(?:\+|-)?\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 Color3(new RGBA(r, g, b));
- }
- return parseNamedKeyword(css);
- }
- CSS2.parse = parse5;
- function parseNamedKeyword(css) {
- switch (css) {
- case "aliceblue":
- return new Color3(new RGBA(240, 248, 255, 1));
- case "antiquewhite":
- return new Color3(new RGBA(250, 235, 215, 1));
- case "aqua":
- return new Color3(new RGBA(0, 255, 255, 1));
- case "aquamarine":
- return new Color3(new RGBA(127, 255, 212, 1));
- case "azure":
- return new Color3(new RGBA(240, 255, 255, 1));
- case "beige":
- return new Color3(new RGBA(245, 245, 220, 1));
- case "bisque":
- return new Color3(new RGBA(255, 228, 196, 1));
- case "black":
- return new Color3(new RGBA(0, 0, 0, 1));
- case "blanchedalmond":
- return new Color3(new RGBA(255, 235, 205, 1));
- case "blue":
- return new Color3(new RGBA(0, 0, 255, 1));
- case "blueviolet":
- return new Color3(new RGBA(138, 43, 226, 1));
- case "brown":
- return new Color3(new RGBA(165, 42, 42, 1));
- case "burlywood":
- return new Color3(new RGBA(222, 184, 135, 1));
- case "cadetblue":
- return new Color3(new RGBA(95, 158, 160, 1));
- case "chartreuse":
- return new Color3(new RGBA(127, 255, 0, 1));
- case "chocolate":
- return new Color3(new RGBA(210, 105, 30, 1));
- case "coral":
- return new Color3(new RGBA(255, 127, 80, 1));
- case "cornflowerblue":
- return new Color3(new RGBA(100, 149, 237, 1));
- case "cornsilk":
- return new Color3(new RGBA(255, 248, 220, 1));
- case "crimson":
- return new Color3(new RGBA(220, 20, 60, 1));
- case "cyan":
- return new Color3(new RGBA(0, 255, 255, 1));
- case "darkblue":
- return new Color3(new RGBA(0, 0, 139, 1));
- case "darkcyan":
- return new Color3(new RGBA(0, 139, 139, 1));
- case "darkgoldenrod":
- return new Color3(new RGBA(184, 134, 11, 1));
- case "darkgray":
- return new Color3(new RGBA(169, 169, 169, 1));
- case "darkgreen":
- return new Color3(new RGBA(0, 100, 0, 1));
- case "darkgrey":
- return new Color3(new RGBA(169, 169, 169, 1));
- case "darkkhaki":
- return new Color3(new RGBA(189, 183, 107, 1));
- case "darkmagenta":
- return new Color3(new RGBA(139, 0, 139, 1));
- case "darkolivegreen":
- return new Color3(new RGBA(85, 107, 47, 1));
- case "darkorange":
- return new Color3(new RGBA(255, 140, 0, 1));
- case "darkorchid":
- return new Color3(new RGBA(153, 50, 204, 1));
- case "darkred":
- return new Color3(new RGBA(139, 0, 0, 1));
- case "darksalmon":
- return new Color3(new RGBA(233, 150, 122, 1));
- case "darkseagreen":
- return new Color3(new RGBA(143, 188, 143, 1));
- case "darkslateblue":
- return new Color3(new RGBA(72, 61, 139, 1));
- case "darkslategray":
- return new Color3(new RGBA(47, 79, 79, 1));
- case "darkslategrey":
- return new Color3(new RGBA(47, 79, 79, 1));
- case "darkturquoise":
- return new Color3(new RGBA(0, 206, 209, 1));
- case "darkviolet":
- return new Color3(new RGBA(148, 0, 211, 1));
- case "deeppink":
- return new Color3(new RGBA(255, 20, 147, 1));
- case "deepskyblue":
- return new Color3(new RGBA(0, 191, 255, 1));
- case "dimgray":
- return new Color3(new RGBA(105, 105, 105, 1));
- case "dimgrey":
- return new Color3(new RGBA(105, 105, 105, 1));
- case "dodgerblue":
- return new Color3(new RGBA(30, 144, 255, 1));
- case "firebrick":
- return new Color3(new RGBA(178, 34, 34, 1));
- case "floralwhite":
- return new Color3(new RGBA(255, 250, 240, 1));
- case "forestgreen":
- return new Color3(new RGBA(34, 139, 34, 1));
- case "fuchsia":
- return new Color3(new RGBA(255, 0, 255, 1));
- case "gainsboro":
- return new Color3(new RGBA(220, 220, 220, 1));
- case "ghostwhite":
- return new Color3(new RGBA(248, 248, 255, 1));
- case "gold":
- return new Color3(new RGBA(255, 215, 0, 1));
- case "goldenrod":
- return new Color3(new RGBA(218, 165, 32, 1));
- case "gray":
- return new Color3(new RGBA(128, 128, 128, 1));
- case "green":
- return new Color3(new RGBA(0, 128, 0, 1));
- case "greenyellow":
- return new Color3(new RGBA(173, 255, 47, 1));
- case "grey":
- return new Color3(new RGBA(128, 128, 128, 1));
- case "honeydew":
- return new Color3(new RGBA(240, 255, 240, 1));
- case "hotpink":
- return new Color3(new RGBA(255, 105, 180, 1));
- case "indianred":
- return new Color3(new RGBA(205, 92, 92, 1));
- case "indigo":
- return new Color3(new RGBA(75, 0, 130, 1));
- case "ivory":
- return new Color3(new RGBA(255, 255, 240, 1));
- case "khaki":
- return new Color3(new RGBA(240, 230, 140, 1));
- case "lavender":
- return new Color3(new RGBA(230, 230, 250, 1));
- case "lavenderblush":
- return new Color3(new RGBA(255, 240, 245, 1));
- case "lawngreen":
- return new Color3(new RGBA(124, 252, 0, 1));
- case "lemonchiffon":
- return new Color3(new RGBA(255, 250, 205, 1));
- case "lightblue":
- return new Color3(new RGBA(173, 216, 230, 1));
- case "lightcoral":
- return new Color3(new RGBA(240, 128, 128, 1));
- case "lightcyan":
- return new Color3(new RGBA(224, 255, 255, 1));
- case "lightgoldenrodyellow":
- return new Color3(new RGBA(250, 250, 210, 1));
- case "lightgray":
- return new Color3(new RGBA(211, 211, 211, 1));
- case "lightgreen":
- return new Color3(new RGBA(144, 238, 144, 1));
- case "lightgrey":
- return new Color3(new RGBA(211, 211, 211, 1));
- case "lightpink":
- return new Color3(new RGBA(255, 182, 193, 1));
- case "lightsalmon":
- return new Color3(new RGBA(255, 160, 122, 1));
- case "lightseagreen":
- return new Color3(new RGBA(32, 178, 170, 1));
- case "lightskyblue":
- return new Color3(new RGBA(135, 206, 250, 1));
- case "lightslategray":
- return new Color3(new RGBA(119, 136, 153, 1));
- case "lightslategrey":
- return new Color3(new RGBA(119, 136, 153, 1));
- case "lightsteelblue":
- return new Color3(new RGBA(176, 196, 222, 1));
- case "lightyellow":
- return new Color3(new RGBA(255, 255, 224, 1));
- case "lime":
- return new Color3(new RGBA(0, 255, 0, 1));
- case "limegreen":
- return new Color3(new RGBA(50, 205, 50, 1));
- case "linen":
- return new Color3(new RGBA(250, 240, 230, 1));
- case "magenta":
- return new Color3(new RGBA(255, 0, 255, 1));
- case "maroon":
- return new Color3(new RGBA(128, 0, 0, 1));
- case "mediumaquamarine":
- return new Color3(new RGBA(102, 205, 170, 1));
- case "mediumblue":
- return new Color3(new RGBA(0, 0, 205, 1));
- case "mediumorchid":
- return new Color3(new RGBA(186, 85, 211, 1));
- case "mediumpurple":
- return new Color3(new RGBA(147, 112, 219, 1));
- case "mediumseagreen":
- return new Color3(new RGBA(60, 179, 113, 1));
- case "mediumslateblue":
- return new Color3(new RGBA(123, 104, 238, 1));
- case "mediumspringgreen":
- return new Color3(new RGBA(0, 250, 154, 1));
- case "mediumturquoise":
- return new Color3(new RGBA(72, 209, 204, 1));
- case "mediumvioletred":
- return new Color3(new RGBA(199, 21, 133, 1));
- case "midnightblue":
- return new Color3(new RGBA(25, 25, 112, 1));
- case "mintcream":
- return new Color3(new RGBA(245, 255, 250, 1));
- case "mistyrose":
- return new Color3(new RGBA(255, 228, 225, 1));
- case "moccasin":
- return new Color3(new RGBA(255, 228, 181, 1));
- case "navajowhite":
- return new Color3(new RGBA(255, 222, 173, 1));
- case "navy":
- return new Color3(new RGBA(0, 0, 128, 1));
- case "oldlace":
- return new Color3(new RGBA(253, 245, 230, 1));
- case "olive":
- return new Color3(new RGBA(128, 128, 0, 1));
- case "olivedrab":
- return new Color3(new RGBA(107, 142, 35, 1));
- case "orange":
- return new Color3(new RGBA(255, 165, 0, 1));
- case "orangered":
- return new Color3(new RGBA(255, 69, 0, 1));
- case "orchid":
- return new Color3(new RGBA(218, 112, 214, 1));
- case "palegoldenrod":
- return new Color3(new RGBA(238, 232, 170, 1));
- case "palegreen":
- return new Color3(new RGBA(152, 251, 152, 1));
- case "paleturquoise":
- return new Color3(new RGBA(175, 238, 238, 1));
- case "palevioletred":
- return new Color3(new RGBA(219, 112, 147, 1));
- case "papayawhip":
- return new Color3(new RGBA(255, 239, 213, 1));
- case "peachpuff":
- return new Color3(new RGBA(255, 218, 185, 1));
- case "peru":
- return new Color3(new RGBA(205, 133, 63, 1));
- case "pink":
- return new Color3(new RGBA(255, 192, 203, 1));
- case "plum":
- return new Color3(new RGBA(221, 160, 221, 1));
- case "powderblue":
- return new Color3(new RGBA(176, 224, 230, 1));
- case "purple":
- return new Color3(new RGBA(128, 0, 128, 1));
- case "rebeccapurple":
- return new Color3(new RGBA(102, 51, 153, 1));
- case "red":
- return new Color3(new RGBA(255, 0, 0, 1));
- case "rosybrown":
- return new Color3(new RGBA(188, 143, 143, 1));
- case "royalblue":
- return new Color3(new RGBA(65, 105, 225, 1));
- case "saddlebrown":
- return new Color3(new RGBA(139, 69, 19, 1));
- case "salmon":
- return new Color3(new RGBA(250, 128, 114, 1));
- case "sandybrown":
- return new Color3(new RGBA(244, 164, 96, 1));
- case "seagreen":
- return new Color3(new RGBA(46, 139, 87, 1));
- case "seashell":
- return new Color3(new RGBA(255, 245, 238, 1));
- case "sienna":
- return new Color3(new RGBA(160, 82, 45, 1));
- case "silver":
- return new Color3(new RGBA(192, 192, 192, 1));
- case "skyblue":
- return new Color3(new RGBA(135, 206, 235, 1));
- case "slateblue":
- return new Color3(new RGBA(106, 90, 205, 1));
- case "slategray":
- return new Color3(new RGBA(112, 128, 144, 1));
- case "slategrey":
- return new Color3(new RGBA(112, 128, 144, 1));
- case "snow":
- return new Color3(new RGBA(255, 250, 250, 1));
- case "springgreen":
- return new Color3(new RGBA(0, 255, 127, 1));
- case "steelblue":
- return new Color3(new RGBA(70, 130, 180, 1));
- case "tan":
- return new Color3(new RGBA(210, 180, 140, 1));
- case "teal":
- return new Color3(new RGBA(0, 128, 128, 1));
- case "thistle":
- return new Color3(new RGBA(216, 191, 216, 1));
- case "tomato":
- return new Color3(new RGBA(255, 99, 71, 1));
- case "turquoise":
- return new Color3(new RGBA(64, 224, 208, 1));
- case "violet":
- return new Color3(new RGBA(238, 130, 238, 1));
- case "wheat":
- return new Color3(new RGBA(245, 222, 179, 1));
- case "white":
- return new Color3(new RGBA(255, 255, 255, 1));
- case "whitesmoke":
- return new Color3(new RGBA(245, 245, 245, 1));
- case "yellow":
- return new Color3(new RGBA(255, 255, 0, 1));
- case "yellowgreen":
- return new Color3(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 Color3(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 Color3(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 Color3(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 Color3(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;
- }
- })(Format.CSS || (Format.CSS = {}));
- })(Color3.Format || (Color3.Format = {}));
- })(Color || (Color = {}));
- }
-});
-
-// ../node_modules/monaco-editor/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(transform2, theme) {
- switch (transform2.op) {
- case 0:
- return resolveColorValue(transform2.value, theme)?.darken(transform2.factor);
- case 1:
- return resolveColorValue(transform2.value, theme)?.lighten(transform2.factor);
- case 2:
- return resolveColorValue(transform2.value, theme)?.transparent(transform2.factor);
- case 7: {
- const primaryColor = resolveColorValue(transform2.color, theme) || Color.transparent;
- const otherColor = resolveColorValue(transform2.with, theme) || Color.transparent;
- return primaryColor.mix(otherColor, transform2.ratio);
- }
- case 3: {
- const backgroundColor = resolveColorValue(transform2.background, theme);
- if (!backgroundColor) {
- return resolveColorValue(transform2.value, theme);
- }
- return resolveColorValue(transform2.value, theme)?.makeOpaque(backgroundColor);
- }
- case 4:
- for (const candidate of transform2.values) {
- const color = resolveColorValue(candidate, theme);
- if (color) {
- return color;
- }
- }
- return void 0;
- case 6:
- return resolveColorValue(theme.defines(transform2.if) ? transform2.then : transform2.else, theme);
- case 5: {
- const from = resolveColorValue(transform2.value, theme);
- if (!from) {
- return void 0;
- }
- const backgroundColor = resolveColorValue(transform2.background, theme);
- if (!backgroundColor) {
- return from.transparent(transform2.factor * transform2.transparency);
- }
- return from.isDarkerThan(backgroundColor) ? Color.getLighterColor(from, backgroundColor, transform2.factor).transparent(transform2.transparency) : Color.getDarkerColor(from, backgroundColor, transform2.factor).transparent(transform2.transparency);
- }
- default:
- throw assertNever();
- }
-}
-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/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/esm/vs/platform/theme/common/colors/baseColors.js
-var foreground, descriptionForeground, iconForeground, focusBorder, contrastBorder, activeContrastBorder, textLinkForeground;
-var init_baseColors = __esm({
- "../node_modules/monaco-editor/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."));
- 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."));
- 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."));
- 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."));
- 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."));
- registerColor("textSeparator.foreground", { light: "#0000002e", dark: "#ffffff2e", hcDark: Color.black, hcLight: "#292929" }, localize(1784, "Color for text separators."));
- registerColor("textPreformat.foreground", { light: "#A31515", dark: "#D7BA7D", hcDark: "#000000", hcLight: "#FFFFFF" }, localize(1785, "Foreground color for preformatted text segments."));
- registerColor("textPreformat.background", { light: "#0000001A", dark: "#FFFFFF1A", hcDark: "#FFFFFF", hcLight: "#09345f" }, localize(1786, "Background color for preformatted text segments."));
- registerColor("textBlockQuote.background", { light: "#f2f2f2", dark: "#222222", hcDark: null, hcLight: "#F2F2F2" }, localize(1787, "Background color for block quotes in text."));
- registerColor("textBlockQuote.border", { light: "#007acc80", dark: "#007acc80", hcDark: Color.white, hcLight: "#292929" }, localize(1788, "Border color for block quotes in text."));
- 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/esm/vs/platform/theme/common/colors/miscColors.js
-var badgeBackground, badgeForeground, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, progressBarBackground;
-var init_miscColors = __esm({
- "../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/miscColors.js"() {
- init_nls();
- init_color();
- init_colorUtils();
- init_baseColors();
- 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."));
- 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"));
- registerColor("activityWarningBadge.background", { dark: "#CCA700", light: "#BF8803", hcDark: null, hcLight: "#CCA700" }, localize(1998, "Background color of the warning activity badge"));
- 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"));
- 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."));
- 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."));
- registerColor("chart.line", { dark: "#236B8E", light: "#236B8E", hcDark: "#236B8E", hcLight: "#236B8E" }, localize(2007, "Line color for the chart."));
- 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."));
- 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/esm/vs/platform/theme/common/colors/editorColors.js
-var editorBackground, editorForeground, editorWidgetBackground, editorWidgetForeground, editorWidgetBorder, editorErrorForeground, editorErrorBorder, editorWarningBackground, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder, editorHintForeground, editorActiveLinkForeground, editorSelectionBackground, editorSelectionForeground, editorInactiveSelection, editorSelectionHighlight, editorFindMatchForeground, editorFindMatchHighlight, editorFindMatchHighlightForeground, editorFindMatchHighlightBorder, editorFindRangeHighlightBorder, editorHoverBackground, editorHoverForeground, editorHoverBorder, editorInlayHintForeground, editorInlayHintBackground, editorInlayHintTypeForeground, editorInlayHintTypeBackground, editorInlayHintParameterForeground, editorInlayHintParameterBackground, editorLightBulbForeground, defaultInsertColor, defaultRemoveColor, diffInserted, diffRemoved, diffInsertedLine, diffOverviewRulerInserted, diffOverviewRulerRemoved, widgetShadow, widgetBorder, toolbarHoverBackground, breadcrumbsForeground, breadcrumbsBackground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, headerTransparency, currentBaseColor, incomingBaseColor, commonBaseColor, contentTransparency, rulerTransparency, mergeCurrentHeaderBackground, mergeIncomingHeaderBackground, mergeCommonHeaderBackground, mergeBorder, overviewRulerFindMatchForeground, overviewRulerSelectionHighlightForeground, problemsErrorIconForeground, problemsWarningIconForeground, problemsInfoIconForeground;
-var init_editorColors = __esm({
- "../node_modules/monaco-editor/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."));
- registerColor("editorStickyScroll.background", editorBackground, localize(1800, "Background color of sticky scroll in the editor"));
- registerColor("editorStickyScrollGutter.background", editorBackground, localize(1801, "Background color of the gutter part of sticky scroll in the editor"));
- 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"));
- registerColor("editorStickyScroll.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1803, "Border color of sticky scroll in the editor"));
- 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."));
- 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."));
- 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."));
- 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."));
- 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);
- registerColor("editor.selectionHighlightBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1825, "Border color for regions with the same content as the selection."));
- registerColor("editor.compositionBorder", { light: "#000000", dark: "#ffffff", hcLight: "#000000", hcDark: "#ffffff" }, localize(1826, "The border color for an IME composition."));
- 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);
- 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);
- 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);
- 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."));
- 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."));
- registerColor("editorLightBulbAutoFix.foreground", { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" }, localize(1847, "The color used for the lightbulb auto fix actions icon."));
- registerColor("editorLightBulbAi.foreground", editorLightBulbForeground, localize(1848, "The color used for the lightbulb AI icon."));
- 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."));
- registerColor("editor.snippetTabstopHighlightBorder", null, localize(1850, "Highlight border color of a snippet tabstop."));
- registerColor("editor.snippetFinalTabstopHighlightBackground", null, localize(1851, "Highlight background color of the final tabstop of a snippet."));
- 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);
- 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);
- registerColor("diffEditorGutter.insertedLineBackground", null, localize(1857, "Background color for the margin where lines got inserted."));
- 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."));
- registerColor("diffEditor.insertedTextBorder", { dark: null, light: null, hcDark: "#33ff2eff", hcLight: "#374E06" }, localize(1861, "Outline color for the text that got inserted."));
- registerColor("diffEditor.removedTextBorder", { dark: null, light: null, hcDark: "#FF008F", hcLight: "#AD0707" }, localize(1862, "Outline color for text that got removed."));
- registerColor("diffEditor.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1863, "Border color between the two text editors."));
- 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."));
- registerColor("diffEditor.unchangedRegionBackground", "sideBar.background", localize(1865, "The background color of unchanged blocks in the diff editor."));
- registerColor("diffEditor.unchangedRegionForeground", "foreground", localize(1866, "The foreground color of unchanged blocks in the diff editor."));
- 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"));
- registerColor("toolbar.hoverOutline", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1871, "Toolbar outline when hovering over actions using the mouse"));
- 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."));
- 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);
- 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);
- 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);
- 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."));
- 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."));
- 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."));
- 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/esm/vs/platform/theme/common/colors/minimapColors.js
-var minimapFindMatch, minimapSelectionOccurrenceHighlight, minimapSelection, minimapInfo, minimapWarning, minimapError, minimapBackground, minimapForegroundOpacity;
-var init_minimapColors = __esm({
- "../node_modules/monaco-editor/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.'));
- registerColor("minimapSlider.background", transparent(scrollbarSliderBackground, 0.5), localize(1991, "Minimap slider background color."));
- registerColor("minimapSlider.hoverBackground", transparent(scrollbarSliderHoverBackground, 0.5), localize(1992, "Minimap slider background color when hovering."));
- registerColor("minimapSlider.activeBackground", transparent(scrollbarSliderActiveBackground, 0.5), localize(1993, "Minimap slider background color when clicked on."));
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/chartsColors.js
-var init_chartsColors = __esm({
- "../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/chartsColors.js"() {
- init_nls();
- init_colorUtils();
- init_baseColors();
- init_editorColors();
- init_minimapColors();
- registerColor("charts.foreground", foreground, localize(1790, "The foreground color used in charts."));
- registerColor("charts.lines", transparent(foreground, 0.5), localize(1791, "The color used for horizontal lines in charts."));
- registerColor("charts.red", editorErrorForeground, localize(1792, "The red color used in chart visualizations."));
- registerColor("charts.blue", editorInfoForeground, localize(1793, "The blue color used in chart visualizations."));
- registerColor("charts.yellow", editorWarningForeground, localize(1794, "The yellow color used in chart visualizations."));
- registerColor("charts.orange", minimapFindMatch, localize(1795, "The orange color used in chart visualizations."));
- registerColor("charts.green", { dark: "#89D185", light: "#388A34", hcDark: "#89D185", hcLight: "#374e06" }, localize(1796, "The green color used in chart visualizations."));
- registerColor("charts.purple", { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" }, localize(1797, "The purple color used in chart visualizations."));
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/inputColors.js
-var inputBackground, inputForeground, inputBorder, inputActiveOptionBorder, inputActiveOptionHoverBackground, inputActiveOptionBackground, inputActiveOptionForeground, 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, checkboxForeground, checkboxBorder, checkboxDisabledBackground, checkboxDisabledForeground, keybindingLabelBackground, keybindingLabelForeground, keybindingLabelBorder, keybindingLabelBottomBorder;
-var init_inputColors = __esm({
- "../node_modules/monaco-editor/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."));
- 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."));
- 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."));
- 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/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, listFilterWidgetBackground, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetShadow, treeIndentGuidesStroke, treeInactiveIndentGuidesStroke, tableColumnsBorder, tableOddRowsBackgroundColor, editorActionListForeground;
-var init_listColors = __esm({
- "../node_modules/monaco-editor/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."));
- 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."));
- registerColor("list.errorForeground", { dark: "#F88070", light: "#B01011", hcDark: null, hcLight: null }, localize(1959, "Foreground color of list items containing errors."));
- 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."));
- registerColor("list.filterMatchBackground", { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, localize(1965, "Background color of the filtered match."));
- registerColor("list.filterMatchBorder", { dark: editorFindMatchHighlightBorder, light: editorFindMatchHighlightBorder, hcDark: contrastBorder, hcLight: activeContrastBorder }, localize(1966, "Border color of the filtered match."));
- 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."));
- registerColor("editorActionList.background", editorWidgetBackground, localize(1972, "Action List background color."));
- editorActionListForeground = registerColor("editorActionList.foreground", editorWidgetForeground, localize(1973, "Action List foreground color."));
- registerColor("editorActionList.focusForeground", listActiveSelectionForeground, localize(1974, "Action List foreground color for the focused item."));
- registerColor("editorActionList.focusBackground", listActiveSelectionBackground, localize(1975, "Action List background color for the focused item."));
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/menuColors.js
-var menuBorder, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuSeparatorBackground;
-var init_menuColors = __esm({
- "../node_modules/monaco-editor/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/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/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/esm/vs/platform/theme/common/colors/searchColors.js
-var init_searchColors = __esm({
- "../node_modules/monaco-editor/esm/vs/platform/theme/common/colors/searchColors.js"() {
- init_nls();
- init_colorUtils();
- init_baseColors();
- init_editorColors();
- 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."));
- 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."));
- 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/esm/vs/editor/browser/editorDom.js
-function createEditorPagePosition(editorViewDomNode) {
- const editorPos = getDomNodePagePosition(editorViewDomNode);
- return new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);
-}
-function createCoordinatesRelativeToEditor(editorViewDomNode, editorPagePosition, pos) {
- const scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;
- const scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;
- const relativeX = (pos.x - editorPagePosition.x) / scaleX;
- const relativeY = (pos.y - editorPagePosition.y) / scaleY;
- return new CoordinatesRelativeToEditor(relativeX, relativeY);
-}
-function camelToDashes(str) {
- return str.replace(/(^[A-Z])/, ([first2]) => first2.toLowerCase()).replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);
-}
-var PageCoordinates, ClientCoordinates, EditorPagePosition, CoordinatesRelativeToEditor, EditorMouseEvent, EditorMouseEventFactory, EditorPointerEventFactory, GlobalEditorPointerMoveMonitor, DynamicCssRules, RefCountedCssRule;
-var init_editorDom = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js"() {
- init_dom();
- init_domStylesheets();
- init_globalPointerMoveMonitor();
- init_mouseEvent();
- init_async();
- init_lifecycle();
- init_colorUtils();
- init_baseColors();
- init_chartsColors();
- init_editorColors();
- init_inputColors();
- init_listColors();
- init_menuColors();
- init_minimapColors();
- init_miscColors();
- init_quickpickColors();
- init_searchColors();
- PageCoordinates = class {
- constructor(x, y) {
- this.x = x;
- this.y = y;
- this._pageCoordinatesBrand = void 0;
- }
- toClientCoordinates(targetWindow) {
- return new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);
- }
- };
- ClientCoordinates = class {
- constructor(clientX, clientY) {
- this.clientX = clientX;
- this.clientY = clientY;
- this._clientCoordinatesBrand = void 0;
- }
- toPageCoordinates(targetWindow) {
- return new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);
- }
- };
- EditorPagePosition = class {
- constructor(x, y, width2, height) {
- this.x = x;
- this.y = y;
- this.width = width2;
- this.height = height;
- this._editorPagePositionBrand = void 0;
- }
- };
- CoordinatesRelativeToEditor = class {
- constructor(x, y) {
- this.x = x;
- this.y = y;
- this._positionRelativeToEditorBrand = void 0;
- }
- };
- EditorMouseEvent = class extends StandardMouseEvent {
- constructor(e, isFromPointerCapture, editorViewDomNode) {
- super(getWindow(editorViewDomNode), e);
- this._editorMouseEventBrand = void 0;
- this.isFromPointerCapture = isFromPointerCapture;
- this.pos = new PageCoordinates(this.posx, this.posy);
- this.editorPos = createEditorPagePosition(editorViewDomNode);
- this.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);
- }
- };
- EditorMouseEventFactory = class {
- constructor(editorViewDomNode) {
- this._editorViewDomNode = editorViewDomNode;
- }
- _create(e) {
- return new EditorMouseEvent(e, false, this._editorViewDomNode);
- }
- onContextMenu(target, callback) {
- return addDisposableListener(target, EventType.CONTEXT_MENU, (e) => {
- callback(this._create(e));
- });
- }
- onMouseUp(target, callback) {
- return addDisposableListener(target, EventType.MOUSE_UP, (e) => {
- callback(this._create(e));
- });
- }
- onMouseDown(target, callback) {
- return addDisposableListener(target, EventType.MOUSE_DOWN, (e) => {
- callback(this._create(e));
- });
- }
- onPointerDown(target, callback) {
- return addDisposableListener(target, EventType.POINTER_DOWN, (e) => {
- callback(this._create(e), e.pointerId);
- });
- }
- onMouseLeave(target, callback) {
- return addDisposableListener(target, EventType.MOUSE_LEAVE, (e) => {
- callback(this._create(e));
- });
- }
- onMouseMove(target, callback) {
- return addDisposableListener(target, EventType.MOUSE_MOVE, (e) => callback(this._create(e)));
- }
- };
- EditorPointerEventFactory = class {
- constructor(editorViewDomNode) {
- this._editorViewDomNode = editorViewDomNode;
- }
- _create(e) {
- return new EditorMouseEvent(e, false, this._editorViewDomNode);
- }
- onPointerUp(target, callback) {
- return addDisposableListener(target, "pointerup", (e) => {
- callback(this._create(e));
- });
- }
- onPointerDown(target, callback) {
- return addDisposableListener(target, EventType.POINTER_DOWN, (e) => {
- callback(this._create(e), e.pointerId);
- });
- }
- onPointerLeave(target, callback) {
- return addDisposableListener(target, EventType.POINTER_LEAVE, (e) => {
- callback(this._create(e));
- });
- }
- onPointerMove(target, callback) {
- return addDisposableListener(target, "pointermove", (e) => callback(this._create(e)));
- }
- };
- GlobalEditorPointerMoveMonitor = class extends Disposable {
- constructor(editorViewDomNode) {
- super();
- this._editorViewDomNode = editorViewDomNode;
- this._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());
- this._keydownListener = null;
- }
- startMonitoring(initialElement, pointerId, initialButtons, pointerMoveCallback, onStopCallback) {
- this._keydownListener = addStandardDisposableListener(initialElement.ownerDocument, "keydown", (e) => {
- const chord = e.toKeyCodeChord();
- if (chord.isModifierKey()) {
- return;
- }
- this._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);
- }, true);
- this._globalPointerMoveMonitor.startMonitoring(initialElement, pointerId, initialButtons, (e) => {
- pointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));
- }, (e) => {
- this._keydownListener.dispose();
- onStopCallback(e);
- });
- }
- stopMonitoring() {
- this._globalPointerMoveMonitor.stopMonitoring(true);
- }
- };
- DynamicCssRules = class _DynamicCssRules {
- static {
- this._idPool = 0;
- }
- constructor(_editor) {
- this._editor = _editor;
- this._instanceId = ++_DynamicCssRules._idPool;
- this._counter = 0;
- this._rules = new DisposableMap();
- this._garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1e3);
- }
- dispose() {
- this._rules.dispose();
- this._garbageCollectionScheduler.dispose();
- }
- createClassNameRef(options) {
- const rule = this.getOrCreateRule(options);
- rule.increaseRefCount();
- return {
- className: rule.className,
- dispose: () => {
- rule.decreaseRefCount();
- this._garbageCollectionScheduler.schedule();
- }
- };
- }
- getOrCreateRule(properties) {
- const key = this.computeUniqueKey(properties);
- let existingRule = this._rules.get(key);
- if (!existingRule) {
- const counter = this._counter++;
- existingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`, isInShadowDOM(this._editor.getContainerDomNode()) ? this._editor.getContainerDomNode() : void 0, properties);
- this._rules.set(key, existingRule);
- }
- return existingRule;
- }
- computeUniqueKey(properties) {
- return JSON.stringify(properties);
- }
- garbageCollect() {
- for (const rule of this._rules.values()) {
- if (!rule.hasReferences()) {
- this._rules.deleteAndDispose(rule.key);
- }
- }
- }
- };
- RefCountedCssRule = class {
- constructor(key, className2, _containerElement, properties) {
- this.key = key;
- this.className = className2;
- this.properties = properties;
- this._referenceCount = 0;
- this._styleElementDisposables = new DisposableStore();
- this._styleElement = createStyleSheet(_containerElement, void 0, this._styleElementDisposables);
- this._styleElement.textContent = this.getCssText(this.className, this.properties);
- }
- getCssText(className2, properties) {
- let str = `.${className2} {`;
- for (const prop in properties) {
- const value = properties[prop];
- let cssValue;
- if (typeof value === "object") {
- cssValue = asCssVariable(value.id);
- } else {
- cssValue = value;
- }
- const cssPropName = camelToDashes(prop);
- str += `
- ${cssPropName}: ${cssValue};`;
- }
- str += `
-}`;
- return str;
- }
- dispose() {
- this._styleElementDisposables.dispose();
- this._styleElement = void 0;
- }
- increaseRefCount() {
- this._referenceCount++;
- }
- decreaseRefCount() {
- this._referenceCount--;
- }
- hasReferences() {
- return this._referenceCount > 0;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewEventHandler.js
-var ViewEventHandler;
-var init_viewEventHandler = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewEventHandler.js"() {
- init_lifecycle();
- ViewEventHandler = class extends Disposable {
- constructor() {
- super();
- this._shouldRender = true;
- }
- shouldRender() {
- return this._shouldRender;
- }
- forceShouldRender() {
- this._shouldRender = true;
- }
- setShouldRender() {
- this._shouldRender = true;
- }
- onDidRender() {
- this._shouldRender = false;
- }
- // --- begin event handlers
- onCompositionStart(e) {
- return false;
- }
- onCompositionEnd(e) {
- return false;
- }
- onConfigurationChanged(e) {
- return false;
- }
- onCursorStateChanged(e) {
- return false;
- }
- onDecorationsChanged(e) {
- return false;
- }
- onFlushed(e) {
- return false;
- }
- onFocusChanged(e) {
- return false;
- }
- onLanguageConfigurationChanged(e) {
- return false;
- }
- onLineMappingChanged(e) {
- return false;
- }
- onLinesChanged(e) {
- return false;
- }
- onLinesDeleted(e) {
- return false;
- }
- onLinesInserted(e) {
- return false;
- }
- onRevealRangeRequest(e) {
- return false;
- }
- onScrollChanged(e) {
- return false;
- }
- onThemeChanged(e) {
- return false;
- }
- onTokensChanged(e) {
- return false;
- }
- onTokensColorsChanged(e) {
- return false;
- }
- onZonesChanged(e) {
- return false;
- }
- // --- end event handlers
- handleEvents(events) {
- let shouldRender = false;
- for (let i2 = 0, len = events.length; i2 < len; i2++) {
- const e = events[i2];
- switch (e.type) {
- case 0:
- if (this.onCompositionStart(e)) {
- shouldRender = true;
- }
- break;
- case 1:
- if (this.onCompositionEnd(e)) {
- shouldRender = true;
- }
- break;
- case 2:
- if (this.onConfigurationChanged(e)) {
- shouldRender = true;
- }
- break;
- case 3:
- if (this.onCursorStateChanged(e)) {
- shouldRender = true;
- }
- break;
- case 4:
- if (this.onDecorationsChanged(e)) {
- shouldRender = true;
- }
- break;
- case 5:
- if (this.onFlushed(e)) {
- shouldRender = true;
- }
- break;
- case 6:
- if (this.onFocusChanged(e)) {
- shouldRender = true;
- }
- break;
- case 7:
- if (this.onLanguageConfigurationChanged(e)) {
- shouldRender = true;
- }
- break;
- case 8:
- if (this.onLineMappingChanged(e)) {
- shouldRender = true;
- }
- break;
- case 9:
- if (this.onLinesChanged(e)) {
- shouldRender = true;
- }
- break;
- case 10:
- if (this.onLinesDeleted(e)) {
- shouldRender = true;
- }
- break;
- case 11:
- if (this.onLinesInserted(e)) {
- shouldRender = true;
- }
- break;
- case 12:
- if (this.onRevealRangeRequest(e)) {
- shouldRender = true;
- }
- break;
- case 13:
- if (this.onScrollChanged(e)) {
- shouldRender = true;
- }
- break;
- case 15:
- if (this.onTokensChanged(e)) {
- shouldRender = true;
- }
- break;
- case 14:
- if (this.onThemeChanged(e)) {
- shouldRender = true;
- }
- break;
- case 16:
- if (this.onTokensColorsChanged(e)) {
- shouldRender = true;
- }
- break;
- case 17:
- if (this.onZonesChanged(e)) {
- shouldRender = true;
- }
- break;
- default:
- console.info("View received unknown event: ");
- console.info(e);
- }
- }
- if (shouldRender) {
- this._shouldRender = true;
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js
-var ViewPart, PartFingerprints;
-var init_viewPart = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"() {
- init_viewEventHandler();
- ViewPart = class extends ViewEventHandler {
- constructor(context) {
- super();
- this._context = context;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- super.dispose();
- }
- };
- PartFingerprints = class {
- static write(target, partId) {
- target.setAttribute("data-mprt", String(partId));
- }
- static read(target) {
- const r = target.getAttribute("data-mprt");
- if (r === null) {
- return 0;
- }
- return parseInt(r, 10);
- }
- static collect(child, stopAt) {
- const result = [];
- let resultLen = 0;
- while (child && child !== child.ownerDocument.body) {
- if (child === stopAt) {
- break;
- }
- if (child.nodeType === child.ELEMENT_NODE) {
- result[resultLen++] = this.read(child);
- }
- child = child.parentElement;
- }
- const r = new Uint8Array(resultLen);
- for (let i2 = 0; i2 < resultLen; i2++) {
- r[i2] = result[resultLen - i2 - 1];
- }
- return r;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/renderingContext.js
-var RestrictedRenderingContext, RenderingContext, LineVisibleRanges, HorizontalRange, FloatHorizontalRange, HorizontalPosition, VisibleRanges;
-var init_renderingContext = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/renderingContext.js"() {
- RestrictedRenderingContext = class {
- constructor(viewLayout, viewportData) {
- this._restrictedRenderingContextBrand = void 0;
- this._viewLayout = viewLayout;
- this.viewportData = viewportData;
- this.scrollWidth = this._viewLayout.getScrollWidth();
- this.scrollHeight = this._viewLayout.getScrollHeight();
- this.visibleRange = this.viewportData.visibleRange;
- this.bigNumbersDelta = this.viewportData.bigNumbersDelta;
- const vInfo = this._viewLayout.getCurrentViewport();
- this.scrollTop = vInfo.top;
- this.scrollLeft = vInfo.left;
- this.viewportWidth = vInfo.width;
- this.viewportHeight = vInfo.height;
- }
- getScrolledTopFromAbsoluteTop(absoluteTop) {
- return absoluteTop - this.scrollTop;
- }
- getVerticalOffsetForLineNumber(lineNumber, includeViewZones) {
- return this._viewLayout.getVerticalOffsetForLineNumber(lineNumber, includeViewZones);
- }
- getVerticalOffsetAfterLineNumber(lineNumber, includeViewZones) {
- return this._viewLayout.getVerticalOffsetAfterLineNumber(lineNumber, includeViewZones);
- }
- getLineHeightForLineNumber(lineNumber) {
- return this._viewLayout.getLineHeightForLineNumber(lineNumber);
- }
- getDecorationsInViewport() {
- return this.viewportData.getDecorationsInViewport();
- }
- };
- RenderingContext = class extends RestrictedRenderingContext {
- constructor(viewLayout, viewportData, viewLines, viewLinesGpu) {
- super(viewLayout, viewportData);
- this._renderingContextBrand = void 0;
- this._viewLines = viewLines;
- this._viewLinesGpu = viewLinesGpu;
- }
- linesVisibleRangesForRange(range2, includeNewLines) {
- const domRanges = this._viewLines.linesVisibleRangesForRange(range2, includeNewLines);
- if (!this._viewLinesGpu) {
- return domRanges ?? null;
- }
- const gpuRanges = this._viewLinesGpu.linesVisibleRangesForRange(range2, includeNewLines);
- if (!domRanges) {
- return gpuRanges;
- }
- if (!gpuRanges) {
- return domRanges;
- }
- return domRanges.concat(gpuRanges).sort((a, b) => a.lineNumber - b.lineNumber);
- }
- visibleRangeForPosition(position) {
- return this._viewLines.visibleRangeForPosition(position) ?? this._viewLinesGpu?.visibleRangeForPosition(position) ?? null;
- }
- };
- LineVisibleRanges = class {
- constructor(outsideRenderedLine, lineNumber, ranges, continuesOnNextLine) {
- this.outsideRenderedLine = outsideRenderedLine;
- this.lineNumber = lineNumber;
- this.ranges = ranges;
- this.continuesOnNextLine = continuesOnNextLine;
- }
- };
- HorizontalRange = class _HorizontalRange {
- static from(ranges) {
- const result = new Array(ranges.length);
- for (let i2 = 0, len = ranges.length; i2 < len; i2++) {
- const range2 = ranges[i2];
- result[i2] = new _HorizontalRange(range2.left, range2.width);
- }
- return result;
- }
- constructor(left, width2) {
- this._horizontalRangeBrand = void 0;
- this.left = Math.round(left);
- this.width = Math.round(width2);
- }
- toString() {
- return `[${this.left},${this.width}]`;
- }
- };
- FloatHorizontalRange = class {
- constructor(left, width2) {
- this._floatHorizontalRangeBrand = void 0;
- this.left = left;
- this.width = width2;
- }
- toString() {
- return `[${this.left},${this.width}]`;
- }
- static compare(a, b) {
- return a.left - b.left;
- }
- };
- HorizontalPosition = class {
- constructor(outsideRenderedLine, left) {
- this.outsideRenderedLine = outsideRenderedLine;
- this.originalLeft = left;
- this.left = Math.round(this.originalLeft);
- }
- };
- VisibleRanges = class {
- constructor(outsideRenderedLine, ranges) {
- this.outsideRenderedLine = outsideRenderedLine;
- this.ranges = ranges;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/rangeUtil.js
-var RangeUtil;
-var init_rangeUtil = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/rangeUtil.js"() {
- init_renderingContext();
- RangeUtil = class {
- static _createRange() {
- if (!this._handyReadyRange) {
- this._handyReadyRange = document.createRange();
- }
- return this._handyReadyRange;
- }
- static _detachRange(range2, endNode) {
- range2.selectNodeContents(endNode);
- }
- static _readClientRects(startElement, startOffset, endElement, endOffset, endNode) {
- const range2 = this._createRange();
- try {
- range2.setStart(startElement, startOffset);
- range2.setEnd(endElement, endOffset);
- return range2.getClientRects();
- } catch (e) {
- return null;
- } finally {
- this._detachRange(range2, endNode);
- }
- }
- static _mergeAdjacentRanges(ranges) {
- if (ranges.length === 1) {
- return ranges;
- }
- ranges.sort(FloatHorizontalRange.compare);
- const result = [];
- let resultLen = 0;
- let prev = ranges[0];
- for (let i2 = 1, len = ranges.length; i2 < len; i2++) {
- const range2 = ranges[i2];
- if (prev.left + prev.width + 0.9 >= range2.left) {
- prev.width = Math.max(prev.width, range2.left + range2.width - prev.left);
- } else {
- result[resultLen++] = prev;
- prev = range2;
- }
- }
- result[resultLen++] = prev;
- return result;
- }
- static _createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft, clientRectScale) {
- if (!clientRects || clientRects.length === 0) {
- return null;
- }
- const result = [];
- for (let i2 = 0, len = clientRects.length; i2 < len; i2++) {
- const clientRect = clientRects[i2];
- result[i2] = new FloatHorizontalRange(Math.max(0, (clientRect.left - clientRectDeltaLeft) / clientRectScale), clientRect.width / clientRectScale);
- }
- return this._mergeAdjacentRanges(result);
- }
- static readHorizontalRanges(domNode, startChildIndex, startOffset, endChildIndex, endOffset, context) {
- const min = 0;
- const max = domNode.children.length - 1;
- if (min > max) {
- return null;
- }
- startChildIndex = Math.min(max, Math.max(min, startChildIndex));
- endChildIndex = Math.min(max, Math.max(min, endChildIndex));
- if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0 && !domNode.children[startChildIndex].firstChild) {
- const clientRects2 = domNode.children[startChildIndex].getClientRects();
- context.markDidDomLayout();
- return this._createHorizontalRangesFromClientRects(clientRects2, context.clientRectDeltaLeft, context.clientRectScale);
- }
- if (startChildIndex !== endChildIndex) {
- if (endChildIndex > 0 && endOffset === 0) {
- endChildIndex--;
- endOffset = 1073741824;
- }
- }
- let startElement = domNode.children[startChildIndex].firstChild;
- let endElement = domNode.children[endChildIndex].firstChild;
- if (!startElement || !endElement) {
- if (!startElement && startOffset === 0 && startChildIndex > 0) {
- startElement = domNode.children[startChildIndex - 1].firstChild;
- startOffset = 1073741824;
- }
- if (!endElement && endOffset === 0 && endChildIndex > 0) {
- endElement = domNode.children[endChildIndex - 1].firstChild;
- endOffset = 1073741824;
- }
- }
- if (!startElement || !endElement) {
- return null;
- }
- startOffset = Math.min(startElement.textContent.length, Math.max(0, startOffset));
- endOffset = Math.min(endElement.textContent.length, Math.max(0, endOffset));
- const clientRects = this._readClientRects(startElement, startOffset, endElement, endOffset, context.endNode);
- context.markDidDomLayout();
- return this._createHorizontalRangesFromClientRects(clientRects, context.clientRectDeltaLeft, context.clientRectScale);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js
-var LineDecoration, DecorationSegment, Stack, LineDecorationsNormalizer;
-var init_lineDecorations = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js"() {
- init_strings();
- LineDecoration = class _LineDecoration {
- constructor(startColumn, endColumn, className2, type) {
- this.startColumn = startColumn;
- this.endColumn = endColumn;
- this.className = className2;
- this.type = type;
- this._lineDecorationBrand = void 0;
- }
- static _equals(a, b) {
- return a.startColumn === b.startColumn && a.endColumn === b.endColumn && a.className === b.className && a.type === b.type;
- }
- static equalsArr(a, b) {
- const aLen = a.length;
- const bLen = b.length;
- if (aLen !== bLen) {
- return false;
- }
- for (let i2 = 0; i2 < aLen; i2++) {
- if (!_LineDecoration._equals(a[i2], b[i2])) {
- return false;
- }
- }
- return true;
- }
- static extractWrapped(arr, startOffset, endOffset) {
- if (arr.length === 0) {
- return arr;
- }
- const startColumn = startOffset + 1;
- const endColumn = endOffset + 1;
- const lineLength = endOffset - startOffset;
- const r = [];
- let rLength = 0;
- for (const dec of arr) {
- if (dec.endColumn <= startColumn || dec.startColumn >= endColumn) {
- continue;
- }
- r[rLength++] = new _LineDecoration(Math.max(1, dec.startColumn - startColumn + 1), Math.min(lineLength + 1, dec.endColumn - startColumn + 1), dec.className, dec.type);
- }
- return r;
- }
- static filter(lineDecorations, lineNumber, minLineColumn, maxLineColumn) {
- if (lineDecorations.length === 0) {
- return [];
- }
- const result = [];
- let resultLen = 0;
- for (let i2 = 0, len = lineDecorations.length; i2 < len; i2++) {
- const d = lineDecorations[i2];
- const range2 = d.range;
- if (range2.endLineNumber < lineNumber || range2.startLineNumber > lineNumber) {
- continue;
- }
- if (range2.isEmpty() && (d.type === 0 || d.type === 3)) {
- continue;
- }
- const startColumn = range2.startLineNumber === lineNumber ? range2.startColumn : minLineColumn;
- const endColumn = range2.endLineNumber === lineNumber ? range2.endColumn : maxLineColumn;
- result[resultLen++] = new _LineDecoration(startColumn, endColumn, d.inlineClassName, d.type);
- }
- return result;
- }
- static _typeCompare(a, b) {
- const ORDER = [2, 0, 1, 3];
- return ORDER[a] - ORDER[b];
- }
- static compare(a, b) {
- if (a.startColumn !== b.startColumn) {
- return a.startColumn - b.startColumn;
- }
- if (a.endColumn !== b.endColumn) {
- return a.endColumn - b.endColumn;
- }
- const typeCmp = _LineDecoration._typeCompare(a.type, b.type);
- if (typeCmp !== 0) {
- return typeCmp;
- }
- if (a.className !== b.className) {
- return a.className < b.className ? -1 : 1;
- }
- return 0;
- }
- };
- DecorationSegment = class {
- constructor(startOffset, endOffset, className2, metadata) {
- this.startOffset = startOffset;
- this.endOffset = endOffset;
- this.className = className2;
- this.metadata = metadata;
- }
- };
- Stack = class _Stack {
- constructor() {
- this.stopOffsets = [];
- this.classNames = [];
- this.metadata = [];
- this.count = 0;
- }
- static _metadata(metadata) {
- let result = 0;
- for (let i2 = 0, len = metadata.length; i2 < len; i2++) {
- result |= metadata[i2];
- }
- return result;
- }
- consumeLowerThan(maxStopOffset, nextStartOffset, result) {
- while (this.count > 0 && this.stopOffsets[0] < maxStopOffset) {
- let i2 = 0;
- while (i2 + 1 < this.count && this.stopOffsets[i2] === this.stopOffsets[i2 + 1]) {
- i2++;
- }
- result.push(new DecorationSegment(nextStartOffset, this.stopOffsets[i2], this.classNames.join(" "), _Stack._metadata(this.metadata)));
- nextStartOffset = this.stopOffsets[i2] + 1;
- this.stopOffsets.splice(0, i2 + 1);
- this.classNames.splice(0, i2 + 1);
- this.metadata.splice(0, i2 + 1);
- this.count -= i2 + 1;
- }
- if (this.count > 0 && nextStartOffset < maxStopOffset) {
- result.push(new DecorationSegment(nextStartOffset, maxStopOffset - 1, this.classNames.join(" "), _Stack._metadata(this.metadata)));
- nextStartOffset = maxStopOffset;
- }
- return nextStartOffset;
- }
- insert(stopOffset, className2, metadata) {
- if (this.count === 0 || this.stopOffsets[this.count - 1] <= stopOffset) {
- this.stopOffsets.push(stopOffset);
- this.classNames.push(className2);
- this.metadata.push(metadata);
- } else {
- for (let i2 = 0; i2 < this.count; i2++) {
- if (this.stopOffsets[i2] >= stopOffset) {
- this.stopOffsets.splice(i2, 0, stopOffset);
- this.classNames.splice(i2, 0, className2);
- this.metadata.splice(i2, 0, metadata);
- break;
- }
- }
- }
- this.count++;
- return;
- }
- };
- LineDecorationsNormalizer = class {
- /**
- * Normalize line decorations. Overlapping decorations will generate multiple segments
- */
- static normalize(lineContent, lineDecorations) {
- if (lineDecorations.length === 0) {
- return [];
- }
- const result = [];
- const stack = new Stack();
- let nextStartOffset = 0;
- for (let i2 = 0, len = lineDecorations.length; i2 < len; i2++) {
- const d = lineDecorations[i2];
- let startColumn = d.startColumn;
- let endColumn = d.endColumn;
- const className2 = d.className;
- const metadata = d.type === 1 ? 2 : d.type === 2 ? 4 : 0;
- if (startColumn > 1) {
- const charCodeBefore = lineContent.charCodeAt(startColumn - 2);
- if (isHighSurrogate(charCodeBefore)) {
- startColumn--;
- }
- }
- if (endColumn > 1) {
- const charCodeBefore = lineContent.charCodeAt(endColumn - 2);
- if (isHighSurrogate(charCodeBefore)) {
- endColumn--;
- }
- }
- const currentStartOffset = startColumn - 1;
- const currentEndOffset = endColumn - 2;
- nextStartOffset = stack.consumeLowerThan(currentStartOffset, nextStartOffset, result);
- if (stack.count === 0) {
- nextStartOffset = currentStartOffset;
- }
- stack.insert(currentEndOffset, className2, metadata);
- }
- stack.consumeLowerThan(1073741824, nextStartOffset, result);
- return result;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linePart.js
-var LinePart;
-var init_linePart = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linePart.js"() {
- LinePart = class {
- constructor(endIndex, type, metadata, containsRTL2) {
- this.endIndex = endIndex;
- this.type = type;
- this.metadata = metadata;
- this.containsRTL = containsRTL2;
- this._linePartBrand = void 0;
- }
- isWhitespace() {
- return this.metadata & 1 ? true : false;
- }
- isPseudoAfter() {
- return this.metadata & 4 ? true : false;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js
-function renderViewLine(input, sb) {
- if (input.lineContent.length === 0) {
- if (input.lineDecorations.length > 0) {
- sb.appendString(``);
- let beforeCount = 0;
- let afterCount = 0;
- let containsForeignElements = 0;
- for (const lineDecoration of input.lineDecorations) {
- if (lineDecoration.type === 1 || lineDecoration.type === 2) {
- sb.appendString(` `);
- if (lineDecoration.type === 1) {
- containsForeignElements |= 1;
- beforeCount++;
- }
- if (lineDecoration.type === 2) {
- containsForeignElements |= 2;
- afterCount++;
- }
- }
- }
- sb.appendString(` `);
- const characterMapping = new CharacterMapping(1, beforeCount + afterCount);
- characterMapping.setColumnInfo(1, beforeCount, 0, 0);
- return new RenderLineOutput(characterMapping, containsForeignElements);
- }
- if (input.renderNewLineWhenEmpty) {
- sb.appendString("\n ");
- } else {
- sb.appendString(" ");
- }
- return new RenderLineOutput(
- new CharacterMapping(0, 0),
- 0
- /* ForeignElementType.None */
- );
- }
- return _renderLine(resolveRenderLineInput(input), sb);
-}
-function renderViewLine2(input) {
- const sb = new StringBuilder(1e4);
- const out = renderViewLine(input, sb);
- return new RenderLineOutput2(out.characterMapping, sb.build(), out.containsForeignElements);
-}
-function resolveRenderLineInput(input) {
- const lineContent = input.lineContent;
- let isOverflowing;
- let overflowingCharCount;
- let len;
- if (input.stopRenderingLineAfter !== -1 && input.stopRenderingLineAfter < lineContent.length) {
- isOverflowing = true;
- overflowingCharCount = lineContent.length - input.stopRenderingLineAfter;
- len = input.stopRenderingLineAfter;
- } else {
- isOverflowing = false;
- overflowingCharCount = 0;
- len = lineContent.length;
- }
- let tokens = transformAndRemoveOverflowing(lineContent, input.containsRTL, input.lineTokens, input.fauxIndentLength, len);
- if (input.renderControlCharacters && !input.isBasicASCII) {
- tokens = extractControlCharacters(lineContent, tokens);
- }
- if (input.renderWhitespace === 4 || input.renderWhitespace === 1 || input.renderWhitespace === 2 && !!input.selectionsOnLine || input.renderWhitespace === 3 && !input.continuesWithWrappedLine) {
- tokens = _applyRenderWhitespace(input, lineContent, len, tokens);
- }
- let containsForeignElements = 0;
- if (input.lineDecorations.length > 0) {
- for (let i2 = 0, len2 = input.lineDecorations.length; i2 < len2; i2++) {
- const lineDecoration = input.lineDecorations[i2];
- if (lineDecoration.type === 3) {
- containsForeignElements |= 1;
- } else if (lineDecoration.type === 1) {
- containsForeignElements |= 1;
- } else if (lineDecoration.type === 2) {
- containsForeignElements |= 2;
- }
- }
- tokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations);
- }
- if (!input.containsRTL) {
- tokens = splitLargeTokens(lineContent, tokens, !input.isBasicASCII || input.fontLigatures);
- } else {
- tokens = splitLeadingWhitespaceFromRTL(lineContent, tokens);
- }
- return new ResolvedRenderLineInput(input.useMonospaceOptimizations, input.canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, overflowingCharCount, tokens, containsForeignElements, input.fauxIndentLength, input.tabSize, input.startVisibleColumn, input.spaceWidth, input.renderSpaceCharCode, input.renderWhitespace, input.renderControlCharacters);
-}
-function transformAndRemoveOverflowing(lineContent, lineContainsRTL, tokens, fauxIndentLength, len) {
- const result = [];
- let resultLen = 0;
- if (fauxIndentLength > 0) {
- result[resultLen++] = new LinePart(fauxIndentLength, "", 0, false);
- }
- let startOffset = fauxIndentLength;
- for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {
- const endIndex = tokens.getEndOffset(tokenIndex);
- if (endIndex <= fauxIndentLength) {
- continue;
- }
- const type = tokens.getClassName(tokenIndex);
- if (endIndex >= len) {
- const tokenContainsRTL2 = lineContainsRTL ? containsRTL(lineContent.substring(startOffset, len)) : false;
- result[resultLen++] = new LinePart(len, type, 0, tokenContainsRTL2);
- break;
- }
- const tokenContainsRTL = lineContainsRTL ? containsRTL(lineContent.substring(startOffset, endIndex)) : false;
- result[resultLen++] = new LinePart(endIndex, type, 0, tokenContainsRTL);
- startOffset = endIndex;
- }
- return result;
-}
-function splitLargeTokens(lineContent, tokens, onlyAtSpaces) {
- let lastTokenEndIndex = 0;
- const result = [];
- let resultLen = 0;
- if (onlyAtSpaces) {
- for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
- const token = tokens[i2];
- const tokenEndIndex = token.endIndex;
- if (lastTokenEndIndex + 50 < tokenEndIndex) {
- const tokenType = token.type;
- const tokenMetadata = token.metadata;
- const tokenContainsRTL = token.containsRTL;
- let lastSpaceOffset = -1;
- let currTokenStart = lastTokenEndIndex;
- for (let j = lastTokenEndIndex; j < tokenEndIndex; j++) {
- if (lineContent.charCodeAt(j) === 32) {
- lastSpaceOffset = j;
- }
- if (lastSpaceOffset !== -1 && j - currTokenStart >= 50) {
- result[resultLen++] = new LinePart(lastSpaceOffset + 1, tokenType, tokenMetadata, tokenContainsRTL);
- currTokenStart = lastSpaceOffset + 1;
- lastSpaceOffset = -1;
- }
- }
- if (currTokenStart !== tokenEndIndex) {
- result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
- }
- } else {
- result[resultLen++] = token;
- }
- lastTokenEndIndex = tokenEndIndex;
- }
- } else {
- for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
- const token = tokens[i2];
- const tokenEndIndex = token.endIndex;
- const diff = tokenEndIndex - lastTokenEndIndex;
- if (diff > 50) {
- const tokenType = token.type;
- const tokenMetadata = token.metadata;
- const tokenContainsRTL = token.containsRTL;
- const piecesCount = Math.ceil(
- diff / 50
- /* Constants.LongToken */
- );
- for (let j = 1; j < piecesCount; j++) {
- const pieceEndIndex = lastTokenEndIndex + j * 50;
- result[resultLen++] = new LinePart(pieceEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
- }
- result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
- } else {
- result[resultLen++] = token;
- }
- lastTokenEndIndex = tokenEndIndex;
- }
- }
- return result;
-}
-function splitLeadingWhitespaceFromRTL(lineContent, tokens) {
- if (tokens.length === 0) {
- return tokens;
- }
- const firstToken = tokens[0];
- if (!firstToken.containsRTL) {
- return tokens;
- }
- const firstTokenEndIndex = firstToken.endIndex;
- let firstNonWhitespaceIndex2 = 0;
- for (let i2 = 0; i2 < firstTokenEndIndex; i2++) {
- const charCode = lineContent.charCodeAt(i2);
- if (charCode !== 32 && charCode !== 9) {
- firstNonWhitespaceIndex2 = i2;
- break;
- }
- }
- if (firstNonWhitespaceIndex2 === 0) {
- return tokens;
- }
- const result = [];
- result.push(new LinePart(firstNonWhitespaceIndex2, firstToken.type, firstToken.metadata, false));
- result.push(new LinePart(firstTokenEndIndex, firstToken.type, firstToken.metadata, firstToken.containsRTL));
- for (let i2 = 1; i2 < tokens.length; i2++) {
- result.push(tokens[i2]);
- }
- return result;
-}
-function isControlCharacter(charCode) {
- if (charCode < 32) {
- return charCode !== 9;
- }
- if (charCode === 127) {
- return true;
- }
- if (charCode >= 8234 && charCode <= 8238 || charCode >= 8294 && charCode <= 8297 || charCode >= 8206 && charCode <= 8207 || charCode === 1564) {
- return true;
- }
- return false;
-}
-function extractControlCharacters(lineContent, tokens) {
- const result = [];
- let lastLinePart = new LinePart(0, "", 0, false);
- let charOffset = 0;
- for (const token of tokens) {
- const tokenEndIndex = token.endIndex;
- for (; charOffset < tokenEndIndex; charOffset++) {
- const charCode = lineContent.charCodeAt(charOffset);
- if (isControlCharacter(charCode)) {
- if (charOffset > lastLinePart.endIndex) {
- lastLinePart = new LinePart(charOffset, token.type, token.metadata, token.containsRTL);
- result.push(lastLinePart);
- }
- lastLinePart = new LinePart(charOffset + 1, "mtkcontrol", token.metadata, false);
- result.push(lastLinePart);
- }
- }
- if (charOffset > lastLinePart.endIndex) {
- lastLinePart = new LinePart(tokenEndIndex, token.type, token.metadata, token.containsRTL);
- result.push(lastLinePart);
- }
- }
- return result;
-}
-function _applyRenderWhitespace(input, lineContent, len, tokens) {
- const continuesWithWrappedLine = input.continuesWithWrappedLine;
- const fauxIndentLength = input.fauxIndentLength;
- const tabSize = input.tabSize;
- const startVisibleColumn = input.startVisibleColumn;
- const useMonospaceOptimizations = input.useMonospaceOptimizations;
- const selections = input.selectionsOnLine;
- const onlyBoundary = input.renderWhitespace === 1;
- const onlyTrailing = input.renderWhitespace === 3;
- const generateLinePartForEachWhitespace = input.renderSpaceWidth !== input.spaceWidth;
- const result = [];
- let resultLen = 0;
- let tokenIndex = 0;
- let tokenType = tokens[tokenIndex].type;
- let tokenContainsRTL = tokens[tokenIndex].containsRTL;
- let tokenEndIndex = tokens[tokenIndex].endIndex;
- const tokensLength = tokens.length;
- let lineIsEmptyOrWhitespace = false;
- let firstNonWhitespaceIndex$1 = firstNonWhitespaceIndex(lineContent);
- let lastNonWhitespaceIndex$1;
- if (firstNonWhitespaceIndex$1 === -1) {
- lineIsEmptyOrWhitespace = true;
- firstNonWhitespaceIndex$1 = len;
- lastNonWhitespaceIndex$1 = len;
- } else {
- lastNonWhitespaceIndex$1 = lastNonWhitespaceIndex(lineContent);
- }
- let wasInWhitespace = false;
- let currentSelectionIndex = 0;
- let currentSelection = selections && selections[currentSelectionIndex];
- let tmpIndent = startVisibleColumn % tabSize;
- for (let charIndex = fauxIndentLength; charIndex < len; charIndex++) {
- const chCode = lineContent.charCodeAt(charIndex);
- if (currentSelection && currentSelection.endExclusive <= charIndex) {
- currentSelectionIndex++;
- currentSelection = selections && selections[currentSelectionIndex];
- }
- let isInWhitespace;
- if (charIndex < firstNonWhitespaceIndex$1 || charIndex > lastNonWhitespaceIndex$1) {
- isInWhitespace = true;
- } else if (chCode === 9) {
- isInWhitespace = true;
- } else if (chCode === 32) {
- if (onlyBoundary) {
- if (wasInWhitespace) {
- isInWhitespace = true;
- } else {
- const nextChCode = charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : 0;
- isInWhitespace = nextChCode === 32 || nextChCode === 9;
- }
- } else {
- isInWhitespace = true;
- }
- } else {
- isInWhitespace = false;
- }
- if (isInWhitespace && selections) {
- isInWhitespace = !!currentSelection && currentSelection.start <= charIndex && charIndex < currentSelection.endExclusive;
- }
- if (isInWhitespace && onlyTrailing) {
- isInWhitespace = lineIsEmptyOrWhitespace || charIndex > lastNonWhitespaceIndex$1;
- }
- if (isInWhitespace && tokenContainsRTL) {
- if (charIndex >= firstNonWhitespaceIndex$1 && charIndex <= lastNonWhitespaceIndex$1) {
- isInWhitespace = false;
- }
- }
- if (wasInWhitespace) {
- if (!isInWhitespace || !useMonospaceOptimizations && tmpIndent >= tabSize) {
- if (generateLinePartForEachWhitespace) {
- const lastEndIndex = resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength;
- for (let i2 = lastEndIndex + 1; i2 <= charIndex; i2++) {
- result[resultLen++] = new LinePart(i2, "mtkw", 1, false);
- }
- } else {
- result[resultLen++] = new LinePart(charIndex, "mtkw", 1, false);
- }
- tmpIndent = tmpIndent % tabSize;
- }
- } else {
- if (charIndex === tokenEndIndex || isInWhitespace && charIndex > fauxIndentLength) {
- result[resultLen++] = new LinePart(charIndex, tokenType, 0, tokenContainsRTL);
- tmpIndent = tmpIndent % tabSize;
- }
- }
- if (chCode === 9) {
- tmpIndent = tabSize;
- } else if (isFullWidthCharacter(chCode)) {
- tmpIndent += 2;
- } else {
- tmpIndent++;
- }
- wasInWhitespace = isInWhitespace;
- while (charIndex === tokenEndIndex) {
- tokenIndex++;
- if (tokenIndex < tokensLength) {
- tokenType = tokens[tokenIndex].type;
- tokenContainsRTL = tokens[tokenIndex].containsRTL;
- tokenEndIndex = tokens[tokenIndex].endIndex;
- } else {
- break;
- }
- }
- }
- let generateWhitespace = false;
- if (wasInWhitespace) {
- if (continuesWithWrappedLine && onlyBoundary) {
- const lastCharCode = len > 0 ? lineContent.charCodeAt(len - 1) : 0;
- const prevCharCode = len > 1 ? lineContent.charCodeAt(len - 2) : 0;
- const isSingleTrailingSpace = lastCharCode === 32 && (prevCharCode !== 32 && prevCharCode !== 9);
- if (!isSingleTrailingSpace) {
- generateWhitespace = true;
- }
- } else {
- generateWhitespace = true;
- }
- }
- if (generateWhitespace) {
- if (generateLinePartForEachWhitespace) {
- const lastEndIndex = resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength;
- for (let i2 = lastEndIndex + 1; i2 <= len; i2++) {
- result[resultLen++] = new LinePart(i2, "mtkw", 1, false);
- }
- } else {
- result[resultLen++] = new LinePart(len, "mtkw", 1, false);
- }
- } else {
- result[resultLen++] = new LinePart(len, tokenType, 0, tokenContainsRTL);
- }
- return result;
-}
-function _applyInlineDecorations(lineContent, len, tokens, _lineDecorations) {
- _lineDecorations.sort(LineDecoration.compare);
- const lineDecorations = LineDecorationsNormalizer.normalize(lineContent, _lineDecorations);
- const lineDecorationsLen = lineDecorations.length;
- let lineDecorationIndex = 0;
- const result = [];
- let resultLen = 0;
- let lastResultEndIndex = 0;
- for (let tokenIndex = 0, len2 = tokens.length; tokenIndex < len2; tokenIndex++) {
- const token = tokens[tokenIndex];
- const tokenEndIndex = token.endIndex;
- const tokenType = token.type;
- const tokenMetadata = token.metadata;
- const tokenContainsRTL = token.containsRTL;
- while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) {
- const lineDecoration = lineDecorations[lineDecorationIndex];
- if (lineDecoration.startOffset > lastResultEndIndex) {
- lastResultEndIndex = lineDecoration.startOffset;
- result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
- }
- if (lineDecoration.endOffset + 1 <= tokenEndIndex) {
- lastResultEndIndex = lineDecoration.endOffset + 1;
- result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + " " + lineDecoration.className, tokenMetadata | lineDecoration.metadata, tokenContainsRTL);
- lineDecorationIndex++;
- } else {
- lastResultEndIndex = tokenEndIndex;
- result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + " " + lineDecoration.className, tokenMetadata | lineDecoration.metadata, tokenContainsRTL);
- break;
- }
- }
- if (tokenEndIndex > lastResultEndIndex) {
- lastResultEndIndex = tokenEndIndex;
- result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
- }
- }
- const lastTokenEndIndex = tokens[tokens.length - 1].endIndex;
- if (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
- while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
- const lineDecoration = lineDecorations[lineDecorationIndex];
- result[resultLen++] = new LinePart(lastResultEndIndex, lineDecoration.className, lineDecoration.metadata, false);
- lineDecorationIndex++;
- }
- }
- return result;
-}
-function _renderLine(input, sb) {
- const fontIsMonospace = input.fontIsMonospace;
- const canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;
- const containsForeignElements = input.containsForeignElements;
- const lineContent = input.lineContent;
- const len = input.len;
- const isOverflowing = input.isOverflowing;
- const overflowingCharCount = input.overflowingCharCount;
- const parts = input.parts;
- const fauxIndentLength = input.fauxIndentLength;
- const tabSize = input.tabSize;
- const startVisibleColumn = input.startVisibleColumn;
- const spaceWidth = input.spaceWidth;
- const renderSpaceCharCode = input.renderSpaceCharCode;
- const renderWhitespace = input.renderWhitespace;
- const renderControlCharacters = input.renderControlCharacters;
- const characterMapping = new CharacterMapping(len + 1, parts.length);
- let lastCharacterMappingDefined = false;
- let charIndex = 0;
- let visibleColumn = startVisibleColumn;
- let charOffsetInPart = 0;
- let charHorizontalOffset = 0;
- let partDisplacement = 0;
- sb.appendString("");
- for (let partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {
- const part = parts[partIndex];
- const partEndIndex = part.endIndex;
- const partType = part.type;
- const partContainsRTL = part.containsRTL;
- const partRendersWhitespace = renderWhitespace !== 0 && part.isWhitespace();
- const partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === "mtkw" || !containsForeignElements);
- const partIsEmptyAndHasPseudoAfter = charIndex === partEndIndex && part.isPseudoAfter();
- charOffsetInPart = 0;
- sb.appendString("= fauxIndentLength) {
- _visibleColumn += charWidth;
- }
- }
- }
- if (partRendersWhitespaceWithWidth) {
- sb.appendString(' style="width:');
- sb.appendString(String(spaceWidth * partWidth));
- sb.appendString('px"');
- }
- sb.appendASCIICharCode(
- 62
- /* CharCode.GreaterThan */
- );
- for (; charIndex < partEndIndex; charIndex++) {
- characterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, charHorizontalOffset);
- partDisplacement = 0;
- const charCode = lineContent.charCodeAt(charIndex);
- let producedCharacters;
- let charWidth;
- if (charCode === 9) {
- producedCharacters = tabSize - visibleColumn % tabSize | 0;
- charWidth = producedCharacters;
- if (!canUseHalfwidthRightwardsArrow || charWidth > 1) {
- sb.appendCharCode(8594);
- } else {
- sb.appendCharCode(65515);
- }
- for (let space = 2; space <= charWidth; space++) {
- sb.appendCharCode(160);
- }
- } else {
- producedCharacters = 2;
- charWidth = 1;
- sb.appendCharCode(renderSpaceCharCode);
- sb.appendCharCode(8204);
- }
- charOffsetInPart += producedCharacters;
- charHorizontalOffset += charWidth;
- if (charIndex >= fauxIndentLength) {
- visibleColumn += charWidth;
- }
- }
- } else {
- sb.appendASCIICharCode(
- 62
- /* CharCode.GreaterThan */
- );
- for (; charIndex < partEndIndex; charIndex++) {
- characterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, charHorizontalOffset);
- partDisplacement = 0;
- const charCode = lineContent.charCodeAt(charIndex);
- let producedCharacters = 1;
- let charWidth = 1;
- switch (charCode) {
- case 9:
- producedCharacters = tabSize - visibleColumn % tabSize;
- charWidth = producedCharacters;
- for (let space = 1; space <= producedCharacters; space++) {
- sb.appendCharCode(160);
- }
- break;
- case 32:
- sb.appendCharCode(160);
- break;
- case 60:
- sb.appendString("<");
- break;
- case 62:
- sb.appendString(">");
- break;
- case 38:
- sb.appendString("&");
- break;
- case 0:
- if (renderControlCharacters) {
- sb.appendCharCode(9216);
- } else {
- sb.appendString("");
- }
- break;
- case 65279:
- case 8232:
- case 8233:
- case 133:
- sb.appendCharCode(65533);
- break;
- default:
- if (isFullWidthCharacter(charCode)) {
- charWidth++;
- }
- if (renderControlCharacters && charCode < 32) {
- sb.appendCharCode(9216 + charCode);
- } else if (renderControlCharacters && charCode === 127) {
- sb.appendCharCode(9249);
- } else if (renderControlCharacters && isControlCharacter(charCode)) {
- sb.appendString("[U+");
- sb.appendString(to4CharHex(charCode));
- sb.appendString("]");
- producedCharacters = 8;
- charWidth = producedCharacters;
- } else {
- sb.appendCharCode(charCode);
- }
- }
- charOffsetInPart += producedCharacters;
- charHorizontalOffset += charWidth;
- if (charIndex >= fauxIndentLength) {
- visibleColumn += charWidth;
- }
- }
- }
- if (partIsEmptyAndHasPseudoAfter) {
- partDisplacement++;
- } else {
- partDisplacement = 0;
- }
- if (charIndex >= len && !lastCharacterMappingDefined && part.isPseudoAfter()) {
- lastCharacterMappingDefined = true;
- characterMapping.setColumnInfo(charIndex + 1, partIndex, charOffsetInPart, charHorizontalOffset);
- }
- sb.appendString(" ");
- }
- if (!lastCharacterMappingDefined) {
- characterMapping.setColumnInfo(len + 1, parts.length - 1, charOffsetInPart, charHorizontalOffset);
- }
- if (isOverflowing) {
- sb.appendString('');
- sb.appendString(localize(796, "Show more ({0})", renderOverflowingCharCount(overflowingCharCount)));
- sb.appendString(" ");
- }
- sb.appendString(" ");
- return new RenderLineOutput(characterMapping, containsForeignElements);
-}
-function to4CharHex(n2) {
- return n2.toString(16).toUpperCase().padStart(4, "0");
-}
-function renderOverflowingCharCount(n2) {
- if (n2 < 1024) {
- return localize(797, "{0} chars", n2);
- }
- if (n2 < 1024 * 1024) {
- return `${(n2 / 1024).toFixed(1)} KB`;
- }
- return `${(n2 / 1024 / 1024).toFixed(1)} MB`;
-}
-var RenderLineInput, DomPosition, CharacterMapping, RenderLineOutput, RenderLineOutput2, ResolvedRenderLineInput;
-var init_viewLineRenderer = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js"() {
- init_nls();
- init_strings();
- init_stringBuilder();
- init_lineDecorations();
- init_linePart();
- init_model2();
- RenderLineInput = class {
- get isLTR() {
- return !this.containsRTL && this.textDirection !== TextDirection.RTL;
- }
- constructor(useMonospaceOptimizations, canUseHalfwidthRightwardsArrow, lineContent, continuesWithWrappedLine, isBasicASCII2, containsRTL2, fauxIndentLength, lineTokens, lineDecorations, tabSize, startVisibleColumn, spaceWidth, middotWidth, wsmiddotWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures, selectionsOnLine, textDirection, verticalScrollbarSize, renderNewLineWhenEmpty = false) {
- this.useMonospaceOptimizations = useMonospaceOptimizations;
- this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow;
- this.lineContent = lineContent;
- this.continuesWithWrappedLine = continuesWithWrappedLine;
- this.isBasicASCII = isBasicASCII2;
- this.containsRTL = containsRTL2;
- this.fauxIndentLength = fauxIndentLength;
- this.lineTokens = lineTokens;
- this.lineDecorations = lineDecorations.sort(LineDecoration.compare);
- this.tabSize = tabSize;
- this.startVisibleColumn = startVisibleColumn;
- this.spaceWidth = spaceWidth;
- this.stopRenderingLineAfter = stopRenderingLineAfter;
- this.renderWhitespace = renderWhitespace === "all" ? 4 : renderWhitespace === "boundary" ? 1 : renderWhitespace === "selection" ? 2 : renderWhitespace === "trailing" ? 3 : 0;
- this.renderControlCharacters = renderControlCharacters;
- this.fontLigatures = fontLigatures;
- this.selectionsOnLine = selectionsOnLine && selectionsOnLine.sort((a, b) => a.start < b.start ? -1 : 1);
- this.renderNewLineWhenEmpty = renderNewLineWhenEmpty;
- this.textDirection = textDirection;
- this.verticalScrollbarSize = verticalScrollbarSize;
- const wsmiddotDiff = Math.abs(wsmiddotWidth - spaceWidth);
- const middotDiff = Math.abs(middotWidth - spaceWidth);
- if (wsmiddotDiff < middotDiff) {
- this.renderSpaceWidth = wsmiddotWidth;
- this.renderSpaceCharCode = 11825;
- } else {
- this.renderSpaceWidth = middotWidth;
- this.renderSpaceCharCode = 183;
- }
- }
- sameSelection(otherSelections) {
- if (this.selectionsOnLine === null) {
- return otherSelections === null;
- }
- if (otherSelections === null) {
- return false;
- }
- if (otherSelections.length !== this.selectionsOnLine.length) {
- return false;
- }
- for (let i2 = 0; i2 < this.selectionsOnLine.length; i2++) {
- if (!this.selectionsOnLine[i2].equals(otherSelections[i2])) {
- return false;
- }
- }
- return true;
- }
- equals(other) {
- return this.useMonospaceOptimizations === other.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.lineContent === other.lineContent && this.continuesWithWrappedLine === other.continuesWithWrappedLine && this.isBasicASCII === other.isBasicASCII && this.containsRTL === other.containsRTL && this.fauxIndentLength === other.fauxIndentLength && this.tabSize === other.tabSize && this.startVisibleColumn === other.startVisibleColumn && this.spaceWidth === other.spaceWidth && this.renderSpaceWidth === other.renderSpaceWidth && this.renderSpaceCharCode === other.renderSpaceCharCode && this.stopRenderingLineAfter === other.stopRenderingLineAfter && this.renderWhitespace === other.renderWhitespace && this.renderControlCharacters === other.renderControlCharacters && this.fontLigatures === other.fontLigatures && LineDecoration.equalsArr(this.lineDecorations, other.lineDecorations) && this.lineTokens.equals(other.lineTokens) && this.sameSelection(other.selectionsOnLine) && this.textDirection === other.textDirection && this.verticalScrollbarSize === other.verticalScrollbarSize && this.renderNewLineWhenEmpty === other.renderNewLineWhenEmpty;
- }
- };
- DomPosition = class {
- constructor(partIndex, charIndex) {
- this.partIndex = partIndex;
- this.charIndex = charIndex;
- }
- };
- CharacterMapping = class _CharacterMapping {
- static getPartIndex(partData) {
- return (partData & 4294901760) >>> 16;
- }
- static getCharIndex(partData) {
- return (partData & 65535) >>> 0;
- }
- constructor(length, partCount) {
- this.length = length;
- this._data = new Uint32Array(this.length);
- this._horizontalOffset = new Uint32Array(this.length);
- }
- setColumnInfo(column, partIndex, charIndex, horizontalOffset) {
- const partData = (partIndex << 16 | charIndex << 0) >>> 0;
- this._data[column - 1] = partData;
- this._horizontalOffset[column - 1] = horizontalOffset;
- }
- getHorizontalOffset(column) {
- if (this._horizontalOffset.length === 0) {
- return 0;
- }
- return this._horizontalOffset[column - 1];
- }
- charOffsetToPartData(charOffset) {
- if (this.length === 0) {
- return 0;
- }
- if (charOffset < 0) {
- return this._data[0];
- }
- if (charOffset >= this.length) {
- return this._data[this.length - 1];
- }
- return this._data[charOffset];
- }
- getDomPosition(column) {
- const partData = this.charOffsetToPartData(column - 1);
- const partIndex = _CharacterMapping.getPartIndex(partData);
- const charIndex = _CharacterMapping.getCharIndex(partData);
- return new DomPosition(partIndex, charIndex);
- }
- getColumn(domPosition, partLength) {
- const charOffset = this.partDataToCharOffset(domPosition.partIndex, partLength, domPosition.charIndex);
- return charOffset + 1;
- }
- partDataToCharOffset(partIndex, partLength, charIndex) {
- if (this.length === 0) {
- return 0;
- }
- const searchEntry = (partIndex << 16 | charIndex << 0) >>> 0;
- let min = 0;
- let max = this.length - 1;
- while (min + 1 < max) {
- const mid = min + max >>> 1;
- const midEntry = this._data[mid];
- if (midEntry === searchEntry) {
- return mid;
- } else if (midEntry > searchEntry) {
- max = mid;
- } else {
- min = mid;
- }
- }
- if (min === max) {
- return min;
- }
- const minEntry = this._data[min];
- const maxEntry = this._data[max];
- if (minEntry === searchEntry) {
- return min;
- }
- if (maxEntry === searchEntry) {
- return max;
- }
- const minPartIndex = _CharacterMapping.getPartIndex(minEntry);
- const minCharIndex = _CharacterMapping.getCharIndex(minEntry);
- const maxPartIndex = _CharacterMapping.getPartIndex(maxEntry);
- let maxCharIndex;
- if (minPartIndex !== maxPartIndex) {
- maxCharIndex = partLength;
- } else {
- maxCharIndex = _CharacterMapping.getCharIndex(maxEntry);
- }
- const minEntryDistance = charIndex - minCharIndex;
- const maxEntryDistance = maxCharIndex - charIndex;
- if (minEntryDistance <= maxEntryDistance) {
- return min;
- }
- return max;
- }
- };
- RenderLineOutput = class {
- constructor(characterMapping, containsForeignElements) {
- this._renderLineOutputBrand = void 0;
- this.characterMapping = characterMapping;
- this.containsForeignElements = containsForeignElements;
- }
- };
- RenderLineOutput2 = class {
- constructor(characterMapping, html3, containsForeignElements) {
- this.characterMapping = characterMapping;
- this.html = html3;
- this.containsForeignElements = containsForeignElements;
- }
- };
- ResolvedRenderLineInput = class {
- constructor(fontIsMonospace, canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, overflowingCharCount, parts, containsForeignElements, fauxIndentLength, tabSize, startVisibleColumn, spaceWidth, renderSpaceCharCode, renderWhitespace, renderControlCharacters) {
- this.fontIsMonospace = fontIsMonospace;
- this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow;
- this.lineContent = lineContent;
- this.len = len;
- this.isOverflowing = isOverflowing;
- this.overflowingCharCount = overflowingCharCount;
- this.parts = parts;
- this.containsForeignElements = containsForeignElements;
- this.fauxIndentLength = fauxIndentLength;
- this.tabSize = tabSize;
- this.startVisibleColumn = startVisibleColumn;
- this.spaceWidth = spaceWidth;
- this.renderSpaceCharCode = renderSpaceCharCode;
- this.renderWhitespace = renderWhitespace;
- this.renderControlCharacters = renderControlCharacters;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/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/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/esm/vs/editor/browser/viewParts/viewLines/viewLine.js
-function createWebKitRenderedLine(domNode, renderLineInput, characterMapping, containsForeignElements) {
- return new WebKitRenderedViewLine(domNode, renderLineInput, characterMapping, containsForeignElements);
-}
-function createNormalRenderedLine(domNode, renderLineInput, characterMapping, containsForeignElements) {
- return new RenderedViewLine(domNode, renderLineInput, characterMapping, containsForeignElements);
-}
-function getColumnOfNodeOffset(characterMapping, spanNode, offset) {
- const spanNodeTextContentLength = spanNode.textContent.length;
- let spanIndex = -1;
- while (spanNode) {
- spanNode = spanNode.previousSibling;
- spanIndex++;
- }
- return characterMapping.getColumn(new DomPosition(spanIndex, offset), spanNodeTextContentLength);
-}
-var canUseFastRenderedViewLine, monospaceAssumptionsAreValid, ViewLine, FastRenderedViewLine, RenderedViewLine, WebKitRenderedViewLine, createRenderedLine;
-var init_viewLine = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLine.js"() {
- init_browser();
- init_fastDomNode();
- init_platform();
- init_rangeUtil();
- init_renderingContext();
- init_lineDecorations();
- init_viewLineRenderer();
- init_theme();
- init_editorOptions();
- init_offsetRange();
- init_model2();
- canUseFastRenderedViewLine = function() {
- if (isNative) {
- return true;
- }
- if (isLinux || isFirefox || isSafari) {
- return false;
- }
- return true;
- }();
- monospaceAssumptionsAreValid = true;
- ViewLine = class _ViewLine {
- static {
- this.CLASS_NAME = "view-line";
- }
- constructor(_viewGpuContext, options) {
- this._viewGpuContext = _viewGpuContext;
- this._options = options;
- this._isMaybeInvalid = true;
- this._renderedViewLine = null;
- }
- // --- begin IVisibleLineData
- getDomNode() {
- if (this._renderedViewLine && this._renderedViewLine.domNode) {
- return this._renderedViewLine.domNode.domNode;
- }
- return null;
- }
- setDomNode(domNode) {
- if (this._renderedViewLine) {
- this._renderedViewLine.domNode = createFastDomNode(domNode);
- } else {
- throw new Error("I have no rendered view line to set the dom node to...");
- }
- }
- onContentChanged() {
- this._isMaybeInvalid = true;
- }
- onTokensChanged() {
- this._isMaybeInvalid = true;
- }
- onDecorationsChanged() {
- this._isMaybeInvalid = true;
- }
- onOptionsChanged(newOptions) {
- this._isMaybeInvalid = true;
- this._options = newOptions;
- }
- onSelectionChanged() {
- if (isHighContrast(this._options.themeType) || this._renderedViewLine?.input.renderWhitespace === 2) {
- this._isMaybeInvalid = true;
- return true;
- }
- return false;
- }
- renderLine(lineNumber, deltaTop, lineHeight, viewportData, sb) {
- if (this._options.useGpu && this._viewGpuContext?.canRender(this._options, viewportData, lineNumber)) {
- this._renderedViewLine?.domNode?.domNode.remove();
- this._renderedViewLine = null;
- return false;
- }
- if (this._isMaybeInvalid === false) {
- return false;
- }
- this._isMaybeInvalid = false;
- const lineData = viewportData.getViewLineRenderingData(lineNumber);
- const options = this._options;
- const actualInlineDecorations = LineDecoration.filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn);
- const renderWhitespace = lineData.hasVariableFonts || options.experimentalWhitespaceRendering === "off" ? options.renderWhitespace : "none";
- const allowFastRendering = !lineData.hasVariableFonts;
- let selectionsOnLine = null;
- if (isHighContrast(options.themeType) || renderWhitespace === "selection") {
- const selections = viewportData.selections;
- for (const selection of selections) {
- if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) {
- continue;
- }
- const startColumn = selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn;
- const endColumn = selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn;
- if (startColumn < endColumn) {
- if (isHighContrast(options.themeType)) {
- actualInlineDecorations.push(new LineDecoration(
- startColumn,
- endColumn,
- "inline-selected-text",
- 0
- /* InlineDecorationType.Regular */
- ));
- }
- if (renderWhitespace === "selection") {
- if (!selectionsOnLine) {
- selectionsOnLine = [];
- }
- selectionsOnLine.push(new OffsetRange(startColumn - 1, endColumn - 1));
- }
- }
- }
- }
- const renderLineInput = new RenderLineInput(options.useMonospaceOptimizations, options.canUseHalfwidthRightwardsArrow, lineData.content, lineData.continuesWithWrappedLine, lineData.isBasicASCII, lineData.containsRTL, lineData.minColumn - 1, lineData.tokens, actualInlineDecorations, lineData.tabSize, lineData.startVisibleColumn, options.spaceWidth, options.middotWidth, options.wsmiddotWidth, options.stopRenderingLineAfter, renderWhitespace, options.renderControlCharacters, options.fontLigatures !== EditorFontLigatures.OFF, selectionsOnLine, lineData.textDirection, options.verticalScrollbarSize);
- if (this._renderedViewLine && this._renderedViewLine.input.equals(renderLineInput)) {
- return false;
- }
- sb.appendString("');
- const output = renderViewLine(renderLineInput, sb);
- sb.appendString("
");
- let renderedViewLine = null;
- if (allowFastRendering && monospaceAssumptionsAreValid && canUseFastRenderedViewLine && lineData.isBasicASCII && renderLineInput.isLTR && options.useMonospaceOptimizations && output.containsForeignElements === 0) {
- renderedViewLine = new FastRenderedViewLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping);
- }
- if (!renderedViewLine) {
- renderedViewLine = createRenderedLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping, output.containsForeignElements);
- }
- this._renderedViewLine = renderedViewLine;
- return true;
- }
- layoutLine(lineNumber, deltaTop, lineHeight) {
- if (this._renderedViewLine && this._renderedViewLine.domNode) {
- this._renderedViewLine.domNode.setTop(deltaTop);
- this._renderedViewLine.domNode.setHeight(lineHeight);
- this._renderedViewLine.domNode.setLineHeight(lineHeight);
- }
- }
- // --- end IVisibleLineData
- isRenderedRTL() {
- if (!this._renderedViewLine) {
- return false;
- }
- return this._renderedViewLine.input.textDirection === TextDirection.RTL;
- }
- getWidth(context) {
- if (!this._renderedViewLine) {
- return 0;
- }
- return this._renderedViewLine.getWidth(context);
- }
- getWidthIsFast() {
- if (!this._renderedViewLine) {
- return true;
- }
- return this._renderedViewLine.getWidthIsFast();
- }
- needsMonospaceFontCheck() {
- if (!this._renderedViewLine) {
- return false;
- }
- return this._renderedViewLine instanceof FastRenderedViewLine;
- }
- monospaceAssumptionsAreValid() {
- if (!this._renderedViewLine) {
- return monospaceAssumptionsAreValid;
- }
- if (this._renderedViewLine instanceof FastRenderedViewLine) {
- return this._renderedViewLine.monospaceAssumptionsAreValid();
- }
- return monospaceAssumptionsAreValid;
- }
- onMonospaceAssumptionsInvalidated() {
- if (this._renderedViewLine && this._renderedViewLine instanceof FastRenderedViewLine) {
- this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine();
- }
- }
- getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {
- if (!this._renderedViewLine) {
- return null;
- }
- startColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, startColumn));
- endColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, endColumn));
- const stopRenderingLineAfter = this._renderedViewLine.input.stopRenderingLineAfter;
- if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1 && endColumn > stopRenderingLineAfter + 1) {
- return new VisibleRanges(true, [new FloatHorizontalRange(this.getWidth(context), 0)]);
- }
- if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1) {
- startColumn = stopRenderingLineAfter + 1;
- }
- if (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter + 1) {
- endColumn = stopRenderingLineAfter + 1;
- }
- const horizontalRanges = this._renderedViewLine.getVisibleRangesForRange(lineNumber, startColumn, endColumn, context);
- if (horizontalRanges && horizontalRanges.length > 0) {
- return new VisibleRanges(false, horizontalRanges);
- }
- return null;
- }
- getColumnOfNodeOffset(spanNode, offset) {
- if (!this._renderedViewLine) {
- return 1;
- }
- return this._renderedViewLine.getColumnOfNodeOffset(spanNode, offset);
- }
- };
- FastRenderedViewLine = class {
- constructor(domNode, renderLineInput, characterMapping) {
- this._cachedWidth = -1;
- this.domNode = domNode;
- this.input = renderLineInput;
- const keyColumnCount = Math.floor(
- renderLineInput.lineContent.length / 300
- /* Constants.MaxMonospaceDistance */
- );
- if (keyColumnCount > 0) {
- this._keyColumnPixelOffsetCache = new Float32Array(keyColumnCount);
- for (let i2 = 0; i2 < keyColumnCount; i2++) {
- this._keyColumnPixelOffsetCache[i2] = -1;
- }
- } else {
- this._keyColumnPixelOffsetCache = null;
- }
- this._characterMapping = characterMapping;
- this._charWidth = renderLineInput.spaceWidth;
- }
- getWidth(context) {
- if (!this.domNode || this.input.lineContent.length < 300) {
- const horizontalOffset = this._characterMapping.getHorizontalOffset(this._characterMapping.length);
- return Math.round(this._charWidth * horizontalOffset);
- }
- if (this._cachedWidth === -1) {
- this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth;
- context?.markDidDomLayout();
- }
- return this._cachedWidth;
- }
- getWidthIsFast() {
- return this.input.lineContent.length < 300 || this._cachedWidth !== -1;
- }
- monospaceAssumptionsAreValid() {
- if (!this.domNode) {
- return monospaceAssumptionsAreValid;
- }
- if (this.input.lineContent.length < 300) {
- const expectedWidth = this.getWidth(null);
- const actualWidth = this.domNode.domNode.firstChild.offsetWidth;
- if (Math.abs(expectedWidth - actualWidth) >= 2) {
- console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`);
- monospaceAssumptionsAreValid = false;
- }
- }
- return monospaceAssumptionsAreValid;
- }
- toSlowRenderedLine() {
- return createRenderedLine(
- this.domNode,
- this.input,
- this._characterMapping,
- 0
- /* ForeignElementType.None */
- );
- }
- getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {
- const startPosition = this._getColumnPixelOffset(lineNumber, startColumn, context);
- const endPosition = this._getColumnPixelOffset(lineNumber, endColumn, context);
- return [new FloatHorizontalRange(startPosition, endPosition - startPosition)];
- }
- _getColumnPixelOffset(lineNumber, column, context) {
- if (column <= 300) {
- const horizontalOffset2 = this._characterMapping.getHorizontalOffset(column);
- return this._charWidth * horizontalOffset2;
- }
- const keyColumnOrdinal = Math.floor(
- (column - 1) / 300
- /* Constants.MaxMonospaceDistance */
- ) - 1;
- const keyColumn = (keyColumnOrdinal + 1) * 300 + 1;
- let keyColumnPixelOffset = -1;
- if (this._keyColumnPixelOffsetCache) {
- keyColumnPixelOffset = this._keyColumnPixelOffsetCache[keyColumnOrdinal];
- if (keyColumnPixelOffset === -1) {
- keyColumnPixelOffset = this._actualReadPixelOffset(lineNumber, keyColumn, context);
- this._keyColumnPixelOffsetCache[keyColumnOrdinal] = keyColumnPixelOffset;
- }
- }
- if (keyColumnPixelOffset === -1) {
- const horizontalOffset2 = this._characterMapping.getHorizontalOffset(column);
- return this._charWidth * horizontalOffset2;
- }
- const keyColumnHorizontalOffset = this._characterMapping.getHorizontalOffset(keyColumn);
- const horizontalOffset = this._characterMapping.getHorizontalOffset(column);
- return keyColumnPixelOffset + this._charWidth * (horizontalOffset - keyColumnHorizontalOffset);
- }
- _getReadingTarget(myDomNode) {
- return myDomNode.domNode.firstChild;
- }
- _actualReadPixelOffset(lineNumber, column, context) {
- if (!this.domNode) {
- return -1;
- }
- const domPosition = this._characterMapping.getDomPosition(column);
- const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(this.domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context);
- if (!r || r.length === 0) {
- return -1;
- }
- return r[0].left;
- }
- getColumnOfNodeOffset(spanNode, offset) {
- return getColumnOfNodeOffset(this._characterMapping, spanNode, offset);
- }
- };
- RenderedViewLine = class {
- constructor(domNode, renderLineInput, characterMapping, containsForeignElements) {
- this.domNode = domNode;
- this.input = renderLineInput;
- this._characterMapping = characterMapping;
- this._isWhitespaceOnly = /^\s*$/.test(renderLineInput.lineContent);
- this._containsForeignElements = containsForeignElements;
- this._cachedWidth = -1;
- this._pixelOffsetCache = null;
- if (renderLineInput.isLTR) {
- this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));
- for (let column = 0, len = this._characterMapping.length; column <= len; column++) {
- this._pixelOffsetCache[column] = -1;
- }
- }
- }
- // --- Reading from the DOM methods
- _getReadingTarget(myDomNode) {
- return myDomNode.domNode.firstChild;
- }
- /**
- * Width of the line in pixels
- */
- getWidth(context) {
- if (!this.domNode) {
- return 0;
- }
- if (this._cachedWidth === -1) {
- this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth;
- context?.markDidDomLayout();
- }
- return this._cachedWidth;
- }
- getWidthIsFast() {
- if (this._cachedWidth === -1) {
- return false;
- }
- return true;
- }
- /**
- * Visible ranges for a model range
- */
- getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {
- if (!this.domNode) {
- return null;
- }
- if (this._pixelOffsetCache !== null) {
- const startOffset = this._readPixelOffset(this.domNode, lineNumber, startColumn, context);
- if (startOffset === -1) {
- return null;
- }
- const endOffset = this._readPixelOffset(this.domNode, lineNumber, endColumn, context);
- if (endOffset === -1) {
- return null;
- }
- return [new FloatHorizontalRange(startOffset, endOffset - startOffset)];
- }
- return this._readVisibleRangesForRange(this.domNode, lineNumber, startColumn, endColumn, context);
- }
- _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) {
- if (startColumn === endColumn) {
- const pixelOffset = this._readPixelOffset(domNode, lineNumber, startColumn, context);
- if (pixelOffset === -1) {
- return null;
- } else {
- return [new FloatHorizontalRange(pixelOffset, 0)];
- }
- } else {
- return this._readRawVisibleRangesForRange(domNode, startColumn, endColumn, context);
- }
- }
- _readPixelOffset(domNode, lineNumber, column, context) {
- if (this.input.isLTR && this._characterMapping.length === 0) {
- if (this._containsForeignElements === 0) {
- return 0;
- }
- if (this._containsForeignElements === 2) {
- return 0;
- }
- if (this._containsForeignElements === 1) {
- return this.getWidth(context);
- }
- const readingTarget = this._getReadingTarget(domNode);
- if (readingTarget.firstChild) {
- context.markDidDomLayout();
- return readingTarget.firstChild.offsetWidth;
- } else {
- return 0;
- }
- }
- if (this._pixelOffsetCache !== null) {
- const cachedPixelOffset = this._pixelOffsetCache[column];
- if (cachedPixelOffset !== -1) {
- return cachedPixelOffset;
- }
- const result = this._actualReadPixelOffset(domNode, lineNumber, column, context);
- this._pixelOffsetCache[column] = result;
- return result;
- }
- return this._actualReadPixelOffset(domNode, lineNumber, column, context);
- }
- _actualReadPixelOffset(domNode, lineNumber, column, context) {
- if (this._characterMapping.length === 0) {
- const r2 = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), 0, 0, 0, 0, context);
- if (!r2 || r2.length === 0) {
- return -1;
- }
- return r2[0].left;
- }
- if (this.input.isLTR && column === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0) {
- return this.getWidth(context);
- }
- const domPosition = this._characterMapping.getDomPosition(column);
- const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context);
- if (!r || r.length === 0) {
- return -1;
- }
- const result = r[0].left;
- if (this.input.isBasicASCII) {
- const horizontalOffset = this._characterMapping.getHorizontalOffset(column);
- const expectedResult = Math.round(this.input.spaceWidth * horizontalOffset);
- if (Math.abs(expectedResult - result) <= 1) {
- return expectedResult;
- }
- }
- return result;
- }
- _readRawVisibleRangesForRange(domNode, startColumn, endColumn, context) {
- if (this.input.isLTR && startColumn === 1 && endColumn === this._characterMapping.length) {
- return [new FloatHorizontalRange(0, this.getWidth(context))];
- }
- const startDomPosition = this._characterMapping.getDomPosition(startColumn);
- const endDomPosition = this._characterMapping.getDomPosition(endColumn);
- return RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), startDomPosition.partIndex, startDomPosition.charIndex, endDomPosition.partIndex, endDomPosition.charIndex, context);
- }
- /**
- * Returns the column for the text found at a specific offset inside a rendered dom node
- */
- getColumnOfNodeOffset(spanNode, offset) {
- return getColumnOfNodeOffset(this._characterMapping, spanNode, offset);
- }
- };
- WebKitRenderedViewLine = class extends RenderedViewLine {
- _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) {
- const output = super._readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context);
- if (!output || output.length === 0 || startColumn === endColumn || startColumn === 1 && endColumn === this._characterMapping.length) {
- return output;
- }
- if (this.input.isLTR) {
- const endPixelOffset = this._readPixelOffset(domNode, lineNumber, endColumn, context);
- if (endPixelOffset !== -1) {
- const lastRange = output[output.length - 1];
- if (lastRange.left < endPixelOffset) {
- lastRange.width = endPixelOffset - lastRange.left;
- }
- }
- }
- return output;
- }
- };
- createRenderedLine = function() {
- if (isWebKit) {
- return createWebKitRenderedLine;
- }
- return createNormalRenderedLine;
- }();
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js
-function createEmptyContentDataInLines(horizontalDistanceToText) {
- return {
- isAfterLines: false,
- horizontalDistanceToText
- };
-}
-function shadowCaretRangeFromPoint(shadowRoot, x, y) {
- const range2 = document.createRange();
- let el = shadowRoot.elementFromPoint(x, y);
- if (el?.hasChildNodes()) {
- while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE && el.lastChild && el.lastChild.firstChild) {
- el = el.lastChild;
- }
- const rect = el.getBoundingClientRect();
- const elWindow = getWindow(el);
- const fontStyle = elWindow.getComputedStyle(el, null).getPropertyValue("font-style");
- const fontVariant = elWindow.getComputedStyle(el, null).getPropertyValue("font-variant");
- const fontWeight = elWindow.getComputedStyle(el, null).getPropertyValue("font-weight");
- const fontSize = elWindow.getComputedStyle(el, null).getPropertyValue("font-size");
- const lineHeight = elWindow.getComputedStyle(el, null).getPropertyValue("line-height");
- const fontFamily = elWindow.getComputedStyle(el, null).getPropertyValue("font-family");
- const font = `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}/${lineHeight} ${fontFamily}`;
- const text2 = el.innerText;
- let pixelCursor = rect.left;
- let offset = 0;
- let step;
- if (x > rect.left + rect.width) {
- offset = text2.length;
- } else {
- const charWidthReader = CharWidthReader.getInstance();
- for (let i2 = 0; i2 < text2.length + 1; i2++) {
- step = charWidthReader.getCharWidth(text2.charAt(i2), font) / 2;
- pixelCursor += step;
- if (x < pixelCursor) {
- offset = i2;
- break;
- }
- pixelCursor += step;
- }
- }
- range2.setStart(el.firstChild, offset);
- range2.setEnd(el.firstChild, offset);
- }
- return range2;
-}
-var UnknownHitTestResult, ContentHitTestResult, HitTestResult, PointerHandlerLastRenderData, MouseTarget, ElementPath, HitTestContext, BareHitTestRequest, HitTestRequest, EMPTY_CONTENT_AFTER_LINES, MouseTargetFactory, CharWidthReader;
-var init_mouseTarget = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js"() {
- init_editorDom();
- init_viewPart();
- init_viewLine();
- init_position();
- init_range();
- init_cursorColumns();
- init_dom();
- init_cursorAtomicMoveOperations();
- init_model2();
- init_lazy();
- UnknownHitTestResult = class {
- constructor(hitTarget = null) {
- this.hitTarget = hitTarget;
- this.type = 0;
- }
- };
- ContentHitTestResult = class {
- get hitTarget() {
- return this.spanNode;
- }
- constructor(position, spanNode, injectedText) {
- this.position = position;
- this.spanNode = spanNode;
- this.injectedText = injectedText;
- this.type = 1;
- }
- };
- (function(HitTestResult2) {
- function createFromDOMInfo(ctx, spanNode, offset) {
- const position = ctx.getPositionFromDOMInfo(spanNode, offset);
- if (position) {
- return new ContentHitTestResult(position, spanNode, null);
- }
- return new UnknownHitTestResult(spanNode);
- }
- HitTestResult2.createFromDOMInfo = createFromDOMInfo;
- })(HitTestResult || (HitTestResult = {}));
- PointerHandlerLastRenderData = class {
- constructor(lastViewCursorsRenderData, lastTextareaPosition) {
- this.lastViewCursorsRenderData = lastViewCursorsRenderData;
- this.lastTextareaPosition = lastTextareaPosition;
- }
- };
- MouseTarget = class {
- static _deduceRage(position, range2 = null) {
- if (!range2 && position) {
- return new Range(position.lineNumber, position.column, position.lineNumber, position.column);
- }
- return range2 ?? null;
- }
- static createUnknown(element, mouseColumn, position) {
- return { type: 0, element, mouseColumn, position, range: this._deduceRage(position) };
- }
- static createTextarea(element, mouseColumn) {
- return { type: 1, element, mouseColumn, position: null, range: null };
- }
- static createMargin(type, element, mouseColumn, position, range2, detail) {
- return { type, element, mouseColumn, position, range: range2, detail };
- }
- static createViewZone(type, element, mouseColumn, position, detail) {
- return { type, element, mouseColumn, position, range: this._deduceRage(position), detail };
- }
- static createContentText(element, mouseColumn, position, range2, detail) {
- return { type: 6, element, mouseColumn, position, range: this._deduceRage(position, range2), detail };
- }
- static createContentEmpty(element, mouseColumn, position, detail) {
- return { type: 7, element, mouseColumn, position, range: this._deduceRage(position), detail };
- }
- static createContentWidget(element, mouseColumn, detail) {
- return { type: 9, element, mouseColumn, position: null, range: null, detail };
- }
- static createScrollbar(element, mouseColumn, position) {
- return { type: 11, element, mouseColumn, position, range: this._deduceRage(position) };
- }
- static createOverlayWidget(element, mouseColumn, detail) {
- return { type: 12, element, mouseColumn, position: null, range: null, detail };
- }
- static createOutsideEditor(mouseColumn, position, outsidePosition, outsideDistance) {
- return { type: 13, element: null, mouseColumn, position, range: this._deduceRage(position), outsidePosition, outsideDistance };
- }
- static _typeToString(type) {
- if (type === 1) {
- return "TEXTAREA";
- }
- if (type === 2) {
- return "GUTTER_GLYPH_MARGIN";
- }
- if (type === 3) {
- return "GUTTER_LINE_NUMBERS";
- }
- if (type === 4) {
- return "GUTTER_LINE_DECORATIONS";
- }
- if (type === 5) {
- return "GUTTER_VIEW_ZONE";
- }
- if (type === 6) {
- return "CONTENT_TEXT";
- }
- if (type === 7) {
- return "CONTENT_EMPTY";
- }
- if (type === 8) {
- return "CONTENT_VIEW_ZONE";
- }
- if (type === 9) {
- return "CONTENT_WIDGET";
- }
- if (type === 10) {
- return "OVERVIEW_RULER";
- }
- if (type === 11) {
- return "SCROLLBAR";
- }
- if (type === 12) {
- return "OVERLAY_WIDGET";
- }
- return "UNKNOWN";
- }
- static toString(target) {
- return this._typeToString(target.type) + ": " + target.position + " - " + target.range + " - " + JSON.stringify(target.detail);
- }
- };
- ElementPath = class {
- static isTextArea(path) {
- return path.length === 2 && path[0] === 3 && path[1] === 7;
- }
- static isChildOfViewLines(path) {
- return path.length >= 4 && path[0] === 3 && path[3] === 8;
- }
- static isStrictChildOfViewLines(path) {
- return path.length > 4 && path[0] === 3 && path[3] === 8;
- }
- static isChildOfScrollableElement(path) {
- return path.length >= 2 && path[0] === 3 && path[1] === 6;
- }
- static isChildOfMinimap(path) {
- return path.length >= 2 && path[0] === 3 && path[1] === 9;
- }
- static isChildOfContentWidgets(path) {
- return path.length >= 4 && path[0] === 3 && path[3] === 1;
- }
- static isChildOfOverflowGuard(path) {
- return path.length >= 1 && path[0] === 3;
- }
- static isChildOfOverflowingContentWidgets(path) {
- return path.length >= 1 && path[0] === 2;
- }
- static isChildOfOverlayWidgets(path) {
- return path.length >= 2 && path[0] === 3 && path[1] === 4;
- }
- static isChildOfOverflowingOverlayWidgets(path) {
- return path.length >= 1 && path[0] === 5;
- }
- };
- HitTestContext = class _HitTestContext {
- constructor(context, viewHelper, lastRenderData) {
- this.viewModel = context.viewModel;
- const options = context.configuration.options;
- this.layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this.viewDomNode = viewHelper.viewDomNode;
- this.viewLinesGpu = viewHelper.viewLinesGpu;
- this.lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this.stickyTabStops = options.get(
- 132
- /* EditorOption.stickyTabStops */
- );
- this.typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- this.lastRenderData = lastRenderData;
- this._context = context;
- this._viewHelper = viewHelper;
- }
- getZoneAtCoord(mouseVerticalOffset) {
- return _HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset);
- }
- static getZoneAtCoord(context, mouseVerticalOffset) {
- const viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset);
- if (viewZoneWhitespace) {
- const viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2;
- const lineCount = context.viewModel.getLineCount();
- let positionBefore = null;
- let position;
- let positionAfter = null;
- if (viewZoneWhitespace.afterLineNumber !== lineCount) {
- positionAfter = new Position(viewZoneWhitespace.afterLineNumber + 1, 1);
- }
- if (viewZoneWhitespace.afterLineNumber > 0) {
- positionBefore = new Position(viewZoneWhitespace.afterLineNumber, context.viewModel.getLineMaxColumn(viewZoneWhitespace.afterLineNumber));
- }
- if (positionAfter === null) {
- position = positionBefore;
- } else if (positionBefore === null) {
- position = positionAfter;
- } else if (mouseVerticalOffset < viewZoneMiddle) {
- position = positionBefore;
- } else {
- position = positionAfter;
- }
- return {
- viewZoneId: viewZoneWhitespace.id,
- afterLineNumber: viewZoneWhitespace.afterLineNumber,
- positionBefore,
- positionAfter,
- position
- };
- }
- return null;
- }
- getFullLineRangeAtCoord(mouseVerticalOffset) {
- if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) {
- const lineNumber2 = this._context.viewModel.getLineCount();
- const maxLineColumn2 = this._context.viewModel.getLineMaxColumn(lineNumber2);
- return {
- range: new Range(lineNumber2, maxLineColumn2, lineNumber2, maxLineColumn2),
- isAfterLines: true
- };
- }
- const lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);
- const maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);
- return {
- range: new Range(lineNumber, 1, lineNumber, maxLineColumn),
- isAfterLines: false
- };
- }
- getLineNumberAtVerticalOffset(mouseVerticalOffset) {
- return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);
- }
- isAfterLines(mouseVerticalOffset) {
- return this._context.viewLayout.isAfterLines(mouseVerticalOffset);
- }
- isInTopPadding(mouseVerticalOffset) {
- return this._context.viewLayout.isInTopPadding(mouseVerticalOffset);
- }
- isInBottomPadding(mouseVerticalOffset) {
- return this._context.viewLayout.isInBottomPadding(mouseVerticalOffset);
- }
- getVerticalOffsetForLineNumber(lineNumber) {
- return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber);
- }
- findAttribute(element, attr) {
- return _HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode);
- }
- static _findAttribute(element, attr, stopAt) {
- while (element && element !== element.ownerDocument.body) {
- if (element.hasAttribute && element.hasAttribute(attr)) {
- return element.getAttribute(attr);
- }
- if (element === stopAt) {
- return null;
- }
- element = element.parentNode;
- }
- return null;
- }
- getLineWidth(lineNumber) {
- return this._viewHelper.getLineWidth(lineNumber);
- }
- isRtl(lineNumber) {
- return this.viewModel.getTextDirection(lineNumber) === TextDirection.RTL;
- }
- visibleRangeForPosition(lineNumber, column) {
- return this._viewHelper.visibleRangeForPosition(lineNumber, column);
- }
- getPositionFromDOMInfo(spanNode, offset) {
- return this._viewHelper.getPositionFromDOMInfo(spanNode, offset);
- }
- getCurrentScrollTop() {
- return this._context.viewLayout.getCurrentScrollTop();
- }
- getCurrentScrollLeft() {
- return this._context.viewLayout.getCurrentScrollLeft();
- }
- };
- BareHitTestRequest = class {
- constructor(ctx, editorPos, pos, relativePos) {
- this.editorPos = editorPos;
- this.pos = pos;
- this.relativePos = relativePos;
- this.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + this.relativePos.y);
- this.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + this.relativePos.x - ctx.layoutInfo.contentLeft;
- this.isInMarginArea = this.relativePos.x < ctx.layoutInfo.contentLeft && this.relativePos.x >= ctx.layoutInfo.glyphMarginLeft;
- this.isInContentArea = !this.isInMarginArea;
- this.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth));
- }
- };
- HitTestRequest = class extends BareHitTestRequest {
- get target() {
- if (this._useHitTestTarget) {
- return this.hitTestResult.value.hitTarget;
- }
- return this._eventTarget;
- }
- get targetPath() {
- if (this._targetPathCacheElement !== this.target) {
- this._targetPathCacheElement = this.target;
- this._targetPathCacheValue = PartFingerprints.collect(this.target, this._ctx.viewDomNode);
- }
- return this._targetPathCacheValue;
- }
- constructor(ctx, editorPos, pos, relativePos, eventTarget) {
- super(ctx, editorPos, pos, relativePos);
- this.hitTestResult = new Lazy(() => MouseTargetFactory.doHitTest(this._ctx, this));
- this._targetPathCacheElement = null;
- this._targetPathCacheValue = new Uint8Array(0);
- this._ctx = ctx;
- this._eventTarget = eventTarget;
- const hasEventTarget = Boolean(this._eventTarget);
- this._useHitTestTarget = !hasEventTarget;
- }
- toString() {
- return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
- target: ${this.target ? this.target.outerHTML : null}`;
- }
- get wouldBenefitFromHitTestTargetSwitch() {
- return !this._useHitTestTarget && this.hitTestResult.value.hitTarget !== null && this.target !== this.hitTestResult.value.hitTarget;
- }
- switchToHitTestTarget() {
- this._useHitTestTarget = true;
- }
- _getMouseColumn(position = null) {
- if (position && position.column < this._ctx.viewModel.getLineMaxColumn(position.lineNumber)) {
- return CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(position.lineNumber), position.column, this._ctx.viewModel.model.getOptions().tabSize) + 1;
- }
- return this.mouseColumn;
- }
- fulfillUnknown(position = null) {
- return MouseTarget.createUnknown(this.target, this._getMouseColumn(position), position);
- }
- fulfillTextarea() {
- return MouseTarget.createTextarea(this.target, this._getMouseColumn());
- }
- fulfillMargin(type, position, range2, detail) {
- return MouseTarget.createMargin(type, this.target, this._getMouseColumn(position), position, range2, detail);
- }
- fulfillViewZone(type, position, detail) {
- return MouseTarget.createViewZone(type, this.target, this._getMouseColumn(), position, detail);
- }
- fulfillContentText(position, range2, detail) {
- return MouseTarget.createContentText(this.target, this._getMouseColumn(position), position, range2, detail);
- }
- fulfillContentEmpty(position, detail) {
- return MouseTarget.createContentEmpty(this.target, this._getMouseColumn(position), position, detail);
- }
- fulfillContentWidget(detail) {
- return MouseTarget.createContentWidget(this.target, this._getMouseColumn(), detail);
- }
- fulfillScrollbar(position) {
- return MouseTarget.createScrollbar(this.target, this._getMouseColumn(position), position);
- }
- fulfillOverlayWidget(detail) {
- return MouseTarget.createOverlayWidget(this.target, this._getMouseColumn(), detail);
- }
- };
- EMPTY_CONTENT_AFTER_LINES = { isAfterLines: true };
- MouseTargetFactory = class _MouseTargetFactory {
- constructor(context, viewHelper) {
- this._context = context;
- this._viewHelper = viewHelper;
- }
- mouseTargetIsWidget(e) {
- const t = e.target;
- const path = PartFingerprints.collect(t, this._viewHelper.viewDomNode);
- if (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) {
- return true;
- }
- if (ElementPath.isChildOfOverlayWidgets(path) || ElementPath.isChildOfOverflowingOverlayWidgets(path)) {
- return true;
- }
- return false;
- }
- createMouseTarget(lastRenderData, editorPos, pos, relativePos, target) {
- const ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData);
- const request = new HitTestRequest(ctx, editorPos, pos, relativePos, target);
- try {
- const r = _MouseTargetFactory._createMouseTarget(ctx, request);
- if (r.type === 6) {
- if (ctx.stickyTabStops && r.position !== null) {
- const position = _MouseTargetFactory._snapToSoftTabBoundary(r.position, ctx.viewModel);
- const range2 = Range.fromPositions(position, position).plusRange(r.range);
- return request.fulfillContentText(position, range2, r.detail);
- }
- }
- return r;
- } catch (err) {
- return request.fulfillUnknown();
- }
- }
- static _createMouseTarget(ctx, request) {
- if (request.target === null) {
- return request.fulfillUnknown();
- }
- const resolvedRequest = request;
- let result = null;
- if (!ElementPath.isChildOfOverflowGuard(request.targetPath) && !ElementPath.isChildOfOverflowingContentWidgets(request.targetPath) && !ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {
- result = result || request.fulfillUnknown();
- }
- result = result || _MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestMargin(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest);
- result = result || _MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest);
- return result || request.fulfillUnknown();
- }
- static _hitTestContentWidget(ctx, request) {
- if (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) {
- const widgetId = ctx.findAttribute(request.target, "widgetId");
- if (widgetId) {
- return request.fulfillContentWidget(widgetId);
- } else {
- return request.fulfillUnknown();
- }
- }
- return null;
- }
- static _hitTestOverlayWidget(ctx, request) {
- if (ElementPath.isChildOfOverlayWidgets(request.targetPath) || ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {
- const widgetId = ctx.findAttribute(request.target, "widgetId");
- if (widgetId) {
- return request.fulfillOverlayWidget(widgetId);
- } else {
- return request.fulfillUnknown();
- }
- }
- return null;
- }
- static _hitTestViewCursor(ctx, request) {
- if (request.target) {
- const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;
- for (const d of lastViewCursorsRenderData) {
- if (request.target === d.domNode) {
- return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });
- }
- }
- }
- if (request.isInContentArea) {
- const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;
- const mouseContentHorizontalOffset = request.mouseContentHorizontalOffset;
- const mouseVerticalOffset = request.mouseVerticalOffset;
- for (const d of lastViewCursorsRenderData) {
- if (mouseContentHorizontalOffset < d.contentLeft) {
- continue;
- }
- if (mouseContentHorizontalOffset > d.contentLeft + d.width) {
- continue;
- }
- const cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber);
- if (cursorVerticalOffset <= mouseVerticalOffset && mouseVerticalOffset <= cursorVerticalOffset + d.height) {
- return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });
- }
- }
- }
- return null;
- }
- static _hitTestViewZone(ctx, request) {
- const viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset);
- if (viewZoneData) {
- const mouseTargetType = request.isInContentArea ? 8 : 5;
- return request.fulfillViewZone(mouseTargetType, viewZoneData.position, viewZoneData);
- }
- return null;
- }
- static _hitTestTextArea(ctx, request) {
- if (ElementPath.isTextArea(request.targetPath)) {
- if (ctx.lastRenderData.lastTextareaPosition) {
- return request.fulfillContentText(ctx.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false, injectedText: null });
- }
- return request.fulfillTextarea();
- }
- return null;
- }
- static _hitTestMargin(ctx, request) {
- if (request.isInMarginArea) {
- const res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset);
- const pos = res.range.getStartPosition();
- let offset = Math.abs(request.relativePos.x);
- const detail = {
- isAfterLines: res.isAfterLines,
- glyphMarginLeft: ctx.layoutInfo.glyphMarginLeft,
- glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth,
- lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth,
- offsetX: offset
- };
- offset -= ctx.layoutInfo.glyphMarginLeft;
- if (offset <= ctx.layoutInfo.glyphMarginWidth) {
- const modelCoordinate = ctx.viewModel.coordinatesConverter.convertViewPositionToModelPosition(res.range.getStartPosition());
- const lanes = ctx.viewModel.glyphLanes.getLanesAtLine(modelCoordinate.lineNumber);
- detail.glyphMarginLane = lanes[Math.floor(offset / ctx.lineHeight)];
- return request.fulfillMargin(2, pos, res.range, detail);
- }
- offset -= ctx.layoutInfo.glyphMarginWidth;
- if (offset <= ctx.layoutInfo.lineNumbersWidth) {
- return request.fulfillMargin(3, pos, res.range, detail);
- }
- offset -= ctx.layoutInfo.lineNumbersWidth;
- return request.fulfillMargin(4, pos, res.range, detail);
- }
- return null;
- }
- static _hitTestViewLines(ctx, request) {
- if (!ElementPath.isChildOfViewLines(request.targetPath)) {
- return null;
- }
- if (ctx.isInTopPadding(request.mouseVerticalOffset)) {
- return request.fulfillContentEmpty(new Position(1, 1), EMPTY_CONTENT_AFTER_LINES);
- }
- if (ctx.isAfterLines(request.mouseVerticalOffset) || ctx.isInBottomPadding(request.mouseVerticalOffset)) {
- const lineCount = ctx.viewModel.getLineCount();
- const maxLineColumn = ctx.viewModel.getLineMaxColumn(lineCount);
- return request.fulfillContentEmpty(new Position(lineCount, maxLineColumn), EMPTY_CONTENT_AFTER_LINES);
- }
- if (ElementPath.isStrictChildOfViewLines(request.targetPath)) {
- const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- const lineLength = ctx.viewModel.getLineLength(lineNumber);
- const lineWidth = ctx.getLineWidth(lineNumber);
- if (lineLength === 0) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- return request.fulfillContentEmpty(new Position(lineNumber, 1), detail);
- }
- const isRtl = ctx.isRtl(lineNumber);
- if (isRtl) {
- if (request.mouseContentHorizontalOffset + lineWidth <= ctx.layoutInfo.contentWidth - ctx.layoutInfo.verticalScrollbarWidth) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
- return request.fulfillContentEmpty(pos, detail);
- }
- } else if (request.mouseContentHorizontalOffset >= lineWidth) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
- return request.fulfillContentEmpty(pos, detail);
- }
- } else {
- if (ctx.viewLinesGpu) {
- const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- if (ctx.viewModel.getLineLength(lineNumber) === 0) {
- const lineWidth2 = ctx.getLineWidth(lineNumber);
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth2);
- return request.fulfillContentEmpty(new Position(lineNumber, 1), detail);
- }
- const lineWidth = ctx.getLineWidth(lineNumber);
- const isRtl = ctx.isRtl(lineNumber);
- if (isRtl) {
- if (request.mouseContentHorizontalOffset + lineWidth <= ctx.layoutInfo.contentWidth - ctx.layoutInfo.verticalScrollbarWidth) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
- return request.fulfillContentEmpty(pos, detail);
- }
- } else if (request.mouseContentHorizontalOffset >= lineWidth) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
- return request.fulfillContentEmpty(pos, detail);
- }
- const position = ctx.viewLinesGpu.getPositionAtCoordinate(lineNumber, request.mouseContentHorizontalOffset);
- if (position) {
- const detail = {
- injectedText: null,
- mightBeForeignElement: false
- };
- return request.fulfillContentText(position, Range.fromPositions(position, position), detail);
- }
- }
- }
- const hitTestResult = request.hitTestResult.value;
- if (hitTestResult.type === 1) {
- return _MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);
- }
- if (request.wouldBenefitFromHitTestTargetSwitch) {
- request.switchToHitTestTarget();
- return this._createMouseTarget(ctx, request);
- }
- return request.fulfillUnknown();
- }
- static _hitTestMinimap(ctx, request) {
- if (ElementPath.isChildOfMinimap(request.targetPath)) {
- const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
- return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
- }
- return null;
- }
- static _hitTestScrollbarSlider(ctx, request) {
- if (ElementPath.isChildOfScrollableElement(request.targetPath)) {
- if (request.target && request.target.nodeType === 1) {
- const className2 = request.target.className;
- if (className2 && /\b(slider|scrollbar)\b/.test(className2)) {
- const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
- return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
- }
- }
- }
- return null;
- }
- static _hitTestScrollbar(ctx, request) {
- if (ElementPath.isChildOfScrollableElement(request.targetPath)) {
- const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
- return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
- }
- return null;
- }
- getMouseColumn(relativePos) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + relativePos.x - layoutInfo.contentLeft;
- return _MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth);
- }
- static _getMouseColumn(mouseContentHorizontalOffset, typicalHalfwidthCharacterWidth) {
- if (mouseContentHorizontalOffset < 0) {
- return 1;
- }
- const chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth);
- return chars + 1;
- }
- static createMouseTargetFromHitTestPosition(ctx, request, spanNode, pos, injectedText) {
- const lineNumber = pos.lineNumber;
- const column = pos.column;
- const lineWidth = ctx.getLineWidth(lineNumber);
- if (request.mouseContentHorizontalOffset > lineWidth) {
- const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
- return request.fulfillContentEmpty(pos, detail);
- }
- const visibleRange = ctx.visibleRangeForPosition(lineNumber, column);
- if (!visibleRange) {
- return request.fulfillUnknown(pos);
- }
- const columnHorizontalOffset = visibleRange.left;
- if (Math.abs(request.mouseContentHorizontalOffset - columnHorizontalOffset) < 1) {
- return request.fulfillContentText(pos, null, { mightBeForeignElement: !!injectedText, injectedText });
- }
- const points = [];
- points.push({ offset: visibleRange.left, column });
- if (column > 1) {
- const visibleRange2 = ctx.visibleRangeForPosition(lineNumber, column - 1);
- if (visibleRange2) {
- points.push({ offset: visibleRange2.left, column: column - 1 });
- }
- }
- const lineMaxColumn = ctx.viewModel.getLineMaxColumn(lineNumber);
- if (column < lineMaxColumn) {
- const visibleRange2 = ctx.visibleRangeForPosition(lineNumber, column + 1);
- if (visibleRange2) {
- points.push({ offset: visibleRange2.left, column: column + 1 });
- }
- }
- points.sort((a, b) => a.offset - b.offset);
- const mouseCoordinates = request.pos.toClientCoordinates(getWindow(ctx.viewDomNode));
- const spanNodeClientRect = spanNode.getBoundingClientRect();
- const mouseIsOverSpanNode = spanNodeClientRect.left <= mouseCoordinates.clientX && mouseCoordinates.clientX <= spanNodeClientRect.right;
- let rng = null;
- for (let i2 = 1; i2 < points.length; i2++) {
- const prev = points[i2 - 1];
- const curr = points[i2];
- if (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) {
- rng = new Range(lineNumber, prev.column, lineNumber, curr.column);
- const prevDelta = Math.abs(prev.offset - request.mouseContentHorizontalOffset);
- const nextDelta = Math.abs(curr.offset - request.mouseContentHorizontalOffset);
- pos = prevDelta < nextDelta ? new Position(lineNumber, prev.column) : new Position(lineNumber, curr.column);
- break;
- }
- }
- return request.fulfillContentText(pos, rng, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText, injectedText });
- }
- /**
- * Most probably WebKit browsers and Edge
- */
- static _doHitTestWithCaretRangeFromPoint(ctx, request) {
- const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
- const lineStartVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber);
- const lineEndVerticalOffset = lineStartVerticalOffset + ctx.lineHeight;
- const isBelowLastLine = lineNumber === ctx.viewModel.getLineCount() && request.mouseVerticalOffset > lineEndVerticalOffset;
- if (!isBelowLastLine) {
- const lineCenteredVerticalOffset = Math.floor((lineStartVerticalOffset + lineEndVerticalOffset) / 2);
- let adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset);
- if (adjustedPageY <= request.editorPos.y) {
- adjustedPageY = request.editorPos.y + 1;
- }
- if (adjustedPageY >= request.editorPos.y + request.editorPos.height) {
- adjustedPageY = request.editorPos.y + request.editorPos.height - 1;
- }
- const adjustedPage = new PageCoordinates(request.pos.x, adjustedPageY);
- const r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates(getWindow(ctx.viewDomNode)));
- if (r.type === 1) {
- return r;
- }
- }
- return this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates(getWindow(ctx.viewDomNode)));
- }
- static _actualDoHitTestWithCaretRangeFromPoint(ctx, coords) {
- const shadowRoot = getShadowRoot(ctx.viewDomNode);
- let range2;
- if (shadowRoot) {
- if (typeof shadowRoot.caretRangeFromPoint === "undefined") {
- range2 = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);
- } else {
- range2 = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY);
- }
- } else {
- range2 = ctx.viewDomNode.ownerDocument.caretRangeFromPoint(coords.clientX, coords.clientY);
- }
- if (!range2 || !range2.startContainer) {
- return new UnknownHitTestResult();
- }
- const startContainer = range2.startContainer;
- if (startContainer.nodeType === startContainer.TEXT_NODE) {
- const parent1 = startContainer.parentNode;
- const parent2 = parent1 ? parent1.parentNode : null;
- const parent3 = parent2 ? parent2.parentNode : null;
- const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;
- if (parent3ClassName === ViewLine.CLASS_NAME) {
- return HitTestResult.createFromDOMInfo(ctx, parent1, range2.startOffset);
- } else {
- return new UnknownHitTestResult(startContainer.parentNode);
- }
- } else if (startContainer.nodeType === startContainer.ELEMENT_NODE) {
- const parent1 = startContainer.parentNode;
- const parent2 = parent1 ? parent1.parentNode : null;
- const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;
- if (parent2ClassName === ViewLine.CLASS_NAME) {
- return HitTestResult.createFromDOMInfo(ctx, startContainer, startContainer.textContent.length);
- } else {
- return new UnknownHitTestResult(startContainer);
- }
- }
- return new UnknownHitTestResult();
- }
- /**
- * Most probably Gecko
- */
- static _doHitTestWithCaretPositionFromPoint(ctx, coords) {
- const hitResult = ctx.viewDomNode.ownerDocument.caretPositionFromPoint(coords.clientX, coords.clientY);
- if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) {
- const parent1 = hitResult.offsetNode.parentNode;
- const parent2 = parent1 ? parent1.parentNode : null;
- const parent3 = parent2 ? parent2.parentNode : null;
- const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;
- if (parent3ClassName === ViewLine.CLASS_NAME) {
- return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode.parentNode, hitResult.offset);
- } else {
- return new UnknownHitTestResult(hitResult.offsetNode.parentNode);
- }
- }
- if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) {
- const parent1 = hitResult.offsetNode.parentNode;
- const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? parent1.className : null;
- const parent2 = parent1 ? parent1.parentNode : null;
- const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;
- if (parent1ClassName === ViewLine.CLASS_NAME) {
- const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)];
- if (tokenSpan) {
- return HitTestResult.createFromDOMInfo(ctx, tokenSpan, 0);
- }
- } else if (parent2ClassName === ViewLine.CLASS_NAME) {
- return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode, 0);
- }
- }
- return new UnknownHitTestResult(hitResult.offsetNode);
- }
- static _snapToSoftTabBoundary(position, viewModel) {
- const lineContent = viewModel.getLineContent(position.lineNumber);
- const { tabSize } = viewModel.model.getOptions();
- const newPosition = AtomicTabMoveOperations.atomicPosition(
- lineContent,
- position.column - 1,
- tabSize,
- 2
- /* Direction.Nearest */
- );
- if (newPosition !== -1) {
- return new Position(position.lineNumber, newPosition + 1);
- }
- return position;
- }
- static doHitTest(ctx, request) {
- let result = new UnknownHitTestResult();
- if (typeof ctx.viewDomNode.ownerDocument.caretRangeFromPoint === "function") {
- result = this._doHitTestWithCaretRangeFromPoint(ctx, request);
- } else if (ctx.viewDomNode.ownerDocument.caretPositionFromPoint) {
- result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates(getWindow(ctx.viewDomNode)));
- }
- if (result.type === 1) {
- const injectedText = ctx.viewModel.getInjectedTextAt(result.position);
- const normalizedPosition = ctx.viewModel.normalizePosition(
- result.position,
- 2
- /* PositionAffinity.None */
- );
- if (injectedText || !normalizedPosition.equals(result.position)) {
- result = new ContentHitTestResult(normalizedPosition, result.spanNode, injectedText);
- }
- }
- return result;
- }
- };
- CharWidthReader = class _CharWidthReader {
- static {
- this._INSTANCE = null;
- }
- static getInstance() {
- if (!_CharWidthReader._INSTANCE) {
- _CharWidthReader._INSTANCE = new _CharWidthReader();
- }
- return _CharWidthReader._INSTANCE;
- }
- constructor() {
- this._cache = {};
- this._canvas = document.createElement("canvas");
- }
- getCharWidth(char, font) {
- const cacheKey = char + font;
- if (this._cache[cacheKey]) {
- return this._cache[cacheKey];
- }
- const context = this._canvas.getContext("2d");
- context.font = font;
- const metrics = context.measureText(char);
- const width2 = metrics.width;
- this._cache[cacheKey] = width2;
- return width2;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/common/decorators.js
-function memoize(_target, key, descriptor) {
- let fnKey = null;
- let fn = null;
- if (typeof descriptor.value === "function") {
- fnKey = "value";
- fn = descriptor.value;
- if (fn.length !== 0) {
- console.warn("Memoize should only be used in functions with zero parameters");
- }
- } else if (typeof descriptor.get === "function") {
- fnKey = "get";
- fn = descriptor.get;
- }
- if (!fn) {
- throw new Error("not supported");
- }
- const memoizeKey = `$memoize$${key}`;
- descriptor[fnKey] = function(...args) {
- if (!this.hasOwnProperty(memoizeKey)) {
- Object.defineProperty(this, memoizeKey, {
- configurable: false,
- enumerable: false,
- writable: false,
- value: fn.apply(this, args)
- });
- }
- return this[memoizeKey];
- };
-}
-var init_decorators = __esm({
- "../node_modules/monaco-editor/esm/vs/base/common/decorators.js"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/touch.js
-var __decorate6, EventType2, Gesture;
-var init_touch = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/touch.js"() {
- init_dom();
- init_window();
- init_decorators();
- init_event();
- init_lifecycle();
- init_linkedList();
- __decorate6 = 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;
- };
- (function(EventType3) {
- EventType3.Tap = "-monaco-gesturetap";
- EventType3.Change = "-monaco-gesturechange";
- EventType3.Start = "-monaco-gesturestart";
- EventType3.End = "-monaco-gesturesend";
- EventType3.Contextmenu = "-monaco-gesturecontextmenu";
- })(EventType2 || (EventType2 = {}));
- Gesture = class _Gesture extends Disposable {
- static {
- this.SCROLL_FRICTION = -5e-3;
- }
- static {
- this.HOLD_DELAY = 700;
- }
- static {
- this.CLEAR_TAP_COUNT_TIME = 400;
- }
- // ms
- constructor() {
- super();
- this.dispatched = false;
- this.targets = new LinkedList();
- this.ignoreTargets = new LinkedList();
- this.activeTouches = {};
- this.handle = null;
- this._lastSetTapCountTime = 0;
- this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window: window2, disposables }) => {
- disposables.add(addDisposableListener(window2.document, "touchstart", (e) => this.onTouchStart(e), { passive: false }));
- disposables.add(addDisposableListener(window2.document, "touchend", (e) => this.onTouchEnd(window2, e)));
- disposables.add(addDisposableListener(window2.document, "touchmove", (e) => this.onTouchMove(e), { passive: false }));
- }, { window: mainWindow, disposables: this._store }));
- }
- static addTarget(element) {
- if (!_Gesture.isTouchDevice()) {
- return Disposable.None;
- }
- if (!_Gesture.INSTANCE) {
- _Gesture.INSTANCE = markAsSingleton(new _Gesture());
- }
- const remove = _Gesture.INSTANCE.targets.push(element);
- return toDisposable(remove);
- }
- static ignoreTarget(element) {
- if (!_Gesture.isTouchDevice()) {
- return Disposable.None;
- }
- if (!_Gesture.INSTANCE) {
- _Gesture.INSTANCE = markAsSingleton(new _Gesture());
- }
- const remove = _Gesture.INSTANCE.ignoreTargets.push(element);
- return toDisposable(remove);
- }
- static isTouchDevice() {
- return "ontouchstart" in mainWindow || navigator.maxTouchPoints > 0;
- }
- dispose() {
- if (this.handle) {
- this.handle.dispose();
- this.handle = null;
- }
- super.dispose();
- }
- onTouchStart(e) {
- const timestamp = Date.now();
- if (this.handle) {
- this.handle.dispose();
- this.handle = null;
- }
- for (let i2 = 0, len = e.targetTouches.length; i2 < len; i2++) {
- const touch = e.targetTouches.item(i2);
- this.activeTouches[touch.identifier] = {
- id: touch.identifier,
- initialTarget: touch.target,
- initialTimeStamp: timestamp,
- initialPageX: touch.pageX,
- initialPageY: touch.pageY,
- rollingTimestamps: [timestamp],
- rollingPageX: [touch.pageX],
- rollingPageY: [touch.pageY]
- };
- const evt = this.newGestureEvent(EventType2.Start, touch.target);
- evt.pageX = touch.pageX;
- evt.pageY = touch.pageY;
- this.dispatchEvent(evt);
- }
- if (this.dispatched) {
- e.preventDefault();
- e.stopPropagation();
- this.dispatched = false;
- }
- }
- onTouchEnd(targetWindow, e) {
- const timestamp = Date.now();
- const activeTouchCount = Object.keys(this.activeTouches).length;
- for (let i2 = 0, len = e.changedTouches.length; i2 < len; i2++) {
- const touch = e.changedTouches.item(i2);
- if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {
- console.warn("move of an UNKNOWN touch", touch);
- continue;
- }
- const data = this.activeTouches[touch.identifier], holdTime = Date.now() - data.initialTimeStamp;
- if (holdTime < _Gesture.HOLD_DELAY && Math.abs(data.initialPageX - data.rollingPageX.at(-1)) < 30 && Math.abs(data.initialPageY - data.rollingPageY.at(-1)) < 30) {
- const evt = this.newGestureEvent(EventType2.Tap, data.initialTarget);
- evt.pageX = data.rollingPageX.at(-1);
- evt.pageY = data.rollingPageY.at(-1);
- this.dispatchEvent(evt);
- } else if (holdTime >= _Gesture.HOLD_DELAY && Math.abs(data.initialPageX - data.rollingPageX.at(-1)) < 30 && Math.abs(data.initialPageY - data.rollingPageY.at(-1)) < 30) {
- const evt = this.newGestureEvent(EventType2.Contextmenu, data.initialTarget);
- evt.pageX = data.rollingPageX.at(-1);
- evt.pageY = data.rollingPageY.at(-1);
- this.dispatchEvent(evt);
- } else if (activeTouchCount === 1) {
- const finalX = data.rollingPageX.at(-1);
- const finalY = data.rollingPageY.at(-1);
- const deltaT = data.rollingTimestamps.at(-1) - data.rollingTimestamps[0];
- const deltaX = finalX - data.rollingPageX[0];
- const deltaY = finalY - data.rollingPageY[0];
- const dispatchTo = [...this.targets].filter((t) => data.initialTarget instanceof Node && t.contains(data.initialTarget));
- this.inertia(
- targetWindow,
- dispatchTo,
- timestamp,
- // time now
- Math.abs(deltaX) / deltaT,
- // speed
- deltaX > 0 ? 1 : -1,
- // x direction
- finalX,
- // x now
- Math.abs(deltaY) / deltaT,
- // y speed
- deltaY > 0 ? 1 : -1,
- // y direction
- finalY
- // y now
- );
- }
- this.dispatchEvent(this.newGestureEvent(EventType2.End, data.initialTarget));
- delete this.activeTouches[touch.identifier];
- }
- if (this.dispatched) {
- e.preventDefault();
- e.stopPropagation();
- this.dispatched = false;
- }
- }
- newGestureEvent(type, initialTarget) {
- const event = document.createEvent("CustomEvent");
- event.initEvent(type, false, true);
- event.initialTarget = initialTarget;
- event.tapCount = 0;
- return event;
- }
- dispatchEvent(event) {
- if (event.type === EventType2.Tap) {
- const currentTime = (/* @__PURE__ */ new Date()).getTime();
- let setTapCount = 0;
- if (currentTime - this._lastSetTapCountTime > _Gesture.CLEAR_TAP_COUNT_TIME) {
- setTapCount = 1;
- } else {
- setTapCount = 2;
- }
- this._lastSetTapCountTime = currentTime;
- event.tapCount = setTapCount;
- } else if (event.type === EventType2.Change || event.type === EventType2.Contextmenu) {
- this._lastSetTapCountTime = 0;
- }
- if (event.initialTarget instanceof Node) {
- for (const ignoreTarget of this.ignoreTargets) {
- if (ignoreTarget.contains(event.initialTarget)) {
- return;
- }
- }
- const targets = [];
- for (const target of this.targets) {
- if (target.contains(event.initialTarget)) {
- let depth = 0;
- let now = event.initialTarget;
- while (now && now !== target) {
- depth++;
- now = now.parentElement;
- }
- targets.push([depth, target]);
- }
- }
- targets.sort((a, b) => a[0] - b[0]);
- for (const [_, target] of targets) {
- target.dispatchEvent(event);
- this.dispatched = true;
- }
- }
- }
- inertia(targetWindow, dispatchTo, t1, vX, dirX, x, vY, dirY, y) {
- this.handle = scheduleAtNextAnimationFrame(targetWindow, () => {
- const now = Date.now();
- const deltaT = now - t1;
- let delta_pos_x = 0, delta_pos_y = 0;
- let stopped = true;
- vX += _Gesture.SCROLL_FRICTION * deltaT;
- vY += _Gesture.SCROLL_FRICTION * deltaT;
- if (vX > 0) {
- stopped = false;
- delta_pos_x = dirX * vX * deltaT;
- }
- if (vY > 0) {
- stopped = false;
- delta_pos_y = dirY * vY * deltaT;
- }
- const evt = this.newGestureEvent(EventType2.Change);
- evt.translationX = delta_pos_x;
- evt.translationY = delta_pos_y;
- dispatchTo.forEach((d) => d.dispatchEvent(evt));
- if (!stopped) {
- this.inertia(targetWindow, dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y);
- }
- });
- }
- onTouchMove(e) {
- const timestamp = Date.now();
- for (let i2 = 0, len = e.changedTouches.length; i2 < len; i2++) {
- const touch = e.changedTouches.item(i2);
- if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {
- console.warn("end of an UNKNOWN touch", touch);
- continue;
- }
- const data = this.activeTouches[touch.identifier];
- const evt = this.newGestureEvent(EventType2.Change, data.initialTarget);
- evt.translationX = touch.pageX - data.rollingPageX.at(-1);
- evt.translationY = touch.pageY - data.rollingPageY.at(-1);
- evt.pageX = touch.pageX;
- evt.pageY = touch.pageY;
- this.dispatchEvent(evt);
- if (data.rollingPageX.length > 3) {
- data.rollingPageX.shift();
- data.rollingPageY.shift();
- data.rollingTimestamps.shift();
- }
- data.rollingPageX.push(touch.pageX);
- data.rollingPageY.push(touch.pageY);
- data.rollingTimestamps.push(timestamp);
- }
- if (this.dispatched) {
- e.preventDefault();
- e.stopPropagation();
- this.dispatched = false;
- }
- }
- };
- __decorate6([
- memoize
- ], Gesture, "isTouchDevice", null);
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js
-var Widget;
-var init_widget = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"() {
- init_dom();
- init_keyboardEvent();
- init_mouseEvent();
- init_touch();
- init_lifecycle();
- Widget = class extends Disposable {
- onclick(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.CLICK, (e) => listener(new StandardMouseEvent(getWindow(domNode), e))));
- }
- onmousedown(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.MOUSE_DOWN, (e) => listener(new StandardMouseEvent(getWindow(domNode), e))));
- }
- onmouseover(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.MOUSE_OVER, (e) => listener(new StandardMouseEvent(getWindow(domNode), e))));
- }
- onmouseleave(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.MOUSE_LEAVE, (e) => listener(new StandardMouseEvent(getWindow(domNode), e))));
- }
- onkeydown(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.KEY_DOWN, (e) => listener(new StandardKeyboardEvent(e))));
- }
- onkeyup(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.KEY_UP, (e) => listener(new StandardKeyboardEvent(e))));
- }
- oninput(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.INPUT, listener));
- }
- onblur(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.BLUR, listener));
- }
- onfocus(domNode, listener) {
- this._register(addDisposableListener(domNode, EventType.FOCUS, listener));
- }
- ignoreGesture(domNode) {
- return Gesture.ignoreTarget(domNode);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js
-var ARROW_IMG_SIZE, ScrollbarArrow;
-var init_scrollbarArrow = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js"() {
- init_globalPointerMoveMonitor();
- init_widget();
- init_async();
- init_themables();
- init_dom();
- ARROW_IMG_SIZE = 11;
- ScrollbarArrow = class extends Widget {
- constructor(opts) {
- super();
- this._onActivate = opts.onActivate;
- this.bgDomNode = document.createElement("div");
- this.bgDomNode.className = "arrow-background";
- this.bgDomNode.style.position = "absolute";
- this.bgDomNode.style.width = opts.bgWidth + "px";
- this.bgDomNode.style.height = opts.bgHeight + "px";
- if (typeof opts.top !== "undefined") {
- this.bgDomNode.style.top = "0px";
- }
- if (typeof opts.left !== "undefined") {
- this.bgDomNode.style.left = "0px";
- }
- if (typeof opts.bottom !== "undefined") {
- this.bgDomNode.style.bottom = "0px";
- }
- if (typeof opts.right !== "undefined") {
- this.bgDomNode.style.right = "0px";
- }
- this.domNode = document.createElement("div");
- this.domNode.className = opts.className;
- this.domNode.classList.add(...ThemeIcon.asClassNameArray(opts.icon));
- this.domNode.style.position = "absolute";
- this.domNode.style.width = ARROW_IMG_SIZE + "px";
- this.domNode.style.height = ARROW_IMG_SIZE + "px";
- if (typeof opts.top !== "undefined") {
- this.domNode.style.top = opts.top + "px";
- }
- if (typeof opts.left !== "undefined") {
- this.domNode.style.left = opts.left + "px";
- }
- if (typeof opts.bottom !== "undefined") {
- this.domNode.style.bottom = opts.bottom + "px";
- }
- if (typeof opts.right !== "undefined") {
- this.domNode.style.right = opts.right + "px";
- }
- this._pointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());
- this._register(addStandardDisposableListener(this.bgDomNode, EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));
- this._register(addStandardDisposableListener(this.domNode, EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));
- this._pointerdownRepeatTimer = this._register(new WindowIntervalTimer());
- this._pointerdownScheduleRepeatTimer = this._register(new TimeoutTimer());
- }
- _arrowPointerDown(e) {
- if (!e.target || !(e.target instanceof Element)) {
- return;
- }
- const scheduleRepeater = () => {
- this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1e3 / 24, getWindow(e));
- };
- this._onActivate();
- this._pointerdownRepeatTimer.cancel();
- this._pointerdownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200);
- this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (pointerMoveData) => {
- }, () => {
- this._pointerdownRepeatTimer.cancel();
- this._pointerdownScheduleRepeatTimer.cancel();
- });
- e.preventDefault();
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js
-var ScrollbarVisibilityController;
-var init_scrollbarVisibilityController = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js"() {
- init_async();
- init_lifecycle();
- ScrollbarVisibilityController = class extends Disposable {
- constructor(visibility, visibleClassName, invisibleClassName) {
- super();
- this._visibility = visibility;
- this._visibleClassName = visibleClassName;
- this._invisibleClassName = invisibleClassName;
- this._domNode = null;
- this._isVisible = false;
- this._isNeeded = false;
- this._rawShouldBeVisible = false;
- this._shouldBeVisible = false;
- this._revealTimer = this._register(new TimeoutTimer());
- }
- setVisibility(visibility) {
- if (this._visibility !== visibility) {
- this._visibility = visibility;
- this._updateShouldBeVisible();
- }
- }
- // ----------------- Hide / Reveal
- setShouldBeVisible(rawShouldBeVisible) {
- this._rawShouldBeVisible = rawShouldBeVisible;
- this._updateShouldBeVisible();
- }
- _applyVisibilitySetting() {
- if (this._visibility === 2) {
- return false;
- }
- if (this._visibility === 3) {
- return true;
- }
- return this._rawShouldBeVisible;
- }
- _updateShouldBeVisible() {
- const shouldBeVisible = this._applyVisibilitySetting();
- if (this._shouldBeVisible !== shouldBeVisible) {
- this._shouldBeVisible = shouldBeVisible;
- this.ensureVisibility();
- }
- }
- setIsNeeded(isNeeded) {
- if (this._isNeeded !== isNeeded) {
- this._isNeeded = isNeeded;
- this.ensureVisibility();
- }
- }
- setDomNode(domNode) {
- this._domNode = domNode;
- this._domNode.setClassName(this._invisibleClassName);
- this.setShouldBeVisible(false);
- }
- ensureVisibility() {
- if (!this._isNeeded) {
- this._hide(false);
- return;
- }
- if (this._shouldBeVisible) {
- this._reveal();
- } else {
- this._hide(true);
- }
- }
- _reveal() {
- if (this._isVisible) {
- return;
- }
- this._isVisible = true;
- this._revealTimer.setIfNotSet(() => {
- this._domNode?.setClassName(this._visibleClassName);
- }, 0);
- }
- _hide(withFadeAway) {
- this._revealTimer.cancel();
- if (!this._isVisible) {
- return;
- }
- this._isVisible = false;
- this._domNode?.setClassName(this._invisibleClassName + (withFadeAway ? " fade" : ""));
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js
-var POINTER_DRAG_RESET_DISTANCE, AbstractScrollbar;
-var init_abstractScrollbar = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js"() {
- init_dom();
- init_fastDomNode();
- init_globalPointerMoveMonitor();
- init_scrollbarArrow();
- init_scrollbarVisibilityController();
- init_widget();
- init_platform();
- POINTER_DRAG_RESET_DISTANCE = 140;
- AbstractScrollbar = class extends Widget {
- constructor(opts) {
- super();
- this._lazyRender = opts.lazyRender;
- this._host = opts.host;
- this._scrollable = opts.scrollable;
- this._scrollByPage = opts.scrollByPage;
- this._scrollbarState = opts.scrollbarState;
- this._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, "visible scrollbar " + opts.extraScrollbarClassName, "invisible scrollbar " + opts.extraScrollbarClassName));
- this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());
- this._pointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());
- this._shouldRender = true;
- this.domNode = createFastDomNode(document.createElement("div"));
- this.domNode.setAttribute("role", "presentation");
- this.domNode.setAttribute("aria-hidden", "true");
- this._visibilityController.setDomNode(this.domNode);
- this.domNode.setPosition("absolute");
- this._register(addDisposableListener(this.domNode.domNode, EventType.POINTER_DOWN, (e) => this._domNodePointerDown(e)));
- }
- // ----------------- creation
- /**
- * Creates the dom node for an arrow & adds it to the container
- */
- _createArrow(opts) {
- const arrow = this._register(new ScrollbarArrow(opts));
- this.domNode.domNode.appendChild(arrow.bgDomNode);
- this.domNode.domNode.appendChild(arrow.domNode);
- }
- /**
- * Creates the slider dom node, adds it to the container & hooks up the events
- */
- _createSlider(top, left, width2, height) {
- this.slider = createFastDomNode(document.createElement("div"));
- this.slider.setClassName("slider");
- this.slider.setPosition("absolute");
- this.slider.setTop(top);
- this.slider.setLeft(left);
- if (typeof width2 === "number") {
- this.slider.setWidth(width2);
- }
- if (typeof height === "number") {
- this.slider.setHeight(height);
- }
- this.slider.setLayerHinting(true);
- this.slider.setContain("strict");
- this.domNode.domNode.appendChild(this.slider.domNode);
- this._register(addDisposableListener(this.slider.domNode, EventType.POINTER_DOWN, (e) => {
- if (e.button === 0) {
- e.preventDefault();
- this._sliderPointerDown(e);
- }
- }));
- this.onclick(this.slider.domNode, (e) => {
- if (e.leftButton) {
- e.stopPropagation();
- }
- });
- }
- // ----------------- Update state
- _onElementSize(visibleSize) {
- if (this._scrollbarState.setVisibleSize(visibleSize)) {
- this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());
- this._shouldRender = true;
- if (!this._lazyRender) {
- this.render();
- }
- }
- return this._shouldRender;
- }
- _onElementScrollSize(elementScrollSize) {
- if (this._scrollbarState.setScrollSize(elementScrollSize)) {
- this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());
- this._shouldRender = true;
- if (!this._lazyRender) {
- this.render();
- }
- }
- return this._shouldRender;
- }
- _onElementScrollPosition(elementScrollPosition) {
- if (this._scrollbarState.setScrollPosition(elementScrollPosition)) {
- this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());
- this._shouldRender = true;
- if (!this._lazyRender) {
- this.render();
- }
- }
- return this._shouldRender;
- }
- // ----------------- rendering
- beginReveal() {
- this._visibilityController.setShouldBeVisible(true);
- }
- beginHide() {
- this._visibilityController.setShouldBeVisible(false);
- }
- render() {
- if (!this._shouldRender) {
- return;
- }
- this._shouldRender = false;
- this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize());
- this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition());
- }
- // ----------------- DOM events
- _domNodePointerDown(e) {
- if (e.target !== this.domNode.domNode) {
- return;
- }
- this._onPointerDown(e);
- }
- delegatePointerDown(e) {
- const domTop = this.domNode.domNode.getClientRects()[0].top;
- const sliderStart = domTop + this._scrollbarState.getSliderPosition();
- const sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize();
- const pointerPos = this._sliderPointerPosition(e);
- if (sliderStart <= pointerPos && pointerPos <= sliderStop) {
- if (e.button === 0) {
- e.preventDefault();
- this._sliderPointerDown(e);
- }
- } else {
- this._onPointerDown(e);
- }
- }
- _onPointerDown(e) {
- let offsetX;
- let offsetY;
- if (e.target === this.domNode.domNode && typeof e.offsetX === "number" && typeof e.offsetY === "number") {
- offsetX = e.offsetX;
- offsetY = e.offsetY;
- } else {
- const domNodePosition = getDomNodePagePosition(this.domNode.domNode);
- offsetX = e.pageX - domNodePosition.left;
- offsetY = e.pageY - domNodePosition.top;
- }
- const isMouse = e.pointerType === "mouse";
- const isLeftClick = e.button === 0;
- if (isLeftClick || !isMouse) {
- const offset = this._pointerDownRelativePosition(offsetX, offsetY);
- this._setDesiredScrollPositionNow(this._scrollByPage ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(offset) : this._scrollbarState.getDesiredScrollPositionFromOffset(offset));
- }
- if (isLeftClick) {
- e.preventDefault();
- this._sliderPointerDown(e);
- }
- }
- _sliderPointerDown(e) {
- if (!e.target || !(e.target instanceof Element)) {
- return;
- }
- const initialPointerPosition = this._sliderPointerPosition(e);
- const initialPointerOrthogonalPosition = this._sliderOrthogonalPointerPosition(e);
- const initialScrollbarState = this._scrollbarState.clone();
- this.slider.toggleClassName("active", true);
- this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (pointerMoveData) => {
- const pointerOrthogonalPosition = this._sliderOrthogonalPointerPosition(pointerMoveData);
- const pointerOrthogonalDelta = Math.abs(pointerOrthogonalPosition - initialPointerOrthogonalPosition);
- if (isWindows && pointerOrthogonalDelta > POINTER_DRAG_RESET_DISTANCE) {
- this._setDesiredScrollPositionNow(initialScrollbarState.getScrollPosition());
- return;
- }
- const pointerPosition = this._sliderPointerPosition(pointerMoveData);
- const pointerDelta = pointerPosition - initialPointerPosition;
- this._setDesiredScrollPositionNow(initialScrollbarState.getDesiredScrollPositionFromDelta(pointerDelta));
- }, () => {
- this.slider.toggleClassName("active", false);
- this._host.onDragEnd();
- });
- this._host.onDragStart();
- }
- _setDesiredScrollPositionNow(_desiredScrollPosition) {
- const desiredScrollPosition = {};
- this.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition);
- this._scrollable.setScrollPositionNow(desiredScrollPosition);
- }
- updateScrollbarSize(scrollbarSize) {
- this._updateScrollbarSize(scrollbarSize);
- this._scrollbarState.setScrollbarSize(scrollbarSize);
- this._shouldRender = true;
- if (!this._lazyRender) {
- this.render();
- }
- }
- isNeeded() {
- return this._scrollbarState.isNeeded();
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js
-var MINIMUM_SLIDER_SIZE, ScrollbarState;
-var init_scrollbarState = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js"() {
- MINIMUM_SLIDER_SIZE = 20;
- ScrollbarState = class _ScrollbarState {
- constructor(arrowSize, scrollbarSize, oppositeScrollbarSize, visibleSize, scrollSize, scrollPosition) {
- this._scrollbarSize = Math.round(scrollbarSize);
- this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);
- this._arrowSize = Math.round(arrowSize);
- this._visibleSize = visibleSize;
- this._scrollSize = scrollSize;
- this._scrollPosition = scrollPosition;
- this._computedAvailableSize = 0;
- this._computedIsNeeded = false;
- this._computedSliderSize = 0;
- this._computedSliderRatio = 0;
- this._computedSliderPosition = 0;
- this._refreshComputedValues();
- }
- clone() {
- return new _ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);
- }
- setVisibleSize(visibleSize) {
- const iVisibleSize = Math.round(visibleSize);
- if (this._visibleSize !== iVisibleSize) {
- this._visibleSize = iVisibleSize;
- this._refreshComputedValues();
- return true;
- }
- return false;
- }
- setScrollSize(scrollSize) {
- const iScrollSize = Math.round(scrollSize);
- if (this._scrollSize !== iScrollSize) {
- this._scrollSize = iScrollSize;
- this._refreshComputedValues();
- return true;
- }
- return false;
- }
- setScrollPosition(scrollPosition) {
- const iScrollPosition = Math.round(scrollPosition);
- if (this._scrollPosition !== iScrollPosition) {
- this._scrollPosition = iScrollPosition;
- this._refreshComputedValues();
- return true;
- }
- return false;
- }
- setScrollbarSize(scrollbarSize) {
- this._scrollbarSize = Math.round(scrollbarSize);
- }
- setOppositeScrollbarSize(oppositeScrollbarSize) {
- this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);
- }
- static _computeValues(oppositeScrollbarSize, arrowSize, visibleSize, scrollSize, scrollPosition) {
- const computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize);
- const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize);
- const computedIsNeeded = scrollSize > 0 && scrollSize > visibleSize;
- if (!computedIsNeeded) {
- return {
- computedAvailableSize: Math.round(computedAvailableSize),
- computedIsNeeded,
- computedSliderSize: Math.round(computedRepresentableSize),
- computedSliderRatio: 0,
- computedSliderPosition: 0
- };
- }
- const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize)));
- const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize);
- const computedSliderPosition = scrollPosition * computedSliderRatio;
- return {
- computedAvailableSize: Math.round(computedAvailableSize),
- computedIsNeeded,
- computedSliderSize: Math.round(computedSliderSize),
- computedSliderRatio,
- computedSliderPosition: Math.round(computedSliderPosition)
- };
- }
- _refreshComputedValues() {
- const r = _ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);
- this._computedAvailableSize = r.computedAvailableSize;
- this._computedIsNeeded = r.computedIsNeeded;
- this._computedSliderSize = r.computedSliderSize;
- this._computedSliderRatio = r.computedSliderRatio;
- this._computedSliderPosition = r.computedSliderPosition;
- }
- getArrowSize() {
- return this._arrowSize;
- }
- getScrollPosition() {
- return this._scrollPosition;
- }
- getRectangleLargeSize() {
- return this._computedAvailableSize;
- }
- getRectangleSmallSize() {
- return this._scrollbarSize;
- }
- isNeeded() {
- return this._computedIsNeeded;
- }
- getSliderSize() {
- return this._computedSliderSize;
- }
- getSliderPosition() {
- return this._computedSliderPosition;
- }
- /**
- * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider.
- * `offset` is based on the same coordinate system as the `sliderPosition`.
- */
- getDesiredScrollPositionFromOffset(offset) {
- if (!this._computedIsNeeded) {
- return 0;
- }
- const desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2;
- return Math.round(desiredSliderPosition / this._computedSliderRatio);
- }
- /**
- * Compute a desired `scrollPosition` from if offset is before or after the slider position.
- * If offset is before slider, treat as a page up (or left). If after, page down (or right).
- * `offset` and `_computedSliderPosition` are based on the same coordinate system.
- * `_visibleSize` corresponds to a "page" of lines in the returned coordinate system.
- */
- getDesiredScrollPositionFromOffsetPaged(offset) {
- if (!this._computedIsNeeded) {
- return 0;
- }
- const correctedOffset = offset - this._arrowSize;
- let desiredScrollPosition = this._scrollPosition;
- if (correctedOffset < this._computedSliderPosition) {
- desiredScrollPosition -= this._visibleSize;
- } else {
- desiredScrollPosition += this._visibleSize;
- }
- return desiredScrollPosition;
- }
- /**
- * Compute a desired `scrollPosition` such that the slider moves by `delta`.
- */
- getDesiredScrollPositionFromDelta(delta) {
- if (!this._computedIsNeeded) {
- return 0;
- }
- const desiredSliderPosition = this._computedSliderPosition + delta;
- return Math.round(desiredSliderPosition / this._computedSliderRatio);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js
-var HorizontalScrollbar;
-var init_horizontalScrollbar = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js"() {
- init_mouseEvent();
- init_abstractScrollbar();
- init_scrollbarArrow();
- init_scrollbarState();
- init_codicons();
- HorizontalScrollbar = class extends AbstractScrollbar {
- constructor(scrollable, options, host) {
- const scrollDimensions = scrollable.getScrollDimensions();
- const scrollPosition = scrollable.getCurrentScrollPosition();
- super({
- lazyRender: options.lazyRender,
- host,
- scrollbarState: new ScrollbarState(options.horizontalHasArrows ? options.arrowSize : 0, options.horizontal === 2 ? 0 : options.horizontalScrollbarSize, options.vertical === 2 ? 0 : options.verticalScrollbarSize, scrollDimensions.width, scrollDimensions.scrollWidth, scrollPosition.scrollLeft),
- visibility: options.horizontal,
- extraScrollbarClassName: "horizontal",
- scrollable,
- scrollByPage: options.scrollByPage
- });
- if (options.horizontalHasArrows) {
- const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;
- const scrollbarDelta = (options.horizontalScrollbarSize - ARROW_IMG_SIZE) / 2;
- this._createArrow({
- className: "scra",
- icon: Codicon.scrollbarButtonLeft,
- top: scrollbarDelta,
- left: arrowDelta,
- bottom: void 0,
- right: void 0,
- bgWidth: options.arrowSize,
- bgHeight: options.horizontalScrollbarSize,
- onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 1, 0))
- });
- this._createArrow({
- className: "scra",
- icon: Codicon.scrollbarButtonRight,
- top: scrollbarDelta,
- left: void 0,
- bottom: void 0,
- right: arrowDelta,
- bgWidth: options.arrowSize,
- bgHeight: options.horizontalScrollbarSize,
- onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, -1, 0))
- });
- }
- this._createSlider(Math.floor((options.horizontalScrollbarSize - options.horizontalSliderSize) / 2), 0, void 0, options.horizontalSliderSize);
- }
- _updateSlider(sliderSize, sliderPosition) {
- this.slider.setWidth(sliderSize);
- this.slider.setLeft(sliderPosition);
- }
- _renderDomNode(largeSize, smallSize) {
- this.domNode.setWidth(largeSize);
- this.domNode.setHeight(smallSize);
- this.domNode.setLeft(0);
- this.domNode.setBottom(0);
- }
- onDidScroll(e) {
- this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender;
- this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender;
- this._shouldRender = this._onElementSize(e.width) || this._shouldRender;
- return this._shouldRender;
- }
- _pointerDownRelativePosition(offsetX, offsetY) {
- return offsetX;
- }
- _sliderPointerPosition(e) {
- return e.pageX;
- }
- _sliderOrthogonalPointerPosition(e) {
- return e.pageY;
- }
- _updateScrollbarSize(size2) {
- this.slider.setHeight(size2);
- }
- writeScrollPosition(target, scrollPosition) {
- target.scrollLeft = scrollPosition;
- }
- updateOptions(options) {
- this.updateScrollbarSize(options.horizontal === 2 ? 0 : options.horizontalScrollbarSize);
- this._scrollbarState.setOppositeScrollbarSize(options.vertical === 2 ? 0 : options.verticalScrollbarSize);
- this._visibilityController.setVisibility(options.horizontal);
- this._scrollByPage = options.scrollByPage;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js
-var VerticalScrollbar;
-var init_verticalScrollbar = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js"() {
- init_mouseEvent();
- init_abstractScrollbar();
- init_scrollbarArrow();
- init_scrollbarState();
- init_codicons();
- VerticalScrollbar = class extends AbstractScrollbar {
- constructor(scrollable, options, host) {
- const scrollDimensions = scrollable.getScrollDimensions();
- const scrollPosition = scrollable.getCurrentScrollPosition();
- super({
- lazyRender: options.lazyRender,
- host,
- scrollbarState: new ScrollbarState(
- options.verticalHasArrows ? options.arrowSize : 0,
- options.vertical === 2 ? 0 : options.verticalScrollbarSize,
- // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom
- 0,
- scrollDimensions.height,
- scrollDimensions.scrollHeight,
- scrollPosition.scrollTop
- ),
- visibility: options.vertical,
- extraScrollbarClassName: "vertical",
- scrollable,
- scrollByPage: options.scrollByPage
- });
- if (options.verticalHasArrows) {
- const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;
- const scrollbarDelta = (options.verticalScrollbarSize - ARROW_IMG_SIZE) / 2;
- this._createArrow({
- className: "scra",
- icon: Codicon.scrollbarButtonUp,
- top: arrowDelta,
- left: scrollbarDelta,
- bottom: void 0,
- right: void 0,
- bgWidth: options.verticalScrollbarSize,
- bgHeight: options.arrowSize,
- onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, 1))
- });
- this._createArrow({
- className: "scra",
- icon: Codicon.scrollbarButtonDown,
- top: void 0,
- left: scrollbarDelta,
- bottom: arrowDelta,
- right: void 0,
- bgWidth: options.verticalScrollbarSize,
- bgHeight: options.arrowSize,
- onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, -1))
- });
- }
- this._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, void 0);
- }
- _updateSlider(sliderSize, sliderPosition) {
- this.slider.setHeight(sliderSize);
- this.slider.setTop(sliderPosition);
- }
- _renderDomNode(largeSize, smallSize) {
- this.domNode.setWidth(smallSize);
- this.domNode.setHeight(largeSize);
- this.domNode.setRight(0);
- this.domNode.setTop(0);
- }
- onDidScroll(e) {
- this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender;
- this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender;
- this._shouldRender = this._onElementSize(e.height) || this._shouldRender;
- return this._shouldRender;
- }
- _pointerDownRelativePosition(offsetX, offsetY) {
- return offsetY;
- }
- _sliderPointerPosition(e) {
- return e.pageY;
- }
- _sliderOrthogonalPointerPosition(e) {
- return e.pageX;
- }
- _updateScrollbarSize(size2) {
- this.slider.setWidth(size2);
- }
- writeScrollPosition(target, scrollPosition) {
- target.scrollTop = scrollPosition;
- }
- updateOptions(options) {
- this.updateScrollbarSize(options.vertical === 2 ? 0 : options.verticalScrollbarSize);
- this._scrollbarState.setOppositeScrollbarSize(0);
- this._visibilityController.setVisibility(options.vertical);
- this._scrollByPage = options.scrollByPage;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/common/scrollable.js
-function createEaseOutCubic(from, to) {
- const delta = to - from;
- return function(completion) {
- return from + delta * easeOutCubic(completion);
- };
-}
-function createComposed(a, b, cut) {
- return function(completion) {
- if (completion < cut) {
- return a(completion / cut);
- }
- return b((completion - cut) / (1 - cut));
- };
-}
-function easeInCubic(t) {
- return Math.pow(t, 3);
-}
-function easeOutCubic(t) {
- return 1 - easeInCubic(1 - t);
-}
-var ScrollState, Scrollable, SmoothScrollingUpdate, SmoothScrollingOperation;
-var init_scrollable = __esm({
- "../node_modules/monaco-editor/esm/vs/base/common/scrollable.js"() {
- init_event();
- init_lifecycle();
- ScrollState = class _ScrollState {
- constructor(_forceIntegerValues, width2, scrollWidth, scrollLeft, height, scrollHeight, scrollTop) {
- this._forceIntegerValues = _forceIntegerValues;
- this._scrollStateBrand = void 0;
- if (this._forceIntegerValues) {
- width2 = width2 | 0;
- scrollWidth = scrollWidth | 0;
- scrollLeft = scrollLeft | 0;
- height = height | 0;
- scrollHeight = scrollHeight | 0;
- scrollTop = scrollTop | 0;
- }
- this.rawScrollLeft = scrollLeft;
- this.rawScrollTop = scrollTop;
- if (width2 < 0) {
- width2 = 0;
- }
- if (scrollLeft + width2 > scrollWidth) {
- scrollLeft = scrollWidth - width2;
- }
- if (scrollLeft < 0) {
- scrollLeft = 0;
- }
- if (height < 0) {
- height = 0;
- }
- if (scrollTop + height > scrollHeight) {
- scrollTop = scrollHeight - height;
- }
- if (scrollTop < 0) {
- scrollTop = 0;
- }
- this.width = width2;
- this.scrollWidth = scrollWidth;
- this.scrollLeft = scrollLeft;
- this.height = height;
- this.scrollHeight = scrollHeight;
- this.scrollTop = scrollTop;
- }
- equals(other) {
- return this.rawScrollLeft === other.rawScrollLeft && this.rawScrollTop === other.rawScrollTop && this.width === other.width && this.scrollWidth === other.scrollWidth && this.scrollLeft === other.scrollLeft && this.height === other.height && this.scrollHeight === other.scrollHeight && this.scrollTop === other.scrollTop;
- }
- withScrollDimensions(update, useRawScrollPositions) {
- return new _ScrollState(this._forceIntegerValues, typeof update.width !== "undefined" ? update.width : this.width, typeof update.scrollWidth !== "undefined" ? update.scrollWidth : this.scrollWidth, useRawScrollPositions ? this.rawScrollLeft : this.scrollLeft, typeof update.height !== "undefined" ? update.height : this.height, typeof update.scrollHeight !== "undefined" ? update.scrollHeight : this.scrollHeight, useRawScrollPositions ? this.rawScrollTop : this.scrollTop);
- }
- withScrollPosition(update) {
- return new _ScrollState(this._forceIntegerValues, this.width, this.scrollWidth, typeof update.scrollLeft !== "undefined" ? update.scrollLeft : this.rawScrollLeft, this.height, this.scrollHeight, typeof update.scrollTop !== "undefined" ? update.scrollTop : this.rawScrollTop);
- }
- createScrollEvent(previous, inSmoothScrolling) {
- const widthChanged = this.width !== previous.width;
- const scrollWidthChanged = this.scrollWidth !== previous.scrollWidth;
- const scrollLeftChanged = this.scrollLeft !== previous.scrollLeft;
- const heightChanged = this.height !== previous.height;
- const scrollHeightChanged = this.scrollHeight !== previous.scrollHeight;
- const scrollTopChanged = this.scrollTop !== previous.scrollTop;
- return {
- inSmoothScrolling,
- oldWidth: previous.width,
- oldScrollWidth: previous.scrollWidth,
- oldScrollLeft: previous.scrollLeft,
- width: this.width,
- scrollWidth: this.scrollWidth,
- scrollLeft: this.scrollLeft,
- oldHeight: previous.height,
- oldScrollHeight: previous.scrollHeight,
- oldScrollTop: previous.scrollTop,
- height: this.height,
- scrollHeight: this.scrollHeight,
- scrollTop: this.scrollTop,
- widthChanged,
- scrollWidthChanged,
- scrollLeftChanged,
- heightChanged,
- scrollHeightChanged,
- scrollTopChanged
- };
- }
- };
- Scrollable = class extends Disposable {
- constructor(options) {
- super();
- this._scrollableBrand = void 0;
- this._onScroll = this._register(new Emitter());
- this.onScroll = this._onScroll.event;
- this._smoothScrollDuration = options.smoothScrollDuration;
- this._scheduleAtNextAnimationFrame = options.scheduleAtNextAnimationFrame;
- this._state = new ScrollState(options.forceIntegerValues, 0, 0, 0, 0, 0, 0);
- this._smoothScrolling = null;
- }
- dispose() {
- if (this._smoothScrolling) {
- this._smoothScrolling.dispose();
- this._smoothScrolling = null;
- }
- super.dispose();
- }
- setSmoothScrollDuration(smoothScrollDuration) {
- this._smoothScrollDuration = smoothScrollDuration;
- }
- validateScrollPosition(scrollPosition) {
- return this._state.withScrollPosition(scrollPosition);
- }
- getScrollDimensions() {
- return this._state;
- }
- setScrollDimensions(dimensions, useRawScrollPositions) {
- const newState = this._state.withScrollDimensions(dimensions, useRawScrollPositions);
- this._setState(newState, Boolean(this._smoothScrolling));
- this._smoothScrolling?.acceptScrollDimensions(this._state);
- }
- /**
- * Returns the final scroll position that the instance will have once the smooth scroll animation concludes.
- * If no scroll animation is occurring, it will return the current scroll position instead.
- */
- getFutureScrollPosition() {
- if (this._smoothScrolling) {
- return this._smoothScrolling.to;
- }
- return this._state;
- }
- /**
- * Returns the current scroll position.
- * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation.
- */
- getCurrentScrollPosition() {
- return this._state;
- }
- setScrollPositionNow(update) {
- const newState = this._state.withScrollPosition(update);
- if (this._smoothScrolling) {
- this._smoothScrolling.dispose();
- this._smoothScrolling = null;
- }
- this._setState(newState, false);
- }
- setScrollPositionSmooth(update, reuseAnimation) {
- if (this._smoothScrollDuration === 0) {
- return this.setScrollPositionNow(update);
- }
- if (this._smoothScrolling) {
- update = {
- scrollLeft: typeof update.scrollLeft === "undefined" ? this._smoothScrolling.to.scrollLeft : update.scrollLeft,
- scrollTop: typeof update.scrollTop === "undefined" ? this._smoothScrolling.to.scrollTop : update.scrollTop
- };
- const validTarget = this._state.withScrollPosition(update);
- if (this._smoothScrolling.to.scrollLeft === validTarget.scrollLeft && this._smoothScrolling.to.scrollTop === validTarget.scrollTop) {
- return;
- }
- let newSmoothScrolling;
- if (reuseAnimation) {
- newSmoothScrolling = new SmoothScrollingOperation(this._smoothScrolling.from, validTarget, this._smoothScrolling.startTime, this._smoothScrolling.duration);
- } else {
- newSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration);
- }
- this._smoothScrolling.dispose();
- this._smoothScrolling = newSmoothScrolling;
- } else {
- const validTarget = this._state.withScrollPosition(update);
- this._smoothScrolling = SmoothScrollingOperation.start(this._state, validTarget, this._smoothScrollDuration);
- }
- this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
- if (!this._smoothScrolling) {
- return;
- }
- this._smoothScrolling.animationFrameDisposable = null;
- this._performSmoothScrolling();
- });
- }
- hasPendingScrollAnimation() {
- return Boolean(this._smoothScrolling);
- }
- _performSmoothScrolling() {
- if (!this._smoothScrolling) {
- return;
- }
- const update = this._smoothScrolling.tick();
- const newState = this._state.withScrollPosition(update);
- this._setState(newState, true);
- if (!this._smoothScrolling) {
- return;
- }
- if (update.isDone) {
- this._smoothScrolling.dispose();
- this._smoothScrolling = null;
- return;
- }
- this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
- if (!this._smoothScrolling) {
- return;
- }
- this._smoothScrolling.animationFrameDisposable = null;
- this._performSmoothScrolling();
- });
- }
- _setState(newState, inSmoothScrolling) {
- const oldState = this._state;
- if (oldState.equals(newState)) {
- return;
- }
- this._state = newState;
- this._onScroll.fire(this._state.createScrollEvent(oldState, inSmoothScrolling));
- }
- };
- SmoothScrollingUpdate = class {
- constructor(scrollLeft, scrollTop, isDone) {
- this.scrollLeft = scrollLeft;
- this.scrollTop = scrollTop;
- this.isDone = isDone;
- }
- };
- SmoothScrollingOperation = class _SmoothScrollingOperation {
- constructor(from, to, startTime, duration) {
- this.from = from;
- this.to = to;
- this.duration = duration;
- this.startTime = startTime;
- this.animationFrameDisposable = null;
- this._initAnimations();
- }
- _initAnimations() {
- this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width);
- this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);
- }
- _initAnimation(from, to, viewportSize) {
- const delta = Math.abs(from - to);
- if (delta > 2.5 * viewportSize) {
- let stop1, stop2;
- if (from < to) {
- stop1 = from + 0.75 * viewportSize;
- stop2 = to - 0.75 * viewportSize;
- } else {
- stop1 = from - 0.75 * viewportSize;
- stop2 = to + 0.75 * viewportSize;
- }
- return createComposed(createEaseOutCubic(from, stop1), createEaseOutCubic(stop2, to), 0.33);
- }
- return createEaseOutCubic(from, to);
- }
- dispose() {
- if (this.animationFrameDisposable !== null) {
- this.animationFrameDisposable.dispose();
- this.animationFrameDisposable = null;
- }
- }
- acceptScrollDimensions(state) {
- this.to = state.withScrollPosition(this.to);
- this._initAnimations();
- }
- tick() {
- return this._tick(Date.now());
- }
- _tick(now) {
- const completion = (now - this.startTime) / this.duration;
- if (completion < 1) {
- const newScrollLeft = this.scrollLeft(completion);
- const newScrollTop = this.scrollTop(completion);
- return new SmoothScrollingUpdate(newScrollLeft, newScrollTop, false);
- }
- return new SmoothScrollingUpdate(this.to.scrollLeft, this.to.scrollTop, true);
- }
- combine(from, to, duration) {
- return _SmoothScrollingOperation.start(from, to, duration);
- }
- static start(from, to, duration) {
- duration = duration + 10;
- const startTime = Date.now() - 10;
- return new _SmoothScrollingOperation(from, to, startTime, duration);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css
-var init_scrollbars = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js
-function resolveOptions(opts) {
- const result = {
- lazyRender: typeof opts.lazyRender !== "undefined" ? opts.lazyRender : false,
- className: typeof opts.className !== "undefined" ? opts.className : "",
- useShadows: typeof opts.useShadows !== "undefined" ? opts.useShadows : true,
- handleMouseWheel: typeof opts.handleMouseWheel !== "undefined" ? opts.handleMouseWheel : true,
- flipAxes: typeof opts.flipAxes !== "undefined" ? opts.flipAxes : false,
- consumeMouseWheelIfScrollbarIsNeeded: typeof opts.consumeMouseWheelIfScrollbarIsNeeded !== "undefined" ? opts.consumeMouseWheelIfScrollbarIsNeeded : false,
- alwaysConsumeMouseWheel: typeof opts.alwaysConsumeMouseWheel !== "undefined" ? opts.alwaysConsumeMouseWheel : false,
- scrollYToX: typeof opts.scrollYToX !== "undefined" ? opts.scrollYToX : false,
- mouseWheelScrollSensitivity: typeof opts.mouseWheelScrollSensitivity !== "undefined" ? opts.mouseWheelScrollSensitivity : 1,
- fastScrollSensitivity: typeof opts.fastScrollSensitivity !== "undefined" ? opts.fastScrollSensitivity : 5,
- scrollPredominantAxis: typeof opts.scrollPredominantAxis !== "undefined" ? opts.scrollPredominantAxis : true,
- mouseWheelSmoothScroll: typeof opts.mouseWheelSmoothScroll !== "undefined" ? opts.mouseWheelSmoothScroll : true,
- inertialScroll: typeof opts.inertialScroll !== "undefined" ? opts.inertialScroll : false,
- arrowSize: typeof opts.arrowSize !== "undefined" ? opts.arrowSize : 11,
- listenOnDomNode: typeof opts.listenOnDomNode !== "undefined" ? opts.listenOnDomNode : null,
- horizontal: typeof opts.horizontal !== "undefined" ? opts.horizontal : 1,
- horizontalScrollbarSize: typeof opts.horizontalScrollbarSize !== "undefined" ? opts.horizontalScrollbarSize : 10,
- horizontalSliderSize: typeof opts.horizontalSliderSize !== "undefined" ? opts.horizontalSliderSize : 0,
- horizontalHasArrows: typeof opts.horizontalHasArrows !== "undefined" ? opts.horizontalHasArrows : false,
- vertical: typeof opts.vertical !== "undefined" ? opts.vertical : 1,
- verticalScrollbarSize: typeof opts.verticalScrollbarSize !== "undefined" ? opts.verticalScrollbarSize : 10,
- verticalHasArrows: typeof opts.verticalHasArrows !== "undefined" ? opts.verticalHasArrows : false,
- verticalSliderSize: typeof opts.verticalSliderSize !== "undefined" ? opts.verticalSliderSize : 0,
- scrollByPage: typeof opts.scrollByPage !== "undefined" ? opts.scrollByPage : false
- };
- result.horizontalSliderSize = typeof opts.horizontalSliderSize !== "undefined" ? opts.horizontalSliderSize : result.horizontalScrollbarSize;
- result.verticalSliderSize = typeof opts.verticalSliderSize !== "undefined" ? opts.verticalSliderSize : result.verticalScrollbarSize;
- if (isMacintosh) {
- result.className += " mac";
- }
- return result;
-}
-var HIDE_TIMEOUT, SCROLL_WHEEL_SENSITIVITY, MouseWheelClassifierItem, MouseWheelClassifier, AbstractScrollableElement, ScrollableElement, SmoothScrollableElement, DomScrollableElement;
-var init_scrollableElement = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"() {
- init_browser();
- init_dom();
- init_fastDomNode();
- init_mouseEvent();
- init_horizontalScrollbar();
- init_verticalScrollbar();
- init_widget();
- init_async();
- init_event();
- init_lifecycle();
- init_platform();
- init_scrollable();
- init_scrollbars();
- HIDE_TIMEOUT = 500;
- SCROLL_WHEEL_SENSITIVITY = 50;
- MouseWheelClassifierItem = class {
- constructor(timestamp, deltaX, deltaY) {
- this.timestamp = timestamp;
- this.deltaX = deltaX;
- this.deltaY = deltaY;
- this.score = 0;
- }
- };
- MouseWheelClassifier = class _MouseWheelClassifier {
- static {
- this.INSTANCE = new _MouseWheelClassifier();
- }
- constructor() {
- this._capacity = 5;
- this._memory = [];
- this._front = -1;
- this._rear = -1;
- }
- isPhysicalMouseWheel() {
- if (this._front === -1 && this._rear === -1) {
- return false;
- }
- let remainingInfluence = 1;
- let score3 = 0;
- let iteration = 1;
- let index = this._rear;
- do {
- const influence = index === this._front ? remainingInfluence : Math.pow(2, -iteration);
- remainingInfluence -= influence;
- score3 += this._memory[index].score * influence;
- if (index === this._front) {
- break;
- }
- index = (this._capacity + index - 1) % this._capacity;
- iteration++;
- } while (true);
- return score3 <= 0.5;
- }
- acceptStandardWheelEvent(e) {
- if (isChrome) {
- const targetWindow = getWindow(e.browserEvent);
- const pageZoomFactor = getZoomFactor(targetWindow);
- this.accept(Date.now(), e.deltaX * pageZoomFactor, e.deltaY * pageZoomFactor);
- } else {
- this.accept(Date.now(), e.deltaX, e.deltaY);
- }
- }
- accept(timestamp, deltaX, deltaY) {
- let previousItem = null;
- const item = new MouseWheelClassifierItem(timestamp, deltaX, deltaY);
- if (this._front === -1 && this._rear === -1) {
- this._memory[0] = item;
- this._front = 0;
- this._rear = 0;
- } else {
- previousItem = this._memory[this._rear];
- this._rear = (this._rear + 1) % this._capacity;
- if (this._rear === this._front) {
- this._front = (this._front + 1) % this._capacity;
- }
- this._memory[this._rear] = item;
- }
- item.score = this._computeScore(item, previousItem);
- }
- /**
- * A score between 0 and 1 for `item`.
- * - a score towards 0 indicates that the source appears to be a physical mouse wheel
- * - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc.
- */
- _computeScore(item, previousItem) {
- if (Math.abs(item.deltaX) > 0 && Math.abs(item.deltaY) > 0) {
- return 1;
- }
- let score3 = 0.5;
- if (!this._isAlmostInt(item.deltaX) || !this._isAlmostInt(item.deltaY)) {
- score3 += 0.25;
- }
- if (previousItem) {
- const absDeltaX = Math.abs(item.deltaX);
- const absDeltaY = Math.abs(item.deltaY);
- const absPreviousDeltaX = Math.abs(previousItem.deltaX);
- const absPreviousDeltaY = Math.abs(previousItem.deltaY);
- const minDeltaX = Math.max(Math.min(absDeltaX, absPreviousDeltaX), 1);
- const minDeltaY = Math.max(Math.min(absDeltaY, absPreviousDeltaY), 1);
- const maxDeltaX = Math.max(absDeltaX, absPreviousDeltaX);
- const maxDeltaY = Math.max(absDeltaY, absPreviousDeltaY);
- const isSameModulo = maxDeltaX % minDeltaX === 0 && maxDeltaY % minDeltaY === 0;
- if (isSameModulo) {
- score3 -= 0.5;
- }
- }
- return Math.min(Math.max(score3, 0), 1);
- }
- _isAlmostInt(value) {
- const epsilon = Number.EPSILON * 100;
- const delta = Math.abs(Math.round(value) - value);
- return delta < 0.01 + epsilon;
- }
- };
- AbstractScrollableElement = class extends Widget {
- get onScroll() {
- return this._onScroll.event;
- }
- get options() {
- return this._options;
- }
- constructor(element, options, scrollable) {
- super();
- this._inertialTimeout = null;
- this._inertialSpeed = { X: 0, Y: 0 };
- this._onScroll = this._register(new Emitter());
- this._onWillScroll = this._register(new Emitter());
- element.style.overflow = "hidden";
- this._options = resolveOptions(options);
- this._scrollable = scrollable;
- this._register(this._scrollable.onScroll((e) => {
- this._onWillScroll.fire(e);
- this._onDidScroll(e);
- this._onScroll.fire(e);
- }));
- const scrollbarHost = {
- onMouseWheel: (mouseWheelEvent) => this._onMouseWheel(mouseWheelEvent),
- onDragStart: () => this._onDragStart(),
- onDragEnd: () => this._onDragEnd()
- };
- this._verticalScrollbar = this._register(new VerticalScrollbar(this._scrollable, this._options, scrollbarHost));
- this._horizontalScrollbar = this._register(new HorizontalScrollbar(this._scrollable, this._options, scrollbarHost));
- this._domNode = document.createElement("div");
- this._domNode.className = "monaco-scrollable-element " + this._options.className;
- this._domNode.setAttribute("role", "presentation");
- this._domNode.style.position = "relative";
- this._domNode.style.overflow = "hidden";
- this._domNode.appendChild(element);
- this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode);
- this._domNode.appendChild(this._verticalScrollbar.domNode.domNode);
- if (this._options.useShadows) {
- this._leftShadowDomNode = createFastDomNode(document.createElement("div"));
- this._leftShadowDomNode.setClassName("shadow");
- this._domNode.appendChild(this._leftShadowDomNode.domNode);
- this._topShadowDomNode = createFastDomNode(document.createElement("div"));
- this._topShadowDomNode.setClassName("shadow");
- this._domNode.appendChild(this._topShadowDomNode.domNode);
- this._topLeftShadowDomNode = createFastDomNode(document.createElement("div"));
- this._topLeftShadowDomNode.setClassName("shadow");
- this._domNode.appendChild(this._topLeftShadowDomNode.domNode);
- } else {
- this._leftShadowDomNode = null;
- this._topShadowDomNode = null;
- this._topLeftShadowDomNode = null;
- }
- this._listenOnDomNode = this._options.listenOnDomNode || this._domNode;
- this._mouseWheelToDispose = [];
- this._setListeningToMouseWheel(this._options.handleMouseWheel);
- this.onmouseover(this._listenOnDomNode, (e) => this._onMouseOver(e));
- this.onmouseleave(this._listenOnDomNode, (e) => this._onMouseLeave(e));
- this._hideTimeout = this._register(new TimeoutTimer());
- this._isDragging = false;
- this._mouseIsOver = false;
- this._shouldRender = true;
- this._revealOnScroll = true;
- }
- dispose() {
- this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);
- if (this._inertialTimeout) {
- this._inertialTimeout.dispose();
- this._inertialTimeout = null;
- }
- super.dispose();
- }
- /**
- * Get the generated 'scrollable' dom node
- */
- getDomNode() {
- return this._domNode;
- }
- getOverviewRulerLayoutInfo() {
- return {
- parent: this._domNode,
- insertBefore: this._verticalScrollbar.domNode.domNode
- };
- }
- /**
- * Delegate a pointer down event to the vertical scrollbar.
- * This is to help with clicking somewhere else and having the scrollbar react.
- */
- delegateVerticalScrollbarPointerDown(browserEvent) {
- this._verticalScrollbar.delegatePointerDown(browserEvent);
- }
- getScrollDimensions() {
- return this._scrollable.getScrollDimensions();
- }
- setScrollDimensions(dimensions) {
- this._scrollable.setScrollDimensions(dimensions, false);
- }
- /**
- * Update the class name of the scrollable element.
- */
- updateClassName(newClassName) {
- this._options.className = newClassName;
- if (isMacintosh) {
- this._options.className += " mac";
- }
- this._domNode.className = "monaco-scrollable-element " + this._options.className;
- }
- /**
- * Update configuration options for the scrollbar.
- */
- updateOptions(newOptions) {
- if (typeof newOptions.handleMouseWheel !== "undefined") {
- this._options.handleMouseWheel = newOptions.handleMouseWheel;
- this._setListeningToMouseWheel(this._options.handleMouseWheel);
- }
- if (typeof newOptions.mouseWheelScrollSensitivity !== "undefined") {
- this._options.mouseWheelScrollSensitivity = newOptions.mouseWheelScrollSensitivity;
- }
- if (typeof newOptions.fastScrollSensitivity !== "undefined") {
- this._options.fastScrollSensitivity = newOptions.fastScrollSensitivity;
- }
- if (typeof newOptions.scrollPredominantAxis !== "undefined") {
- this._options.scrollPredominantAxis = newOptions.scrollPredominantAxis;
- }
- if (typeof newOptions.horizontal !== "undefined") {
- this._options.horizontal = newOptions.horizontal;
- }
- if (typeof newOptions.vertical !== "undefined") {
- this._options.vertical = newOptions.vertical;
- }
- if (typeof newOptions.horizontalScrollbarSize !== "undefined") {
- this._options.horizontalScrollbarSize = newOptions.horizontalScrollbarSize;
- }
- if (typeof newOptions.verticalScrollbarSize !== "undefined") {
- this._options.verticalScrollbarSize = newOptions.verticalScrollbarSize;
- }
- if (typeof newOptions.scrollByPage !== "undefined") {
- this._options.scrollByPage = newOptions.scrollByPage;
- }
- this._horizontalScrollbar.updateOptions(this._options);
- this._verticalScrollbar.updateOptions(this._options);
- if (!this._options.lazyRender) {
- this._render();
- }
- }
- delegateScrollFromMouseWheelEvent(browserEvent) {
- this._onMouseWheel(new StandardWheelEvent(browserEvent));
- }
- async _periodicSync() {
- let scheduleAgain = false;
- if (this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0) {
- this._scrollable.setScrollPositionNow({
- scrollTop: this._scrollable.getCurrentScrollPosition().scrollTop - this._inertialSpeed.Y * 100,
- scrollLeft: this._scrollable.getCurrentScrollPosition().scrollLeft - this._inertialSpeed.X * 100
- });
- this._inertialSpeed.X *= 0.9;
- this._inertialSpeed.Y *= 0.9;
- if (Math.abs(this._inertialSpeed.X) < 0.01) {
- this._inertialSpeed.X = 0;
- }
- if (Math.abs(this._inertialSpeed.Y) < 0.01) {
- this._inertialSpeed.Y = 0;
- }
- scheduleAgain = this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0;
- }
- if (scheduleAgain) {
- if (!this._inertialTimeout) {
- this._inertialTimeout = new TimeoutTimer();
- }
- this._inertialTimeout.cancelAndSet(() => this._periodicSync(), 1e3 / 60);
- } else {
- this._inertialTimeout?.dispose();
- this._inertialTimeout = null;
- }
- }
- // -------------------- mouse wheel scrolling --------------------
- _setListeningToMouseWheel(shouldListen) {
- const isListening = this._mouseWheelToDispose.length > 0;
- if (isListening === shouldListen) {
- return;
- }
- this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);
- if (shouldListen) {
- const onMouseWheel = (browserEvent) => {
- this._onMouseWheel(new StandardWheelEvent(browserEvent));
- };
- this._mouseWheelToDispose.push(addDisposableListener(this._listenOnDomNode, EventType.MOUSE_WHEEL, onMouseWheel, { passive: false }));
- }
- }
- _onMouseWheel(e) {
- if (e.browserEvent?.defaultPrevented) {
- return;
- }
- const classifier = MouseWheelClassifier.INSTANCE;
- {
- classifier.acceptStandardWheelEvent(e);
- }
- let didScroll = false;
- if (e.deltaY || e.deltaX) {
- let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity;
- let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity;
- if (this._options.scrollPredominantAxis) {
- if (this._options.scrollYToX && deltaX + deltaY === 0) {
- deltaX = deltaY = 0;
- } else if (Math.abs(deltaY) >= Math.abs(deltaX)) {
- deltaX = 0;
- } else {
- deltaY = 0;
- }
- }
- if (this._options.flipAxes) {
- [deltaY, deltaX] = [deltaX, deltaY];
- }
- const shiftConvert = !isMacintosh && e.browserEvent && e.browserEvent.shiftKey;
- if ((this._options.scrollYToX || shiftConvert) && !deltaX) {
- deltaX = deltaY;
- deltaY = 0;
- }
- if (e.browserEvent && e.browserEvent.altKey) {
- deltaX = deltaX * this._options.fastScrollSensitivity;
- deltaY = deltaY * this._options.fastScrollSensitivity;
- }
- const futureScrollPosition = this._scrollable.getFutureScrollPosition();
- let desiredScrollPosition = {};
- if (deltaY) {
- const deltaScrollTop = SCROLL_WHEEL_SENSITIVITY * deltaY;
- const desiredScrollTop = futureScrollPosition.scrollTop - (deltaScrollTop < 0 ? Math.floor(deltaScrollTop) : Math.ceil(deltaScrollTop));
- this._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop);
- }
- if (deltaX) {
- const deltaScrollLeft = SCROLL_WHEEL_SENSITIVITY * deltaX;
- const desiredScrollLeft = futureScrollPosition.scrollLeft - (deltaScrollLeft < 0 ? Math.floor(deltaScrollLeft) : Math.ceil(deltaScrollLeft));
- this._horizontalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollLeft);
- }
- desiredScrollPosition = this._scrollable.validateScrollPosition(desiredScrollPosition);
- if (this._options.inertialScroll && (deltaX || deltaY) && !classifier.isPhysicalMouseWheel()) {
- let startPeriodic = false;
- if (this._inertialSpeed.X === 0 && this._inertialSpeed.Y === 0) {
- startPeriodic = true;
- }
- this._inertialSpeed.Y = (deltaY < 0 ? -1 : 1) * Math.abs(deltaY) ** 1.02;
- this._inertialSpeed.X = (deltaX < 0 ? -1 : 1) * Math.abs(deltaX) ** 1.02;
- if (startPeriodic) {
- this._periodicSync();
- }
- }
- if (futureScrollPosition.scrollLeft !== desiredScrollPosition.scrollLeft || futureScrollPosition.scrollTop !== desiredScrollPosition.scrollTop) {
- const canPerformSmoothScroll = this._options.mouseWheelSmoothScroll && classifier.isPhysicalMouseWheel();
- if (canPerformSmoothScroll) {
- this._scrollable.setScrollPositionSmooth(desiredScrollPosition);
- } else {
- this._scrollable.setScrollPositionNow(desiredScrollPosition);
- }
- didScroll = true;
- }
- }
- let consumeMouseWheel = didScroll;
- if (!consumeMouseWheel && this._options.alwaysConsumeMouseWheel) {
- consumeMouseWheel = true;
- }
- if (!consumeMouseWheel && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded())) {
- consumeMouseWheel = true;
- }
- if (consumeMouseWheel) {
- e.preventDefault();
- e.stopPropagation();
- }
- }
- _onDidScroll(e) {
- this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender;
- this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender;
- if (this._options.useShadows) {
- this._shouldRender = true;
- }
- if (this._revealOnScroll) {
- this._reveal();
- }
- if (!this._options.lazyRender) {
- this._render();
- }
- }
- /**
- * Render / mutate the DOM now.
- * Should be used together with the ctor option `lazyRender`.
- */
- renderNow() {
- if (!this._options.lazyRender) {
- throw new Error("Please use `lazyRender` together with `renderNow`!");
- }
- this._render();
- }
- _render() {
- if (!this._shouldRender) {
- return;
- }
- this._shouldRender = false;
- this._horizontalScrollbar.render();
- this._verticalScrollbar.render();
- if (this._options.useShadows) {
- const scrollState = this._scrollable.getCurrentScrollPosition();
- const enableTop = scrollState.scrollTop > 0;
- const enableLeft = scrollState.scrollLeft > 0;
- const leftClassName = enableLeft ? " left" : "";
- const topClassName = enableTop ? " top" : "";
- const topLeftClassName = enableLeft || enableTop ? " top-left-corner" : "";
- this._leftShadowDomNode.setClassName(`shadow${leftClassName}`);
- this._topShadowDomNode.setClassName(`shadow${topClassName}`);
- this._topLeftShadowDomNode.setClassName(`shadow${topLeftClassName}${topClassName}${leftClassName}`);
- }
- }
- // -------------------- fade in / fade out --------------------
- _onDragStart() {
- this._isDragging = true;
- this._reveal();
- }
- _onDragEnd() {
- this._isDragging = false;
- this._hide();
- }
- _onMouseLeave(e) {
- this._mouseIsOver = false;
- this._hide();
- }
- _onMouseOver(e) {
- this._mouseIsOver = true;
- this._reveal();
- }
- _reveal() {
- this._verticalScrollbar.beginReveal();
- this._horizontalScrollbar.beginReveal();
- this._scheduleHide();
- }
- _hide() {
- if (!this._mouseIsOver && !this._isDragging) {
- this._verticalScrollbar.beginHide();
- this._horizontalScrollbar.beginHide();
- }
- }
- _scheduleHide() {
- if (!this._mouseIsOver && !this._isDragging) {
- this._hideTimeout.cancelAndSet(() => this._hide(), HIDE_TIMEOUT);
- }
- }
- };
- ScrollableElement = class extends AbstractScrollableElement {
- constructor(element, options) {
- options = options || {};
- options.mouseWheelSmoothScroll = false;
- const scrollable = new Scrollable({
- forceIntegerValues: true,
- smoothScrollDuration: 0,
- scheduleAtNextAnimationFrame: (callback) => scheduleAtNextAnimationFrame(getWindow(element), callback)
- });
- super(element, options, scrollable);
- this._register(scrollable);
- }
- setScrollPosition(update) {
- this._scrollable.setScrollPositionNow(update);
- }
- };
- SmoothScrollableElement = class extends AbstractScrollableElement {
- constructor(element, options, scrollable) {
- super(element, options, scrollable);
- }
- setScrollPosition(update) {
- if (update.reuseAnimation) {
- this._scrollable.setScrollPositionSmooth(update, update.reuseAnimation);
- } else {
- this._scrollable.setScrollPositionNow(update);
- }
- }
- getScrollPosition() {
- return this._scrollable.getCurrentScrollPosition();
- }
- };
- DomScrollableElement = class extends AbstractScrollableElement {
- constructor(element, options) {
- options = options || {};
- options.mouseWheelSmoothScroll = false;
- const scrollable = new Scrollable({
- forceIntegerValues: false,
- // See https://github.com/microsoft/vscode/issues/139877
- smoothScrollDuration: 0,
- scheduleAtNextAnimationFrame: (callback) => scheduleAtNextAnimationFrame(getWindow(element), callback)
- });
- super(element, options, scrollable);
- this._register(scrollable);
- this._element = element;
- this._register(this.onScroll((e) => {
- if (e.scrollTopChanged) {
- this._element.scrollTop = e.scrollTop;
- }
- if (e.scrollLeftChanged) {
- this._element.scrollLeft = e.scrollLeft;
- }
- }));
- this.scanDomNode();
- }
- setScrollPosition(update) {
- this._scrollable.setScrollPositionNow(update);
- }
- getScrollPosition() {
- return this._scrollable.getCurrentScrollPosition();
- }
- scanDomNode() {
- this.setScrollDimensions({
- width: this._element.clientWidth,
- scrollWidth: this._element.scrollWidth,
- height: this._element.clientHeight,
- scrollHeight: this._element.scrollHeight
- });
- this.setScrollPosition({
- scrollLeft: this._element.scrollLeft,
- scrollTop: this._element.scrollTop
- });
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/dragScrolling.js
-var DragScrolling, DragScrollingOperation, TopBottomDragScrolling, TopBottomDragScrollingOperation, LeftRightDragScrolling, LeftRightDragScrollingOperation;
-var init_dragScrolling = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/dragScrolling.js"() {
- init_dom();
- init_lifecycle();
- init_position();
- init_editorDom();
- init_mouseTarget();
- DragScrolling = class extends Disposable {
- constructor(_context, _viewHelper, _mouseTargetFactory, _dispatchMouse) {
- super();
- this._context = _context;
- this._viewHelper = _viewHelper;
- this._mouseTargetFactory = _mouseTargetFactory;
- this._dispatchMouse = _dispatchMouse;
- this._operation = null;
- }
- dispose() {
- super.dispose();
- this.stop();
- }
- start(position, mouseEvent) {
- if (this._operation) {
- this._operation.setPosition(position, mouseEvent);
- } else {
- this._operation = this._createDragScrollingOperation(position, mouseEvent);
- }
- }
- stop() {
- if (this._operation) {
- this._operation.dispose();
- this._operation = null;
- }
- }
- };
- DragScrollingOperation = class extends Disposable {
- constructor(_context, _viewHelper, _mouseTargetFactory, _dispatchMouse, position, mouseEvent) {
- super();
- this._context = _context;
- this._viewHelper = _viewHelper;
- this._mouseTargetFactory = _mouseTargetFactory;
- this._dispatchMouse = _dispatchMouse;
- this._position = position;
- this._mouseEvent = mouseEvent;
- this._lastTime = Date.now();
- this._animationFrameDisposable = scheduleAtNextAnimationFrame(getWindow(mouseEvent.browserEvent), () => this._execute());
- }
- dispose() {
- this._animationFrameDisposable.dispose();
- super.dispose();
- }
- setPosition(position, mouseEvent) {
- this._position = position;
- this._mouseEvent = mouseEvent;
- }
- /**
- * update internal state and return elapsed ms since last time
- */
- _tick() {
- const now = Date.now();
- const elapsed = now - this._lastTime;
- this._lastTime = now;
- return elapsed;
- }
- };
- TopBottomDragScrolling = class extends DragScrolling {
- _createDragScrollingOperation(position, mouseEvent) {
- return new TopBottomDragScrollingOperation(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, position, mouseEvent);
- }
- };
- TopBottomDragScrollingOperation = class extends DragScrollingOperation {
- /**
- * get the number of lines per second to auto-scroll
- */
- _getScrollSpeed() {
- const lineHeight = this._context.configuration.options.get(
- 75
- /* EditorOption.lineHeight */
- );
- const viewportInLines = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).height / lineHeight;
- const outsideDistanceInLines = this._position.outsideDistance / lineHeight;
- if (outsideDistanceInLines <= 1.5) {
- return Math.max(30, viewportInLines * (1 + outsideDistanceInLines));
- }
- if (outsideDistanceInLines <= 3) {
- return Math.max(60, viewportInLines * (2 + outsideDistanceInLines));
- }
- return Math.max(200, viewportInLines * (7 + outsideDistanceInLines));
- }
- _execute() {
- const lineHeight = this._context.configuration.options.get(
- 75
- /* EditorOption.lineHeight */
- );
- const scrollSpeedInLines = this._getScrollSpeed();
- const elapsed = this._tick();
- const scrollInPixels = scrollSpeedInLines * (elapsed / 1e3) * lineHeight;
- const scrollValue = this._position.outsidePosition === "above" ? -scrollInPixels : scrollInPixels;
- this._context.viewModel.viewLayout.deltaScrollNow(0, scrollValue);
- this._viewHelper.renderNow();
- const viewportData = this._context.viewLayout.getLinesViewportData();
- const edgeLineNumber = this._position.outsidePosition === "above" ? viewportData.startLineNumber : viewportData.endLineNumber;
- let mouseTarget;
- {
- const editorPos = createEditorPagePosition(this._viewHelper.viewDomNode);
- const horizontalScrollbarHeight = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).horizontalScrollbarHeight;
- const pos = new PageCoordinates(this._mouseEvent.pos.x, editorPos.y + editorPos.height - horizontalScrollbarHeight - 0.1);
- const relativePos = createCoordinatesRelativeToEditor(this._viewHelper.viewDomNode, editorPos, pos);
- mouseTarget = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);
- }
- if (!mouseTarget.position || mouseTarget.position.lineNumber !== edgeLineNumber) {
- if (this._position.outsidePosition === "above") {
- mouseTarget = MouseTarget.createOutsideEditor(this._position.mouseColumn, new Position(edgeLineNumber, 1), "above", this._position.outsideDistance);
- } else {
- mouseTarget = MouseTarget.createOutsideEditor(this._position.mouseColumn, new Position(edgeLineNumber, this._context.viewModel.getLineMaxColumn(edgeLineNumber)), "below", this._position.outsideDistance);
- }
- }
- this._dispatchMouse(
- mouseTarget,
- true,
- 2
- /* NavigationCommandRevealType.None */
- );
- this._animationFrameDisposable = scheduleAtNextAnimationFrame(getWindow(mouseTarget.element), () => this._execute());
- }
- };
- LeftRightDragScrolling = class extends DragScrolling {
- _createDragScrollingOperation(position, mouseEvent) {
- return new LeftRightDragScrollingOperation(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, position, mouseEvent);
- }
- };
- LeftRightDragScrollingOperation = class extends DragScrollingOperation {
- /**
- * get the number of cols per second to auto-scroll
- */
- _getScrollSpeed() {
- const charWidth = this._context.configuration.options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalFullwidthCharacterWidth;
- const viewportInChars = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).contentWidth / charWidth;
- const outsideDistanceInChars = this._position.outsideDistance / charWidth;
- if (outsideDistanceInChars <= 1.5) {
- return Math.max(30, viewportInChars * (1 + outsideDistanceInChars));
- }
- if (outsideDistanceInChars <= 3) {
- return Math.max(60, viewportInChars * (2 + outsideDistanceInChars));
- }
- return Math.max(200, viewportInChars * (7 + outsideDistanceInChars));
- }
- _execute() {
- const charWidth = this._context.configuration.options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalFullwidthCharacterWidth;
- const scrollSpeedInChars = this._getScrollSpeed();
- const elapsed = this._tick();
- const scrollInPixels = scrollSpeedInChars * (elapsed / 1e3) * charWidth * 0.5;
- const scrollValue = this._position.outsidePosition === "left" ? -scrollInPixels : scrollInPixels;
- this._context.viewModel.viewLayout.deltaScrollNow(scrollValue, 0);
- this._viewHelper.renderNow();
- if (!this._position.position) {
- return;
- }
- const edgeLineNumber = this._position.position.lineNumber;
- let mouseTarget;
- {
- const editorPos = createEditorPagePosition(this._viewHelper.viewDomNode);
- const horizontalScrollbarHeight = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).horizontalScrollbarHeight;
- const pos = new PageCoordinates(this._mouseEvent.pos.x, editorPos.y + editorPos.height - horizontalScrollbarHeight - 0.1);
- const relativePos = createCoordinatesRelativeToEditor(this._viewHelper.viewDomNode, editorPos, pos);
- mouseTarget = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);
- }
- if (this._position.outsidePosition === "left") {
- mouseTarget = MouseTarget.createOutsideEditor(mouseTarget.mouseColumn, new Position(edgeLineNumber, mouseTarget.mouseColumn), "left", this._position.outsideDistance);
- } else {
- mouseTarget = MouseTarget.createOutsideEditor(mouseTarget.mouseColumn, new Position(edgeLineNumber, mouseTarget.mouseColumn), "right", this._position.outsideDistance);
- }
- this._dispatchMouse(
- mouseTarget,
- true,
- 2
- /* NavigationCommandRevealType.None */
- );
- this._animationFrameDisposable = scheduleAtNextAnimationFrame(getWindow(mouseTarget.element), () => this._execute());
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js
-var MouseHandler, MouseDownOperation, MouseDownState;
-var init_mouseHandler = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js"() {
- init_dom();
- init_mouseEvent();
- init_lifecycle();
- init_platform();
- init_mouseTarget();
- init_editorDom();
- init_editorZoom();
- init_position();
- init_selection();
- init_viewEventHandler();
- init_scrollableElement();
- init_dragScrolling();
- MouseHandler = class extends ViewEventHandler {
- constructor(context, viewController, viewHelper) {
- super();
- this._mouseLeaveMonitor = null;
- this._context = context;
- this.viewController = viewController;
- this.viewHelper = viewHelper;
- this.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);
- this._mouseDownOperation = this._register(new MouseDownOperation(this._context, this.viewController, this.viewHelper, this.mouseTargetFactory, (e, testEventTarget) => this._createMouseTarget(e, testEventTarget), (e) => this._getMouseColumn(e)));
- this.lastMouseLeaveTime = -1;
- this._height = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).height;
- const mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);
- this._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));
- this._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {
- this._onMouseMove(e);
- if (!this._mouseLeaveMonitor) {
- this._mouseLeaveMonitor = addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, "mousemove", (e2) => {
- if (!this.viewHelper.viewDomNode.contains(e2.target)) {
- this._onMouseLeave(new EditorMouseEvent(e2, false, this.viewHelper.viewDomNode));
- }
- });
- }
- }));
- this._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));
- this._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));
- let capturePointerId = 0;
- this._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {
- capturePointerId = pointerId;
- }));
- this._register(addDisposableListener(this.viewHelper.viewDomNode, EventType.POINTER_UP, (e) => {
- this._mouseDownOperation.onPointerUp();
- }));
- this._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));
- this._setupMouseWheelZoomListener();
- this._context.addEventHandler(this);
- }
- _setupMouseWheelZoomListener() {
- const classifier = MouseWheelClassifier.INSTANCE;
- let prevMouseWheelTime = 0;
- let gestureStartZoomLevel = EditorZoom.getZoomLevel();
- let gestureHasZoomModifiers = false;
- let gestureAccumulatedDelta = 0;
- const onMouseWheel = (browserEvent) => {
- this.viewController.emitMouseWheel(browserEvent);
- if (!this._context.configuration.options.get(
- 84
- /* EditorOption.mouseWheelZoom */
- )) {
- return;
- }
- const e = new StandardWheelEvent(browserEvent);
- classifier.acceptStandardWheelEvent(e);
- if (classifier.isPhysicalMouseWheel()) {
- if (hasMouseWheelZoomModifiers(browserEvent)) {
- const zoomLevel = EditorZoom.getZoomLevel();
- const delta = e.deltaY > 0 ? 1 : -1;
- EditorZoom.setZoomLevel(zoomLevel + delta);
- e.preventDefault();
- e.stopPropagation();
- }
- } else {
- if (Date.now() - prevMouseWheelTime > 50) {
- gestureStartZoomLevel = EditorZoom.getZoomLevel();
- gestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);
- gestureAccumulatedDelta = 0;
- }
- prevMouseWheelTime = Date.now();
- gestureAccumulatedDelta += e.deltaY;
- if (gestureHasZoomModifiers) {
- EditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);
- e.preventDefault();
- e.stopPropagation();
- }
- }
- };
- this._register(addDisposableListener(this.viewHelper.viewDomNode, EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));
- function hasMouseWheelZoomModifiers(browserEvent) {
- return isMacintosh ? (browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey : browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey;
- }
- }
- dispose() {
- this._context.removeEventHandler(this);
- if (this._mouseLeaveMonitor) {
- this._mouseLeaveMonitor.dispose();
- this._mouseLeaveMonitor = null;
- }
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- if (e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- )) {
- const height = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- ).height;
- if (this._height !== height) {
- this._height = height;
- this._mouseDownOperation.onHeightChanged();
- }
- }
- return false;
- }
- onCursorStateChanged(e) {
- this._mouseDownOperation.onCursorStateChanged(e);
- return false;
- }
- onFocusChanged(e) {
- return false;
- }
- // --- end event handlers
- getTargetAtClientPoint(clientX, clientY) {
- const clientPos = new ClientCoordinates(clientX, clientY);
- const pos = clientPos.toPageCoordinates(getWindow(this.viewHelper.viewDomNode));
- const editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);
- if (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {
- return null;
- }
- const relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);
- return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);
- }
- _createMouseTarget(e, testEventTarget) {
- let target = e.target;
- if (!this.viewHelper.viewDomNode.contains(target)) {
- const shadowRoot = getShadowRoot(this.viewHelper.viewDomNode);
- if (shadowRoot) {
- const potentialTarget = shadowRoot.elementsFromPoint(e.posx, e.posy).find((el) => this.viewHelper.viewDomNode.contains(el)) ?? null;
- target = potentialTarget;
- }
- }
- return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);
- }
- _getMouseColumn(e) {
- return this.mouseTargetFactory.getMouseColumn(e.relativePos);
- }
- _onContextMenu(e, testEventTarget) {
- this.viewController.emitContextMenu({
- event: e,
- target: this._createMouseTarget(e, testEventTarget)
- });
- }
- _onMouseMove(e) {
- const targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);
- if (!targetIsWidget) {
- e.preventDefault();
- }
- if (this._mouseDownOperation.isActive()) {
- return;
- }
- const actualMouseMoveTime = e.timestamp;
- if (actualMouseMoveTime < this.lastMouseLeaveTime) {
- return;
- }
- this.viewController.emitMouseMove({
- event: e,
- target: this._createMouseTarget(e, true)
- });
- }
- _onMouseLeave(e) {
- if (this._mouseLeaveMonitor) {
- this._mouseLeaveMonitor.dispose();
- this._mouseLeaveMonitor = null;
- }
- this.lastMouseLeaveTime = (/* @__PURE__ */ new Date()).getTime();
- this.viewController.emitMouseLeave({
- event: e,
- target: null
- });
- }
- _onMouseUp(e) {
- this.viewController.emitMouseUp({
- event: e,
- target: this._createMouseTarget(e, true)
- });
- }
- _onMouseDown(e, pointerId) {
- const t = this._createMouseTarget(e, true);
- const targetIsContent = t.type === 6 || t.type === 7;
- const targetIsGutter = t.type === 2 || t.type === 3 || t.type === 4;
- const targetIsLineNumbers = t.type === 3;
- const selectOnLineNumbers = this._context.configuration.options.get(
- 125
- /* EditorOption.selectOnLineNumbers */
- );
- const targetIsViewZone = t.type === 8 || t.type === 5;
- const targetIsWidget = t.type === 9;
- let shouldHandle = e.leftButton || e.middleButton;
- if (isMacintosh && e.leftButton && e.ctrlKey) {
- shouldHandle = false;
- }
- const focus = () => {
- e.preventDefault();
- this.viewHelper.focusTextArea();
- };
- if (shouldHandle && (targetIsContent || targetIsLineNumbers && selectOnLineNumbers)) {
- focus();
- this._mouseDownOperation.start(t.type, e, pointerId);
- } else if (targetIsGutter) {
- e.preventDefault();
- } else if (targetIsViewZone) {
- const viewZoneData = t.detail;
- if (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {
- focus();
- this._mouseDownOperation.start(t.type, e, pointerId);
- e.preventDefault();
- }
- } else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)) {
- focus();
- e.preventDefault();
- }
- this.viewController.emitMouseDown({
- event: e,
- target: t
- });
- }
- };
- MouseDownOperation = class extends Disposable {
- constructor(_context, _viewController, _viewHelper, _mouseTargetFactory, createMouseTarget, getMouseColumn) {
- super();
- this._context = _context;
- this._viewController = _viewController;
- this._viewHelper = _viewHelper;
- this._mouseTargetFactory = _mouseTargetFactory;
- this._createMouseTarget = createMouseTarget;
- this._getMouseColumn = getMouseColumn;
- this._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));
- this._topBottomDragScrolling = this._register(new TopBottomDragScrolling(this._context, this._viewHelper, this._mouseTargetFactory, (position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)));
- this._leftRightDragScrolling = this._register(new LeftRightDragScrolling(this._context, this._viewHelper, this._mouseTargetFactory, (position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)));
- this._mouseState = new MouseDownState();
- this._currentSelection = new Selection(1, 1, 1, 1);
- this._isActive = false;
- this._lastMouseEvent = null;
- }
- dispose() {
- super.dispose();
- }
- isActive() {
- return this._isActive;
- }
- _onMouseDownThenMove(e) {
- this._lastMouseEvent = e;
- this._mouseState.setModifiers(e);
- const position = this._findMousePosition(e, false);
- if (!position) {
- return;
- }
- if (this._mouseState.isDragAndDrop) {
- this._viewController.emitMouseDrag({
- event: e,
- target: position
- });
- } else {
- if (position.type === 13) {
- if (position.outsidePosition === "above" || position.outsidePosition === "below") {
- this._topBottomDragScrolling.start(position, e);
- this._leftRightDragScrolling.stop();
- } else {
- this._leftRightDragScrolling.start(position, e);
- this._topBottomDragScrolling.stop();
- }
- } else {
- this._topBottomDragScrolling.stop();
- this._leftRightDragScrolling.stop();
- this._dispatchMouse(
- position,
- true,
- 1
- /* NavigationCommandRevealType.Minimal */
- );
- }
- }
- }
- start(targetType, e, pointerId) {
- this._lastMouseEvent = e;
- this._mouseState.setStartedOnLineNumbers(
- targetType === 3
- /* MouseTargetType.GUTTER_LINE_NUMBERS */
- );
- this._mouseState.setStartButtons(e);
- this._mouseState.setModifiers(e);
- const position = this._findMousePosition(e, true);
- if (!position || !position.position) {
- return;
- }
- this._mouseState.trySetCount(e.detail, position.position);
- e.detail = this._mouseState.count;
- const options = this._context.configuration.options;
- if (!options.get(
- 104
- /* EditorOption.readOnly */
- ) && options.get(
- 42
- /* EditorOption.dragAndDrop */
- ) && !options.get(
- 28
- /* EditorOption.columnSelection */
- ) && !this._mouseState.altKey && e.detail < 2 && !this._isActive && !this._currentSelection.isEmpty() && position.type === 6 && position.position && this._currentSelection.containsPosition(position.position)) {
- this._mouseState.isDragAndDrop = true;
- this._isActive = true;
- this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, pointerId, e.buttons, (e2) => this._onMouseDownThenMove(e2), (browserEvent) => {
- const position2 = this._findMousePosition(this._lastMouseEvent, false);
- if (isKeyboardEvent(browserEvent)) {
- this._viewController.emitMouseDropCanceled();
- } else {
- this._viewController.emitMouseDrop({
- event: this._lastMouseEvent,
- target: position2 ? this._createMouseTarget(this._lastMouseEvent, true) : null
- // Ignoring because position is unknown, e.g., Content View Zone
- });
- }
- this._stop();
- });
- return;
- }
- this._mouseState.isDragAndDrop = false;
- this._dispatchMouse(
- position,
- e.shiftKey,
- 1
- /* NavigationCommandRevealType.Minimal */
- );
- if (!this._isActive) {
- this._isActive = true;
- this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, pointerId, e.buttons, (e2) => this._onMouseDownThenMove(e2), () => this._stop());
- }
- }
- _stop() {
- this._isActive = false;
- this._topBottomDragScrolling.stop();
- this._leftRightDragScrolling.stop();
- }
- onHeightChanged() {
- this._mouseMoveMonitor.stopMonitoring();
- }
- onPointerUp() {
- this._mouseMoveMonitor.stopMonitoring();
- }
- onCursorStateChanged(e) {
- this._currentSelection = e.selections[0];
- }
- _getPositionOutsideEditor(e) {
- const editorContent = e.editorPos;
- const model = this._context.viewModel;
- const viewLayout = this._context.viewLayout;
- const mouseColumn = this._getMouseColumn(e);
- if (e.posy < editorContent.y) {
- const outsideDistance = editorContent.y - e.posy;
- const verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);
- const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);
- if (viewZoneData) {
- const newPosition = this._helpPositionJumpOverViewZone(viewZoneData);
- if (newPosition) {
- return MouseTarget.createOutsideEditor(mouseColumn, newPosition, "above", outsideDistance);
- }
- }
- const aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);
- return MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), "above", outsideDistance);
- }
- if (e.posy > editorContent.y + editorContent.height) {
- const outsideDistance = e.posy - editorContent.y - editorContent.height;
- const verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;
- const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);
- if (viewZoneData) {
- const newPosition = this._helpPositionJumpOverViewZone(viewZoneData);
- if (newPosition) {
- return MouseTarget.createOutsideEditor(mouseColumn, newPosition, "below", outsideDistance);
- }
- }
- const belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);
- return MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), "below", outsideDistance);
- }
- const possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);
- const layoutInfo = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const xLeftBoundary = layoutInfo.contentLeft;
- if (e.relativePos.x <= xLeftBoundary) {
- const outsideDistance = xLeftBoundary - e.relativePos.x;
- return MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), "left", outsideDistance);
- }
- const contentRight = layoutInfo.minimap.minimapLeft === 0 ? layoutInfo.width - layoutInfo.verticalScrollbarWidth : layoutInfo.minimap.minimapLeft;
- const xRightBoundary = contentRight;
- if (e.relativePos.x >= xRightBoundary) {
- const outsideDistance = e.relativePos.x - xRightBoundary;
- return MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), "right", outsideDistance);
- }
- return null;
- }
- _findMousePosition(e, testEventTarget) {
- const positionOutsideEditor = this._getPositionOutsideEditor(e);
- if (positionOutsideEditor) {
- return positionOutsideEditor;
- }
- const t = this._createMouseTarget(e, testEventTarget);
- const hintedPosition = t.position;
- if (!hintedPosition) {
- return null;
- }
- if (t.type === 8 || t.type === 5) {
- const newPosition = this._helpPositionJumpOverViewZone(t.detail);
- if (newPosition) {
- return MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);
- }
- }
- return t;
- }
- _helpPositionJumpOverViewZone(viewZoneData) {
- const selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);
- const positionBefore = viewZoneData.positionBefore;
- const positionAfter = viewZoneData.positionAfter;
- if (positionBefore && positionAfter) {
- if (positionBefore.isBefore(selectionStart)) {
- return positionBefore;
- } else {
- return positionAfter;
- }
- }
- return null;
- }
- _dispatchMouse(position, inSelectionMode, revealType) {
- if (!position.position) {
- return;
- }
- this._viewController.dispatchMouse({
- position: position.position,
- mouseColumn: position.mouseColumn,
- startedOnLineNumbers: this._mouseState.startedOnLineNumbers,
- revealType,
- inSelectionMode,
- mouseDownCount: this._mouseState.count,
- altKey: this._mouseState.altKey,
- ctrlKey: this._mouseState.ctrlKey,
- metaKey: this._mouseState.metaKey,
- shiftKey: this._mouseState.shiftKey,
- leftButton: this._mouseState.leftButton,
- middleButton: this._mouseState.middleButton,
- onInjectedText: position.type === 6 && position.detail.injectedText !== null
- });
- }
- };
- MouseDownState = class _MouseDownState {
- static {
- this.CLEAR_MOUSE_DOWN_COUNT_TIME = 400;
- }
- // ms
- get altKey() {
- return this._altKey;
- }
- get ctrlKey() {
- return this._ctrlKey;
- }
- get metaKey() {
- return this._metaKey;
- }
- get shiftKey() {
- return this._shiftKey;
- }
- get leftButton() {
- return this._leftButton;
- }
- get middleButton() {
- return this._middleButton;
- }
- get startedOnLineNumbers() {
- return this._startedOnLineNumbers;
- }
- constructor() {
- this._altKey = false;
- this._ctrlKey = false;
- this._metaKey = false;
- this._shiftKey = false;
- this._leftButton = false;
- this._middleButton = false;
- this._startedOnLineNumbers = false;
- this._lastMouseDownPosition = null;
- this._lastMouseDownPositionEqualCount = 0;
- this._lastMouseDownCount = 0;
- this._lastSetMouseDownCountTime = 0;
- this.isDragAndDrop = false;
- }
- get count() {
- return this._lastMouseDownCount;
- }
- setModifiers(source) {
- this._altKey = source.altKey;
- this._ctrlKey = source.ctrlKey;
- this._metaKey = source.metaKey;
- this._shiftKey = source.shiftKey;
- }
- setStartButtons(source) {
- this._leftButton = source.leftButton;
- this._middleButton = source.middleButton;
- }
- setStartedOnLineNumbers(startedOnLineNumbers) {
- this._startedOnLineNumbers = startedOnLineNumbers;
- }
- trySetCount(setMouseDownCount, newMouseDownPosition) {
- const currentTime = (/* @__PURE__ */ new Date()).getTime();
- if (currentTime - this._lastSetMouseDownCountTime > _MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {
- setMouseDownCount = 1;
- }
- this._lastSetMouseDownCountTime = currentTime;
- if (setMouseDownCount > this._lastMouseDownCount + 1) {
- setMouseDownCount = this._lastMouseDownCount + 1;
- }
- if (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {
- this._lastMouseDownPositionEqualCount++;
- } else {
- this._lastMouseDownPositionEqualCount = 1;
- }
- this._lastMouseDownPosition = newMouseDownPosition;
- this._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/event.js
-var DomEmitter;
-var init_event2 = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/event.js"() {
- init_event();
- DomEmitter = class {
- get event() {
- return this.emitter.event;
- }
- constructor(element, type, useCapture) {
- const fn = (e) => this.emitter.fire(e);
- this.emitter = new Emitter({
- onWillAddFirstListener: () => element.addEventListener(type, fn, useCapture),
- onDidRemoveLastListener: () => element.removeEventListener(type, fn, useCapture)
- });
- }
- dispose() {
- this.emitter.dispose();
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/editContext/clipboardUtils.js
-function getDataToCopy(viewModel, modelSelections, emptySelectionClipboard, copyWithSyntaxHighlighting) {
- const rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows);
- const newLineCharacter = viewModel.model.getEOL();
- const isFromEmptySelection = emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty();
- const multicursorText = Array.isArray(rawTextToCopy) ? rawTextToCopy : null;
- const text2 = Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy;
- let html3 = void 0;
- let mode = null;
- if (CopyOptions.forceCopyWithSyntaxHighlighting || copyWithSyntaxHighlighting && text2.length < 65536) {
- const richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard);
- if (richText) {
- html3 = richText.html;
- mode = richText.mode;
- }
- }
- const dataToCopy = {
- isFromEmptySelection,
- multicursorText,
- text: text2,
- html: html3,
- mode
- };
- return dataToCopy;
-}
-var InMemoryClipboardMetadataManager, CopyOptions, ClipboardEventUtils;
-var init_clipboardUtils = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/editContext/clipboardUtils.js"() {
- init_platform();
- init_mime();
- InMemoryClipboardMetadataManager = class _InMemoryClipboardMetadataManager {
- static {
- this.INSTANCE = new _InMemoryClipboardMetadataManager();
- }
- constructor() {
- this._lastState = null;
- }
- set(lastCopiedValue, data) {
- this._lastState = { lastCopiedValue, data };
- }
- get(pastedText) {
- if (this._lastState && this._lastState.lastCopiedValue === pastedText) {
- return this._lastState.data;
- }
- this._lastState = null;
- return null;
- }
- };
- CopyOptions = {
- forceCopyWithSyntaxHighlighting: false
- };
- ClipboardEventUtils = {
- getTextData(clipboardData) {
- const text2 = clipboardData.getData(Mimes.text);
- let metadata = null;
- const rawmetadata = clipboardData.getData("vscode-editor-data");
- if (typeof rawmetadata === "string") {
- try {
- metadata = JSON.parse(rawmetadata);
- if (metadata.version !== 1) {
- metadata = null;
- }
- } catch (err) {
- }
- }
- if (text2.length === 0 && metadata === null && clipboardData.files.length > 0) {
- const files = Array.prototype.slice.call(clipboardData.files, 0);
- return [files.map((file) => file.name).join("\n"), null];
- }
- return [text2, metadata];
- },
- setTextData(clipboardData, text2, html3, metadata) {
- clipboardData.setData(Mimes.text, text2);
- if (typeof html3 === "string") {
- clipboardData.setData("text/html", html3);
- }
- clipboardData.setData("vscode-editor-data", JSON.stringify(metadata));
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js
-var TextAreaState;
-var init_textAreaEditContextState = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js"() {
- init_strings();
- TextAreaState = class _TextAreaState {
- static {
- this.EMPTY = new _TextAreaState("", 0, 0, null, void 0);
- }
- constructor(value, selectionStart, selectionEnd, selection, newlineCountBeforeSelection) {
- this.value = value;
- this.selectionStart = selectionStart;
- this.selectionEnd = selectionEnd;
- this.selection = selection;
- this.newlineCountBeforeSelection = newlineCountBeforeSelection;
- }
- toString() {
- return `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;
- }
- static readFromTextArea(textArea, previousState) {
- const value = textArea.getValue();
- const selectionStart = textArea.getSelectionStart();
- const selectionEnd = textArea.getSelectionEnd();
- let newlineCountBeforeSelection = void 0;
- if (previousState) {
- const valueBeforeSelectionStart = value.substring(0, selectionStart);
- const previousValueBeforeSelectionStart = previousState.value.substring(0, previousState.selectionStart);
- if (valueBeforeSelectionStart === previousValueBeforeSelectionStart) {
- newlineCountBeforeSelection = previousState.newlineCountBeforeSelection;
- }
- }
- return new _TextAreaState(value, selectionStart, selectionEnd, null, newlineCountBeforeSelection);
- }
- collapseSelection() {
- if (this.selectionStart === this.value.length) {
- return this;
- }
- return new _TextAreaState(this.value, this.value.length, this.value.length, null, void 0);
- }
- isWrittenToTextArea(textArea, select) {
- const valuesEqual = this.value === textArea.getValue();
- if (!select) {
- return valuesEqual;
- }
- const selectionsEqual = this.selectionStart === textArea.getSelectionStart() && this.selectionEnd === textArea.getSelectionEnd();
- return selectionsEqual && valuesEqual;
- }
- writeToTextArea(reason, textArea, select) {
- textArea.setValue(reason, this.value);
- if (select) {
- textArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd);
- }
- }
- deduceEditorPosition(offset) {
- if (offset <= this.selectionStart) {
- const str = this.value.substring(offset, this.selectionStart);
- return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, str, -1);
- }
- if (offset >= this.selectionEnd) {
- const str = this.value.substring(this.selectionEnd, offset);
- return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, str, 1);
- }
- const str1 = this.value.substring(this.selectionStart, offset);
- if (str1.indexOf(String.fromCharCode(8230)) === -1) {
- return this._finishDeduceEditorPosition(this.selection?.getStartPosition() ?? null, str1, 1);
- }
- const str2 = this.value.substring(offset, this.selectionEnd);
- return this._finishDeduceEditorPosition(this.selection?.getEndPosition() ?? null, str2, -1);
- }
- _finishDeduceEditorPosition(anchor, deltaText, signum) {
- let lineFeedCnt = 0;
- let lastLineFeedIndex = -1;
- while ((lastLineFeedIndex = deltaText.indexOf("\n", lastLineFeedIndex + 1)) !== -1) {
- lineFeedCnt++;
- }
- return [anchor, signum * deltaText.length, lineFeedCnt];
- }
- static deduceInput(previousState, currentState, couldBeEmojiInput) {
- if (!previousState) {
- return {
- text: "",
- replacePrevCharCnt: 0,
- replaceNextCharCnt: 0,
- positionDelta: 0
- };
- }
- const prefixLength = Math.min(commonPrefixLength(previousState.value, currentState.value), previousState.selectionStart, currentState.selectionStart);
- const suffixLength = Math.min(commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd, currentState.value.length - currentState.selectionEnd);
- previousState.value.substring(prefixLength, previousState.value.length - suffixLength);
- const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);
- const previousSelectionStart = previousState.selectionStart - prefixLength;
- const previousSelectionEnd = previousState.selectionEnd - prefixLength;
- const currentSelectionStart = currentState.selectionStart - prefixLength;
- const currentSelectionEnd = currentState.selectionEnd - prefixLength;
- if (currentSelectionStart === currentSelectionEnd) {
- const replacePreviousCharacters2 = previousState.selectionStart - prefixLength;
- return {
- text: currentValue,
- replacePrevCharCnt: replacePreviousCharacters2,
- replaceNextCharCnt: 0,
- positionDelta: 0
- };
- }
- const replacePreviousCharacters = previousSelectionEnd - previousSelectionStart;
- return {
- text: currentValue,
- replacePrevCharCnt: replacePreviousCharacters,
- replaceNextCharCnt: 0,
- positionDelta: 0
- };
- }
- static deduceAndroidCompositionInput(previousState, currentState) {
- if (!previousState) {
- return {
- text: "",
- replacePrevCharCnt: 0,
- replaceNextCharCnt: 0,
- positionDelta: 0
- };
- }
- if (previousState.value === currentState.value) {
- return {
- text: "",
- replacePrevCharCnt: 0,
- replaceNextCharCnt: 0,
- positionDelta: currentState.selectionEnd - previousState.selectionEnd
- };
- }
- const prefixLength = Math.min(commonPrefixLength(previousState.value, currentState.value), previousState.selectionEnd);
- const suffixLength = Math.min(commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd);
- const previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength);
- const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);
- previousState.selectionStart - prefixLength;
- const previousSelectionEnd = previousState.selectionEnd - prefixLength;
- currentState.selectionStart - prefixLength;
- const currentSelectionEnd = currentState.selectionEnd - prefixLength;
- return {
- text: currentValue,
- replacePrevCharCnt: previousSelectionEnd,
- replaceNextCharCnt: previousValue.length - previousSelectionEnd,
- positionDelta: currentSelectionEnd - currentValue.length
- };
- }
- static fromScreenReaderContentState(screenReaderContentState) {
- return new _TextAreaState(screenReaderContentState.value, screenReaderContentState.selectionStart, screenReaderContentState.selectionEnd, screenReaderContentState.selection, screenReaderContentState.newlineCountBeforeSelection);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/common/uuid.js
-function prefixedUuid(namespace) {
- return `${namespace}-${generateUuid()}`;
-}
-var generateUuid;
-var init_uuid = __esm({
- "../node_modules/monaco-editor/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/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js
-var __decorate7, __param6, TextAreaSyntethicEvents, CompositionContext, TextAreaInput, TextAreaWrapper;
-var init_textAreaEditContextInput = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js"() {
- init_browser();
- init_dom();
- init_event2();
- init_keyboardEvent();
- init_performance();
- init_async();
- init_event();
- init_lifecycle();
- init_strings();
- init_selection();
- init_accessibility();
- init_log();
- init_clipboardUtils();
- init_textAreaEditContextState();
- init_uuid();
- __decorate7 = 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;
- };
- __param6 = function(paramIndex, decorator) {
- return function(target, key) {
- decorator(target, key, paramIndex);
- };
- };
- (function(TextAreaSyntethicEvents2) {
- TextAreaSyntethicEvents2.Tap = "-monaco-textarea-synthetic-tap";
- })(TextAreaSyntethicEvents || (TextAreaSyntethicEvents = {}));
- CompositionContext = class {
- constructor() {
- this._lastTypeTextLength = 0;
- }
- handleCompositionUpdate(text2) {
- text2 = text2 || "";
- const typeInput = {
- text: text2,
- replacePrevCharCnt: this._lastTypeTextLength,
- replaceNextCharCnt: 0,
- positionDelta: 0
- };
- this._lastTypeTextLength = text2.length;
- return typeInput;
- }
- };
- TextAreaInput = class TextAreaInput2 extends Disposable {
- get textAreaState() {
- return this._textAreaState;
- }
- constructor(_host, _textArea, _OS, _browser, _accessibilityService, _logService) {
- super();
- this._host = _host;
- this._textArea = _textArea;
- this._OS = _OS;
- this._browser = _browser;
- this._accessibilityService = _accessibilityService;
- this._logService = _logService;
- this._onFocus = this._register(new Emitter());
- this.onFocus = this._onFocus.event;
- this._onBlur = this._register(new Emitter());
- this.onBlur = this._onBlur.event;
- this._onKeyDown = this._register(new Emitter());
- this.onKeyDown = this._onKeyDown.event;
- this._onKeyUp = this._register(new Emitter());
- this.onKeyUp = this._onKeyUp.event;
- this._onCut = this._register(new Emitter());
- this.onCut = this._onCut.event;
- this._onPaste = this._register(new Emitter());
- this.onPaste = this._onPaste.event;
- this._onType = this._register(new Emitter());
- this.onType = this._onType.event;
- this._onCompositionStart = this._register(new Emitter());
- this.onCompositionStart = this._onCompositionStart.event;
- this._onCompositionUpdate = this._register(new Emitter());
- this.onCompositionUpdate = this._onCompositionUpdate.event;
- this._onCompositionEnd = this._register(new Emitter());
- this.onCompositionEnd = this._onCompositionEnd.event;
- this._onSelectionChangeRequest = this._register(new Emitter());
- this.onSelectionChangeRequest = this._onSelectionChangeRequest.event;
- this._asyncFocusGainWriteScreenReaderContent = this._register(new MutableDisposable());
- this._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0));
- this._textAreaState = TextAreaState.EMPTY;
- this._selectionChangeListener = null;
- if (this._accessibilityService.isScreenReaderOptimized()) {
- this.writeNativeTextAreaContent("ctor");
- }
- this._register(Event.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized, () => {
- if (this._accessibilityService.isScreenReaderOptimized() && !this._asyncFocusGainWriteScreenReaderContent.value) {
- this._asyncFocusGainWriteScreenReaderContent.value = this._register(new RunOnceScheduler(() => this.writeNativeTextAreaContent("asyncFocusGain"), 0));
- } else {
- this._asyncFocusGainWriteScreenReaderContent.clear();
- }
- }));
- this._hasFocus = false;
- this._currentComposition = null;
- let lastKeyDown = null;
- this._register(this._textArea.onKeyDown((_e2) => {
- const e = new StandardKeyboardEvent(_e2);
- if (e.keyCode === 114 || this._currentComposition && e.keyCode === 1) {
- e.stopPropagation();
- }
- if (e.equals(
- 9
- /* KeyCode.Escape */
- )) {
- e.preventDefault();
- }
- lastKeyDown = e;
- this._onKeyDown.fire(e);
- }));
- this._register(this._textArea.onKeyUp((_e2) => {
- const e = new StandardKeyboardEvent(_e2);
- this._onKeyUp.fire(e);
- }));
- this._register(this._textArea.onCompositionStart((e) => {
- const currentComposition = new CompositionContext();
- if (this._currentComposition) {
- this._currentComposition = currentComposition;
- return;
- }
- this._currentComposition = currentComposition;
- if (this._OS === 2 && lastKeyDown && lastKeyDown.equals(
- 114
- /* KeyCode.KEY_IN_COMPOSITION */
- ) && this._textAreaState.selectionStart === this._textAreaState.selectionEnd && this._textAreaState.selectionStart > 0 && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e.data && (lastKeyDown.code === "ArrowRight" || lastKeyDown.code === "ArrowLeft")) {
- currentComposition.handleCompositionUpdate("x");
- this._onCompositionStart.fire({ data: e.data });
- return;
- }
- if (this._browser.isAndroid) {
- this._onCompositionStart.fire({ data: e.data });
- return;
- }
- this._onCompositionStart.fire({ data: e.data });
- }));
- this._register(this._textArea.onCompositionUpdate((e) => {
- const currentComposition = this._currentComposition;
- if (!currentComposition) {
- return;
- }
- if (this._browser.isAndroid) {
- const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);
- const typeInput2 = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);
- this._textAreaState = newState;
- this._onType.fire(typeInput2);
- this._onCompositionUpdate.fire(e);
- return;
- }
- const typeInput = currentComposition.handleCompositionUpdate(e.data);
- this._textAreaState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);
- this._onType.fire(typeInput);
- this._onCompositionUpdate.fire(e);
- }));
- this._register(this._textArea.onCompositionEnd((e) => {
- const currentComposition = this._currentComposition;
- if (!currentComposition) {
- return;
- }
- this._currentComposition = null;
- if (this._browser.isAndroid) {
- const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);
- const typeInput2 = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);
- this._textAreaState = newState;
- this._onType.fire(typeInput2);
- this._onCompositionEnd.fire();
- return;
- }
- const typeInput = currentComposition.handleCompositionUpdate(e.data);
- this._textAreaState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);
- this._onType.fire(typeInput);
- this._onCompositionEnd.fire();
- }));
- this._register(this._textArea.onInput((e) => {
- this._textArea.setIgnoreSelectionChangeTime("received input event");
- if (this._currentComposition) {
- return;
- }
- const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);
- const typeInput = TextAreaState.deduceInput(
- this._textAreaState,
- newState,
- /*couldBeEmojiInput*/
- this._OS === 2
- /* OperatingSystem.Macintosh */
- );
- if (typeInput.replacePrevCharCnt === 0 && typeInput.text.length === 1) {
- if (isHighSurrogate(typeInput.text.charCodeAt(0)) || typeInput.text.charCodeAt(0) === 127) {
- return;
- }
- }
- this._textAreaState = newState;
- if (typeInput.text !== "" || typeInput.replacePrevCharCnt !== 0 || typeInput.replaceNextCharCnt !== 0 || typeInput.positionDelta !== 0) {
- if (e.inputType === "insertFromPaste") {
- this._onPaste.fire({
- text: typeInput.text,
- metadata: InMemoryClipboardMetadataManager.INSTANCE.get(typeInput.text)
- });
- } else {
- this._onType.fire(typeInput);
- }
- }
- }));
- this._register(this._textArea.onCut((e) => {
- this._logService.trace(`TextAreaInput#onCut`, e);
- this._textArea.setIgnoreSelectionChangeTime("received cut event");
- this._ensureClipboardGetsEditorSelection(e);
- this._asyncTriggerCut.schedule();
- }));
- this._register(this._textArea.onCopy((e) => {
- this._logService.trace(`TextAreaInput#onCopy`, e);
- this._ensureClipboardGetsEditorSelection(e);
- }));
- this._register(this._textArea.onPaste((e) => {
- this._logService.trace(`TextAreaInput#onPaste`, e);
- this._textArea.setIgnoreSelectionChangeTime("received paste event");
- e.preventDefault();
- if (!e.clipboardData) {
- return;
- }
- let [text2, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);
- this._logService.trace(`TextAreaInput#onPaste with id : `, metadata?.id, " with text.length: ", text2.length);
- if (!text2) {
- return;
- }
- metadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text2);
- this._logService.trace(`TextAreaInput#onPaste (before onPaste)`);
- this._onPaste.fire({
- text: text2,
- metadata
- });
- }));
- this._register(this._textArea.onFocus(() => {
- const hadFocus = this._hasFocus;
- this._setHasFocus(true);
- if (this._accessibilityService.isScreenReaderOptimized() && this._browser.isSafari && !hadFocus && this._hasFocus) {
- if (!this._asyncFocusGainWriteScreenReaderContent.value) {
- this._asyncFocusGainWriteScreenReaderContent.value = new RunOnceScheduler(() => this.writeNativeTextAreaContent("asyncFocusGain"), 0);
- }
- this._asyncFocusGainWriteScreenReaderContent.value.schedule();
- }
- }));
- this._register(this._textArea.onBlur(() => {
- if (this._currentComposition) {
- this._currentComposition = null;
- this.writeNativeTextAreaContent("blurWithoutCompositionEnd");
- this._onCompositionEnd.fire();
- }
- this._setHasFocus(false);
- }));
- this._register(this._textArea.onSyntheticTap(() => {
- if (this._browser.isAndroid && this._currentComposition) {
- this._currentComposition = null;
- this.writeNativeTextAreaContent("tapWithoutCompositionEnd");
- this._onCompositionEnd.fire();
- }
- }));
- }
- _installSelectionChangeListener() {
- let previousSelectionChangeEventTime = 0;
- return addDisposableListener(this._textArea.ownerDocument, "selectionchange", (e) => {
- inputLatency.onSelectionChange();
- if (!this._hasFocus) {
- return;
- }
- if (this._currentComposition) {
- return;
- }
- if (!this._browser.isChrome) {
- return;
- }
- const now = Date.now();
- const delta1 = now - previousSelectionChangeEventTime;
- previousSelectionChangeEventTime = now;
- if (delta1 < 5) {
- return;
- }
- const delta2 = now - this._textArea.getIgnoreSelectionChangeTime();
- this._textArea.resetSelectionChangeTime();
- if (delta2 < 100) {
- return;
- }
- if (!this._textAreaState.selection) {
- return;
- }
- const newValue = this._textArea.getValue();
- if (this._textAreaState.value !== newValue) {
- return;
- }
- const newSelectionStart = this._textArea.getSelectionStart();
- const newSelectionEnd = this._textArea.getSelectionEnd();
- if (this._textAreaState.selectionStart === newSelectionStart && this._textAreaState.selectionEnd === newSelectionEnd) {
- return;
- }
- const _newSelectionStartPosition = this._textAreaState.deduceEditorPosition(newSelectionStart);
- const newSelectionStartPosition = this._host.deduceModelPosition(_newSelectionStartPosition[0], _newSelectionStartPosition[1], _newSelectionStartPosition[2]);
- const _newSelectionEndPosition = this._textAreaState.deduceEditorPosition(newSelectionEnd);
- const newSelectionEndPosition = this._host.deduceModelPosition(_newSelectionEndPosition[0], _newSelectionEndPosition[1], _newSelectionEndPosition[2]);
- const newSelection = new Selection(newSelectionStartPosition.lineNumber, newSelectionStartPosition.column, newSelectionEndPosition.lineNumber, newSelectionEndPosition.column);
- this._onSelectionChangeRequest.fire(newSelection);
- });
- }
- dispose() {
- super.dispose();
- if (this._selectionChangeListener) {
- this._selectionChangeListener.dispose();
- this._selectionChangeListener = null;
- }
- }
- focusTextArea() {
- this._setHasFocus(true);
- this.refreshFocusState();
- }
- isFocused() {
- return this._hasFocus;
- }
- refreshFocusState() {
- this._setHasFocus(this._textArea.hasFocus());
- }
- _setHasFocus(newHasFocus) {
- if (this._hasFocus === newHasFocus) {
- return;
- }
- this._hasFocus = newHasFocus;
- if (this._selectionChangeListener) {
- this._selectionChangeListener.dispose();
- this._selectionChangeListener = null;
- }
- if (this._hasFocus) {
- this._selectionChangeListener = this._installSelectionChangeListener();
- }
- if (this._hasFocus) {
- this.writeNativeTextAreaContent("focusgain");
- }
- if (this._hasFocus) {
- this._onFocus.fire();
- } else {
- this._onBlur.fire();
- }
- }
- _setAndWriteTextAreaState(reason, textAreaState) {
- if (!this._hasFocus) {
- textAreaState = textAreaState.collapseSelection();
- }
- if (!textAreaState.isWrittenToTextArea(this._textArea, this._hasFocus)) {
- this._logService.trace(`writeTextAreaState(reason: ${reason})`);
- }
- textAreaState.writeToTextArea(reason, this._textArea, this._hasFocus);
- this._textAreaState = textAreaState;
- }
- writeNativeTextAreaContent(reason) {
- if (!this._accessibilityService.isScreenReaderOptimized() && reason === "render" || this._currentComposition) {
- return;
- }
- this._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent());
- }
- _ensureClipboardGetsEditorSelection(e) {
- const dataToCopy = this._host.getDataToCopy();
- let id = void 0;
- if (this._logService.getLevel() === LogLevel.Trace) {
- id = generateUuid();
- }
- const storedMetadata = {
- version: 1,
- id,
- isFromEmptySelection: dataToCopy.isFromEmptySelection,
- multicursorText: dataToCopy.multicursorText,
- mode: dataToCopy.mode
- };
- InMemoryClipboardMetadataManager.INSTANCE.set(
- // When writing "LINE\r\n" to the clipboard and then pasting,
- // Firefox pastes "LINE\n", so let's work around this quirk
- this._browser.isFirefox ? dataToCopy.text.replace(/\r\n/g, "\n") : dataToCopy.text,
- storedMetadata
- );
- e.preventDefault();
- if (e.clipboardData) {
- ClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);
- }
- this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ", id, " with text.length: ", dataToCopy.text.length);
- }
- };
- TextAreaInput = __decorate7([
- __param6(4, IAccessibilityService),
- __param6(5, ILogService)
- ], TextAreaInput);
- TextAreaWrapper = class extends Disposable {
- get ownerDocument() {
- return this._actual.ownerDocument;
- }
- constructor(_actual) {
- super();
- this._actual = _actual;
- this._onSyntheticTap = this._register(new Emitter());
- this.onSyntheticTap = this._onSyntheticTap.event;
- this._ignoreSelectionChangeTime = 0;
- this.onKeyDown = this._register(new DomEmitter(this._actual, "keydown")).event;
- this.onKeyPress = this._register(new DomEmitter(this._actual, "keypress")).event;
- this.onKeyUp = this._register(new DomEmitter(this._actual, "keyup")).event;
- this.onCompositionStart = this._register(new DomEmitter(this._actual, "compositionstart")).event;
- this.onCompositionUpdate = this._register(new DomEmitter(this._actual, "compositionupdate")).event;
- this.onCompositionEnd = this._register(new DomEmitter(this._actual, "compositionend")).event;
- this.onBeforeInput = this._register(new DomEmitter(this._actual, "beforeinput")).event;
- this.onInput = this._register(new DomEmitter(this._actual, "input")).event;
- this.onCut = this._register(new DomEmitter(this._actual, "cut")).event;
- this.onCopy = this._register(new DomEmitter(this._actual, "copy")).event;
- this.onPaste = this._register(new DomEmitter(this._actual, "paste")).event;
- this.onFocus = this._register(new DomEmitter(this._actual, "focus")).event;
- this.onBlur = this._register(new DomEmitter(this._actual, "blur")).event;
- this._register(this.onKeyDown(() => inputLatency.onKeyDown()));
- this._register(this.onBeforeInput(() => inputLatency.onBeforeInput()));
- this._register(this.onInput(() => inputLatency.onInput()));
- this._register(this.onKeyUp(() => inputLatency.onKeyUp()));
- this._register(addDisposableListener(this._actual, TextAreaSyntethicEvents.Tap, () => this._onSyntheticTap.fire()));
- }
- hasFocus() {
- const shadowRoot = getShadowRoot(this._actual);
- if (shadowRoot) {
- return shadowRoot.activeElement === this._actual;
- } else if (this._actual.isConnected) {
- return getActiveElement() === this._actual;
- } else {
- return false;
- }
- }
- setIgnoreSelectionChangeTime(reason) {
- this._ignoreSelectionChangeTime = Date.now();
- }
- getIgnoreSelectionChangeTime() {
- return this._ignoreSelectionChangeTime;
- }
- resetSelectionChangeTime() {
- this._ignoreSelectionChangeTime = 0;
- }
- getValue() {
- return this._actual.value;
- }
- setValue(reason, value) {
- const textArea = this._actual;
- if (textArea.value === value) {
- return;
- }
- this.setIgnoreSelectionChangeTime("setValue");
- textArea.value = value;
- }
- getSelectionStart() {
- return this._actual.selectionDirection === "backward" ? this._actual.selectionEnd : this._actual.selectionStart;
- }
- getSelectionEnd() {
- return this._actual.selectionDirection === "backward" ? this._actual.selectionStart : this._actual.selectionEnd;
- }
- setSelectionRange(reason, selectionStart, selectionEnd) {
- const textArea = this._actual;
- let activeElement = null;
- const shadowRoot = getShadowRoot(textArea);
- if (shadowRoot) {
- activeElement = shadowRoot.activeElement;
- } else {
- activeElement = getActiveElement();
- }
- const activeWindow = getWindow(activeElement);
- const currentIsFocused = activeElement === textArea;
- const currentSelectionStart = textArea.selectionStart;
- const currentSelectionEnd = textArea.selectionEnd;
- if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) {
- if (isFirefox && activeWindow.parent !== activeWindow) {
- textArea.focus();
- }
- return;
- }
- if (currentIsFocused) {
- this.setIgnoreSelectionChangeTime("setSelectionRange");
- textArea.setSelectionRange(selectionStart, selectionEnd);
- if (isFirefox && activeWindow.parent !== activeWindow) {
- textArea.focus();
- }
- return;
- }
- try {
- const scrollState = saveParentsScrollTop(textArea);
- this.setIgnoreSelectionChangeTime("setSelectionRange");
- textArea.focus();
- textArea.setSelectionRange(selectionStart, selectionEnd);
- restoreParentsScrollTop(textArea, scrollState);
- } catch (e) {
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js
-var PointerEventHandler, TouchHandler, PointerHandler;
-var init_pointerHandler = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js"() {
- init_canIUse();
- init_dom();
- init_touch();
- init_window();
- init_lifecycle();
- init_platform();
- init_mouseHandler();
- init_editorDom();
- init_textAreaEditContextInput();
- PointerEventHandler = class extends MouseHandler {
- constructor(context, viewController, viewHelper) {
- super(context, viewController, viewHelper);
- this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Tap, (e) => this.onTap(e)));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Change, (e) => this.onChange(e)));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode), false)));
- this._lastPointerType = "mouse";
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, "pointerdown", (e) => {
- const pointerType = e.pointerType;
- if (pointerType === "mouse") {
- this._lastPointerType = "mouse";
- return;
- } else if (pointerType === "touch") {
- this._lastPointerType = "touch";
- } else {
- this._lastPointerType = "pen";
- }
- }));
- const pointerEvents = new EditorPointerEventFactory(this.viewHelper.viewDomNode);
- this._register(pointerEvents.onPointerMove(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e)));
- this._register(pointerEvents.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));
- this._register(pointerEvents.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));
- this._register(pointerEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => this._onMouseDown(e, pointerId)));
- }
- onTap(event) {
- if (!event.initialTarget || !this.viewHelper.linesContentDomNode.contains(event.initialTarget)) {
- return;
- }
- event.preventDefault();
- this.viewHelper.focusTextArea();
- this._dispatchGesture(
- event,
- /*inSelectionMode*/
- false
- );
- }
- onChange(event) {
- if (this._lastPointerType === "touch") {
- this._context.viewModel.viewLayout.deltaScrollNow(-event.translationX, -event.translationY);
- }
- if (this._lastPointerType === "pen") {
- this._dispatchGesture(
- event,
- /*inSelectionMode*/
- true
- );
- }
- }
- _dispatchGesture(event, inSelectionMode) {
- const target = this._createMouseTarget(new EditorMouseEvent(event, false, this.viewHelper.viewDomNode), false);
- if (target.position) {
- this.viewController.dispatchMouse({
- position: target.position,
- mouseColumn: target.position.column,
- startedOnLineNumbers: false,
- revealType: 1,
- mouseDownCount: event.tapCount,
- inSelectionMode,
- altKey: false,
- ctrlKey: false,
- metaKey: false,
- shiftKey: false,
- leftButton: false,
- middleButton: false,
- onInjectedText: target.type === 6 && target.detail.injectedText !== null
- });
- }
- }
- _onMouseDown(e, pointerId) {
- if (e.browserEvent.pointerType === "touch") {
- return;
- }
- super._onMouseDown(e, pointerId);
- }
- };
- TouchHandler = class extends MouseHandler {
- constructor(context, viewController, viewHelper) {
- super(context, viewController, viewHelper);
- this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Tap, (e) => this.onTap(e)));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Change, (e) => this.onChange(e)));
- this._register(addDisposableListener(this.viewHelper.linesContentDomNode, EventType2.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode), false)));
- }
- onTap(event) {
- event.preventDefault();
- this.viewHelper.focusTextArea();
- const target = this._createMouseTarget(new EditorMouseEvent(event, false, this.viewHelper.viewDomNode), false);
- if (target.position) {
- const event2 = document.createEvent("CustomEvent");
- event2.initEvent(TextAreaSyntethicEvents.Tap, false, true);
- this.viewHelper.dispatchTextAreaEvent(event2);
- this.viewController.moveTo(
- target.position,
- 1
- /* NavigationCommandRevealType.Minimal */
- );
- }
- }
- onChange(e) {
- this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);
- }
- };
- PointerHandler = class extends Disposable {
- constructor(context, viewController, viewHelper) {
- super();
- const isPhone = isIOS || isAndroid2 && isMobile;
- if (isPhone && BrowserFeatures.pointerEvents) {
- this.handler = this._register(new PointerEventHandler(context, viewController, viewHelper));
- } else if (mainWindow.TouchEvent) {
- this.handler = this._register(new TouchHandler(context, viewController, viewHelper));
- } else {
- this.handler = this._register(new MouseHandler(context, viewController, viewHelper));
- }
- }
- getTargetAtClientPoint(clientX, clientY) {
- return this.handler.getTargetAtClientPoint(clientX, clientY);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js
-var ViewController;
-var init_viewController = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js"() {
- init_coreCommands();
- init_position();
- init_platform();
- ViewController = class {
- constructor(configuration, viewModel, userInputEvents, commandDelegate) {
- this.configuration = configuration;
- this.viewModel = viewModel;
- this.userInputEvents = userInputEvents;
- this.commandDelegate = commandDelegate;
- }
- paste(text2, pasteOnNewLine, multicursorText, mode) {
- this.commandDelegate.paste(text2, pasteOnNewLine, multicursorText, mode);
- }
- type(text2) {
- this.commandDelegate.type(text2);
- }
- compositionType(text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta) {
- this.commandDelegate.compositionType(text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta);
- }
- compositionStart() {
- this.commandDelegate.startComposition();
- }
- compositionEnd() {
- this.commandDelegate.endComposition();
- }
- cut() {
- this.commandDelegate.cut();
- }
- setSelection(modelSelection) {
- CoreNavigationCommands.SetSelection.runCoreEditorCommand(this.viewModel, {
- source: "keyboard",
- selection: modelSelection
- });
- }
- _validateViewColumn(viewPosition) {
- const minColumn = this.viewModel.getLineMinColumn(viewPosition.lineNumber);
- if (viewPosition.column < minColumn) {
- return new Position(viewPosition.lineNumber, minColumn);
- }
- return viewPosition;
- }
- _hasMulticursorModifier(data) {
- switch (this.configuration.options.get(
- 86
- /* EditorOption.multiCursorModifier */
- )) {
- case "altKey":
- return data.altKey;
- case "ctrlKey":
- return data.ctrlKey;
- case "metaKey":
- return data.metaKey;
- default:
- return false;
- }
- }
- _hasNonMulticursorModifier(data) {
- switch (this.configuration.options.get(
- 86
- /* EditorOption.multiCursorModifier */
- )) {
- case "altKey":
- return data.ctrlKey || data.metaKey;
- case "ctrlKey":
- return data.altKey || data.metaKey;
- case "metaKey":
- return data.ctrlKey || data.altKey;
- default:
- return false;
- }
- }
- dispatchMouse(data) {
- const options = this.configuration.options;
- const selectionClipboardIsOn = isLinux && options.get(
- 121
- /* EditorOption.selectionClipboard */
- );
- const columnSelection = options.get(
- 28
- /* EditorOption.columnSelection */
- );
- const scrollOnMiddleClick = options.get(
- 171
- /* EditorOption.scrollOnMiddleClick */
- );
- if (data.middleButton && !selectionClipboardIsOn) {
- if (scrollOnMiddleClick) ;
- else {
- this._columnSelect(data.position, data.mouseColumn, data.inSelectionMode);
- }
- } else if (data.startedOnLineNumbers) {
- if (this._hasMulticursorModifier(data)) {
- if (data.inSelectionMode) {
- this._lastCursorLineSelect(data.position, data.revealType);
- } else {
- this._createCursor(data.position, true);
- }
- } else {
- if (data.inSelectionMode) {
- this._lineSelectDrag(data.position, data.revealType);
- } else {
- this._lineSelect(data.position, data.revealType);
- }
- }
- } else if (data.mouseDownCount >= 4) {
- this._selectAll();
- } else if (data.mouseDownCount === 3) {
- if (this._hasMulticursorModifier(data)) {
- if (data.inSelectionMode) {
- this._lastCursorLineSelectDrag(data.position, data.revealType);
- } else {
- this._lastCursorLineSelect(data.position, data.revealType);
- }
- } else {
- if (data.inSelectionMode) {
- this._lineSelectDrag(data.position, data.revealType);
- } else {
- this._lineSelect(data.position, data.revealType);
- }
- }
- } else if (data.mouseDownCount === 2) {
- if (!data.onInjectedText) {
- if (this._hasMulticursorModifier(data)) {
- this._lastCursorWordSelect(data.position, data.revealType);
- } else {
- if (data.inSelectionMode) {
- this._wordSelectDrag(data.position, data.revealType);
- } else {
- this._wordSelect(data.position, data.revealType);
- }
- }
- }
- } else {
- if (this._hasMulticursorModifier(data)) {
- if (!this._hasNonMulticursorModifier(data)) {
- if (data.shiftKey) {
- this._columnSelect(data.position, data.mouseColumn, true);
- } else {
- if (data.inSelectionMode) {
- this._lastCursorMoveToSelect(data.position, data.revealType);
- } else {
- this._createCursor(data.position, false);
- }
- }
- }
- } else {
- if (data.inSelectionMode) {
- if (data.altKey) {
- this._columnSelect(data.position, data.mouseColumn, true);
- } else {
- if (columnSelection) {
- this._columnSelect(data.position, data.mouseColumn, true);
- } else {
- this._moveToSelect(data.position, data.revealType);
- }
- }
- } else {
- this.moveTo(data.position, data.revealType);
- }
- }
- }
- }
- _usualArgs(viewPosition, revealType) {
- viewPosition = this._validateViewColumn(viewPosition);
- return {
- source: "mouse",
- position: this._convertViewToModelPosition(viewPosition),
- viewPosition,
- revealType
- };
- }
- moveTo(viewPosition, revealType) {
- CoreNavigationCommands.MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _moveToSelect(viewPosition, revealType) {
- CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _columnSelect(viewPosition, mouseColumn, doColumnSelect) {
- viewPosition = this._validateViewColumn(viewPosition);
- CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(this.viewModel, {
- source: "mouse",
- position: this._convertViewToModelPosition(viewPosition),
- viewPosition,
- mouseColumn,
- doColumnSelect
- });
- }
- _createCursor(viewPosition, wholeLine) {
- viewPosition = this._validateViewColumn(viewPosition);
- CoreNavigationCommands.CreateCursor.runCoreEditorCommand(this.viewModel, {
- source: "mouse",
- position: this._convertViewToModelPosition(viewPosition),
- viewPosition,
- wholeLine
- });
- }
- _lastCursorMoveToSelect(viewPosition, revealType) {
- CoreNavigationCommands.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _wordSelect(viewPosition, revealType) {
- CoreNavigationCommands.WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _wordSelectDrag(viewPosition, revealType) {
- CoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _lastCursorWordSelect(viewPosition, revealType) {
- CoreNavigationCommands.LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _lineSelect(viewPosition, revealType) {
- CoreNavigationCommands.LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _lineSelectDrag(viewPosition, revealType) {
- CoreNavigationCommands.LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _lastCursorLineSelect(viewPosition, revealType) {
- CoreNavigationCommands.LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _lastCursorLineSelectDrag(viewPosition, revealType) {
- CoreNavigationCommands.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition, revealType));
- }
- _selectAll() {
- CoreNavigationCommands.SelectAll.runCoreEditorCommand(this.viewModel, { source: "mouse" });
- }
- // ----------------------
- _convertViewToModelPosition(viewPosition) {
- return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(viewPosition);
- }
- emitKeyDown(e) {
- this.userInputEvents.emitKeyDown(e);
- }
- emitKeyUp(e) {
- this.userInputEvents.emitKeyUp(e);
- }
- emitContextMenu(e) {
- this.userInputEvents.emitContextMenu(e);
- }
- emitMouseMove(e) {
- this.userInputEvents.emitMouseMove(e);
- }
- emitMouseLeave(e) {
- this.userInputEvents.emitMouseLeave(e);
- }
- emitMouseUp(e) {
- this.userInputEvents.emitMouseUp(e);
- }
- emitMouseDown(e) {
- this.userInputEvents.emitMouseDown(e);
- }
- emitMouseDrag(e) {
- this.userInputEvents.emitMouseDrag(e);
- }
- emitMouseDrop(e) {
- this.userInputEvents.emitMouseDrop(e);
- }
- emitMouseDropCanceled() {
- this.userInputEvents.emitMouseDropCanceled();
- }
- emitMouseWheel(e) {
- this.userInputEvents.emitMouseWheel(e);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/trustedTypes.js
-function createTrustedTypesPolicy(policyName, policyOptions) {
- const monacoEnvironment3 = getMonacoEnvironment();
- if (monacoEnvironment3?.createTrustedTypesPolicy) {
- try {
- return monacoEnvironment3.createTrustedTypesPolicy(policyName, policyOptions);
- } catch (err) {
- onUnexpectedError(err);
- return void 0;
- }
- }
- try {
- return globalThis.trustedTypes?.createPolicy(policyName, policyOptions);
- } catch (err) {
- onUnexpectedError(err);
- return void 0;
- }
-}
-var init_trustedTypes = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/trustedTypes.js"() {
- init_errors();
- init_browser();
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js
-var RenderedLinesCollection, VisibleLinesCollection, ViewLayerRenderer;
-var init_viewLayer = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js"() {
- init_fastDomNode();
- init_trustedTypes();
- init_errors();
- init_stringBuilder();
- RenderedLinesCollection = class {
- constructor(_lineFactory) {
- this._lineFactory = _lineFactory;
- this._set(1, []);
- }
- flush() {
- this._set(1, []);
- }
- _set(rendLineNumberStart, lines) {
- this._lines = lines;
- this._rendLineNumberStart = rendLineNumberStart;
- }
- _get() {
- return {
- rendLineNumberStart: this._rendLineNumberStart,
- lines: this._lines
- };
- }
- /**
- * @returns Inclusive line number that is inside this collection
- */
- getStartLineNumber() {
- return this._rendLineNumberStart;
- }
- /**
- * @returns Inclusive line number that is inside this collection
- */
- getEndLineNumber() {
- return this._rendLineNumberStart + this._lines.length - 1;
- }
- getCount() {
- return this._lines.length;
- }
- getLine(lineNumber) {
- const lineIndex = lineNumber - this._rendLineNumberStart;
- if (lineIndex < 0 || lineIndex >= this._lines.length) {
- throw new BugIndicatingError("Illegal value for lineNumber");
- }
- return this._lines[lineIndex];
- }
- /**
- * @returns Lines that were removed from this collection
- */
- onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) {
- if (this.getCount() === 0) {
- return null;
- }
- const startLineNumber = this.getStartLineNumber();
- const endLineNumber = this.getEndLineNumber();
- if (deleteToLineNumber < startLineNumber) {
- const deleteCnt = deleteToLineNumber - deleteFromLineNumber + 1;
- this._rendLineNumberStart -= deleteCnt;
- return null;
- }
- if (deleteFromLineNumber > endLineNumber) {
- return null;
- }
- let deleteStartIndex = 0;
- let deleteCount = 0;
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
- const lineIndex = lineNumber - this._rendLineNumberStart;
- if (deleteFromLineNumber <= lineNumber && lineNumber <= deleteToLineNumber) {
- if (deleteCount === 0) {
- deleteStartIndex = lineIndex;
- deleteCount = 1;
- } else {
- deleteCount++;
- }
- }
- }
- if (deleteFromLineNumber < startLineNumber) {
- let deleteAboveCount = 0;
- if (deleteToLineNumber < startLineNumber) {
- deleteAboveCount = deleteToLineNumber - deleteFromLineNumber + 1;
- } else {
- deleteAboveCount = startLineNumber - deleteFromLineNumber;
- }
- this._rendLineNumberStart -= deleteAboveCount;
- }
- const deleted = this._lines.splice(deleteStartIndex, deleteCount);
- return deleted;
- }
- onLinesChanged(changeFromLineNumber, changeCount) {
- const changeToLineNumber = changeFromLineNumber + changeCount - 1;
- if (this.getCount() === 0) {
- return false;
- }
- const startLineNumber = this.getStartLineNumber();
- const endLineNumber = this.getEndLineNumber();
- let someoneNotified = false;
- for (let changedLineNumber = changeFromLineNumber; changedLineNumber <= changeToLineNumber; changedLineNumber++) {
- if (changedLineNumber >= startLineNumber && changedLineNumber <= endLineNumber) {
- this._lines[changedLineNumber - this._rendLineNumberStart].onContentChanged();
- someoneNotified = true;
- }
- }
- return someoneNotified;
- }
- onLinesInserted(insertFromLineNumber, insertToLineNumber) {
- if (this.getCount() === 0) {
- return null;
- }
- const insertCnt = insertToLineNumber - insertFromLineNumber + 1;
- const startLineNumber = this.getStartLineNumber();
- const endLineNumber = this.getEndLineNumber();
- if (insertFromLineNumber <= startLineNumber) {
- this._rendLineNumberStart += insertCnt;
- return null;
- }
- if (insertFromLineNumber > endLineNumber) {
- return null;
- }
- if (insertCnt + insertFromLineNumber > endLineNumber) {
- const deleted = this._lines.splice(insertFromLineNumber - this._rendLineNumberStart, endLineNumber - insertFromLineNumber + 1);
- return deleted;
- }
- const newLines = [];
- for (let i2 = 0; i2 < insertCnt; i2++) {
- newLines[i2] = this._lineFactory.createLine();
- }
- const insertIndex = insertFromLineNumber - this._rendLineNumberStart;
- const beforeLines = this._lines.slice(0, insertIndex);
- const afterLines = this._lines.slice(insertIndex, this._lines.length - insertCnt);
- const deletedLines = this._lines.slice(this._lines.length - insertCnt, this._lines.length);
- this._lines = beforeLines.concat(newLines).concat(afterLines);
- return deletedLines;
- }
- onTokensChanged(ranges) {
- if (this.getCount() === 0) {
- return false;
- }
- const startLineNumber = this.getStartLineNumber();
- const endLineNumber = this.getEndLineNumber();
- let notifiedSomeone = false;
- for (let i2 = 0, len = ranges.length; i2 < len; i2++) {
- const rng = ranges[i2];
- if (rng.toLineNumber < startLineNumber || rng.fromLineNumber > endLineNumber) {
- continue;
- }
- const from = Math.max(startLineNumber, rng.fromLineNumber);
- const to = Math.min(endLineNumber, rng.toLineNumber);
- for (let lineNumber = from; lineNumber <= to; lineNumber++) {
- const lineIndex = lineNumber - this._rendLineNumberStart;
- this._lines[lineIndex].onTokensChanged();
- notifiedSomeone = true;
- }
- }
- return notifiedSomeone;
- }
- };
- VisibleLinesCollection = class {
- constructor(_viewContext, _lineFactory) {
- this._viewContext = _viewContext;
- this._lineFactory = _lineFactory;
- this.domNode = this._createDomNode();
- this._linesCollection = new RenderedLinesCollection(this._lineFactory);
- }
- _createDomNode() {
- const domNode = createFastDomNode(document.createElement("div"));
- domNode.setClassName("view-layer");
- domNode.setPosition("absolute");
- domNode.domNode.setAttribute("role", "presentation");
- domNode.domNode.setAttribute("aria-hidden", "true");
- return domNode;
- }
- // ---- begin view event handlers
- onConfigurationChanged(e) {
- if (e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- )) {
- return true;
- }
- return false;
- }
- onFlushed(e, flushDom) {
- if (flushDom) {
- const start = this._linesCollection.getStartLineNumber();
- const end = this._linesCollection.getEndLineNumber();
- for (let i2 = start; i2 <= end; i2++) {
- this._linesCollection.getLine(i2).getDomNode()?.remove();
- }
- }
- this._linesCollection.flush();
- return true;
- }
- onLinesChanged(e) {
- return this._linesCollection.onLinesChanged(e.fromLineNumber, e.count);
- }
- onLinesDeleted(e) {
- const deleted = this._linesCollection.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
- if (deleted) {
- for (let i2 = 0, len = deleted.length; i2 < len; i2++) {
- const lineDomNode = deleted[i2].getDomNode();
- lineDomNode?.remove();
- }
- }
- return true;
- }
- onLinesInserted(e) {
- const deleted = this._linesCollection.onLinesInserted(e.fromLineNumber, e.toLineNumber);
- if (deleted) {
- for (let i2 = 0, len = deleted.length; i2 < len; i2++) {
- const lineDomNode = deleted[i2].getDomNode();
- lineDomNode?.remove();
- }
- }
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onTokensChanged(e) {
- return this._linesCollection.onTokensChanged(e.ranges);
- }
- onZonesChanged(e) {
- return true;
- }
- // ---- end view event handlers
- getStartLineNumber() {
- return this._linesCollection.getStartLineNumber();
- }
- getEndLineNumber() {
- return this._linesCollection.getEndLineNumber();
- }
- getVisibleLine(lineNumber) {
- return this._linesCollection.getLine(lineNumber);
- }
- renderLines(viewportData) {
- const inp = this._linesCollection._get();
- const renderer = new ViewLayerRenderer(this.domNode.domNode, this._lineFactory, viewportData, this._viewContext);
- const ctx = {
- rendLineNumberStart: inp.rendLineNumberStart,
- lines: inp.lines,
- linesLength: inp.lines.length
- };
- const resCtx = renderer.render(ctx, viewportData.startLineNumber, viewportData.endLineNumber, viewportData.relativeVerticalOffset);
- this._linesCollection._set(resCtx.rendLineNumberStart, resCtx.lines);
- }
- };
- ViewLayerRenderer = class _ViewLayerRenderer {
- static {
- this._ttPolicy = createTrustedTypesPolicy("editorViewLayer", { createHTML: (value) => value });
- }
- constructor(_domNode, _lineFactory, _viewportData, _viewContext) {
- this._domNode = _domNode;
- this._lineFactory = _lineFactory;
- this._viewportData = _viewportData;
- this._viewContext = _viewContext;
- }
- render(inContext, startLineNumber, stopLineNumber, deltaTop) {
- const ctx = {
- rendLineNumberStart: inContext.rendLineNumberStart,
- lines: inContext.lines.slice(0),
- linesLength: inContext.linesLength
- };
- if (ctx.rendLineNumberStart + ctx.linesLength - 1 < startLineNumber || stopLineNumber < ctx.rendLineNumberStart) {
- ctx.rendLineNumberStart = startLineNumber;
- ctx.linesLength = stopLineNumber - startLineNumber + 1;
- ctx.lines = [];
- for (let x = startLineNumber; x <= stopLineNumber; x++) {
- ctx.lines[x - startLineNumber] = this._lineFactory.createLine();
- }
- this._finishRendering(ctx, true, deltaTop);
- return ctx;
- }
- this._renderUntouchedLines(ctx, Math.max(startLineNumber - ctx.rendLineNumberStart, 0), Math.min(stopLineNumber - ctx.rendLineNumberStart, ctx.linesLength - 1), deltaTop, startLineNumber);
- if (ctx.rendLineNumberStart > startLineNumber) {
- const fromLineNumber = startLineNumber;
- const toLineNumber = Math.min(stopLineNumber, ctx.rendLineNumberStart - 1);
- if (fromLineNumber <= toLineNumber) {
- this._insertLinesBefore(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber);
- ctx.linesLength += toLineNumber - fromLineNumber + 1;
- }
- } else if (ctx.rendLineNumberStart < startLineNumber) {
- const removeCnt = Math.min(ctx.linesLength, startLineNumber - ctx.rendLineNumberStart);
- if (removeCnt > 0) {
- this._removeLinesBefore(ctx, removeCnt);
- ctx.linesLength -= removeCnt;
- }
- }
- ctx.rendLineNumberStart = startLineNumber;
- if (ctx.rendLineNumberStart + ctx.linesLength - 1 < stopLineNumber) {
- const fromLineNumber = ctx.rendLineNumberStart + ctx.linesLength;
- const toLineNumber = stopLineNumber;
- if (fromLineNumber <= toLineNumber) {
- this._insertLinesAfter(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber);
- ctx.linesLength += toLineNumber - fromLineNumber + 1;
- }
- } else if (ctx.rendLineNumberStart + ctx.linesLength - 1 > stopLineNumber) {
- const fromLineNumber = Math.max(0, stopLineNumber - ctx.rendLineNumberStart + 1);
- const toLineNumber = ctx.linesLength - 1;
- const removeCnt = toLineNumber - fromLineNumber + 1;
- if (removeCnt > 0) {
- this._removeLinesAfter(ctx, removeCnt);
- ctx.linesLength -= removeCnt;
- }
- }
- this._finishRendering(ctx, false, deltaTop);
- return ctx;
- }
- _renderUntouchedLines(ctx, startIndex, endIndex, deltaTop, deltaLN) {
- const rendLineNumberStart = ctx.rendLineNumberStart;
- const lines = ctx.lines;
- for (let i2 = startIndex; i2 <= endIndex; i2++) {
- const lineNumber = rendLineNumberStart + i2;
- lines[i2].layoutLine(lineNumber, deltaTop[lineNumber - deltaLN], this._lineHeightForLineNumber(lineNumber));
- }
- }
- _insertLinesBefore(ctx, fromLineNumber, toLineNumber, deltaTop, deltaLN) {
- const newLines = [];
- let newLinesLen = 0;
- for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {
- newLines[newLinesLen++] = this._lineFactory.createLine();
- }
- ctx.lines = newLines.concat(ctx.lines);
- }
- _removeLinesBefore(ctx, removeCount) {
- for (let i2 = 0; i2 < removeCount; i2++) {
- const lineDomNode = ctx.lines[i2].getDomNode();
- lineDomNode?.remove();
- }
- ctx.lines.splice(0, removeCount);
- }
- _insertLinesAfter(ctx, fromLineNumber, toLineNumber, deltaTop, deltaLN) {
- const newLines = [];
- let newLinesLen = 0;
- for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {
- newLines[newLinesLen++] = this._lineFactory.createLine();
- }
- ctx.lines = ctx.lines.concat(newLines);
- }
- _removeLinesAfter(ctx, removeCount) {
- const removeIndex = ctx.linesLength - removeCount;
- for (let i2 = 0; i2 < removeCount; i2++) {
- const lineDomNode = ctx.lines[removeIndex + i2].getDomNode();
- lineDomNode?.remove();
- }
- ctx.lines.splice(removeIndex, removeCount);
- }
- _finishRenderingNewLines(ctx, domNodeIsEmpty, newLinesHTML, wasNew) {
- if (_ViewLayerRenderer._ttPolicy) {
- newLinesHTML = _ViewLayerRenderer._ttPolicy.createHTML(newLinesHTML);
- }
- const lastChild = this._domNode.lastChild;
- if (domNodeIsEmpty || !lastChild) {
- this._domNode.innerHTML = newLinesHTML;
- } else {
- lastChild.insertAdjacentHTML("afterend", newLinesHTML);
- }
- let currChild = this._domNode.lastChild;
- for (let i2 = ctx.linesLength - 1; i2 >= 0; i2--) {
- const line = ctx.lines[i2];
- if (wasNew[i2]) {
- line.setDomNode(currChild);
- currChild = currChild.previousSibling;
- }
- }
- }
- _finishRenderingInvalidLines(ctx, invalidLinesHTML, wasInvalid) {
- const hugeDomNode = document.createElement("div");
- if (_ViewLayerRenderer._ttPolicy) {
- invalidLinesHTML = _ViewLayerRenderer._ttPolicy.createHTML(invalidLinesHTML);
- }
- hugeDomNode.innerHTML = invalidLinesHTML;
- for (let i2 = 0; i2 < ctx.linesLength; i2++) {
- const line = ctx.lines[i2];
- if (wasInvalid[i2]) {
- const source = hugeDomNode.firstChild;
- const lineDomNode = line.getDomNode();
- lineDomNode.replaceWith(source);
- line.setDomNode(source);
- }
- }
- }
- static {
- this._sb = new StringBuilder(1e5);
- }
- _finishRendering(ctx, domNodeIsEmpty, deltaTop) {
- const sb = _ViewLayerRenderer._sb;
- const linesLength = ctx.linesLength;
- const lines = ctx.lines;
- const rendLineNumberStart = ctx.rendLineNumberStart;
- const wasNew = [];
- {
- sb.reset();
- let hadNewLine = false;
- for (let i2 = 0; i2 < linesLength; i2++) {
- const line = lines[i2];
- wasNew[i2] = false;
- const lineDomNode = line.getDomNode();
- if (lineDomNode) {
- continue;
- }
- const renderedLineNumber = i2 + rendLineNumberStart;
- const renderResult = line.renderLine(renderedLineNumber, deltaTop[i2], this._lineHeightForLineNumber(renderedLineNumber), this._viewportData, sb);
- if (!renderResult) {
- continue;
- }
- wasNew[i2] = true;
- hadNewLine = true;
- }
- if (hadNewLine) {
- this._finishRenderingNewLines(ctx, domNodeIsEmpty, sb.build(), wasNew);
- }
- }
- {
- sb.reset();
- let hadInvalidLine = false;
- const wasInvalid = [];
- for (let i2 = 0; i2 < linesLength; i2++) {
- const line = lines[i2];
- wasInvalid[i2] = false;
- if (wasNew[i2]) {
- continue;
- }
- const renderedLineNumber = i2 + rendLineNumberStart;
- const renderResult = line.renderLine(renderedLineNumber, deltaTop[i2], this._lineHeightForLineNumber(renderedLineNumber), this._viewportData, sb);
- if (!renderResult) {
- continue;
- }
- wasInvalid[i2] = true;
- hadInvalidLine = true;
- }
- if (hadInvalidLine) {
- this._finishRenderingInvalidLines(ctx, sb.build(), wasInvalid);
- }
- }
- }
- _lineHeightForLineNumber(lineNumber) {
- return this._viewContext.viewLayout.getLineHeightForLineNumber(lineNumber);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js
-var ViewOverlays, ViewOverlayLine, ContentViewOverlays, MarginViewOverlays;
-var init_viewOverlays = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js"() {
- init_fastDomNode();
- init_domFontInfo();
- init_viewLayer();
- init_viewPart();
- ViewOverlays = class extends ViewPart {
- constructor(context) {
- super(context);
- this._dynamicOverlays = [];
- this._isFocused = false;
- this._visibleLines = new VisibleLinesCollection(this._context, {
- createLine: () => new ViewOverlayLine(this._dynamicOverlays)
- });
- this.domNode = this._visibleLines.domNode;
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- applyFontInfo(this.domNode, fontInfo);
- this.domNode.setClassName("view-overlays");
- }
- shouldRender() {
- if (super.shouldRender()) {
- return true;
- }
- for (let i2 = 0, len = this._dynamicOverlays.length; i2 < len; i2++) {
- const dynamicOverlay = this._dynamicOverlays[i2];
- if (dynamicOverlay.shouldRender()) {
- return true;
- }
- }
- return false;
- }
- dispose() {
- super.dispose();
- for (let i2 = 0, len = this._dynamicOverlays.length; i2 < len; i2++) {
- const dynamicOverlay = this._dynamicOverlays[i2];
- dynamicOverlay.dispose();
- }
- this._dynamicOverlays = [];
- }
- getDomNode() {
- return this.domNode;
- }
- addDynamicOverlay(overlay) {
- this._dynamicOverlays.push(overlay);
- }
- // ----- event handlers
- onConfigurationChanged(e) {
- this._visibleLines.onConfigurationChanged(e);
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- applyFontInfo(this.domNode, fontInfo);
- return true;
- }
- onFlushed(e) {
- return this._visibleLines.onFlushed(e);
- }
- onFocusChanged(e) {
- this._isFocused = e.isFocused;
- return true;
- }
- onLinesChanged(e) {
- return this._visibleLines.onLinesChanged(e);
- }
- onLinesDeleted(e) {
- return this._visibleLines.onLinesDeleted(e);
- }
- onLinesInserted(e) {
- return this._visibleLines.onLinesInserted(e);
- }
- onScrollChanged(e) {
- return this._visibleLines.onScrollChanged(e) || true;
- }
- onTokensChanged(e) {
- return this._visibleLines.onTokensChanged(e);
- }
- onZonesChanged(e) {
- return this._visibleLines.onZonesChanged(e);
- }
- // ----- end event handlers
- prepareRender(ctx) {
- const toRender = this._dynamicOverlays.filter((overlay) => overlay.shouldRender());
- for (let i2 = 0, len = toRender.length; i2 < len; i2++) {
- const dynamicOverlay = toRender[i2];
- dynamicOverlay.prepareRender(ctx);
- dynamicOverlay.onDidRender();
- }
- }
- render(ctx) {
- this._viewOverlaysRender(ctx);
- this.domNode.toggleClassName("focused", this._isFocused);
- }
- _viewOverlaysRender(ctx) {
- this._visibleLines.renderLines(ctx.viewportData);
- }
- };
- ViewOverlayLine = class {
- constructor(dynamicOverlays) {
- this._dynamicOverlays = dynamicOverlays;
- this._domNode = null;
- this._renderedContent = null;
- }
- getDomNode() {
- if (!this._domNode) {
- return null;
- }
- return this._domNode.domNode;
- }
- setDomNode(domNode) {
- this._domNode = createFastDomNode(domNode);
- }
- onContentChanged() {
- }
- onTokensChanged() {
- }
- renderLine(lineNumber, deltaTop, lineHeight, viewportData, sb) {
- let result = "";
- for (let i2 = 0, len = this._dynamicOverlays.length; i2 < len; i2++) {
- const dynamicOverlay = this._dynamicOverlays[i2];
- result += dynamicOverlay.render(viewportData.startLineNumber, lineNumber);
- }
- if (this._renderedContent === result) {
- return false;
- }
- this._renderedContent = result;
- sb.appendString('');
- sb.appendString(result);
- sb.appendString("
");
- return true;
- }
- layoutLine(lineNumber, deltaTop, lineHeight) {
- if (this._domNode) {
- this._domNode.setTop(deltaTop);
- this._domNode.setHeight(lineHeight);
- this._domNode.setLineHeight(lineHeight);
- }
- }
- };
- ContentViewOverlays = class extends ViewOverlays {
- constructor(context) {
- super(context);
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._contentWidth = layoutInfo.contentWidth;
- this.domNode.setHeight(0);
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._contentWidth = layoutInfo.contentWidth;
- return super.onConfigurationChanged(e) || true;
- }
- onScrollChanged(e) {
- return super.onScrollChanged(e) || e.scrollWidthChanged;
- }
- // --- end event handlers
- _viewOverlaysRender(ctx) {
- super._viewOverlaysRender(ctx);
- this.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth));
- }
- };
- MarginViewOverlays = class extends ViewOverlays {
- constructor(context) {
- super(context);
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._contentLeft = layoutInfo.contentLeft;
- this.domNode.setClassName("margin-view-overlays");
- this.domNode.setWidth(1);
- applyFontInfo(this.domNode, options.get(
- 59
- /* EditorOption.fontInfo */
- ));
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- applyFontInfo(this.domNode, options.get(
- 59
- /* EditorOption.fontInfo */
- ));
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._contentLeft = layoutInfo.contentLeft;
- return super.onConfigurationChanged(e) || true;
- }
- onScrollChanged(e) {
- return super.onScrollChanged(e) || e.scrollHeightChanged;
- }
- _viewOverlaysRender(ctx) {
- super._viewOverlaysRender(ctx);
- const height = Math.min(ctx.scrollHeight, 1e6);
- this.domNode.setHeight(height);
- this.domNode.setWidth(this._contentLeft);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js
-var ViewUserInputEvents;
-var init_viewUserInputEvents = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js"() {
- init_position();
- ViewUserInputEvents = class _ViewUserInputEvents {
- constructor(coordinatesConverter) {
- this.onKeyDown = null;
- this.onKeyUp = null;
- this.onContextMenu = null;
- this.onMouseMove = null;
- this.onMouseLeave = null;
- this.onMouseDown = null;
- this.onMouseUp = null;
- this.onMouseDrag = null;
- this.onMouseDrop = null;
- this.onMouseDropCanceled = null;
- this.onMouseWheel = null;
- this._coordinatesConverter = coordinatesConverter;
- }
- emitKeyDown(e) {
- this.onKeyDown?.(e);
- }
- emitKeyUp(e) {
- this.onKeyUp?.(e);
- }
- emitContextMenu(e) {
- this.onContextMenu?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseMove(e) {
- this.onMouseMove?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseLeave(e) {
- this.onMouseLeave?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseDown(e) {
- this.onMouseDown?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseUp(e) {
- this.onMouseUp?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseDrag(e) {
- this.onMouseDrag?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseDrop(e) {
- this.onMouseDrop?.(this._convertViewToModelMouseEvent(e));
- }
- emitMouseDropCanceled() {
- this.onMouseDropCanceled?.();
- }
- emitMouseWheel(e) {
- this.onMouseWheel?.(e);
- }
- _convertViewToModelMouseEvent(e) {
- if (e.target) {
- return {
- event: e.event,
- target: this._convertViewToModelMouseTarget(e.target)
- };
- }
- return e;
- }
- _convertViewToModelMouseTarget(target) {
- return _ViewUserInputEvents.convertViewToModelMouseTarget(target, this._coordinatesConverter);
- }
- static convertViewToModelMouseTarget(target, coordinatesConverter) {
- const result = { ...target };
- if (result.position) {
- result.position = coordinatesConverter.convertViewPositionToModelPosition(result.position);
- }
- if (result.range) {
- result.range = coordinatesConverter.convertViewRangeToModelRange(result.range);
- }
- if (result.type === 5 || result.type === 8) {
- result.detail = this.convertViewToModelViewZoneData(result.detail, coordinatesConverter);
- }
- return result;
- }
- static convertViewToModelViewZoneData(data, coordinatesConverter) {
- return {
- viewZoneId: data.viewZoneId,
- positionBefore: data.positionBefore ? coordinatesConverter.convertViewPositionToModelPosition(data.positionBefore) : data.positionBefore,
- positionAfter: data.positionAfter ? coordinatesConverter.convertViewPositionToModelPosition(data.positionAfter) : data.positionAfter,
- position: coordinatesConverter.convertViewPositionToModelPosition(data.position),
- afterLineNumber: coordinatesConverter.convertViewPositionToModelPosition(new Position(data.afterLineNumber, 1)).lineNumber
- };
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.css
-var init_blockDecorations = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js
-var BlockDecorations;
-var init_blockDecorations2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js"() {
- init_fastDomNode();
- init_blockDecorations();
- init_viewPart();
- BlockDecorations = class extends ViewPart {
- constructor(context) {
- super(context);
- this.blocks = [];
- this.contentWidth = -1;
- this.contentLeft = 0;
- this.domNode = createFastDomNode(document.createElement("div"));
- this.domNode.setAttribute("role", "presentation");
- this.domNode.setAttribute("aria-hidden", "true");
- this.domNode.setClassName("blockDecorations-container");
- this.update();
- }
- update() {
- let didChange = false;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const newContentWidth = layoutInfo.contentWidth - layoutInfo.verticalScrollbarWidth;
- if (this.contentWidth !== newContentWidth) {
- this.contentWidth = newContentWidth;
- didChange = true;
- }
- const newContentLeft = layoutInfo.contentLeft;
- if (this.contentLeft !== newContentLeft) {
- this.contentLeft = newContentLeft;
- didChange = true;
- }
- return didChange;
- }
- dispose() {
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- return this.update();
- }
- onScrollChanged(e) {
- return e.scrollTopChanged || e.scrollLeftChanged;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- }
- render(ctx) {
- let count = 0;
- const decorations = ctx.getDecorationsInViewport();
- for (const decoration3 of decorations) {
- if (!decoration3.options.blockClassName) {
- continue;
- }
- let block2 = this.blocks[count];
- if (!block2) {
- block2 = this.blocks[count] = createFastDomNode(document.createElement("div"));
- this.domNode.appendChild(block2);
- }
- let top;
- let bottom;
- if (decoration3.options.blockIsAfterEnd) {
- top = ctx.getVerticalOffsetAfterLineNumber(decoration3.range.endLineNumber, false);
- bottom = ctx.getVerticalOffsetAfterLineNumber(decoration3.range.endLineNumber, true);
- } else {
- top = ctx.getVerticalOffsetForLineNumber(decoration3.range.startLineNumber, true);
- bottom = decoration3.range.isEmpty() && !decoration3.options.blockDoesNotCollapse ? ctx.getVerticalOffsetForLineNumber(decoration3.range.startLineNumber, false) : ctx.getVerticalOffsetAfterLineNumber(decoration3.range.endLineNumber, true);
- }
- const [paddingTop, paddingRight, paddingBottom, paddingLeft] = decoration3.options.blockPadding ?? [0, 0, 0, 0];
- block2.setClassName("blockDecorations-block " + decoration3.options.blockClassName);
- block2.setLeft(this.contentLeft - paddingLeft);
- block2.setWidth(this.contentWidth + paddingLeft + paddingRight);
- block2.setTop(top - ctx.scrollTop - paddingTop);
- block2.setHeight(bottom - top + paddingTop + paddingBottom);
- count++;
- }
- for (let i2 = count; i2 < this.blocks.length; i2++) {
- this.blocks[i2].domNode.remove();
- }
- this.blocks.length = count;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js
-function safeInvoke(fn, thisArg, ...args) {
- try {
- return fn.call(thisArg, ...args);
- } catch {
- return null;
- }
-}
-var ViewContentWidgets, Widget2, PositionPair, Coordinate, AnchorCoordinate;
-var init_contentWidgets = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js"() {
- init_dom();
- init_fastDomNode();
- init_viewPart();
- ViewContentWidgets = class extends ViewPart {
- constructor(context, viewDomNode) {
- super(context);
- this._viewDomNode = viewDomNode;
- this._widgets = {};
- this.domNode = createFastDomNode(document.createElement("div"));
- PartFingerprints.write(
- this.domNode,
- 1
- /* PartFingerprint.ContentWidgets */
- );
- this.domNode.setClassName("contentWidgets");
- this.domNode.setPosition("absolute");
- this.domNode.setTop(0);
- this.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement("div"));
- PartFingerprints.write(
- this.overflowingContentWidgetsDomNode,
- 2
- /* PartFingerprint.OverflowingContentWidgets */
- );
- this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets");
- }
- dispose() {
- super.dispose();
- this._widgets = {};
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const keys = Object.keys(this._widgets);
- for (const widgetId of keys) {
- this._widgets[widgetId].onConfigurationChanged(e);
- }
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLineMappingChanged(e) {
- this._updateAnchorsViewPositions();
- return true;
- }
- onLinesChanged(e) {
- this._updateAnchorsViewPositions();
- return true;
- }
- onLinesDeleted(e) {
- this._updateAnchorsViewPositions();
- return true;
- }
- onLinesInserted(e) {
- this._updateAnchorsViewPositions();
- return true;
- }
- onScrollChanged(e) {
- return true;
- }
- onZonesChanged(e) {
- return true;
- }
- // ---- end view event handlers
- _updateAnchorsViewPositions() {
- const keys = Object.keys(this._widgets);
- for (const widgetId of keys) {
- this._widgets[widgetId].updateAnchorViewPosition();
- }
- }
- addWidget(_widget) {
- const myWidget = new Widget2(this._context, this._viewDomNode, _widget);
- this._widgets[myWidget.id] = myWidget;
- if (myWidget.allowEditorOverflow) {
- this.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);
- } else {
- this.domNode.appendChild(myWidget.domNode);
- }
- this.setShouldRender();
- }
- setWidgetPosition(widget, primaryAnchor, secondaryAnchor, preference, affinity) {
- const myWidget = this._widgets[widget.getId()];
- myWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);
- this.setShouldRender();
- }
- removeWidget(widget) {
- const widgetId = widget.getId();
- if (this._widgets.hasOwnProperty(widgetId)) {
- const myWidget = this._widgets[widgetId];
- delete this._widgets[widgetId];
- const domNode = myWidget.domNode.domNode;
- domNode.remove();
- domNode.removeAttribute("monaco-visible-content-widget");
- this.setShouldRender();
- }
- }
- shouldSuppressMouseDownOnWidget(widgetId) {
- if (this._widgets.hasOwnProperty(widgetId)) {
- return this._widgets[widgetId].suppressMouseDown;
- }
- return false;
- }
- onBeforeRender(viewportData) {
- const keys = Object.keys(this._widgets);
- for (const widgetId of keys) {
- this._widgets[widgetId].onBeforeRender(viewportData);
- }
- }
- prepareRender(ctx) {
- const keys = Object.keys(this._widgets);
- for (const widgetId of keys) {
- this._widgets[widgetId].prepareRender(ctx);
- }
- }
- render(ctx) {
- const keys = Object.keys(this._widgets);
- for (const widgetId of keys) {
- this._widgets[widgetId].render(ctx);
- }
- }
- };
- Widget2 = class {
- constructor(context, viewDomNode, actual) {
- this._primaryAnchor = new PositionPair(null, null);
- this._secondaryAnchor = new PositionPair(null, null);
- this._context = context;
- this._viewDomNode = viewDomNode;
- this._actual = actual;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const allowOverflow = options.get(
- 4
- /* EditorOption.allowOverflow */
- );
- this.domNode = createFastDomNode(this._actual.getDomNode());
- this.id = this._actual.getId();
- this.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;
- this.suppressMouseDown = this._actual.suppressMouseDown || false;
- this._fixedOverflowWidgets = options.get(
- 51
- /* EditorOption.fixedOverflowWidgets */
- );
- this._contentWidth = layoutInfo.contentWidth;
- this._contentLeft = layoutInfo.contentLeft;
- this._affinity = null;
- this._preference = [];
- this._cachedDomNodeOffsetWidth = -1;
- this._cachedDomNodeOffsetHeight = -1;
- this._maxWidth = this._getMaxWidth();
- this._isVisible = false;
- this._renderData = null;
- this.domNode.setPosition(this._fixedOverflowWidgets && this.allowEditorOverflow ? "fixed" : "absolute");
- this.domNode.setDisplay("none");
- this.domNode.setVisibility("hidden");
- this.domNode.setAttribute("widgetId", this.id);
- this.domNode.setMaxWidth(this._maxWidth);
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- if (e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- )) {
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._contentLeft = layoutInfo.contentLeft;
- this._contentWidth = layoutInfo.contentWidth;
- this._maxWidth = this._getMaxWidth();
- }
- }
- updateAnchorViewPosition() {
- this._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);
- }
- _setPosition(affinity, primaryAnchor, secondaryAnchor) {
- this._affinity = affinity;
- this._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);
- this._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);
- function getValidPositionPair(position, viewModel, affinity2) {
- if (!position) {
- return new PositionPair(null, null);
- }
- const validModelPosition = viewModel.model.validatePosition(position);
- if (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {
- const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity2 ?? void 0);
- return new PositionPair(position, viewPosition);
- }
- return new PositionPair(position, null);
- }
- }
- _getMaxWidth() {
- const elDocument = this.domNode.domNode.ownerDocument;
- const elWindow = elDocument.defaultView;
- return this.allowEditorOverflow ? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth : this._contentWidth;
- }
- setPosition(primaryAnchor, secondaryAnchor, preference, affinity) {
- this._setPosition(affinity, primaryAnchor, secondaryAnchor);
- this._preference = preference;
- if (this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {
- this.domNode.setDisplay("block");
- } else {
- this.domNode.setDisplay("none");
- }
- this._cachedDomNodeOffsetWidth = -1;
- this._cachedDomNodeOffsetHeight = -1;
- }
- _layoutBoxInViewport(anchor, width2, height, ctx) {
- const aboveLineTop = anchor.top;
- const heightAvailableAboveLine = aboveLineTop;
- const underLineTop = anchor.top + anchor.height;
- const heightAvailableUnderLine = ctx.viewportHeight - underLineTop;
- const aboveTop = aboveLineTop - height;
- const fitsAbove = heightAvailableAboveLine >= height;
- const belowTop = underLineTop;
- const fitsBelow = heightAvailableUnderLine >= height;
- let left = anchor.left;
- if (left + width2 > ctx.scrollLeft + ctx.viewportWidth) {
- left = ctx.scrollLeft + ctx.viewportWidth - width2;
- }
- if (left < ctx.scrollLeft) {
- left = ctx.scrollLeft;
- }
- return { fitsAbove, aboveTop, fitsBelow, belowTop, left };
- }
- _layoutHorizontalSegmentInPage(windowSize, domNodePosition, left, width2) {
- const LEFT_PADDING = 15;
- const RIGHT_PADDING = 15;
- const MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width2);
- const MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width2, windowSize.width - RIGHT_PADDING);
- const elDocument = this._viewDomNode.domNode.ownerDocument;
- const elWindow = elDocument.defaultView;
- let absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);
- if (absoluteLeft + width2 > MAX_LIMIT) {
- const delta = absoluteLeft - (MAX_LIMIT - width2);
- absoluteLeft -= delta;
- left -= delta;
- }
- if (absoluteLeft < MIN_LIMIT) {
- const delta = absoluteLeft - MIN_LIMIT;
- absoluteLeft -= delta;
- left -= delta;
- }
- return [left, absoluteLeft];
- }
- _layoutBoxInPage(anchor, width2, height, ctx) {
- const aboveTop = anchor.top - height;
- const belowTop = anchor.top + anchor.height;
- const domNodePosition = getDomNodePagePosition(this._viewDomNode.domNode);
- const elDocument = this._viewDomNode.domNode.ownerDocument;
- const elWindow = elDocument.defaultView;
- const absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);
- const absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);
- const windowSize = getClientArea(elDocument.body);
- const [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width2);
- const TOP_PADDING = 22;
- const BOTTOM_PADDING = 22;
- const fitsAbove = absoluteAboveTop >= TOP_PADDING;
- const fitsBelow = absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING;
- if (this._fixedOverflowWidgets) {
- return {
- fitsAbove,
- aboveTop: Math.max(absoluteAboveTop, TOP_PADDING),
- fitsBelow,
- belowTop: absoluteBelowTop,
- left: absoluteAboveLeft
- };
- }
- return { fitsAbove, aboveTop, fitsBelow, belowTop, left };
- }
- _prepareRenderWidgetAtExactPositionOverflowing(topLeft) {
- return new Coordinate(topLeft.top, topLeft.left + this._contentLeft);
- }
- /**
- * Compute the coordinates above and below the primary and secondary anchors.
- * The content widget *must* touch the primary anchor.
- * The content widget should touch if possible the secondary anchor.
- */
- _getAnchorsCoordinates(ctx) {
- const primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);
- const secondaryViewPosition = this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null;
- const secondary = getCoordinates(secondaryViewPosition, this._affinity);
- return { primary, secondary };
- function getCoordinates(position, affinity) {
- if (!position) {
- return null;
- }
- const horizontalPosition = ctx.visibleRangeForPosition(position);
- if (!horizontalPosition) {
- return null;
- }
- const left = position.column === 1 && affinity === 3 ? 0 : horizontalPosition.left;
- const top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;
- const lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);
- return new AnchorCoordinate(top, left, lineHeight);
- }
- }
- _reduceAnchorCoordinates(primary, secondary, width2) {
- if (!secondary) {
- return primary;
- }
- const fontInfo = this._context.configuration.options.get(
- 59
- /* EditorOption.fontInfo */
- );
- let left = secondary.left;
- if (left < primary.left) {
- left = Math.max(left, primary.left - width2 + fontInfo.typicalFullwidthCharacterWidth);
- } else {
- left = Math.min(left, primary.left + width2 - fontInfo.typicalFullwidthCharacterWidth);
- }
- return new AnchorCoordinate(primary.top, left, primary.height);
- }
- _prepareRenderWidget(ctx) {
- if (!this._preference || this._preference.length === 0) {
- return null;
- }
- const { primary, secondary } = this._getAnchorsCoordinates(ctx);
- if (!primary) {
- return {
- kind: "offViewport",
- preserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)
- };
- }
- if (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {
- let preferredDimensions = null;
- if (typeof this._actual.beforeRender === "function") {
- preferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);
- }
- if (preferredDimensions) {
- this._cachedDomNodeOffsetWidth = preferredDimensions.width;
- this._cachedDomNodeOffsetHeight = preferredDimensions.height;
- } else {
- const domNode = this.domNode.domNode;
- const clientRect = domNode.getBoundingClientRect();
- this._cachedDomNodeOffsetWidth = Math.round(clientRect.width);
- this._cachedDomNodeOffsetHeight = Math.round(clientRect.height);
- }
- }
- const anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);
- let placement;
- if (this.allowEditorOverflow) {
- placement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);
- } else {
- placement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);
- }
- for (let pass = 1; pass <= 2; pass++) {
- for (const pref of this._preference) {
- if (pref === 1) {
- if (!placement) {
- return null;
- }
- if (pass === 2 || placement.fitsAbove) {
- return {
- kind: "inViewport",
- coordinate: new Coordinate(placement.aboveTop, placement.left),
- position: 1
- /* ContentWidgetPositionPreference.ABOVE */
- };
- }
- } else if (pref === 2) {
- if (!placement) {
- return null;
- }
- if (pass === 2 || placement.fitsBelow) {
- return {
- kind: "inViewport",
- coordinate: new Coordinate(placement.belowTop, placement.left),
- position: 2
- /* ContentWidgetPositionPreference.BELOW */
- };
- }
- } else {
- if (this.allowEditorOverflow) {
- return {
- kind: "inViewport",
- coordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),
- position: 0
- /* ContentWidgetPositionPreference.EXACT */
- };
- } else {
- return {
- kind: "inViewport",
- coordinate: new Coordinate(anchor.top, anchor.left),
- position: 0
- /* ContentWidgetPositionPreference.EXACT */
- };
- }
- }
- }
- }
- return null;
- }
- /**
- * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.
- */
- onBeforeRender(viewportData) {
- if (!this._primaryAnchor.viewPosition || !this._preference) {
- return;
- }
- if (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {
- return;
- }
- this.domNode.setMaxWidth(this._maxWidth);
- }
- prepareRender(ctx) {
- this._renderData = this._prepareRenderWidget(ctx);
- }
- render(ctx) {
- if (!this._renderData || this._renderData.kind === "offViewport") {
- if (this._isVisible) {
- this.domNode.removeAttribute("monaco-visible-content-widget");
- this._isVisible = false;
- if (this._renderData?.kind === "offViewport" && this._renderData.preserveFocus) {
- this.domNode.setTop(-1e3);
- } else {
- this.domNode.setVisibility("hidden");
- }
- }
- if (typeof this._actual.afterRender === "function") {
- safeInvoke(this._actual.afterRender, this._actual, null, null);
- }
- return;
- }
- if (this.allowEditorOverflow) {
- this.domNode.setTop(this._renderData.coordinate.top);
- this.domNode.setLeft(this._renderData.coordinate.left);
- } else {
- this.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);
- this.domNode.setLeft(this._renderData.coordinate.left);
- }
- if (!this._isVisible) {
- this.domNode.setVisibility("inherit");
- this.domNode.setAttribute("monaco-visible-content-widget", "true");
- this._isVisible = true;
- }
- if (typeof this._actual.afterRender === "function") {
- safeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);
- }
- }
- };
- PositionPair = class {
- constructor(modelPosition, viewPosition) {
- this.modelPosition = modelPosition;
- this.viewPosition = viewPosition;
- }
- };
- Coordinate = class {
- constructor(top, left) {
- this.top = top;
- this.left = left;
- this._coordinateBrand = void 0;
- }
- };
- AnchorCoordinate = class {
- constructor(top, left, height) {
- this.top = top;
- this.left = left;
- this.height = height;
- this._anchorCoordinateBrand = void 0;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css
-var init_currentLineHighlight = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js
-var DynamicViewOverlay;
-var init_dynamicViewOverlay = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"() {
- init_viewEventHandler();
- DynamicViewOverlay = class extends ViewEventHandler {
- };
- }
-});
-
-// ../node_modules/monaco-editor/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/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/esm/vs/editor/common/core/editorColorRegistry.js
-var editorLineHighlight, editorLineHighlightBorder, editorCursorForeground, editorCursorBackground, editorMultiCursorPrimaryForeground, editorMultiCursorPrimaryBackground, editorMultiCursorSecondaryForeground, editorMultiCursorSecondaryBackground, editorWhitespaces, editorLineNumbers, deprecatedEditorIndentGuides, deprecatedEditorActiveIndentGuides, editorIndentGuide1, editorIndentGuide2, editorIndentGuide3, editorIndentGuide4, editorIndentGuide5, editorIndentGuide6, editorActiveIndentGuide1, editorActiveIndentGuide2, editorActiveIndentGuide3, editorActiveIndentGuide4, editorActiveIndentGuide5, editorActiveIndentGuide6, deprecatedEditorActiveLineNumber, editorDimmedLineNumber, editorRuler, editorOverviewRulerBorder, editorOverviewRulerBackground, editorUnnecessaryCodeOpacity, ghostTextForeground, rulerRangeDefault, overviewRulerRangeHighlight, overviewRulerError, overviewRulerWarning, overviewRulerInfo, editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketHighlightingUnexpectedBracketForeground, editorBracketPairGuideBackground1, editorBracketPairGuideBackground2, editorBracketPairGuideBackground3, editorBracketPairGuideBackground4, editorBracketPairGuideBackground5, editorBracketPairGuideBackground6, editorBracketPairGuideActiveBackground1, editorBracketPairGuideActiveBackground2, editorBracketPairGuideActiveBackground3, editorBracketPairGuideActiveBackground4, editorBracketPairGuideActiveBackground5, editorBracketPairGuideActiveBackground6;
-var init_editorColorRegistry = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js"() {
- init_nls();
- init_color();
- init_colorUtils();
- init_baseColors();
- init_chartsColors();
- init_editorColors();
- init_inputColors();
- init_listColors();
- init_menuColors();
- init_minimapColors();
- init_miscColors();
- init_quickpickColors();
- init_searchColors();
- 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."));
- 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);
- registerColor("editor.rangeHighlightBorder", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(613, "Background color of the border around highlighted ranges."));
- 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);
- 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."));
- 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."));
- registerColor("editorCodeLens.foreground", { dark: "#999999", light: "#919191", hcDark: "#999999", hcLight: "#292929" }, localize(645, "Foreground color of editor CodeLens"));
- registerColor("editorBracketMatch.background", { dark: "#0064001a", light: "#0064001a", hcDark: "#0064001a", hcLight: "#0000" }, localize(646, "Background color behind matching brackets"));
- 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."));
- registerColor("editorGutter.background", editorBackground, localize(650, "Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));
- 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.`));
- 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."));
- 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."));
- registerColor("editorUnicodeHighlight.border", editorWarningForeground, localize(679, "Border color used to highlight unicode characters."));
- 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/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js
-var AbstractLineHighlightOverlay, CurrentLineHighlightOverlay, CurrentLineMarginHighlightOverlay;
-var init_currentLineHighlight2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js"() {
- init_currentLineHighlight();
- init_dynamicViewOverlay();
- init_editorColorRegistry();
- init_arrays();
- init_themeService();
- init_selection();
- init_theme();
- init_position();
- AbstractLineHighlightOverlay = class extends DynamicViewOverlay {
- constructor(context) {
- super();
- this._context = context;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._renderLineHighlight = options.get(
- 110
- /* EditorOption.renderLineHighlight */
- );
- this._renderLineHighlightOnlyWhenFocus = options.get(
- 111
- /* EditorOption.renderLineHighlightOnlyWhenFocus */
- );
- this._wordWrap = layoutInfo.isViewportWrapping;
- this._contentLeft = layoutInfo.contentLeft;
- this._contentWidth = layoutInfo.contentWidth;
- this._selectionIsEmpty = true;
- this._focused = false;
- this._cursorLineNumbers = [1];
- this._selections = [new Selection(1, 1, 1, 1)];
- this._renderData = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- super.dispose();
- }
- _readFromSelections() {
- let hasChanged = false;
- const lineNumbers = /* @__PURE__ */ new Set();
- for (const selection of this._selections) {
- lineNumbers.add(selection.positionLineNumber);
- }
- const cursorsLineNumbers = Array.from(lineNumbers);
- cursorsLineNumbers.sort((a, b) => a - b);
- if (!equals(this._cursorLineNumbers, cursorsLineNumbers)) {
- this._cursorLineNumbers = cursorsLineNumbers;
- hasChanged = true;
- }
- const selectionIsEmpty = this._selections.every((s) => s.isEmpty());
- if (this._selectionIsEmpty !== selectionIsEmpty) {
- this._selectionIsEmpty = selectionIsEmpty;
- hasChanged = true;
- }
- return hasChanged;
- }
- // --- begin event handlers
- onThemeChanged(e) {
- return this._readFromSelections();
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._renderLineHighlight = options.get(
- 110
- /* EditorOption.renderLineHighlight */
- );
- this._renderLineHighlightOnlyWhenFocus = options.get(
- 111
- /* EditorOption.renderLineHighlightOnlyWhenFocus */
- );
- this._wordWrap = layoutInfo.isViewportWrapping;
- this._contentLeft = layoutInfo.contentLeft;
- this._contentWidth = layoutInfo.contentWidth;
- return true;
- }
- onCursorStateChanged(e) {
- this._selections = e.selections;
- return this._readFromSelections();
- }
- onFlushed(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollWidthChanged || e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- onFocusChanged(e) {
- if (!this._renderLineHighlightOnlyWhenFocus) {
- return false;
- }
- this._focused = e.isFocused;
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- if (!this._shouldRenderThis()) {
- this._renderData = null;
- return;
- }
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const renderData = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- renderData[lineIndex] = "";
- }
- if (this._wordWrap) {
- const renderedLineWrapped = this._renderOne(ctx, false);
- for (const cursorLineNumber of this._cursorLineNumbers) {
- const coordinatesConverter = this._context.viewModel.coordinatesConverter;
- const modelLineNumber = coordinatesConverter.convertViewPositionToModelPosition(new Position(cursorLineNumber, 1)).lineNumber;
- const firstViewLineNumber = coordinatesConverter.convertModelPositionToViewPosition(new Position(modelLineNumber, 1)).lineNumber;
- const lastViewLineNumber = coordinatesConverter.convertModelPositionToViewPosition(new Position(modelLineNumber, this._context.viewModel.model.getLineMaxColumn(modelLineNumber))).lineNumber;
- const firstLine = Math.max(firstViewLineNumber, visibleStartLineNumber);
- const lastLine = Math.min(lastViewLineNumber, visibleEndLineNumber);
- for (let lineNumber = firstLine; lineNumber <= lastLine; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- renderData[lineIndex] = renderedLineWrapped;
- }
- }
- }
- const renderedLineExact = this._renderOne(ctx, true);
- for (const cursorLineNumber of this._cursorLineNumbers) {
- if (cursorLineNumber < visibleStartLineNumber || cursorLineNumber > visibleEndLineNumber) {
- continue;
- }
- const lineIndex = cursorLineNumber - visibleStartLineNumber;
- renderData[lineIndex] = renderedLineExact;
- }
- this._renderData = renderData;
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderData) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex >= this._renderData.length) {
- return "";
- }
- return this._renderData[lineIndex];
- }
- _shouldRenderInMargin() {
- return (this._renderLineHighlight === "gutter" || this._renderLineHighlight === "all") && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
- }
- _shouldRenderInContent() {
- return (this._renderLineHighlight === "line" || this._renderLineHighlight === "all") && this._selectionIsEmpty && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
- }
- };
- CurrentLineHighlightOverlay = class extends AbstractLineHighlightOverlay {
- _renderOne(ctx, exact) {
- const className2 = "current-line" + (this._shouldRenderInMargin() ? " current-line-both" : "") + (exact ? " current-line-exact" : "");
- return `
`;
- }
- _shouldRenderThis() {
- return this._shouldRenderInContent();
- }
- _shouldRenderOther() {
- return this._shouldRenderInMargin();
- }
- };
- CurrentLineMarginHighlightOverlay = class extends AbstractLineHighlightOverlay {
- _renderOne(ctx, exact) {
- const className2 = "current-line" + (this._shouldRenderInMargin() ? " current-line-margin" : "") + (this._shouldRenderOther() ? " current-line-margin-both" : "") + (this._shouldRenderInMargin() && exact ? " current-line-exact-margin" : "");
- return `
`;
- }
- _shouldRenderThis() {
- return true;
- }
- _shouldRenderOther() {
- return this._shouldRenderInContent();
- }
- };
- registerThemingParticipant((theme, collector) => {
- const lineHighlight = theme.getColor(editorLineHighlight);
- if (lineHighlight) {
- collector.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${lineHighlight}; }`);
- collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`);
- }
- if (!lineHighlight || lineHighlight.isTransparent() || theme.defines(editorLineHighlightBorder)) {
- const lineHighlightBorder = theme.getColor(editorLineHighlightBorder);
- if (lineHighlightBorder) {
- collector.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${lineHighlightBorder}; }`);
- collector.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${lineHighlightBorder}; }`);
- if (isHighContrast(theme.type)) {
- collector.addRule(`.monaco-editor .view-overlays .current-line-exact { border-width: 1px; }`);
- collector.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }`);
- }
- }
- }
- });
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css
-var init_decorations = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js
-var DecorationsOverlay;
-var init_decorations2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js"() {
- init_decorations();
- init_dynamicViewOverlay();
- init_renderingContext();
- init_range();
- DecorationsOverlay = class extends DynamicViewOverlay {
- constructor(context) {
- super();
- this._context = context;
- const options = this._context.configuration.options;
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- this._renderResult = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged || e.scrollWidthChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- const _decorations = ctx.getDecorationsInViewport();
- let decorations = [];
- let decorationsLen = 0;
- for (let i2 = 0, len = _decorations.length; i2 < len; i2++) {
- const d = _decorations[i2];
- if (d.options.className) {
- decorations[decorationsLen++] = d;
- }
- }
- decorations = decorations.sort((a, b) => {
- if (a.options.zIndex < b.options.zIndex) {
- return -1;
- }
- if (a.options.zIndex > b.options.zIndex) {
- return 1;
- }
- const aClassName = a.options.className;
- const bClassName = b.options.className;
- if (aClassName < bClassName) {
- return -1;
- }
- if (aClassName > bClassName) {
- return 1;
- }
- return Range.compareRangesUsingStarts(a.range, b.range);
- });
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const output = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- output[lineIndex] = "";
- }
- this._renderWholeLineDecorations(ctx, decorations, output);
- this._renderNormalDecorations(ctx, decorations, output);
- this._renderResult = output;
- }
- _renderWholeLineDecorations(ctx, decorations, output) {
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- for (let i2 = 0, lenI = decorations.length; i2 < lenI; i2++) {
- const d = decorations[i2];
- if (!d.options.isWholeLine) {
- continue;
- }
- const decorationOutput = '
';
- const startLineNumber = Math.max(d.range.startLineNumber, visibleStartLineNumber);
- const endLineNumber = Math.min(d.range.endLineNumber, visibleEndLineNumber);
- for (let j = startLineNumber; j <= endLineNumber; j++) {
- const lineIndex = j - visibleStartLineNumber;
- output[lineIndex] += decorationOutput;
- }
- }
- }
- _renderNormalDecorations(ctx, decorations, output) {
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- let prevClassName = null;
- let prevShowIfCollapsed = false;
- let prevRange = null;
- let prevShouldFillLineOnLineBreak = false;
- for (let i2 = 0, lenI = decorations.length; i2 < lenI; i2++) {
- const d = decorations[i2];
- if (d.options.isWholeLine) {
- continue;
- }
- const className2 = d.options.className;
- const showIfCollapsed = Boolean(d.options.showIfCollapsed);
- let range2 = d.range;
- if (showIfCollapsed && range2.endColumn === 1 && range2.endLineNumber !== range2.startLineNumber) {
- range2 = new Range(range2.startLineNumber, range2.startColumn, range2.endLineNumber - 1, this._context.viewModel.getLineMaxColumn(range2.endLineNumber - 1));
- }
- if (prevClassName === className2 && prevShowIfCollapsed === showIfCollapsed && Range.areIntersectingOrTouching(prevRange, range2)) {
- prevRange = Range.plusRange(prevRange, range2);
- continue;
- }
- if (prevClassName !== null) {
- this._renderNormalDecoration(ctx, prevRange, prevClassName, prevShouldFillLineOnLineBreak, prevShowIfCollapsed, visibleStartLineNumber, output);
- }
- prevClassName = className2;
- prevShowIfCollapsed = showIfCollapsed;
- prevRange = range2;
- prevShouldFillLineOnLineBreak = d.options.shouldFillLineOnLineBreak ?? false;
- }
- if (prevClassName !== null) {
- this._renderNormalDecoration(ctx, prevRange, prevClassName, prevShouldFillLineOnLineBreak, prevShowIfCollapsed, visibleStartLineNumber, output);
- }
- }
- _renderNormalDecoration(ctx, range2, className2, shouldFillLineOnLineBreak, showIfCollapsed, visibleStartLineNumber, output) {
- const linesVisibleRanges = ctx.linesVisibleRangesForRange(
- range2,
- /*TODO@Alex*/
- className2 === "findMatch"
- );
- if (!linesVisibleRanges) {
- return;
- }
- for (let j = 0, lenJ = linesVisibleRanges.length; j < lenJ; j++) {
- const lineVisibleRanges = linesVisibleRanges[j];
- if (lineVisibleRanges.outsideRenderedLine) {
- continue;
- }
- const lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber;
- if (showIfCollapsed && lineVisibleRanges.ranges.length === 1) {
- const singleVisibleRange = lineVisibleRanges.ranges[0];
- if (singleVisibleRange.width < this._typicalHalfwidthCharacterWidth) {
- const center = Math.round(singleVisibleRange.left + singleVisibleRange.width / 2);
- const left = Math.max(0, Math.round(center - this._typicalHalfwidthCharacterWidth / 2));
- lineVisibleRanges.ranges[0] = new HorizontalRange(left, this._typicalHalfwidthCharacterWidth);
- }
- }
- for (let k = 0, lenK = lineVisibleRanges.ranges.length; k < lenK; k++) {
- const expandToLeft = shouldFillLineOnLineBreak && lineVisibleRanges.continuesOnNextLine && lenK === 1;
- const visibleRange = lineVisibleRanges.ranges[k];
- const decorationOutput = '
';
- output[lineIndex] += decorationOutput;
- }
- }
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex < 0 || lineIndex >= this._renderResult.length) {
- return "";
- }
- return this._renderResult[lineIndex];
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js
-var EditorScrollbar2;
-var init_editorScrollbar = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js"() {
- init_dom();
- init_fastDomNode();
- init_scrollableElement();
- init_viewPart();
- init_themeService();
- EditorScrollbar2 = class extends ViewPart {
- constructor(context, linesContent, viewDomNode, overflowGuardDomNode) {
- super(context);
- const options = this._context.configuration.options;
- const scrollbar = options.get(
- 117
- /* EditorOption.scrollbar */
- );
- const mouseWheelScrollSensitivity = options.get(
- 83
- /* EditorOption.mouseWheelScrollSensitivity */
- );
- const fastScrollSensitivity = options.get(
- 49
- /* EditorOption.fastScrollSensitivity */
- );
- const scrollPredominantAxis = options.get(
- 120
- /* EditorOption.scrollPredominantAxis */
- );
- const inertialScroll = options.get(
- 158
- /* EditorOption.inertialScroll */
- );
- const scrollbarOptions = {
- listenOnDomNode: viewDomNode.domNode,
- className: "editor-scrollable " + getThemeTypeSelector(context.theme.type),
- useShadows: false,
- lazyRender: true,
- vertical: scrollbar.vertical,
- horizontal: scrollbar.horizontal,
- verticalHasArrows: scrollbar.verticalHasArrows,
- horizontalHasArrows: scrollbar.horizontalHasArrows,
- verticalScrollbarSize: scrollbar.verticalScrollbarSize,
- verticalSliderSize: scrollbar.verticalSliderSize,
- horizontalScrollbarSize: scrollbar.horizontalScrollbarSize,
- horizontalSliderSize: scrollbar.horizontalSliderSize,
- handleMouseWheel: scrollbar.handleMouseWheel,
- alwaysConsumeMouseWheel: scrollbar.alwaysConsumeMouseWheel,
- arrowSize: scrollbar.arrowSize,
- mouseWheelScrollSensitivity,
- fastScrollSensitivity,
- scrollPredominantAxis,
- scrollByPage: scrollbar.scrollByPage,
- inertialScroll
- };
- this.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.getScrollable()));
- PartFingerprints.write(
- this.scrollbar.getDomNode(),
- 6
- /* PartFingerprint.ScrollableElement */
- );
- this.scrollbarDomNode = createFastDomNode(this.scrollbar.getDomNode());
- this.scrollbarDomNode.setPosition("absolute");
- this._setLayout();
- const onBrowserDesperateReveal = (domNode, lookAtScrollTop, lookAtScrollLeft) => {
- const newScrollPosition = {};
- {
- const deltaTop = domNode.scrollTop;
- if (deltaTop) {
- newScrollPosition.scrollTop = this._context.viewLayout.getCurrentScrollTop() + deltaTop;
- domNode.scrollTop = 0;
- }
- }
- if (lookAtScrollLeft) {
- const deltaLeft = domNode.scrollLeft;
- if (deltaLeft) {
- newScrollPosition.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + deltaLeft;
- domNode.scrollLeft = 0;
- }
- }
- this._context.viewModel.viewLayout.setScrollPosition(
- newScrollPosition,
- 1
- /* ScrollType.Immediate */
- );
- };
- this._register(addDisposableListener(viewDomNode.domNode, "scroll", (e) => onBrowserDesperateReveal(viewDomNode.domNode, true, true)));
- this._register(addDisposableListener(linesContent.domNode, "scroll", (e) => onBrowserDesperateReveal(linesContent.domNode, true, false)));
- this._register(addDisposableListener(overflowGuardDomNode.domNode, "scroll", (e) => onBrowserDesperateReveal(overflowGuardDomNode.domNode, true, false)));
- this._register(addDisposableListener(this.scrollbarDomNode.domNode, "scroll", (e) => onBrowserDesperateReveal(this.scrollbarDomNode.domNode, true, false)));
- }
- dispose() {
- super.dispose();
- }
- _setLayout() {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this.scrollbarDomNode.setLeft(layoutInfo.contentLeft);
- const minimap = options.get(
- 81
- /* EditorOption.minimap */
- );
- const side = minimap.side;
- if (side === "right") {
- this.scrollbarDomNode.setWidth(layoutInfo.contentWidth + layoutInfo.minimap.minimapWidth);
- } else {
- this.scrollbarDomNode.setWidth(layoutInfo.contentWidth);
- }
- this.scrollbarDomNode.setHeight(layoutInfo.height);
- }
- getOverviewRulerLayoutInfo() {
- return this.scrollbar.getOverviewRulerLayoutInfo();
- }
- getDomNode() {
- return this.scrollbarDomNode;
- }
- delegateVerticalScrollbarPointerDown(browserEvent) {
- this.scrollbar.delegateVerticalScrollbarPointerDown(browserEvent);
- }
- delegateScrollFromMouseWheelEvent(browserEvent) {
- this.scrollbar.delegateScrollFromMouseWheelEvent(browserEvent);
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- if (e.hasChanged(
- 117
- /* EditorOption.scrollbar */
- ) || e.hasChanged(
- 83
- /* EditorOption.mouseWheelScrollSensitivity */
- ) || e.hasChanged(
- 49
- /* EditorOption.fastScrollSensitivity */
- )) {
- const options = this._context.configuration.options;
- const scrollbar = options.get(
- 117
- /* EditorOption.scrollbar */
- );
- const mouseWheelScrollSensitivity = options.get(
- 83
- /* EditorOption.mouseWheelScrollSensitivity */
- );
- const fastScrollSensitivity = options.get(
- 49
- /* EditorOption.fastScrollSensitivity */
- );
- const scrollPredominantAxis = options.get(
- 120
- /* EditorOption.scrollPredominantAxis */
- );
- const newOpts = {
- vertical: scrollbar.vertical,
- horizontal: scrollbar.horizontal,
- verticalScrollbarSize: scrollbar.verticalScrollbarSize,
- horizontalScrollbarSize: scrollbar.horizontalScrollbarSize,
- scrollByPage: scrollbar.scrollByPage,
- handleMouseWheel: scrollbar.handleMouseWheel,
- mouseWheelScrollSensitivity,
- fastScrollSensitivity,
- scrollPredominantAxis
- };
- this.scrollbar.updateOptions(newOpts);
- }
- if (e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- )) {
- this._setLayout();
- }
- return true;
- }
- onScrollChanged(e) {
- return true;
- }
- onThemeChanged(e) {
- this.scrollbar.updateClassName("editor-scrollable " + getThemeTypeSelector(this._context.theme.type));
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- }
- render(ctx) {
- this.scrollbar.renderNow();
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css
-var init_glyphMargin = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js
-var DecorationToRender, LineDecorationToRender, VisibleLineDecorationsToRender, DedupOverlay, GlyphMarginWidgets, DecorationBasedGlyphRenderRequest, WidgetBasedGlyphRenderRequest, DecorationBasedGlyph;
-var init_glyphMargin2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js"() {
- init_fastDomNode();
- init_arrays();
- init_glyphMargin();
- init_dynamicViewOverlay();
- init_viewPart();
- init_position();
- init_range();
- init_model2();
- DecorationToRender = class {
- constructor(startLineNumber, endLineNumber, className2, tooltip, zIndex) {
- this.startLineNumber = startLineNumber;
- this.endLineNumber = endLineNumber;
- this.className = className2;
- this.tooltip = tooltip;
- this._decorationToRenderBrand = void 0;
- this.zIndex = zIndex ?? 0;
- }
- };
- LineDecorationToRender = class {
- constructor(className2, zIndex, tooltip) {
- this.className = className2;
- this.zIndex = zIndex;
- this.tooltip = tooltip;
- }
- };
- VisibleLineDecorationsToRender = class {
- constructor() {
- this.decorations = [];
- }
- add(decoration3) {
- this.decorations.push(decoration3);
- }
- getDecorations() {
- return this.decorations;
- }
- };
- DedupOverlay = class extends DynamicViewOverlay {
- /**
- * Returns an array with an element for each visible line number.
- */
- _render(visibleStartLineNumber, visibleEndLineNumber, decorations) {
- const output = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- output[lineIndex] = new VisibleLineDecorationsToRender();
- }
- if (decorations.length === 0) {
- return output;
- }
- decorations.sort((a, b) => {
- if (a.className === b.className) {
- if (a.startLineNumber === b.startLineNumber) {
- return a.endLineNumber - b.endLineNumber;
- }
- return a.startLineNumber - b.startLineNumber;
- }
- return a.className < b.className ? -1 : 1;
- });
- let prevClassName = null;
- let prevEndLineIndex = 0;
- for (let i2 = 0, len = decorations.length; i2 < len; i2++) {
- const d = decorations[i2];
- const className2 = d.className;
- const zIndex = d.zIndex;
- let startLineIndex = Math.max(d.startLineNumber, visibleStartLineNumber) - visibleStartLineNumber;
- const endLineIndex = Math.min(d.endLineNumber, visibleEndLineNumber) - visibleStartLineNumber;
- if (prevClassName === className2) {
- startLineIndex = Math.max(prevEndLineIndex + 1, startLineIndex);
- prevEndLineIndex = Math.max(prevEndLineIndex, endLineIndex);
- } else {
- prevClassName = className2;
- prevEndLineIndex = endLineIndex;
- }
- for (let i3 = startLineIndex; i3 <= prevEndLineIndex; i3++) {
- output[i3].add(new LineDecorationToRender(className2, zIndex, d.tooltip));
- }
- }
- return output;
- }
- };
- GlyphMarginWidgets = class extends ViewPart {
- constructor(context) {
- super(context);
- this._widgets = {};
- this._context = context;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this.domNode = createFastDomNode(document.createElement("div"));
- this.domNode.setClassName("glyph-margin-widgets");
- this.domNode.setPosition("absolute");
- this.domNode.setTop(0);
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._glyphMargin = options.get(
- 66
- /* EditorOption.glyphMargin */
- );
- this._glyphMarginLeft = layoutInfo.glyphMarginLeft;
- this._glyphMarginWidth = layoutInfo.glyphMarginWidth;
- this._glyphMarginDecorationLaneCount = layoutInfo.glyphMarginDecorationLaneCount;
- this._managedDomNodes = [];
- this._decorationGlyphsToRender = [];
- }
- dispose() {
- this._managedDomNodes = [];
- this._decorationGlyphsToRender = [];
- this._widgets = {};
- super.dispose();
- }
- getWidgets() {
- return Object.values(this._widgets);
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._glyphMargin = options.get(
- 66
- /* EditorOption.glyphMargin */
- );
- this._glyphMarginLeft = layoutInfo.glyphMarginLeft;
- this._glyphMarginWidth = layoutInfo.glyphMarginWidth;
- this._glyphMarginDecorationLaneCount = layoutInfo.glyphMarginDecorationLaneCount;
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- // --- begin widget management
- addWidget(widget) {
- const domNode = createFastDomNode(widget.getDomNode());
- this._widgets[widget.getId()] = {
- widget,
- preference: widget.getPosition(),
- domNode,
- renderInfo: null
- };
- domNode.setPosition("absolute");
- domNode.setDisplay("none");
- domNode.setAttribute("widgetId", widget.getId());
- this.domNode.appendChild(domNode);
- this.setShouldRender();
- }
- setWidgetPosition(widget, preference) {
- const myWidget = this._widgets[widget.getId()];
- if (myWidget.preference.lane === preference.lane && myWidget.preference.zIndex === preference.zIndex && Range.equalsRange(myWidget.preference.range, preference.range)) {
- return false;
- }
- myWidget.preference = preference;
- this.setShouldRender();
- return true;
- }
- removeWidget(widget) {
- const widgetId = widget.getId();
- if (this._widgets[widgetId]) {
- const widgetData = this._widgets[widgetId];
- const domNode = widgetData.domNode.domNode;
- delete this._widgets[widgetId];
- domNode.remove();
- this.setShouldRender();
- }
- }
- // --- end widget management
- _collectDecorationBasedGlyphRenderRequest(ctx, requests) {
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const decorations = ctx.getDecorationsInViewport();
- for (const d of decorations) {
- const glyphMarginClassName = d.options.glyphMarginClassName;
- if (!glyphMarginClassName) {
- continue;
- }
- const startLineNumber = Math.max(d.range.startLineNumber, visibleStartLineNumber);
- const endLineNumber = Math.min(d.range.endLineNumber, visibleEndLineNumber);
- const lane = d.options.glyphMargin?.position ?? GlyphMarginLane.Center;
- const zIndex = d.options.zIndex ?? 0;
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
- const modelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber, 0));
- const laneIndex = this._context.viewModel.glyphLanes.getLanesAtLine(modelPosition.lineNumber).indexOf(lane);
- requests.push(new DecorationBasedGlyphRenderRequest(lineNumber, laneIndex, zIndex, glyphMarginClassName));
- }
- }
- }
- _collectWidgetBasedGlyphRenderRequest(ctx, requests) {
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- for (const widget of Object.values(this._widgets)) {
- const range2 = widget.preference.range;
- const { startLineNumber, endLineNumber } = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(Range.lift(range2));
- if (!startLineNumber || !endLineNumber || endLineNumber < visibleStartLineNumber || startLineNumber > visibleEndLineNumber) {
- continue;
- }
- const widgetLineNumber = Math.max(startLineNumber, visibleStartLineNumber);
- const modelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(widgetLineNumber, 0));
- const laneIndex = this._context.viewModel.glyphLanes.getLanesAtLine(modelPosition.lineNumber).indexOf(widget.preference.lane);
- requests.push(new WidgetBasedGlyphRenderRequest(widgetLineNumber, laneIndex, widget.preference.zIndex, widget));
- }
- }
- _collectSortedGlyphRenderRequests(ctx) {
- const requests = [];
- this._collectDecorationBasedGlyphRenderRequest(ctx, requests);
- this._collectWidgetBasedGlyphRenderRequest(ctx, requests);
- requests.sort((a, b) => {
- if (a.lineNumber === b.lineNumber) {
- if (a.laneIndex === b.laneIndex) {
- if (a.zIndex === b.zIndex) {
- if (b.type === a.type) {
- if (a.type === 0 && b.type === 0) {
- return a.className < b.className ? -1 : 1;
- }
- return 0;
- }
- return b.type - a.type;
- }
- return b.zIndex - a.zIndex;
- }
- return a.laneIndex - b.laneIndex;
- }
- return a.lineNumber - b.lineNumber;
- });
- return requests;
- }
- /**
- * Will store render information in each widget's renderInfo and in `_decorationGlyphsToRender`.
- */
- prepareRender(ctx) {
- if (!this._glyphMargin) {
- this._decorationGlyphsToRender = [];
- return;
- }
- for (const widget of Object.values(this._widgets)) {
- widget.renderInfo = null;
- }
- const requests = new ArrayQueue(this._collectSortedGlyphRenderRequests(ctx));
- const decorationGlyphsToRender = [];
- while (requests.length > 0) {
- const first2 = requests.peek();
- if (!first2) {
- break;
- }
- const requestsAtLocation = requests.takeWhile((el) => el.lineNumber === first2.lineNumber && el.laneIndex === first2.laneIndex);
- if (!requestsAtLocation || requestsAtLocation.length === 0) {
- break;
- }
- const winner = requestsAtLocation[0];
- if (winner.type === 0) {
- const classNames2 = [];
- for (const request of requestsAtLocation) {
- if (request.zIndex !== winner.zIndex || request.type !== winner.type) {
- break;
- }
- if (classNames2.length === 0 || classNames2[classNames2.length - 1] !== request.className) {
- classNames2.push(request.className);
- }
- }
- decorationGlyphsToRender.push(winner.accept(classNames2.join(" ")));
- } else {
- winner.widget.renderInfo = {
- lineNumber: winner.lineNumber,
- laneIndex: winner.laneIndex
- };
- }
- }
- this._decorationGlyphsToRender = decorationGlyphsToRender;
- }
- render(ctx) {
- if (!this._glyphMargin) {
- for (const widget of Object.values(this._widgets)) {
- widget.domNode.setDisplay("none");
- }
- while (this._managedDomNodes.length > 0) {
- const domNode = this._managedDomNodes.pop();
- domNode?.domNode.remove();
- }
- return;
- }
- const width2 = Math.round(this._glyphMarginWidth / this._glyphMarginDecorationLaneCount);
- for (const widget of Object.values(this._widgets)) {
- if (!widget.renderInfo) {
- widget.domNode.setDisplay("none");
- } else {
- const top = ctx.viewportData.relativeVerticalOffset[widget.renderInfo.lineNumber - ctx.viewportData.startLineNumber];
- const left = this._glyphMarginLeft + widget.renderInfo.laneIndex * this._lineHeight;
- widget.domNode.setDisplay("block");
- widget.domNode.setTop(top);
- widget.domNode.setLeft(left);
- widget.domNode.setWidth(width2);
- widget.domNode.setHeight(this._lineHeight);
- }
- }
- for (let i2 = 0; i2 < this._decorationGlyphsToRender.length; i2++) {
- const dec = this._decorationGlyphsToRender[i2];
- const decLineNumber = dec.lineNumber;
- const top = ctx.viewportData.relativeVerticalOffset[decLineNumber - ctx.viewportData.startLineNumber];
- const left = this._glyphMarginLeft + dec.laneIndex * this._lineHeight;
- let domNode;
- if (i2 < this._managedDomNodes.length) {
- domNode = this._managedDomNodes[i2];
- } else {
- domNode = createFastDomNode(document.createElement("div"));
- this._managedDomNodes.push(domNode);
- this.domNode.appendChild(domNode);
- }
- const lineHeight = this._context.viewLayout.getLineHeightForLineNumber(decLineNumber);
- domNode.setClassName(`cgmr codicon ` + dec.combinedClassName);
- domNode.setPosition(`absolute`);
- domNode.setTop(top);
- domNode.setLeft(left);
- domNode.setWidth(width2);
- domNode.setHeight(lineHeight);
- }
- while (this._managedDomNodes.length > this._decorationGlyphsToRender.length) {
- const domNode = this._managedDomNodes.pop();
- domNode?.domNode.remove();
- }
- }
- };
- DecorationBasedGlyphRenderRequest = class {
- constructor(lineNumber, laneIndex, zIndex, className2) {
- this.lineNumber = lineNumber;
- this.laneIndex = laneIndex;
- this.zIndex = zIndex;
- this.className = className2;
- this.type = 0;
- }
- accept(combinedClassName) {
- return new DecorationBasedGlyph(this.lineNumber, this.laneIndex, combinedClassName);
- }
- };
- WidgetBasedGlyphRenderRequest = class {
- constructor(lineNumber, laneIndex, zIndex, widget) {
- this.lineNumber = lineNumber;
- this.laneIndex = laneIndex;
- this.zIndex = zIndex;
- this.widget = widget;
- this.type = 1;
- }
- };
- DecorationBasedGlyph = class {
- constructor(lineNumber, laneIndex, combinedClassName) {
- this.lineNumber = lineNumber;
- this.laneIndex = laneIndex;
- this.combinedClassName = combinedClassName;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.css
-var init_indentGuides = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/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/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/esm/vs/editor/common/model/textModelPart.js
-var TextModelPart;
-var init_textModelPart = __esm({
- "../node_modules/monaco-editor/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/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_utils3 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/model/utils.js"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/textModelGuides.js
-var HorizontalGuidesState, IndentGuide, IndentGuideHorizontalLine;
-var init_textModelGuides = __esm({
- "../node_modules/monaco-editor/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/esm/vs/editor/common/model/guidesTextModelPart.js
-var GuidesTextModelPart, BracketPairGuidesClassNames;
-var init_guidesTextModelPart = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/model/guidesTextModelPart.js"() {
- init_arraysFind();
- init_strings();
- init_cursorColumns();
- init_range();
- init_textModelPart();
- init_utils3();
- 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, options) {
- 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)?.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 && !options.includeInactive) {
- continue;
- }
- const className2 = colorProvider.getInlineClassName(pair.nestingLevel, pair.nestingLevelOfEqualBracketType, independentColorPoolPerBracketType) + (options.highlightActive && isActive ? " " + colorProvider.activeClassName : "");
- const start = pair.openingBracketRange.getStartPosition();
- const end = pair.closingBracketRange.getStartPosition();
- const horizontalGuides = options.horizontalGuides === HorizontalGuidesState.Enabled || options.horizontalGuides === HorizontalGuidesState.EnabledForActive && isActive;
- if (pair.range.startLineNumber === pair.range.endLineNumber) {
- if (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 options = 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 / options.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 options = this.textModel.getOptions();
- if (aboveContentLineIndent === -1 || belowContentLineIndent === -1) {
- return 0;
- } else if (aboveContentLineIndent < belowContentLineIndent) {
- return 1 + Math.floor(aboveContentLineIndent / options.indentSize);
- } else if (aboveContentLineIndent === belowContentLineIndent) {
- return Math.ceil(belowContentLineIndent / options.indentSize);
- } else {
- if (offSide) {
- return Math.ceil(belowContentLineIndent / options.indentSize);
- } else {
- return 1 + Math.floor(belowContentLineIndent / options.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/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js
-function transparentToUndefined(color) {
- if (color && color.isTransparent()) {
- return void 0;
- }
- return color;
-}
-var IndentGuidesOverlay;
-var init_indentGuides2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js"() {
- init_indentGuides();
- init_dynamicViewOverlay();
- init_editorColorRegistry();
- init_themeService();
- init_position();
- init_arrays();
- init_types();
- init_guidesTextModelPart();
- init_textModelGuides();
- IndentGuidesOverlay = class extends DynamicViewOverlay {
- constructor(context) {
- super();
- this._context = context;
- this._primaryPosition = null;
- const options = this._context.configuration.options;
- const wrappingInfo = options.get(
- 166
- /* EditorOption.wrappingInfo */
- );
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- this._spaceWidth = fontInfo.spaceWidth;
- this._maxIndentLeft = wrappingInfo.wrappingColumn === -1 ? -1 : wrappingInfo.wrappingColumn * fontInfo.typicalHalfwidthCharacterWidth;
- this._bracketPairGuideOptions = options.get(
- 22
- /* EditorOption.guides */
- );
- this._renderResult = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const wrappingInfo = options.get(
- 166
- /* EditorOption.wrappingInfo */
- );
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- this._spaceWidth = fontInfo.spaceWidth;
- this._maxIndentLeft = wrappingInfo.wrappingColumn === -1 ? -1 : wrappingInfo.wrappingColumn * fontInfo.typicalHalfwidthCharacterWidth;
- this._bracketPairGuideOptions = options.get(
- 22
- /* EditorOption.guides */
- );
- return true;
- }
- onCursorStateChanged(e) {
- const selection = e.selections[0];
- const newPosition = selection.getPosition();
- if (!this._primaryPosition?.equals(newPosition)) {
- this._primaryPosition = newPosition;
- return true;
- }
- return false;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- onLanguageConfigurationChanged(e) {
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- if (!this._bracketPairGuideOptions.indentation && this._bracketPairGuideOptions.bracketPairs === false) {
- this._renderResult = null;
- return;
- }
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const scrollWidth = ctx.scrollWidth;
- const activeCursorPosition = this._primaryPosition;
- const indents = this.getGuidesByLine(visibleStartLineNumber, Math.min(visibleEndLineNumber + 1, this._context.viewModel.getLineCount()), activeCursorPosition);
- const output = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- const indent = indents[lineIndex];
- let result = "";
- const leftOffset = ctx.visibleRangeForPosition(new Position(lineNumber, 1))?.left ?? 0;
- for (const guide of indent) {
- const left = guide.column === -1 ? leftOffset + (guide.visibleColumn - 1) * this._spaceWidth : ctx.visibleRangeForPosition(new Position(lineNumber, guide.column)).left;
- if (left > scrollWidth || this._maxIndentLeft > 0 && left > this._maxIndentLeft) {
- break;
- }
- const className2 = guide.horizontalLine ? guide.horizontalLine.top ? "horizontal-top" : "horizontal-bottom" : "vertical";
- const width2 = guide.horizontalLine ? (ctx.visibleRangeForPosition(new Position(lineNumber, guide.horizontalLine.endColumn))?.left ?? left + this._spaceWidth) - left : this._spaceWidth;
- result += `
`;
- }
- output[lineIndex] = result;
- }
- this._renderResult = output;
- }
- getGuidesByLine(visibleStartLineNumber, visibleEndLineNumber, activeCursorPosition) {
- const bracketGuides = this._bracketPairGuideOptions.bracketPairs !== false ? this._context.viewModel.getBracketGuidesInRangeByLine(visibleStartLineNumber, visibleEndLineNumber, activeCursorPosition, {
- highlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair,
- horizontalGuides: this._bracketPairGuideOptions.bracketPairsHorizontal === true ? HorizontalGuidesState.Enabled : this._bracketPairGuideOptions.bracketPairsHorizontal === "active" ? HorizontalGuidesState.EnabledForActive : HorizontalGuidesState.Disabled,
- includeInactive: this._bracketPairGuideOptions.bracketPairs === true
- }) : null;
- const indentGuides = this._bracketPairGuideOptions.indentation ? this._context.viewModel.getLinesIndentGuides(visibleStartLineNumber, visibleEndLineNumber) : null;
- let activeIndentStartLineNumber = 0;
- let activeIndentEndLineNumber = 0;
- let activeIndentLevel = 0;
- if (this._bracketPairGuideOptions.highlightActiveIndentation !== false && activeCursorPosition) {
- const activeIndentInfo = this._context.viewModel.getActiveIndentGuide(activeCursorPosition.lineNumber, visibleStartLineNumber, visibleEndLineNumber);
- activeIndentStartLineNumber = activeIndentInfo.startLineNumber;
- activeIndentEndLineNumber = activeIndentInfo.endLineNumber;
- activeIndentLevel = activeIndentInfo.indent;
- }
- const { indentSize } = this._context.viewModel.model.getOptions();
- const result = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineGuides = new Array();
- result.push(lineGuides);
- const bracketGuidesInLine = bracketGuides ? bracketGuides[lineNumber - visibleStartLineNumber] : [];
- const bracketGuidesInLineQueue = new ArrayQueue(bracketGuidesInLine);
- const indentGuidesInLine = indentGuides ? indentGuides[lineNumber - visibleStartLineNumber] : 0;
- for (let indentLvl = 1; indentLvl <= indentGuidesInLine; indentLvl++) {
- const indentGuide = (indentLvl - 1) * indentSize + 1;
- const isActive = (
- // Disable active indent guide if there are bracket guides.
- (this._bracketPairGuideOptions.highlightActiveIndentation === "always" || bracketGuidesInLine.length === 0) && activeIndentStartLineNumber <= lineNumber && lineNumber <= activeIndentEndLineNumber && indentLvl === activeIndentLevel
- );
- lineGuides.push(...bracketGuidesInLineQueue.takeWhile((g) => g.visibleColumn < indentGuide) || []);
- const peeked = bracketGuidesInLineQueue.peek();
- if (!peeked || peeked.visibleColumn !== indentGuide || peeked.horizontalLine) {
- lineGuides.push(new IndentGuide(indentGuide, -1, `core-guide-indent lvl-${(indentLvl - 1) % 30}` + (isActive ? " indent-active" : ""), null, -1, -1));
- }
- }
- lineGuides.push(...bracketGuidesInLineQueue.takeWhile((g) => true) || []);
- }
- return result;
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex < 0 || lineIndex >= this._renderResult.length) {
- return "";
- }
- return this._renderResult[lineIndex];
- }
- };
- registerThemingParticipant((theme, collector) => {
- const colors = [
- { bracketColor: editorBracketHighlightingForeground1, guideColor: editorBracketPairGuideBackground1, guideColorActive: editorBracketPairGuideActiveBackground1 },
- { bracketColor: editorBracketHighlightingForeground2, guideColor: editorBracketPairGuideBackground2, guideColorActive: editorBracketPairGuideActiveBackground2 },
- { bracketColor: editorBracketHighlightingForeground3, guideColor: editorBracketPairGuideBackground3, guideColorActive: editorBracketPairGuideActiveBackground3 },
- { bracketColor: editorBracketHighlightingForeground4, guideColor: editorBracketPairGuideBackground4, guideColorActive: editorBracketPairGuideActiveBackground4 },
- { bracketColor: editorBracketHighlightingForeground5, guideColor: editorBracketPairGuideBackground5, guideColorActive: editorBracketPairGuideActiveBackground5 },
- { bracketColor: editorBracketHighlightingForeground6, guideColor: editorBracketPairGuideBackground6, guideColorActive: editorBracketPairGuideActiveBackground6 }
- ];
- const colorProvider = new BracketPairGuidesClassNames();
- const indentColors = [
- { indentColor: editorIndentGuide1, indentColorActive: editorActiveIndentGuide1 },
- { indentColor: editorIndentGuide2, indentColorActive: editorActiveIndentGuide2 },
- { indentColor: editorIndentGuide3, indentColorActive: editorActiveIndentGuide3 },
- { indentColor: editorIndentGuide4, indentColorActive: editorActiveIndentGuide4 },
- { indentColor: editorIndentGuide5, indentColorActive: editorActiveIndentGuide5 },
- { indentColor: editorIndentGuide6, indentColorActive: editorActiveIndentGuide6 }
- ];
- const colorValues = colors.map((c) => {
- const bracketColor = theme.getColor(c.bracketColor);
- const guideColor = theme.getColor(c.guideColor);
- const guideColorActive = theme.getColor(c.guideColorActive);
- const effectiveGuideColor = transparentToUndefined(transparentToUndefined(guideColor) ?? bracketColor?.transparent(0.3));
- const effectiveGuideColorActive = transparentToUndefined(transparentToUndefined(guideColorActive) ?? bracketColor);
- if (!effectiveGuideColor || !effectiveGuideColorActive) {
- return void 0;
- }
- return {
- guideColor: effectiveGuideColor,
- guideColorActive: effectiveGuideColorActive
- };
- }).filter(isDefined);
- const indentColorValues = indentColors.map((c) => {
- const indentColor = theme.getColor(c.indentColor);
- const indentColorActive = theme.getColor(c.indentColorActive);
- const effectiveIndentColor = transparentToUndefined(indentColor);
- const effectiveIndentColorActive = transparentToUndefined(indentColorActive);
- if (!effectiveIndentColor || !effectiveIndentColorActive) {
- return void 0;
- }
- return {
- indentColor: effectiveIndentColor,
- indentColorActive: effectiveIndentColorActive
- };
- }).filter(isDefined);
- if (colorValues.length > 0) {
- for (let level = 0; level < 30; level++) {
- const colors2 = colorValues[level % colorValues.length];
- collector.addRule(`.monaco-editor .${colorProvider.getInlineClassNameOfLevel(level).replace(/ /g, ".")} { --guide-color: ${colors2.guideColor}; --guide-color-active: ${colors2.guideColorActive}; }`);
- }
- collector.addRule(`.monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }`);
- collector.addRule(`.monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }`);
- collector.addRule(`.monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }`);
- collector.addRule(`.monaco-editor .vertical.${colorProvider.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`);
- collector.addRule(`.monaco-editor .horizontal-top.${colorProvider.activeClassName} { border-top: 1px solid var(--guide-color-active); }`);
- collector.addRule(`.monaco-editor .horizontal-bottom.${colorProvider.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`);
- }
- if (indentColorValues.length > 0) {
- for (let level = 0; level < 30; level++) {
- const colors2 = indentColorValues[level % indentColorValues.length];
- collector.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${level} { --indent-color: ${colors2.indentColor}; --indent-color-active: ${colors2.indentColorActive}; }`);
- }
- collector.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }`);
- collector.addRule(`.monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }`);
- }
- });
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css
-var init_lineNumbers = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js
-var LineNumbersOverlay;
-var init_lineNumbers2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js"() {
- init_lineNumbers();
- init_platform();
- init_dynamicViewOverlay();
- init_position();
- init_range();
- init_themeService();
- init_editorColorRegistry();
- LineNumbersOverlay = class _LineNumbersOverlay extends DynamicViewOverlay {
- static {
- this.CLASS_NAME = "line-numbers";
- }
- constructor(context) {
- super();
- this._context = context;
- this._readConfig();
- this._lastCursorModelPosition = new Position(1, 1);
- this._renderResult = null;
- this._activeModelLineNumber = 1;
- this._context.addEventHandler(this);
- }
- _readConfig() {
- const options = this._context.configuration.options;
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- const lineNumbers = options.get(
- 76
- /* EditorOption.lineNumbers */
- );
- this._renderLineNumbers = lineNumbers.renderType;
- this._renderCustomLineNumbers = lineNumbers.renderFn;
- this._renderFinalNewline = options.get(
- 109
- /* EditorOption.renderFinalNewline */
- );
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._lineNumbersLeft = layoutInfo.lineNumbersLeft;
- this._lineNumbersWidth = layoutInfo.lineNumbersWidth;
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- this._readConfig();
- return true;
- }
- onCursorStateChanged(e) {
- const primaryViewPosition = e.selections[0].getPosition();
- this._lastCursorModelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(primaryViewPosition);
- let shouldRender = false;
- if (this._activeModelLineNumber !== this._lastCursorModelPosition.lineNumber) {
- this._activeModelLineNumber = this._lastCursorModelPosition.lineNumber;
- shouldRender = true;
- }
- if (this._renderLineNumbers === 2 || this._renderLineNumbers === 3) {
- shouldRender = true;
- }
- return shouldRender;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- onDecorationsChanged(e) {
- return e.affectsLineNumber;
- }
- // --- end event handlers
- _getLineRenderLineNumber(viewLineNumber) {
- const modelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(viewLineNumber, 1));
- if (modelPosition.column !== 1) {
- return "";
- }
- const modelLineNumber = modelPosition.lineNumber;
- if (this._renderCustomLineNumbers) {
- return this._renderCustomLineNumbers(modelLineNumber);
- }
- if (this._renderLineNumbers === 2) {
- const diff = Math.abs(this._lastCursorModelPosition.lineNumber - modelLineNumber);
- if (diff === 0) {
- return '' + modelLineNumber + " ";
- }
- return String(diff);
- }
- if (this._renderLineNumbers === 3) {
- if (this._lastCursorModelPosition.lineNumber === modelLineNumber) {
- return String(modelLineNumber);
- }
- if (modelLineNumber % 10 === 0) {
- return String(modelLineNumber);
- }
- const finalLineNumber = this._context.viewModel.getLineCount();
- if (modelLineNumber === finalLineNumber) {
- return String(modelLineNumber);
- }
- return "";
- }
- return String(modelLineNumber);
- }
- prepareRender(ctx) {
- if (this._renderLineNumbers === 0) {
- this._renderResult = null;
- return;
- }
- const lineHeightClassName = isLinux ? this._lineHeight % 2 === 0 ? " lh-even" : " lh-odd" : "";
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const lineNoDecorations = this._context.viewModel.getDecorationsInViewport(ctx.visibleRange).filter((d) => !!d.options.lineNumberClassName);
- lineNoDecorations.sort((a, b) => Range.compareRangesUsingEnds(a.range, b.range));
- let decorationStartIndex = 0;
- const lineCount = this._context.viewModel.getLineCount();
- const output = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- const modelLineNumber = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber, 1)).lineNumber;
- let renderLineNumber = this._getLineRenderLineNumber(lineNumber);
- let extraClassNames = "";
- while (decorationStartIndex < lineNoDecorations.length && lineNoDecorations[decorationStartIndex].range.endLineNumber < lineNumber) {
- decorationStartIndex++;
- }
- for (let i2 = decorationStartIndex; i2 < lineNoDecorations.length; i2++) {
- const { range: range2, options } = lineNoDecorations[i2];
- if (range2.startLineNumber <= lineNumber) {
- extraClassNames += " " + options.lineNumberClassName;
- }
- }
- if (!renderLineNumber && !extraClassNames) {
- output[lineIndex] = "";
- continue;
- }
- if (lineNumber === lineCount && this._context.viewModel.getLineLength(lineNumber) === 0) {
- if (this._renderFinalNewline === "off") {
- renderLineNumber = "";
- }
- if (this._renderFinalNewline === "dimmed") {
- extraClassNames += " dimmed-line-number";
- }
- }
- if (modelLineNumber === this._activeModelLineNumber) {
- extraClassNames += " active-line-number";
- }
- output[lineIndex] = ``;
- }
- this._renderResult = output;
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex < 0 || lineIndex >= this._renderResult.length) {
- return "";
- }
- return this._renderResult[lineIndex];
- }
- };
- registerThemingParticipant((theme, collector) => {
- const editorLineNumbersColor = theme.getColor(editorLineNumbers);
- const editorDimmedLineNumberColor = theme.getColor(editorDimmedLineNumber);
- if (editorDimmedLineNumberColor) {
- collector.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${editorDimmedLineNumberColor}; }`);
- } else if (editorLineNumbersColor) {
- collector.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${editorLineNumbersColor.transparent(0.4)}; }`);
- }
- });
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css
-var init_mouseCursor = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js
-var MOUSE_CURSOR_TEXT_CSS_CLASS_NAME;
-var init_mouseCursor2 = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js"() {
- init_mouseCursor();
- MOUSE_CURSOR_TEXT_CSS_CLASS_NAME = `monaco-mouse-cursor-text`;
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLines.css
-var init_viewLines = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLines.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js
-var DomReadingContext;
-var init_domReadingContext = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js"() {
- DomReadingContext = class {
- get didDomLayout() {
- return this._didDomLayout;
- }
- readClientRect() {
- if (!this._clientRectRead) {
- this._clientRectRead = true;
- const rect = this._domNode.getBoundingClientRect();
- this.markDidDomLayout();
- this._clientRectDeltaLeft = rect.left;
- this._clientRectScale = rect.width / this._domNode.offsetWidth;
- }
- }
- get clientRectDeltaLeft() {
- if (!this._clientRectRead) {
- this.readClientRect();
- }
- return this._clientRectDeltaLeft;
- }
- get clientRectScale() {
- if (!this._clientRectRead) {
- this.readClientRect();
- }
- return this._clientRectScale;
- }
- constructor(_domNode, endNode) {
- this._domNode = _domNode;
- this.endNode = endNode;
- this._didDomLayout = false;
- this._clientRectDeltaLeft = 0;
- this._clientRectScale = 1;
- this._clientRectRead = false;
- }
- markDidDomLayout() {
- this._didDomLayout = true;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js
-var ViewLineOptions;
-var init_viewLineOptions = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js"() {
- ViewLineOptions = class {
- constructor(config, themeType) {
- this.themeType = themeType;
- const options = config.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- this.renderWhitespace = options.get(
- 113
- /* EditorOption.renderWhitespace */
- );
- this.experimentalWhitespaceRendering = options.get(
- 47
- /* EditorOption.experimentalWhitespaceRendering */
- );
- this.renderControlCharacters = options.get(
- 108
- /* EditorOption.renderControlCharacters */
- );
- this.spaceWidth = fontInfo.spaceWidth;
- this.middotWidth = fontInfo.middotWidth;
- this.wsmiddotWidth = fontInfo.wsmiddotWidth;
- this.useMonospaceOptimizations = fontInfo.isMonospace && !options.get(
- 40
- /* EditorOption.disableMonospaceOptimizations */
- );
- this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow;
- this.lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this.stopRenderingLineAfter = options.get(
- 133
- /* EditorOption.stopRenderingLineAfter */
- );
- this.fontLigatures = options.get(
- 60
- /* EditorOption.fontLigatures */
- );
- this.verticalScrollbarSize = options.get(
- 117
- /* EditorOption.scrollbar */
- ).verticalScrollbarSize;
- this.useGpu = options.get(
- 46
- /* EditorOption.experimentalGpuAcceleration */
- ) === "on";
- }
- equals(other) {
- return this.themeType === other.themeType && this.renderWhitespace === other.renderWhitespace && this.experimentalWhitespaceRendering === other.experimentalWhitespaceRendering && this.renderControlCharacters === other.renderControlCharacters && this.spaceWidth === other.spaceWidth && this.middotWidth === other.middotWidth && this.wsmiddotWidth === other.wsmiddotWidth && this.useMonospaceOptimizations === other.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.lineHeight === other.lineHeight && this.stopRenderingLineAfter === other.stopRenderingLineAfter && this.fontLigatures === other.fontLigatures && this.verticalScrollbarSize === other.verticalScrollbarSize && this.useGpu === other.useGpu;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLines.js
-var LastRenderedData, HorizontalRevealRangeRequest, HorizontalRevealSelectionsRequest, ViewLines;
-var init_viewLines2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewLines/viewLines.js"() {
- init_mouseCursor2();
- init_async();
- init_platform();
- init_viewLines();
- init_domFontInfo();
- init_renderingContext();
- init_viewLayer();
- init_viewPart();
- init_domReadingContext();
- init_viewLine();
- init_position();
- init_range();
- init_viewLineOptions();
- init_model2();
- LastRenderedData = class {
- constructor() {
- this._currentVisibleRange = new Range(1, 1, 1, 1);
- }
- getCurrentVisibleRange() {
- return this._currentVisibleRange;
- }
- setCurrentVisibleRange(currentVisibleRange) {
- this._currentVisibleRange = currentVisibleRange;
- }
- };
- HorizontalRevealRangeRequest = class {
- constructor(minimalReveal, lineNumber, startColumn, endColumn, startScrollTop, stopScrollTop, scrollType) {
- this.minimalReveal = minimalReveal;
- this.lineNumber = lineNumber;
- this.startColumn = startColumn;
- this.endColumn = endColumn;
- this.startScrollTop = startScrollTop;
- this.stopScrollTop = stopScrollTop;
- this.scrollType = scrollType;
- this.type = "range";
- this.minLineNumber = lineNumber;
- this.maxLineNumber = lineNumber;
- }
- };
- HorizontalRevealSelectionsRequest = class {
- constructor(minimalReveal, selections, startScrollTop, stopScrollTop, scrollType) {
- this.minimalReveal = minimalReveal;
- this.selections = selections;
- this.startScrollTop = startScrollTop;
- this.stopScrollTop = stopScrollTop;
- this.scrollType = scrollType;
- this.type = "selections";
- let minLineNumber = selections[0].startLineNumber;
- let maxLineNumber = selections[0].endLineNumber;
- for (let i2 = 1, len = selections.length; i2 < len; i2++) {
- const selection = selections[i2];
- minLineNumber = Math.min(minLineNumber, selection.startLineNumber);
- maxLineNumber = Math.max(maxLineNumber, selection.endLineNumber);
- }
- this.minLineNumber = minLineNumber;
- this.maxLineNumber = maxLineNumber;
- }
- };
- ViewLines = class _ViewLines extends ViewPart {
- static {
- this.HORIZONTAL_EXTRA_PX = 30;
- }
- constructor(context, viewGpuContext, linesContent) {
- super(context);
- const conf81 = this._context.configuration;
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- const wrappingInfo = options.get(
- 166
- /* EditorOption.wrappingInfo */
- );
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
- this._isViewportWrapping = wrappingInfo.isViewportWrapping;
- this._revealHorizontalRightPadding = options.get(
- 114
- /* EditorOption.revealHorizontalRightPadding */
- );
- this._cursorSurroundingLines = options.get(
- 35
- /* EditorOption.cursorSurroundingLines */
- );
- this._cursorSurroundingLinesStyle = options.get(
- 36
- /* EditorOption.cursorSurroundingLinesStyle */
- );
- this._canUseLayerHinting = !options.get(
- 39
- /* EditorOption.disableLayerHinting */
- );
- this._viewLineOptions = new ViewLineOptions(conf81, this._context.theme.type);
- this._linesContent = linesContent;
- this._textRangeRestingSpot = document.createElement("div");
- this._visibleLines = new VisibleLinesCollection(this._context, {
- createLine: () => new ViewLine(viewGpuContext, this._viewLineOptions)
- });
- this.domNode = this._visibleLines.domNode;
- PartFingerprints.write(
- this.domNode,
- 8
- /* PartFingerprint.ViewLines */
- );
- this.domNode.setClassName(`view-lines ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);
- applyFontInfo(this.domNode, fontInfo);
- this._maxLineWidth = 0;
- this._asyncUpdateLineWidths = new RunOnceScheduler(() => {
- this._updateLineWidthsSlow();
- }, 200);
- this._asyncCheckMonospaceFontAssumptions = new RunOnceScheduler(() => {
- this._checkMonospaceFontAssumptions();
- }, 2e3);
- this._lastRenderedData = new LastRenderedData();
- this._horizontalRevealRequest = null;
- this._stickyScrollEnabled = options.get(
- 131
- /* EditorOption.stickyScroll */
- ).enabled;
- this._maxNumberStickyLines = options.get(
- 131
- /* EditorOption.stickyScroll */
- ).maxLineCount;
- }
- dispose() {
- this._asyncUpdateLineWidths.dispose();
- this._asyncCheckMonospaceFontAssumptions.dispose();
- super.dispose();
- }
- getDomNode() {
- return this.domNode;
- }
- // ---- begin view event handlers
- onConfigurationChanged(e) {
- this._visibleLines.onConfigurationChanged(e);
- if (e.hasChanged(
- 166
- /* EditorOption.wrappingInfo */
- )) {
- this._maxLineWidth = 0;
- }
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- const wrappingInfo = options.get(
- 166
- /* EditorOption.wrappingInfo */
- );
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
- this._isViewportWrapping = wrappingInfo.isViewportWrapping;
- this._revealHorizontalRightPadding = options.get(
- 114
- /* EditorOption.revealHorizontalRightPadding */
- );
- this._cursorSurroundingLines = options.get(
- 35
- /* EditorOption.cursorSurroundingLines */
- );
- this._cursorSurroundingLinesStyle = options.get(
- 36
- /* EditorOption.cursorSurroundingLinesStyle */
- );
- this._canUseLayerHinting = !options.get(
- 39
- /* EditorOption.disableLayerHinting */
- );
- this._stickyScrollEnabled = options.get(
- 131
- /* EditorOption.stickyScroll */
- ).enabled;
- this._maxNumberStickyLines = options.get(
- 131
- /* EditorOption.stickyScroll */
- ).maxLineCount;
- applyFontInfo(this.domNode, fontInfo);
- this._onOptionsMaybeChanged();
- if (e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- )) {
- this._maxLineWidth = 0;
- }
- return true;
- }
- _onOptionsMaybeChanged() {
- const conf81 = this._context.configuration;
- const newViewLineOptions = new ViewLineOptions(conf81, this._context.theme.type);
- if (!this._viewLineOptions.equals(newViewLineOptions)) {
- this._viewLineOptions = newViewLineOptions;
- const startLineNumber = this._visibleLines.getStartLineNumber();
- const endLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
- const line = this._visibleLines.getVisibleLine(lineNumber);
- line.onOptionsChanged(this._viewLineOptions);
- }
- return true;
- }
- return false;
- }
- onCursorStateChanged(e) {
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- let r = false;
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- r = this._visibleLines.getVisibleLine(lineNumber).onSelectionChanged() || r;
- }
- return r;
- }
- onDecorationsChanged(e) {
- {
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- this._visibleLines.getVisibleLine(lineNumber).onDecorationsChanged();
- }
- }
- return true;
- }
- onFlushed(e) {
- const shouldRender = this._visibleLines.onFlushed(e, this._viewLineOptions.useGpu);
- this._maxLineWidth = 0;
- return shouldRender;
- }
- onLinesChanged(e) {
- return this._visibleLines.onLinesChanged(e);
- }
- onLinesDeleted(e) {
- return this._visibleLines.onLinesDeleted(e);
- }
- onLinesInserted(e) {
- return this._visibleLines.onLinesInserted(e);
- }
- onRevealRangeRequest(e) {
- const desiredScrollTop = this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(), e.source, e.minimalReveal, e.range, e.selections, e.verticalType);
- if (desiredScrollTop === -1) {
- return false;
- }
- let newScrollPosition = this._context.viewLayout.validateScrollPosition({ scrollTop: desiredScrollTop });
- if (e.revealHorizontal) {
- if (e.range && e.range.startLineNumber !== e.range.endLineNumber) {
- newScrollPosition = {
- scrollTop: newScrollPosition.scrollTop,
- scrollLeft: 0
- };
- } else if (e.range) {
- this._horizontalRevealRequest = new HorizontalRevealRangeRequest(e.minimalReveal, e.range.startLineNumber, e.range.startColumn, e.range.endColumn, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType);
- } else if (e.selections && e.selections.length > 0) {
- this._horizontalRevealRequest = new HorizontalRevealSelectionsRequest(e.minimalReveal, e.selections, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType);
- }
- } else {
- this._horizontalRevealRequest = null;
- }
- const scrollTopDelta = Math.abs(this._context.viewLayout.getCurrentScrollTop() - newScrollPosition.scrollTop);
- const scrollType = scrollTopDelta <= this._lineHeight ? 1 : e.scrollType;
- this._context.viewModel.viewLayout.setScrollPosition(newScrollPosition, scrollType);
- return true;
- }
- onScrollChanged(e) {
- if (this._horizontalRevealRequest && e.scrollLeftChanged) {
- this._horizontalRevealRequest = null;
- }
- if (this._horizontalRevealRequest && e.scrollTopChanged) {
- const min = Math.min(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);
- const max = Math.max(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);
- if (e.scrollTop < min || e.scrollTop > max) {
- this._horizontalRevealRequest = null;
- }
- }
- this.domNode.setWidth(e.scrollWidth);
- return this._visibleLines.onScrollChanged(e) || true;
- }
- onTokensChanged(e) {
- return this._visibleLines.onTokensChanged(e);
- }
- onZonesChanged(e) {
- this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth);
- return this._visibleLines.onZonesChanged(e);
- }
- onThemeChanged(e) {
- return this._onOptionsMaybeChanged();
- }
- // ---- end view event handlers
- // ----------- HELPERS FOR OTHERS
- getPositionFromDOMInfo(spanNode, offset) {
- const viewLineDomNode = this._getViewLineDomNode(spanNode);
- if (viewLineDomNode === null) {
- return null;
- }
- const lineNumber = this._getLineNumberFor(viewLineDomNode);
- if (lineNumber === -1) {
- return null;
- }
- if (lineNumber < 1 || lineNumber > this._context.viewModel.getLineCount()) {
- return null;
- }
- if (this._context.viewModel.getLineMaxColumn(lineNumber) === 1) {
- return new Position(lineNumber, 1);
- }
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {
- return null;
- }
- let column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(spanNode, offset);
- const minColumn = this._context.viewModel.getLineMinColumn(lineNumber);
- if (column < minColumn) {
- column = minColumn;
- }
- return new Position(lineNumber, column);
- }
- _getViewLineDomNode(node) {
- while (node && node.nodeType === 1) {
- if (node.className === ViewLine.CLASS_NAME) {
- return node;
- }
- node = node.parentElement;
- }
- return null;
- }
- /**
- * @returns the line number of this view line dom node.
- */
- _getLineNumberFor(domNode) {
- const startLineNumber = this._visibleLines.getStartLineNumber();
- const endLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
- const line = this._visibleLines.getVisibleLine(lineNumber);
- if (domNode === line.getDomNode()) {
- return lineNumber;
- }
- }
- return -1;
- }
- getLineWidth(lineNumber) {
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {
- return -1;
- }
- const context = new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot);
- const result = this._visibleLines.getVisibleLine(lineNumber).getWidth(context);
- this._updateLineWidthsSlowIfDomDidLayout(context);
- return result;
- }
- linesVisibleRangesForRange(_range, includeNewLines) {
- if (this.shouldRender()) {
- return null;
- }
- const originalEndLineNumber = _range.endLineNumber;
- const range2 = Range.intersectRanges(_range, this._lastRenderedData.getCurrentVisibleRange());
- if (!range2) {
- return null;
- }
- const visibleRanges = [];
- let visibleRangesLen = 0;
- const domReadingContext = new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot);
- let nextLineModelLineNumber = 0;
- if (includeNewLines) {
- nextLineModelLineNumber = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(range2.startLineNumber, 1)).lineNumber;
- }
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = range2.startLineNumber; lineNumber <= range2.endLineNumber; lineNumber++) {
- if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {
- continue;
- }
- const startColumn = lineNumber === range2.startLineNumber ? range2.startColumn : 1;
- const continuesInNextLine = lineNumber !== originalEndLineNumber;
- const endColumn = continuesInNextLine ? this._context.viewModel.getLineMaxColumn(lineNumber) : range2.endColumn;
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- const visibleRangesForLine = visibleLine.getVisibleRangesForRange(lineNumber, startColumn, endColumn, domReadingContext);
- if (!visibleRangesForLine) {
- continue;
- }
- if (includeNewLines && lineNumber < originalEndLineNumber) {
- const currentLineModelLineNumber = nextLineModelLineNumber;
- nextLineModelLineNumber = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber + 1, 1)).lineNumber;
- if (currentLineModelLineNumber !== nextLineModelLineNumber) {
- const floatHorizontalRange = visibleRangesForLine.ranges[visibleRangesForLine.ranges.length - 1];
- floatHorizontalRange.width += this._typicalHalfwidthCharacterWidth;
- if (this._context.viewModel.getTextDirection(currentLineModelLineNumber) === TextDirection.RTL) {
- floatHorizontalRange.left -= this._typicalHalfwidthCharacterWidth;
- }
- }
- }
- visibleRanges[visibleRangesLen++] = new LineVisibleRanges(visibleRangesForLine.outsideRenderedLine, lineNumber, HorizontalRange.from(visibleRangesForLine.ranges), continuesInNextLine);
- }
- this._updateLineWidthsSlowIfDomDidLayout(domReadingContext);
- if (visibleRangesLen === 0) {
- return null;
- }
- return visibleRanges;
- }
- _visibleRangesForLineRange(lineNumber, startColumn, endColumn) {
- if (this.shouldRender()) {
- return null;
- }
- if (lineNumber < this._visibleLines.getStartLineNumber() || lineNumber > this._visibleLines.getEndLineNumber()) {
- return null;
- }
- const domReadingContext = new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot);
- const result = this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(lineNumber, startColumn, endColumn, domReadingContext);
- this._updateLineWidthsSlowIfDomDidLayout(domReadingContext);
- return result;
- }
- _lineIsRenderedRTL(lineNumber) {
- if (lineNumber < this._visibleLines.getStartLineNumber() || lineNumber > this._visibleLines.getEndLineNumber()) {
- return false;
- }
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- return visibleLine.isRenderedRTL();
- }
- visibleRangeForPosition(position) {
- const visibleRanges = this._visibleRangesForLineRange(position.lineNumber, position.column, position.column);
- if (!visibleRanges) {
- return null;
- }
- return new HorizontalPosition(visibleRanges.outsideRenderedLine, visibleRanges.ranges[0].left);
- }
- /**
- * Updates the max line width if it is fast to compute.
- * Returns true if all lines were taken into account.
- * Returns false if some lines need to be reevaluated (in a slow fashion).
- */
- _updateLineWidthsFast() {
- return this._updateLineWidths(true);
- }
- _updateLineWidthsSlow() {
- this._updateLineWidths(false);
- }
- /**
- * Update the line widths using DOM layout information after someone else
- * has caused a synchronous layout.
- */
- _updateLineWidthsSlowIfDomDidLayout(domReadingContext) {
- if (!domReadingContext.didDomLayout) {
- return;
- }
- if (this._asyncUpdateLineWidths.isScheduled()) {
- return;
- }
- this._asyncUpdateLineWidths.cancel();
- this._updateLineWidthsSlow();
- }
- _updateLineWidths(fast) {
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- let localMaxLineWidth = 1;
- let allWidthsComputed = true;
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- if (fast && !visibleLine.getWidthIsFast()) {
- allWidthsComputed = false;
- continue;
- }
- localMaxLineWidth = Math.max(localMaxLineWidth, visibleLine.getWidth(null));
- }
- if (allWidthsComputed && rendStartLineNumber === 1 && rendEndLineNumber === this._context.viewModel.getLineCount()) {
- this._maxLineWidth = 0;
- }
- this._ensureMaxLineWidth(localMaxLineWidth);
- return allWidthsComputed;
- }
- _checkMonospaceFontAssumptions() {
- let longestLineNumber = -1;
- let longestWidth = -1;
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- if (visibleLine.needsMonospaceFontCheck()) {
- const lineWidth = visibleLine.getWidth(null);
- if (lineWidth > longestWidth) {
- longestWidth = lineWidth;
- longestLineNumber = lineNumber;
- }
- }
- }
- if (longestLineNumber === -1) {
- return;
- }
- if (!this._visibleLines.getVisibleLine(longestLineNumber).monospaceAssumptionsAreValid()) {
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- visibleLine.onMonospaceAssumptionsInvalidated();
- }
- }
- }
- prepareRender() {
- throw new Error("Not supported");
- }
- render() {
- throw new Error("Not supported");
- }
- renderText(viewportData) {
- this._visibleLines.renderLines(viewportData);
- this._lastRenderedData.setCurrentVisibleRange(viewportData.visibleRange);
- this.domNode.setWidth(this._context.viewLayout.getScrollWidth());
- this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1e6));
- if (this._horizontalRevealRequest) {
- const horizontalRevealRequest = this._horizontalRevealRequest;
- if (viewportData.startLineNumber <= horizontalRevealRequest.minLineNumber && horizontalRevealRequest.maxLineNumber <= viewportData.endLineNumber) {
- this._horizontalRevealRequest = null;
- this.onDidRender();
- const newScrollLeft = this._computeScrollLeftToReveal(horizontalRevealRequest);
- if (newScrollLeft) {
- if (!this._isViewportWrapping && !newScrollLeft.hasRTL) {
- this._ensureMaxLineWidth(newScrollLeft.maxHorizontalOffset);
- }
- this._context.viewModel.viewLayout.setScrollPosition({
- scrollLeft: newScrollLeft.scrollLeft
- }, horizontalRevealRequest.scrollType);
- }
- }
- }
- if (!this._updateLineWidthsFast()) {
- this._asyncUpdateLineWidths.schedule();
- } else {
- this._asyncUpdateLineWidths.cancel();
- }
- if (isLinux && !this._asyncCheckMonospaceFontAssumptions.isScheduled()) {
- const rendStartLineNumber = this._visibleLines.getStartLineNumber();
- const rendEndLineNumber = this._visibleLines.getEndLineNumber();
- for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) {
- const visibleLine = this._visibleLines.getVisibleLine(lineNumber);
- if (visibleLine.needsMonospaceFontCheck()) {
- this._asyncCheckMonospaceFontAssumptions.schedule();
- break;
- }
- }
- }
- this._linesContent.setLayerHinting(this._canUseLayerHinting);
- this._linesContent.setContain("strict");
- const adjustedScrollTop = this._context.viewLayout.getCurrentScrollTop() - viewportData.bigNumbersDelta;
- this._linesContent.setTop(-adjustedScrollTop);
- this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft());
- }
- // --- width
- _ensureMaxLineWidth(lineWidth) {
- const iLineWidth = Math.ceil(lineWidth);
- if (this._maxLineWidth < iLineWidth) {
- this._maxLineWidth = iLineWidth;
- this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth);
- }
- }
- _computeScrollTopToRevealRange(viewport, source, minimalReveal, range2, selections, verticalType) {
- const viewportStartY = viewport.top;
- const viewportHeight = viewport.height;
- const viewportEndY = viewportStartY + viewportHeight;
- let boxIsSingleRange;
- let boxStartY;
- let boxEndY;
- if (selections && selections.length > 0) {
- let minLineNumber = selections[0].startLineNumber;
- let maxLineNumber = selections[0].endLineNumber;
- for (let i2 = 1, len = selections.length; i2 < len; i2++) {
- const selection = selections[i2];
- minLineNumber = Math.min(minLineNumber, selection.startLineNumber);
- maxLineNumber = Math.max(maxLineNumber, selection.endLineNumber);
- }
- boxIsSingleRange = false;
- boxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(minLineNumber);
- boxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(maxLineNumber) + this._lineHeight;
- } else if (range2) {
- boxIsSingleRange = true;
- boxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(range2.startLineNumber);
- boxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(range2.endLineNumber) + this._lineHeight;
- } else {
- return -1;
- }
- const shouldIgnoreScrollOff = (source === "mouse" || minimalReveal) && this._cursorSurroundingLinesStyle === "default";
- let paddingTop = 0;
- let paddingBottom = 0;
- if (!shouldIgnoreScrollOff) {
- const maxLinesInViewport = viewportHeight / this._lineHeight;
- const surroundingLines = Math.max(this._cursorSurroundingLines, this._stickyScrollEnabled ? this._maxNumberStickyLines : 0);
- const context = Math.min(maxLinesInViewport / 2, surroundingLines);
- paddingTop = context * this._lineHeight;
- paddingBottom = Math.max(0, context - 1) * this._lineHeight;
- } else {
- if (!minimalReveal) {
- paddingTop = this._lineHeight;
- }
- }
- if (!minimalReveal) {
- if (verticalType === 0 || verticalType === 4) {
- paddingBottom += this._lineHeight;
- }
- }
- boxStartY -= paddingTop;
- boxEndY += paddingBottom;
- let newScrollTop;
- if (boxEndY - boxStartY > viewportHeight) {
- if (!boxIsSingleRange) {
- return -1;
- }
- newScrollTop = boxStartY;
- } else if (verticalType === 5 || verticalType === 6) {
- if (verticalType === 6 && viewportStartY <= boxStartY && boxEndY <= viewportEndY) {
- newScrollTop = viewportStartY;
- } else {
- const desiredGapAbove = Math.max(5 * this._lineHeight, viewportHeight * 0.2);
- const desiredScrollTop = boxStartY - desiredGapAbove;
- const minScrollTop = boxEndY - viewportHeight;
- newScrollTop = Math.max(minScrollTop, desiredScrollTop);
- }
- } else if (verticalType === 1 || verticalType === 2) {
- if (verticalType === 2 && viewportStartY <= boxStartY && boxEndY <= viewportEndY) {
- newScrollTop = viewportStartY;
- } else {
- const boxMiddleY = (boxStartY + boxEndY) / 2;
- newScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2);
- }
- } else {
- newScrollTop = this._computeMinimumScrolling(
- viewportStartY,
- viewportEndY,
- boxStartY,
- boxEndY,
- verticalType === 3,
- verticalType === 4
- /* viewEvents.VerticalRevealType.Bottom */
- );
- }
- return newScrollTop;
- }
- _computeScrollLeftToReveal(horizontalRevealRequest) {
- const viewport = this._context.viewLayout.getCurrentViewport();
- const layoutInfo = this._context.configuration.options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const viewportStartX = viewport.left;
- const viewportEndX = viewportStartX + viewport.width - layoutInfo.verticalScrollbarWidth;
- let boxStartX = 1073741824;
- let boxEndX = 0;
- let hasRTL = false;
- if (horizontalRevealRequest.type === "range") {
- hasRTL = this._lineIsRenderedRTL(horizontalRevealRequest.lineNumber);
- const visibleRanges = this._visibleRangesForLineRange(horizontalRevealRequest.lineNumber, horizontalRevealRequest.startColumn, horizontalRevealRequest.endColumn);
- if (!visibleRanges) {
- return null;
- }
- for (const visibleRange of visibleRanges.ranges) {
- boxStartX = Math.min(boxStartX, Math.round(visibleRange.left));
- boxEndX = Math.max(boxEndX, Math.round(visibleRange.left + visibleRange.width));
- }
- } else {
- for (const selection of horizontalRevealRequest.selections) {
- if (selection.startLineNumber !== selection.endLineNumber) {
- return null;
- }
- const visibleRanges = this._visibleRangesForLineRange(selection.startLineNumber, selection.startColumn, selection.endColumn);
- hasRTL ||= this._lineIsRenderedRTL(selection.startLineNumber);
- if (!visibleRanges) {
- return null;
- }
- for (const visibleRange of visibleRanges.ranges) {
- boxStartX = Math.min(boxStartX, Math.round(visibleRange.left));
- boxEndX = Math.max(boxEndX, Math.round(visibleRange.left + visibleRange.width));
- }
- }
- }
- if (!horizontalRevealRequest.minimalReveal) {
- boxStartX = Math.max(0, boxStartX - _ViewLines.HORIZONTAL_EXTRA_PX);
- boxEndX += this._revealHorizontalRightPadding;
- }
- if (horizontalRevealRequest.type === "selections" && boxEndX - boxStartX > viewport.width) {
- return null;
- }
- const newScrollLeft = this._computeMinimumScrolling(viewportStartX, viewportEndX, boxStartX, boxEndX);
- return {
- scrollLeft: newScrollLeft,
- maxHorizontalOffset: boxEndX,
- hasRTL
- };
- }
- _computeMinimumScrolling(viewportStart, viewportEnd, boxStart, boxEnd, revealAtStart, revealAtEnd) {
- viewportStart = viewportStart | 0;
- viewportEnd = viewportEnd | 0;
- boxStart = boxStart | 0;
- boxEnd = boxEnd | 0;
- revealAtStart = !!revealAtStart;
- revealAtEnd = !!revealAtEnd;
- const viewportLength = viewportEnd - viewportStart;
- const boxLength = boxEnd - boxStart;
- if (boxLength < viewportLength) {
- if (revealAtStart) {
- return boxStart;
- }
- if (revealAtEnd) {
- return Math.max(0, boxEnd - viewportLength);
- }
- if (boxStart < viewportStart) {
- return boxStart;
- } else if (boxEnd > viewportEnd) {
- return Math.max(0, boxEnd - viewportLength);
- }
- } else {
- return boxStart;
- }
- return viewportStart;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css
-var init_linesDecorations = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js
-var LinesDecorationsOverlay;
-var init_linesDecorations2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js"() {
- init_linesDecorations();
- init_glyphMargin2();
- LinesDecorationsOverlay = class extends DedupOverlay {
- constructor(context) {
- super();
- this._context = context;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._decorationsLeft = layoutInfo.decorationsLeft;
- this._decorationsWidth = layoutInfo.decorationsWidth;
- this._renderResult = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._decorationsLeft = layoutInfo.decorationsLeft;
- this._decorationsWidth = layoutInfo.decorationsWidth;
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- _getDecorations(ctx) {
- const decorations = ctx.getDecorationsInViewport();
- const r = [];
- let rLen = 0;
- for (let i2 = 0, len = decorations.length; i2 < len; i2++) {
- const d = decorations[i2];
- const linesDecorationsClassName = d.options.linesDecorationsClassName;
- const zIndex = d.options.zIndex;
- if (linesDecorationsClassName) {
- r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, linesDecorationsClassName, d.options.linesDecorationsTooltip ?? null, zIndex);
- }
- const firstLineDecorationClassName = d.options.firstLineDecorationClassName;
- if (firstLineDecorationClassName) {
- r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.startLineNumber, firstLineDecorationClassName, d.options.linesDecorationsTooltip ?? null, zIndex);
- }
- }
- return r;
- }
- prepareRender(ctx) {
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- const toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx));
- const left = this._decorationsLeft.toString();
- const width2 = this._decorationsWidth.toString();
- const common = '" style="left:' + left + "px;width:" + width2 + 'px;">';
- const output = [];
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- const decorations = toRender[lineIndex].getDecorations();
- let lineOutput = "";
- for (const decoration3 of decorations) {
- let addition = '
';
- }
- output[lineIndex] = lineOutput;
- }
- this._renderResult = output;
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- return this._renderResult[lineNumber - startLineNumber];
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css
-var init_minimap = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/core/misc/rgba.js
-var RGBA8;
-var init_rgba = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/core/misc/rgba.js"() {
- RGBA8 = class _RGBA8 {
- static {
- this.Empty = new _RGBA8(0, 0, 0, 0);
- }
- constructor(r, g, b, a) {
- this._rgba8Brand = void 0;
- this.r = _RGBA8._clamp(r);
- this.g = _RGBA8._clamp(g);
- this.b = _RGBA8._clamp(b);
- this.a = _RGBA8._clamp(a);
- }
- equals(other) {
- return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
- }
- static _clamp(c) {
- if (c < 0) {
- return 0;
- }
- if (c > 255) {
- return 255;
- }
- return c | 0;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js
-var TokenizationRegistry, TokenizationSupportFactoryData;
-var init_tokenizationRegistry = __esm({
- "../node_modules/monaco-editor/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/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/esm/vs/editor/common/languages.js"() {
- init_codicons();
- init_uri();
- init_range();
- init_tokenizationRegistry();
- init_nls();
- Token = class {
- constructor(offset, type, language82) {
- this.offset = offset;
- this.type = type;
- this.language = language82;
- 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(InlineCompletionTriggerKind4) {
- InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["Automatic"] = 0] = "Automatic";
- InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["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(SignatureHelpTriggerKind4) {
- SignatureHelpTriggerKind4[SignatureHelpTriggerKind4["Invoke"] = 1] = "Invoke";
- SignatureHelpTriggerKind4[SignatureHelpTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter";
- SignatureHelpTriggerKind4[SignatureHelpTriggerKind4["ContentChange"] = 3] = "ContentChange";
- })(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));
- (function(DocumentHighlightKind5) {
- DocumentHighlightKind5[DocumentHighlightKind5["Text"] = 0] = "Text";
- DocumentHighlightKind5[DocumentHighlightKind5["Read"] = 1] = "Read";
- DocumentHighlightKind5[DocumentHighlightKind5["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(Command4) {
- function is(obj) {
- if (!obj || typeof obj !== "object") {
- return false;
- }
- return typeof obj.id === "string" && typeof obj.title === "string";
- }
- Command4.is = is;
- })(Command2 || (Command2 = {}));
- (function(InlayHintKind5) {
- InlayHintKind5[InlayHintKind5["Type"] = 1] = "Type";
- InlayHintKind5[InlayHintKind5["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/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js
-var MinimapTokensColorTracker;
-var init_minimapTokensColorTracker = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js"() {
- init_event();
- init_lifecycle();
- init_rgba();
- init_languages();
- MinimapTokensColorTracker = class _MinimapTokensColorTracker extends Disposable {
- static {
- this._INSTANCE = null;
- }
- static getInstance() {
- if (!this._INSTANCE) {
- this._INSTANCE = markAsSingleton(new _MinimapTokensColorTracker());
- }
- return this._INSTANCE;
- }
- constructor() {
- super();
- this._onDidChange = new Emitter();
- this.onDidChange = this._onDidChange.event;
- this._updateColorMap();
- this._register(TokenizationRegistry2.onDidChange((e) => {
- if (e.changedColorMap) {
- this._updateColorMap();
- }
- }));
- }
- _updateColorMap() {
- const colorMap = TokenizationRegistry2.getColorMap();
- if (!colorMap) {
- this._colors = [RGBA8.Empty];
- this._backgroundIsLight = true;
- return;
- }
- this._colors = [RGBA8.Empty];
- for (let colorId = 1; colorId < colorMap.length; colorId++) {
- const source = colorMap[colorId].rgba;
- this._colors[colorId] = new RGBA8(source.r, source.g, source.b, Math.round(source.a * 255));
- }
- const backgroundLuminosity = colorMap[
- 2
- /* ColorId.DefaultBackground */
- ].getRelativeLuminance();
- this._backgroundIsLight = backgroundLuminosity >= 0.5;
- this._onDidChange.fire(void 0);
- }
- getColor(colorId) {
- if (colorId < 1 || colorId >= this._colors.length) {
- colorId = 2;
- }
- return this._colors[colorId];
- }
- backgroundIsLight() {
- return this._backgroundIsLight;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js
-var allCharCodes, getCharIndex;
-var init_minimapCharSheet = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js"() {
- allCharCodes = (() => {
- const v = [];
- for (let i2 = 32; i2 <= 126; i2++) {
- v.push(i2);
- }
- v.push(
- 65533
- /* Constants.UNKNOWN_CODE */
- );
- return v;
- })();
- getCharIndex = (chCode, fontScale) => {
- chCode -= 32;
- if (chCode < 0 || chCode > 96) {
- if (fontScale <= 2) {
- return (chCode + 96) % 96;
- }
- return 96 - 1;
- }
- return chCode;
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js
-var MinimapCharRenderer;
-var init_minimapCharRenderer = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js"() {
- init_minimapCharSheet();
- init_uint();
- MinimapCharRenderer = class _MinimapCharRenderer {
- constructor(charData, scale) {
- this.scale = scale;
- this._minimapCharRendererBrand = void 0;
- this.charDataNormal = _MinimapCharRenderer.soften(charData, 12 / 15);
- this.charDataLight = _MinimapCharRenderer.soften(charData, 50 / 60);
- }
- static soften(input, ratio) {
- const result = new Uint8ClampedArray(input.length);
- for (let i2 = 0, len = input.length; i2 < len; i2++) {
- result[i2] = toUint8(input[i2] * ratio);
- }
- return result;
- }
- renderChar(target, dx, dy, chCode, color, foregroundAlpha, backgroundColor, backgroundAlpha, fontScale, useLighterFont, force1pxHeight) {
- const charWidth = 1 * this.scale;
- const charHeight = 2 * this.scale;
- const renderHeight = force1pxHeight ? 1 : charHeight;
- if (dx + charWidth > target.width || dy + renderHeight > target.height) {
- console.warn("bad render request outside image data");
- return;
- }
- const charData = useLighterFont ? this.charDataLight : this.charDataNormal;
- const charIndex = getCharIndex(chCode, fontScale);
- const destWidth = target.width * 4;
- const backgroundR = backgroundColor.r;
- const backgroundG = backgroundColor.g;
- const backgroundB = backgroundColor.b;
- const deltaR = color.r - backgroundR;
- const deltaG = color.g - backgroundG;
- const deltaB = color.b - backgroundB;
- const destAlpha = Math.max(foregroundAlpha, backgroundAlpha);
- const dest = target.data;
- let sourceOffset = charIndex * charWidth * charHeight;
- let row = dy * destWidth + dx * 4;
- for (let y = 0; y < renderHeight; y++) {
- let column = row;
- for (let x = 0; x < charWidth; x++) {
- const c = charData[sourceOffset++] / 255 * (foregroundAlpha / 255);
- dest[column++] = backgroundR + deltaR * c;
- dest[column++] = backgroundG + deltaG * c;
- dest[column++] = backgroundB + deltaB * c;
- dest[column++] = destAlpha;
- }
- row += destWidth;
- }
- }
- blockRenderChar(target, dx, dy, color, foregroundAlpha, backgroundColor, backgroundAlpha, force1pxHeight) {
- const charWidth = 1 * this.scale;
- const charHeight = 2 * this.scale;
- const renderHeight = force1pxHeight ? 1 : charHeight;
- if (dx + charWidth > target.width || dy + renderHeight > target.height) {
- console.warn("bad render request outside image data");
- return;
- }
- const destWidth = target.width * 4;
- const c = 0.5 * (foregroundAlpha / 255);
- const backgroundR = backgroundColor.r;
- const backgroundG = backgroundColor.g;
- const backgroundB = backgroundColor.b;
- const deltaR = color.r - backgroundR;
- const deltaG = color.g - backgroundG;
- const deltaB = color.b - backgroundB;
- const colorR = backgroundR + deltaR * c;
- const colorG = backgroundG + deltaG * c;
- const colorB = backgroundB + deltaB * c;
- const destAlpha = Math.max(foregroundAlpha, backgroundAlpha);
- const dest = target.data;
- let row = dy * destWidth + dx * 4;
- for (let y = 0; y < renderHeight; y++) {
- let column = row;
- for (let x = 0; x < charWidth; x++) {
- dest[column++] = colorR;
- dest[column++] = colorG;
- dest[column++] = colorB;
- dest[column++] = destAlpha;
- }
- row += destWidth;
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js
-var charTable, decodeData, prebakedMiniMaps;
-var init_minimapPreBaked = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js"() {
- init_functional();
- charTable = {
- "0": 0,
- "1": 1,
- "2": 2,
- "3": 3,
- "4": 4,
- "5": 5,
- "6": 6,
- "7": 7,
- "8": 8,
- "9": 9,
- A: 10,
- B: 11,
- C: 12,
- D: 13,
- E: 14,
- F: 15
- };
- decodeData = (str) => {
- const output = new Uint8ClampedArray(str.length / 2);
- for (let i2 = 0; i2 < str.length; i2 += 2) {
- output[i2 >> 1] = charTable[str[i2]] << 4 | charTable[str[i2 + 1]] & 15;
- }
- return output;
- };
- prebakedMiniMaps = {
- 1: createSingleCallFunction(() => decodeData("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),
- 2: createSingleCallFunction(() => decodeData("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js
-var MinimapCharRendererFactory;
-var init_minimapCharRendererFactory = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js"() {
- init_minimapCharRenderer();
- init_minimapCharSheet();
- init_minimapPreBaked();
- init_uint();
- MinimapCharRendererFactory = class _MinimapCharRendererFactory {
- /**
- * Creates a new character renderer factory with the given scale.
- */
- static create(scale, fontFamily) {
- if (this.lastCreated && scale === this.lastCreated.scale && fontFamily === this.lastFontFamily) {
- return this.lastCreated;
- }
- let factory;
- if (prebakedMiniMaps[scale]) {
- factory = new MinimapCharRenderer(prebakedMiniMaps[scale](), scale);
- } else {
- factory = _MinimapCharRendererFactory.createFromSampleData(_MinimapCharRendererFactory.createSampleData(fontFamily).data, scale);
- }
- this.lastFontFamily = fontFamily;
- this.lastCreated = factory;
- return factory;
- }
- /**
- * Creates the font sample data, writing to a canvas.
- */
- static createSampleData(fontFamily) {
- const canvas = document.createElement("canvas");
- const ctx = canvas.getContext("2d");
- canvas.style.height = `${16}px`;
- canvas.height = 16;
- canvas.width = 96 * 10;
- canvas.style.width = 96 * 10 + "px";
- ctx.fillStyle = "#ffffff";
- ctx.font = `bold ${16}px ${fontFamily}`;
- ctx.textBaseline = "middle";
- let x = 0;
- for (const code of allCharCodes) {
- ctx.fillText(String.fromCharCode(code), x, 16 / 2);
- x += 10;
- }
- return ctx.getImageData(
- 0,
- 0,
- 96 * 10,
- 16
- /* Constants.SAMPLED_CHAR_HEIGHT */
- );
- }
- /**
- * Creates a character renderer from the canvas sample data.
- */
- static createFromSampleData(source, scale) {
- const expectedLength = 16 * 10 * 4 * 96;
- if (source.length !== expectedLength) {
- throw new Error("Unexpected source in MinimapCharRenderer");
- }
- const charData = _MinimapCharRendererFactory._downsample(source, scale);
- return new MinimapCharRenderer(charData, scale);
- }
- static _downsampleChar(source, sourceOffset, dest, destOffset, scale) {
- const width2 = 1 * scale;
- const height = 2 * scale;
- let targetIndex = destOffset;
- let brightest = 0;
- for (let y = 0; y < height; y++) {
- const sourceY1 = y / height * 16;
- const sourceY2 = (y + 1) / height * 16;
- for (let x = 0; x < width2; x++) {
- const sourceX1 = x / width2 * 10;
- const sourceX2 = (x + 1) / width2 * 10;
- let value = 0;
- let samples = 0;
- for (let sy = sourceY1; sy < sourceY2; sy++) {
- const sourceRow = sourceOffset + Math.floor(sy) * 3840;
- const yBalance = 1 - (sy - Math.floor(sy));
- for (let sx = sourceX1; sx < sourceX2; sx++) {
- const xBalance = 1 - (sx - Math.floor(sx));
- const sourceIndex = sourceRow + Math.floor(sx) * 4;
- const weight5 = xBalance * yBalance;
- samples += weight5;
- value += source[sourceIndex] * source[sourceIndex + 3] / 255 * weight5;
- }
- }
- const final = value / samples;
- brightest = Math.max(brightest, final);
- dest[targetIndex++] = toUint8(final);
- }
- }
- return brightest;
- }
- static _downsample(data, scale) {
- const pixelsPerCharacter = 2 * scale * 1 * scale;
- const resultLen = pixelsPerCharacter * 96;
- const result = new Uint8ClampedArray(resultLen);
- let resultOffset = 0;
- let sourceOffset = 0;
- let brightest = 0;
- for (let charIndex = 0; charIndex < 96; charIndex++) {
- brightest = Math.max(brightest, this._downsampleChar(data, sourceOffset, result, resultOffset, scale));
- resultOffset += pixelsPerCharacter;
- sourceOffset += 10 * 4;
- }
- if (brightest > 0) {
- const adjust = 255 / brightest;
- for (let i2 = 0; i2 < resultLen; i2++) {
- result[i2] *= adjust;
- }
- }
- return result;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/browser/fonts.js
-var DEFAULT_FONT_FAMILY;
-var init_fonts = __esm({
- "../node_modules/monaco-editor/esm/vs/base/browser/fonts.js"() {
- init_platform();
- DEFAULT_FONT_FAMILY = isWindows ? '"Segoe WPC", "Segoe UI", sans-serif' : isMacintosh ? "-apple-system, BlinkMacSystemFont, sans-serif" : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecoration.js
-function isModelDecorationVisible(model, decoration3) {
- if (decoration3.options.hideInCommentTokens && isModelDecorationInComment(model, decoration3)) {
- return false;
- }
- if (decoration3.options.hideInStringTokens && isModelDecorationInString(model, decoration3)) {
- return false;
- }
- return true;
-}
-function isModelDecorationInComment(model, decoration3) {
- return testTokensInRange(
- model,
- decoration3.range,
- (tokenType) => tokenType === 1
- /* StandardTokenType.Comment */
- );
-}
-function isModelDecorationInString(model, decoration3) {
- return testTokensInRange(
- model,
- decoration3.range,
- (tokenType) => tokenType === 2
- /* StandardTokenType.String */
- );
-}
-function testTokensInRange(model, range2, callback) {
- for (let lineNumber = range2.startLineNumber; lineNumber <= range2.endLineNumber; lineNumber++) {
- const lineTokens = model.tokenization.getLineTokens(lineNumber);
- const isFirstLine = lineNumber === range2.startLineNumber;
- const isEndLine = lineNumber === range2.endLineNumber;
- let tokenIdx = isFirstLine ? lineTokens.findTokenIndexAtOffset(range2.startColumn - 1) : 0;
- while (tokenIdx < lineTokens.getCount()) {
- if (isEndLine) {
- const startOffset = lineTokens.getStartOffset(tokenIdx);
- if (startOffset > range2.endColumn - 1) {
- break;
- }
- }
- const callbackResult = callback(lineTokens.getStandardTokenType(tokenIdx));
- if (!callbackResult) {
- return false;
- }
- tokenIdx++;
- }
- }
- return true;
-}
-var ViewModelDecoration;
-var init_viewModelDecoration = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecoration.js"() {
- ViewModelDecoration = class {
- constructor(range2, options) {
- this._viewModelDecorationBrand = void 0;
- this.range = range2;
- this.options = options;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js
-var POINTER_DRAG_RESET_DISTANCE2, GUTTER_DECORATION_WIDTH, MinimapOptions, MinimapLayout, MinimapLine, RenderData, MinimapBuffers, MinimapSamplingState, Minimap, InnerMinimap, ContiguousLineMap;
-var init_minimap2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js"() {
- init_minimap();
- init_dom();
- init_fastDomNode();
- init_globalPointerMoveMonitor();
- init_lifecycle();
- init_platform();
- init_strings();
- init_viewLayer();
- init_viewPart();
- init_editorOptions();
- init_range();
- init_rgba();
- init_minimapTokensColorTracker();
- init_colorUtils();
- init_baseColors();
- init_chartsColors();
- init_editorColors();
- init_inputColors();
- init_listColors();
- init_menuColors();
- init_minimapColors();
- init_miscColors();
- init_quickpickColors();
- init_searchColors();
- init_selection();
- init_touch();
- init_minimapCharRendererFactory();
- init_functional();
- init_map();
- init_fonts();
- init_viewModelDecoration();
- init_async();
- POINTER_DRAG_RESET_DISTANCE2 = 140;
- GUTTER_DECORATION_WIDTH = 2;
- MinimapOptions = class _MinimapOptions {
- constructor(configuration, theme, tokensColorTracker) {
- const options = configuration.options;
- const pixelRatio = options.get(
- 163
- /* EditorOption.pixelRatio */
- );
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const minimapLayout = layoutInfo.minimap;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- const minimapOpts = options.get(
- 81
- /* EditorOption.minimap */
- );
- this.renderMinimap = minimapLayout.renderMinimap;
- this.size = minimapOpts.size;
- this.minimapHeightIsEditorHeight = minimapLayout.minimapHeightIsEditorHeight;
- this.scrollBeyondLastLine = options.get(
- 119
- /* EditorOption.scrollBeyondLastLine */
- );
- this.paddingTop = options.get(
- 96
- /* EditorOption.padding */
- ).top;
- this.paddingBottom = options.get(
- 96
- /* EditorOption.padding */
- ).bottom;
- this.showSlider = minimapOpts.showSlider;
- this.autohide = minimapOpts.autohide;
- this.pixelRatio = pixelRatio;
- this.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
- this.lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this.minimapLeft = minimapLayout.minimapLeft;
- this.minimapWidth = minimapLayout.minimapWidth;
- this.minimapHeight = layoutInfo.height;
- this.canvasInnerWidth = minimapLayout.minimapCanvasInnerWidth;
- this.canvasInnerHeight = minimapLayout.minimapCanvasInnerHeight;
- this.canvasOuterWidth = minimapLayout.minimapCanvasOuterWidth;
- this.canvasOuterHeight = minimapLayout.minimapCanvasOuterHeight;
- this.isSampling = minimapLayout.minimapIsSampling;
- this.editorHeight = layoutInfo.height;
- this.fontScale = minimapLayout.minimapScale;
- this.minimapLineHeight = minimapLayout.minimapLineHeight;
- this.minimapCharWidth = 1 * this.fontScale;
- this.sectionHeaderFontFamily = DEFAULT_FONT_FAMILY;
- this.sectionHeaderFontSize = minimapOpts.sectionHeaderFontSize * pixelRatio;
- this.sectionHeaderLetterSpacing = minimapOpts.sectionHeaderLetterSpacing;
- this.sectionHeaderFontColor = _MinimapOptions._getSectionHeaderColor(theme, tokensColorTracker.getColor(
- 1
- /* ColorId.DefaultForeground */
- ));
- this.charRenderer = createSingleCallFunction(() => MinimapCharRendererFactory.create(this.fontScale, fontInfo.fontFamily));
- this.defaultBackgroundColor = tokensColorTracker.getColor(
- 2
- /* ColorId.DefaultBackground */
- );
- this.backgroundColor = _MinimapOptions._getMinimapBackground(theme, this.defaultBackgroundColor);
- this.foregroundAlpha = _MinimapOptions._getMinimapForegroundOpacity(theme);
- }
- static _getMinimapBackground(theme, defaultBackgroundColor) {
- const themeColor = theme.getColor(minimapBackground);
- if (themeColor) {
- return new RGBA8(themeColor.rgba.r, themeColor.rgba.g, themeColor.rgba.b, Math.round(255 * themeColor.rgba.a));
- }
- return defaultBackgroundColor;
- }
- static _getMinimapForegroundOpacity(theme) {
- const themeColor = theme.getColor(minimapForegroundOpacity);
- if (themeColor) {
- return RGBA8._clamp(Math.round(255 * themeColor.rgba.a));
- }
- return 255;
- }
- static _getSectionHeaderColor(theme, defaultForegroundColor) {
- const themeColor = theme.getColor(editorForeground);
- if (themeColor) {
- return new RGBA8(themeColor.rgba.r, themeColor.rgba.g, themeColor.rgba.b, Math.round(255 * themeColor.rgba.a));
- }
- return defaultForegroundColor;
- }
- equals(other) {
- return this.renderMinimap === other.renderMinimap && this.size === other.size && this.minimapHeightIsEditorHeight === other.minimapHeightIsEditorHeight && this.scrollBeyondLastLine === other.scrollBeyondLastLine && this.paddingTop === other.paddingTop && this.paddingBottom === other.paddingBottom && this.showSlider === other.showSlider && this.autohide === other.autohide && this.pixelRatio === other.pixelRatio && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth && this.lineHeight === other.lineHeight && this.minimapLeft === other.minimapLeft && this.minimapWidth === other.minimapWidth && this.minimapHeight === other.minimapHeight && this.canvasInnerWidth === other.canvasInnerWidth && this.canvasInnerHeight === other.canvasInnerHeight && this.canvasOuterWidth === other.canvasOuterWidth && this.canvasOuterHeight === other.canvasOuterHeight && this.isSampling === other.isSampling && this.editorHeight === other.editorHeight && this.fontScale === other.fontScale && this.minimapLineHeight === other.minimapLineHeight && this.minimapCharWidth === other.minimapCharWidth && this.sectionHeaderFontSize === other.sectionHeaderFontSize && this.sectionHeaderLetterSpacing === other.sectionHeaderLetterSpacing && this.defaultBackgroundColor && this.defaultBackgroundColor.equals(other.defaultBackgroundColor) && this.backgroundColor && this.backgroundColor.equals(other.backgroundColor) && this.foregroundAlpha === other.foregroundAlpha;
- }
- };
- MinimapLayout = class _MinimapLayout {
- constructor(scrollTop, scrollHeight, sliderNeeded, _computedSliderRatio, sliderTop, sliderHeight, topPaddingLineCount, startLineNumber, endLineNumber) {
- this.scrollTop = scrollTop;
- this.scrollHeight = scrollHeight;
- this.sliderNeeded = sliderNeeded;
- this._computedSliderRatio = _computedSliderRatio;
- this.sliderTop = sliderTop;
- this.sliderHeight = sliderHeight;
- this.topPaddingLineCount = topPaddingLineCount;
- this.startLineNumber = startLineNumber;
- this.endLineNumber = endLineNumber;
- }
- /**
- * Compute a desired `scrollPosition` such that the slider moves by `delta`.
- */
- getDesiredScrollTopFromDelta(delta) {
- return Math.round(this.scrollTop + delta / this._computedSliderRatio);
- }
- getDesiredScrollTopFromTouchLocation(pageY) {
- return Math.round((pageY - this.sliderHeight / 2) / this._computedSliderRatio);
- }
- /**
- * Intersect a line range with `this.startLineNumber` and `this.endLineNumber`.
- */
- intersectWithViewport(range2) {
- const startLineNumber = Math.max(this.startLineNumber, range2.startLineNumber);
- const endLineNumber = Math.min(this.endLineNumber, range2.endLineNumber);
- if (startLineNumber > endLineNumber) {
- return null;
- }
- return [startLineNumber, endLineNumber];
- }
- /**
- * Get the inner minimap y coordinate for a line number.
- */
- getYForLineNumber(lineNumber, minimapLineHeight) {
- return +(lineNumber - this.startLineNumber + this.topPaddingLineCount) * minimapLineHeight;
- }
- static create(options, viewportStartLineNumber, viewportEndLineNumber, viewportStartLineNumberVerticalOffset, viewportHeight, viewportContainsWhitespaceGaps, lineCount, realLineCount, scrollTop, scrollHeight, previousLayout) {
- const pixelRatio = options.pixelRatio;
- const minimapLineHeight = options.minimapLineHeight;
- const minimapLinesFitting = Math.floor(options.canvasInnerHeight / minimapLineHeight);
- const lineHeight = options.lineHeight;
- if (options.minimapHeightIsEditorHeight) {
- let logicalScrollHeight = realLineCount * options.lineHeight + options.paddingTop + options.paddingBottom;
- if (options.scrollBeyondLastLine) {
- logicalScrollHeight += Math.max(0, viewportHeight - options.lineHeight - options.paddingBottom);
- }
- const sliderHeight2 = Math.max(1, Math.floor(viewportHeight * viewportHeight / logicalScrollHeight));
- const maxMinimapSliderTop2 = Math.max(0, options.minimapHeight - sliderHeight2);
- const computedSliderRatio2 = maxMinimapSliderTop2 / (scrollHeight - viewportHeight);
- const sliderTop2 = scrollTop * computedSliderRatio2;
- const sliderNeeded = maxMinimapSliderTop2 > 0;
- const maxLinesFitting = Math.floor(options.canvasInnerHeight / options.minimapLineHeight);
- const topPaddingLineCount = Math.floor(options.paddingTop / options.lineHeight);
- return new _MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio2, sliderTop2, sliderHeight2, topPaddingLineCount, 1, Math.min(lineCount, maxLinesFitting));
- }
- let sliderHeight;
- if (viewportContainsWhitespaceGaps && viewportEndLineNumber !== lineCount) {
- const viewportLineCount = viewportEndLineNumber - viewportStartLineNumber + 1;
- sliderHeight = Math.floor(viewportLineCount * minimapLineHeight / pixelRatio);
- } else {
- const expectedViewportLineCount = viewportHeight / lineHeight;
- sliderHeight = Math.floor(expectedViewportLineCount * minimapLineHeight / pixelRatio);
- }
- const extraLinesAtTheTop = Math.floor(options.paddingTop / lineHeight);
- let extraLinesAtTheBottom = Math.floor(options.paddingBottom / lineHeight);
- if (options.scrollBeyondLastLine) {
- const expectedViewportLineCount = viewportHeight / lineHeight;
- extraLinesAtTheBottom = Math.max(extraLinesAtTheBottom, expectedViewportLineCount - 1);
- }
- let maxMinimapSliderTop;
- if (extraLinesAtTheBottom > 0) {
- const expectedViewportLineCount = viewportHeight / lineHeight;
- maxMinimapSliderTop = (extraLinesAtTheTop + lineCount + extraLinesAtTheBottom - expectedViewportLineCount - 1) * minimapLineHeight / pixelRatio;
- } else {
- maxMinimapSliderTop = Math.max(0, (extraLinesAtTheTop + lineCount) * minimapLineHeight / pixelRatio - sliderHeight);
- }
- maxMinimapSliderTop = Math.min(options.minimapHeight - sliderHeight, maxMinimapSliderTop);
- const computedSliderRatio = maxMinimapSliderTop / (scrollHeight - viewportHeight);
- const sliderTop = scrollTop * computedSliderRatio;
- if (minimapLinesFitting >= extraLinesAtTheTop + lineCount + extraLinesAtTheBottom) {
- const sliderNeeded = maxMinimapSliderTop > 0;
- return new _MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, extraLinesAtTheTop, 1, lineCount);
- } else {
- let consideringStartLineNumber;
- if (viewportStartLineNumber > 1) {
- consideringStartLineNumber = viewportStartLineNumber + extraLinesAtTheTop;
- } else {
- consideringStartLineNumber = Math.max(1, scrollTop / lineHeight);
- }
- let topPaddingLineCount;
- let startLineNumber = Math.max(1, Math.floor(consideringStartLineNumber - sliderTop * pixelRatio / minimapLineHeight));
- if (startLineNumber < extraLinesAtTheTop) {
- topPaddingLineCount = extraLinesAtTheTop - startLineNumber + 1;
- startLineNumber = 1;
- } else {
- topPaddingLineCount = 0;
- startLineNumber = Math.max(1, startLineNumber - extraLinesAtTheTop);
- }
- if (previousLayout && previousLayout.scrollHeight === scrollHeight) {
- if (previousLayout.scrollTop > scrollTop) {
- startLineNumber = Math.min(startLineNumber, previousLayout.startLineNumber);
- topPaddingLineCount = Math.max(topPaddingLineCount, previousLayout.topPaddingLineCount);
- }
- if (previousLayout.scrollTop < scrollTop) {
- startLineNumber = Math.max(startLineNumber, previousLayout.startLineNumber);
- topPaddingLineCount = Math.min(topPaddingLineCount, previousLayout.topPaddingLineCount);
- }
- }
- const endLineNumber = Math.min(lineCount, startLineNumber - topPaddingLineCount + minimapLinesFitting - 1);
- const partialLine = (scrollTop - viewportStartLineNumberVerticalOffset) / lineHeight;
- let sliderTopAligned;
- if (scrollTop >= options.paddingTop) {
- sliderTopAligned = (viewportStartLineNumber - startLineNumber + topPaddingLineCount + partialLine) * minimapLineHeight / pixelRatio;
- } else {
- sliderTopAligned = scrollTop / options.paddingTop * (topPaddingLineCount + partialLine) * minimapLineHeight / pixelRatio;
- }
- return new _MinimapLayout(scrollTop, scrollHeight, true, computedSliderRatio, sliderTopAligned, sliderHeight, topPaddingLineCount, startLineNumber, endLineNumber);
- }
- }
- };
- MinimapLine = class _MinimapLine {
- static {
- this.INVALID = new _MinimapLine(-1);
- }
- constructor(dy) {
- this.dy = dy;
- }
- onContentChanged() {
- this.dy = -1;
- }
- onTokensChanged() {
- this.dy = -1;
- }
- };
- RenderData = class {
- constructor(renderedLayout, imageData, lines) {
- this.renderedLayout = renderedLayout;
- this._imageData = imageData;
- this._renderedLines = new RenderedLinesCollection({
- createLine: () => MinimapLine.INVALID
- });
- this._renderedLines._set(renderedLayout.startLineNumber, lines);
- }
- /**
- * Check if the current RenderData matches accurately the new desired layout and no painting is needed.
- */
- linesEquals(layout2) {
- if (!this.scrollEquals(layout2)) {
- return false;
- }
- const tmp = this._renderedLines._get();
- const lines = tmp.lines;
- for (let i2 = 0, len = lines.length; i2 < len; i2++) {
- if (lines[i2].dy === -1) {
- return false;
- }
- }
- return true;
- }
- /**
- * Check if the current RenderData matches the new layout's scroll position
- */
- scrollEquals(layout2) {
- return this.renderedLayout.startLineNumber === layout2.startLineNumber && this.renderedLayout.endLineNumber === layout2.endLineNumber;
- }
- _get() {
- const tmp = this._renderedLines._get();
- return {
- imageData: this._imageData,
- rendLineNumberStart: tmp.rendLineNumberStart,
- lines: tmp.lines
- };
- }
- onLinesChanged(changeFromLineNumber, changeCount) {
- return this._renderedLines.onLinesChanged(changeFromLineNumber, changeCount);
- }
- onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) {
- this._renderedLines.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber);
- }
- onLinesInserted(insertFromLineNumber, insertToLineNumber) {
- this._renderedLines.onLinesInserted(insertFromLineNumber, insertToLineNumber);
- }
- onTokensChanged(ranges) {
- return this._renderedLines.onTokensChanged(ranges);
- }
- };
- MinimapBuffers = class _MinimapBuffers {
- constructor(ctx, WIDTH, HEIGHT, background) {
- this._backgroundFillData = _MinimapBuffers._createBackgroundFillData(WIDTH, HEIGHT, background);
- this._buffers = [
- ctx.createImageData(WIDTH, HEIGHT),
- ctx.createImageData(WIDTH, HEIGHT)
- ];
- this._lastUsedBuffer = 0;
- }
- getBuffer() {
- this._lastUsedBuffer = 1 - this._lastUsedBuffer;
- const result = this._buffers[this._lastUsedBuffer];
- result.data.set(this._backgroundFillData);
- return result;
- }
- static _createBackgroundFillData(WIDTH, HEIGHT, background) {
- const backgroundR = background.r;
- const backgroundG = background.g;
- const backgroundB = background.b;
- const backgroundA = background.a;
- const result = new Uint8ClampedArray(WIDTH * HEIGHT * 4);
- let offset = 0;
- for (let i2 = 0; i2 < HEIGHT; i2++) {
- for (let j = 0; j < WIDTH; j++) {
- result[offset] = backgroundR;
- result[offset + 1] = backgroundG;
- result[offset + 2] = backgroundB;
- result[offset + 3] = backgroundA;
- offset += 4;
- }
- }
- return result;
- }
- };
- MinimapSamplingState = class _MinimapSamplingState {
- static compute(options, viewLineCount, oldSamplingState) {
- if (options.renderMinimap === 0 || !options.isSampling) {
- return [null, []];
- }
- const { minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({
- viewLineCount,
- scrollBeyondLastLine: options.scrollBeyondLastLine,
- paddingTop: options.paddingTop,
- paddingBottom: options.paddingBottom,
- height: options.editorHeight,
- lineHeight: options.lineHeight,
- pixelRatio: options.pixelRatio
- });
- const ratio = viewLineCount / minimapLineCount;
- const halfRatio = ratio / 2;
- if (!oldSamplingState || oldSamplingState.minimapLines.length === 0) {
- const result2 = [];
- result2[0] = 1;
- if (minimapLineCount > 1) {
- for (let i2 = 0, lastIndex = minimapLineCount - 1; i2 < lastIndex; i2++) {
- result2[i2] = Math.round(i2 * ratio + halfRatio);
- }
- result2[minimapLineCount - 1] = viewLineCount;
- }
- return [new _MinimapSamplingState(ratio, result2), []];
- }
- const oldMinimapLines = oldSamplingState.minimapLines;
- const oldLength = oldMinimapLines.length;
- const result = [];
- let oldIndex = 0;
- let oldDeltaLineCount = 0;
- let minViewLineNumber = 1;
- const MAX_EVENT_COUNT = 10;
- let events = [];
- let lastEvent = null;
- for (let i2 = 0; i2 < minimapLineCount; i2++) {
- const fromViewLineNumber = Math.max(minViewLineNumber, Math.round(i2 * ratio));
- const toViewLineNumber = Math.max(fromViewLineNumber, Math.round((i2 + 1) * ratio));
- while (oldIndex < oldLength && oldMinimapLines[oldIndex] < fromViewLineNumber) {
- if (events.length < MAX_EVENT_COUNT) {
- const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;
- if (lastEvent && lastEvent.type === "deleted" && lastEvent._oldIndex === oldIndex - 1) {
- lastEvent.deleteToLineNumber++;
- } else {
- lastEvent = { type: "deleted", _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber };
- events.push(lastEvent);
- }
- oldDeltaLineCount--;
- }
- oldIndex++;
- }
- let selectedViewLineNumber;
- if (oldIndex < oldLength && oldMinimapLines[oldIndex] <= toViewLineNumber) {
- selectedViewLineNumber = oldMinimapLines[oldIndex];
- oldIndex++;
- } else {
- if (i2 === 0) {
- selectedViewLineNumber = 1;
- } else if (i2 + 1 === minimapLineCount) {
- selectedViewLineNumber = viewLineCount;
- } else {
- selectedViewLineNumber = Math.round(i2 * ratio + halfRatio);
- }
- if (events.length < MAX_EVENT_COUNT) {
- const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;
- if (lastEvent && lastEvent.type === "inserted" && lastEvent._i === i2 - 1) {
- lastEvent.insertToLineNumber++;
- } else {
- lastEvent = { type: "inserted", _i: i2, insertFromLineNumber: oldMinimapLineNumber, insertToLineNumber: oldMinimapLineNumber };
- events.push(lastEvent);
- }
- oldDeltaLineCount++;
- }
- }
- result[i2] = selectedViewLineNumber;
- minViewLineNumber = selectedViewLineNumber;
- }
- if (events.length < MAX_EVENT_COUNT) {
- while (oldIndex < oldLength) {
- const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount;
- if (lastEvent && lastEvent.type === "deleted" && lastEvent._oldIndex === oldIndex - 1) {
- lastEvent.deleteToLineNumber++;
- } else {
- lastEvent = { type: "deleted", _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber };
- events.push(lastEvent);
- }
- oldDeltaLineCount--;
- oldIndex++;
- }
- } else {
- events = [{ type: "flush" }];
- }
- return [new _MinimapSamplingState(ratio, result), events];
- }
- constructor(samplingRatio, minimapLines) {
- this.samplingRatio = samplingRatio;
- this.minimapLines = minimapLines;
- }
- modelLineToMinimapLine(lineNumber) {
- return Math.min(this.minimapLines.length, Math.max(1, Math.round(lineNumber / this.samplingRatio)));
- }
- /**
- * Will return null if the model line ranges are not intersecting with a sampled model line.
- */
- modelLineRangeToMinimapLineRange(fromLineNumber, toLineNumber) {
- let fromLineIndex = this.modelLineToMinimapLine(fromLineNumber) - 1;
- while (fromLineIndex > 0 && this.minimapLines[fromLineIndex - 1] >= fromLineNumber) {
- fromLineIndex--;
- }
- let toLineIndex = this.modelLineToMinimapLine(toLineNumber) - 1;
- while (toLineIndex + 1 < this.minimapLines.length && this.minimapLines[toLineIndex + 1] <= toLineNumber) {
- toLineIndex++;
- }
- if (fromLineIndex === toLineIndex) {
- const sampledLineNumber = this.minimapLines[fromLineIndex];
- if (sampledLineNumber < fromLineNumber || sampledLineNumber > toLineNumber) {
- return null;
- }
- }
- return [fromLineIndex + 1, toLineIndex + 1];
- }
- /**
- * Will always return a range, even if it is not intersecting with a sampled model line.
- */
- decorationLineRangeToMinimapLineRange(startLineNumber, endLineNumber) {
- let minimapLineStart = this.modelLineToMinimapLine(startLineNumber);
- let minimapLineEnd = this.modelLineToMinimapLine(endLineNumber);
- if (startLineNumber !== endLineNumber && minimapLineEnd === minimapLineStart) {
- if (minimapLineEnd === this.minimapLines.length) {
- if (minimapLineStart > 1) {
- minimapLineStart--;
- }
- } else {
- minimapLineEnd++;
- }
- }
- return [minimapLineStart, minimapLineEnd];
- }
- onLinesDeleted(e) {
- const deletedLineCount = e.toLineNumber - e.fromLineNumber + 1;
- let changeStartIndex = this.minimapLines.length;
- let changeEndIndex = 0;
- for (let i2 = this.minimapLines.length - 1; i2 >= 0; i2--) {
- if (this.minimapLines[i2] < e.fromLineNumber) {
- break;
- }
- if (this.minimapLines[i2] <= e.toLineNumber) {
- this.minimapLines[i2] = Math.max(1, e.fromLineNumber - 1);
- changeStartIndex = Math.min(changeStartIndex, i2);
- changeEndIndex = Math.max(changeEndIndex, i2);
- } else {
- this.minimapLines[i2] -= deletedLineCount;
- }
- }
- return [changeStartIndex, changeEndIndex];
- }
- onLinesInserted(e) {
- const insertedLineCount = e.toLineNumber - e.fromLineNumber + 1;
- for (let i2 = this.minimapLines.length - 1; i2 >= 0; i2--) {
- if (this.minimapLines[i2] < e.fromLineNumber) {
- break;
- }
- this.minimapLines[i2] += insertedLineCount;
- }
- }
- };
- Minimap = class extends ViewPart {
- constructor(context) {
- super(context);
- this._sectionHeaderCache = new LRUCache(10, 1.5);
- this.tokensColorTracker = MinimapTokensColorTracker.getInstance();
- this._selections = [];
- this._minimapSelections = null;
- this.options = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker);
- const [samplingState] = MinimapSamplingState.compute(this.options, this._context.viewModel.getLineCount(), null);
- this._samplingState = samplingState;
- this._shouldCheckSampling = false;
- this._actual = new InnerMinimap(context.theme, this);
- }
- dispose() {
- this._actual.dispose();
- super.dispose();
- }
- getDomNode() {
- return this._actual.getDomNode();
- }
- _onOptionsMaybeChanged() {
- const opts = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker);
- if (this.options.equals(opts)) {
- return false;
- }
- this.options = opts;
- this._recreateLineSampling();
- this._actual.onDidChangeOptions();
- return true;
- }
- // ---- begin view event handlers
- onConfigurationChanged(e) {
- return this._onOptionsMaybeChanged();
- }
- onCursorStateChanged(e) {
- this._selections = e.selections;
- this._minimapSelections = null;
- return this._actual.onSelectionChanged();
- }
- onDecorationsChanged(e) {
- if (e.affectsMinimap) {
- return this._actual.onDecorationsChanged();
- }
- return false;
- }
- onFlushed(e) {
- if (this._samplingState) {
- this._shouldCheckSampling = true;
- }
- return this._actual.onFlushed();
- }
- onLinesChanged(e) {
- if (this._samplingState) {
- const minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber, e.fromLineNumber + e.count - 1);
- if (minimapLineRange) {
- return this._actual.onLinesChanged(minimapLineRange[0], minimapLineRange[1] - minimapLineRange[0] + 1);
- } else {
- return false;
- }
- } else {
- return this._actual.onLinesChanged(e.fromLineNumber, e.count);
- }
- }
- onLinesDeleted(e) {
- if (this._samplingState) {
- const [changeStartIndex, changeEndIndex] = this._samplingState.onLinesDeleted(e);
- if (changeStartIndex <= changeEndIndex) {
- this._actual.onLinesChanged(changeStartIndex + 1, changeEndIndex - changeStartIndex + 1);
- }
- this._shouldCheckSampling = true;
- return true;
- } else {
- return this._actual.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
- }
- }
- onLinesInserted(e) {
- if (this._samplingState) {
- this._samplingState.onLinesInserted(e);
- this._shouldCheckSampling = true;
- return true;
- } else {
- return this._actual.onLinesInserted(e.fromLineNumber, e.toLineNumber);
- }
- }
- onScrollChanged(e) {
- return this._actual.onScrollChanged(e);
- }
- onThemeChanged(e) {
- this._actual.onThemeChanged();
- this._onOptionsMaybeChanged();
- return true;
- }
- onTokensChanged(e) {
- if (this._samplingState) {
- const ranges = [];
- for (const range2 of e.ranges) {
- const minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(range2.fromLineNumber, range2.toLineNumber);
- if (minimapLineRange) {
- ranges.push({ fromLineNumber: minimapLineRange[0], toLineNumber: minimapLineRange[1] });
- }
- }
- if (ranges.length) {
- return this._actual.onTokensChanged(ranges);
- } else {
- return false;
- }
- } else {
- return this._actual.onTokensChanged(e.ranges);
- }
- }
- onTokensColorsChanged(e) {
- this._onOptionsMaybeChanged();
- return this._actual.onTokensColorsChanged();
- }
- onZonesChanged(e) {
- return this._actual.onZonesChanged();
- }
- // --- end event handlers
- prepareRender(ctx) {
- if (this._shouldCheckSampling) {
- this._shouldCheckSampling = false;
- this._recreateLineSampling();
- }
- }
- render(ctx) {
- let viewportStartLineNumber = ctx.visibleRange.startLineNumber;
- let viewportEndLineNumber = ctx.visibleRange.endLineNumber;
- if (this._samplingState) {
- viewportStartLineNumber = this._samplingState.modelLineToMinimapLine(viewportStartLineNumber);
- viewportEndLineNumber = this._samplingState.modelLineToMinimapLine(viewportEndLineNumber);
- }
- const minimapCtx = {
- viewportContainsWhitespaceGaps: ctx.viewportData.whitespaceViewportData.length > 0,
- scrollWidth: ctx.scrollWidth,
- scrollHeight: ctx.scrollHeight,
- viewportStartLineNumber,
- viewportEndLineNumber,
- viewportStartLineNumberVerticalOffset: ctx.getVerticalOffsetForLineNumber(viewportStartLineNumber),
- scrollTop: ctx.scrollTop,
- scrollLeft: ctx.scrollLeft,
- viewportWidth: ctx.viewportWidth,
- viewportHeight: ctx.viewportHeight
- };
- this._actual.render(minimapCtx);
- }
- //#region IMinimapModel
- _recreateLineSampling() {
- this._minimapSelections = null;
- const wasSampling = Boolean(this._samplingState);
- const [samplingState, events] = MinimapSamplingState.compute(this.options, this._context.viewModel.getLineCount(), this._samplingState);
- this._samplingState = samplingState;
- if (wasSampling && this._samplingState) {
- for (const event of events) {
- switch (event.type) {
- case "deleted":
- this._actual.onLinesDeleted(event.deleteFromLineNumber, event.deleteToLineNumber);
- break;
- case "inserted":
- this._actual.onLinesInserted(event.insertFromLineNumber, event.insertToLineNumber);
- break;
- case "flush":
- this._actual.onFlushed();
- break;
- }
- }
- }
- }
- getLineCount() {
- if (this._samplingState) {
- return this._samplingState.minimapLines.length;
- }
- return this._context.viewModel.getLineCount();
- }
- getRealLineCount() {
- return this._context.viewModel.getLineCount();
- }
- getLineContent(lineNumber) {
- if (this._samplingState) {
- return this._context.viewModel.getLineContent(this._samplingState.minimapLines[lineNumber - 1]);
- }
- return this._context.viewModel.getLineContent(lineNumber);
- }
- getLineMaxColumn(lineNumber) {
- if (this._samplingState) {
- return this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[lineNumber - 1]);
- }
- return this._context.viewModel.getLineMaxColumn(lineNumber);
- }
- getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed) {
- if (this._samplingState) {
- const result = [];
- for (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) {
- if (needed[lineIndex]) {
- result[lineIndex] = this._context.viewModel.getViewLineData(this._samplingState.minimapLines[startLineNumber + lineIndex - 1]);
- } else {
- result[lineIndex] = null;
- }
- }
- return result;
- }
- return this._context.viewModel.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed).data;
- }
- getSelections() {
- if (this._minimapSelections === null) {
- if (this._samplingState) {
- this._minimapSelections = [];
- for (const selection of this._selections) {
- const [minimapLineStart, minimapLineEnd] = this._samplingState.decorationLineRangeToMinimapLineRange(selection.startLineNumber, selection.endLineNumber);
- this._minimapSelections.push(new Selection(minimapLineStart, selection.startColumn, minimapLineEnd, selection.endColumn));
- }
- } else {
- this._minimapSelections = this._selections;
- }
- }
- return this._minimapSelections;
- }
- getMinimapDecorationsInViewport(startLineNumber, endLineNumber) {
- return this._getMinimapDecorationsInViewport(startLineNumber, endLineNumber).filter((decoration3) => !decoration3.options.minimap?.sectionHeaderStyle);
- }
- getSectionHeaderDecorationsInViewport(startLineNumber, endLineNumber) {
- const headerHeightInMinimapLines = this.options.sectionHeaderFontSize / this.options.minimapLineHeight;
- startLineNumber = Math.floor(Math.max(1, startLineNumber - headerHeightInMinimapLines));
- return this._getMinimapDecorationsInViewport(startLineNumber, endLineNumber).filter((decoration3) => !!decoration3.options.minimap?.sectionHeaderStyle);
- }
- _getMinimapDecorationsInViewport(startLineNumber, endLineNumber) {
- let visibleRange;
- if (this._samplingState) {
- const modelStartLineNumber = this._samplingState.minimapLines[startLineNumber - 1];
- const modelEndLineNumber = this._samplingState.minimapLines[endLineNumber - 1];
- visibleRange = new Range(modelStartLineNumber, 1, modelEndLineNumber, this._context.viewModel.getLineMaxColumn(modelEndLineNumber));
- } else {
- visibleRange = new Range(startLineNumber, 1, endLineNumber, this._context.viewModel.getLineMaxColumn(endLineNumber));
- }
- const decorations = this._context.viewModel.getMinimapDecorationsInRange(visibleRange);
- if (this._samplingState) {
- const result = [];
- for (const decoration3 of decorations) {
- if (!decoration3.options.minimap) {
- continue;
- }
- const range2 = decoration3.range;
- const minimapStartLineNumber = this._samplingState.modelLineToMinimapLine(range2.startLineNumber);
- const minimapEndLineNumber = this._samplingState.modelLineToMinimapLine(range2.endLineNumber);
- result.push(new ViewModelDecoration(new Range(minimapStartLineNumber, range2.startColumn, minimapEndLineNumber, range2.endColumn), decoration3.options));
- }
- return result;
- }
- return decorations;
- }
- getSectionHeaderText(decoration3, fitWidth) {
- const headerText = decoration3.options.minimap?.sectionHeaderText;
- if (!headerText) {
- return null;
- }
- const cachedText = this._sectionHeaderCache.get(headerText);
- if (cachedText) {
- return cachedText;
- }
- const fittedText = fitWidth(headerText);
- this._sectionHeaderCache.set(headerText, fittedText);
- return fittedText;
- }
- getOptions() {
- return this._context.viewModel.model.getOptions();
- }
- revealLineNumber(lineNumber) {
- if (this._samplingState) {
- lineNumber = this._samplingState.minimapLines[lineNumber - 1];
- }
- this._context.viewModel.revealRange(
- "mouse",
- false,
- new Range(lineNumber, 1, lineNumber, 1),
- 1,
- 0
- /* ScrollType.Smooth */
- );
- }
- setScrollTop(scrollTop) {
- this._context.viewModel.viewLayout.setScrollPosition(
- {
- scrollTop
- },
- 1
- /* ScrollType.Immediate */
- );
- }
- };
- InnerMinimap = class _InnerMinimap extends Disposable {
- constructor(theme, model) {
- super();
- this._renderDecorations = false;
- this._gestureInProgress = false;
- this._isMouseOverMinimap = false;
- this._theme = theme;
- this._model = model;
- this._lastRenderData = null;
- this._buffers = null;
- this._selectionColor = this._theme.getColor(minimapSelection);
- this._domNode = createFastDomNode(document.createElement("div"));
- PartFingerprints.write(
- this._domNode,
- 9
- /* PartFingerprint.Minimap */
- );
- this._domNode.setClassName(this._getMinimapDomNodeClassName());
- this._domNode.setPosition("absolute");
- this._domNode.setAttribute("role", "presentation");
- this._domNode.setAttribute("aria-hidden", "true");
- this._shadow = createFastDomNode(document.createElement("div"));
- this._shadow.setClassName("minimap-shadow-hidden");
- this._domNode.appendChild(this._shadow);
- this._canvas = createFastDomNode(document.createElement("canvas"));
- this._canvas.setPosition("absolute");
- this._canvas.setLeft(0);
- this._domNode.appendChild(this._canvas);
- this._decorationsCanvas = createFastDomNode(document.createElement("canvas"));
- this._decorationsCanvas.setPosition("absolute");
- this._decorationsCanvas.setClassName("minimap-decorations-layer");
- this._decorationsCanvas.setLeft(0);
- this._domNode.appendChild(this._decorationsCanvas);
- this._slider = createFastDomNode(document.createElement("div"));
- this._slider.setPosition("absolute");
- this._slider.setClassName("minimap-slider");
- this._slider.setLayerHinting(true);
- this._slider.setContain("strict");
- this._domNode.appendChild(this._slider);
- this._sliderHorizontal = createFastDomNode(document.createElement("div"));
- this._sliderHorizontal.setPosition("absolute");
- this._sliderHorizontal.setClassName("minimap-slider-horizontal");
- this._slider.appendChild(this._sliderHorizontal);
- this._applyLayout();
- this._hideDelayedScheduler = this._register(new RunOnceScheduler(() => this._hideImmediatelyIfMouseIsOutside(), 500));
- this._register(addStandardDisposableListener(this._domNode.domNode, EventType.MOUSE_OVER, () => {
- this._isMouseOverMinimap = true;
- }));
- this._register(addStandardDisposableListener(this._domNode.domNode, EventType.MOUSE_LEAVE, () => {
- this._isMouseOverMinimap = false;
- }));
- this._pointerDownListener = addStandardDisposableListener(this._domNode.domNode, EventType.POINTER_DOWN, (e) => {
- e.preventDefault();
- const isMouse = e.pointerType === "mouse";
- const isLeftClick = e.button === 0;
- const renderMinimap = this._model.options.renderMinimap;
- if (renderMinimap === 0) {
- return;
- }
- if (!this._lastRenderData) {
- return;
- }
- if (this._model.options.size !== "proportional") {
- if (isLeftClick && this._lastRenderData) {
- const position = getDomNodePagePosition(this._slider.domNode);
- const initialPosY = position.top + position.height / 2;
- this._startSliderDragging(e, initialPosY, this._lastRenderData.renderedLayout);
- }
- return;
- }
- if (isLeftClick || !isMouse) {
- const minimapLineHeight = this._model.options.minimapLineHeight;
- const internalOffsetY = this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight * e.offsetY;
- const lineIndex = Math.floor(internalOffsetY / minimapLineHeight);
- let lineNumber = lineIndex + this._lastRenderData.renderedLayout.startLineNumber - this._lastRenderData.renderedLayout.topPaddingLineCount;
- lineNumber = Math.min(lineNumber, this._model.getLineCount());
- this._model.revealLineNumber(lineNumber);
- }
- });
- this._sliderPointerMoveMonitor = new GlobalPointerMoveMonitor();
- this._sliderPointerDownListener = addStandardDisposableListener(this._slider.domNode, EventType.POINTER_DOWN, (e) => {
- e.preventDefault();
- e.stopPropagation();
- if (e.button === 0 && this._lastRenderData) {
- this._startSliderDragging(e, e.pageY, this._lastRenderData.renderedLayout);
- }
- });
- this._gestureDisposable = Gesture.addTarget(this._domNode.domNode);
- this._sliderTouchStartListener = addDisposableListener(this._domNode.domNode, EventType2.Start, (e) => {
- e.preventDefault();
- e.stopPropagation();
- if (this._lastRenderData) {
- this._slider.toggleClassName("active", true);
- this._gestureInProgress = true;
- this.scrollDueToTouchEvent(e);
- }
- }, { passive: false });
- this._sliderTouchMoveListener = addDisposableListener(this._domNode.domNode, EventType2.Change, (e) => {
- e.preventDefault();
- e.stopPropagation();
- if (this._lastRenderData && this._gestureInProgress) {
- this.scrollDueToTouchEvent(e);
- }
- }, { passive: false });
- this._sliderTouchEndListener = addStandardDisposableListener(this._domNode.domNode, EventType2.End, (e) => {
- e.preventDefault();
- e.stopPropagation();
- this._gestureInProgress = false;
- this._slider.toggleClassName("active", false);
- });
- }
- _hideSoon() {
- this._hideDelayedScheduler.cancel();
- this._hideDelayedScheduler.schedule();
- }
- _hideImmediatelyIfMouseIsOutside() {
- if (this._isMouseOverMinimap) {
- this._hideSoon();
- return;
- }
- this._domNode.toggleClassName("active", false);
- }
- _startSliderDragging(e, initialPosY, initialSliderState) {
- if (!e.target || !(e.target instanceof Element)) {
- return;
- }
- const initialPosX = e.pageX;
- this._slider.toggleClassName("active", true);
- const handlePointerMove = (posy, posx) => {
- const minimapPosition = getDomNodePagePosition(this._domNode.domNode);
- const pointerOrthogonalDelta = Math.min(Math.abs(posx - initialPosX), Math.abs(posx - minimapPosition.left), Math.abs(posx - minimapPosition.left - minimapPosition.width));
- if (isWindows && pointerOrthogonalDelta > POINTER_DRAG_RESET_DISTANCE2) {
- this._model.setScrollTop(initialSliderState.scrollTop);
- return;
- }
- const pointerDelta = posy - initialPosY;
- this._model.setScrollTop(initialSliderState.getDesiredScrollTopFromDelta(pointerDelta));
- };
- if (e.pageY !== initialPosY) {
- handlePointerMove(e.pageY, initialPosX);
- }
- this._sliderPointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (pointerMoveData) => handlePointerMove(pointerMoveData.pageY, pointerMoveData.pageX), () => {
- this._slider.toggleClassName("active", false);
- });
- }
- scrollDueToTouchEvent(touch) {
- const startY = this._domNode.domNode.getBoundingClientRect().top;
- const scrollTop = this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(touch.pageY - startY);
- this._model.setScrollTop(scrollTop);
- }
- dispose() {
- this._pointerDownListener.dispose();
- this._sliderPointerMoveMonitor.dispose();
- this._sliderPointerDownListener.dispose();
- this._gestureDisposable.dispose();
- this._sliderTouchStartListener.dispose();
- this._sliderTouchMoveListener.dispose();
- this._sliderTouchEndListener.dispose();
- super.dispose();
- }
- _getMinimapDomNodeClassName() {
- const class_ = ["minimap"];
- if (this._model.options.showSlider === "always") {
- class_.push("slider-always");
- } else {
- class_.push("slider-mouseover");
- }
- if (this._model.options.autohide === "mouseover") {
- class_.push("minimap-autohide-mouseover");
- } else if (this._model.options.autohide === "scroll") {
- class_.push("minimap-autohide-scroll");
- }
- return class_.join(" ");
- }
- getDomNode() {
- return this._domNode;
- }
- _applyLayout() {
- this._domNode.setLeft(this._model.options.minimapLeft);
- this._domNode.setWidth(this._model.options.minimapWidth);
- this._domNode.setHeight(this._model.options.minimapHeight);
- this._shadow.setHeight(this._model.options.minimapHeight);
- this._canvas.setWidth(this._model.options.canvasOuterWidth);
- this._canvas.setHeight(this._model.options.canvasOuterHeight);
- this._canvas.domNode.width = this._model.options.canvasInnerWidth;
- this._canvas.domNode.height = this._model.options.canvasInnerHeight;
- this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth);
- this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight);
- this._decorationsCanvas.domNode.width = this._model.options.canvasInnerWidth;
- this._decorationsCanvas.domNode.height = this._model.options.canvasInnerHeight;
- this._slider.setWidth(this._model.options.minimapWidth);
- }
- _getBuffer() {
- if (!this._buffers) {
- if (this._model.options.canvasInnerWidth > 0 && this._model.options.canvasInnerHeight > 0) {
- this._buffers = new MinimapBuffers(this._canvas.domNode.getContext("2d"), this._model.options.canvasInnerWidth, this._model.options.canvasInnerHeight, this._model.options.backgroundColor);
- }
- }
- return this._buffers ? this._buffers.getBuffer() : null;
- }
- // ---- begin view event handlers
- onDidChangeOptions() {
- this._lastRenderData = null;
- this._buffers = null;
- this._applyLayout();
- this._domNode.setClassName(this._getMinimapDomNodeClassName());
- }
- onSelectionChanged() {
- this._renderDecorations = true;
- return true;
- }
- onDecorationsChanged() {
- this._renderDecorations = true;
- return true;
- }
- onFlushed() {
- this._lastRenderData = null;
- return true;
- }
- onLinesChanged(changeFromLineNumber, changeCount) {
- if (this._lastRenderData) {
- return this._lastRenderData.onLinesChanged(changeFromLineNumber, changeCount);
- }
- return false;
- }
- onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) {
- this._lastRenderData?.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber);
- return true;
- }
- onLinesInserted(insertFromLineNumber, insertToLineNumber) {
- this._lastRenderData?.onLinesInserted(insertFromLineNumber, insertToLineNumber);
- return true;
- }
- onScrollChanged(e) {
- if (this._model.options.autohide === "scroll" && (e.scrollTopChanged || e.scrollHeightChanged)) {
- this._domNode.toggleClassName("active", true);
- this._hideSoon();
- }
- this._renderDecorations = true;
- return true;
- }
- onThemeChanged() {
- this._selectionColor = this._theme.getColor(minimapSelection);
- this._renderDecorations = true;
- return true;
- }
- onTokensChanged(ranges) {
- if (this._lastRenderData) {
- return this._lastRenderData.onTokensChanged(ranges);
- }
- return false;
- }
- onTokensColorsChanged() {
- this._lastRenderData = null;
- this._buffers = null;
- return true;
- }
- onZonesChanged() {
- this._lastRenderData = null;
- return true;
- }
- // --- end event handlers
- render(renderingCtx) {
- const renderMinimap = this._model.options.renderMinimap;
- if (renderMinimap === 0) {
- this._shadow.setClassName("minimap-shadow-hidden");
- this._sliderHorizontal.setWidth(0);
- this._sliderHorizontal.setHeight(0);
- return;
- }
- if (renderingCtx.scrollLeft + renderingCtx.viewportWidth >= renderingCtx.scrollWidth) {
- this._shadow.setClassName("minimap-shadow-hidden");
- } else {
- this._shadow.setClassName("minimap-shadow-visible");
- }
- const layout2 = MinimapLayout.create(this._model.options, renderingCtx.viewportStartLineNumber, renderingCtx.viewportEndLineNumber, renderingCtx.viewportStartLineNumberVerticalOffset, renderingCtx.viewportHeight, renderingCtx.viewportContainsWhitespaceGaps, this._model.getLineCount(), this._model.getRealLineCount(), renderingCtx.scrollTop, renderingCtx.scrollHeight, this._lastRenderData ? this._lastRenderData.renderedLayout : null);
- this._slider.setDisplay(layout2.sliderNeeded ? "block" : "none");
- this._slider.setTop(layout2.sliderTop);
- this._slider.setHeight(layout2.sliderHeight);
- this._sliderHorizontal.setLeft(0);
- this._sliderHorizontal.setWidth(this._model.options.minimapWidth);
- this._sliderHorizontal.setTop(0);
- this._sliderHorizontal.setHeight(layout2.sliderHeight);
- this.renderDecorations(layout2);
- this._lastRenderData = this.renderLines(layout2);
- }
- renderDecorations(layout2) {
- if (this._renderDecorations) {
- this._renderDecorations = false;
- const selections = this._model.getSelections();
- selections.sort(Range.compareRangesUsingStarts);
- const decorations = this._model.getMinimapDecorationsInViewport(layout2.startLineNumber, layout2.endLineNumber);
- decorations.sort((a, b) => (a.options.zIndex || 0) - (b.options.zIndex || 0));
- const { canvasInnerWidth, canvasInnerHeight } = this._model.options;
- const minimapLineHeight = this._model.options.minimapLineHeight;
- const minimapCharWidth = this._model.options.minimapCharWidth;
- const tabSize = this._model.getOptions().tabSize;
- const canvasContext = this._decorationsCanvas.domNode.getContext("2d");
- canvasContext.clearRect(0, 0, canvasInnerWidth, canvasInnerHeight);
- const highlightedLines = new ContiguousLineMap(layout2.startLineNumber, layout2.endLineNumber, false);
- this._renderSelectionLineHighlights(canvasContext, selections, highlightedLines, layout2, minimapLineHeight);
- this._renderDecorationsLineHighlights(canvasContext, decorations, highlightedLines, layout2, minimapLineHeight);
- const lineOffsetMap = new ContiguousLineMap(layout2.startLineNumber, layout2.endLineNumber, null);
- this._renderSelectionsHighlights(canvasContext, selections, lineOffsetMap, layout2, minimapLineHeight, tabSize, minimapCharWidth, canvasInnerWidth);
- this._renderDecorationsHighlights(canvasContext, decorations, lineOffsetMap, layout2, minimapLineHeight, tabSize, minimapCharWidth, canvasInnerWidth);
- this._renderSectionHeaders(layout2);
- }
- }
- _renderSelectionLineHighlights(canvasContext, selections, highlightedLines, layout2, minimapLineHeight) {
- if (!this._selectionColor || this._selectionColor.isTransparent()) {
- return;
- }
- canvasContext.fillStyle = this._selectionColor.transparent(0.5).toString();
- let y1 = 0;
- let y2 = 0;
- for (const selection of selections) {
- const intersection2 = layout2.intersectWithViewport(selection);
- if (!intersection2) {
- continue;
- }
- const [startLineNumber, endLineNumber] = intersection2;
- for (let line = startLineNumber; line <= endLineNumber; line++) {
- highlightedLines.set(line, true);
- }
- const yy1 = layout2.getYForLineNumber(startLineNumber, minimapLineHeight);
- const yy2 = layout2.getYForLineNumber(endLineNumber, minimapLineHeight);
- if (y2 >= yy1) {
- y2 = yy2;
- } else {
- if (y2 > y1) {
- canvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);
- }
- y1 = yy1;
- y2 = yy2;
- }
- }
- if (y2 > y1) {
- canvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);
- }
- }
- _renderDecorationsLineHighlights(canvasContext, decorations, highlightedLines, layout2, minimapLineHeight) {
- const highlightColors = /* @__PURE__ */ new Map();
- for (let i2 = decorations.length - 1; i2 >= 0; i2--) {
- const decoration3 = decorations[i2];
- const minimapOptions = decoration3.options.minimap;
- if (!minimapOptions || minimapOptions.position !== 1) {
- continue;
- }
- const intersection2 = layout2.intersectWithViewport(decoration3.range);
- if (!intersection2) {
- continue;
- }
- const [startLineNumber, endLineNumber] = intersection2;
- const decorationColor = minimapOptions.getColor(this._theme.value);
- if (!decorationColor || decorationColor.isTransparent()) {
- continue;
- }
- let highlightColor = highlightColors.get(decorationColor.toString());
- if (!highlightColor) {
- highlightColor = decorationColor.transparent(0.5).toString();
- highlightColors.set(decorationColor.toString(), highlightColor);
- }
- canvasContext.fillStyle = highlightColor;
- for (let line = startLineNumber; line <= endLineNumber; line++) {
- if (highlightedLines.has(line)) {
- continue;
- }
- highlightedLines.set(line, true);
- const y = layout2.getYForLineNumber(startLineNumber, minimapLineHeight);
- canvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y, canvasContext.canvas.width, minimapLineHeight);
- }
- }
- }
- _renderSelectionsHighlights(canvasContext, selections, lineOffsetMap, layout2, lineHeight, tabSize, characterWidth, canvasInnerWidth) {
- if (!this._selectionColor || this._selectionColor.isTransparent()) {
- return;
- }
- for (const selection of selections) {
- const intersection2 = layout2.intersectWithViewport(selection);
- if (!intersection2) {
- continue;
- }
- const [startLineNumber, endLineNumber] = intersection2;
- for (let line = startLineNumber; line <= endLineNumber; line++) {
- this.renderDecorationOnLine(canvasContext, lineOffsetMap, selection, this._selectionColor, layout2, line, lineHeight, lineHeight, tabSize, characterWidth, canvasInnerWidth);
- }
- }
- }
- _renderDecorationsHighlights(canvasContext, decorations, lineOffsetMap, layout2, minimapLineHeight, tabSize, characterWidth, canvasInnerWidth) {
- for (const decoration3 of decorations) {
- const minimapOptions = decoration3.options.minimap;
- if (!minimapOptions) {
- continue;
- }
- const intersection2 = layout2.intersectWithViewport(decoration3.range);
- if (!intersection2) {
- continue;
- }
- const [startLineNumber, endLineNumber] = intersection2;
- const decorationColor = minimapOptions.getColor(this._theme.value);
- if (!decorationColor || decorationColor.isTransparent()) {
- continue;
- }
- for (let line = startLineNumber; line <= endLineNumber; line++) {
- switch (minimapOptions.position) {
- case 1:
- this.renderDecorationOnLine(canvasContext, lineOffsetMap, decoration3.range, decorationColor, layout2, line, minimapLineHeight, minimapLineHeight, tabSize, characterWidth, canvasInnerWidth);
- continue;
- case 2: {
- const y = layout2.getYForLineNumber(line, minimapLineHeight);
- const x = 2;
- this.renderDecoration(canvasContext, decorationColor, x, y, GUTTER_DECORATION_WIDTH, minimapLineHeight);
- continue;
- }
- }
- }
- }
- }
- renderDecorationOnLine(canvasContext, lineOffsetMap, decorationRange, decorationColor, layout2, lineNumber, height, minimapLineHeight, tabSize, charWidth, canvasInnerWidth) {
- const y = layout2.getYForLineNumber(lineNumber, minimapLineHeight);
- if (y + height < 0 || y > this._model.options.canvasInnerHeight) {
- return;
- }
- const { startLineNumber, endLineNumber } = decorationRange;
- const startColumn = startLineNumber === lineNumber ? decorationRange.startColumn : 1;
- const endColumn = endLineNumber === lineNumber ? decorationRange.endColumn : this._model.getLineMaxColumn(lineNumber);
- const x1 = this.getXOffsetForPosition(lineOffsetMap, lineNumber, startColumn, tabSize, charWidth, canvasInnerWidth);
- const x2 = this.getXOffsetForPosition(lineOffsetMap, lineNumber, endColumn, tabSize, charWidth, canvasInnerWidth);
- this.renderDecoration(canvasContext, decorationColor, x1, y, x2 - x1, height);
- }
- getXOffsetForPosition(lineOffsetMap, lineNumber, column, tabSize, charWidth, canvasInnerWidth) {
- if (column === 1) {
- return MINIMAP_GUTTER_WIDTH;
- }
- const minimumXOffset = (column - 1) * charWidth;
- if (minimumXOffset >= canvasInnerWidth) {
- return canvasInnerWidth;
- }
- let lineIndexToXOffset = lineOffsetMap.get(lineNumber);
- if (!lineIndexToXOffset) {
- const lineData = this._model.getLineContent(lineNumber);
- lineIndexToXOffset = [MINIMAP_GUTTER_WIDTH];
- let prevx = MINIMAP_GUTTER_WIDTH;
- for (let i2 = 1; i2 < lineData.length + 1; i2++) {
- const charCode = lineData.charCodeAt(i2 - 1);
- const dx = charCode === 9 ? tabSize * charWidth : isFullWidthCharacter(charCode) ? 2 * charWidth : charWidth;
- const x = prevx + dx;
- if (x >= canvasInnerWidth) {
- lineIndexToXOffset[i2] = canvasInnerWidth;
- break;
- }
- lineIndexToXOffset[i2] = x;
- prevx = x;
- }
- lineOffsetMap.set(lineNumber, lineIndexToXOffset);
- }
- if (column - 1 < lineIndexToXOffset.length) {
- return lineIndexToXOffset[column - 1];
- }
- return canvasInnerWidth;
- }
- renderDecoration(canvasContext, decorationColor, x, y, width2, height) {
- canvasContext.fillStyle = decorationColor && decorationColor.toString() || "";
- canvasContext.fillRect(x, y, width2, height);
- }
- _renderSectionHeaders(layout2) {
- const minimapLineHeight = this._model.options.minimapLineHeight;
- const sectionHeaderFontSize = this._model.options.sectionHeaderFontSize;
- const sectionHeaderLetterSpacing = this._model.options.sectionHeaderLetterSpacing;
- const backgroundFillHeight = sectionHeaderFontSize * 1.5;
- const { canvasInnerWidth } = this._model.options;
- const backgroundColor = this._model.options.backgroundColor;
- const backgroundFill = `rgb(${backgroundColor.r} ${backgroundColor.g} ${backgroundColor.b} / .7)`;
- const foregroundColor = this._model.options.sectionHeaderFontColor;
- const foregroundFill = `rgb(${foregroundColor.r} ${foregroundColor.g} ${foregroundColor.b})`;
- const separatorStroke = foregroundFill;
- const canvasContext = this._decorationsCanvas.domNode.getContext("2d");
- canvasContext.letterSpacing = sectionHeaderLetterSpacing + "px";
- canvasContext.font = "500 " + sectionHeaderFontSize + "px " + this._model.options.sectionHeaderFontFamily;
- canvasContext.strokeStyle = separatorStroke;
- canvasContext.lineWidth = 0.4;
- const decorations = this._model.getSectionHeaderDecorationsInViewport(layout2.startLineNumber, layout2.endLineNumber);
- decorations.sort((a, b) => a.range.startLineNumber - b.range.startLineNumber);
- const fitWidth = _InnerMinimap._fitSectionHeader.bind(null, canvasContext, canvasInnerWidth - MINIMAP_GUTTER_WIDTH);
- for (const decoration3 of decorations) {
- const y = layout2.getYForLineNumber(decoration3.range.startLineNumber, minimapLineHeight) + sectionHeaderFontSize;
- const backgroundFillY = y - sectionHeaderFontSize;
- const separatorY = backgroundFillY + 2;
- const headerText = this._model.getSectionHeaderText(decoration3, fitWidth);
- _InnerMinimap._renderSectionLabel(canvasContext, headerText, decoration3.options.minimap?.sectionHeaderStyle === 2, backgroundFill, foregroundFill, canvasInnerWidth, backgroundFillY, backgroundFillHeight, y, separatorY);
- }
- }
- static _fitSectionHeader(target, maxWidth, headerText) {
- if (!headerText) {
- return headerText;
- }
- const ellipsis = "\u2026";
- const width2 = target.measureText(headerText).width;
- const ellipsisWidth = target.measureText(ellipsis).width;
- if (width2 <= maxWidth || width2 <= ellipsisWidth) {
- return headerText;
- }
- const len = headerText.length;
- const averageCharWidth = width2 / headerText.length;
- const maxCharCount = Math.floor((maxWidth - ellipsisWidth) / averageCharWidth) - 1;
- let halfCharCount = Math.ceil(maxCharCount / 2);
- while (halfCharCount > 0 && /\s/.test(headerText[halfCharCount - 1])) {
- --halfCharCount;
- }
- return headerText.substring(0, halfCharCount) + ellipsis + headerText.substring(len - (maxCharCount - halfCharCount));
- }
- static _renderSectionLabel(target, headerText, hasSeparatorLine, backgroundFill, foregroundFill, minimapWidth, backgroundFillY, backgroundFillHeight, textY, separatorY) {
- if (headerText) {
- target.fillStyle = backgroundFill;
- target.fillRect(0, backgroundFillY, minimapWidth, backgroundFillHeight);
- target.fillStyle = foregroundFill;
- target.fillText(headerText, MINIMAP_GUTTER_WIDTH, textY);
- }
- if (hasSeparatorLine) {
- target.beginPath();
- target.moveTo(0, separatorY);
- target.lineTo(minimapWidth, separatorY);
- target.closePath();
- target.stroke();
- }
- }
- renderLines(layout2) {
- const startLineNumber = layout2.startLineNumber;
- const endLineNumber = layout2.endLineNumber;
- const minimapLineHeight = this._model.options.minimapLineHeight;
- if (this._lastRenderData && this._lastRenderData.linesEquals(layout2)) {
- const _lastData = this._lastRenderData._get();
- return new RenderData(layout2, _lastData.imageData, _lastData.lines);
- }
- const imageData = this._getBuffer();
- if (!imageData) {
- return null;
- }
- const [_dirtyY1, _dirtyY2, needed] = _InnerMinimap._renderUntouchedLines(imageData, layout2.topPaddingLineCount, startLineNumber, endLineNumber, minimapLineHeight, this._lastRenderData);
- const lineInfo = this._model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed);
- const tabSize = this._model.getOptions().tabSize;
- const defaultBackground = this._model.options.defaultBackgroundColor;
- const background = this._model.options.backgroundColor;
- const foregroundAlpha = this._model.options.foregroundAlpha;
- const tokensColorTracker = this._model.tokensColorTracker;
- const useLighterFont = tokensColorTracker.backgroundIsLight();
- const renderMinimap = this._model.options.renderMinimap;
- const charRenderer = this._model.options.charRenderer();
- const fontScale = this._model.options.fontScale;
- const minimapCharWidth = this._model.options.minimapCharWidth;
- const baseCharHeight = renderMinimap === 1 ? 2 : 2 + 1;
- const renderMinimapLineHeight = baseCharHeight * fontScale;
- const innerLinePadding = minimapLineHeight > renderMinimapLineHeight ? Math.floor((minimapLineHeight - renderMinimapLineHeight) / 2) : 0;
- const backgroundA = background.a / 255;
- const renderBackground = new RGBA8(Math.round((background.r - defaultBackground.r) * backgroundA + defaultBackground.r), Math.round((background.g - defaultBackground.g) * backgroundA + defaultBackground.g), Math.round((background.b - defaultBackground.b) * backgroundA + defaultBackground.b), 255);
- let dy = layout2.topPaddingLineCount * minimapLineHeight;
- const renderedLines = [];
- for (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) {
- if (needed[lineIndex]) {
- _InnerMinimap._renderLine(imageData, renderBackground, background.a, useLighterFont, renderMinimap, minimapCharWidth, tokensColorTracker, foregroundAlpha, charRenderer, dy, innerLinePadding, tabSize, lineInfo[lineIndex], fontScale, minimapLineHeight);
- }
- renderedLines[lineIndex] = new MinimapLine(dy);
- dy += minimapLineHeight;
- }
- const dirtyY1 = _dirtyY1 === -1 ? 0 : _dirtyY1;
- const dirtyY2 = _dirtyY2 === -1 ? imageData.height : _dirtyY2;
- const dirtyHeight = dirtyY2 - dirtyY1;
- const ctx = this._canvas.domNode.getContext("2d");
- ctx.putImageData(imageData, 0, 0, 0, dirtyY1, imageData.width, dirtyHeight);
- return new RenderData(layout2, imageData, renderedLines);
- }
- static _renderUntouchedLines(target, topPaddingLineCount, startLineNumber, endLineNumber, minimapLineHeight, lastRenderData) {
- const needed = [];
- if (!lastRenderData) {
- for (let i2 = 0, len = endLineNumber - startLineNumber + 1; i2 < len; i2++) {
- needed[i2] = true;
- }
- return [-1, -1, needed];
- }
- const _lastData = lastRenderData._get();
- const lastTargetData = _lastData.imageData.data;
- const lastStartLineNumber = _lastData.rendLineNumberStart;
- const lastLines = _lastData.lines;
- const lastLinesLength = lastLines.length;
- const WIDTH = target.width;
- const targetData = target.data;
- const maxDestPixel = (endLineNumber - startLineNumber + 1) * minimapLineHeight * WIDTH * 4;
- let dirtyPixel1 = -1;
- let dirtyPixel2 = -1;
- let copySourceStart = -1;
- let copySourceEnd = -1;
- let copyDestStart = -1;
- let copyDestEnd = -1;
- let dest_dy = topPaddingLineCount * minimapLineHeight;
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
- const lineIndex = lineNumber - startLineNumber;
- const lastLineIndex = lineNumber - lastStartLineNumber;
- const source_dy = lastLineIndex >= 0 && lastLineIndex < lastLinesLength ? lastLines[lastLineIndex].dy : -1;
- if (source_dy === -1) {
- needed[lineIndex] = true;
- dest_dy += minimapLineHeight;
- continue;
- }
- const sourceStart = source_dy * WIDTH * 4;
- const sourceEnd = (source_dy + minimapLineHeight) * WIDTH * 4;
- const destStart = dest_dy * WIDTH * 4;
- const destEnd = (dest_dy + minimapLineHeight) * WIDTH * 4;
- if (copySourceEnd === sourceStart && copyDestEnd === destStart) {
- copySourceEnd = sourceEnd;
- copyDestEnd = destEnd;
- } else {
- if (copySourceStart !== -1) {
- targetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart);
- if (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) {
- dirtyPixel1 = copySourceEnd;
- }
- if (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) {
- dirtyPixel2 = copySourceStart;
- }
- }
- copySourceStart = sourceStart;
- copySourceEnd = sourceEnd;
- copyDestStart = destStart;
- copyDestEnd = destEnd;
- }
- needed[lineIndex] = false;
- dest_dy += minimapLineHeight;
- }
- if (copySourceStart !== -1) {
- targetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart);
- if (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) {
- dirtyPixel1 = copySourceEnd;
- }
- if (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) {
- dirtyPixel2 = copySourceStart;
- }
- }
- const dirtyY1 = dirtyPixel1 === -1 ? -1 : dirtyPixel1 / (WIDTH * 4);
- const dirtyY2 = dirtyPixel2 === -1 ? -1 : dirtyPixel2 / (WIDTH * 4);
- return [dirtyY1, dirtyY2, needed];
- }
- static _renderLine(target, backgroundColor, backgroundAlpha, useLighterFont, renderMinimap, charWidth, colorTracker, foregroundAlpha, minimapCharRenderer, dy, innerLinePadding, tabSize, lineData, fontScale, minimapLineHeight) {
- const content = lineData.content;
- const tokens = lineData.tokens;
- const maxDx = target.width - charWidth;
- const force1pxHeight = minimapLineHeight === 1;
- let dx = MINIMAP_GUTTER_WIDTH;
- let charIndex = 0;
- let tabsCharDelta = 0;
- for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {
- const tokenEndIndex = tokens.getEndOffset(tokenIndex);
- const tokenColorId = tokens.getForeground(tokenIndex);
- const tokenColor = colorTracker.getColor(tokenColorId);
- for (; charIndex < tokenEndIndex; charIndex++) {
- if (dx > maxDx) {
- return;
- }
- const charCode = content.charCodeAt(charIndex);
- if (charCode === 9) {
- const insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;
- tabsCharDelta += insertSpacesCount - 1;
- dx += insertSpacesCount * charWidth;
- } else if (charCode === 32) {
- dx += charWidth;
- } else {
- const count = isFullWidthCharacter(charCode) ? 2 : 1;
- for (let i2 = 0; i2 < count; i2++) {
- if (renderMinimap === 2) {
- minimapCharRenderer.blockRenderChar(target, dx, dy + innerLinePadding, tokenColor, foregroundAlpha, backgroundColor, backgroundAlpha, force1pxHeight);
- } else {
- minimapCharRenderer.renderChar(target, dx, dy + innerLinePadding, charCode, tokenColor, foregroundAlpha, backgroundColor, backgroundAlpha, fontScale, useLighterFont, force1pxHeight);
- }
- dx += charWidth;
- if (dx > maxDx) {
- return;
- }
- }
- }
- }
- }
- }
- };
- ContiguousLineMap = class {
- constructor(startLineNumber, endLineNumber, defaultValue) {
- this._startLineNumber = startLineNumber;
- this._endLineNumber = endLineNumber;
- this._defaultValue = defaultValue;
- this._values = [];
- for (let i2 = 0, count = this._endLineNumber - this._startLineNumber + 1; i2 < count; i2++) {
- this._values[i2] = defaultValue;
- }
- }
- has(lineNumber) {
- return this.get(lineNumber) !== this._defaultValue;
- }
- set(lineNumber, value) {
- if (lineNumber < this._startLineNumber || lineNumber > this._endLineNumber) {
- return;
- }
- this._values[lineNumber - this._startLineNumber] = value;
- }
- get(lineNumber) {
- if (lineNumber < this._startLineNumber || lineNumber > this._endLineNumber) {
- return this._defaultValue;
- }
- return this._values[lineNumber - this._startLineNumber];
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css
-var init_overlayWidgets = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js
-var ViewOverlayWidgets;
-var init_overlayWidgets2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js"() {
- init_overlayWidgets();
- init_fastDomNode();
- init_viewPart();
- init_dom();
- ViewOverlayWidgets = class extends ViewPart {
- constructor(context, viewDomNode) {
- super(context);
- this._viewDomNode = viewDomNode;
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._widgets = {};
- this._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth;
- this._minimapWidth = layoutInfo.minimap.minimapWidth;
- this._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;
- this._editorHeight = layoutInfo.height;
- this._editorWidth = layoutInfo.width;
- this._viewDomNodeRect = { top: 0, left: 0, width: 0, height: 0 };
- this._domNode = createFastDomNode(document.createElement("div"));
- PartFingerprints.write(
- this._domNode,
- 4
- /* PartFingerprint.OverlayWidgets */
- );
- this._domNode.setClassName("overlayWidgets");
- this.overflowingOverlayWidgetsDomNode = createFastDomNode(document.createElement("div"));
- PartFingerprints.write(
- this.overflowingOverlayWidgetsDomNode,
- 5
- /* PartFingerprint.OverflowingOverlayWidgets */
- );
- this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets");
- }
- dispose() {
- super.dispose();
- this._widgets = {};
- }
- getDomNode() {
- return this._domNode;
- }
- // ---- begin view event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth;
- this._minimapWidth = layoutInfo.minimap.minimapWidth;
- this._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight;
- this._editorHeight = layoutInfo.height;
- this._editorWidth = layoutInfo.width;
- return true;
- }
- // ---- end view event handlers
- _widgetCanOverflow(widget) {
- const options = this._context.configuration.options;
- const allowOverflow = options.get(
- 4
- /* EditorOption.allowOverflow */
- );
- return (widget.allowEditorOverflow || false) && allowOverflow;
- }
- addWidget(widget) {
- const domNode = createFastDomNode(widget.getDomNode());
- this._widgets[widget.getId()] = {
- widget,
- preference: null,
- domNode
- };
- domNode.setPosition("absolute");
- domNode.setAttribute("widgetId", widget.getId());
- if (this._widgetCanOverflow(widget)) {
- this.overflowingOverlayWidgetsDomNode.appendChild(domNode);
- } else {
- this._domNode.appendChild(domNode);
- }
- this.setShouldRender();
- this._updateMaxMinWidth();
- }
- setWidgetPosition(widget, position) {
- const widgetData = this._widgets[widget.getId()];
- const preference = position ? position.preference : null;
- const stack = position?.stackOridinal;
- if (widgetData.preference === preference && widgetData.stack === stack) {
- this._updateMaxMinWidth();
- return false;
- }
- widgetData.preference = preference;
- widgetData.stack = stack;
- this.setShouldRender();
- this._updateMaxMinWidth();
- return true;
- }
- removeWidget(widget) {
- const widgetId = widget.getId();
- if (this._widgets.hasOwnProperty(widgetId)) {
- const widgetData = this._widgets[widgetId];
- const domNode = widgetData.domNode.domNode;
- delete this._widgets[widgetId];
- domNode.remove();
- this.setShouldRender();
- this._updateMaxMinWidth();
- }
- }
- _updateMaxMinWidth() {
- let maxMinWidth = 0;
- const keys = Object.keys(this._widgets);
- for (let i2 = 0, len = keys.length; i2 < len; i2++) {
- const widgetId = keys[i2];
- const widget = this._widgets[widgetId];
- const widgetMinWidthInPx = widget.widget.getMinContentWidthInPx?.();
- if (typeof widgetMinWidthInPx !== "undefined") {
- maxMinWidth = Math.max(maxMinWidth, widgetMinWidthInPx);
- }
- }
- this._context.viewLayout.setOverlayWidgetsMinWidth(maxMinWidth);
- }
- _renderWidget(widgetData, stackCoordinates) {
- const domNode = widgetData.domNode;
- if (widgetData.preference === null) {
- domNode.setTop("");
- return;
- }
- const maxRight = 2 * this._verticalScrollbarWidth + this._minimapWidth;
- if (widgetData.preference === 0 || widgetData.preference === 1) {
- if (widgetData.preference === 1) {
- const widgetHeight = domNode.domNode.clientHeight;
- domNode.setTop(this._editorHeight - widgetHeight - 2 * this._horizontalScrollbarHeight);
- } else {
- domNode.setTop(0);
- }
- if (widgetData.stack !== void 0) {
- domNode.setTop(stackCoordinates[widgetData.preference]);
- stackCoordinates[widgetData.preference] += domNode.domNode.clientWidth;
- } else {
- domNode.setRight(maxRight);
- }
- } else if (widgetData.preference === 2) {
- domNode.domNode.style.right = "50%";
- if (widgetData.stack !== void 0) {
- domNode.setTop(stackCoordinates[
- 2
- /* OverlayWidgetPositionPreference.TOP_CENTER */
- ]);
- stackCoordinates[
- 2
- /* OverlayWidgetPositionPreference.TOP_CENTER */
- ] += domNode.domNode.clientHeight;
- } else {
- domNode.setTop(0);
- }
- } else {
- const { top, left } = widgetData.preference;
- const fixedOverflowWidgets = this._context.configuration.options.get(
- 51
- /* EditorOption.fixedOverflowWidgets */
- );
- if (fixedOverflowWidgets && this._widgetCanOverflow(widgetData.widget)) {
- const editorBoundingBox = this._viewDomNodeRect;
- domNode.setTop(top + editorBoundingBox.top);
- domNode.setLeft(left + editorBoundingBox.left);
- domNode.setPosition("fixed");
- } else {
- domNode.setTop(top);
- domNode.setLeft(left);
- domNode.setPosition("absolute");
- }
- }
- }
- prepareRender(ctx) {
- this._viewDomNodeRect = getDomNodePagePosition(this._viewDomNode.domNode);
- }
- render(ctx) {
- this._domNode.setWidth(this._editorWidth);
- const keys = Object.keys(this._widgets);
- const stackCoordinates = Array.from({ length: 2 + 1 }, () => 0);
- keys.sort((a, b) => (this._widgets[a].stack || 0) - (this._widgets[b].stack || 0));
- for (let i2 = 0, len = keys.length; i2 < len; i2++) {
- const widgetId = keys[i2];
- this._renderWidget(this._widgets[widgetId], stackCoordinates);
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewModel.js
-var Viewport, MinimapLinesRenderingData, ViewLineData, ViewLineRenderingData, OverviewRulerDecorationsGroup;
-var init_viewModel = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewModel.js"() {
- init_arrays();
- init_strings();
- Viewport = class {
- constructor(top, left, width2, height) {
- this._viewportBrand = void 0;
- this.top = top | 0;
- this.left = left | 0;
- this.width = width2 | 0;
- this.height = height | 0;
- }
- };
- MinimapLinesRenderingData = class {
- constructor(tabSize, data) {
- this.tabSize = tabSize;
- this.data = data;
- }
- };
- ViewLineData = class {
- constructor(content, continuesWithWrappedLine, minColumn, maxColumn, startVisibleColumn, tokens, inlineDecorations) {
- this._viewLineDataBrand = void 0;
- this.content = content;
- this.continuesWithWrappedLine = continuesWithWrappedLine;
- this.minColumn = minColumn;
- this.maxColumn = maxColumn;
- this.startVisibleColumn = startVisibleColumn;
- this.tokens = tokens;
- this.inlineDecorations = inlineDecorations;
- }
- };
- ViewLineRenderingData = class _ViewLineRenderingData {
- constructor(minColumn, maxColumn, content, continuesWithWrappedLine, mightContainRTL, mightContainNonBasicASCII, tokens, inlineDecorations, tabSize, startVisibleColumn, textDirection, hasVariableFonts) {
- this.minColumn = minColumn;
- this.maxColumn = maxColumn;
- this.content = content;
- this.continuesWithWrappedLine = continuesWithWrappedLine;
- this.isBasicASCII = _ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);
- this.containsRTL = _ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);
- this.tokens = tokens;
- this.inlineDecorations = inlineDecorations;
- this.tabSize = tabSize;
- this.startVisibleColumn = startVisibleColumn;
- this.textDirection = textDirection;
- this.hasVariableFonts = hasVariableFonts;
- }
- static isBasicASCII(lineContent, mightContainNonBasicASCII) {
- if (mightContainNonBasicASCII) {
- return isBasicASCII(lineContent);
- }
- return true;
- }
- static containsRTL(lineContent, isBasicASCII2, mightContainRTL) {
- if (!isBasicASCII2 && mightContainRTL) {
- return containsRTL(lineContent);
- }
- return false;
- }
- };
- OverviewRulerDecorationsGroup = class _OverviewRulerDecorationsGroup {
- constructor(color, zIndex, data) {
- this.color = color;
- this.zIndex = zIndex;
- this.data = data;
- }
- static compareByRenderingProps(a, b) {
- if (a.zIndex === b.zIndex) {
- if (a.color < b.color) {
- return -1;
- }
- if (a.color > b.color) {
- return 1;
- }
- return 0;
- }
- return a.zIndex - b.zIndex;
- }
- static equals(a, b) {
- return a.color === b.color && a.zIndex === b.zIndex && equals(a.data, b.data);
- }
- static equalsArr(a, b) {
- return equals(a, b, _OverviewRulerDecorationsGroup.equals);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js
-var Settings, DecorationsOverviewRuler;
-var init_decorationsOverviewRuler = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js"() {
- init_fastDomNode();
- init_color();
- init_viewPart();
- init_position();
- init_languages();
- init_editorColorRegistry();
- init_viewModel();
- init_arrays();
- Settings = class {
- constructor(config, theme) {
- const options = config.options;
- this.lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this.pixelRatio = options.get(
- 163
- /* EditorOption.pixelRatio */
- );
- this.overviewRulerLanes = options.get(
- 95
- /* EditorOption.overviewRulerLanes */
- );
- this.renderBorder = options.get(
- 94
- /* EditorOption.overviewRulerBorder */
- );
- const borderColor = theme.getColor(editorOverviewRulerBorder);
- this.borderColor = borderColor ? borderColor.toString() : null;
- this.hideCursor = options.get(
- 68
- /* EditorOption.hideCursorInOverviewRuler */
- );
- const cursorColorSingle = theme.getColor(editorCursorForeground);
- this.cursorColorSingle = cursorColorSingle ? cursorColorSingle.transparent(0.7).toString() : null;
- const cursorColorPrimary = theme.getColor(editorMultiCursorPrimaryForeground);
- this.cursorColorPrimary = cursorColorPrimary ? cursorColorPrimary.transparent(0.7).toString() : null;
- const cursorColorSecondary = theme.getColor(editorMultiCursorSecondaryForeground);
- this.cursorColorSecondary = cursorColorSecondary ? cursorColorSecondary.transparent(0.7).toString() : null;
- this.themeType = theme.type;
- const minimapOpts = options.get(
- 81
- /* EditorOption.minimap */
- );
- const minimapEnabled = minimapOpts.enabled;
- const minimapSide = minimapOpts.side;
- const themeColor = theme.getColor(editorOverviewRulerBackground);
- const defaultBackground = TokenizationRegistry2.getDefaultBackground();
- if (themeColor) {
- this.backgroundColor = themeColor;
- } else if (minimapEnabled && minimapSide === "right") {
- this.backgroundColor = defaultBackground;
- } else {
- this.backgroundColor = null;
- }
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- const position = layoutInfo.overviewRuler;
- this.top = position.top;
- this.right = position.right;
- this.domWidth = position.width;
- this.domHeight = position.height;
- if (this.overviewRulerLanes === 0) {
- this.canvasWidth = 0;
- this.canvasHeight = 0;
- } else {
- this.canvasWidth = this.domWidth * this.pixelRatio | 0;
- this.canvasHeight = this.domHeight * this.pixelRatio | 0;
- }
- const [x, w] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes);
- this.x = x;
- this.w = w;
- }
- _initLanes(canvasLeftOffset, canvasWidth, laneCount) {
- const remainingWidth = canvasWidth - canvasLeftOffset;
- if (laneCount >= 3) {
- const leftWidth = Math.floor(remainingWidth / 3);
- const rightWidth = Math.floor(remainingWidth / 3);
- const centerWidth = remainingWidth - leftWidth - rightWidth;
- const leftOffset = canvasLeftOffset;
- const centerOffset = leftOffset + leftWidth;
- const rightOffset = leftOffset + leftWidth + centerWidth;
- return [
- [
- 0,
- leftOffset,
- // Left
- centerOffset,
- // Center
- leftOffset,
- // Left | Center
- rightOffset,
- // Right
- leftOffset,
- // Left | Right
- centerOffset,
- // Center | Right
- leftOffset
- // Left | Center | Right
- ],
- [
- 0,
- leftWidth,
- // Left
- centerWidth,
- // Center
- leftWidth + centerWidth,
- // Left | Center
- rightWidth,
- // Right
- leftWidth + centerWidth + rightWidth,
- // Left | Right
- centerWidth + rightWidth,
- // Center | Right
- leftWidth + centerWidth + rightWidth
- // Left | Center | Right
- ]
- ];
- } else if (laneCount === 2) {
- const leftWidth = Math.floor(remainingWidth / 2);
- const rightWidth = remainingWidth - leftWidth;
- const leftOffset = canvasLeftOffset;
- const rightOffset = leftOffset + leftWidth;
- return [
- [
- 0,
- leftOffset,
- // Left
- leftOffset,
- // Center
- leftOffset,
- // Left | Center
- rightOffset,
- // Right
- leftOffset,
- // Left | Right
- leftOffset,
- // Center | Right
- leftOffset
- // Left | Center | Right
- ],
- [
- 0,
- leftWidth,
- // Left
- leftWidth,
- // Center
- leftWidth,
- // Left | Center
- rightWidth,
- // Right
- leftWidth + rightWidth,
- // Left | Right
- leftWidth + rightWidth,
- // Center | Right
- leftWidth + rightWidth
- // Left | Center | Right
- ]
- ];
- } else {
- const offset = canvasLeftOffset;
- const width2 = remainingWidth;
- return [
- [
- 0,
- offset,
- // Left
- offset,
- // Center
- offset,
- // Left | Center
- offset,
- // Right
- offset,
- // Left | Right
- offset,
- // Center | Right
- offset
- // Left | Center | Right
- ],
- [
- 0,
- width2,
- // Left
- width2,
- // Center
- width2,
- // Left | Center
- width2,
- // Right
- width2,
- // Left | Right
- width2,
- // Center | Right
- width2
- // Left | Center | Right
- ]
- ];
- }
- }
- equals(other) {
- return this.lineHeight === other.lineHeight && this.pixelRatio === other.pixelRatio && this.overviewRulerLanes === other.overviewRulerLanes && this.renderBorder === other.renderBorder && this.borderColor === other.borderColor && this.hideCursor === other.hideCursor && this.cursorColorSingle === other.cursorColorSingle && this.cursorColorPrimary === other.cursorColorPrimary && this.cursorColorSecondary === other.cursorColorSecondary && this.themeType === other.themeType && Color.equals(this.backgroundColor, other.backgroundColor) && this.top === other.top && this.right === other.right && this.domWidth === other.domWidth && this.domHeight === other.domHeight && this.canvasWidth === other.canvasWidth && this.canvasHeight === other.canvasHeight;
- }
- };
- DecorationsOverviewRuler = class extends ViewPart {
- constructor(context) {
- super(context);
- this._actualShouldRender = 0;
- this._renderedDecorations = [];
- this._renderedCursorPositions = [];
- this._domNode = createFastDomNode(document.createElement("canvas"));
- this._domNode.setClassName("decorationsOverviewRuler");
- this._domNode.setPosition("absolute");
- this._domNode.setLayerHinting(true);
- this._domNode.setContain("strict");
- this._domNode.setAttribute("aria-hidden", "true");
- this._updateSettings(false);
- this._tokensColorTrackerListener = TokenizationRegistry2.onDidChange((e) => {
- if (e.changedColorMap) {
- this._updateSettings(true);
- }
- });
- this._cursorPositions = [{ position: new Position(1, 1), color: this._settings.cursorColorSingle }];
- }
- dispose() {
- super.dispose();
- this._tokensColorTrackerListener.dispose();
- }
- _updateSettings(renderNow) {
- const newSettings = new Settings(this._context.configuration, this._context.theme);
- if (this._settings && this._settings.equals(newSettings)) {
- return false;
- }
- this._settings = newSettings;
- this._domNode.setTop(this._settings.top);
- this._domNode.setRight(this._settings.right);
- this._domNode.setWidth(this._settings.domWidth);
- this._domNode.setHeight(this._settings.domHeight);
- this._domNode.domNode.width = this._settings.canvasWidth;
- this._domNode.domNode.height = this._settings.canvasHeight;
- if (renderNow) {
- this._render();
- }
- return true;
- }
- // ---- begin view event handlers
- _markRenderingIsNeeded() {
- this._actualShouldRender = 2;
- return true;
- }
- _markRenderingIsMaybeNeeded() {
- this._actualShouldRender = 1;
- return true;
- }
- onConfigurationChanged(e) {
- return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
- }
- onCursorStateChanged(e) {
- this._cursorPositions = [];
- for (let i2 = 0, len = e.selections.length; i2 < len; i2++) {
- let color = this._settings.cursorColorSingle;
- if (len > 1) {
- color = i2 === 0 ? this._settings.cursorColorPrimary : this._settings.cursorColorSecondary;
- }
- this._cursorPositions.push({ position: e.selections[i2].getPosition(), color });
- }
- this._cursorPositions.sort((a, b) => Position.compare(a.position, b.position));
- return this._markRenderingIsMaybeNeeded();
- }
- onDecorationsChanged(e) {
- if (e.affectsOverviewRuler) {
- return this._markRenderingIsMaybeNeeded();
- }
- return false;
- }
- onFlushed(e) {
- return this._markRenderingIsNeeded();
- }
- onScrollChanged(e) {
- return e.scrollHeightChanged ? this._markRenderingIsNeeded() : false;
- }
- onZonesChanged(e) {
- return this._markRenderingIsNeeded();
- }
- onThemeChanged(e) {
- return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
- }
- // ---- end view event handlers
- getDomNode() {
- return this._domNode.domNode;
- }
- prepareRender(ctx) {
- }
- render(editorCtx) {
- this._render();
- this._actualShouldRender = 0;
- }
- _render() {
- const backgroundColor = this._settings.backgroundColor;
- if (this._settings.overviewRulerLanes === 0) {
- this._domNode.setBackgroundColor(backgroundColor ? Color.Format.CSS.formatHexA(backgroundColor) : "");
- this._domNode.setDisplay("none");
- return;
- }
- const decorations = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
- decorations.sort(OverviewRulerDecorationsGroup.compareByRenderingProps);
- if (this._actualShouldRender === 1 && !OverviewRulerDecorationsGroup.equalsArr(this._renderedDecorations, decorations)) {
- this._actualShouldRender = 2;
- }
- if (this._actualShouldRender === 1 && !equals(this._renderedCursorPositions, this._cursorPositions, (a, b) => a.position.lineNumber === b.position.lineNumber && a.color === b.color)) {
- this._actualShouldRender = 2;
- }
- if (this._actualShouldRender === 1) {
- return;
- }
- this._renderedDecorations = decorations;
- this._renderedCursorPositions = this._cursorPositions;
- this._domNode.setDisplay("block");
- const canvasWidth = this._settings.canvasWidth;
- const canvasHeight = this._settings.canvasHeight;
- const lineHeight = this._settings.lineHeight;
- const viewLayout = this._context.viewLayout;
- const outerHeight = this._context.viewLayout.getScrollHeight();
- const heightRatio = canvasHeight / outerHeight;
- const minDecorationHeight = 6 * this._settings.pixelRatio | 0;
- const halfMinDecorationHeight = minDecorationHeight / 2 | 0;
- const canvasCtx = this._domNode.domNode.getContext("2d");
- if (backgroundColor) {
- if (backgroundColor.isOpaque()) {
- canvasCtx.fillStyle = Color.Format.CSS.formatHexA(backgroundColor);
- canvasCtx.fillRect(0, 0, canvasWidth, canvasHeight);
- } else {
- canvasCtx.clearRect(0, 0, canvasWidth, canvasHeight);
- canvasCtx.fillStyle = Color.Format.CSS.formatHexA(backgroundColor);
- canvasCtx.fillRect(0, 0, canvasWidth, canvasHeight);
- }
- } else {
- canvasCtx.clearRect(0, 0, canvasWidth, canvasHeight);
- }
- const x = this._settings.x;
- const w = this._settings.w;
- for (const decorationGroup of decorations) {
- const color = decorationGroup.color;
- const decorationGroupData = decorationGroup.data;
- canvasCtx.fillStyle = color;
- let prevLane = 0;
- let prevY1 = 0;
- let prevY2 = 0;
- for (let i2 = 0, len = decorationGroupData.length / 3; i2 < len; i2++) {
- const lane = decorationGroupData[3 * i2];
- const startLineNumber = decorationGroupData[3 * i2 + 1];
- const endLineNumber = decorationGroupData[3 * i2 + 2];
- let y1 = viewLayout.getVerticalOffsetForLineNumber(startLineNumber) * heightRatio | 0;
- let y2 = (viewLayout.getVerticalOffsetForLineNumber(endLineNumber) + lineHeight) * heightRatio | 0;
- const height = y2 - y1;
- if (height < minDecorationHeight) {
- let yCenter = (y1 + y2) / 2 | 0;
- if (yCenter < halfMinDecorationHeight) {
- yCenter = halfMinDecorationHeight;
- } else if (yCenter + halfMinDecorationHeight > canvasHeight) {
- yCenter = canvasHeight - halfMinDecorationHeight;
- }
- y1 = yCenter - halfMinDecorationHeight;
- y2 = yCenter + halfMinDecorationHeight;
- }
- if (y1 > prevY2 + 1 || lane !== prevLane) {
- if (i2 !== 0) {
- canvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1);
- }
- prevLane = lane;
- prevY1 = y1;
- prevY2 = y2;
- } else {
- if (y2 > prevY2) {
- prevY2 = y2;
- }
- }
- }
- canvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1);
- }
- if (!this._settings.hideCursor) {
- const cursorHeight = 2 * this._settings.pixelRatio | 0;
- const halfCursorHeight = cursorHeight / 2 | 0;
- const cursorX = this._settings.x[
- 7
- /* OverviewRulerLane.Full */
- ];
- const cursorW = this._settings.w[
- 7
- /* OverviewRulerLane.Full */
- ];
- let prevY1 = -100;
- let prevY2 = -100;
- let prevColor = null;
- for (let i2 = 0, len = this._cursorPositions.length; i2 < len; i2++) {
- const color = this._cursorPositions[i2].color;
- if (!color) {
- continue;
- }
- const cursor = this._cursorPositions[i2].position;
- let yCenter = viewLayout.getVerticalOffsetForLineNumber(cursor.lineNumber) * heightRatio | 0;
- if (yCenter < halfCursorHeight) {
- yCenter = halfCursorHeight;
- } else if (yCenter + halfCursorHeight > canvasHeight) {
- yCenter = canvasHeight - halfCursorHeight;
- }
- const y1 = yCenter - halfCursorHeight;
- const y2 = y1 + cursorHeight;
- if (y1 > prevY2 + 1 || color !== prevColor) {
- if (i2 !== 0 && prevColor) {
- canvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1);
- }
- prevY1 = y1;
- prevY2 = y2;
- } else {
- if (y2 > prevY2) {
- prevY2 = y2;
- }
- }
- prevColor = color;
- canvasCtx.fillStyle = color;
- }
- if (prevColor) {
- canvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1);
- }
- }
- if (this._settings.renderBorder && this._settings.borderColor && this._settings.overviewRulerLanes > 0) {
- canvasCtx.beginPath();
- canvasCtx.lineWidth = 1;
- canvasCtx.strokeStyle = this._settings.borderColor;
- canvasCtx.moveTo(0, 0);
- canvasCtx.lineTo(0, canvasHeight);
- canvasCtx.moveTo(1, 0);
- canvasCtx.lineTo(canvasWidth, 0);
- canvasCtx.stroke();
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewModel/overviewZoneManager.js
-var ColorZone, OverviewRulerZone, OverviewZoneManager;
-var init_overviewZoneManager = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/overviewZoneManager.js"() {
- ColorZone = class {
- constructor(from, to, colorId) {
- this._colorZoneBrand = void 0;
- this.from = from | 0;
- this.to = to | 0;
- this.colorId = colorId | 0;
- }
- static compare(a, b) {
- if (a.colorId === b.colorId) {
- if (a.from === b.from) {
- return a.to - b.to;
- }
- return a.from - b.from;
- }
- return a.colorId - b.colorId;
- }
- };
- OverviewRulerZone = class {
- constructor(startLineNumber, endLineNumber, heightInLines, color) {
- this._overviewRulerZoneBrand = void 0;
- this.startLineNumber = startLineNumber;
- this.endLineNumber = endLineNumber;
- this.heightInLines = heightInLines;
- this.color = color;
- this._colorZone = null;
- }
- static compare(a, b) {
- if (a.color === b.color) {
- if (a.startLineNumber === b.startLineNumber) {
- if (a.heightInLines === b.heightInLines) {
- return a.endLineNumber - b.endLineNumber;
- }
- return a.heightInLines - b.heightInLines;
- }
- return a.startLineNumber - b.startLineNumber;
- }
- return a.color < b.color ? -1 : 1;
- }
- setColorZone(colorZone) {
- this._colorZone = colorZone;
- }
- getColorZones() {
- return this._colorZone;
- }
- };
- OverviewZoneManager = class {
- constructor(getVerticalOffsetForLine) {
- this._getVerticalOffsetForLine = getVerticalOffsetForLine;
- this._zones = [];
- this._colorZonesInvalid = false;
- this._lineHeight = 0;
- this._domWidth = 0;
- this._domHeight = 0;
- this._outerHeight = 0;
- this._pixelRatio = 1;
- this._lastAssignedId = 0;
- this._color2Id = /* @__PURE__ */ Object.create(null);
- this._id2Color = [];
- }
- getId2Color() {
- return this._id2Color;
- }
- setZones(newZones) {
- this._zones = newZones;
- this._zones.sort(OverviewRulerZone.compare);
- }
- setLineHeight(lineHeight) {
- if (this._lineHeight === lineHeight) {
- return false;
- }
- this._lineHeight = lineHeight;
- this._colorZonesInvalid = true;
- return true;
- }
- setPixelRatio(pixelRatio) {
- this._pixelRatio = pixelRatio;
- this._colorZonesInvalid = true;
- }
- getDOMWidth() {
- return this._domWidth;
- }
- getCanvasWidth() {
- return this._domWidth * this._pixelRatio;
- }
- setDOMWidth(width2) {
- if (this._domWidth === width2) {
- return false;
- }
- this._domWidth = width2;
- this._colorZonesInvalid = true;
- return true;
- }
- getDOMHeight() {
- return this._domHeight;
- }
- getCanvasHeight() {
- return this._domHeight * this._pixelRatio;
- }
- setDOMHeight(height) {
- if (this._domHeight === height) {
- return false;
- }
- this._domHeight = height;
- this._colorZonesInvalid = true;
- return true;
- }
- getOuterHeight() {
- return this._outerHeight;
- }
- setOuterHeight(outerHeight) {
- if (this._outerHeight === outerHeight) {
- return false;
- }
- this._outerHeight = outerHeight;
- this._colorZonesInvalid = true;
- return true;
- }
- resolveColorZones() {
- const colorZonesInvalid = this._colorZonesInvalid;
- const lineHeight = Math.floor(this._lineHeight);
- const totalHeight = Math.floor(this.getCanvasHeight());
- const outerHeight = Math.floor(this._outerHeight);
- const heightRatio = totalHeight / outerHeight;
- const halfMinimumHeight = Math.floor(4 * this._pixelRatio / 2);
- const allColorZones = [];
- for (let i2 = 0, len = this._zones.length; i2 < len; i2++) {
- const zone = this._zones[i2];
- if (!colorZonesInvalid) {
- const colorZone2 = zone.getColorZones();
- if (colorZone2) {
- allColorZones.push(colorZone2);
- continue;
- }
- }
- const offset1 = this._getVerticalOffsetForLine(zone.startLineNumber);
- const offset2 = zone.heightInLines === 0 ? this._getVerticalOffsetForLine(zone.endLineNumber) + lineHeight : offset1 + zone.heightInLines * lineHeight;
- const y1 = Math.floor(heightRatio * offset1);
- const y2 = Math.floor(heightRatio * offset2);
- let ycenter = Math.floor((y1 + y2) / 2);
- let halfHeight = y2 - ycenter;
- if (halfHeight < halfMinimumHeight) {
- halfHeight = halfMinimumHeight;
- }
- if (ycenter - halfHeight < 0) {
- ycenter = halfHeight;
- }
- if (ycenter + halfHeight > totalHeight) {
- ycenter = totalHeight - halfHeight;
- }
- const color = zone.color;
- let colorId = this._color2Id[color];
- if (!colorId) {
- colorId = ++this._lastAssignedId;
- this._color2Id[color] = colorId;
- this._id2Color[colorId] = color;
- }
- const colorZone = new ColorZone(ycenter - halfHeight, ycenter + halfHeight, colorId);
- zone.setColorZone(colorZone);
- allColorZones.push(colorZone);
- }
- this._colorZonesInvalid = false;
- allColorZones.sort(ColorZone.compare);
- return allColorZones;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js
-var OverviewRuler;
-var init_overviewRuler = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js"() {
- init_fastDomNode();
- init_overviewZoneManager();
- init_viewEventHandler();
- OverviewRuler = class extends ViewEventHandler {
- constructor(context, cssClassName) {
- super();
- this._context = context;
- const options = this._context.configuration.options;
- this._domNode = createFastDomNode(document.createElement("canvas"));
- this._domNode.setClassName(cssClassName);
- this._domNode.setPosition("absolute");
- this._domNode.setLayerHinting(true);
- this._domNode.setContain("strict");
- this._zoneManager = new OverviewZoneManager((lineNumber) => this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber));
- this._zoneManager.setDOMWidth(0);
- this._zoneManager.setDOMHeight(0);
- this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight());
- this._zoneManager.setLineHeight(options.get(
- 75
- /* EditorOption.lineHeight */
- ));
- this._zoneManager.setPixelRatio(options.get(
- 163
- /* EditorOption.pixelRatio */
- ));
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- super.dispose();
- }
- // ---- begin view event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- if (e.hasChanged(
- 75
- /* EditorOption.lineHeight */
- )) {
- this._zoneManager.setLineHeight(options.get(
- 75
- /* EditorOption.lineHeight */
- ));
- this._render();
- }
- if (e.hasChanged(
- 163
- /* EditorOption.pixelRatio */
- )) {
- this._zoneManager.setPixelRatio(options.get(
- 163
- /* EditorOption.pixelRatio */
- ));
- this._domNode.setWidth(this._zoneManager.getDOMWidth());
- this._domNode.setHeight(this._zoneManager.getDOMHeight());
- this._domNode.domNode.width = this._zoneManager.getCanvasWidth();
- this._domNode.domNode.height = this._zoneManager.getCanvasHeight();
- this._render();
- }
- return true;
- }
- onFlushed(e) {
- this._render();
- return true;
- }
- onScrollChanged(e) {
- if (e.scrollHeightChanged) {
- this._zoneManager.setOuterHeight(e.scrollHeight);
- this._render();
- }
- return true;
- }
- onZonesChanged(e) {
- this._render();
- return true;
- }
- // ---- end view event handlers
- getDomNode() {
- return this._domNode.domNode;
- }
- setLayout(position) {
- this._domNode.setTop(position.top);
- this._domNode.setRight(position.right);
- let hasChanged = false;
- hasChanged = this._zoneManager.setDOMWidth(position.width) || hasChanged;
- hasChanged = this._zoneManager.setDOMHeight(position.height) || hasChanged;
- if (hasChanged) {
- this._domNode.setWidth(this._zoneManager.getDOMWidth());
- this._domNode.setHeight(this._zoneManager.getDOMHeight());
- this._domNode.domNode.width = this._zoneManager.getCanvasWidth();
- this._domNode.domNode.height = this._zoneManager.getCanvasHeight();
- this._render();
- }
- }
- setZones(zones) {
- this._zoneManager.setZones(zones);
- this._render();
- }
- _render() {
- if (this._zoneManager.getOuterHeight() === 0) {
- return false;
- }
- const width2 = this._zoneManager.getCanvasWidth();
- const height = this._zoneManager.getCanvasHeight();
- const colorZones = this._zoneManager.resolveColorZones();
- const id2Color = this._zoneManager.getId2Color();
- const ctx = this._domNode.domNode.getContext("2d");
- ctx.clearRect(0, 0, width2, height);
- if (colorZones.length > 0) {
- this._renderOneLane(ctx, colorZones, id2Color, width2);
- }
- return true;
- }
- _renderOneLane(ctx, colorZones, id2Color, width2) {
- let currentColorId = 0;
- let currentFrom = 0;
- let currentTo = 0;
- for (const zone of colorZones) {
- const zoneColorId = zone.colorId;
- const zoneFrom = zone.from;
- const zoneTo = zone.to;
- if (zoneColorId !== currentColorId) {
- ctx.fillRect(0, currentFrom, width2, currentTo - currentFrom);
- currentColorId = zoneColorId;
- ctx.fillStyle = id2Color[currentColorId];
- currentFrom = zoneFrom;
- currentTo = zoneTo;
- } else {
- if (currentTo >= zoneFrom) {
- currentTo = Math.max(currentTo, zoneTo);
- } else {
- ctx.fillRect(0, currentFrom, width2, currentTo - currentFrom);
- currentFrom = zoneFrom;
- currentTo = zoneTo;
- }
- }
- }
- ctx.fillRect(0, currentFrom, width2, currentTo - currentFrom);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css
-var init_rulers = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js
-var Rulers;
-var init_rulers2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js"() {
- init_rulers();
- init_fastDomNode();
- init_viewPart();
- Rulers = class extends ViewPart {
- constructor(context) {
- super(context);
- this.domNode = createFastDomNode(document.createElement("div"));
- this.domNode.setAttribute("role", "presentation");
- this.domNode.setAttribute("aria-hidden", "true");
- this.domNode.setClassName("view-rulers");
- this._renderedRulers = [];
- const options = this._context.configuration.options;
- this._rulers = options.get(
- 116
- /* EditorOption.rulers */
- );
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- }
- dispose() {
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- this._rulers = options.get(
- 116
- /* EditorOption.rulers */
- );
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- return true;
- }
- onScrollChanged(e) {
- return e.scrollHeightChanged;
- }
- // --- end event handlers
- prepareRender(ctx) {
- }
- _ensureRulersCount() {
- const currentCount = this._renderedRulers.length;
- const desiredCount = this._rulers.length;
- if (currentCount === desiredCount) {
- return;
- }
- if (currentCount < desiredCount) {
- const { tabSize } = this._context.viewModel.model.getOptions();
- const rulerWidth = tabSize;
- let addCount = desiredCount - currentCount;
- while (addCount > 0) {
- const node = createFastDomNode(document.createElement("div"));
- node.setClassName("view-ruler");
- node.setWidth(rulerWidth);
- this.domNode.appendChild(node);
- this._renderedRulers.push(node);
- addCount--;
- }
- return;
- }
- let removeCount = currentCount - desiredCount;
- while (removeCount > 0) {
- const node = this._renderedRulers.pop();
- this.domNode.removeChild(node);
- removeCount--;
- }
- }
- render(ctx) {
- this._ensureRulersCount();
- for (let i2 = 0, len = this._rulers.length; i2 < len; i2++) {
- const node = this._renderedRulers[i2];
- const ruler = this._rulers[i2];
- node.setBoxShadow(ruler.color ? `1px 0 0 0 ${ruler.color} inset` : ``);
- node.setHeight(Math.min(ctx.scrollHeight, 1e6));
- node.setLeft(ruler.column * this._typicalHalfwidthCharacterWidth);
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css
-var init_scrollDecoration = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js
-var ScrollDecorationViewPart;
-var init_scrollDecoration2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js"() {
- init_scrollDecoration();
- init_fastDomNode();
- init_viewPart();
- ScrollDecorationViewPart = class extends ViewPart {
- constructor(context) {
- super(context);
- this._scrollTop = 0;
- this._width = 0;
- this._updateWidth();
- this._shouldShow = false;
- const options = this._context.configuration.options;
- const scrollbar = options.get(
- 117
- /* EditorOption.scrollbar */
- );
- this._useShadows = scrollbar.useShadows;
- this._domNode = createFastDomNode(document.createElement("div"));
- this._domNode.setAttribute("role", "presentation");
- this._domNode.setAttribute("aria-hidden", "true");
- }
- dispose() {
- super.dispose();
- }
- _updateShouldShow() {
- const newShouldShow = this._useShadows && this._scrollTop > 0;
- if (this._shouldShow !== newShouldShow) {
- this._shouldShow = newShouldShow;
- return true;
- }
- return false;
- }
- getDomNode() {
- return this._domNode;
- }
- _updateWidth() {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- if (layoutInfo.minimap.renderMinimap === 0 || layoutInfo.minimap.minimapWidth > 0 && layoutInfo.minimap.minimapLeft === 0) {
- this._width = layoutInfo.width;
- } else {
- this._width = layoutInfo.width - layoutInfo.verticalScrollbarWidth;
- }
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const scrollbar = options.get(
- 117
- /* EditorOption.scrollbar */
- );
- this._useShadows = scrollbar.useShadows;
- this._updateWidth();
- this._updateShouldShow();
- return true;
- }
- onScrollChanged(e) {
- this._scrollTop = e.scrollTop;
- return this._updateShouldShow();
- }
- // --- end event handlers
- prepareRender(ctx) {
- }
- render(ctx) {
- this._domNode.setWidth(this._width);
- this._domNode.setClassName(this._shouldShow ? "scroll-decoration" : "");
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css
-var init_selections = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js
-function toStyledRange(item) {
- return new HorizontalRangeWithStyle(item);
-}
-function toStyled(item) {
- return new LineVisibleRangesWithStyle(item.lineNumber, item.ranges.map(toStyledRange));
-}
-function abs(n2) {
- return n2 < 0 ? -n2 : n2;
-}
-var HorizontalRangeWithStyle, LineVisibleRangesWithStyle, SelectionsOverlay;
-var init_selections2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js"() {
- init_selections();
- init_dynamicViewOverlay();
- init_colorUtils();
- init_baseColors();
- init_chartsColors();
- init_editorColors();
- init_inputColors();
- init_listColors();
- init_menuColors();
- init_minimapColors();
- init_miscColors();
- init_quickpickColors();
- init_searchColors();
- init_themeService();
- HorizontalRangeWithStyle = class {
- constructor(other) {
- this.left = other.left;
- this.width = other.width;
- this.startStyle = null;
- this.endStyle = null;
- }
- };
- LineVisibleRangesWithStyle = class {
- constructor(lineNumber, ranges) {
- this.lineNumber = lineNumber;
- this.ranges = ranges;
- }
- };
- SelectionsOverlay = class _SelectionsOverlay extends DynamicViewOverlay {
- static {
- this.SELECTION_CLASS_NAME = "selected-text";
- }
- static {
- this.SELECTION_TOP_LEFT = "top-left-radius";
- }
- static {
- this.SELECTION_BOTTOM_LEFT = "bottom-left-radius";
- }
- static {
- this.SELECTION_TOP_RIGHT = "top-right-radius";
- }
- static {
- this.SELECTION_BOTTOM_RIGHT = "bottom-right-radius";
- }
- static {
- this.EDITOR_BACKGROUND_CLASS_NAME = "monaco-editor-background";
- }
- static {
- this.ROUNDED_PIECE_WIDTH = 10;
- }
- constructor(context) {
- super();
- this._previousFrameVisibleRangesWithStyle = [];
- this._context = context;
- const options = this._context.configuration.options;
- this._roundedSelection = options.get(
- 115
- /* EditorOption.roundedSelection */
- );
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- this._selections = [];
- this._renderResult = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- this._roundedSelection = options.get(
- 115
- /* EditorOption.roundedSelection */
- );
- this._typicalHalfwidthCharacterWidth = options.get(
- 59
- /* EditorOption.fontInfo */
- ).typicalHalfwidthCharacterWidth;
- return true;
- }
- onCursorStateChanged(e) {
- this._selections = e.selections.slice(0);
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- _visibleRangesHaveGaps(linesVisibleRanges) {
- for (let i2 = 0, len = linesVisibleRanges.length; i2 < len; i2++) {
- const lineVisibleRanges = linesVisibleRanges[i2];
- if (lineVisibleRanges.ranges.length > 1) {
- return true;
- }
- }
- return false;
- }
- _enrichVisibleRangesWithStyle(viewport, linesVisibleRanges, previousFrame) {
- const epsilon = this._typicalHalfwidthCharacterWidth / 4;
- let previousFrameTop = null;
- let previousFrameBottom = null;
- if (previousFrame && previousFrame.length > 0 && linesVisibleRanges.length > 0) {
- const topLineNumber = linesVisibleRanges[0].lineNumber;
- if (topLineNumber === viewport.startLineNumber) {
- for (let i2 = 0; !previousFrameTop && i2 < previousFrame.length; i2++) {
- if (previousFrame[i2].lineNumber === topLineNumber) {
- previousFrameTop = previousFrame[i2].ranges[0];
- }
- }
- }
- const bottomLineNumber = linesVisibleRanges[linesVisibleRanges.length - 1].lineNumber;
- if (bottomLineNumber === viewport.endLineNumber) {
- for (let i2 = previousFrame.length - 1; !previousFrameBottom && i2 >= 0; i2--) {
- if (previousFrame[i2].lineNumber === bottomLineNumber) {
- previousFrameBottom = previousFrame[i2].ranges[0];
- }
- }
- }
- if (previousFrameTop && !previousFrameTop.startStyle) {
- previousFrameTop = null;
- }
- if (previousFrameBottom && !previousFrameBottom.startStyle) {
- previousFrameBottom = null;
- }
- }
- for (let i2 = 0, len = linesVisibleRanges.length; i2 < len; i2++) {
- const curLineRange = linesVisibleRanges[i2].ranges[0];
- const curLeft = curLineRange.left;
- const curRight = curLineRange.left + curLineRange.width;
- const startStyle = {
- top: 0,
- bottom: 0
- /* CornerStyle.EXTERN */
- };
- const endStyle = {
- top: 0,
- bottom: 0
- /* CornerStyle.EXTERN */
- };
- if (i2 > 0) {
- const prevLeft = linesVisibleRanges[i2 - 1].ranges[0].left;
- const prevRight = linesVisibleRanges[i2 - 1].ranges[0].left + linesVisibleRanges[i2 - 1].ranges[0].width;
- if (abs(curLeft - prevLeft) < epsilon) {
- startStyle.top = 2;
- } else if (curLeft > prevLeft) {
- startStyle.top = 1;
- }
- if (abs(curRight - prevRight) < epsilon) {
- endStyle.top = 2;
- } else if (prevLeft < curRight && curRight < prevRight) {
- endStyle.top = 1;
- }
- } else if (previousFrameTop) {
- startStyle.top = previousFrameTop.startStyle.top;
- endStyle.top = previousFrameTop.endStyle.top;
- }
- if (i2 + 1 < len) {
- const nextLeft = linesVisibleRanges[i2 + 1].ranges[0].left;
- const nextRight = linesVisibleRanges[i2 + 1].ranges[0].left + linesVisibleRanges[i2 + 1].ranges[0].width;
- if (abs(curLeft - nextLeft) < epsilon) {
- startStyle.bottom = 2;
- } else if (nextLeft < curLeft && curLeft < nextRight) {
- startStyle.bottom = 1;
- }
- if (abs(curRight - nextRight) < epsilon) {
- endStyle.bottom = 2;
- } else if (curRight < nextRight) {
- endStyle.bottom = 1;
- }
- } else if (previousFrameBottom) {
- startStyle.bottom = previousFrameBottom.startStyle.bottom;
- endStyle.bottom = previousFrameBottom.endStyle.bottom;
- }
- curLineRange.startStyle = startStyle;
- curLineRange.endStyle = endStyle;
- }
- }
- _getVisibleRangesWithStyle(selection, ctx, previousFrame) {
- const _linesVisibleRanges = ctx.linesVisibleRangesForRange(selection, true) || [];
- const linesVisibleRanges = _linesVisibleRanges.map(toStyled);
- const visibleRangesHaveGaps = this._visibleRangesHaveGaps(linesVisibleRanges);
- if (!visibleRangesHaveGaps && this._roundedSelection) {
- this._enrichVisibleRangesWithStyle(ctx.visibleRange, linesVisibleRanges, previousFrame);
- }
- return linesVisibleRanges;
- }
- _createSelectionPiece(top, bottom, className2, left, width2) {
- return '
';
- }
- _actualRenderOneSelection(output2, visibleStartLineNumber, hasMultipleSelections, visibleRanges) {
- if (visibleRanges.length === 0) {
- return;
- }
- const visibleRangesHaveStyle = !!visibleRanges[0].ranges[0].startStyle;
- const firstLineNumber = visibleRanges[0].lineNumber;
- const lastLineNumber = visibleRanges[visibleRanges.length - 1].lineNumber;
- for (let i2 = 0, len = visibleRanges.length; i2 < len; i2++) {
- const lineVisibleRanges = visibleRanges[i2];
- const lineNumber = lineVisibleRanges.lineNumber;
- const lineIndex = lineNumber - visibleStartLineNumber;
- const top = hasMultipleSelections ? lineNumber === firstLineNumber ? 1 : 0 : 0;
- const bottom = hasMultipleSelections ? lineNumber !== firstLineNumber && lineNumber === lastLineNumber ? 1 : 0 : 0;
- let innerCornerOutput = "";
- let restOfSelectionOutput = "";
- for (let j = 0, lenJ = lineVisibleRanges.ranges.length; j < lenJ; j++) {
- const visibleRange = lineVisibleRanges.ranges[j];
- if (visibleRangesHaveStyle) {
- const startStyle = visibleRange.startStyle;
- const endStyle = visibleRange.endStyle;
- if (startStyle.top === 1 || startStyle.bottom === 1) {
- innerCornerOutput += this._createSelectionPiece(top, bottom, _SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left - _SelectionsOverlay.ROUNDED_PIECE_WIDTH, _SelectionsOverlay.ROUNDED_PIECE_WIDTH);
- let className3 = _SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;
- if (startStyle.top === 1) {
- className3 += " " + _SelectionsOverlay.SELECTION_TOP_RIGHT;
- }
- if (startStyle.bottom === 1) {
- className3 += " " + _SelectionsOverlay.SELECTION_BOTTOM_RIGHT;
- }
- innerCornerOutput += this._createSelectionPiece(top, bottom, className3, visibleRange.left - _SelectionsOverlay.ROUNDED_PIECE_WIDTH, _SelectionsOverlay.ROUNDED_PIECE_WIDTH);
- }
- if (endStyle.top === 1 || endStyle.bottom === 1) {
- innerCornerOutput += this._createSelectionPiece(top, bottom, _SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left + visibleRange.width, _SelectionsOverlay.ROUNDED_PIECE_WIDTH);
- let className3 = _SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;
- if (endStyle.top === 1) {
- className3 += " " + _SelectionsOverlay.SELECTION_TOP_LEFT;
- }
- if (endStyle.bottom === 1) {
- className3 += " " + _SelectionsOverlay.SELECTION_BOTTOM_LEFT;
- }
- innerCornerOutput += this._createSelectionPiece(top, bottom, className3, visibleRange.left + visibleRange.width, _SelectionsOverlay.ROUNDED_PIECE_WIDTH);
- }
- }
- let className2 = _SelectionsOverlay.SELECTION_CLASS_NAME;
- if (visibleRangesHaveStyle) {
- const startStyle = visibleRange.startStyle;
- const endStyle = visibleRange.endStyle;
- if (startStyle.top === 0) {
- className2 += " " + _SelectionsOverlay.SELECTION_TOP_LEFT;
- }
- if (startStyle.bottom === 0) {
- className2 += " " + _SelectionsOverlay.SELECTION_BOTTOM_LEFT;
- }
- if (endStyle.top === 0) {
- className2 += " " + _SelectionsOverlay.SELECTION_TOP_RIGHT;
- }
- if (endStyle.bottom === 0) {
- className2 += " " + _SelectionsOverlay.SELECTION_BOTTOM_RIGHT;
- }
- }
- restOfSelectionOutput += this._createSelectionPiece(top, bottom, className2, visibleRange.left, visibleRange.width);
- }
- output2[lineIndex][0] += innerCornerOutput;
- output2[lineIndex][1] += restOfSelectionOutput;
- }
- }
- prepareRender(ctx) {
- const output = [];
- const visibleStartLineNumber = ctx.visibleRange.startLineNumber;
- const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
- for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
- const lineIndex = lineNumber - visibleStartLineNumber;
- output[lineIndex] = ["", ""];
- }
- const thisFrameVisibleRangesWithStyle = [];
- for (let i2 = 0, len = this._selections.length; i2 < len; i2++) {
- const selection = this._selections[i2];
- if (selection.isEmpty()) {
- thisFrameVisibleRangesWithStyle[i2] = null;
- continue;
- }
- const visibleRangesWithStyle = this._getVisibleRangesWithStyle(selection, ctx, this._previousFrameVisibleRangesWithStyle[i2]);
- thisFrameVisibleRangesWithStyle[i2] = visibleRangesWithStyle;
- this._actualRenderOneSelection(output, visibleStartLineNumber, this._selections.length > 1, visibleRangesWithStyle);
- }
- this._previousFrameVisibleRangesWithStyle = thisFrameVisibleRangesWithStyle;
- this._renderResult = output.map(([internalCorners, restOfSelection]) => internalCorners + restOfSelection);
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex < 0 || lineIndex >= this._renderResult.length) {
- return "";
- }
- return this._renderResult[lineIndex];
- }
- };
- registerThemingParticipant((theme, collector) => {
- const editorSelectionForegroundColor = theme.getColor(editorSelectionForeground);
- if (editorSelectionForegroundColor && !editorSelectionForegroundColor.isTransparent()) {
- collector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`);
- }
- });
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css
-var init_viewCursors = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js
-var ViewCursorRenderData, CursorPlurality, ViewCursor;
-var init_viewCursor = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js"() {
- init_dom();
- init_fastDomNode();
- init_strings();
- init_domFontInfo();
- init_editorOptions();
- init_position();
- init_range();
- init_mouseCursor2();
- ViewCursorRenderData = class {
- constructor(top, left, paddingLeft, width2, height, textContent, textContentClassName) {
- this.top = top;
- this.left = left;
- this.paddingLeft = paddingLeft;
- this.width = width2;
- this.height = height;
- this.textContent = textContent;
- this.textContentClassName = textContentClassName;
- }
- };
- (function(CursorPlurality2) {
- CursorPlurality2[CursorPlurality2["Single"] = 0] = "Single";
- CursorPlurality2[CursorPlurality2["MultiPrimary"] = 1] = "MultiPrimary";
- CursorPlurality2[CursorPlurality2["MultiSecondary"] = 2] = "MultiSecondary";
- })(CursorPlurality || (CursorPlurality = {}));
- ViewCursor = class {
- constructor(context, plurality) {
- this._context = context;
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- this._cursorStyle = options.get(
- 161
- /* EditorOption.effectiveCursorStyle */
- );
- this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
- this._lineCursorWidth = Math.min(options.get(
- 37
- /* EditorOption.cursorWidth */
- ), this._typicalHalfwidthCharacterWidth);
- this._lineCursorHeight = options.get(
- 38
- /* EditorOption.cursorHeight */
- );
- this._isVisible = true;
- this._domNode = createFastDomNode(document.createElement("div"));
- this._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`);
- this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1));
- this._domNode.setTop(0);
- this._domNode.setLeft(0);
- applyFontInfo(this._domNode, fontInfo);
- this._domNode.setDisplay("none");
- this._position = new Position(1, 1);
- this._pluralityClass = "";
- this.setPlurality(plurality);
- this._lastRenderedContent = "";
- this._renderData = null;
- }
- getDomNode() {
- return this._domNode;
- }
- getPosition() {
- return this._position;
- }
- setPlurality(plurality) {
- switch (plurality) {
- default:
- case CursorPlurality.Single:
- this._pluralityClass = "";
- break;
- case CursorPlurality.MultiPrimary:
- this._pluralityClass = "cursor-primary";
- break;
- case CursorPlurality.MultiSecondary:
- this._pluralityClass = "cursor-secondary";
- break;
- }
- }
- show() {
- if (!this._isVisible) {
- this._domNode.setVisibility("inherit");
- this._isVisible = true;
- }
- }
- hide() {
- if (this._isVisible) {
- this._domNode.setVisibility("hidden");
- this._isVisible = false;
- }
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- this._cursorStyle = options.get(
- 161
- /* EditorOption.effectiveCursorStyle */
- );
- this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
- this._lineCursorWidth = Math.min(options.get(
- 37
- /* EditorOption.cursorWidth */
- ), this._typicalHalfwidthCharacterWidth);
- this._lineCursorHeight = options.get(
- 38
- /* EditorOption.cursorHeight */
- );
- applyFontInfo(this._domNode, fontInfo);
- return true;
- }
- onCursorPositionChanged(position, pauseAnimation) {
- if (pauseAnimation) {
- this._domNode.domNode.style.transitionProperty = "none";
- } else {
- this._domNode.domNode.style.transitionProperty = "";
- }
- this._position = position;
- return true;
- }
- /**
- * If `this._position` is inside a grapheme, returns the position where the grapheme starts.
- * Also returns the next grapheme.
- */
- _getGraphemeAwarePosition() {
- const { lineNumber, column } = this._position;
- const lineContent = this._context.viewModel.getLineContent(lineNumber);
- const [startOffset, endOffset] = getCharContainingOffset(lineContent, column - 1);
- return [new Position(lineNumber, startOffset + 1), lineContent.substring(startOffset, endOffset)];
- }
- _prepareRender(ctx) {
- let textContent = "";
- let textContentClassName = "";
- const [position, nextGrapheme] = this._getGraphemeAwarePosition();
- const lineHeight = this._context.viewLayout.getLineHeightForLineNumber(position.lineNumber);
- const lineCursorHeight = this._lineCursorHeight === 0 ? lineHeight : Math.min(lineHeight, this._lineCursorHeight);
- const lineHeightAdjustment = (lineHeight - lineCursorHeight) / 2;
- if (this._cursorStyle === TextEditorCursorStyle.Line || this._cursorStyle === TextEditorCursorStyle.LineThin) {
- const visibleRange = ctx.visibleRangeForPosition(position);
- if (!visibleRange || visibleRange.outsideRenderedLine) {
- return null;
- }
- const window2 = getWindow(this._domNode.domNode);
- let width3;
- if (this._cursorStyle === TextEditorCursorStyle.Line) {
- width3 = computeScreenAwareSize(window2, this._lineCursorWidth > 0 ? this._lineCursorWidth : 2);
- if (width3 > 2) {
- textContent = nextGrapheme;
- textContentClassName = this._getTokenClassName(position);
- }
- } else {
- width3 = computeScreenAwareSize(window2, 1);
- }
- let left = visibleRange.left;
- let paddingLeft = 0;
- if (width3 >= 2 && left >= 1) {
- paddingLeft = 1;
- left -= paddingLeft;
- }
- const top2 = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.bigNumbersDelta + lineHeightAdjustment;
- return new ViewCursorRenderData(top2, left, paddingLeft, width3, lineCursorHeight, textContent, textContentClassName);
- }
- const visibleRangeForCharacter = ctx.linesVisibleRangesForRange(new Range(position.lineNumber, position.column, position.lineNumber, position.column + nextGrapheme.length), false);
- if (!visibleRangeForCharacter || visibleRangeForCharacter.length === 0) {
- return null;
- }
- const firstVisibleRangeForCharacter = visibleRangeForCharacter[0];
- if (firstVisibleRangeForCharacter.outsideRenderedLine || firstVisibleRangeForCharacter.ranges.length === 0) {
- return null;
- }
- const range2 = firstVisibleRangeForCharacter.ranges[0];
- const width2 = nextGrapheme === " " ? this._typicalHalfwidthCharacterWidth : range2.width < 1 ? this._typicalHalfwidthCharacterWidth : range2.width;
- if (this._cursorStyle === TextEditorCursorStyle.Block) {
- textContent = nextGrapheme;
- textContentClassName = this._getTokenClassName(position);
- }
- let top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.bigNumbersDelta;
- let height = lineHeight;
- if (this._cursorStyle === TextEditorCursorStyle.Underline || this._cursorStyle === TextEditorCursorStyle.UnderlineThin) {
- top += lineHeight - 2;
- height = 2;
- }
- return new ViewCursorRenderData(top, range2.left, 0, width2, height, textContent, textContentClassName);
- }
- _getTokenClassName(position) {
- const lineData = this._context.viewModel.getViewLineData(position.lineNumber);
- const tokenIndex = lineData.tokens.findTokenIndexAtOffset(position.column - 1);
- return lineData.tokens.getClassName(tokenIndex);
- }
- prepareRender(ctx) {
- this._renderData = this._prepareRender(ctx);
- }
- render(ctx) {
- if (!this._renderData) {
- this._domNode.setDisplay("none");
- return null;
- }
- if (this._lastRenderedContent !== this._renderData.textContent) {
- this._lastRenderedContent = this._renderData.textContent;
- this._domNode.domNode.textContent = this._lastRenderedContent;
- }
- this._domNode.setClassName(`cursor ${this._pluralityClass} ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`);
- this._domNode.setDisplay("block");
- this._domNode.setTop(this._renderData.top);
- this._domNode.setLeft(this._renderData.left);
- this._domNode.setPaddingLeft(this._renderData.paddingLeft);
- this._domNode.setWidth(this._renderData.width);
- this._domNode.setLineHeight(this._renderData.height);
- this._domNode.setHeight(this._renderData.height);
- return {
- domNode: this._domNode.domNode,
- position: this._position,
- contentLeft: this._renderData.left,
- height: this._renderData.height,
- width: 2
- };
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js
-var ViewCursors;
-var init_viewCursors2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js"() {
- init_viewCursors();
- init_fastDomNode();
- init_async();
- init_viewPart();
- init_viewCursor();
- init_editorOptions();
- init_editorColorRegistry();
- init_themeService();
- init_theme();
- init_dom();
- ViewCursors = class _ViewCursors extends ViewPart {
- static {
- this.BLINK_INTERVAL = 500;
- }
- constructor(context) {
- super(context);
- const options = this._context.configuration.options;
- this._readOnly = options.get(
- 104
- /* EditorOption.readOnly */
- );
- this._cursorBlinking = options.get(
- 32
- /* EditorOption.cursorBlinking */
- );
- this._cursorStyle = options.get(
- 161
- /* EditorOption.effectiveCursorStyle */
- );
- this._cursorSmoothCaretAnimation = options.get(
- 33
- /* EditorOption.cursorSmoothCaretAnimation */
- );
- this._editContextEnabled = options.get(
- 170
- /* EditorOption.effectiveEditContext */
- );
- this._selectionIsEmpty = true;
- this._isComposingInput = false;
- this._isVisible = false;
- this._primaryCursor = new ViewCursor(this._context, CursorPlurality.Single);
- this._secondaryCursors = [];
- this._renderData = [];
- this._domNode = createFastDomNode(document.createElement("div"));
- this._domNode.setAttribute("role", "presentation");
- this._domNode.setAttribute("aria-hidden", "true");
- this._updateDomClassName();
- this._domNode.appendChild(this._primaryCursor.getDomNode());
- this._startCursorBlinkAnimation = new TimeoutTimer();
- this._cursorFlatBlinkInterval = new WindowIntervalTimer();
- this._blinkingEnabled = false;
- this._editorHasFocus = false;
- this._updateBlinking();
- }
- dispose() {
- super.dispose();
- this._startCursorBlinkAnimation.dispose();
- this._cursorFlatBlinkInterval.dispose();
- }
- getDomNode() {
- return this._domNode;
- }
- // --- begin event handlers
- onCompositionStart(e) {
- this._isComposingInput = true;
- this._updateBlinking();
- return true;
- }
- onCompositionEnd(e) {
- this._isComposingInput = false;
- this._updateBlinking();
- return true;
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- this._readOnly = options.get(
- 104
- /* EditorOption.readOnly */
- );
- this._cursorBlinking = options.get(
- 32
- /* EditorOption.cursorBlinking */
- );
- this._cursorStyle = options.get(
- 161
- /* EditorOption.effectiveCursorStyle */
- );
- this._cursorSmoothCaretAnimation = options.get(
- 33
- /* EditorOption.cursorSmoothCaretAnimation */
- );
- this._editContextEnabled = options.get(
- 170
- /* EditorOption.effectiveEditContext */
- );
- this._updateBlinking();
- this._updateDomClassName();
- this._primaryCursor.onConfigurationChanged(e);
- for (let i2 = 0, len = this._secondaryCursors.length; i2 < len; i2++) {
- this._secondaryCursors[i2].onConfigurationChanged(e);
- }
- return true;
- }
- _onCursorPositionChanged(position, secondaryPositions, reason) {
- const pauseAnimation = this._secondaryCursors.length !== secondaryPositions.length || this._cursorSmoothCaretAnimation === "explicit" && reason !== 3;
- this._primaryCursor.setPlurality(secondaryPositions.length ? CursorPlurality.MultiPrimary : CursorPlurality.Single);
- this._primaryCursor.onCursorPositionChanged(position, pauseAnimation);
- this._updateBlinking();
- if (this._secondaryCursors.length < secondaryPositions.length) {
- const addCnt = secondaryPositions.length - this._secondaryCursors.length;
- for (let i2 = 0; i2 < addCnt; i2++) {
- const newCursor = new ViewCursor(this._context, CursorPlurality.MultiSecondary);
- this._domNode.domNode.insertBefore(newCursor.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling);
- this._secondaryCursors.push(newCursor);
- }
- } else if (this._secondaryCursors.length > secondaryPositions.length) {
- const removeCnt = this._secondaryCursors.length - secondaryPositions.length;
- for (let i2 = 0; i2 < removeCnt; i2++) {
- this._domNode.removeChild(this._secondaryCursors[0].getDomNode());
- this._secondaryCursors.splice(0, 1);
- }
- }
- for (let i2 = 0; i2 < secondaryPositions.length; i2++) {
- this._secondaryCursors[i2].onCursorPositionChanged(secondaryPositions[i2], pauseAnimation);
- }
- }
- onCursorStateChanged(e) {
- const positions = [];
- for (let i2 = 0, len = e.selections.length; i2 < len; i2++) {
- positions[i2] = e.selections[i2].getPosition();
- }
- this._onCursorPositionChanged(positions[0], positions.slice(1), e.reason);
- const selectionIsEmpty = e.selections[0].isEmpty();
- if (this._selectionIsEmpty !== selectionIsEmpty) {
- this._selectionIsEmpty = selectionIsEmpty;
- this._updateDomClassName();
- }
- return true;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onFocusChanged(e) {
- this._editorHasFocus = e.isFocused;
- this._updateBlinking();
- return false;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return true;
- }
- onTokensChanged(e) {
- const shouldRender = (position) => {
- for (let i2 = 0, len = e.ranges.length; i2 < len; i2++) {
- if (e.ranges[i2].fromLineNumber <= position.lineNumber && position.lineNumber <= e.ranges[i2].toLineNumber) {
- return true;
- }
- }
- return false;
- };
- if (shouldRender(this._primaryCursor.getPosition())) {
- return true;
- }
- for (const secondaryCursor of this._secondaryCursors) {
- if (shouldRender(secondaryCursor.getPosition())) {
- return true;
- }
- }
- return false;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- // ---- blinking logic
- _getCursorBlinking() {
- if (this._isComposingInput && !this._editContextEnabled) {
- return 0;
- }
- if (!this._editorHasFocus) {
- return 0;
- }
- if (this._readOnly) {
- return 5;
- }
- return this._cursorBlinking;
- }
- _updateBlinking() {
- this._startCursorBlinkAnimation.cancel();
- this._cursorFlatBlinkInterval.cancel();
- const blinkingStyle = this._getCursorBlinking();
- const isHidden = blinkingStyle === 0;
- const isSolid = blinkingStyle === 5;
- if (isHidden) {
- this._hide();
- } else {
- this._show();
- }
- this._blinkingEnabled = false;
- this._updateDomClassName();
- if (!isHidden && !isSolid) {
- if (blinkingStyle === 1) {
- this._cursorFlatBlinkInterval.cancelAndSet(() => {
- if (this._isVisible) {
- this._hide();
- } else {
- this._show();
- }
- }, _ViewCursors.BLINK_INTERVAL, getWindow(this._domNode.domNode));
- } else {
- this._startCursorBlinkAnimation.setIfNotSet(() => {
- this._blinkingEnabled = true;
- this._updateDomClassName();
- }, _ViewCursors.BLINK_INTERVAL);
- }
- }
- }
- // --- end blinking logic
- _updateDomClassName() {
- this._domNode.setClassName(this._getClassName());
- }
- _getClassName() {
- let result = "cursors-layer";
- if (!this._selectionIsEmpty) {
- result += " has-selection";
- }
- switch (this._cursorStyle) {
- case TextEditorCursorStyle.Line:
- result += " cursor-line-style";
- break;
- case TextEditorCursorStyle.Block:
- result += " cursor-block-style";
- break;
- case TextEditorCursorStyle.Underline:
- result += " cursor-underline-style";
- break;
- case TextEditorCursorStyle.LineThin:
- result += " cursor-line-thin-style";
- break;
- case TextEditorCursorStyle.BlockOutline:
- result += " cursor-block-outline-style";
- break;
- case TextEditorCursorStyle.UnderlineThin:
- result += " cursor-underline-thin-style";
- break;
- default:
- result += " cursor-line-style";
- }
- if (this._blinkingEnabled) {
- switch (this._getCursorBlinking()) {
- case 1:
- result += " cursor-blink";
- break;
- case 2:
- result += " cursor-smooth";
- break;
- case 3:
- result += " cursor-phase";
- break;
- case 4:
- result += " cursor-expand";
- break;
- case 5:
- result += " cursor-solid";
- break;
- default:
- result += " cursor-solid";
- }
- } else {
- result += " cursor-solid";
- }
- if (this._cursorSmoothCaretAnimation === "on" || this._cursorSmoothCaretAnimation === "explicit") {
- result += " cursor-smooth-caret-animation";
- }
- return result;
- }
- _show() {
- this._primaryCursor.show();
- for (let i2 = 0, len = this._secondaryCursors.length; i2 < len; i2++) {
- this._secondaryCursors[i2].show();
- }
- this._isVisible = true;
- }
- _hide() {
- this._primaryCursor.hide();
- for (let i2 = 0, len = this._secondaryCursors.length; i2 < len; i2++) {
- this._secondaryCursors[i2].hide();
- }
- this._isVisible = false;
- }
- // ---- IViewPart implementation
- prepareRender(ctx) {
- this._primaryCursor.prepareRender(ctx);
- for (let i2 = 0, len = this._secondaryCursors.length; i2 < len; i2++) {
- this._secondaryCursors[i2].prepareRender(ctx);
- }
- }
- render(ctx) {
- const renderData = [];
- let renderDataLen = 0;
- const primaryRenderData = this._primaryCursor.render(ctx);
- if (primaryRenderData) {
- renderData[renderDataLen++] = primaryRenderData;
- }
- for (let i2 = 0, len = this._secondaryCursors.length; i2 < len; i2++) {
- const secondaryRenderData = this._secondaryCursors[i2].render(ctx);
- if (secondaryRenderData) {
- renderData[renderDataLen++] = secondaryRenderData;
- }
- }
- this._renderData = renderData;
- }
- getLastRenderData() {
- return this._renderData;
- }
- };
- registerThemingParticipant((theme, collector) => {
- const cursorThemes = [
- { class: ".cursor", foreground: editorCursorForeground, background: editorCursorBackground },
- { class: ".cursor-primary", foreground: editorMultiCursorPrimaryForeground, background: editorMultiCursorPrimaryBackground },
- { class: ".cursor-secondary", foreground: editorMultiCursorSecondaryForeground, background: editorMultiCursorSecondaryBackground }
- ];
- for (const cursorTheme of cursorThemes) {
- const caret2 = theme.getColor(cursorTheme.foreground);
- if (caret2) {
- let caretBackground = theme.getColor(cursorTheme.background);
- if (!caretBackground) {
- caretBackground = caret2.opposite();
- }
- collector.addRule(`.monaco-editor .cursors-layer ${cursorTheme.class} { background-color: ${caret2}; border-color: ${caret2}; color: ${caretBackground}; }`);
- if (isHighContrast(theme.type)) {
- collector.addRule(`.monaco-editor .cursors-layer.has-selection ${cursorTheme.class} { border-left: 1px solid ${caretBackground}; border-right: 1px solid ${caretBackground}; }`);
- }
- }
- }
- });
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js
-function safeInvoke1Arg(func, arg1) {
- try {
- return func(arg1);
- } catch (e) {
- onUnexpectedError(e);
- return void 0;
- }
-}
-var invalidFunc, ViewZones;
-var init_viewZones = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js"() {
- init_fastDomNode();
- init_errors();
- init_viewPart();
- init_position();
- invalidFunc = () => {
- throw new Error(`Invalid change accessor`);
- };
- ViewZones = class extends ViewPart {
- constructor(context) {
- super(context);
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._contentWidth = layoutInfo.contentWidth;
- this._contentLeft = layoutInfo.contentLeft;
- this.domNode = createFastDomNode(document.createElement("div"));
- this.domNode.setClassName("view-zones");
- this.domNode.setPosition("absolute");
- this.domNode.setAttribute("role", "presentation");
- this.domNode.setAttribute("aria-hidden", "true");
- this.marginDomNode = createFastDomNode(document.createElement("div"));
- this.marginDomNode.setClassName("margin-view-zones");
- this.marginDomNode.setPosition("absolute");
- this.marginDomNode.setAttribute("role", "presentation");
- this.marginDomNode.setAttribute("aria-hidden", "true");
- this._zones = {};
- }
- dispose() {
- super.dispose();
- this._zones = {};
- }
- // ---- begin view event handlers
- _recomputeWhitespacesProps() {
- const whitespaces = this._context.viewLayout.getWhitespaces();
- const oldWhitespaces = /* @__PURE__ */ new Map();
- for (const whitespace of whitespaces) {
- oldWhitespaces.set(whitespace.id, whitespace);
- }
- let hadAChange = false;
- this._context.viewModel.changeWhitespace((whitespaceAccessor) => {
- const keys = Object.keys(this._zones);
- for (let i2 = 0, len = keys.length; i2 < len; i2++) {
- const id = keys[i2];
- const zone = this._zones[id];
- const props = this._computeWhitespaceProps(zone.delegate);
- zone.isInHiddenArea = props.isInHiddenArea;
- const oldWhitespace = oldWhitespaces.get(id);
- if (oldWhitespace && (oldWhitespace.afterLineNumber !== props.afterViewLineNumber || oldWhitespace.height !== props.heightInPx)) {
- whitespaceAccessor.changeOneWhitespace(id, props.afterViewLineNumber, props.heightInPx);
- this._safeCallOnComputedHeight(zone.delegate, props.heightInPx);
- hadAChange = true;
- }
- }
- });
- return hadAChange;
- }
- onConfigurationChanged(e) {
- const options = this._context.configuration.options;
- const layoutInfo = options.get(
- 165
- /* EditorOption.layoutInfo */
- );
- this._lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this._contentWidth = layoutInfo.contentWidth;
- this._contentLeft = layoutInfo.contentLeft;
- if (e.hasChanged(
- 75
- /* EditorOption.lineHeight */
- )) {
- this._recomputeWhitespacesProps();
- }
- return true;
- }
- onLineMappingChanged(e) {
- return this._recomputeWhitespacesProps();
- }
- onLinesDeleted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged || e.scrollWidthChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- // ---- end view event handlers
- _getZoneOrdinal(zone) {
- return zone.ordinal ?? zone.afterColumn ?? 1e4;
- }
- _computeWhitespaceProps(zone) {
- if (zone.afterLineNumber === 0) {
- return {
- isInHiddenArea: false,
- afterViewLineNumber: 0,
- heightInPx: this._heightInPixels(zone),
- minWidthInPx: this._minWidthInPixels(zone)
- };
- }
- let zoneAfterModelPosition;
- if (typeof zone.afterColumn !== "undefined") {
- zoneAfterModelPosition = this._context.viewModel.model.validatePosition({
- lineNumber: zone.afterLineNumber,
- column: zone.afterColumn
- });
- } else {
- const validAfterLineNumber = this._context.viewModel.model.validatePosition({
- lineNumber: zone.afterLineNumber,
- column: 1
- }).lineNumber;
- zoneAfterModelPosition = new Position(validAfterLineNumber, this._context.viewModel.model.getLineMaxColumn(validAfterLineNumber));
- }
- let zoneBeforeModelPosition;
- if (zoneAfterModelPosition.column === this._context.viewModel.model.getLineMaxColumn(zoneAfterModelPosition.lineNumber)) {
- zoneBeforeModelPosition = this._context.viewModel.model.validatePosition({
- lineNumber: zoneAfterModelPosition.lineNumber + 1,
- column: 1
- });
- } else {
- zoneBeforeModelPosition = this._context.viewModel.model.validatePosition({
- lineNumber: zoneAfterModelPosition.lineNumber,
- column: zoneAfterModelPosition.column + 1
- });
- }
- const viewPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(zoneAfterModelPosition, zone.afterColumnAffinity, true);
- const isVisible = zone.showInHiddenAreas || this._context.viewModel.coordinatesConverter.modelPositionIsVisible(zoneBeforeModelPosition);
- return {
- isInHiddenArea: !isVisible,
- afterViewLineNumber: viewPosition.lineNumber,
- heightInPx: isVisible ? this._heightInPixels(zone) : 0,
- minWidthInPx: this._minWidthInPixels(zone)
- };
- }
- changeViewZones(callback) {
- let zonesHaveChanged = false;
- this._context.viewModel.changeWhitespace((whitespaceAccessor) => {
- const changeAccessor = {
- addZone: (zone) => {
- zonesHaveChanged = true;
- return this._addZone(whitespaceAccessor, zone);
- },
- removeZone: (id) => {
- if (!id) {
- return;
- }
- zonesHaveChanged = this._removeZone(whitespaceAccessor, id) || zonesHaveChanged;
- },
- layoutZone: (id) => {
- if (!id) {
- return;
- }
- zonesHaveChanged = this._layoutZone(whitespaceAccessor, id) || zonesHaveChanged;
- }
- };
- safeInvoke1Arg(callback, changeAccessor);
- changeAccessor.addZone = invalidFunc;
- changeAccessor.removeZone = invalidFunc;
- changeAccessor.layoutZone = invalidFunc;
- });
- return zonesHaveChanged;
- }
- _addZone(whitespaceAccessor, zone) {
- const props = this._computeWhitespaceProps(zone);
- const whitespaceId = whitespaceAccessor.insertWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx, props.minWidthInPx);
- const myZone = {
- whitespaceId,
- delegate: zone,
- isInHiddenArea: props.isInHiddenArea,
- isVisible: false,
- domNode: createFastDomNode(zone.domNode),
- marginDomNode: zone.marginDomNode ? createFastDomNode(zone.marginDomNode) : null
- };
- this._safeCallOnComputedHeight(myZone.delegate, props.heightInPx);
- myZone.domNode.setPosition("absolute");
- myZone.domNode.domNode.style.width = "100%";
- myZone.domNode.setDisplay("none");
- myZone.domNode.setAttribute("monaco-view-zone", myZone.whitespaceId);
- this.domNode.appendChild(myZone.domNode);
- if (myZone.marginDomNode) {
- myZone.marginDomNode.setPosition("absolute");
- myZone.marginDomNode.domNode.style.width = "100%";
- myZone.marginDomNode.setDisplay("none");
- myZone.marginDomNode.setAttribute("monaco-view-zone", myZone.whitespaceId);
- this.marginDomNode.appendChild(myZone.marginDomNode);
- }
- this._zones[myZone.whitespaceId] = myZone;
- this.setShouldRender();
- return myZone.whitespaceId;
- }
- _removeZone(whitespaceAccessor, id) {
- if (this._zones.hasOwnProperty(id)) {
- const zone = this._zones[id];
- delete this._zones[id];
- whitespaceAccessor.removeWhitespace(zone.whitespaceId);
- zone.domNode.removeAttribute("monaco-visible-view-zone");
- zone.domNode.removeAttribute("monaco-view-zone");
- zone.domNode.domNode.remove();
- if (zone.marginDomNode) {
- zone.marginDomNode.removeAttribute("monaco-visible-view-zone");
- zone.marginDomNode.removeAttribute("monaco-view-zone");
- zone.marginDomNode.domNode.remove();
- }
- this.setShouldRender();
- return true;
- }
- return false;
- }
- _layoutZone(whitespaceAccessor, id) {
- if (this._zones.hasOwnProperty(id)) {
- const zone = this._zones[id];
- const props = this._computeWhitespaceProps(zone.delegate);
- zone.isInHiddenArea = props.isInHiddenArea;
- whitespaceAccessor.changeOneWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx);
- this._safeCallOnComputedHeight(zone.delegate, props.heightInPx);
- this.setShouldRender();
- return true;
- }
- return false;
- }
- shouldSuppressMouseDownOnViewZone(id) {
- if (this._zones.hasOwnProperty(id)) {
- const zone = this._zones[id];
- return Boolean(zone.delegate.suppressMouseDown);
- }
- return false;
- }
- _heightInPixels(zone) {
- if (typeof zone.heightInPx === "number") {
- return zone.heightInPx;
- }
- if (typeof zone.heightInLines === "number") {
- return this._lineHeight * zone.heightInLines;
- }
- return this._lineHeight;
- }
- _minWidthInPixels(zone) {
- if (typeof zone.minWidthInPx === "number") {
- return zone.minWidthInPx;
- }
- return 0;
- }
- _safeCallOnComputedHeight(zone, height) {
- if (typeof zone.onComputedHeight === "function") {
- try {
- zone.onComputedHeight(height);
- } catch (e) {
- onUnexpectedError(e);
- }
- }
- }
- _safeCallOnDomNodeTop(zone, top) {
- if (typeof zone.onDomNodeTop === "function") {
- try {
- zone.onDomNodeTop(top);
- } catch (e) {
- onUnexpectedError(e);
- }
- }
- }
- prepareRender(ctx) {
- }
- render(ctx) {
- const visibleWhitespaces = ctx.viewportData.whitespaceViewportData;
- const visibleZones = {};
- let hasVisibleZone = false;
- for (const visibleWhitespace of visibleWhitespaces) {
- if (this._zones[visibleWhitespace.id].isInHiddenArea) {
- continue;
- }
- visibleZones[visibleWhitespace.id] = visibleWhitespace;
- hasVisibleZone = true;
- }
- const keys = Object.keys(this._zones);
- for (let i2 = 0, len = keys.length; i2 < len; i2++) {
- const id = keys[i2];
- const zone = this._zones[id];
- let newTop = 0;
- let newHeight = 0;
- let newDisplay = "none";
- if (visibleZones.hasOwnProperty(id)) {
- newTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta;
- newHeight = visibleZones[id].height;
- newDisplay = "block";
- if (!zone.isVisible) {
- zone.domNode.setAttribute("monaco-visible-view-zone", "true");
- zone.isVisible = true;
- }
- this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
- } else {
- if (zone.isVisible) {
- zone.domNode.removeAttribute("monaco-visible-view-zone");
- zone.isVisible = false;
- }
- this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1e6));
- }
- zone.domNode.setTop(newTop);
- zone.domNode.setHeight(newHeight);
- zone.domNode.setDisplay(newDisplay);
- if (zone.marginDomNode) {
- zone.marginDomNode.setTop(newTop);
- zone.marginDomNode.setHeight(newHeight);
- zone.marginDomNode.setDisplay(newDisplay);
- }
- }
- if (hasVisibleZone) {
- this.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth));
- this.marginDomNode.setWidth(this._contentLeft);
- }
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.css
-var init_whitespace = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.css"() {
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.js
-var WhitespaceOverlay, WhitespaceOptions;
-var init_whitespace2 = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.js"() {
- init_whitespace();
- init_dynamicViewOverlay();
- init_strings();
- init_position();
- init_editorColorRegistry();
- init_offsetRange();
- WhitespaceOverlay = class extends DynamicViewOverlay {
- constructor(context) {
- super();
- this._context = context;
- this._options = new WhitespaceOptions(this._context.configuration);
- this._selection = [];
- this._renderResult = null;
- this._context.addEventHandler(this);
- }
- dispose() {
- this._context.removeEventHandler(this);
- this._renderResult = null;
- super.dispose();
- }
- // --- begin event handlers
- onConfigurationChanged(e) {
- const newOptions = new WhitespaceOptions(this._context.configuration);
- if (this._options.equals(newOptions)) {
- return e.hasChanged(
- 165
- /* EditorOption.layoutInfo */
- );
- }
- this._options = newOptions;
- return true;
- }
- onCursorStateChanged(e) {
- this._selection = e.selections;
- if (this._options.renderWhitespace === "selection") {
- return true;
- }
- return false;
- }
- onDecorationsChanged(e) {
- return true;
- }
- onFlushed(e) {
- return true;
- }
- onLinesChanged(e) {
- return true;
- }
- onLinesDeleted(e) {
- return true;
- }
- onLinesInserted(e) {
- return true;
- }
- onScrollChanged(e) {
- return e.scrollTopChanged;
- }
- onZonesChanged(e) {
- return true;
- }
- // --- end event handlers
- prepareRender(ctx) {
- if (this._options.renderWhitespace === "none") {
- this._renderResult = null;
- return;
- }
- const startLineNumber = ctx.visibleRange.startLineNumber;
- const endLineNumber = ctx.visibleRange.endLineNumber;
- const lineCount = endLineNumber - startLineNumber + 1;
- const needed = new Array(lineCount);
- for (let i2 = 0; i2 < lineCount; i2++) {
- needed[i2] = true;
- }
- this._renderResult = [];
- for (let lineNumber = ctx.viewportData.startLineNumber; lineNumber <= ctx.viewportData.endLineNumber; lineNumber++) {
- const lineIndex = lineNumber - ctx.viewportData.startLineNumber;
- const lineData = this._context.viewModel.getViewLineRenderingData(lineNumber);
- let selectionsOnLine = null;
- if (this._options.renderWhitespace === "selection") {
- const selections = this._selection;
- for (const selection of selections) {
- if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) {
- continue;
- }
- const startColumn = selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn;
- const endColumn = selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn;
- if (startColumn < endColumn) {
- if (!selectionsOnLine) {
- selectionsOnLine = [];
- }
- selectionsOnLine.push(new OffsetRange(startColumn - 1, endColumn - 1));
- }
- }
- }
- this._renderResult[lineIndex] = this._applyRenderWhitespace(ctx, lineNumber, selectionsOnLine, lineData);
- }
- }
- _applyRenderWhitespace(ctx, lineNumber, selections, lineData) {
- if (lineData.hasVariableFonts) {
- return "";
- }
- if (this._options.renderWhitespace === "selection" && !selections) {
- return "";
- }
- if (this._options.renderWhitespace === "trailing" && lineData.continuesWithWrappedLine) {
- return "";
- }
- const color = this._context.theme.getColor(editorWhitespaces);
- const USE_SVG = this._options.renderWithSVG;
- const lineContent = lineData.content;
- const len = this._options.stopRenderingLineAfter === -1 ? lineContent.length : Math.min(this._options.stopRenderingLineAfter, lineContent.length);
- const continuesWithWrappedLine = lineData.continuesWithWrappedLine;
- const fauxIndentLength = lineData.minColumn - 1;
- const onlyBoundary = this._options.renderWhitespace === "boundary";
- const onlyTrailing = this._options.renderWhitespace === "trailing";
- const lineHeight = ctx.getLineHeightForLineNumber(lineNumber);
- const middotWidth = this._options.middotWidth;
- const wsmiddotWidth = this._options.wsmiddotWidth;
- const spaceWidth = this._options.spaceWidth;
- const wsmiddotDiff = Math.abs(wsmiddotWidth - spaceWidth);
- const middotDiff = Math.abs(middotWidth - spaceWidth);
- const renderSpaceCharCode = wsmiddotDiff < middotDiff ? 11825 : 183;
- const canUseHalfwidthRightwardsArrow = this._options.canUseHalfwidthRightwardsArrow;
- let result = "";
- let lineIsEmptyOrWhitespace = false;
- let firstNonWhitespaceIndex$1 = firstNonWhitespaceIndex(lineContent);
- let lastNonWhitespaceIndex$1;
- if (firstNonWhitespaceIndex$1 === -1) {
- lineIsEmptyOrWhitespace = true;
- firstNonWhitespaceIndex$1 = len;
- lastNonWhitespaceIndex$1 = len;
- } else {
- lastNonWhitespaceIndex$1 = lastNonWhitespaceIndex(lineContent);
- }
- let currentSelectionIndex = 0;
- let currentSelection = selections && selections[currentSelectionIndex];
- let maxLeft = 0;
- for (let charIndex = fauxIndentLength; charIndex < len; charIndex++) {
- const chCode = lineContent.charCodeAt(charIndex);
- if (currentSelection && currentSelection.endExclusive <= charIndex) {
- currentSelectionIndex++;
- currentSelection = selections && selections[currentSelectionIndex];
- }
- if (chCode !== 9 && chCode !== 32) {
- continue;
- }
- if (onlyTrailing && !lineIsEmptyOrWhitespace && charIndex <= lastNonWhitespaceIndex$1) {
- continue;
- }
- if (onlyBoundary && charIndex >= firstNonWhitespaceIndex$1 && charIndex <= lastNonWhitespaceIndex$1 && chCode === 32) {
- const prevChCode = charIndex - 1 >= 0 ? lineContent.charCodeAt(charIndex - 1) : 0;
- const nextChCode = charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : 0;
- if (prevChCode !== 32 && nextChCode !== 32) {
- continue;
- }
- }
- if (onlyBoundary && continuesWithWrappedLine && charIndex === len - 1) {
- const prevCharCode = charIndex - 1 >= 0 ? lineContent.charCodeAt(charIndex - 1) : 0;
- const isSingleTrailingSpace = chCode === 32 && (prevCharCode !== 32 && prevCharCode !== 9);
- if (isSingleTrailingSpace) {
- continue;
- }
- }
- if (selections && !(currentSelection && currentSelection.start <= charIndex && charIndex < currentSelection.endExclusive)) {
- continue;
- }
- const visibleRange = ctx.visibleRangeForPosition(new Position(lineNumber, charIndex + 1));
- if (!visibleRange) {
- continue;
- }
- if (USE_SVG) {
- maxLeft = Math.max(maxLeft, visibleRange.left);
- if (chCode === 9) {
- result += this._renderArrow(lineHeight, spaceWidth, visibleRange.left);
- } else {
- result += ` `;
- }
- } else {
- if (chCode === 9) {
- result += `${canUseHalfwidthRightwardsArrow ? String.fromCharCode(65515) : String.fromCharCode(8594)}
`;
- } else {
- result += `${String.fromCharCode(renderSpaceCharCode)}
`;
- }
- }
- }
- if (USE_SVG) {
- maxLeft = Math.round(maxLeft + spaceWidth);
- return `` + result + ` `;
- }
- return result;
- }
- _renderArrow(lineHeight, spaceWidth, left) {
- const strokeWidth = spaceWidth / 7;
- const width2 = spaceWidth;
- const dy = lineHeight / 2;
- const dx = left;
- const p1 = { x: 0, y: strokeWidth / 2 };
- const p2 = { x: 100 / 125 * width2, y: p1.y };
- const p3 = { x: p2.x - 0.2 * p2.x, y: p2.y + 0.2 * p2.x };
- const p4 = { x: p3.x + 0.1 * p2.x, y: p3.y + 0.1 * p2.x };
- const p5 = { x: p4.x + 0.35 * p2.x, y: p4.y - 0.35 * p2.x };
- const p6 = { x: p5.x, y: -p5.y };
- const p7 = { x: p4.x, y: -p4.y };
- const p8 = { x: p3.x, y: -p3.y };
- const p9 = { x: p2.x, y: -p2.y };
- const p10 = { x: p1.x, y: -p1.y };
- const p = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10];
- const parts = p.map((p11) => `${(dx + p11.x).toFixed(2)} ${(dy + p11.y).toFixed(2)}`).join(" L ");
- return ` `;
- }
- render(startLineNumber, lineNumber) {
- if (!this._renderResult) {
- return "";
- }
- const lineIndex = lineNumber - startLineNumber;
- if (lineIndex < 0 || lineIndex >= this._renderResult.length) {
- return "";
- }
- return this._renderResult[lineIndex];
- }
- };
- WhitespaceOptions = class {
- constructor(config) {
- const options = config.options;
- const fontInfo = options.get(
- 59
- /* EditorOption.fontInfo */
- );
- const experimentalWhitespaceRendering = options.get(
- 47
- /* EditorOption.experimentalWhitespaceRendering */
- );
- if (experimentalWhitespaceRendering === "off") {
- this.renderWhitespace = "none";
- this.renderWithSVG = false;
- } else if (experimentalWhitespaceRendering === "svg") {
- this.renderWhitespace = options.get(
- 113
- /* EditorOption.renderWhitespace */
- );
- this.renderWithSVG = true;
- } else {
- this.renderWhitespace = options.get(
- 113
- /* EditorOption.renderWhitespace */
- );
- this.renderWithSVG = false;
- }
- this.spaceWidth = fontInfo.spaceWidth;
- this.middotWidth = fontInfo.middotWidth;
- this.wsmiddotWidth = fontInfo.wsmiddotWidth;
- this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow;
- this.lineHeight = options.get(
- 75
- /* EditorOption.lineHeight */
- );
- this.stopRenderingLineAfter = options.get(
- 133
- /* EditorOption.stopRenderingLineAfter */
- );
- }
- equals(other) {
- return this.renderWhitespace === other.renderWhitespace && this.renderWithSVG === other.renderWithSVG && this.spaceWidth === other.spaceWidth && this.middotWidth === other.middotWidth && this.wsmiddotWidth === other.wsmiddotWidth && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.lineHeight === other.lineHeight && this.stopRenderingLineAfter === other.stopRenderingLineAfter;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js
-var ViewportData;
-var init_viewLinesViewportData = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js"() {
- init_range();
- ViewportData = class {
- constructor(selections, partialData, whitespaceViewportData, model) {
- this.selections = selections;
- this.startLineNumber = partialData.startLineNumber | 0;
- this.endLineNumber = partialData.endLineNumber | 0;
- this.relativeVerticalOffset = partialData.relativeVerticalOffset;
- this.bigNumbersDelta = partialData.bigNumbersDelta | 0;
- this.lineHeight = partialData.lineHeight | 0;
- this.whitespaceViewportData = whitespaceViewportData;
- this._model = model;
- this.visibleRange = new Range(partialData.startLineNumber, this._model.getLineMinColumn(partialData.startLineNumber), partialData.endLineNumber, this._model.getLineMaxColumn(partialData.endLineNumber));
- }
- getViewLineRenderingData(lineNumber) {
- return this._model.getViewportViewLineRenderingData(this.visibleRange, lineNumber);
- }
- getDecorationsInViewport() {
- return this._model.getDecorationsInViewport(this.visibleRange);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/editorTheme.js
-var EditorTheme;
-var init_editorTheme = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/editorTheme.js"() {
- EditorTheme = class {
- get type() {
- return this._theme.type;
- }
- get value() {
- return this._theme;
- }
- constructor(theme) {
- this._theme = theme;
- }
- update(theme) {
- this._theme = theme;
- }
- getColor(color) {
- return this._theme.getColor(color);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewContext.js
-var ViewContext;
-var init_viewContext = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewContext.js"() {
- init_editorTheme();
- ViewContext = class {
- constructor(configuration, theme, model) {
- this.configuration = configuration;
- this.theme = new EditorTheme(theme);
- this.viewModel = model;
- this.viewLayout = model.viewLayout;
- }
- addEventHandler(eventHandler) {
- this.viewModel.addViewEventHandler(eventHandler);
- }
- removeEventHandler(eventHandler) {
- this.viewModel.removeViewEventHandler(eventHandler);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/gpuUtils.js
-function ensureNonNullable(value) {
- if (!value) {
- throw new Error(`Value "${value}" cannot be null`);
- }
- return value;
-}
-function observeDevicePixelDimensions(element, parentWindow, callback) {
- let observer = new parentWindow.ResizeObserver((entries2) => {
- const entry = entries2.find((entry2) => entry2.target === element);
- if (!entry) {
- return;
- }
- if (!("devicePixelContentBoxSize" in entry)) {
- observer?.disconnect();
- observer = void 0;
- return;
- }
- const width2 = entry.devicePixelContentBoxSize[0].inlineSize;
- const height = entry.devicePixelContentBoxSize[0].blockSize;
- if (width2 > 0 && height > 0) {
- callback(width2, height);
- }
- });
- try {
- observer.observe(element, { box: ["device-pixel-content-box"] });
- } catch {
- observer.disconnect();
- observer = void 0;
- throw new BugIndicatingError("Could not observe device pixel dimensions");
- }
- return toDisposable(() => observer?.disconnect());
-}
-var quadVertices;
-var init_gpuUtils = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/gpuUtils.js"() {
- init_errors();
- init_lifecycle();
- quadVertices = new Float32Array([
- 1,
- 0,
- 1,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 1,
- 1,
- 0
- ]);
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/raster/glyphRasterizer.js
-var __decorate8, nextId, GlyphRasterizer;
-var init_glyphRasterizer = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/raster/glyphRasterizer.js"() {
- init_decorators();
- init_lifecycle();
- init_platform();
- init_stringBuilder();
- init_encodedTokenAttributes();
- init_gpuUtils();
- __decorate8 = 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;
- };
- nextId = 0;
- GlyphRasterizer = class extends Disposable {
- get cacheKey() {
- return `${this.fontFamily}_${this.fontSize}px`;
- }
- constructor(fontSize, fontFamily, devicePixelRatio, _decorationStyleCache) {
- super();
- this.fontSize = fontSize;
- this.fontFamily = fontFamily;
- this.devicePixelRatio = devicePixelRatio;
- this._decorationStyleCache = _decorationStyleCache;
- this.id = nextId++;
- this._workGlyph = {
- source: null,
- boundingBox: {
- left: 0,
- bottom: 0,
- right: 0,
- top: 0
- },
- originOffset: {
- x: 0,
- y: 0
- },
- fontBoundingBoxAscent: 0,
- fontBoundingBoxDescent: 0
- };
- this._workGlyphConfig = { chars: void 0, tokenMetadata: 0, decorationStyleSetId: 0 };
- this._antiAliasing = isMacintosh ? "greyscale" : "subpixel";
- const devicePixelFontSize = Math.ceil(this.fontSize * devicePixelRatio);
- this._canvas = new OffscreenCanvas(devicePixelFontSize * 3, devicePixelFontSize * 3);
- this._ctx = ensureNonNullable(this._canvas.getContext("2d", {
- willReadFrequently: true,
- alpha: this._antiAliasing === "greyscale"
- }));
- this._ctx.textBaseline = "top";
- this._ctx.fillStyle = "#FFFFFF";
- this._ctx.font = `${devicePixelFontSize}px ${this.fontFamily}`;
- this._textMetrics = this._ctx.measureText("A");
- }
- /**
- * Rasterizes a glyph. Note that the returned object is reused across different glyphs and
- * therefore is only safe for synchronous access.
- */
- rasterizeGlyph(chars, tokenMetadata, decorationStyleSetId, colorMap) {
- if (chars === "") {
- return {
- source: this._canvas,
- boundingBox: { top: 0, left: 0, bottom: -1, right: -1 },
- originOffset: { x: 0, y: 0 },
- fontBoundingBoxAscent: 0,
- fontBoundingBoxDescent: 0
- };
- }
- if (this._workGlyphConfig.chars === chars && this._workGlyphConfig.tokenMetadata === tokenMetadata && this._workGlyphConfig.decorationStyleSetId === decorationStyleSetId) {
- return this._workGlyph;
- }
- this._workGlyphConfig.chars = chars;
- this._workGlyphConfig.tokenMetadata = tokenMetadata;
- this._workGlyphConfig.decorationStyleSetId = decorationStyleSetId;
- return this._rasterizeGlyph(chars, tokenMetadata, decorationStyleSetId, colorMap);
- }
- _rasterizeGlyph(chars, tokenMetadata, decorationStyleSetId, colorMap) {
- const devicePixelFontSize = Math.ceil(this.fontSize * this.devicePixelRatio);
- const canvasDim = devicePixelFontSize * 3;
- if (this._canvas.width !== canvasDim) {
- this._canvas.width = canvasDim;
- this._canvas.height = canvasDim;
- }
- this._ctx.save();
- const xSubPixelXOffset = (tokenMetadata & 15) / 10;
- const bgId = TokenMetadata.getBackground(tokenMetadata);
- const bg = colorMap[bgId];
- const decorationStyleSet = this._decorationStyleCache.getStyleSet(decorationStyleSetId);
- if (this._antiAliasing === "subpixel") {
- this._ctx.fillStyle = bg;
- this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);
- } else {
- this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
- }
- const fontSb = new StringBuilder(200);
- const fontStyle = TokenMetadata.getFontStyle(tokenMetadata);
- if (fontStyle & 1) {
- fontSb.appendString("italic ");
- }
- if (decorationStyleSet?.bold !== void 0) {
- if (decorationStyleSet.bold) {
- fontSb.appendString("bold ");
- }
- } else if (fontStyle & 2) {
- fontSb.appendString("bold ");
- }
- fontSb.appendString(`${devicePixelFontSize}px ${this.fontFamily}`);
- this._ctx.font = fontSb.build();
- const originX = devicePixelFontSize;
- const originY = devicePixelFontSize;
- if (decorationStyleSet?.color !== void 0) {
- this._ctx.fillStyle = `#${decorationStyleSet.color.toString(16).padStart(8, "0")}`;
- } else {
- this._ctx.fillStyle = colorMap[TokenMetadata.getForeground(tokenMetadata)];
- }
- this._ctx.textBaseline = "top";
- if (decorationStyleSet?.opacity !== void 0) {
- this._ctx.globalAlpha = decorationStyleSet.opacity;
- }
- this._ctx.fillText(chars, originX + xSubPixelXOffset, originY);
- this._ctx.restore();
- const imageData = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height);
- if (this._antiAliasing === "subpixel") {
- const bgR = parseInt(bg.substring(1, 3), 16);
- const bgG = parseInt(bg.substring(3, 5), 16);
- const bgB = parseInt(bg.substring(5, 7), 16);
- this._clearColor(imageData, bgR, bgG, bgB);
- this._ctx.putImageData(imageData, 0, 0);
- }
- this._findGlyphBoundingBox(imageData, this._workGlyph.boundingBox);
- this._workGlyph.source = this._canvas;
- this._workGlyph.originOffset.x = this._workGlyph.boundingBox.left - originX;
- this._workGlyph.originOffset.y = this._workGlyph.boundingBox.top - originY;
- this._workGlyph.fontBoundingBoxAscent = this._textMetrics.fontBoundingBoxAscent;
- this._workGlyph.fontBoundingBoxDescent = this._textMetrics.fontBoundingBoxDescent;
- return this._workGlyph;
- }
- _clearColor(imageData, r, g, b) {
- for (let offset = 0; offset < imageData.data.length; offset += 4) {
- if (imageData.data[offset] === r && imageData.data[offset + 1] === g && imageData.data[offset + 2] === b) {
- imageData.data[offset + 3] = 0;
- }
- }
- }
- // TODO: Does this even need to happen when measure text is used?
- _findGlyphBoundingBox(imageData, outBoundingBox) {
- const height = this._canvas.height;
- const width2 = this._canvas.width;
- let found = false;
- for (let y = 0; y < height; y++) {
- for (let x = 0; x < width2; x++) {
- const alphaOffset = y * width2 * 4 + x * 4 + 3;
- if (imageData.data[alphaOffset] !== 0) {
- outBoundingBox.top = y;
- found = true;
- break;
- }
- }
- if (found) {
- break;
- }
- }
- outBoundingBox.left = 0;
- found = false;
- for (let x = 0; x < width2; x++) {
- for (let y = 0; y < height; y++) {
- const alphaOffset = y * width2 * 4 + x * 4 + 3;
- if (imageData.data[alphaOffset] !== 0) {
- outBoundingBox.left = x;
- found = true;
- break;
- }
- }
- if (found) {
- break;
- }
- }
- outBoundingBox.right = width2;
- found = false;
- for (let x = width2 - 1; x >= outBoundingBox.left; x--) {
- for (let y = 0; y < height; y++) {
- const alphaOffset = y * width2 * 4 + x * 4 + 3;
- if (imageData.data[alphaOffset] !== 0) {
- outBoundingBox.right = x;
- found = true;
- break;
- }
- }
- if (found) {
- break;
- }
- }
- outBoundingBox.bottom = outBoundingBox.top;
- found = false;
- for (let y = height - 1; y >= 0; y--) {
- for (let x = 0; x < width2; x++) {
- const alphaOffset = y * width2 * 4 + x * 4 + 3;
- if (imageData.data[alphaOffset] !== 0) {
- outBoundingBox.bottom = y;
- found = true;
- break;
- }
- }
- if (found) {
- break;
- }
- }
- }
- getTextMetrics(text2) {
- return this._ctx.measureText(text2);
- }
- };
- __decorate8([
- memoize
- ], GlyphRasterizer.prototype, "cacheKey", null);
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/taskQueue.js
-var __decorate9, __param7, TaskQueue2, PriorityTaskQueue, IdleTaskQueueInternal, IdleTaskQueue;
-var init_taskQueue = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/taskQueue.js"() {
- init_dom();
- init_lifecycle();
- init_log();
- __decorate9 = 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;
- };
- __param7 = function(paramIndex, decorator) {
- return function(target, key) {
- decorator(target, key, paramIndex);
- };
- };
- TaskQueue2 = class TaskQueue3 extends Disposable {
- constructor(_logService) {
- super();
- this._logService = _logService;
- this._tasks = [];
- this._i = 0;
- this._register(toDisposable(() => this.clear()));
- }
- enqueue(task) {
- this._tasks.push(task);
- this._start();
- }
- clear() {
- if (this._idleCallback) {
- this._cancelCallback(this._idleCallback);
- this._idleCallback = void 0;
- }
- this._i = 0;
- this._tasks.length = 0;
- }
- _start() {
- if (!this._idleCallback) {
- this._idleCallback = this._requestCallback(this._process.bind(this));
- }
- }
- _process(deadline) {
- this._idleCallback = void 0;
- let taskDuration = 0;
- let longestTask = 0;
- let lastDeadlineRemaining = deadline.timeRemaining();
- let deadlineRemaining = 0;
- while (this._i < this._tasks.length) {
- taskDuration = Date.now();
- if (!this._tasks[this._i]()) {
- this._i++;
- }
- taskDuration = Math.max(1, Date.now() - taskDuration);
- longestTask = Math.max(taskDuration, longestTask);
- deadlineRemaining = deadline.timeRemaining();
- if (longestTask * 1.5 > deadlineRemaining) {
- if (lastDeadlineRemaining - taskDuration < -20) {
- this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(lastDeadlineRemaining - taskDuration))}ms`);
- }
- this._start();
- return;
- }
- lastDeadlineRemaining = deadlineRemaining;
- }
- this.clear();
- }
- };
- TaskQueue2 = __decorate9([
- __param7(0, ILogService)
- ], TaskQueue2);
- PriorityTaskQueue = class extends TaskQueue2 {
- _requestCallback(callback) {
- return getActiveWindow().setTimeout(() => callback(this._createDeadline(16)));
- }
- _cancelCallback(identifier3) {
- getActiveWindow().clearTimeout(identifier3);
- }
- _createDeadline(duration) {
- const end = Date.now() + duration;
- return {
- timeRemaining: () => Math.max(0, end - Date.now())
- };
- }
- };
- IdleTaskQueueInternal = class extends TaskQueue2 {
- _requestCallback(callback) {
- return getActiveWindow().requestIdleCallback(callback);
- }
- _cancelCallback(identifier3) {
- getActiveWindow().cancelIdleCallback(identifier3);
- }
- };
- IdleTaskQueue = "requestIdleCallback" in getActiveWindow() ? IdleTaskQueueInternal : PriorityTaskQueue;
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.js
-var TextureAtlasShelfAllocator;
-var init_textureAtlasShelfAllocator = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.js"() {
- init_errors();
- init_gpuUtils();
- TextureAtlasShelfAllocator = class {
- constructor(_canvas, _textureIndex) {
- this._canvas = _canvas;
- this._textureIndex = _textureIndex;
- this._currentRow = {
- x: 0,
- y: 0,
- h: 0
- };
- this._allocatedGlyphs = /* @__PURE__ */ new Set();
- this._nextIndex = 0;
- this._ctx = ensureNonNullable(this._canvas.getContext("2d", {
- willReadFrequently: true
- }));
- }
- allocate(rasterizedGlyph) {
- const glyphWidth = rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1;
- const glyphHeight = rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1;
- if (glyphWidth > this._canvas.width || glyphHeight > this._canvas.height) {
- throw new BugIndicatingError("Glyph is too large for the atlas page");
- }
- if (rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1 > this._canvas.width - this._currentRow.x) {
- this._currentRow.x = 0;
- this._currentRow.y += this._currentRow.h;
- this._currentRow.h = 1;
- }
- if (this._currentRow.y + rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1 > this._canvas.height) {
- return void 0;
- }
- this._ctx.drawImage(
- rasterizedGlyph.source,
- // source
- rasterizedGlyph.boundingBox.left,
- rasterizedGlyph.boundingBox.top,
- glyphWidth,
- glyphHeight,
- // destination
- this._currentRow.x,
- this._currentRow.y,
- glyphWidth,
- glyphHeight
- );
- const glyph = {
- pageIndex: this._textureIndex,
- glyphIndex: this._nextIndex++,
- x: this._currentRow.x,
- y: this._currentRow.y,
- w: glyphWidth,
- h: glyphHeight,
- originOffsetX: rasterizedGlyph.originOffset.x,
- originOffsetY: rasterizedGlyph.originOffset.y,
- fontBoundingBoxAscent: rasterizedGlyph.fontBoundingBoxAscent,
- fontBoundingBoxDescent: rasterizedGlyph.fontBoundingBoxDescent
- };
- this._currentRow.x += glyphWidth;
- this._currentRow.h = Math.max(this._currentRow.h, glyphHeight);
- this._allocatedGlyphs.add(glyph);
- return glyph;
- }
- getUsagePreview() {
- const w = this._canvas.width;
- const h2 = this._canvas.height;
- const canvas = new OffscreenCanvas(w, h2);
- const ctx = ensureNonNullable(canvas.getContext("2d"));
- ctx.fillStyle = "#808080";
- ctx.fillRect(0, 0, w, h2);
- const rowHeight = /* @__PURE__ */ new Map();
- const rowWidth = /* @__PURE__ */ new Map();
- for (const g of this._allocatedGlyphs) {
- rowHeight.set(g.y, Math.max(rowHeight.get(g.y) ?? 0, g.h));
- rowWidth.set(g.y, Math.max(rowWidth.get(g.y) ?? 0, g.x + g.w));
- }
- for (const g of this._allocatedGlyphs) {
- ctx.fillStyle = "#4040FF";
- ctx.fillRect(g.x, g.y, g.w, g.h);
- ctx.fillStyle = "#FF0000";
- ctx.fillRect(g.x, g.y + g.h, g.w, rowHeight.get(g.y) - g.h);
- }
- for (const [rowY, rowW] of rowWidth.entries()) {
- if (rowY !== this._currentRow.y) {
- ctx.fillStyle = "#FF0000";
- ctx.fillRect(rowW, rowY, w - rowW, rowHeight.get(rowY));
- }
- }
- return canvas.convertToBlob();
- }
- getStats() {
- const w = this._canvas.width;
- const h2 = this._canvas.height;
- let usedPixels = 0;
- let wastedPixels = 0;
- const totalPixels = w * h2;
- const rowHeight = /* @__PURE__ */ new Map();
- const rowWidth = /* @__PURE__ */ new Map();
- for (const g of this._allocatedGlyphs) {
- rowHeight.set(g.y, Math.max(rowHeight.get(g.y) ?? 0, g.h));
- rowWidth.set(g.y, Math.max(rowWidth.get(g.y) ?? 0, g.x + g.w));
- }
- for (const g of this._allocatedGlyphs) {
- usedPixels += g.w * g.h;
- wastedPixels += g.w * (rowHeight.get(g.y) - g.h);
- }
- for (const [rowY, rowW] of rowWidth.entries()) {
- if (rowY !== this._currentRow.y) {
- wastedPixels += (w - rowW) * rowHeight.get(rowY);
- }
- }
- return [
- `page${this._textureIndex}:`,
- ` Total: ${totalPixels} (${w}x${h2})`,
- ` Used: ${usedPixels} (${(usedPixels / totalPixels * 100).toPrecision(2)}%)`,
- ` Wasted: ${wastedPixels} (${(wastedPixels / totalPixels * 100).toPrecision(2)}%)`,
- `Efficiency: ${(usedPixels / (usedPixels + wastedPixels) * 100).toPrecision(2)}%`
- ].join("\n");
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.js
-function addEntryToMapArray(map, key, entry) {
- let list2 = map.get(key);
- if (!list2) {
- list2 = [];
- map.set(key, list2);
- }
- list2.push(entry);
-}
-var TextureAtlasSlabAllocator;
-var init_textureAtlasSlabAllocator = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.js"() {
- init_dom();
- init_errors();
- init_map();
- init_gpuUtils();
- TextureAtlasSlabAllocator = class {
- constructor(_canvas, _textureIndex, options) {
- this._canvas = _canvas;
- this._textureIndex = _textureIndex;
- this._slabs = [];
- this._activeSlabsByDims = new NKeyMap();
- this._unusedRects = [];
- this._openRegionsByHeight = /* @__PURE__ */ new Map();
- this._openRegionsByWidth = /* @__PURE__ */ new Map();
- this._allocatedGlyphs = /* @__PURE__ */ new Set();
- this._nextIndex = 0;
- this._ctx = ensureNonNullable(this._canvas.getContext("2d", {
- willReadFrequently: true
- }));
- this._slabW = Math.min(options?.slabW ?? 64 << Math.max(Math.floor(getActiveWindow().devicePixelRatio) - 1, 0), this._canvas.width);
- this._slabH = Math.min(options?.slabH ?? this._slabW, this._canvas.height);
- this._slabsPerRow = Math.floor(this._canvas.width / this._slabW);
- this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
- }
- allocate(rasterizedGlyph) {
- const glyphWidth = rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1;
- const glyphHeight = rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1;
- if (glyphWidth > this._canvas.width || glyphHeight > this._canvas.height) {
- throw new BugIndicatingError("Glyph is too large for the atlas page");
- }
- if (glyphWidth > this._slabW || glyphHeight > this._slabH) {
- if (this._allocatedGlyphs.size > 0) {
- return void 0;
- }
- let sizeCandidate = this._canvas.width;
- while (glyphWidth < sizeCandidate / 2 && glyphHeight < sizeCandidate / 2) {
- sizeCandidate /= 2;
- }
- this._slabW = sizeCandidate;
- this._slabH = sizeCandidate;
- this._slabsPerRow = Math.floor(this._canvas.width / this._slabW);
- this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
- }
- const desiredSlabSize = {
- // Nearest square number
- // TODO: This can probably be optimized
- // w: 1 << Math.ceil(Math.sqrt(glyphWidth)),
- // h: 1 << Math.ceil(Math.sqrt(glyphHeight)),
- // Nearest x px
- // w: Math.ceil(glyphWidth / nearestXPixels) * nearestXPixels,
- // h: Math.ceil(glyphHeight / nearestXPixels) * nearestXPixels,
- // Round odd numbers up
- // w: glyphWidth % 0 === 1 ? glyphWidth + 1 : glyphWidth,
- // h: glyphHeight % 0 === 1 ? glyphHeight + 1 : glyphHeight,
- // Exact number only
- w: glyphWidth,
- h: glyphHeight
- };
- let slab = this._activeSlabsByDims.get(desiredSlabSize.w, desiredSlabSize.h);
- if (slab) {
- const glyphsPerSlab = Math.floor(this._slabW / slab.entryW) * Math.floor(this._slabH / slab.entryH);
- if (slab.count >= glyphsPerSlab) {
- slab = void 0;
- }
- }
- let dx;
- let dy;
- if (!slab) {
- if (glyphWidth < glyphHeight) {
- const openRegions = this._openRegionsByWidth.get(glyphWidth);
- if (openRegions?.length) {
- for (let i2 = openRegions.length - 1; i2 >= 0; i2--) {
- const r = openRegions[i2];
- if (r.w >= glyphWidth && r.h >= glyphHeight) {
- dx = r.x;
- dy = r.y;
- if (glyphWidth < r.w) {
- this._unusedRects.push({
- x: r.x + glyphWidth,
- y: r.y,
- w: r.w - glyphWidth,
- h: glyphHeight
- });
- }
- r.y += glyphHeight;
- r.h -= glyphHeight;
- if (r.h === 0) {
- if (i2 === openRegions.length - 1) {
- openRegions.pop();
- } else {
- this._unusedRects.splice(i2, 1);
- }
- }
- break;
- }
- }
- }
- } else {
- const openRegions = this._openRegionsByHeight.get(glyphHeight);
- if (openRegions?.length) {
- for (let i2 = openRegions.length - 1; i2 >= 0; i2--) {
- const r = openRegions[i2];
- if (r.w >= glyphWidth && r.h >= glyphHeight) {
- dx = r.x;
- dy = r.y;
- if (glyphHeight < r.h) {
- this._unusedRects.push({
- x: r.x,
- y: r.y + glyphHeight,
- w: glyphWidth,
- h: r.h - glyphHeight
- });
- }
- r.x += glyphWidth;
- r.w -= glyphWidth;
- if (r.h === 0) {
- if (i2 === openRegions.length - 1) {
- openRegions.pop();
- } else {
- this._unusedRects.splice(i2, 1);
- }
- }
- break;
- }
- }
- }
- }
- }
- if (dx === void 0 || dy === void 0) {
- if (!slab) {
- if (this._slabs.length >= this._slabsPerRow * this._slabsPerColumn) {
- return void 0;
- }
- slab = {
- x: Math.floor(this._slabs.length % this._slabsPerRow) * this._slabW,
- y: Math.floor(this._slabs.length / this._slabsPerRow) * this._slabH,
- entryW: desiredSlabSize.w,
- entryH: desiredSlabSize.h,
- count: 0
- };
- const unusedW = this._slabW % slab.entryW;
- const unusedH = this._slabH % slab.entryH;
- if (unusedW) {
- addEntryToMapArray(this._openRegionsByWidth, unusedW, {
- x: slab.x + this._slabW - unusedW,
- w: unusedW,
- y: slab.y,
- h: this._slabH - (unusedH ?? 0)
- });
- }
- if (unusedH) {
- addEntryToMapArray(this._openRegionsByHeight, unusedH, {
- x: slab.x,
- w: this._slabW,
- y: slab.y + this._slabH - unusedH,
- h: unusedH
- });
- }
- this._slabs.push(slab);
- this._activeSlabsByDims.set(slab, desiredSlabSize.w, desiredSlabSize.h);
- }
- const glyphsPerRow = Math.floor(this._slabW / slab.entryW);
- dx = slab.x + Math.floor(slab.count % glyphsPerRow) * slab.entryW;
- dy = slab.y + Math.floor(slab.count / glyphsPerRow) * slab.entryH;
- slab.count++;
- }
- this._ctx.drawImage(
- rasterizedGlyph.source,
- // source
- rasterizedGlyph.boundingBox.left,
- rasterizedGlyph.boundingBox.top,
- glyphWidth,
- glyphHeight,
- // destination
- dx,
- dy,
- glyphWidth,
- glyphHeight
- );
- const glyph = {
- pageIndex: this._textureIndex,
- glyphIndex: this._nextIndex++,
- x: dx,
- y: dy,
- w: glyphWidth,
- h: glyphHeight,
- originOffsetX: rasterizedGlyph.originOffset.x,
- originOffsetY: rasterizedGlyph.originOffset.y,
- fontBoundingBoxAscent: rasterizedGlyph.fontBoundingBoxAscent,
- fontBoundingBoxDescent: rasterizedGlyph.fontBoundingBoxDescent
- };
- this._allocatedGlyphs.add(glyph);
- return glyph;
- }
- getUsagePreview() {
- const w = this._canvas.width;
- const h2 = this._canvas.height;
- const canvas = new OffscreenCanvas(w, h2);
- const ctx = ensureNonNullable(canvas.getContext("2d"));
- ctx.fillStyle = "#808080";
- ctx.fillRect(0, 0, w, h2);
- let slabEntryPixels = 0;
- let usedPixels = 0;
- let restrictedPixels = 0;
- const slabW = 64 << Math.floor(getActiveWindow().devicePixelRatio) - 1;
- const slabH = slabW;
- for (const slab of this._slabs) {
- let x = 0;
- let y = 0;
- for (let i2 = 0; i2 < slab.count; i2++) {
- if (x + slab.entryW > slabW) {
- x = 0;
- y += slab.entryH;
- }
- ctx.fillStyle = "#FF0000";
- ctx.fillRect(slab.x + x, slab.y + y, slab.entryW, slab.entryH);
- slabEntryPixels += slab.entryW * slab.entryH;
- x += slab.entryW;
- }
- const entriesPerRow = Math.floor(slabW / slab.entryW);
- const entriesPerCol = Math.floor(slabH / slab.entryH);
- slab.entryW * entriesPerRow * slab.entryH * entriesPerCol;
- }
- for (const g of this._allocatedGlyphs) {
- usedPixels += g.w * g.h;
- ctx.fillStyle = "#4040FF";
- ctx.fillRect(g.x, g.y, g.w, g.h);
- }
- const unusedRegions = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
- for (const r of unusedRegions) {
- ctx.fillStyle = "#FF000088";
- ctx.fillRect(r.x, r.y, r.w, r.h);
- restrictedPixels += r.w * r.h;
- }
- ctx.globalAlpha = 0.5;
- ctx.drawImage(this._canvas, 0, 0);
- ctx.globalAlpha = 1;
- return canvas.convertToBlob();
- }
- getStats() {
- const w = this._canvas.width;
- const h2 = this._canvas.height;
- let slabEntryPixels = 0;
- let usedPixels = 0;
- let slabEdgePixels = 0;
- let wastedPixels = 0;
- let restrictedPixels = 0;
- const totalPixels = w * h2;
- const slabW = 64 << Math.floor(getActiveWindow().devicePixelRatio) - 1;
- const slabH = slabW;
- for (const slab of this._slabs) {
- let x = 0;
- let y = 0;
- for (let i2 = 0; i2 < slab.count; i2++) {
- if (x + slab.entryW > slabW) {
- x = 0;
- y += slab.entryH;
- }
- slabEntryPixels += slab.entryW * slab.entryH;
- x += slab.entryW;
- }
- const entriesPerRow = Math.floor(slabW / slab.entryW);
- const entriesPerCol = Math.floor(slabH / slab.entryH);
- const thisSlabPixels = slab.entryW * entriesPerRow * slab.entryH * entriesPerCol;
- slabEdgePixels += slabW * slabH - thisSlabPixels;
- }
- for (const g of this._allocatedGlyphs) {
- usedPixels += g.w * g.h;
- }
- const unusedRegions = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
- for (const r of unusedRegions) {
- restrictedPixels += r.w * r.h;
- }
- const edgeUsedPixels = slabEdgePixels - restrictedPixels;
- wastedPixels = slabEntryPixels - (usedPixels - edgeUsedPixels);
- const efficiency = usedPixels / (usedPixels + wastedPixels + restrictedPixels);
- return [
- `page[${this._textureIndex}]:`,
- ` Total: ${totalPixels}px (${w}x${h2})`,
- ` Used: ${usedPixels}px (${(usedPixels / totalPixels * 100).toFixed(2)}%)`,
- ` Wasted: ${wastedPixels}px (${(wastedPixels / totalPixels * 100).toFixed(2)}%)`,
- `Restricted: ${restrictedPixels}px (${(restrictedPixels / totalPixels * 100).toFixed(2)}%) (hard to allocate)`,
- `Efficiency: ${efficiency === 1 ? "100" : (efficiency * 100).toFixed(2)}%`,
- ` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width / slabW) * Math.floor(this._canvas.height / slabH)}`
- ].join("\n");
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasPage.js
-var __decorate10, __param8, TextureAtlasPage_1, TextureAtlasPage;
-var init_textureAtlasPage = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlasPage.js"() {
- init_lifecycle();
- init_map();
- init_log();
- init_themeService();
- init_textureAtlasShelfAllocator();
- init_textureAtlasSlabAllocator();
- __decorate10 = 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;
- };
- __param8 = function(paramIndex, decorator) {
- return function(target, key) {
- decorator(target, key, paramIndex);
- };
- };
- TextureAtlasPage = class TextureAtlasPage2 extends Disposable {
- static {
- TextureAtlasPage_1 = this;
- }
- get version() {
- return this._version;
- }
- static {
- this.maximumGlyphCount = 5e3;
- }
- get usedArea() {
- return this._usedArea;
- }
- get source() {
- return this._canvas;
- }
- get glyphs() {
- return this._glyphInOrderSet.values();
- }
- constructor(textureIndex, pageSize, allocatorType, _logService, themeService) {
- super();
- this._logService = _logService;
- this._version = 0;
- this._usedArea = { left: 0, top: 0, right: 0, bottom: 0 };
- this._glyphMap = new NKeyMap();
- this._glyphInOrderSet = /* @__PURE__ */ new Set();
- this._canvas = new OffscreenCanvas(pageSize, pageSize);
- this._colorMap = themeService.getColorTheme().tokenColorMap;
- switch (allocatorType) {
- case "shelf":
- this._allocator = new TextureAtlasShelfAllocator(this._canvas, textureIndex);
- break;
- case "slab":
- this._allocator = new TextureAtlasSlabAllocator(this._canvas, textureIndex);
- break;
- default:
- this._allocator = allocatorType(this._canvas, textureIndex);
- break;
- }
- this._register(toDisposable(() => {
- this._canvas.width = 1;
- this._canvas.height = 1;
- }));
- }
- getGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId) {
- return this._glyphMap.get(chars, tokenMetadata, decorationStyleSetId, rasterizer.cacheKey) ?? this._createGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId);
- }
- _createGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId) {
- if (this._glyphInOrderSet.size >= TextureAtlasPage_1.maximumGlyphCount) {
- return void 0;
- }
- const rasterizedGlyph = rasterizer.rasterizeGlyph(chars, tokenMetadata, decorationStyleSetId, this._colorMap);
- const glyph = this._allocator.allocate(rasterizedGlyph);
- if (glyph === void 0) {
- return void 0;
- }
- this._glyphMap.set(glyph, chars, tokenMetadata, decorationStyleSetId, rasterizer.cacheKey);
- this._glyphInOrderSet.add(glyph);
- this._version++;
- this._usedArea.right = Math.max(this._usedArea.right, glyph.x + glyph.w - 1);
- this._usedArea.bottom = Math.max(this._usedArea.bottom, glyph.y + glyph.h - 1);
- if (this._logService.getLevel() === LogLevel.Trace) {
- this._logService.trace("New glyph", {
- chars,
- tokenMetadata,
- decorationStyleSetId,
- rasterizedGlyph,
- glyph
- });
- }
- return glyph;
- }
- getUsagePreview() {
- return this._allocator.getUsagePreview();
- }
- getStats() {
- return this._allocator.getStats();
- }
- };
- TextureAtlasPage = TextureAtlasPage_1 = __decorate10([
- __param8(3, ILogService),
- __param8(4, IThemeService)
- ], TextureAtlasPage);
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlas.js
-var __decorate11, __param9, TextureAtlas_1, TextureAtlas;
-var init_textureAtlas = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/atlas/textureAtlas.js"() {
- init_dom();
- init_errors();
- init_event();
- init_lifecycle();
- init_map();
- init_instantiation();
- init_themeService();
- init_glyphRasterizer();
- init_taskQueue();
- init_textureAtlasPage();
- __decorate11 = 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;
- };
- __param9 = function(paramIndex, decorator) {
- return function(target, key) {
- decorator(target, key, paramIndex);
- };
- };
- TextureAtlas = class TextureAtlas2 extends Disposable {
- static {
- TextureAtlas_1 = this;
- }
- static {
- this.maximumPageCount = 16;
- }
- get pages() {
- return this._pages;
- }
- constructor(_maxTextureSize, options, _decorationStyleCache, _themeService, _instantiationService) {
- super();
- this._maxTextureSize = _maxTextureSize;
- this._decorationStyleCache = _decorationStyleCache;
- this._themeService = _themeService;
- this._instantiationService = _instantiationService;
- this._warmUpTask = this._register(new MutableDisposable());
- this._warmedUpRasterizers = /* @__PURE__ */ new Set();
- this._pages = [];
- this._glyphPageIndex = new NKeyMap();
- this._onDidDeleteGlyphs = this._register(new Emitter());
- this.onDidDeleteGlyphs = this._onDidDeleteGlyphs.event;
- this._allocatorType = options?.allocatorType ?? "slab";
- this._register(Event.runAndSubscribe(this._themeService.onDidColorThemeChange, () => {
- if (this._colorMap) {
- this.clear();
- }
- this._colorMap = this._themeService.getColorTheme().tokenColorMap;
- }));
- const dprFactor = Math.max(1, Math.floor(getActiveWindow().devicePixelRatio));
- this.pageSize = Math.min(1024 * dprFactor, this._maxTextureSize);
- this._initFirstPage();
- this._register(toDisposable(() => dispose(this._pages)));
- }
- _initFirstPage() {
- const firstPage = this._instantiationService.createInstance(TextureAtlasPage, 0, this.pageSize, this._allocatorType);
- this._pages.push(firstPage);
- const nullRasterizer = new GlyphRasterizer(1, "", 1, this._decorationStyleCache);
- firstPage.getGlyph(nullRasterizer, "", 0, 0);
- nullRasterizer.dispose();
- }
- clear() {
- for (const page of this._pages) {
- page.dispose();
- }
- this._pages.length = 0;
- this._glyphPageIndex.clear();
- this._warmedUpRasterizers.clear();
- this._warmUpTask.clear();
- this._initFirstPage();
- this._onDidDeleteGlyphs.fire();
- }
- getGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId, x) {
- tokenMetadata &= -2048;
- tokenMetadata |= Math.floor(x % 1 * 10);
- if (!this._warmedUpRasterizers.has(rasterizer.id)) {
- this._warmUpAtlas(rasterizer);
- this._warmedUpRasterizers.add(rasterizer.id);
- }
- return this._tryGetGlyph(this._glyphPageIndex.get(chars, tokenMetadata, decorationStyleSetId, rasterizer.cacheKey) ?? 0, rasterizer, chars, tokenMetadata, decorationStyleSetId);
- }
- _tryGetGlyph(pageIndex, rasterizer, chars, tokenMetadata, decorationStyleSetId) {
- this._glyphPageIndex.set(pageIndex, chars, tokenMetadata, decorationStyleSetId, rasterizer.cacheKey);
- return this._pages[pageIndex].getGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId) ?? (pageIndex + 1 < this._pages.length ? this._tryGetGlyph(pageIndex + 1, rasterizer, chars, tokenMetadata, decorationStyleSetId) : void 0) ?? this._getGlyphFromNewPage(rasterizer, chars, tokenMetadata, decorationStyleSetId);
- }
- _getGlyphFromNewPage(rasterizer, chars, tokenMetadata, decorationStyleSetId) {
- if (this._pages.length >= TextureAtlas_1.maximumPageCount) {
- throw new Error(`Attempt to create a texture atlas page past the limit ${TextureAtlas_1.maximumPageCount}`);
- }
- this._pages.push(this._instantiationService.createInstance(TextureAtlasPage, this._pages.length, this.pageSize, this._allocatorType));
- this._glyphPageIndex.set(this._pages.length - 1, chars, tokenMetadata, decorationStyleSetId, rasterizer.cacheKey);
- return this._pages[this._pages.length - 1].getGlyph(rasterizer, chars, tokenMetadata, decorationStyleSetId);
- }
- getStats() {
- return this._pages.map((e) => e.getStats());
- }
- /**
- * Warms up the atlas by rasterizing all printable ASCII characters for each token color. This
- * is distrubuted over multiple idle callbacks to avoid blocking the main thread.
- */
- _warmUpAtlas(rasterizer) {
- const colorMap = this._colorMap;
- if (!colorMap) {
- throw new BugIndicatingError("Cannot warm atlas without color map");
- }
- this._warmUpTask.value?.clear();
- const taskQueue = this._warmUpTask.value = this._instantiationService.createInstance(IdleTaskQueue);
- for (let code = 65; code <= 90; code++) {
- for (const fgColor of colorMap.keys()) {
- taskQueue.enqueue(() => {
- for (let x = 0; x < 1; x += 0.1) {
- this.getGlyph(rasterizer, String.fromCharCode(code), fgColor << 15 & 16744448, 0, x);
- }
- });
- }
- }
- for (let code = 97; code <= 122; code++) {
- for (const fgColor of colorMap.keys()) {
- taskQueue.enqueue(() => {
- for (let x = 0; x < 1; x += 0.1) {
- this.getGlyph(rasterizer, String.fromCharCode(code), fgColor << 15 & 16744448, 0, x);
- }
- });
- }
- }
- for (let code = 33; code <= 126; code++) {
- for (const fgColor of colorMap.keys()) {
- taskQueue.enqueue(() => {
- for (let x = 0; x < 1; x += 0.1) {
- this.getGlyph(rasterizer, String.fromCharCode(code), fgColor << 15 & 16744448, 0, x);
- }
- });
- }
- }
- }
- };
- TextureAtlas = TextureAtlas_1 = __decorate11([
- __param9(3, IThemeService),
- __param9(4, IInstantiationService)
- ], TextureAtlas);
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/base/common/severity.js
-var Severity, Severity$1;
-var init_severity = __esm({
- "../node_modules/monaco-editor/esm/vs/base/common/severity.js"() {
- init_strings();
- (function(Severity3) {
- Severity3[Severity3["Ignore"] = 0] = "Ignore";
- Severity3[Severity3["Info"] = 1] = "Info";
- Severity3[Severity3["Warning"] = 2] = "Warning";
- Severity3[Severity3["Error"] = 3] = "Error";
- })(Severity || (Severity = {}));
- (function(Severity3) {
- const _error = "error";
- const _warning = "warning";
- const _warn = "warn";
- const _info = "info";
- const _ignore = "ignore";
- function fromValue(value) {
- if (!value) {
- return Severity3.Ignore;
- }
- if (equalsIgnoreCase(_error, value)) {
- return Severity3.Error;
- }
- if (equalsIgnoreCase(_warning, value) || equalsIgnoreCase(_warn, value)) {
- return Severity3.Warning;
- }
- if (equalsIgnoreCase(_info, value)) {
- return Severity3.Info;
- }
- return Severity3.Ignore;
- }
- Severity3.fromValue = fromValue;
- function toString(severity) {
- switch (severity) {
- case Severity3.Error:
- return _error;
- case Severity3.Warning:
- return _warning;
- case Severity3.Info:
- return _info;
- default:
- return _ignore;
- }
- }
- Severity3.toString = toString;
- })(Severity || (Severity = {}));
- Severity$1 = Severity;
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js
-var Severity2, INotificationService, NoOpNotification;
-var init_notification = __esm({
- "../node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"() {
- init_severity();
- init_instantiation();
- Severity2 = Severity$1;
- INotificationService = createDecorator("notificationService");
- NoOpNotification = class {
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/gpuDisposable.js
-function wrapDestroyableInDisposable(value) {
- return {
- object: value,
- dispose: () => value.destroy()
- };
-}
-var GPULifecycle;
-var init_gpuDisposable = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/gpuDisposable.js"() {
- init_types();
- (function(GPULifecycle2) {
- async function requestDevice(fallback2) {
- try {
- if (!navigator.gpu) {
- throw new Error("This browser does not support WebGPU");
- }
- const adapter = await navigator.gpu.requestAdapter();
- if (!adapter) {
- throw new Error("This browser supports WebGPU but it appears to be disabled");
- }
- return wrapDestroyableInDisposable(await adapter.requestDevice());
- } catch (e) {
- if (fallback2) {
- fallback2(e.message);
- }
- throw e;
- }
- }
- GPULifecycle2.requestDevice = requestDevice;
- function createBuffer(device, descriptor, initialValues) {
- const buffer = device.createBuffer(descriptor);
- if (initialValues) {
- device.queue.writeBuffer(buffer, 0, isFunction(initialValues) ? initialValues() : initialValues);
- }
- return wrapDestroyableInDisposable(buffer);
- }
- GPULifecycle2.createBuffer = createBuffer;
- function createTexture(device, descriptor) {
- return wrapDestroyableInDisposable(device.createTexture(descriptor));
- }
- GPULifecycle2.createTexture = createTexture;
- })(GPULifecycle || (GPULifecycle = {}));
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/bufferDirtyTracker.js
-var BufferDirtyTracker;
-var init_bufferDirtyTracker = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/bufferDirtyTracker.js"() {
- BufferDirtyTracker = class {
- get dataOffset() {
- return this._startIndex;
- }
- get dirtySize() {
- if (this._startIndex === void 0 || this._endIndex === void 0) {
- return void 0;
- }
- return this._endIndex - this._startIndex + 1;
- }
- get isDirty() {
- return this._startIndex !== void 0;
- }
- /**
- * Flag the index(es) as modified. Returns the index flagged.
- * @param index An index to flag.
- * @param length An optional length to flag. Defaults to 1.
- */
- flag(index, length = 1) {
- this._flag(index);
- if (length > 1) {
- this._flag(index + length - 1);
- }
- return index;
- }
- _flag(index) {
- if (this._startIndex === void 0 || index < this._startIndex) {
- this._startIndex = index;
- }
- if (this._endIndex === void 0 || index > this._endIndex) {
- this._endIndex = index;
- }
- }
- clear() {
- this._startIndex = void 0;
- this._endIndex = void 0;
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/objectCollectionBuffer.js
-function createObjectCollectionBuffer(propertySpecs, capacity) {
- return new ObjectCollectionBuffer(propertySpecs, capacity);
-}
-var ObjectCollectionBuffer, ObjectCollectionBufferEntry;
-var init_objectCollectionBuffer = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/objectCollectionBuffer.js"() {
- init_event();
- init_lifecycle();
- init_linkedList();
- init_bufferDirtyTracker();
- ObjectCollectionBuffer = class extends Disposable {
- get entryCount() {
- return this._entries.size;
- }
- get dirtyTracker() {
- return this._dirtyTracker;
- }
- constructor(propertySpecs, capacity) {
- super();
- this.propertySpecs = propertySpecs;
- this.capacity = capacity;
- this._dirtyTracker = new BufferDirtyTracker();
- this._propertySpecsMap = /* @__PURE__ */ new Map();
- this._entries = new LinkedList();
- this._onDidChange = this._register(new Emitter());
- this._onDidChangeBuffer = this._register(new Emitter());
- this.onDidChangeBuffer = this._onDidChangeBuffer.event;
- this.view = new Float32Array(capacity * propertySpecs.length);
- this.buffer = this.view.buffer;
- this._entrySize = propertySpecs.length;
- for (let i2 = 0; i2 < propertySpecs.length; i2++) {
- const spec = {
- offset: i2,
- ...propertySpecs[i2]
- };
- this._propertySpecsMap.set(spec.name, spec);
- }
- this._register(toDisposable(() => dispose(this._entries)));
- }
- createEntry(data) {
- if (this._entries.size === this.capacity) {
- this._expandBuffer();
- this._onDidChangeBuffer.fire();
- }
- const value = new ObjectCollectionBufferEntry(this.view, this._propertySpecsMap, this._dirtyTracker, this._entries.size, data);
- const removeFromEntries = this._entries.push(value);
- const listeners = [];
- listeners.push(Event.forward(value.onDidChange, this._onDidChange));
- listeners.push(value.onWillDispose(() => {
- const deletedEntryIndex = value.i;
- removeFromEntries();
- this.view.set(this.view.subarray(deletedEntryIndex * this._entrySize + 2, this._entries.size * this._entrySize + 2), deletedEntryIndex * this._entrySize);
- for (const entry of this._entries) {
- if (entry.i > deletedEntryIndex) {
- entry.i--;
- }
- }
- this._dirtyTracker.flag(deletedEntryIndex, (this._entries.size - deletedEntryIndex) * this._entrySize);
- dispose(listeners);
- }));
- return value;
- }
- _expandBuffer() {
- this.capacity *= 2;
- const newView = new Float32Array(this.capacity * this._entrySize);
- newView.set(this.view);
- this.view = newView;
- this.buffer = this.view.buffer;
- }
- };
- ObjectCollectionBufferEntry = class extends Disposable {
- constructor(_view, _propertySpecsMap, _dirtyTracker, i2, data) {
- super();
- this._view = _view;
- this._propertySpecsMap = _propertySpecsMap;
- this._dirtyTracker = _dirtyTracker;
- this.i = i2;
- this._onDidChange = this._register(new Emitter());
- this.onDidChange = this._onDidChange.event;
- this._onWillDispose = this._register(new Emitter());
- this.onWillDispose = this._onWillDispose.event;
- for (const propertySpec of this._propertySpecsMap.values()) {
- this._view[this.i * this._propertySpecsMap.size + propertySpec.offset] = data[propertySpec.name];
- }
- this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
- }
- dispose() {
- this._onWillDispose.fire();
- super.dispose();
- }
- setRaw(data) {
- if (data.length !== this._propertySpecsMap.size) {
- throw new Error(`Data length ${data.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);
- }
- this._view.set(data, this.i * this._propertySpecsMap.size);
- this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
- }
- };
- }
-});
-
-// ../node_modules/monaco-editor/esm/vs/editor/browser/gpu/rectangleRenderer.wgsl.js
-var rectangleRendererWgsl;
-var init_rectangleRenderer_wgsl = __esm({
- "../node_modules/monaco-editor/esm/vs/editor/browser/gpu/rectangleRenderer.wgsl.js"() {
- rectangleRendererWgsl = /*wgsl*/
- `
+ `,constraint:e,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:!1},noHistory:{type:"boolean",default:!1}}}}]},n.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"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let o;switch(i.to){case n.RawDirection.Left:o=0;break;case n.RawDirection.Right:o=1;break;case n.RawDirection.Up:o=2;break;case n.RawDirection.Down:o=3;break;case n.RawDirection.PrevBlankLine:o=4;break;case n.RawDirection.NextBlankLine:o=5;break;case n.RawDirection.WrappedLineStart:o=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:o=7;break;case n.RawDirection.WrappedLineColumnCenter:o=8;break;case n.RawDirection.WrappedLineEnd:o=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:o=10;break;case n.RawDirection.ViewPortTop:o=11;break;case n.RawDirection.ViewPortBottom:o=13;break;case n.RawDirection.ViewPortCenter:o=12;break;case n.RawDirection.ViewPortIfOutside:o=14;break;default:return null}let r=0;switch(i.by){case n.RawUnit.Line:r=1;break;case n.RawUnit.WrappedLine:r=2;break;case n.RawUnit.Character:r=3;break;case n.RawUnit.HalfLine:r=4;break}return{direction:o,unit:r,select:!!i.select,value:i.value||1,noHistory:!!i.noHistory}}n.parse=t})(AD||(AD={}))});function MD(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}var so,Fy,_F,pv=w(()=>{(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(so||(so={}));Fy=class{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}function PD(n){let e=OD;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}function _v(n,e,t,i,o){if(e=PD(e),o||(o=ht.first(hve)),t.length>o.maxLen){let c=n-o.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+o.maxLen/2),_v(n,e,t,i,o)}let r=Date.now(),s=n-1-i,a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){let d=s-o.windowSize*c;e.lastIndex=Math.max(0,d);let h=E9e(e,t,s,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){let c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function E9e(n,e,t,i){let o;for(;o=n.exec(e);){let r=o.index||0;if(r<=t&&n.lastIndex>=t)return o;if(i>0&&r>i)return null}return null}var By,OD,hve,nx=w(()=>{bl();_d();By="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";OD=I9e();hve=new Fn;hve.unshift({maxLen:1e3,windowSize:15,timeBudget:150})});var bF,uve=w(()=>{pv();bF=class n{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
+ `}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
+ `}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Fy(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Fy({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){let t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Fy({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}});function fve(){return GY||(GY=new TextDecoder("UTF-16LE")),GY}function D9e(){return YY||(YY=new TextDecoder("UTF-16BE")),YY}function XY(){return ZY||(ZY=LO()?fve():D9e()),ZY}function mve(n,e,t){let i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?T9e(n,e,t):fve().decode(i)}function T9e(n,e,t){let i=[],o=0;for(let r=0;r{He();ct();ev();zl=class{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";let e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return XY().decode(e)}_flushBuffer(){let e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){let t=this._capacity-this._bufferLength;t<=1&&(t===0||Dn(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){let t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[s[0].toLowerCase(),s[1].toLowerCase()]);let t=[];for(let s=0;s{let[l,c]=s,[d,h]=a;return l===d||l===h||c===d||c===h},o=(s,a)=>{let l=Math.min(s,a),c=Math.max(s,a);for(let d=0;d0&&r.push({open:a,close:l})}return r}function gve(n,e,t,i){for(let o=0,r=e.length;o=0&&i.push(a);for(let a of s.close)a.indexOf(n)>=0&&i.push(a)}}function pve(n,e){return n.length-e.length}function wF(n){if(n.length<=1)return n;let e=[],t=new Set;for(let i of n)t.has(i)||(e.push(i),t.add(i));return e}function R9e(n,e,t,i){let o=[];o=o.concat(n),o=o.concat(e);for(let r=0,s=o.length;r{He();Gf();de();QY=class n{constructor(e,t,i,o,r,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=o,this.forwardRegex=r,this.reversedRegex=s,this._openSet=n._toSet(this.open),this._closeSet=n._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){let t=new Set;for(let i of e)t.add(i);return t}};vF=class{constructor(e,t){this._richEditBracketsBrand=void 0;let i=N9e(t);this.brackets=i.map((o,r)=>new QY(e,r,o.open,o.close,R9e(o.open,o.close,i,r),A9e(o.open,o.close,i,r))),this.forwardRegex=M9e(this.brackets),this.reversedRegex=O9e(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(let o of this.brackets){for(let r of o.open)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(let r of o.close)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}};JY=function(){function n(i){let o=new Uint16Array(i.length),r=0;for(let s=i.length-1;s>=0;s--)o[r++]=i.charCodeAt(s);return XY().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=n(e)),t}}(),jc=class{static _findPrevBracketInText(e,t,i,o){let r=i.match(e);if(!r)return null;let s=i.length-(r.index||0),a=r[0].length,l=o+s;return new y(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,o,r){let a=JY(i).substring(i.length-r,i.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,i,o){let r=i.match(e);if(!r)return null;let s=r.index||0,a=r[0].length;if(a===0)return null;let l=o+s;return new y(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,o,r){let s=i.substring(o,r);return this.findNextBracketInText(e,t,s,o)}}});var CF,_ve=w(()=>{We();Ny();FD();CF=class{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(let t of this._richEditBrackets.brackets)for(let i of t.close){let o=i.charAt(i.length-1);e.push(o)}return Vc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;let o=t.findTokenIndexAtOffset(i-1);if(Yu(t.getStandardTokenType(o)))return null;let r=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,a=jc.findPrevBracketInRange(r,1,s,0,s.length);if(!a)return null;let l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;let d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}});function xF(n){return n.global&&(n.lastIndex=0),!0}var SF,bve=w(()=>{SF=class{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&xF(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&xF(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&xF(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&xF(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}});var yF,vve=w(()=>{Ae();He();pv();yF=class n{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{let i=n._createOpenBracketRegExp(t[0]),o=n._createCloseBracketRegExp(t[1]);i&&o&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,o){if(e>=3)for(let r=0,s=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&o.length>0)for(let r=0,s=this._brackets.length;r=2&&i.length>0){for(let r=0,s=this._brackets.length;r"u"?t:r}function xve(n){return n.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}var Me,oi=w(()=>{ye();Me=Re("configurationService")});var ci,el=w(()=>{ye();ci=Re("languageService")});var kd,LF=w(()=>{kd=class{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}});function it(n,e,t){e instanceof kd||(e=new kd(e,[],!!t)),Sve.push([n,e])}function iZ(){return Sve}var Sve,Ws=w(()=>{LF();Sve=[]});var wn,bv=w(()=>{wn=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"})});function F9e(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}var ox,nZ,B9e,IF=w(()=>{ae();B();_s();ox={JSONContribution:"base.contributions.json"};nZ=class extends E{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new N)}registerSchema(e,t,i){let o=F9e(e);this.schemasById[o]=t,this._onDidChangeSchema.fire(e),i&&i.add(se(()=>{delete this.schemasById[o],this._onDidChangeSchema.fire(e)}))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}},B9e=new nZ;qt.add(ox.JSONContribution,B9e)});var nh,oZ,Hy,rZ=w(()=>{tP();oZ=globalThis.vscode;if(typeof oZ<"u"&&typeof oZ.context<"u"){let n=oZ.context.configuration();if(n)nh=n.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(nh=globalThis._VSCODE_PRODUCT_JSON,LC.VSCODE_DEV&&Object.assign(nh,{nameShort:`${nh.nameShort} Dev`,nameLong:`${nh.nameLong} Dev`,dataFolderName:`${nh.dataFolderName}-dev`,serverDataFolderName:nh.serverDataFolderName?`${nh.serverDataFolderName}-dev`:void 0}),!nh.version){let n=globalThis._VSCODE_PACKAGE_JSON;Object.assign(nh,{version:n.version})}}else nh={},Object.keys(nh).length===0&&Object.assign(nh,{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"});Hy=nh});function BD(n){let e=[];if(n_.test(n)){let t=kve.exec(n);for(;t?.length;){let i=t[1].trim();i&&e.push(i),t=kve.exec(n)}}return Vc(e)}function H9e(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function V9e(n,e,t){return n.trim()?n_.test(n)?g(1671,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):DF.getConfigurationProperties()[n]!==void 0&&(!t||!z9e.has(t.toLowerCase()))?g(1672,"Cannot register '{0}'. This property is already registered.",n):e.policy?.name&&DF.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(1673,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,e.policy?.name,DF.getPolicyConfigurations().get(e.policy?.name)):null:g(1670,"Cannot register an empty property")}var yl,EF,yve,sZ,Lve,kve,W9e,n_,DF,z9e,o_=w(()=>{We();ae();Nt();le();oi();IF();_s();B();rZ();yl={Configuration:"base.contributions.configuration"},EF="vscode://schemas/settings/resourceLanguage",yve=qt.as(ox.JSONContribution),sZ=class extends E{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new N),this._onDidUpdateConfiguration=this._register(new N),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:g(1664,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},yve.registerSchema(EF,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){let i=new Set;this.doRegisterConfigurations(e,t,i),yve.registerSchema(EF,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);let i=[];for(let{overrides:o,source:r}of e)for(let s in o){t.add(s);let a=this.configurationDefaultsOverrides.get(s)??this.configurationDefaultsOverrides.set(s,{configurationDefaultOverrides:[]}).get(s),l=o[s];if(a.configurationDefaultOverrides.push({value:l,source:r}),n_.test(s)){let c=this.mergeDefaultConfigurationsForOverrideIdentifier(s,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(s,c,r),i.push(...BD(s))}else{let c=this.mergeDefaultConfigurationsForConfigurationProperty(s,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;let d=this.configurationProperties[s];d&&(this.updatePropertyDefaultValue(s,d),this.updateSchema(s,d))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){let o={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:g(1665,"Configure settings to be overridden for {0}.",xve(e)),$ref:EF,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=o,this.defaultLanguageConfigurationOverridesNode.properties[e]=o}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,o){let r=o?.value||{},s=o?.source??new Map;if(!(s instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let a of Object.keys(t)){let l=t[a];if(_n(l)&&(gs(r[a])||_n(r[a]))){if(r[a]={...r[a]??{},...l},i)for(let d in l)s.set(`${a}.${d}`,i)}else r[a]=l,i?s.set(a,i):s.delete(a)}return{value:r,source:s}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,o){let r=this.configurationProperties[e],s=o?.value??r?.defaultDefaultValue,a=i;if(_n(t)&&(r!==void 0&&r.type==="object"||r===void 0&&(gs(s)||_n(s)))){if(a=o?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let c in t)i&&a.set(`${e}.${c}`,i);t={..._n(s)?s:{},...t}}return{value:t,source:a}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,i),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,i,o,r=4,s){r=Ml(e.scope)?r:e.scope;let a=e.properties;if(a)for(let c in a){let d=a[c];if(d.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&V9e(c,d,i?.id)){delete a[c];continue}d.source=i,d.defaultDefaultValue=a[c].default,this.updatePropertyDefaultValue(c,d),n_.test(c)?d.scope=void 0:(d.scope=Ml(d.scope)?r:d.scope,d.restricted=Ml(d.restricted)?!!o?.includes(c):d.restricted),d.experiment?d.tags?.some(f=>f.toLowerCase()==="onexp")||(d.tags=d.tags??[],d.tags.push("onExP")):d.tags?.some(f=>f.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${c}'. Please use 'experiment' property instead.`),d.experiment={mode:"startup"});let h=a[c].hasOwnProperty("included")&&!a[c].included,u=a[c].policy?.name;h?(this.excludedConfigurationProperties[c]=a[c],u&&(this.policyConfigurations.set(u,c),s.add(c)),delete a[c]):(s.add(c),u&&this.policyConfigurations.set(u,c),this.configurationProperties[c]=a[c],!a[c].deprecationMessage&&a[c].markdownDeprecationMessage&&(a[c].deprecationMessage=a[c].markdownDeprecationMessage))}let l=e.allOf;if(l)for(let c of l)this.validateAndRegisterProperties(c,t,i,o,r,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){let t=i=>{let o=i.properties;if(o)for(let s in o)this.updateSchema(s,o[s]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 3:break;case 7:break;case 4:break;case 5:break;case 6:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,i={type:"object",description:g(1666,"Configure editor settings to be overridden for a language."),errorMessage:g(1667,"This setting does not support per-language configuration."),$ref:EF};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){g(1668,"Configure editor settings to be overridden for a language."),g(1669,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,o,r;i&&(!t.disallowConfigurationDefault||!i.source)&&(o=i.value,r=i.source),gs(o)&&(o=t.defaultDefaultValue,r=void 0),gs(o)&&(o=H9e(t.type)),t.default=o,t.defaultValueSource=r}},Lve="\\[([^\\]]+)\\]",kve=new RegExp(Lve,"g"),W9e=`^(${Lve})+$`,n_=new RegExp(W9e);DF=new sZ;qt.add(yl.Configuration,DF);z9e=new Set(Hy.defaultChatAgent?[Hy.defaultChatAgent.extensionId,Hy.defaultChatAgent.chatExtensionId].map(n=>n.toLowerCase()):[])});var U9e,aZ,vv,ws,$9e,iu=w(()=>{le();ae();_s();B();bv();o_();U9e={ModesRegistry:"editor.modesRegistry"},aZ=class extends E{constructor(){super(),this._onDidChangeLanguages=this._register(new N),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;te!==""&&t!=="")}var TF,NF,lZ,cZ,Eve=w(()=>{qO();FD();TF=class{constructor(e,t){this.languageId=e;let i=t.brackets?Ive(t.brackets):[],o=new xC(a=>{let l=new Set;return{info:new lZ(this,a,l),closing:l}}),r=new xC(a=>{let l=new Set,c=new Set;return{info:new cZ(this,a,l,c),opening:l,openingColorized:c}});for(let[a,l]of i){let c=o.get(a),d=r.get(l);c.closing.add(d.info),d.opening.add(c.info)}let s=t.colorizedBracketPairs?Ive(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(let[a,l]of s){let c=o.get(a),d=r.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){let t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return Wy(t,e)}};NF=class{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}},lZ=class extends NF{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}},cZ=class extends NF{constructor(e,t,i,o){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=o,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}});function j9e(n,e,t,i){let o=e.getLanguageConfiguration(n);if(!o){if(!i.isRegisteredLanguageId(n))return new Vy(n,{});o=new Vy(n,{})}let r=K9e(o.languageId,t),s=Nve([o.underlyingConfig,r]);return new Vy(o.languageId,s)}function K9e(n,e){let t=e.getValue(hZ.brackets,{overrideIdentifier:n}),i=e.getValue(hZ.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:Tve(t),colorizedBracketPairs:Tve(i)}}function Tve(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function MF(n,e,t){let i=n.getLineContent(e),o=ai(i);return o.length>t-1&&(o=o.substring(0,t-1)),o}function Nve(n){let e={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(let t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}var q9e,Dve,WD,Ft,dZ,hZ,uZ,RF,AF,fZ,Vy,Mo=w(()=>{ae();B();He();nx();pv();uve();_ve();bve();vve();FD();ye();oi();el();Ws();iu();Eve();q9e=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Dve=function(n,e){return function(t,i){e(t,i,n)}},WD=class{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}},Ft=Re("languageConfigurationService"),dZ=class extends E{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new fZ),this.onDidChangeEmitter=this._register(new N),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;let i=new Set(Object.values(hZ));this._register(this.configurationService.onDidChangeConfiguration(o=>{let r=o.change.keys.some(a=>i.has(a)),s=o.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new WD(void 0));else for(let a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new WD(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new WD(o.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=j9e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};dZ=q9e([Dve(0,Me),Dve(1,ci)],dZ);hZ={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};uZ=class{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){let i=new RF(e,t,++this._order);return this._entries.push(i),this._resolved=null,se(()=>{for(let o=0;oe.configuration)))}};RF=class{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}},AF=class{constructor(e){this.languageId=e}},fZ=class extends E{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._register(this.register(ws,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let o=this._entries.get(e);o||(o=new uZ(e),this._entries.set(e,o));let r=o.register(t,i);return this._onDidChange.fire(new AF(e)),se(()=>{r.dispose(),this._onDidChange.fire(new AF(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}},Vy=class n{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new yF(this.underlyingConfig):null,this.comments=n._handleComments(this.underlyingConfig),this.characterPair=new bF(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||OD,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new SF(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new TF(e,this.underlyingConfig)}getWordDefinition(){return PD(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new vF(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new CF(this.brackets)),this._electricCharacter}onEnter(e,t,i,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,o):null}getAutoClosingPairs(){return new _F(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(typeof t.lineComment=="string"?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){let[o,r]=t.blockComment;i.blockCommentStartToken=o,i.blockCommentEndToken=r}return i}};it(Ft,dZ,1)});var $o,rx=w(()=>{$o=class{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e),o=this.getFontStyle(e);return o&1&&(i+=" mtki"),o&2&&(i+=" mtkb"),o&4&&(i+=" mtku"),o&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){let i=this.getForeground(e),o=this.getFontStyle(e),r=`color: ${t[i]};`;o&1&&(r+="font-style: italic;"),o&2&&(r+="font-weight: bold;");let s="";return o&4&&(s+=" underline"),o&8&&(s+=" line-through"),s&&(r+=`text-decoration:${s};`),r}static getPresentationFromMetadata(e){let t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}});var Ee,OF,Cn=w(()=>{Ae();Ee=class n{static fromTo(e,t){return new n(e,t)}static addRange(e,t){let i=0;for(;it))return new n(e,t)}static ofLength(e){return new n(0,e)}static ofStartAndLength(e,t){return new n(e,e+t)}static emptyAt(e){return new n(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new ke(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new n(this.start+e,this.endExclusive+e)}deltaStart(e){return new n(this.start+e,this.endExclusive)}deltaEnd(e){return new n(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ke(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ke(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}});function Rve(n,e){let t=e.lineNumber;if(!n.tokenization.isCheapToTokenize(t))return;n.tokenization.forceTokenization(t);let i=n.tokenization.getLineTokens(t),o=i.findTokenIndexAtOffset(e.column-1);return i.getStandardTokenType(o)}var Ci,mZ,Yf,HD,gZ,kl=w(()=>{rx();Cn();Ae();Ci=class n{static createEmpty(e,t){let i=n.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=i,new n(o,e,t)}static createFromTextAndMetadata(e,t){let i=0,o="",r=new Array;for(let{text:s,metadata:a}of e)r.push(i+s.length,a),i+=s.length,o+=s;return new n(new Uint32Array(r),o,t)}static convertToEndOffset(e,t){let o=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;it&&(o=r)}return i}static{this.defaultTokenMetadata=(32768|2<<24)>>>0}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&De(new Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(e){return e instanceof n?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;let o=t<<1,r=o+(i<<1);for(let s=o;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){let t=this._tokens[(e<<1)+1],i=$o.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){let t=this._tokens[(e<<1)+1];return $o.getTokenType(t)}getForeground(e){let t=this._tokens[(e<<1)+1];return $o.getForeground(t)}getClassName(e){let t=this._tokens[(e<<1)+1];return $o.getClassNameFromMetadata(t)}getInlineStyle(e,t){let i=this._tokens[(e<<1)+1];return $o.getInlineStyleFromMetadata(i,t)}getPresentation(e){let t=this._tokens[(e<<1)+1];return $o.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return n.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new mZ(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(e){if(e.length===0)return this;let t=0,i=0,o="",r=new Array,s=0;for(;;){let a=ts){o+=this._text.substring(s,l.offset);let c=this._tokens[(t<<1)+1];r.push(o.length,c),s=l.offset}o+=l.text,r.push(o.length,l.tokenMetadata),i++}else break}return new n(new Uint32Array(r),o,this.languageIdCodec)}getTokensInRange(e){let t=new gZ,i=this.findTokenIndexAtOffset(e.start),o=this.findTokenIndexAtOffset(e.endExclusive);for(let r=i;r<=o;r++){let a=new Ee(this.getStartOffset(r),this.getEndOffset(r)).intersectionLength(e);a>0&&t.add(a,this.getMetadata(r))}return t.build()}getTokenText(e){let t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){let t=this.getCount();for(let i=0;i{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`}),e}},mZ=class n{constructor(e,t,i,o){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let r=this._firstTokenIndex,s=e.getCount();r=i);r++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof n?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){let t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){let t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),o=this._source.getEndOffset(t),r=this._source.getTokenText(t);return ithis._endOffset&&(r=r.substring(0,r.length-(o-this._endOffset))),r}forEach(e){for(let t=0;t({text:i.substring(e),metadata:o.metadata})),t)}forEach(e){let t=0;for(let i of this._tokenInfo){let o=new Ee(t,t+i.length);e(o,i),t+=i.length}}map(e){let t=[],i=0;for(let o of this._tokenInfo){let r=new Ee(i,i+o.length);t.push(e(r,o)),i+=o.length}return t}slice(e){let t=[],i=0;for(let o of this._tokenInfo){let r=i,s=r+o.length;if(s>e.start){if(r>=e.endExclusive)break;let a=Math.max(0,e.start-r),l=Math.max(0,s-e.endExclusive);t.push(new HD(o.length-a-l,o.metadata))}i+=o.length}return n.create(t)}},HD=class{constructor(e,t){this.length=e,this.metadata=t}},gZ=class{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new HD(e,t))}build(){return Yf.create(this._tokens)}}});function FF(n,e){n.tokenization.forceTokenization(e.lineNumber);let t=n.tokenization.getLineTokens(e.lineNumber),i=Jm(t,e.column-1),o=i.firstCharOffset===0,r=t.getLanguageId(0)===i.languageId;return!o&&!r}var sx,ax,PF,BF=w(()=>{He();Ny();kl();sx=class{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new PF(e,i)}shouldIncrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}},ax=class{constructor(e,t){this.model=e,this.indentationLineProcessor=new PF(e,t)}getProcessedTokenContextAroundRange(e){let t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),o=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:o}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);let t=this.model.tokenization.getLineTokens(e.startLineNumber),i=Jm(t,e.startColumn-1),o;if(FF(this.model,e.getStartPosition())){let s=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+s;o=t.sliceAndInflate(a,l,0)}else{let s=e.startColumn-1;o=t.sliceAndInflate(0,s,0)}return this.indentationLineProcessor.getProcessedTokens(o)}_getProcessedTokensAfterRange(e){let t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);let i=this.model.tokenization.getLineTokens(t.lineNumber),o=Jm(i,t.column-1),r=t.column-1-o.firstCharOffset,s=o.firstCharOffset+r,a=o.firstCharOffset+o.getLineLength(),l=i.sliceAndInflate(s,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){let t=f=>{this.model.tokenization.forceTokenization(f);let m=this.model.tokenization.getLineTokens(f),p=this.model.getLineMaxColumn(f)-1;return Jm(m,p)};this.model.tokenization.forceTokenization(e.startLineNumber);let i=this.model.tokenization.getLineTokens(e.startLineNumber),o=Jm(i,e.startColumn-1),r=Ci.createEmpty("",o.languageIdCodec),s=e.startLineNumber-1;if(s===0||!(o.firstCharOffset===0))return r;let c=t(s);if(!(o.languageId===c.languageId))return r;let h=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}},PF=class{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){let i=(s,a)=>{let l=ai(s);return a+s.substring(l.length)};this.model.tokenization.forceTokenization?.(e);let o=this.model.tokenization.getLineTokens(e),r=this.getProcessedTokens(o).getLineContent();return t!==void 0&&(r=i(r,t)),r}getProcessedTokens(e){let t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),s=[];return e.forEach(l=>{let c=e.getStandardTokenType(l),d=e.getTokenText(l);t(c)&&(d=d.replace(r,""));let h=e.getMetadata(l);s.push({text:d,metadata:h})}),Ci.createFromTextAndMetadata(s,e.languageIdCodec)}}});function r_(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);let o=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),r=i.getLanguageConfiguration(o);if(!r)return null;let a=new ax(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=r.onEnter(n,l,c,d);if(!h)return null;let u=h.indentAction,f=h.appendText,m=h.removeText||0;f?u===so.Indent&&(f=" "+f):u===so.Indent||u===so.IndentOutdent?f=" ":f="";let p=MF(e,t.startLineNumber,t.startColumn);return m&&(p=p.substring(0,p.length-m)),{indentAction:u,appendText:f,removeText:m,indentation:p}}var WF=w(()=>{pv();Mo();BF()});function lx(n,e){if(e<=0)return"";pZ[n]||(pZ[n]=["",n]);let t=pZ[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}var G9e,Y9e,HF,pZ,Ul,zy=w(()=>{He();yd();de();bi();WF();Mo();G9e=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y9e=function(n,e){return function(t,i){e(t,i,n)}},pZ=Object.create(null);Ul=HF=class{static unshiftIndent(e,t,i,o,r){let s=Oi.visibleColumnFromColumn(e,t,i);if(r){let a=lx(" ",o),c=Oi.prevIndentTabStop(s,o)/o;return lx(a,c)}else{let a=" ",c=Oi.prevRenderTabStop(s,i)/i;return lx(a,c)}}static shiftIndent(e,t,i,o,r){let s=Oi.visibleColumnFromColumn(e,t,i);if(r){let a=lx(" ",o),c=Oi.nextIndentTabStop(s,o)/o;return lx(a,c)}else{let a=" ",c=Oi.nextRenderTabStop(s,i)/i;return lx(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){let i=this._selection.startLineNumber,o=this._selection.endLineNumber;this._selection.endColumn===1&&i!==o&&(o=o-1);let{tabSize:r,indentSize:s,insertSpaces:a}=this._opts,l=i===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let h=i;h<=o;h++,c=d){d=0;let u=e.getLineContent(h),f=Gn(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&Oi.visibleColumnFromColumn(u,f+1,r)%s!==0&&e.tokenization.isCheapToTokenize(h-1)){let _=r_(this._opts.autoIndent,e,new y(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let b=0,v=_.appendText.length;b{de();bi();VF=class{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new y(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new y(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection||null)}computeCursorState(e,t){let i=t.getInverseEditOperations(),o=i[0].range,r=i[1].range;return new ge(o.endLineNumber,o.endColumn,r.endLineNumber,r.endColumn-this._charAfterSelection.length)}},zF=class{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new y(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){let o=t.getInverseEditOperations()[0].range;return new ge(o.endLineNumber,o.startColumn,o.endLineNumber,o.endColumn-this._charAfter.length)}}});function Z9e(n,e,t){let i=n.tokenization.getLanguageIdAtPosition(e,0);if(e>1){let o,r=-1;for(o=e-1;o>=1;o--){if(n.tokenization.getLanguageIdAtPosition(o,0)!==i)return r;let s=n.getLineContent(o);if(t.shouldIgnore(o)||/^\s+$/.test(s)||s===""){r=o;continue}return o}}return-1}function Uy(n,e,t,i=!0,o){if(n<4)return null;let r=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)return null;let s=new sx(e,r,o);if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};let a=Z9e(e,t,s);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(s.shouldIncrease(a)||s.shouldIndentNextLine(a)){let l=e.getLineContent(a);return{indentation:ai(l),action:so.Indent,line:a}}else if(s.shouldDecrease(a)){let l=e.getLineContent(a);return{indentation:ai(l),action:null,line:a}}else{if(a===1)return{indentation:ai(e.getLineContent(a)),action:null,line:a};let l=a-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let h=l-1;h>0;h--)if(!s.shouldIndentNextLine(h)){d=h;break}return{indentation:ai(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ai(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(s.shouldIncrease(d))return{indentation:ai(e.getLineContent(d)),action:so.Indent,line:d};if(s.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!s.shouldIndentNextLine(d)){h=u;break}return{indentation:ai(e.getLineContent(h+1)),action:null,line:h+1}}else if(s.shouldDecrease(d))return{indentation:ai(e.getLineContent(d)),action:null,line:d}}return{indentation:ai(e.getLineContent(1)),action:null,line:1}}}function cx(n,e,t,i,o,r){if(n<4)return null;let s=r.getLanguageConfiguration(t);if(!s)return null;let a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;let l=new sx(e,a,r),c=Uy(n,e,i,void 0,r);if(c){let d=c.line;if(d!==void 0){let h=!0;for(let u=d;u0){let b=e.getLineContent(_);if(c.shouldIndentNextLine(b)&&c.shouldIncrease(p)){let x=Uy(s,e,t.startLineNumber,!1,r)?.indentation;if(x!==void 0){let C=e.getLineContent(t.startLineNumber),S=ai(C),I=o.shiftIndent(x)===S,D=/^\s*$/.test(m),T=n.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),W=T&&T.length>0&&D;if(I&&W)return x}}}return null}function UF(n,e,t){let i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function X9e(n,e,t){return{tokenization:{getLineTokens:o=>o===e?t:n.tokenization.getLineTokens(o),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(o,r)=>n.getLanguageIdAtPosition(o,r)},getLineContent:o=>o===e?t.getLineContent():n.getLineContent(o)}}var $F=w(()=>{He();pv();BF()});function wZ(n,e){return n===" "?e===5||e===6?6:5:4}function i4(n,e){return Pve(n)&&!Pve(e)?!0:n===5?!1:Ove(n)!==Ove(e)}function Ove(n){return n===6||n===5?"space":n}function Pve(n){return n===4||n===5||n===6}function Fve(n,e,t,i,o){if(n.autoClosingOvertype==="never"||!n.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,s=t.length;r2?c.charCodeAt(l.column-2):0)===92&&h)return!1;if(n.autoClosingOvertype==="auto"){let f=!1;for(let m=0,p=i.length;m {Ae();He();ZC();zy();_Z();th();Oy();de();Fe();pv();Mo();Ny();$F();WF();qF=class{static getEdits(e,t,i,o,r){if(!r&&this._isAutoIndentType(e,t,i)){let s=[];for(let l of i){let c=this._findActualIndentationForSelection(e,t,l,o);if(c===null)return;s.push({selection:l,indentation:c})}let a=$y.getAutoClosingPairClose(e,t,i,o,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,s,o,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let o=0,r=i.length;oCZ(e,a),unshiftIndent:a=>t4(e,a)},e.languageConfigurationService);if(r===null)return null;let s=MF(t,i.startLineNumber,i.startColumn);return r===e.normalizeIndentation(s)?null:r}static _getIndentationAndAutoClosingPairEdits(e,t,i,o,r){let s=i.map(({selection:l,indentation:c})=>{if(r!==null){let d=this._getEditFromIndentationAndSelection(e,t,c,l,o,!1);return new vZ(d,l,o,r)}else{let d=this._getEditFromIndentationAndSelection(e,t,c,l,o,!0);return dx(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new Js(4,s,a)}static _getEditFromIndentationAndSelection(e,t,i,o,r,s=!0){let a=o.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a),c=e.normalizeIndentation(i);if(l!==0){let h=t.getLineContent(a);c+=h.substring(l-1,o.startColumn-1)}return c+=s?r:"",{range:new y(a,1,o.endLineNumber,o.endColumn),text:c}}},jF=class{static getEdits(e,t,i,o,r,s){if(Fve(t,i,o,r,s))return this._runAutoClosingOvertype(e,o,s)}static _runAutoClosingOvertype(e,t,i){let o=[];for(let r=0,s=t.length;rnew Ao(new y(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new Js(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}},$y=class{static getEdits(e,t,i,o,r,s){if(!s){let a=this.getAutoClosingPairClose(e,t,i,o,r);if(a!==null)return this._runAutoClosingOpenCharType(i,o,r,a)}}static _runAutoClosingOpenCharType(e,t,i,o){let r=[];for(let s=0,a=e.length;s{let p=m.getPosition();return r?{lineNumber:p.lineNumber,beforeColumn:p.column-o.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(m=>new M(m.lineNumber,m.beforeColumn)),o);if(!a)return null;let l,c;if(Kf(o)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;let h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"",f=!0;for(let m of s){let{lineNumber:p,beforeColumn:_,afterColumn:b}=m,v=t.getLineContent(p),x=v.substring(0,_-1),C=v.substring(b-1);if(C.startsWith(u)||(f=!1),C.length>0){let D=C.charAt(0);if(!this._isBeforeClosingBrace(e,C)&&!c(D))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){let D=Hl(e.wordSeparators,[]);if(x.length>0){let T=x.charCodeAt(x.length-1);if(D.get(T)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);let S=t.tokenization.getLineTokens(p),L=Jm(S,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;let I=a.findNeutralCharacter();if(I){let D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,I);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;let i=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[],r=null;for(let s of o)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!r||s.open.length>r.open.length)&&(r=s);return r}static _findAutoClosingPairOpen(e,t,i,o){let r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!r)return null;let s=null;for(let a of r)if(s===null||a.open.length>s.open.length){let l=!0;for(let c of i)if(t.getValueInRange(new y(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(s=a)}return s}static _isBeforeClosingBrace(e,t){let i=t.charAt(0),o=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],r=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=o.some(l=>t.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!s&&a}},VD=class{static getEdits(e,t){if(!(e.inputMode==="overtype"))return null;let o=t.map(r=>new lF(r.insertedTextRange));return new Js(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}},GF=class{static getEdits(e,t,i,o,r){if(!r&&this._isSurroundSelectionType(e,t,i,o))return this._runSurroundSelectionType(e,i,o)}static _runSurroundSelectionType(e,t,i){let o=[];for(let r=0,s=t.length;r=4){let l=Ave(e.autoIndent,t,o,{unshiftIndent:c=>t4(e,c),shiftIndent:c=>CZ(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition()),d=o.endColumn,h=t.getLineContent(o.endLineNumber),u=Gn(h);if(u>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,u+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),i)return new GC(o,`
+`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new YC(o,`
+`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return dx(o,`
+`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];let o=[];for(let r=0,s=i.length;rthis._compositionType(i,d,r,s,a,l));return new Js(4,c,{shouldPushStackElementBefore:i4(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,o,r,s){if(!t.isEmpty())return null;let a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),d=new y(a.lineNumber,l,a.lineNumber,c);return new YC(d,i,0,s)}},JF=class{static getEdits(e,t,i){let o=[];for(let s=0,a=t.length;s1){let a;for(a=i-1;a>=1;a--){let d=t.getLineContent(a);if(ua(d)>=0)break}if(a<1)return null;let l=t.getLineMaxColumn(a),c=r_(e.autoIndent,t,new y(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return o&&(o===so.Indent&&(r=CZ(e,r)),o===so.Outdent&&(r=t4(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,i,o){let r="",s=i.getStartPosition();if(e.insertSpaces){let a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let d=0;d{zy();_Z();th();zD();nu=class{static indent(e,t,i){if(t===null||i===null)return[];let o=[];for(let r=0,s=i.length;r{le();Ze();(function(n){n.editorSimpleInput=new fe("editorSimpleInput",!1,!0),n.editorTextFocus=new fe("editorTextFocus",!1,g(681,"Whether the editor text has focus (cursor is blinking)")),n.focus=new fe("editorFocus",!1,g(682,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new fe("textInputFocus",!1,g(683,"Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new fe("editorReadonly",!1,g(684,"Whether the editor is read-only")),n.inDiffEditor=new fe("inDiffEditor",!1,g(685,"Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new fe("isEmbeddedDiffEditor",!1,g(686,"Whether the context is an embedded diff editor")),n.inMultiDiffEditor=new fe("inMultiDiffEditor",!1,g(687,"Whether the context is a multi diff editor")),n.multiDiffEditorAllCollapsed=new fe("multiDiffEditorAllCollapsed",void 0,g(688,"Whether all files in multi diff editor are collapsed")),n.hasChanges=new fe("diffEditorHasChanges",!1,g(689,"Whether the diff editor has changes")),n.comparingMovedCode=new fe("comparingMovedCode",!1,g(690,"Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new fe("accessibleDiffViewerVisible",!1,g(691,"Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new fe("diffEditorRenderSideBySideInlineBreakpointReached",!1,g(692,"Whether the diff editor render side by side inline breakpoint is reached")),n.diffEditorInlineMode=new fe("diffEditorInlineMode",!1,g(693,"Whether inline mode is active")),n.diffEditorOriginalWritable=new fe("diffEditorOriginalWritable",!1,g(694,"Whether modified is writable in the diff editor")),n.diffEditorModifiedWritable=new fe("diffEditorModifiedWritable",!1,g(695,"Whether modified is writable in the diff editor")),n.diffEditorOriginalUri=new fe("diffEditorOriginalUri","",g(696,"The uri of the original document")),n.diffEditorModifiedUri=new fe("diffEditorModifiedUri","",g(697,"The uri of the modified document")),n.columnSelection=new fe("editorColumnSelection",!1,g(698,"Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new fe("editorHasSelection",!1,g(699,"Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new fe("editorHasMultipleSelections",!1,g(700,"Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new fe("editorTabMovesFocus",!1,g(701,"Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInEmbeddedEditor=new fe("isInEmbeddedEditor",!1,!0),n.canUndo=new fe("canUndo",!1,!0),n.canRedo=new fe("canRedo",!1,!0),n.hoverVisible=new fe("editorHoverVisible",!1,g(702,"Whether the editor hover is visible")),n.hoverFocused=new fe("editorHoverFocused",!1,g(703,"Whether the editor hover is focused")),n.stickyScrollFocused=new fe("stickyScrollFocused",!1,g(704,"Whether the sticky scroll is focused")),n.stickyScrollVisible=new fe("stickyScrollVisible",!1,g(705,"Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new fe("standaloneColorPickerVisible",!1,g(706,"Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new fe("standaloneColorPickerFocused",!1,g(707,"Whether the standalone color picker is focused")),n.inCompositeEditor=new fe("inCompositeEditor",void 0,g(708,"Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new fe("editorLangId","",g(709,"The language identifier of the editor")),n.hasCompletionItemProvider=new fe("editorHasCompletionItemProvider",!1,g(710,"Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new fe("editorHasCodeActionsProvider",!1,g(711,"Whether the editor has a code actions provider")),n.hasCodeLensProvider=new fe("editorHasCodeLensProvider",!1,g(712,"Whether the editor has a code lens provider")),n.hasDefinitionProvider=new fe("editorHasDefinitionProvider",!1,g(713,"Whether the editor has a definition provider")),n.hasDeclarationProvider=new fe("editorHasDeclarationProvider",!1,g(714,"Whether the editor has a declaration provider")),n.hasImplementationProvider=new fe("editorHasImplementationProvider",!1,g(715,"Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new fe("editorHasTypeDefinitionProvider",!1,g(716,"Whether the editor has a type definition provider")),n.hasHoverProvider=new fe("editorHasHoverProvider",!1,g(717,"Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new fe("editorHasDocumentHighlightProvider",!1,g(718,"Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new fe("editorHasDocumentSymbolProvider",!1,g(719,"Whether the editor has a document symbol provider")),n.hasReferenceProvider=new fe("editorHasReferenceProvider",!1,g(720,"Whether the editor has a reference provider")),n.hasRenameProvider=new fe("editorHasRenameProvider",!1,g(721,"Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new fe("editorHasSignatureHelpProvider",!1,g(722,"Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new fe("editorHasInlayHintsProvider",!1,g(723,"Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new fe("editorHasDocumentFormattingProvider",!1,g(724,"Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new fe("editorHasDocumentSelectionFormattingProvider",!1,g(725,"Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new fe("editorHasMultipleDocumentFormattingProvider",!1,g(726,"Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new fe("editorHasMultipleDocumentSelectionFormattingProvider",!1,g(727,"Whether the editor has multiple document selection formatting providers"))})(R||(R={}))});function Ky(n,e){Qn.registerKeybindingRule({id:n,primary:e,when:Q9e,weight:xi+1})}function Bve(n){return n.register(),n}function hx(n,e){Bve(new r4("default:"+n,n)),Bve(new r4(n,n,e))}var xi,ao,tl,jy,UD,ta,Q9e,wv,r4,yo=w(()=>{le();Gs();Nt();Xs();at();bo();rve();th();dF();pF();o4();Fe();de();di();Ze();qf();oe();zD();xi=0,ao=class extends Ji{runEditorCommand(e,t,i){let o=t._getViewModel();o&&this.runCoreEditorCommand(o,i||{})}};(function(n){let e=function(i){if(!_n(i))return!1;let o=i;return!(!En(o.to)||!gs(o.by)&&!En(o.by)||!gs(o.value)&&!Fc(o.value)||!gs(o.revealCursor)&&!zE(o.revealCursor))};n.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:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,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"}}}}]},n.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"};function t(i){let o;switch(i.to){case n.RawDirection.Up:o=1;break;case n.RawDirection.Right:o=2;break;case n.RawDirection.Down:o=3;break;case n.RawDirection.Left:o=4;break;default:return null}let r;switch(i.by){case n.RawUnit.Line:r=1;break;case n.RawUnit.WrappedLine:r=2;break;case n.RawUnit.Page:r=3;break;case n.RawUnit.HalfPage:r=4;break;case n.RawUnit.Editor:r=5;break;case n.RawUnit.Column:r=6;break;default:r=2}let s=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:o,unit:r,value:s,revealCursor:a,select:!!i.select}}n.parse=t})(tl||(tl={}));(function(n){let e=function(t){if(!_n(t))return!1;let i=t;return!(!Fc(i.lineNumber)&&!En(i.lineNumber)||!gs(i.at)&&!En(i.at))};n.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:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},n.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(jy||(jy={}));UD=class{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{let o=t.get(ot).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{let o=hn();return o&&Uc(o)?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{let o=t.get(ot).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,i)):!1})}_runEditorCommand(e,t,i){let o=this.runEditorCommand(e,t,i);return o||!0}};(function(n){class e extends ao{constructor(v){super(v),this._inSelectionMode=v.inSelectionMode}runCoreEditorCommand(v,x){if(!x.position)return;v.model.pushStackElement(),v.setCursorStates(x.source,3,[sr.moveTo(v,v.getPrimaryCursorState(),this._inSelectionMode,x.position,x.viewPosition)])&&x.revealType!==2&&v.revealAllCursors(x.source,!0,!0)}}n.MoveTo=we(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=we(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ao{runCoreEditorCommand(v,x){v.model.pushStackElement();let C=this._getColumnSelectResult(v,v.getPrimaryCursorState(),v.getCursorColumnSelectData(),x);C!==null&&(v.setCursorStates(x.source,3,C.viewStates.map(S=>Ot.fromViewState(S))),v.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:C.fromLineNumber,fromViewVisualColumn:C.fromVisualColumn,toViewLineNumber:C.toLineNumber,toViewVisualColumn:C.toVisualColumn}),C.reversed?v.revealTopMostCursor(x.source):v.revealBottomMostCursor(x.source))}}n.ColumnSelect=we(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,v,x,C){if(typeof C.position>"u"||typeof C.viewPosition>"u"||typeof C.mouseColumn>"u")return null;let S=b.model.validatePosition(C.position),L=b.coordinatesConverter.validateViewPosition(new M(C.viewPosition.lineNumber,C.viewPosition.column),S),I=C.doColumnSelect?x.fromViewLineNumber:L.lineNumber,D=C.doColumnSelect?x.fromViewVisualColumn:C.mouseColumn-1;return fv.columnSelect(b.cursorConfig,b,I,D,L.lineNumber,C.mouseColumn-1)}}),n.CursorColumnSelectLeft=we(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(b,v,x,C){return fv.columnSelectLeft(b.cursorConfig,b,x)}}),n.CursorColumnSelectRight=we(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(b,v,x,C){return fv.columnSelectRight(b.cursorConfig,b,x)}});class i extends t{constructor(v){super(v),this._isPaged=v.isPaged}_getColumnSelectResult(v,x,C,S){return fv.columnSelectUp(v.cursorConfig,v,C,this._isPaged)}}n.CursorColumnSelectUp=we(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=we(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(v){super(v),this._isPaged=v.isPaged}_getColumnSelectResult(v,x,C,S){return fv.columnSelectDown(v.cursorConfig,v,C,this._isPaged)}}n.CursorColumnSelectDown=we(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=we(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends ao{constructor(){super({id:"cursorMove",precondition:void 0,metadata:AD.metadata})}runCoreEditorCommand(v,x){let C=AD.parse(x);C&&this._runCursorMove(v,x.source,C)}_runCursorMove(v,x,C){let S=C.noHistory?"api":x;v.model.pushStackElement(),v.setCursorStates(S,3,r._move(v,v.getCursorStates(),C)),v.revealAllCursors(S,!0)}static _move(v,x,C){let S=C.select,L=C.value;switch(C.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return sr.simpleMove(v,x,C.direction,S,L,C.unit);case 11:case 13:case 12:case 14:return sr.viewportMove(v,x,C.direction,S,L);default:return null}}}n.CursorMoveImpl=r,n.CursorMove=we(new r);class s extends ao{constructor(v){super(v),this._staticArgs=v.args}runCoreEditorCommand(v,x){let C=this._staticArgs;this._staticArgs.value===-1&&(C={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:x.pageSize||v.cursorConfig.pageSize}),v.model.pushStackElement(),v.setCursorStates(x.source,3,sr.simpleMove(v,v.getCursorStates(),C.direction,C.select,C.value,C.unit)),v.revealAllCursors(x.source,!0)}}n.CursorLeft=we(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=we(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1039}})),n.CursorRight=we(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=we(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1041}})),n.CursorUp=we(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=we(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=we(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:11}})),n.CursorPageUpSelect=we(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1035}})),n.CursorDown=we(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=we(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=we(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:12}})),n.CursorPageDownSelect=we(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1036}})),n.CreateCursor=we(new class extends ao{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,v){if(!v.position)return;let x;v.wholeLine?x=sr.line(b,b.getPrimaryCursorState(),!1,v.position,v.viewPosition):x=sr.moveTo(b,b.getPrimaryCursorState(),!1,v.position,v.viewPosition);let C=b.getCursorStates();if(C.length>1){let S=x.modelState?x.modelState.position:null,L=x.viewState?x.viewState.position:null;for(let I=0,D=C.length;IL&&(S=L);let I=new y(S,1,S,b.model.getLineMaxColumn(S)),D=0;if(x.at)switch(x.at){case jy.RawAtArgument.Top:D=3;break;case jy.RawAtArgument.Center:D=1;break;case jy.RawAtArgument.Bottom:D=4;break}let T=b.coordinatesConverter.convertModelRangeToViewRange(I);b.revealRange(v.source,!1,T,D,0)}}),n.SelectAll=new class extends UD{constructor(){super(ove)}runDOMCommand(b){To&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,v,x){let C=v._getViewModel();C&&this.runCoreEditorCommand(C,x)}runCoreEditorCommand(b,v){b.model.pushStackElement(),b.setCursorStates("keyboard",3,[sr.selectAll(b,b.getPrimaryCursorState())])}},n.SetSelection=we(new class extends ao{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,v){v.selection&&(b.model.pushStackElement(),b.setCursorStates(v.source,3,[Ot.fromModelSelection(v.selection)]))}})})(ta||(ta={}));Q9e=G.and(R.textInputFocus,R.columnSelection);Ky(ta.CursorColumnSelectLeft.id,1039);Ky(ta.CursorColumnSelectRight.id,1041);Ky(ta.CursorColumnSelectUp.id,1040);Ky(ta.CursorColumnSelectPageUp.id,1035);Ky(ta.CursorColumnSelectDown.id,1042);Ky(ta.CursorColumnSelectPageDown.id,1036);(function(n){class e extends Ji{runEditorCommand(i,o,r){let s=o._getViewModel();s&&this.runCoreEditingCommand(o,s,r||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=we(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:R.writable,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,s_.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection)))}}),n.Outdent=we(new class extends e{constructor(){super({id:"outdent",precondition:R.writable,kbOpts:{weight:xi,kbExpr:G.and(R.editorTextFocus,R.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,nu.outdent(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.Tab=we(new class extends e{constructor(){super({id:"tab",precondition:R.writable,kbOpts:{weight:xi,kbExpr:G.and(R.editorTextFocus,R.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,nu.tab(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=we(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,o){let[r,s]=e_.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(2)}}),n.DeleteRight=we(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:xi,kbExpr:R.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,o){let[r,s]=e_.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(3)}}),n.Undo=new class extends UD{constructor(){super(BY)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,o){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().undo()}},n.Redo=new class extends UD{constructor(){super(WY)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,o){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().redo()}}})(wv||(wv={}));r4=class extends jC{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){let i=e.get(ot).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}};hx("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});hx("replacePreviousChar");hx("compositionType");hx("compositionStart");hx("compositionEnd");hx("paste");hx("cut")});var Gy,s4=w(()=>{ye();Gy=Re("markerDecorationsService")});var J9e,eHe,a4,Wve=w(()=>{s4();at();J9e=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eHe=function(n,e){return function(t,i){e(t,i,n)}},a4=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};a4=J9e([eHe(1,Gy)],a4);$e(a4.ID,a4,0)});var Hve=w(()=>{});function Zf(n){return typeof n=="number"?`${n}px`:n}function gt(n){return new Cv(n)}var Cv,ar=w(()=>{Cv=class{constructor(e){this.domNode=e,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=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){let t=Zf(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Zf(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Zf(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Zf(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Zf(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Zf(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Zf(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=Zf(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Zf(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Zf(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Zf(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}});function xn(n,e){n instanceof Cv?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}var Ld=w(()=>{ar()});var Yy,SZ=w(()=>{B();ae();oe();Yy=class extends E{constructor(e,t){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},i=!1,o=!1,r=()=>{if(i&&!o)try{i=!1,o=!0,t()}finally{Ms(Ce(this._referenceDomElement),()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(s=>{s&&s[0]&&s[0].contentRect?e={width:s[0].contentRect.width,height:s[0].contentRect.height}:e=null,i=!0,r()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,o=0;t?(i=t.width,o=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),i=Math.max(5,i),o=Math.max(5,o),(this._width!==i||this._height!==o)&&(this._width=i,this._height=o,e&&this._onDidChange.fire())}}});var yZ,kZ,LZ,xv,l4=w(()=>{oe();ae();B();yZ=class extends E{constructor(e){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}},kZ=class extends E{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new yZ(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,o=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/o}},LZ=class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=ov(e),i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new kZ(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),X.once(ube)(({vscodeWindowId:o})=>{o===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},xv=new LZ});function Vve(n,e,t){new IZ(e,t).read(n)}var c4,IZ,zve=w(()=>{Ld();c4=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},IZ=class n{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){let e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";let t=document.createElement("div");xn(t,this._bareFontInfo),e.appendChild(t);let i=document.createElement("div");xn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);let o=document.createElement("div");xn(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);let r=[];for(let s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=i),s.type===1&&(a=o),a.appendChild(document.createElement("br"));let l=document.createElement("span");n._render(l,s),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let i="\xA0";for(let o=0;o<8;o++)i+=i;e.innerText=i}else{let i=t.chr;for(let o=0;o<8;o++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{ae();$l=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}}});var tHe,EZ,Sv,iHe,a_,DZ,TZ,nHe,oHe,rHe,Oa,l_=w(()=>{ct();Zy();tHe=qe?1.5:1.35,EZ=8,Sv=class n{static _create(e,t,i,o,r,s,a,l,c){s===0?s=tHe*i:s{Hs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}}});function d4(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new yv(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){let i=Array.isArray(n)&&Array.isArray(e)&&Pt(n,e);return new yv(e,!i)}let t=!1;for(let i in e)if(e.hasOwnProperty(i)){let o=d4(n[i],e[i]);o.didChange&&(n[i]=o.newValue,t=!0)}return new yv(n,t)}function Ve(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}function Qf(n,e,t,i){if(typeof n=="string"&&(n=parseInt(n,10)),typeof n!="number"||isNaN(n))return e;let o=n;return o=Math.max(t,o),o=Math.min(i,o),o|0}function qve(n,e,t,i){if(typeof n>"u")return e;let o=Kc.float(n,e);return Kc.clamp(o,t,i)}function Sn(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}function sHe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}function aHe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}function Uve(n){switch(n){case"line":return Cs.Line;case"block":return Cs.Block;case"underline":return Cs.Underline;case"line-thin":return Cs.LineThin;case"block-outline":return Cs.BlockOutline;case"underline-thin":return Cs.UnderlineThin}}function lHe(n){return n==="ctrlCmd"?qe?"metaKey":"ctrlKey":"altKey"}function fx(n){let e=n.get(112);return e==="editable"?n.get(104):e!=="on"}function mx(n){return!n.get(172)}function $ve(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}function Xy(n,e,t){let i=t.indexOf(n);return i===-1?e:t[i]}function ce(n){return Lv[n.id]=n,n}var Xf,Qy,qD,Mn,yv,tg,kv,Ct,$i,Kc,ql,An,ux,NZ,RZ,Cs,AZ,MZ,OZ,Ed,PZ,FZ,BZ,WZ,HZ,VZ,zZ,UZ,$Z,jD,qZ,ou,jZ,KZ,GZ,YZ,ZZ,XZ,QZ,JZ,eX,tX,iX,nX,oX,rX,sX,Id,fc,aX,lX,cX,dX,hX,uX,fX,mX,gX,pX,_X,Lv,Vs,xs=w(()=>{We();qc();ct();l_();$D();nx();le();Xf=8,Qy=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},qD=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},Mn=class{constructor(e,t,i,o){this.id=e,this.name=t,this.defaultValue=i,this.schema=o}applyUpdate(e,t){return d4(e,t)}compute(e,t,i){return i}},yv=class{constructor(e,t){this.newValue=e,this.didChange=t}};tg=class{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return d4(e,t)}validate(e){return this.defaultValue}},kv=class{constructor(e,t,i,o){this.id=e,this.name=t,this.defaultValue=i,this.schema=o}applyUpdate(e,t){return d4(e,t)}compute(e,t,i){return i}};Ct=class extends kv{constructor(e,t,i,o=void 0){typeof o<"u"&&(o.type="boolean",o.default=i),super(e,t,i,o)}validate(e){return Ve(e,this.defaultValue)}};$i=class n extends kv{static clampedInt(e,t,i,o){return Qf(e,t,i,o)}constructor(e,t,i,o,r,s=void 0){typeof s<"u"&&(s.type="integer",s.default=i,s.minimum=o,s.maximum=r),super(e,t,i,s),this.minimum=o,this.maximum=r}validate(e){return n.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}};Kc=class n extends kv{static clamp(e,t,i){return ei?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,o,r,s,a){typeof r<"u"&&(r.type="number",r.default=i,r.minimum=s,r.maximum=a),super(e,t,i,r),this.validationFn=o,this.minimum=s,this.maximum=a}validate(e){return this.validationFn(n.float(e,this.defaultValue))}},ql=class n extends kv{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,o=void 0){typeof o<"u"&&(o.type="string",o.default=i),super(e,t,i,o)}validate(e){return n.string(e,this.defaultValue)}};An=class extends kv{constructor(e,t,i,o,r=void 0){typeof r<"u"&&(r.type="string",r.enum=o.slice(0),r.default=i),super(e,t,i,r),this._allowedValues=o}validate(e){return Sn(e,this.defaultValue,this._allowedValues)}},ux=class extends Mn{constructor(e,t,i,o,r,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=o),super(e,t,i,a),this._allowedValues=r,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};NZ=class extends Mn{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[g(201,"Use platform APIs to detect when a Screen Reader is attached."),g(202,"Optimize for usage with a Screen Reader."),g(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:g(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}},RZ=class extends Mn{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:g(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:g(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertSpace:Ve(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Ve(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Cs||(Cs={}));AZ=class extends tg{constructor(){super(162,"")}compute(e,t,i){let o=["monaco-editor"];return t.get(48)&&o.push(t.get(48)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(82)==="default"?o.push("mouse-default"):t.get(82)==="copy"&&o.push("mouse-copy"),t.get(127)&&o.push("showUnused"),t.get(157)&&o.push("showDeprecated"),o.join(" ")}},MZ=class extends Ct{constructor(){super(45,"emptySelectionClipboard",!0,{description:g(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}},OZ=class extends Mn{constructor(){let e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:g(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[g(209,"Never seed search string from the editor selection."),g(210,"Always seed search string from the editor selection, including word at cursor position."),g(211,"Only seed search string from the editor selection.")],description:g(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:e.autoFindInSelection,enumDescriptions:[g(213,"Never turn on Find in Selection automatically (default)."),g(214,"Always turn on Find in Selection automatically."),g(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:g(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:g(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:qe},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:g(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:e.loop,description:g(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:[g(220,"Do not store search history from the find widget."),g(221,"Store search history across the active workspace")],description:g(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[g(223,"Do not store history from the replace widget."),g(224,"Store replace history across the active workspace")],description:g(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:g(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{cursorMoveOnType:Ve(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Ve(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Sn(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Sn(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Ve(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Ve(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Ve(t.loop,this.defaultValue.loop),history:Sn(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Sn(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}},Ed=class n extends Mn{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",n.OFF,{anyOf:[{type:"boolean",description:g(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:g(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:g(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:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?n.OFF:e==="true"?n.ON:e:e?n.ON:n.OFF}},PZ=class n extends Mn{static{this.OFF=DZ}static{this.TRANSLATE=TZ}constructor(){super(63,"fontVariations",n.OFF,{anyOf:[{type:"boolean",description:g(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:g(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:g(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:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?n.OFF:e==="true"?n.TRANSLATE:e:e?n.TRANSLATE:n.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}},FZ=class extends tg{constructor(){super(59,new a_({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}},BZ=class extends tg{constructor(){super(161,Cs.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}},WZ=class extends tg{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}},HZ=class extends tg{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}},VZ=class extends kv{constructor(){super(61,"fontSize",Oa.fontSize,{type:"number",minimum:6,maximum:100,default:Oa.fontSize,description:g(233,"Controls the font size in pixels.")})}validate(e){let t=Kc.float(e,this.defaultValue);return t===0?Oa.fontSize:Kc.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}},zZ=class n extends Mn{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",Oa.fontWeight,{anyOf:[{type:"number",minimum:n.MINIMUM_VALUE,maximum:n.MAXIMUM_VALUE,errorMessage:g(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:n.SUGGESTION_VALUES}],default:Oa.fontWeight,description:g(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String($i.clampedInt(e,Oa.fontWeight,n.MINIMUM_VALUE,n.MAXIMUM_VALUE))}},UZ=class extends Mn{constructor(){let e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[g(236,"Show Peek view of the results (default)"),g(237,"Go to the primary result and show a Peek view"),g(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:g(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:g(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:g(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:g(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:g(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:g(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:g(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:e.alternativeTypeDefinitionCommand,enum:i,description:g(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:e.alternativeDeclarationCommand,enum:i,description:g(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:e.alternativeImplementationCommand,enum:i,description:g(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:e.alternativeReferenceCommand,enum:i,description:g(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{multiple:Sn(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Sn(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Sn(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Sn(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Sn(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Sn(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Sn(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ql.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ql.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ql.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ql.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ql.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:ql.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},$Z=class extends Mn{constructor(){let e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:g(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:g(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:g(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:g(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:e.above,description:g(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),delay:$i.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Ve(t.sticky,this.defaultValue.sticky),hidingDelay:$i.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Ve(t.above,this.defaultValue.above)}}},jD=class n extends tg{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:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return n.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight),o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));let r=(i+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:o,desiredRatio:r,minimapLineCount:s}}static _computeMinimapLayout(e,t){let i=e.outerWidth,o=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};let s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters,u=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale,f=e.minimap.maxColumn,m=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,x=e.isViewportWrapping,C=h?2:3,S=Math.floor(r*o),L=S/r,I=!1,D=!1,T=C*u,O=u/r,W=1;if(m==="fill"||m==="fit"){let{typicalViewportLineCount:_e,extraLinesBeforeFirstLine:Oe,extraLinesBeyondLastLine:Qe,desiredRatio:pt,minimapLineCount:ti}=n.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:r});if(b/ti>1)I=!0,D=!0,u=1,T=1,O=u/r;else{let pn=!1,Ni=u+1;if(m==="fit"){let Ks=Math.ceil((Oe+b+Qe)*T);x&&a&&v<=t.stableFitRemainingWidth?(pn=!0,Ni=t.stableFitMaxMinimapScale):pn=Ks>S}if(m==="fill"||pn){I=!0;let Ks=u;T=Math.min(l*r,Math.max(1,Math.floor(1/pt))),x&&a&&v<=t.stableFitRemainingWidth&&(Ni=t.stableFitMaxMinimapScale),u=Math.min(Ni,Math.max(1,Math.floor(T/C))),u>Ks&&(W=Math.min(2,u/Ks)),O=u/r/W,S=Math.ceil(Math.max(_e,Oe+b+Qe)*T),x?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}let H=Math.floor(f*O),z=Math.min(H,Math.max(0,Math.floor((v-_-2)*O/(c+O)))+Xf),Q=Math.floor(r*z),ee=Q/r;Q=Math.floor(Q*W);let pe=h?1:2,he=p==="left"?0:i-z-_;return{renderMinimap:pe,minimapLeft:he,minimapWidth:z,minimapHeightIsEditorHeight:I,minimapIsSampling:D,minimapScale:u,minimapLineHeight:T,minimapCanvasInnerWidth:Q,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:ee,minimapCanvasOuterHeight:L}}static computeLayout(e,t){let i=t.outerWidth|0,o=t.outerHeight|0,r=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,m=e.get(152),p=t.isDominatedByLongLines,_=e.get(66),b=e.get(76).renderType!==0,v=e.get(77),x=e.get(119),C=e.get(96),S=e.get(81),L=e.get(117),I=L.verticalScrollbarSize,D=L.verticalHasArrows,T=L.arrowSize,O=L.horizontalScrollbarSize,W=e.get(52),H=e.get(126)!=="never",z=e.get(74);W&&H&&(z+=16);let Q=0;if(b){let ic=Math.max(s,v);Q=Math.round(ic*l)}let ee=0;_&&(ee=r*t.glyphMarginDecorationLaneCount);let pe=0,he=pe+ee,_e=he+Q,Oe=_e+z,Qe=i-ee-Q-z,pt=!1,ti=!1,Vt=-1;e.get(2)===2&&u==="inherit"&&p?(pt=!0,ti=!0):f==="on"||f==="bounded"?ti=!0:f==="wordWrapColumn"&&(Vt=m);let pn=n._computeMinimapLayout({outerWidth:i,outerHeight:o,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:x,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:I,viewLineCount:d,remainingWidth:Qe,isViewportWrapping:ti},t.memory||new qD);pn.renderMinimap!==0&&pn.minimapLeft===0&&(pe+=pn.minimapWidth,he+=pn.minimapWidth,_e+=pn.minimapWidth,Oe+=pn.minimapWidth);let Ni=Qe-pn.minimapWidth,Ks=Math.max(1,Math.floor((Ni-I-2)/a)),Vo=D?T:0;return ti&&(Vt=Math.max(1,Ks),f==="bounded"&&(Vt=Math.min(Vt,m))),{width:i,height:o,glyphMarginLeft:pe,glyphMarginWidth:ee,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:he,lineNumbersWidth:Q,decorationsLeft:_e,decorationsWidth:z,contentLeft:Oe,contentWidth:Ni,minimap:pn,viewportColumn:Ks,isWordWrapMinified:pt,isViewportWrapping:ti,wrappingColumn:Vt,verticalScrollbarWidth:I,horizontalScrollbarHeight:O,overviewRuler:{top:Vo,width:I,height:o-2*Vo,right:0}}}},qZ=class extends Mn{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[g(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."),g(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:g(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Sn(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}};(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(ou||(ou={}));jZ=class extends Mn{constructor(){let e={enabled:ou.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[ou.Off,ou.OnCode,ou.On],default:e.enabled,enumDescriptions:[g(258,"Disable the code action menu."),g(259,"Show the code action menu when the cursor is on lines with code."),g(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:g(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Sn(e.enabled,this.defaultValue.enabled,[ou.Off,ou.OnCode,ou.On])}}},KZ=class extends Mn{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:g(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:g(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:g(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:e.scrollWithEditor,description:g(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),maxLineCount:$i.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Sn(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Ve(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},GZ=class extends Mn{constructor(){let e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:g(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[g(267,"Inlay hints are enabled"),g(268,"Inlay hints are showing by default and hide when holding {0}",qe?"Ctrl+Option":"Ctrl+Alt"),g(269,"Inlay hints are hidden by default and show when holding {0}",qe?"Ctrl+Option":"Ctrl+Alt"),g(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:g(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:e.fontFamily,markdownDescription:g(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:e.padding,description:g(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:g(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(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Sn(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:$i.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ql.string(t.fontFamily,this.defaultValue.fontFamily),padding:Ve(t.padding,this.defaultValue.padding),maximumLength:$i.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}},YZ=class extends Mn{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):$i.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?$i.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}},ZZ=class extends Kc{constructor(){super(75,"lineHeight",Oa.lineHeight,e=>Kc.clamp(e,0,150),{markdownDescription:g(275,`Controls the line height.
+ - Use 0 to automatically compute the line height from the font size.
+ - Values between 0 and 8 will be used as a multiplier with the font size.
+ - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}},XZ=class extends Mn{constructor(){let e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?-?)\\s*(?.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:g(276,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[g(277,"The minimap is always shown."),g(278,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),g(279,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:g(280,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[g(281,"The minimap has the same size as the editor contents (and might scroll)."),g(282,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),g(283,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:g(284,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:g(285,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:g(286,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:g(287,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:g(288,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:g(289,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:g(290,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:g(291,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:g(292,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:g(293,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:g(294,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e,i=this.defaultValue.markSectionHeaderRegex,o=t.markSectionHeaderRegex;if(typeof o=="string")try{new RegExp(o,"d"),i=o}catch{}return{enabled:Ve(t.enabled,this.defaultValue.enabled),autohide:Sn(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:Sn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Sn(t.side,this.defaultValue.side,["right","left"]),showSlider:Sn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:$i.clampedInt(t.scale,1,1,3),maxColumn:$i.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:Ve(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:Ve(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:i,sectionHeaderFontSize:Kc.clamp(Kc.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:Kc.clamp(Kc.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};QZ=class extends Mn{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:g(295,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:g(296,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{top:$i.clampedInt(t.top,0,0,1e3),bottom:$i.clampedInt(t.bottom,0,0,1e3)}}},JZ=class extends Mn{constructor(){let e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:g(297,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:g(298,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),cycle:Ve(t.cycle,this.defaultValue.cycle)}}},eX=class extends tg{constructor(){super(163,1)}compute(e,t,i){return e.pixelRatio}},tX=class extends Mn{constructor(){super(100,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}},iX=class extends Mn{constructor(){let e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[g(299,"Quick suggestions show inside the suggest widget"),g(300,"Quick suggestions show as ghost text"),g(301,"Quick suggestions are disabled")]}];super(102,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:g(302,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:g(303,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:g(304,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:g(305,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){let c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;let{other:t,comments:i,strings:o}=e,r=["on","inline","off"],s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=Sn(t,this.defaultValue.other,r),typeof i=="boolean"?a=i?"on":"off":a=Sn(i,this.defaultValue.comments,r),typeof o=="boolean"?l=o?"on":"off":l=Sn(o,this.defaultValue.strings,r),{other:s,comments:a,strings:l}}},nX=class extends Mn{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[g(306,"Line numbers are not rendered."),g(307,"Line numbers are rendered as absolute number."),g(308,"Line numbers are rendered as distance in lines to cursor position."),g(309,"Line numbers are rendered every 10 lines.")],default:"on",description:g(310,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}};oX=class extends Mn{constructor(){let e=[],t={type:"number",description:g(311,"Number of monospace characters at which this editor ruler will render.")};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:g(312,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:g(313,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="number")t.push({column:$i.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){let o=i;t.push({column:$i.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((i,o)=>i.column-o.column),t}return this.defaultValue}},rX=class extends Mn{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}};sX=class extends Mn{constructor(){let e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(314,"The vertical scrollbar will be visible only when necessary."),g(315,"The vertical scrollbar will always be visible."),g(316,"The vertical scrollbar will always be hidden.")],default:"auto",description:g(317,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(318,"The horizontal scrollbar will be visible only when necessary."),g(319,"The horizontal scrollbar will always be visible."),g(320,"The horizontal scrollbar will always be hidden.")],default:"auto",description:g(321,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:g(322,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:g(323,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:g(324,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:g(325,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e,i=$i.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=$i.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:$i.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:$ve(t.vertical,this.defaultValue.vertical),horizontal:$ve(t.horizontal,this.defaultValue.horizontal),useShadows:Ve(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Ve(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Ve(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Ve(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Ve(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:$i.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:o,verticalSliderSize:$i.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:Ve(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Ve(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},Id="inUntrustedWorkspace",fc={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"},aX=class extends Mn{constructor(){let e={nonBasicASCII:Id,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Id,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[fc.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Id],default:e.nonBasicASCII,description:g(326,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[fc.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:g(327,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[fc.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:g(328,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[fc.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Id],default:e.includeComments,description:g(329,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[fc.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Id],default:e.includeStrings,description:g(330,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[fc.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g(331,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[fc.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:g(332,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(ea(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(ea(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));let o=super.applyUpdate(e,t);return i?new yv(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{nonBasicASCII:Xy(t.nonBasicASCII,Id,[!0,!1,Id]),invisibleCharacters:Ve(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Ve(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Xy(t.includeComments,Id,[!0,!1,Id]),includeStrings:Xy(t.includeStrings,Id,[!0,!1,Id]),allowedCharacters:this.validateBooleanMap(t.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(t.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;let i={};for(let[o,r]of Object.entries(e))r===!0&&(i[o]=!0);return i}},lX=class extends Mn{constructor(){let e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always"},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:g(333,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(334,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),g(335,"Show the inline suggestion toolbar when hovering over an inline suggestion."),g(336,"Never show the inline suggestion toolbar.")],description:g(337,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:g(338,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:g(339,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:g(340,"Controls whether inline suggestions are suppressed when in snippet mode.")},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:g(341,"Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:g(342,"Suppresses inline completions for specified extension IDs -- comma separated."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:g(343,"Controls whether to send request information from the inline suggestion provider."),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:g(344,"Controls whether to trigger a command when the inline suggestion provider changes."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:g(345,"Controls whether to show inline suggestions when there is a suggest conflict."),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:g(346,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:g(347,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:g(348,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[g(349,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),g(350,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:g(351,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),mode:Sn(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Sn(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Ve(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Ve(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ql.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:Ve(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:$i.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:Ve(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:Ve(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(t.experimental)}}_validateEdits(e){if(!e||typeof e!="object")return this.defaultValue.edits;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.edits.enabled),showCollapsed:Ve(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:Sn(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:Sn(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])}}_validateExperimental(e){if(!e||typeof e!="object")return this.defaultValue.experimental;let t=e;return{suppressInlineSuggestions:ql.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:Sn(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:Ve(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},cX=class extends Mn{constructor(){let e={enabled:Hs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Hs.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(352,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:g(353,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Ve(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},dX=class extends Mn{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(354,"Enables bracket pair guides."),g(355,"Enables bracket pair guides only for the active bracket pair."),g(356,"Disables bracket pair guides.")],default:e.bracketPairs,description:g(357,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(358,"Enables horizontal guides as addition to vertical bracket pair guides."),g(359,"Enables horizontal guides only for the active bracket pair."),g(360,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:g(361,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:g(362,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:g(363,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[g(364,"Highlights the active indent guide."),g(365,"Highlights the active indent guide even if bracket guides are highlighted."),g(366,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:g(367,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{bracketPairs:Xy(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Xy(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Ve(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Ve(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Xy(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}};hX=class extends Mn{constructor(){let e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[g(368,"Insert suggestion without overwriting text right of the cursor."),g(369,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:g(370,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:g(371,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:g(372,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:g(373,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[g(374,"Always select a suggestion when automatically triggering IntelliSense."),g(375,"Never select a suggestion when automatically triggering IntelliSense."),g(376,"Select a suggestion only when triggering IntelliSense from a trigger character."),g(377,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:g(378,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:g(379,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:g(380,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:g(381,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:g(382,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:g(383,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:g(384,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:g(385,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:g(386,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:g(387,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:g(388,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:g(389,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:g(390,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:g(391,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:g(392,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:g(393,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:g(394,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:g(395,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:g(396,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:g(397,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:g(398,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:g(399,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:g(400,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:g(401,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:g(402,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:g(403,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:g(404,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:g(405,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:g(406,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:g(407,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:g(408,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:g(409,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:g(410,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:g(411,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:g(412,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:g(413,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:g(414,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:g(415,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertMode:Sn(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Ve(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Ve(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Ve(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Ve(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Sn(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Ve(t.showIcons,this.defaultValue.showIcons),showStatusBar:Ve(t.showStatusBar,this.defaultValue.showStatusBar),preview:Ve(t.preview,this.defaultValue.preview),previewMode:Sn(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Ve(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Ve(t.showMethods,this.defaultValue.showMethods),showFunctions:Ve(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Ve(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Ve(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Ve(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Ve(t.showFields,this.defaultValue.showFields),showVariables:Ve(t.showVariables,this.defaultValue.showVariables),showClasses:Ve(t.showClasses,this.defaultValue.showClasses),showStructs:Ve(t.showStructs,this.defaultValue.showStructs),showInterfaces:Ve(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Ve(t.showModules,this.defaultValue.showModules),showProperties:Ve(t.showProperties,this.defaultValue.showProperties),showEvents:Ve(t.showEvents,this.defaultValue.showEvents),showOperators:Ve(t.showOperators,this.defaultValue.showOperators),showUnits:Ve(t.showUnits,this.defaultValue.showUnits),showValues:Ve(t.showValues,this.defaultValue.showValues),showConstants:Ve(t.showConstants,this.defaultValue.showConstants),showEnums:Ve(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Ve(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Ve(t.showKeywords,this.defaultValue.showKeywords),showWords:Ve(t.showWords,this.defaultValue.showWords),showColors:Ve(t.showColors,this.defaultValue.showColors),showFiles:Ve(t.showFiles,this.defaultValue.showFiles),showReferences:Ve(t.showReferences,this.defaultValue.showReferences),showFolders:Ve(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Ve(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Ve(t.showSnippets,this.defaultValue.showSnippets),showUsers:Ve(t.showUsers,this.defaultValue.showUsers),showIssues:Ve(t.showIssues,this.defaultValue.showIssues)}}},uX=class extends Mn{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:g(416,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:g(417,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Ve(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Ve(e.selectSubwords,this.defaultValue.selectSubwords)}}},fX=class extends Mn{constructor(){let e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:g(418,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"},default:e})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}},mX=class extends Mn{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[g(419,"No indentation. Wrapped lines begin at column 1."),g(420,"Wrapped lines get the same indentation as the parent."),g(421,"Wrapped lines get +1 indentation toward the parent."),g(422,"Wrapped lines get +2 indentation toward the parent.")],description:g(423,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}},gX=class extends tg{constructor(){super(166,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,i){let o=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}},pX=class extends Mn{constructor(){let e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(424,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:g(425,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[g(426,"Show the drop selector widget after a file is dropped into the editor."),g(427,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),showDropSelector:Sn(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},_X=class extends Mn{constructor(){let e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(428,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:g(429,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[g(430,"Show the paste selector widget after content is pasted into the editor."),g(431,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:Ve(t.enabled,this.defaultValue.enabled),showPasteSelector:Sn(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},Lv=[];Vs={acceptSuggestionOnCommitCharacter:ce(new Ct(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:g(432,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:ce(new An(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",g(433,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:g(434,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:ce(new NZ),accessibilityPageSize:ce(new $i(3,"accessibilityPageSize",500,1,1073741824,{description:g(435,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),allowOverflow:ce(new Ct(4,"allowOverflow",!0)),allowVariableLineHeights:ce(new Ct(5,"allowVariableLineHeights",!0,{description:g(436,"Controls whether to allow using variable line heights in the editor.")})),allowVariableFonts:ce(new Ct(6,"allowVariableFonts",!0,{description:g(437,"Controls whether to allow using variable fonts in the editor.")})),allowVariableFontsInAccessibilityMode:ce(new Ct(7,"allowVariableFontsInAccessibilityMode",!1,{description:g(438,"Controls whether to allow using variable fonts in the editor in the accessibility mode."),tags:["accessibility"]})),ariaLabel:ce(new ql(8,"ariaLabel",g(439,"Editor content"))),ariaRequired:ce(new Ct(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ce(new Ct(12,"screenReaderAnnounceInlineSuggestion",!0,{description:g(440,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ce(new An(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(441,"Use language configurations to determine when to autoclose brackets."),g(442,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:g(443,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:ce(new An(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(444,"Use language configurations to determine when to autoclose comments."),g(445,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:g(446,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:ce(new An(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",g(447,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:g(448,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:ce(new An(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",g(449,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:g(450,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:ce(new An(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(451,"Use language configurations to determine when to autoclose quotes."),g(452,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:g(453,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:ce(new ux(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],sHe,{enumDescriptions:[g(454,"The editor will not insert indentation automatically."),g(455,"The editor will keep the current line's indentation."),g(456,"The editor will keep the current line's indentation and honor language defined brackets."),g(457,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),g(458,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:g(459,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),autoIndentOnPaste:ce(new Ct(17,"autoIndentOnPaste",!1,{description:g(460,"Controls whether the editor should automatically auto-indent the pasted content.")})),autoIndentOnPasteWithinString:ce(new Ct(18,"autoIndentOnPasteWithinString",!0,{description:g(461,"Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.")})),automaticLayout:ce(new Ct(19,"automaticLayout",!1)),autoSurround:ce(new An(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[g(462,"Use language configurations to determine when to automatically surround selections."),g(463,"Surround with quotes but not brackets."),g(464,"Surround with brackets but not quotes."),""],description:g(465,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:ce(new cX),bracketPairGuides:ce(new dX),stickyTabStops:ce(new Ct(132,"stickyTabStops",!1,{description:g(466,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ce(new Ct(23,"codeLens",!0,{description:g(467,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ce(new ql(24,"codeLensFontFamily","",{description:g(468,"Controls the font family for CodeLens.")})),codeLensFontSize:ce(new $i(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:g(469,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:ce(new Ct(26,"colorDecorators",!0,{description:g(470,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ce(new An(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[g(471,"Make the color picker appear both on click and hover of the color decorator"),g(472,"Make the color picker appear on hover of the color decorator"),g(473,"Make the color picker appear on click of the color decorator")],description:g(474,"Controls the condition to make a color picker appear from a color decorator.")})),colorDecoratorsLimit:ce(new $i(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:g(475,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:ce(new Ct(28,"columnSelection",!1,{description:g(476,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:ce(new RZ),contextmenu:ce(new Ct(30,"contextmenu",!0)),copyWithSyntaxHighlighting:ce(new Ct(31,"copyWithSyntaxHighlighting",!0,{description:g(477,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ce(new ux(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],aHe,{description:g(478,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:ce(new An(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[g(479,"Smooth caret animation is disabled."),g(480,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),g(481,"Smooth caret animation is always enabled.")],description:g(482,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:ce(new ux(34,"cursorStyle",Cs.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Uve,{description:g(483,"Controls the cursor style in insert input mode.")})),overtypeCursorStyle:ce(new ux(92,"overtypeCursorStyle",Cs.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],Uve,{description:g(484,"Controls the cursor style in overtype input mode.")})),cursorSurroundingLines:ce(new $i(35,"cursorSurroundingLines",0,0,1073741824,{description:g(485,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:ce(new An(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[g(486,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),g(487,"`cursorSurroundingLines` is enforced always.")],markdownDescription:g(488,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:ce(new $i(37,"cursorWidth",0,0,1073741824,{markdownDescription:g(489,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:ce(new $i(38,"cursorHeight",0,0,1073741824,{markdownDescription:g(490,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:ce(new Ct(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:ce(new Ct(40,"disableMonospaceOptimizations",!1)),domReadOnly:ce(new Ct(41,"domReadOnly",!1)),dragAndDrop:ce(new Ct(42,"dragAndDrop",!0,{description:g(491,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ce(new MZ),dropIntoEditor:ce(new pX),editContext:ce(new Ct(44,"editContext",!0,{description:g(492,"Sets whether the EditContext API should be used instead of the text area to power input in the editor."),included:jE||IO||oc})),renderRichScreenReaderContent:ce(new Ct(107,"renderRichScreenReaderContent",!1,{markdownDescription:g(493,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:ce(new KZ),experimentalGpuAcceleration:ce(new An(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[g(494,"Use regular DOM-based rendering."),g(495,"Use GPU acceleration.")],description:g(496,"Controls whether to use the experimental GPU acceleration to render the editor.")})),experimentalWhitespaceRendering:ce(new An(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[g(497,"Use a new rendering method with svgs."),g(498,"Use a new rendering method with font characters."),g(499,"Use the stable rendering method.")],description:g(500,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:ce(new ql(48,"extraEditorClassName","")),fastScrollSensitivity:ce(new Kc(49,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:g(501,"Scrolling speed multiplier when pressing `Alt`.")})),find:ce(new OZ),fixedOverflowWidgets:ce(new Ct(51,"fixedOverflowWidgets",!1)),folding:ce(new Ct(52,"folding",!0,{description:g(502,"Controls whether the editor has code folding enabled.")})),foldingStrategy:ce(new An(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[g(503,"Use a language-specific folding strategy if available, else the indentation-based one."),g(504,"Use the indentation-based folding strategy.")],description:g(505,"Controls the strategy for computing folding ranges.")})),foldingHighlight:ce(new Ct(54,"foldingHighlight",!0,{description:g(506,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ce(new Ct(55,"foldingImportsByDefault",!1,{description:g(507,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ce(new $i(56,"foldingMaximumRegions",5e3,10,65e3,{description:g(508,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:ce(new Ct(57,"unfoldOnClickAfterEndOfLine",!1,{description:g(509,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ce(new ql(58,"fontFamily",Oa.fontFamily,{description:g(510,"Controls the font family.")})),fontInfo:ce(new FZ),fontLigatures2:ce(new Ed),fontSize:ce(new VZ),fontWeight:ce(new zZ),fontVariations:ce(new PZ),formatOnPaste:ce(new Ct(64,"formatOnPaste",!1,{description:g(511,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:ce(new Ct(65,"formatOnType",!1,{description:g(512,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ce(new Ct(66,"glyphMargin",!0,{description:g(513,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ce(new UZ),hideCursorInOverviewRuler:ce(new Ct(68,"hideCursorInOverviewRuler",!1,{description:g(514,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:ce(new $Z),inDiffEditor:ce(new Ct(70,"inDiffEditor",!1)),inertialScroll:ce(new Ct(158,"inertialScroll",!1,{description:g(515,"Make scrolling inertial - mostly useful with touchpad on linux.")})),letterSpacing:ce(new Kc(72,"letterSpacing",Oa.letterSpacing,n=>Kc.clamp(n,-5,20),{description:g(516,"Controls the letter spacing in pixels.")})),lightbulb:ce(new jZ),lineDecorationsWidth:ce(new YZ),lineHeight:ce(new ZZ),lineNumbers:ce(new nX),lineNumbersMinChars:ce(new $i(77,"lineNumbersMinChars",5,1,300)),linkedEditing:ce(new Ct(78,"linkedEditing",!1,{description:g(517,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:ce(new Ct(79,"links",!0,{description:g(518,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ce(new An(80,"matchBrackets","always",["always","near","never"],{description:g(519,"Highlight matching brackets.")})),minimap:ce(new XZ),mouseStyle:ce(new An(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ce(new Kc(83,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:g(520,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:ce(new Ct(84,"mouseWheelZoom",!1,{markdownDescription:qe?g(521,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):g(522,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ce(new Ct(85,"multiCursorMergeOverlapping",!0,{description:g(523,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ce(new ux(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],lHe,{markdownEnumDescriptions:[g(524,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(525,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:g(526,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),mouseMiddleClickAction:ce(new An(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:g(527,"Controls what happens when middle mouse button is clicked in the editor.")})),multiCursorPaste:ce(new An(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[g(528,"Each cursor pastes a single line of the text."),g(529,"Each cursor pastes the full text.")],markdownDescription:g(530,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:ce(new $i(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:g(531,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ce(new An(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[g(532,"Does not highlight occurrences."),g(533,"Highlights occurrences only in the current file."),g(534,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:g(535,"Controls whether occurrences should be highlighted across open files.")})),occurrencesHighlightDelay:ce(new $i(91,"occurrencesHighlightDelay",0,0,2e3,{description:g(536,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),overtypeOnPaste:ce(new Ct(93,"overtypeOnPaste",!0,{description:g(537,"Controls whether pasting should overtype.")})),overviewRulerBorder:ce(new Ct(94,"overviewRulerBorder",!0,{description:g(538,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ce(new $i(95,"overviewRulerLanes",3,0,3)),padding:ce(new QZ),pasteAs:ce(new _X),parameterHints:ce(new JZ),peekWidgetDefaultFocus:ce(new An(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[g(539,"Focus the tree when opening peek"),g(540,"Focus the editor when opening peek")],description:g(541,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:ce(new tX),definitionLinkOpensInPeek:ce(new Ct(101,"definitionLinkOpensInPeek",!1,{description:g(542,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ce(new iX),quickSuggestionsDelay:ce(new $i(103,"quickSuggestionsDelay",10,0,1073741824,{description:g(543,"Controls the delay in milliseconds after which quick suggestions will show up."),experiment:{mode:"auto"}})),readOnly:ce(new Ct(104,"readOnly",!1)),readOnlyMessage:ce(new rX),renameOnType:ce(new Ct(106,"renameOnType",!1,{description:g(544,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:g(545,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:ce(new Ct(108,"renderControlCharacters",!0,{description:g(546,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ce(new An(109,"renderFinalNewline",go?"dimmed":"on",["off","on","dimmed"],{description:g(547,"Render last line number when the file ends with a newline.")})),renderLineHighlight:ce(new An(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",g(548,"Highlights both the gutter and the current line.")],description:g(549,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:ce(new Ct(111,"renderLineHighlightOnlyWhenFocus",!1,{description:g(550,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ce(new An(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ce(new An(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",g(551,"Render whitespace characters except for single spaces between words."),g(552,"Render whitespace characters only on selected text."),g(553,"Render only trailing whitespace characters."),""],description:g(554,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:ce(new $i(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ce(new Ct(115,"roundedSelection",!0,{description:g(555,"Controls whether selections should have rounded corners.")})),rulers:ce(new oX),scrollbar:ce(new sX),scrollBeyondLastColumn:ce(new $i(118,"scrollBeyondLastColumn",4,0,1073741824,{description:g(556,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ce(new Ct(119,"scrollBeyondLastLine",!0,{description:g(557,"Controls whether the editor will scroll beyond the last line.")})),scrollOnMiddleClick:ce(new Ct(171,"scrollOnMiddleClick",!1,{description:g(558,"Controls whether the editor will scroll when the middle button is pressed.")})),scrollPredominantAxis:ce(new Ct(120,"scrollPredominantAxis",!0,{description:g(559,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:ce(new Ct(121,"selectionClipboard",!0,{description:g(560,"Controls whether the Linux primary clipboard should be supported."),included:go})),selectionHighlight:ce(new Ct(122,"selectionHighlight",!0,{description:g(561,"Controls whether the editor should highlight matches similar to the selection.")})),selectionHighlightMaxLength:ce(new $i(123,"selectionHighlightMaxLength",200,0,1073741824,{description:g(562,"Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.")})),selectionHighlightMultiline:ce(new Ct(124,"selectionHighlightMultiline",!1,{description:g(563,"Controls whether the editor should highlight selection matches that span multiple lines.")})),selectOnLineNumbers:ce(new Ct(125,"selectOnLineNumbers",!0)),showFoldingControls:ce(new An(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[g(564,"Always show the folding controls."),g(565,"Never show the folding controls and reduce the gutter size."),g(566,"Only show the folding controls when the mouse is over the gutter.")],description:g(567,"Controls when the folding controls on the gutter are shown.")})),showUnused:ce(new Ct(127,"showUnused",!0,{description:g(568,"Controls fading out of unused code.")})),showDeprecated:ce(new Ct(157,"showDeprecated",!0,{description:g(569,"Controls strikethrough deprecated variables.")})),inlayHints:ce(new GZ),snippetSuggestions:ce(new An(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[g(570,"Show snippet suggestions on top of other suggestions."),g(571,"Show snippet suggestions below other suggestions."),g(572,"Show snippets suggestions with other suggestions."),g(573,"Do not show snippet suggestions.")],description:g(574,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:ce(new uX),smoothScrolling:ce(new Ct(130,"smoothScrolling",!1,{description:g(575,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ce(new $i(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ce(new hX),inlineSuggest:ce(new lX),inlineCompletionsAccessibilityVerbose:ce(new Ct(169,"inlineCompletionsAccessibilityVerbose",!1,{description:g(576,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:ce(new $i(135,"suggestFontSize",0,0,1e3,{markdownDescription:g(577,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:ce(new $i(136,"suggestLineHeight",0,0,1e3,{markdownDescription:g(578,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:ce(new Ct(137,"suggestOnTriggerCharacters",!0,{description:g(579,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ce(new An(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[g(580,"Always select the first suggestion."),g(581,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),g(582,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:g(583,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:ce(new An(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[g(584,"Tab complete will insert the best matching suggestion when pressing tab."),g(585,"Disable tab completions."),g(586,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:g(587,"Enables tab completions.")})),tabIndex:ce(new $i(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:ce(new Ct(141,"trimWhitespaceOnDelete",!1,{description:g(588,"Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.")})),unicodeHighlight:ce(new aX),unusualLineTerminators:ce(new An(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[g(589,"Unusual line terminators are automatically removed."),g(590,"Unusual line terminators are ignored."),g(591,"Unusual line terminators prompt to be removed.")],description:g(592,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:ce(new Ct(144,"useShadowDOM",!0)),useTabStops:ce(new Ct(145,"useTabStops",!0,{description:g(593,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:ce(new An(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[g(594,"Use the default line break rule."),g(595,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:g(596,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:ce(new fX),wordSeparators:ce(new ql(148,"wordSeparators",By,{description:g(597,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ce(new An(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[g(598,"Lines will never wrap."),g(599,"Lines will wrap at the viewport width."),g(600,"Lines will wrap at `#editor.wordWrapColumn#`."),g(601,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:g(602,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:ce(new ql(150,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:ce(new ql(151,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:ce(new $i(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:g(603,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:ce(new An(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ce(new An(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:ce(new Ct(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:g(604,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:ce(new BZ),editorClassName:ce(new AZ),defaultColorDecorators:ce(new An(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[g(605,"Show default color decorators only when no extension provides colors decorators."),g(606,"Always show default color decorators."),g(607,"Never show default color decorators.")],description:g(608,"Controls whether inline color decorations should be shown using the default document color provider.")})),pixelRatio:ce(new eX),tabFocusMode:ce(new Ct(164,"tabFocusMode",!1,{markdownDescription:g(609,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ce(new jD),wrappingInfo:ce(new gX),wrappingIndent:ce(new mX),wrappingStrategy:ce(new qZ),effectiveEditContextEnabled:ce(new WZ),effectiveAllowVariableFonts:ce(new HZ)}});var bX,vX,KD,wX=w(()=>{oe();l4();ae();B();zve();xs();l_();bX=class extends E{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){let t=ov(e),i=this._cache.get(t);return i||(i=new vX,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),!i.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),i=t.getValues(),o=!1;for(let r of i)r.isTrusted||(o=!0,t.remove(r));o&&this._onDidChange.fire()}readFontInfo(e,t){let i=this._ensureCache(e);if(!i.has(t)){let o=this._actualReadFontInfo(e,t);(o.typicalHalfwidthCharacterWidth<=2||o.typicalFullwidthCharacterWidth<=2||o.spaceWidth<=2||o.maxDigitWidth<=2)&&(o=new a_({pixelRatio:xv.getInstance(e).value,fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontSize:o.fontSize,fontFeatureSettings:o.fontFeatureSettings,fontVariationSettings:o.fontVariationSettings,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,isMonospace:o.isMonospace,typicalHalfwidthCharacterWidth:Math.max(o.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(o.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:o.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(o.spaceWidth,5),middotWidth:Math.max(o.middotWidth,5),wsmiddotWidth:Math.max(o.wsmiddotWidth,5),maxDigitWidth:Math.max(o.maxDigitWidth,5)},!1)),this._writeToCache(e,t,o)}return i.get(t)}_createRequest(e,t,i,o){let r=new c4(e,t);return i.push(r),o?.push(r),r}_actualReadFontInfo(e,t){let i=[],o=[],r=this._createRequest("n",0,i,o),s=this._createRequest("\uFF4D",0,i,null),a=this._createRequest(" ",0,i,o),l=this._createRequest("0",0,i,o),c=this._createRequest("1",0,i,o),d=this._createRequest("2",0,i,o),h=this._createRequest("3",0,i,o),u=this._createRequest("4",0,i,o),f=this._createRequest("5",0,i,o),m=this._createRequest("6",0,i,o),p=this._createRequest("7",0,i,o),_=this._createRequest("8",0,i,o),b=this._createRequest("9",0,i,o),v=this._createRequest("\u2192",0,i,o),x=this._createRequest("\uFFEB",0,i,null),C=this._createRequest("\xB7",0,i,o),S=this._createRequest("\u2E31",0,i,null),L="|/-_ilm%";for(let W=0,H=L.length;W.001){D=!1;break}}let O=!0;return D&&x.width!==T&&(O=!1),x.width>v.width&&(O=!1),new a_({pixelRatio:xv.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:D,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:O,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:S.width,maxDigitWidth:I},!0)}},vX=class{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}},KD=new bX});function ru(n,e){GD.items.push(new GD(n,e))}function mc(n,e){ru(n,(t,i,o)=>{if(typeof t<"u"){for(let[r,s]of e)if(t===r){o(n,s);return}}})}function jve(n){GD.items.forEach(e=>e.apply(n))}var GD,cHe,Kve=w(()=>{GD=class n{static{this.items=[]}constructor(e,t){this.key=e,this.migrate=t}apply(e){let t=n._read(e,this.key),i=r=>n._read(e,r),o=(r,s)=>n._write(e,r,s);this.migrate(t,i,o)}static _read(e,t){if(typeof e>"u"||e===null)return;let i=t.indexOf(".");if(i>=0){let o=t.substring(0,i);return this._read(e[o],t.substring(i+1))}return e[t]}static _write(e,t,i){let o=t.indexOf(".");if(o>=0){let r=t.substring(0,o);e[r]=e[r]||{},this._write(e[r],t.substring(o+1),i);return}e[t]=i}};mc("wordWrap",[[!0,"on"],[!1,"off"]]);mc("lineNumbers",[[!0,"on"],[!1,"off"]]);mc("cursorBlinking",[["visible","solid"]]);mc("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);mc("renderLineHighlight",[[!0,"line"],[!1,"none"]]);mc("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);mc("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);mc("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);mc("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);mc("autoIndent",[[!1,"advanced"],[!0,"full"]]);mc("matchBrackets",[[!0,"always"],[!1,"never"]]);mc("renderFinalNewline",[[!0,"on"],[!1,"off"]]);mc("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);mc("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);mc("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);mc("defaultColorDecorators",[[!0,"auto"],[!1,"never"]]);mc("minimap.autohide",[[!0,"mouseover"],[!1,"none"]]);ru("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});ru("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});ru("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});cHe={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};ru("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(let i of Object.entries(cHe))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});ru("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){let i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});ru("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});ru("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});ru("editor.experimentalEditContextEnabled",(n,e,t)=>{typeof n=="boolean"&&(t("editor.experimentalEditContextEnabled",void 0),typeof e("editor.editContext")>"u"&&t("editor.editContext",n))});ru("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1,o={};for(let r of Object.entries(n))typeof r[1]=="boolean"?(i=!0,o[r[0]]=r[1]?"explicit":"never"):o[r[0]]=r[1];i&&t("codeActionsOnSave",o)}});ru("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});ru("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});ru("inlineSuggest.edits.codeShifting",(n,e,t)=>{typeof n=="boolean"&&(t("inlineSuggest.edits.codeShifting",void 0),t("inlineSuggest.edits.allowCodeShifting",n?"always":"never"))})});var CX,c_,h4=w(()=>{ae();CX=class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new N,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},c_=new CX});function Gve(n,e,t){let i=n.get(58),o=n.get(62),r=n.get(61),s=n.get(60),a=n.get(63),l=n.get(75),c=n.get(72);return Sv._create(i,o,r,s,a,l,c,e,t)}function Yve(n,e,t=!1){let i=Vs.fontFamily.validate(n.fontFamily),o=Vs.fontWeight.validate(n.fontWeight),r=Vs.fontSize.validate(n.fontSize),s=Vs.fontLigatures2.validate(n.fontLigatures),a=Vs.fontVariations.validate(n.fontVariations),l=Vs.lineHeight.validate(n.lineHeight),c=Vs.letterSpacing.validate(n.letterSpacing);return Sv._create(i,o,r,s,a,l,c,e,t)}var xX=w(()=>{xs();l_()});var ji,d_,zs=w(()=>{Ze();ye();ji=Re("accessibilityService"),d_=new fe("accessibilityModeEnabled",!1)});function uHe(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function fHe(){let n="";return Pu||pO?(n+="no-minimap-shadow ",n+="enable-user-select "):n+="no-user-select ",qe&&(n+="mac "),n}function Zve(n){let e=ih(n);return jve(e),e}var dHe,hHe,u4,SX,yX,gx,Xve=w(()=>{Gs();We();ae();B();qc();ct();SZ();wX();Kve();h4();xs();Zy();xX();zs();oe();l4();zY();dHe=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hHe=function(n,e){return function(t,i){e(t,i,n)}},u4=class extends E{constructor(e,t,i,o,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new N),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new qD,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new Yy(o,i.dimension)),this._targetWindowId=Ce(o).vscodeWindowId,this._rawOptions=Zve(i),this._validatedOptions=gx.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(19)&&this._containerObserver.startObserving(),this._register($l.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(c_.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(KD.onDidChange(()=>this._recomputeOptions())),this._register(xv.getInstance(Ce(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._register(DD.onDidChangeInputMode(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=gx.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=Gve(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(164)||c_.getTabFocusMode(),inputMode:DD.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return gx.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:fHe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:_C||To,pixelRatio:xv.getInstance(uY(this._targetWindowId,!0).window).value,editContextSupported:typeof globalThis.EditContext=="function",accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return KD.readFontInfo(uY(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=Zve(e);gx.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=gx.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=uHe(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};u4=dHe([hHe(4,ji)],u4);SX=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}},yX=class{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}},gx=class n{static validateOptions(e){let t=new SX;for(let i of Lv){let o=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(o))}return t}static computeOptions(e,t){let i=new yX;for(let o of Lv)i._write(o.id,o.compute(t,i,e._read(o.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Pt(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!n._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){let i=[],o=!1;for(let r of Lv){let s=!n._deepEquals(e._read(r.id),t._read(r.id));i[r.id]=s,s&&(o=!0)}return o?new Qy(i):null}static applyUpdate(e,t){let i=!1;for(let o of Lv)if(t.hasOwnProperty(o.name)){let r=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=r.newValue,i=i||r.didChange}return i}}});var ig,kX=w(()=>{(function(n){let e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},o={...e},r=0,s={keydown:0,input:0,render:0};function a(){b(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,_()}n.onBeforeInput=c;function d(){s.input===0&&c(),queueMicrotask(h)}n.onInput=d;function h(){s.input===1&&(performance.mark("input/end"),s.input=2)}function u(){b()}n.onKeyUp=u;function f(){b()}n.onSelectionChange=f;function m(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),_())}n.onRenderStart=m;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function _(){setTimeout(b)}function b(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),v("keydown",e),v("input",t),v("render",i),v("inputlatency",o),r++,x())}function v(I,D){let T=performance.getEntriesByName(I)[0].duration;D.total+=T,D.min=Math.min(D.min,T),D.max=Math.max(D.max,T)}function x(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function C(){if(r===0)return;let I={keydown:S(e),input:S(t),render:S(i),total:S(o),sampleCount:r};return L(e),L(t),L(i),L(o),r=0,I}n.getAndClearMeasurements=C;function S(I){return{average:I.total/r,max:I.max,min:I.min}}function L(I){I.total=0,I.min=Number.MAX_VALUE,I.max=0}})(ig||(ig={}))});function mHe(){return new IX}function _a(n=Et.document.head,e,t){let i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),n.appendChild(i),t&&t.add(se(()=>i.remove())),n===Et.document.head){let o=new Set;f4.set(i,o),t&&t.add(se(()=>f4.delete(i)));for(let{window:r,disposables:s}of hY()){if(r===Et)continue;let a=s.add(gHe(i,o,r));t?.add(a)}}return i}function gHe(n,e,t){let i=new P,o=n.cloneNode(!0);t.document.head.appendChild(o),i.add(se(()=>o.remove()));for(let r of Jve(n))o.sheet?.insertRule(r.cssText,o.sheet?.cssRules.length);return i.add(vbe.observe(n,i,{childList:!0,subtree:To,characterData:To})(()=>{o.textContent=n.textContent})),e.add(o),i.add(se(()=>e.delete(o))),i}function Qve(){return LX||(LX=_a()),LX}function Jve(n){return n?.sheet?.rules?n.sheet.rules:n?.sheet?.cssRules?n.sheet.cssRules:[]}function Jy(n,e,t=Qve()){if(!(!t||!e)){t.sheet?.insertRule(`${n} {${e}}`,0);for(let i of f4.get(t)??[])Jy(n,e,i)}}function m4(n,e=Qve()){if(!e)return;let t=Jve(e),i=[];for(let o=0;o=0;o--)e.sheet?.deleteRule(i[o]);for(let o of f4.get(e)??[])m4(n,o)}function pHe(n){return typeof n.selectorText=="string"}function ewe(n){let e=new P,t=e.add(mHe());return e.add(Te(i=>{t.setStyle(n.read(i))})),e}var f4,IX,LX,su=w(()=>{B();dt();Gs();oe();ka();pi();f4=new Map;IX=class{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.textContent=e:this._styleSheet=_a(Et.document.head,t=>t.textContent=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}};LX=null});var oh,px=w(()=>{oe();B();oh=class{constructor(){this._hooks=new P,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,o,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(se(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Ce(e)}this._hooks.add(F(s,J.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(F(s,J.POINTER_UP,a=>this.stopMonitoring(!0)))}}});function Iv(n,e){let t=Math.pow(10,e);return Math.round(n*t)/t}var Z,ng,Xu,q,en=w(()=>{Z=class{constructor(e,t,i,o=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Iv(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}},ng=class n{constructor(e,t,i,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Iv(Math.max(Math.min(1,t),0),3),this.l=Iv(Math.max(Math.min(1,i),0),3),this.a=Iv(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,o=e.b/255,r=e.a,s=Math.max(t,i,o),a=Math.min(t,i,o),l=0,c=0,d=(a+s)/2,h=s-a;if(h>0){switch(c=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),s){case t:l=(i-o)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){let t=e.h/360,{s:i,l:o,a:r}=e,s,a,l;if(i===0)s=a=l=o;else{let c=o<.5?o*(1+i):o+i-o*i,d=2*o-c;s=n._hue2rgb(d,c,t+1/3),a=n._hue2rgb(d,c,t),l=n._hue2rgb(d,c,t-1/3)}return new Z(Math.round(s*255),Math.round(a*255),Math.round(l*255),r)}},Xu=class n{constructor(e,t,i,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Iv(Math.max(Math.min(1,t),0),3),this.v=Iv(Math.max(Math.min(1,i),0),3),this.a=Iv(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,o=e.b/255,r=Math.max(t,i,o),s=Math.min(t,i,o),a=r-s,l=r===0?0:a/r,c;return a===0?c=0:r===t?c=((i-o)/a%6+6)%6:r===i?c=(o-t)/a+2:c=(t-i)/a+4,new n(Math.round(c*60),l,r,e.a)}static toRGBA(e){let{h:t,s:i,v:o,a:r}=e,s=o*i,a=s*(1-Math.abs(t/60%2-1)),l=o-s,[c,d,h]=[0,0,0];return t<60?(c=s,d=a):t<120?(c=a,d=s):t<180?(d=s,h=a):t<240?(d=a,h=s):t<300?(c=a,h=s):t<=360&&(c=s,h=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),h=Math.round((h+l)*255),new Z(c,d,h,r)}},q=class n{static fromHex(e){return n.Format.CSS.parseHex(e)||n.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:ng.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Xu.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Z)this.rgba=e;else if(e instanceof ng)this._hsla=e,this.rgba=ng.toRGBA(e);else if(e instanceof Xu)this._hsva=e,this.rgba=Xu.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Z.equals(this.rgba,e.rgba)&&ng.equals(this.hsla,e.hsla)&&Xu.equals(this.hsva,e.hsva)}getRelativeLuminance(){let e=n._relativeLuminanceForComponent(this.rgba.r),t=n._relativeLuminanceForComponent(this.rgba.g),i=n._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*i;return Iv(o,4)}static _relativeLuminanceForComponent(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){let t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){let t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>>0),this._toNumber32Bit}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;let o=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(r-o)/r,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;let o=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(o-r)/o,e.darken(i)}static{this.white=new n(new Z(255,255,255,1))}static{this.black=new n(new Z(0,0,0,1))}static{this.red=new n(new Z(255,0,0,1))}static{this.blue=new n(new Z(0,0,255,1))}static{this.green=new n(new Z(0,255,0,1))}static{this.cyan=new n(new Z(0,255,255,1))}static{this.lightgrey=new n(new Z(211,211,211,1))}static{this.transparent=new n(new Z(0,0,0,0))}};(function(n){(function(e){(function(t){function i(p){return p.rgba.a===1?`rgb(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b})`:n.Format.CSS.formatRGBA(p)}t.formatRGB=i;function o(p){return`rgba(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b}, ${+p.rgba.a.toFixed(2)})`}t.formatRGBA=o;function r(p){return p.hsla.a===1?`hsl(${p.hsla.h}, ${Math.round(p.hsla.s*100)}%, ${Math.round(p.hsla.l*100)}%)`:n.Format.CSS.formatHSLA(p)}t.formatHSL=r;function s(p){return`hsla(${p.hsla.h}, ${Math.round(p.hsla.s*100)}%, ${Math.round(p.hsla.l*100)}%, ${p.hsla.a.toFixed(2)})`}t.formatHSLA=s;function a(p){let _=p.toString(16);return _.length!==2?"0"+_:_}function l(p){return`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}`}t.formatHex=l;function c(p,_=!1){return _&&p.rgba.a===1?n.Format.CSS.formatHex(p):`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}${a(Math.round(p.rgba.a*255))}`}t.formatHexA=c;function d(p){return p.isOpaque()?n.Format.CSS.formatHex(p):n.Format.CSS.formatRGBA(p)}t.format=d;function h(p){if(p==="transparent")return n.transparent;if(p.startsWith("#"))return f(p);if(p.startsWith("rgba(")){let _=p.match(/rgba\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+(\.\d+)?)\)/);if(!_)throw new Error("Invalid color format "+p);let b=parseInt(_.groups?.r??"0"),v=parseInt(_.groups?.g??"0"),x=parseInt(_.groups?.b??"0"),C=parseFloat(_.groups?.a??"0");return new n(new Z(b,v,x,C))}if(p.startsWith("rgb(")){let _=p.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/);if(!_)throw new Error("Invalid color format "+p);let b=parseInt(_.groups?.r??"0"),v=parseInt(_.groups?.g??"0"),x=parseInt(_.groups?.b??"0");return new n(new Z(b,v,x))}return u(p)}t.parse=h;function u(p){switch(p){case"aliceblue":return new n(new Z(240,248,255,1));case"antiquewhite":return new n(new Z(250,235,215,1));case"aqua":return new n(new Z(0,255,255,1));case"aquamarine":return new n(new Z(127,255,212,1));case"azure":return new n(new Z(240,255,255,1));case"beige":return new n(new Z(245,245,220,1));case"bisque":return new n(new Z(255,228,196,1));case"black":return new n(new Z(0,0,0,1));case"blanchedalmond":return new n(new Z(255,235,205,1));case"blue":return new n(new Z(0,0,255,1));case"blueviolet":return new n(new Z(138,43,226,1));case"brown":return new n(new Z(165,42,42,1));case"burlywood":return new n(new Z(222,184,135,1));case"cadetblue":return new n(new Z(95,158,160,1));case"chartreuse":return new n(new Z(127,255,0,1));case"chocolate":return new n(new Z(210,105,30,1));case"coral":return new n(new Z(255,127,80,1));case"cornflowerblue":return new n(new Z(100,149,237,1));case"cornsilk":return new n(new Z(255,248,220,1));case"crimson":return new n(new Z(220,20,60,1));case"cyan":return new n(new Z(0,255,255,1));case"darkblue":return new n(new Z(0,0,139,1));case"darkcyan":return new n(new Z(0,139,139,1));case"darkgoldenrod":return new n(new Z(184,134,11,1));case"darkgray":return new n(new Z(169,169,169,1));case"darkgreen":return new n(new Z(0,100,0,1));case"darkgrey":return new n(new Z(169,169,169,1));case"darkkhaki":return new n(new Z(189,183,107,1));case"darkmagenta":return new n(new Z(139,0,139,1));case"darkolivegreen":return new n(new Z(85,107,47,1));case"darkorange":return new n(new Z(255,140,0,1));case"darkorchid":return new n(new Z(153,50,204,1));case"darkred":return new n(new Z(139,0,0,1));case"darksalmon":return new n(new Z(233,150,122,1));case"darkseagreen":return new n(new Z(143,188,143,1));case"darkslateblue":return new n(new Z(72,61,139,1));case"darkslategray":return new n(new Z(47,79,79,1));case"darkslategrey":return new n(new Z(47,79,79,1));case"darkturquoise":return new n(new Z(0,206,209,1));case"darkviolet":return new n(new Z(148,0,211,1));case"deeppink":return new n(new Z(255,20,147,1));case"deepskyblue":return new n(new Z(0,191,255,1));case"dimgray":return new n(new Z(105,105,105,1));case"dimgrey":return new n(new Z(105,105,105,1));case"dodgerblue":return new n(new Z(30,144,255,1));case"firebrick":return new n(new Z(178,34,34,1));case"floralwhite":return new n(new Z(255,250,240,1));case"forestgreen":return new n(new Z(34,139,34,1));case"fuchsia":return new n(new Z(255,0,255,1));case"gainsboro":return new n(new Z(220,220,220,1));case"ghostwhite":return new n(new Z(248,248,255,1));case"gold":return new n(new Z(255,215,0,1));case"goldenrod":return new n(new Z(218,165,32,1));case"gray":return new n(new Z(128,128,128,1));case"green":return new n(new Z(0,128,0,1));case"greenyellow":return new n(new Z(173,255,47,1));case"grey":return new n(new Z(128,128,128,1));case"honeydew":return new n(new Z(240,255,240,1));case"hotpink":return new n(new Z(255,105,180,1));case"indianred":return new n(new Z(205,92,92,1));case"indigo":return new n(new Z(75,0,130,1));case"ivory":return new n(new Z(255,255,240,1));case"khaki":return new n(new Z(240,230,140,1));case"lavender":return new n(new Z(230,230,250,1));case"lavenderblush":return new n(new Z(255,240,245,1));case"lawngreen":return new n(new Z(124,252,0,1));case"lemonchiffon":return new n(new Z(255,250,205,1));case"lightblue":return new n(new Z(173,216,230,1));case"lightcoral":return new n(new Z(240,128,128,1));case"lightcyan":return new n(new Z(224,255,255,1));case"lightgoldenrodyellow":return new n(new Z(250,250,210,1));case"lightgray":return new n(new Z(211,211,211,1));case"lightgreen":return new n(new Z(144,238,144,1));case"lightgrey":return new n(new Z(211,211,211,1));case"lightpink":return new n(new Z(255,182,193,1));case"lightsalmon":return new n(new Z(255,160,122,1));case"lightseagreen":return new n(new Z(32,178,170,1));case"lightskyblue":return new n(new Z(135,206,250,1));case"lightslategray":return new n(new Z(119,136,153,1));case"lightslategrey":return new n(new Z(119,136,153,1));case"lightsteelblue":return new n(new Z(176,196,222,1));case"lightyellow":return new n(new Z(255,255,224,1));case"lime":return new n(new Z(0,255,0,1));case"limegreen":return new n(new Z(50,205,50,1));case"linen":return new n(new Z(250,240,230,1));case"magenta":return new n(new Z(255,0,255,1));case"maroon":return new n(new Z(128,0,0,1));case"mediumaquamarine":return new n(new Z(102,205,170,1));case"mediumblue":return new n(new Z(0,0,205,1));case"mediumorchid":return new n(new Z(186,85,211,1));case"mediumpurple":return new n(new Z(147,112,219,1));case"mediumseagreen":return new n(new Z(60,179,113,1));case"mediumslateblue":return new n(new Z(123,104,238,1));case"mediumspringgreen":return new n(new Z(0,250,154,1));case"mediumturquoise":return new n(new Z(72,209,204,1));case"mediumvioletred":return new n(new Z(199,21,133,1));case"midnightblue":return new n(new Z(25,25,112,1));case"mintcream":return new n(new Z(245,255,250,1));case"mistyrose":return new n(new Z(255,228,225,1));case"moccasin":return new n(new Z(255,228,181,1));case"navajowhite":return new n(new Z(255,222,173,1));case"navy":return new n(new Z(0,0,128,1));case"oldlace":return new n(new Z(253,245,230,1));case"olive":return new n(new Z(128,128,0,1));case"olivedrab":return new n(new Z(107,142,35,1));case"orange":return new n(new Z(255,165,0,1));case"orangered":return new n(new Z(255,69,0,1));case"orchid":return new n(new Z(218,112,214,1));case"palegoldenrod":return new n(new Z(238,232,170,1));case"palegreen":return new n(new Z(152,251,152,1));case"paleturquoise":return new n(new Z(175,238,238,1));case"palevioletred":return new n(new Z(219,112,147,1));case"papayawhip":return new n(new Z(255,239,213,1));case"peachpuff":return new n(new Z(255,218,185,1));case"peru":return new n(new Z(205,133,63,1));case"pink":return new n(new Z(255,192,203,1));case"plum":return new n(new Z(221,160,221,1));case"powderblue":return new n(new Z(176,224,230,1));case"purple":return new n(new Z(128,0,128,1));case"rebeccapurple":return new n(new Z(102,51,153,1));case"red":return new n(new Z(255,0,0,1));case"rosybrown":return new n(new Z(188,143,143,1));case"royalblue":return new n(new Z(65,105,225,1));case"saddlebrown":return new n(new Z(139,69,19,1));case"salmon":return new n(new Z(250,128,114,1));case"sandybrown":return new n(new Z(244,164,96,1));case"seagreen":return new n(new Z(46,139,87,1));case"seashell":return new n(new Z(255,245,238,1));case"sienna":return new n(new Z(160,82,45,1));case"silver":return new n(new Z(192,192,192,1));case"skyblue":return new n(new Z(135,206,235,1));case"slateblue":return new n(new Z(106,90,205,1));case"slategray":return new n(new Z(112,128,144,1));case"slategrey":return new n(new Z(112,128,144,1));case"snow":return new n(new Z(255,250,250,1));case"springgreen":return new n(new Z(0,255,127,1));case"steelblue":return new n(new Z(70,130,180,1));case"tan":return new n(new Z(210,180,140,1));case"teal":return new n(new Z(0,128,128,1));case"thistle":return new n(new Z(216,191,216,1));case"tomato":return new n(new Z(255,99,71,1));case"turquoise":return new n(new Z(64,224,208,1));case"violet":return new n(new Z(238,130,238,1));case"wheat":return new n(new Z(245,222,179,1));case"white":return new n(new Z(255,255,255,1));case"whitesmoke":return new n(new Z(245,245,245,1));case"yellow":return new n(new Z(255,255,0,1));case"yellowgreen":return new n(new Z(154,205,50,1));default:return null}}function f(p){let _=p.length;if(_===0||p.charCodeAt(0)!==35)return null;if(_===7){let b=16*m(p.charCodeAt(1))+m(p.charCodeAt(2)),v=16*m(p.charCodeAt(3))+m(p.charCodeAt(4)),x=16*m(p.charCodeAt(5))+m(p.charCodeAt(6));return new n(new Z(b,v,x,1))}if(_===9){let b=16*m(p.charCodeAt(1))+m(p.charCodeAt(2)),v=16*m(p.charCodeAt(3))+m(p.charCodeAt(4)),x=16*m(p.charCodeAt(5))+m(p.charCodeAt(6)),C=16*m(p.charCodeAt(7))+m(p.charCodeAt(8));return new n(new Z(b,v,x,C/255))}if(_===4){let b=m(p.charCodeAt(1)),v=m(p.charCodeAt(2)),x=m(p.charCodeAt(3));return new n(new Z(16*b+b,16*v+v,16*x+x))}if(_===5){let b=m(p.charCodeAt(1)),v=m(p.charCodeAt(2)),x=m(p.charCodeAt(3)),C=m(p.charCodeAt(4));return new n(new Z(16*b+b,16*v+v,16*x+x,(16*C+C)/255))}return null}t.parseHex=f;function m(p){switch(p){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}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(q||(q={}))});function g4(n){return`--vscode-${n.replace(/\./g,"-")}`}function re(n){return`var(${g4(n)})`}function p4(n,e){return`var(${g4(n)}, ${e})`}function _He(n){return n!==null&&typeof n=="object"&&"light"in n&&"dark"in n}function A(n,e,t,i,o){return _4.registerColor(n,e,t,i,o)}function vHe(n,e){switch(n.op){case 0:return au(n.value,e)?.darken(n.factor);case 1:return au(n.value,e)?.lighten(n.factor);case 2:return au(n.value,e)?.transparent(n.factor);case 7:{let t=au(n.color,e)||q.transparent,i=au(n.with,e)||q.transparent;return t.mix(i,n.ratio)}case 3:{let t=au(n.background,e);return t?au(n.value,e)?.makeOpaque(t):au(n.value,e)}case 4:for(let t of n.values){let i=au(t,e);if(i)return i}return;case 6:return au(e.defines(n.if)?n.then:n.else,e);case 5:{let t=au(n.value,e);if(!t)return;let i=au(n.background,e);return i?t.isDarkerThan(i)?q.getLighterColor(t,i,n.factor).transparent(n.transparency):q.getDarkerColor(t,i,n.factor).transparent(n.transparency):t.transparent(n.factor*n.transparency)}default:throw Hm()}}function il(n,e){return{op:0,value:n,factor:e}}function rh(n,e){return{op:1,value:n,factor:e}}function Je(n,e){return{op:2,value:n,factor:e}}function _x(...n){return{op:4,values:n}}function iwe(n,e,t){return{op:6,if:n,then:e,else:t}}function TX(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function au(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?q.fromHex(n):e.getColor(n);if(n instanceof q)return n;if(typeof n=="object")return vHe(n,e)}}var DX,bHe,EX,_4,nwe,owe,twe,Bt=w(()=>{_l();Ye();en();ae();IF();_s();le();B();DX={ColorContribution:"base.contributions.colors"},bHe="default",EX=class extends E{constructor(){super(),this._onDidChangeSchema=this._register(new N),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,o=!1,r){let s={id:e,description:i,defaults:t,needsTransparency:o,deprecationMessage:r};this.colorsById[e]=s;let a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),o&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=g(2022,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:bHe,description:g(2023,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){let i=this.colorsById[e];if(i?.defaults){let o=_He(i.defaults)?i.defaults[t.type]:i.defaults;return au(o,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(t,i)=>{let o=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return o!==r?o-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(`
+`)}},_4=new EX;qt.add(DX.ColorContribution,_4);nwe="vscode://schemas/workbench-colors",owe=qt.as(ox.JSONContribution);owe.registerSchema(nwe,_4.getColorSchema());twe=new lt(()=>owe.notifySchemaChanged(nwe),200);_4.onDidChangeSchema(()=>{twe.isScheduled()||twe.schedule()})});var wt,NX,bx,sh,xt,Pi,rwe,ri=w(()=>{le();en();Bt();wt=A("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(1773,"Overall foreground color. This color is only used if not overridden by a component."));A("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(1774,"Overall foreground for disabled elements. This color is only used if not overridden by a component."));A("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(1775,"Overall foreground color for error messages. This color is only used if not overridden by a component."));NX=A("descriptionForeground",{light:"#717171",dark:Je(wt,.7),hcDark:Je(wt,.7),hcLight:Je(wt,.7)},g(1776,"Foreground color for description text providing additional information, for example for a label.")),bx=A("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1777,"The default color for icons in the workbench.")),sh=A("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(1778,"Overall border color for focused elements. This color is only used if not overridden by a component.")),xt=A("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(1779,"An extra border around elements to separate them from others for greater contrast.")),Pi=A("contrastActiveBorder",{light:null,dark:null,hcDark:sh,hcLight:sh},g(1780,"An extra border around active elements to separate them from others for greater contrast."));A("selection.background",null,g(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."));rwe=A("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1782,"Foreground color for links in text."));A("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1783,"Foreground color for links in text when clicked on and on mouse hover."));A("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:q.black,hcLight:"#292929"},g(1784,"Color for text separators."));A("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(1785,"Foreground color for preformatted text segments."));A("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(1786,"Background color for preformatted text segments."));A("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1787,"Background color for block quotes in text."));A("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:q.white,hcLight:"#292929"},g(1788,"Border color for block quotes in text."));A("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:q.black,hcLight:"#F2F2F2"},g(1789,"Background color for code blocks in text."))});var e0,swe,vx,b4,v4,w4,awe,Si=w(()=>{le();en();Bt();ri();A("sash.hoverBorder",sh,g(1994,"Border color of active sashes."));e0=A("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:q.black,hcLight:"#0F4A85"},g(1995,"Badge background color. Badges are small information labels, e.g. for search results count.")),swe=A("badge.foreground",{dark:q.white,light:"#333",hcDark:q.white,hcLight:q.white},g(1996,"Badge foreground color. Badges are small information labels, e.g. for search results count."));A("activityWarningBadge.foreground",{dark:q.black.lighten(.2),light:q.white,hcDark:null,hcLight:q.black.lighten(.2)},g(1997,"Foreground color of the warning activity badge"));A("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},g(1998,"Background color of the warning activity badge"));A("activityErrorBadge.foreground",{dark:q.black.lighten(.2),light:q.white,hcDark:null,hcLight:q.black.lighten(.2)},g(1999,"Foreground color of the error activity badge"));A("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},g(2e3,"Background color of the error activity badge"));vx=A("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(2001,"Scrollbar shadow to indicate that the view is scrolled.")),b4=A("scrollbarSlider.background",{dark:q.fromHex("#797979").transparent(.4),light:q.fromHex("#646464").transparent(.4),hcDark:Je(xt,.6),hcLight:Je(xt,.4)},g(2002,"Scrollbar slider background color.")),v4=A("scrollbarSlider.hoverBackground",{dark:q.fromHex("#646464").transparent(.7),light:q.fromHex("#646464").transparent(.7),hcDark:Je(xt,.8),hcLight:Je(xt,.8)},g(2003,"Scrollbar slider background color when hovering.")),w4=A("scrollbarSlider.activeBackground",{dark:q.fromHex("#BFBFBF").transparent(.4),light:q.fromHex("#000000").transparent(.6),hcDark:xt,hcLight:xt},g(2004,"Scrollbar slider background color when clicked on."));A("scrollbar.background",null,g(2005,"Scrollbar track background color."));awe=A("progressBar.background",{dark:q.fromHex("#0E70C0"),light:q.fromHex("#0E70C0"),hcDark:xt,hcLight:xt},g(2006,"Background color of the progress bar that can show for long running operations."));A("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},g(2007,"Line color for the chart."));A("chart.axis",{dark:q.fromHex("#BFBFBF").transparent(.4),light:q.fromHex("#000000").transparent(.6),hcDark:xt,hcLight:xt},g(2008,"Axis color for the chart."));A("chart.guide",{dark:q.fromHex("#BFBFBF").transparent(.2),light:q.fromHex("#000000").transparent(.2),hcDark:xt,hcLight:xt},g(2009,"Guide line for the chart."))});var tn,ah,nl,wx,ZD,Cx,uwe,fwe,lh,Ev,Gc,Dv,mwe,gwe,h_,pwe,OX,XD,_we,lu,bwe,Qu,vwe,YD,PX,n0,S4,y4,wwe,Cwe,xwe,Swe,wHe,C4,x4,u_,og,QD,ywe,kwe,rg,o0,lwe,Lwe,Iwe,FX,Ewe,Dwe,cwe,dwe,hwe,BX,t0,RX,AX,MX,i0,k4,WX,Twe,Nwe,Rwe,hi=w(()=>{le();en();Bt();ri();Si();tn=A("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:q.black,hcLight:q.white},g(1798,"Editor background color.")),ah=A("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:q.white,hcLight:wt},g(1799,"Editor default foreground color."));A("editorStickyScroll.background",tn,g(1800,"Background color of sticky scroll in the editor"));A("editorStickyScrollGutter.background",tn,g(1801,"Background color of the gutter part of sticky scroll in the editor"));A("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:q.fromHex("#0F4A85").transparent(.1)},g(1802,"Background color of sticky scroll on hover in the editor"));A("editorStickyScroll.border",{dark:null,light:null,hcDark:xt,hcLight:xt},g(1803,"Border color of sticky scroll in the editor"));A("editorStickyScroll.shadow",vx,g(1804," Shadow color of sticky scroll in the editor"));nl=A("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:q.white},g(1805,"Background color of editor widgets, such as find/replace.")),wx=A("editorWidget.foreground",wt,g(1806,"Foreground color of editor widgets, such as find/replace.")),ZD=A("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:xt,hcLight:xt},g(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."));A("editorWidget.resizeBorder",null,g(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."));A("editorError.background",null,g(1809,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);Cx=A("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1810,"Foreground color of error squigglies in the editor.")),uwe=A("editorError.border",{dark:null,light:null,hcDark:q.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(1811,"If set, color of double underlines for errors in the editor.")),fwe=A("editorWarning.background",null,g(1812,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),lh=A("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1813,"Foreground color of warning squigglies in the editor.")),Ev=A("editorWarning.border",{dark:null,light:null,hcDark:q.fromHex("#FFCC00").transparent(.8),hcLight:q.fromHex("#FFCC00").transparent(.8)},g(1814,"If set, color of double underlines for warnings in the editor."));A("editorInfo.background",null,g(1815,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);Gc=A("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1816,"Foreground color of info squigglies in the editor.")),Dv=A("editorInfo.border",{dark:null,light:null,hcDark:q.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(1817,"If set, color of double underlines for infos in the editor.")),mwe=A("editorHint.foreground",{dark:q.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(1818,"Foreground color of hint squigglies in the editor."));A("editorHint.border",{dark:null,light:null,hcDark:q.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(1819,"If set, color of double underlines for hints in the editor."));gwe=A("editorLink.activeForeground",{dark:"#4E94CE",light:q.blue,hcDark:q.cyan,hcLight:"#292929"},g(1820,"Color of active links.")),h_=A("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1821,"Color of the editor selection.")),pwe=A("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:q.white},g(1822,"Color of the selected text for high contrast.")),OX=A("editor.inactiveSelectionBackground",{light:Je(h_,.5),dark:Je(h_,.5),hcDark:Je(h_,.7),hcLight:Je(h_,.5)},g(1823,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),XD=A("editor.selectionHighlightBackground",{light:TX(h_,tn,.3,.6),dark:TX(h_,tn,.3,.6),hcDark:null,hcLight:null},g(1824,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);A("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Pi,hcLight:Pi},g(1825,"Border color for regions with the same content as the selection."));A("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},g(1826,"The border color for an IME composition."));A("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1827,"Color of the current search match."));_we=A("editor.findMatchForeground",null,g(1828,"Text color of the current search match.")),lu=A("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(1829,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),bwe=A("editor.findMatchHighlightForeground",null,g(1830,"Foreground color of the other search matches."),!0);A("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(1831,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);A("editor.findMatchBorder",{light:null,dark:null,hcDark:Pi,hcLight:Pi},g(1832,"Border color of the current search match."));Qu=A("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Pi,hcLight:Pi},g(1833,"Border color of the other search matches.")),vwe=A("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Je(Pi,.4),hcLight:Je(Pi,.4)},g(1834,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);A("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(1835,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);YD=A("editorHoverWidget.background",nl,g(1836,"Background color of the editor hover.")),PX=A("editorHoverWidget.foreground",wx,g(1837,"Foreground color of the editor hover.")),n0=A("editorHoverWidget.border",ZD,g(1838,"Border color of the editor hover."));A("editorHoverWidget.statusBarBackground",{dark:rh(YD,.2),light:il(YD,.05),hcDark:nl,hcLight:nl},g(1839,"Background color of the editor hover status bar."));S4=A("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:q.white,hcLight:q.black},g(1840,"Foreground color of inline hints")),y4=A("editorInlayHint.background",{dark:Je(e0,.1),light:Je(e0,.1),hcDark:Je(q.white,.1),hcLight:Je(e0,.1)},g(1841,"Background color of inline hints")),wwe=A("editorInlayHint.typeForeground",S4,g(1842,"Foreground color of inline hints for types")),Cwe=A("editorInlayHint.typeBackground",y4,g(1843,"Background color of inline hints for types")),xwe=A("editorInlayHint.parameterForeground",S4,g(1844,"Foreground color of inline hints for parameters")),Swe=A("editorInlayHint.parameterBackground",y4,g(1845,"Background color of inline hints for parameters")),wHe=A("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(1846,"The color used for the lightbulb actions icon."));A("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(1847,"The color used for the lightbulb auto fix actions icon."));A("editorLightBulbAi.foreground",wHe,g(1848,"The color used for the lightbulb AI icon."));A("editor.snippetTabstopHighlightBackground",{dark:new q(new Z(124,124,124,.3)),light:new q(new Z(10,50,100,.2)),hcDark:new q(new Z(124,124,124,.3)),hcLight:new q(new Z(10,50,100,.2))},g(1849,"Highlight background color of a snippet tabstop."));A("editor.snippetTabstopHighlightBorder",null,g(1850,"Highlight border color of a snippet tabstop."));A("editor.snippetFinalTabstopHighlightBackground",null,g(1851,"Highlight background color of the final tabstop of a snippet."));A("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new q(new Z(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1852,"Highlight border color of the final tabstop of a snippet."));C4=new q(new Z(155,185,85,.2)),x4=new q(new Z(255,0,0,.2)),u_=A("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(1853,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),og=A("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(1854,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),QD=A("diffEditor.insertedLineBackground",{dark:C4,light:C4,hcDark:null,hcLight:null},g(1855,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);A("diffEditor.removedLineBackground",{dark:x4,light:x4,hcDark:null,hcLight:null},g(1856,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);A("diffEditorGutter.insertedLineBackground",null,g(1857,"Background color for the margin where lines got inserted."));A("diffEditorGutter.removedLineBackground",null,g(1858,"Background color for the margin where lines got removed."));ywe=A("diffEditorOverview.insertedForeground",null,g(1859,"Diff overview ruler foreground for inserted content.")),kwe=A("diffEditorOverview.removedForeground",null,g(1860,"Diff overview ruler foreground for removed content."));A("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(1861,"Outline color for the text that got inserted."));A("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(1862,"Outline color for text that got removed."));A("diffEditor.border",{dark:null,light:null,hcDark:xt,hcLight:xt},g(1863,"Border color between the two text editors."));A("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(1864,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));A("diffEditor.unchangedRegionBackground","sideBar.background",g(1865,"The background color of unchanged blocks in the diff editor."));A("diffEditor.unchangedRegionForeground","foreground",g(1866,"The foreground color of unchanged blocks in the diff editor."));A("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(1867,"The background color of unchanged code in the diff editor."));rg=A("widget.shadow",{dark:Je(q.black,.36),light:Je(q.black,.16),hcDark:null,hcLight:null},g(1868,"Shadow color of widgets such as find/replace inside the editor.")),o0=A("widget.border",{dark:null,light:null,hcDark:xt,hcLight:xt},g(1869,"Border color of widgets such as find/replace inside the editor.")),lwe=A("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(1870,"Toolbar background when hovering over actions using the mouse"));A("toolbar.hoverOutline",{dark:null,light:null,hcDark:Pi,hcLight:Pi},g(1871,"Toolbar outline when hovering over actions using the mouse"));A("toolbar.activeBackground",{dark:rh(lwe,.1),light:il(lwe,.1),hcDark:null,hcLight:null},g(1872,"Toolbar background when holding the mouse over actions"));Lwe=A("breadcrumb.foreground",Je(wt,.8),g(1873,"Color of focused breadcrumb items.")),Iwe=A("breadcrumb.background",tn,g(1874,"Background color of breadcrumb items.")),FX=A("breadcrumb.focusForeground",{light:il(wt,.2),dark:rh(wt,.1),hcDark:rh(wt,.1),hcLight:rh(wt,.1)},g(1875,"Color of focused breadcrumb items.")),Ewe=A("breadcrumb.activeSelectionForeground",{light:il(wt,.2),dark:rh(wt,.1),hcDark:rh(wt,.1),hcLight:rh(wt,.1)},g(1876,"Color of selected breadcrumb items."));A("breadcrumbPicker.background",nl,g(1877,"Background color of breadcrumb item picker."));Dwe=.5,cwe=q.fromHex("#40C8AE").transparent(Dwe),dwe=q.fromHex("#40A6FF").transparent(Dwe),hwe=q.fromHex("#606060").transparent(.4),BX=.4,t0=1,RX=A("merge.currentHeaderBackground",{dark:cwe,light:cwe,hcDark:null,hcLight:null},g(1878,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);A("merge.currentContentBackground",Je(RX,BX),g(1879,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);AX=A("merge.incomingHeaderBackground",{dark:dwe,light:dwe,hcDark:null,hcLight:null},g(1880,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);A("merge.incomingContentBackground",Je(AX,BX),g(1881,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);MX=A("merge.commonHeaderBackground",{dark:hwe,light:hwe,hcDark:null,hcLight:null},g(1882,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);A("merge.commonContentBackground",Je(MX,BX),g(1883,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);i0=A("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(1884,"Border color on headers and the splitter in inline merge-conflicts."));A("editorOverviewRuler.currentContentForeground",{dark:Je(RX,t0),light:Je(RX,t0),hcDark:i0,hcLight:i0},g(1885,"Current overview ruler foreground for inline merge-conflicts."));A("editorOverviewRuler.incomingContentForeground",{dark:Je(AX,t0),light:Je(AX,t0),hcDark:i0,hcLight:i0},g(1886,"Incoming overview ruler foreground for inline merge-conflicts."));A("editorOverviewRuler.commonContentForeground",{dark:Je(MX,t0),light:Je(MX,t0),hcDark:i0,hcLight:i0},g(1887,"Common ancestor overview ruler foreground for inline merge-conflicts."));k4=A("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},g(1888,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),WX=A("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",g(1889,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Twe=A("problemsErrorIcon.foreground",Cx,g(1890,"The color used for the problems error icon.")),Nwe=A("problemsWarningIcon.foreground",lh,g(1891,"The color used for the problems warning icon.")),Rwe=A("problemsInfoIcon.foreground",Gc,g(1892,"The color used for the problems info icon."))});var JD,eT,HX,Awe,Mwe,Owe,Pwe,Fwe,Ii=w(()=>{le();en();Bt();hi();Si();JD=A("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1983,"Minimap marker color for find matches."),!0),eT=A("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1984,"Minimap marker color for repeating editor selections."),!0),HX=A("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1985,"Minimap marker color for the editor selection."),!0),Awe=A("minimap.infoHighlight",{dark:Gc,light:Gc,hcDark:Dv,hcLight:Dv},g(1986,"Minimap marker color for infos.")),Mwe=A("minimap.warningHighlight",{dark:lh,light:lh,hcDark:Ev,hcLight:Ev},g(1987,"Minimap marker color for warnings.")),Owe=A("minimap.errorHighlight",{dark:new q(new Z(255,18,18,.7)),light:new q(new Z(255,18,18,.7)),hcDark:new q(new Z(255,50,50,1)),hcLight:"#B5200D"},g(1988,"Minimap marker color for errors.")),Pwe=A("minimap.background",null,g(1989,"Minimap background color.")),Fwe=A("minimap.foregroundOpacity",q.fromHex("#000f"),g(1990,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));A("minimapSlider.background",Je(b4,.5),g(1991,"Minimap slider background color."));A("minimapSlider.hoverBackground",Je(v4,.5),g(1992,"Minimap slider background color when hovering."));A("minimapSlider.activeBackground",Je(w4,.5),g(1993,"Minimap slider background color when clicked on."))});var Fi=w(()=>{le();Bt();ri();hi();Ii();A("charts.foreground",wt,g(1790,"The foreground color used in charts."));A("charts.lines",Je(wt,.5),g(1791,"The color used for horizontal lines in charts."));A("charts.red",Cx,g(1792,"The red color used in chart visualizations."));A("charts.blue",Gc,g(1793,"The blue color used in chart visualizations."));A("charts.yellow",lh,g(1794,"The yellow color used in chart visualizations."));A("charts.orange",JD,g(1795,"The orange color used in chart visualizations."));A("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(1796,"The green color used in chart visualizations."));A("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(1797,"The purple color used in chart visualizations."))});var tT,L4,I4,m_,CHe,Jf,g_,Bwe,Wwe,Hwe,Vwe,zwe,Uwe,$we,qwe,jwe,a0,Kwe,iT,nT,l0,Gwe,f_,Ywe,Zwe,E4,s0,Xwe,r0,Qwe,Jwe,eCe,tCe,iCe,nCe,D4,T4,oCe,rCe,sCe,aCe,lCe,cCe,dCe,yi=w(()=>{le();en();Bt();ri();hi();tT=A("input.background",{dark:"#3C3C3C",light:q.white,hcDark:q.black,hcLight:q.white},g(1893,"Input box background.")),L4=A("input.foreground",wt,g(1894,"Input box foreground.")),I4=A("input.border",{dark:null,light:null,hcDark:xt,hcLight:xt},g(1895,"Input box border.")),m_=A("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:xt,hcLight:xt},g(1896,"Border color of activated options in input fields.")),CHe=A("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1897,"Background color of activated options in input fields.")),Jf=A("inputOption.activeBackground",{dark:Je(sh,.4),light:Je(sh,.2),hcDark:q.transparent,hcLight:q.transparent},g(1898,"Background hover color of options in input fields.")),g_=A("inputOption.activeForeground",{dark:q.white,light:q.black,hcDark:wt,hcLight:wt},g(1899,"Foreground color of activated options in input fields."));A("input.placeholderForeground",{light:Je(wt,.5),dark:Je(wt,.5),hcDark:Je(wt,.7),hcLight:Je(wt,.7)},g(1900,"Input box foreground color for placeholder text."));Bwe=A("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:q.black,hcLight:q.white},g(1901,"Input validation background color for information severity.")),Wwe=A("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:wt},g(1902,"Input validation foreground color for information severity.")),Hwe=A("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:xt,hcLight:xt},g(1903,"Input validation border color for information severity.")),Vwe=A("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:q.black,hcLight:q.white},g(1904,"Input validation background color for warning severity.")),zwe=A("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:wt},g(1905,"Input validation foreground color for warning severity.")),Uwe=A("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:xt,hcLight:xt},g(1906,"Input validation border color for warning severity.")),$we=A("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:q.black,hcLight:q.white},g(1907,"Input validation background color for error severity.")),qwe=A("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:wt},g(1908,"Input validation foreground color for error severity.")),jwe=A("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:xt,hcLight:xt},g(1909,"Input validation border color for error severity.")),a0=A("dropdown.background",{dark:"#3C3C3C",light:q.white,hcDark:q.black,hcLight:q.white},g(1910,"Dropdown background.")),Kwe=A("dropdown.listBackground",{dark:null,light:null,hcDark:q.black,hcLight:q.white},g(1911,"Dropdown list background.")),iT=A("dropdown.foreground",{dark:"#F0F0F0",light:wt,hcDark:q.white,hcLight:wt},g(1912,"Dropdown foreground.")),nT=A("dropdown.border",{dark:a0,light:"#CECECE",hcDark:xt,hcLight:xt},g(1913,"Dropdown border.")),l0=A("button.foreground",q.white,g(1914,"Button foreground color.")),Gwe=A("button.separator",Je(l0,.4),g(1915,"Button separator color.")),f_=A("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:q.black,hcLight:"#0F4A85"},g(1916,"Button background color.")),Ywe=A("button.hoverBackground",{dark:rh(f_,.2),light:il(f_,.2),hcDark:f_,hcLight:f_},g(1917,"Button background color when hovering.")),Zwe=A("button.border",xt,g(1918,"Button border color.")),E4=A("button.secondaryForeground",{dark:q.white,light:q.white,hcDark:q.white,hcLight:wt},g(1919,"Secondary button foreground color.")),s0=A("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:q.white},g(1920,"Secondary button background color.")),Xwe=A("button.secondaryHoverBackground",{dark:rh(s0,.2),light:il(s0,.2),hcDark:null,hcLight:null},g(1921,"Secondary button background color when hovering.")),r0=A("radio.activeForeground",g_,g(1922,"Foreground color of active radio option.")),Qwe=A("radio.activeBackground",Jf,g(1923,"Background color of active radio option.")),Jwe=A("radio.activeBorder",m_,g(1924,"Border color of the active radio option.")),eCe=A("radio.inactiveForeground",null,g(1925,"Foreground color of inactive radio option.")),tCe=A("radio.inactiveBackground",null,g(1926,"Background color of inactive radio option.")),iCe=A("radio.inactiveBorder",{light:Je(r0,.2),dark:Je(r0,.2),hcDark:Je(r0,.4),hcLight:Je(r0,.2)},g(1927,"Border color of the inactive radio option.")),nCe=A("radio.inactiveHoverBackground",CHe,g(1928,"Background color of inactive active radio option when hovering.")),D4=A("checkbox.background",a0,g(1929,"Background color of checkbox widget."));A("checkbox.selectBackground",nl,g(1930,"Background color of checkbox widget when the element it's in is selected."));T4=A("checkbox.foreground",iT,g(1931,"Foreground color of checkbox widget.")),oCe=A("checkbox.border",nT,g(1932,"Border color of checkbox widget."));A("checkbox.selectBorder",bx,g(1933,"Border color of checkbox widget when the element it's in is selected."));rCe=A("checkbox.disabled.background",{op:7,color:D4,with:T4,ratio:.33},g(1934,"Background of a disabled checkbox.")),sCe=A("checkbox.disabled.foreground",{op:7,color:T4,with:D4,ratio:.33},g(1935,"Foreground of a disabled checkbox.")),aCe=A("keybindingLabel.background",{dark:new q(new Z(128,128,128,.17)),light:new q(new Z(221,221,221,.4)),hcDark:q.transparent,hcLight:q.transparent},g(1936,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),lCe=A("keybindingLabel.foreground",{dark:q.fromHex("#CCCCCC"),light:q.fromHex("#555555"),hcDark:q.white,hcLight:wt},g(1937,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),cCe=A("keybindingLabel.border",{dark:new q(new Z(51,51,51,.6)),light:new q(new Z(204,204,204,.4)),hcDark:new q(new Z(111,195,223)),hcLight:xt},g(1938,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),dCe=A("keybindingLabel.bottomBorder",{dark:new q(new Z(68,68,68,.6)),light:new q(new Z(187,187,187,.4)),hcDark:new q(new Z(111,195,223)),hcLight:wt},g(1939,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut."))});var hCe,uCe,fCe,mCe,sg,Nv,N4,gCe,pCe,_Ce,bCe,vCe,VX,zX,wCe,CCe,Tv,xCe,SCe,yCe,kCe,LCe,UX,ICe,ECe,DCe,TCe,ki=w(()=>{le();en();Bt();ri();hi();hCe=A("list.focusBackground",null,g(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.")),uCe=A("list.focusForeground",null,g(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.")),fCe=A("list.focusOutline",{dark:sh,light:sh,hcDark:Pi,hcLight:Pi},g(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.")),mCe=A("list.focusAndSelectionOutline",null,g(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.")),sg=A("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:q.fromHex("#0F4A85").transparent(.1)},g(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.")),Nv=A("list.activeSelectionForeground",{dark:q.white,light:q.white,hcDark:null,hcLight:null},g(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.")),N4=A("list.activeSelectionIconForeground",null,g(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.")),gCe=A("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:q.fromHex("#0F4A85").transparent(.1)},g(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.")),pCe=A("list.inactiveSelectionForeground",null,g(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.")),_Ce=A("list.inactiveSelectionIconForeground",null,g(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.")),bCe=A("list.inactiveFocusBackground",null,g(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.")),vCe=A("list.inactiveFocusOutline",null,g(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.")),VX=A("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:q.white.transparent(.1),hcLight:q.fromHex("#0F4A85").transparent(.1)},g(1952,"List/Tree background when hovering over items using the mouse.")),zX=A("list.hoverForeground",null,g(1953,"List/Tree foreground when hovering over items using the mouse.")),wCe=A("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(1954,"List/Tree drag and drop background when moving items over other items when using the mouse.")),CCe=A("list.dropBetweenBackground",{dark:bx,light:bx,hcDark:null,hcLight:null},g(1955,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Tv=A("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:sh,hcLight:sh},g(1956,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),xCe=A("list.focusHighlightForeground",{dark:Tv,light:iwe(sg,Tv,"#BBE7FF"),hcDark:Tv,hcLight:Tv},g(1957,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));A("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(1958,"List/Tree foreground color for invalid items, for example an unresolved root in explorer."));A("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(1959,"Foreground color of list items containing errors."));A("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(1960,"Foreground color of list items containing warnings."));SCe=A("listFilterWidget.background",{light:il(nl,0),dark:rh(nl,0),hcDark:nl,hcLight:nl},g(1961,"Background color of the type filter widget in lists and trees.")),yCe=A("listFilterWidget.outline",{dark:q.transparent,light:q.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(1962,"Outline color of the type filter widget in lists and trees.")),kCe=A("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:xt,hcLight:xt},g(1963,"Outline color of the type filter widget in lists and trees, when there are no matches.")),LCe=A("listFilterWidget.shadow",rg,g(1964,"Shadow color of the type filter widget in lists and trees."));A("list.filterMatchBackground",{dark:lu,light:lu,hcDark:null,hcLight:null},g(1965,"Background color of the filtered match."));A("list.filterMatchBorder",{dark:Qu,light:Qu,hcDark:xt,hcLight:Pi},g(1966,"Border color of the filtered match."));A("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1967,"List/Tree foreground color for items that are deemphasized."));UX=A("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1968,"Tree stroke color for the indentation guides.")),ICe=A("tree.inactiveIndentGuidesStroke",Je(UX,.4),g(1969,"Tree stroke color for the indentation guides that are not active.")),ECe=A("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1970,"Table border color between columns.")),DCe=A("tree.tableOddRowsBackground",{dark:Je(wt,.04),light:Je(wt,.04),hcDark:null,hcLight:null},g(1971,"Background color for odd table rows."));A("editorActionList.background",nl,g(1972,"Action List background color."));TCe=A("editorActionList.foreground",wx,g(1973,"Action List foreground color."));A("editorActionList.focusForeground",Nv,g(1974,"Action List foreground color for the focused item."));A("editorActionList.focusBackground",sg,g(1975,"Action List background color for the focused item."))});var NCe,RCe,ACe,MCe,OCe,PCe,FCe,Bi=w(()=>{le();Bt();ri();yi();ki();NCe=A("menu.border",{dark:null,light:null,hcDark:xt,hcLight:xt},g(1976,"Border color of menus.")),RCe=A("menu.foreground",iT,g(1977,"Foreground color of menu items.")),ACe=A("menu.background",a0,g(1978,"Background color of menu items.")),MCe=A("menu.selectionForeground",Nv,g(1979,"Foreground color of the selected menu item in menus.")),OCe=A("menu.selectionBackground",sg,g(1980,"Background color of the selected menu item in menus.")),PCe=A("menu.selectionBorder",{dark:null,light:null,hcDark:Pi,hcLight:Pi},g(1981,"Border color of the selected menu item in menus.")),FCe=A("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:xt,hcLight:xt},g(1982,"Color of a separator menu item in menus."))});var R4,WCe,HCe,A4,VCe,BCe,p_,c0,__,Wi=w(()=>{le();en();Bt();hi();ki();R4=A("quickInput.background",nl,g(2010,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),WCe=A("quickInput.foreground",wx,g(2011,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),HCe=A("quickInputTitle.background",{dark:new q(new Z(255,255,255,.105)),light:new q(new Z(0,0,0,.06)),hcDark:"#000000",hcLight:q.white},g(2012,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),A4=A("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:q.white,hcLight:"#0F4A85"},g(2013,"Quick picker color for grouping labels.")),VCe=A("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:q.white,hcLight:"#0F4A85"},g(2014,"Quick picker color for grouping borders.")),BCe=A("quickInput.list.focusBackground",null,"",void 0,g(2015,"Please use quickInputList.focusBackground instead")),p_=A("quickInputList.focusForeground",Nv,g(2016,"Quick picker foreground color for the focused item.")),c0=A("quickInputList.focusIconForeground",N4,g(2017,"Quick picker icon foreground color for the focused item.")),__=A("quickInputList.focusBackground",{dark:_x(BCe,sg),light:_x(BCe,sg),hcDark:null,hcLight:null},g(2018,"Quick picker background color for the focused item."))});var Hi=w(()=>{le();Bt();ri();hi();A("search.resultsInfoForeground",{light:wt,dark:Je(wt,.65),hcDark:wt,hcLight:wt},g(2019,"Color of the text in the search viewlet's completion message."));A("searchEditor.findMatchBackground",{light:Je(lu,.66),dark:Je(lu,.66),hcDark:lu,hcLight:lu},g(2020,"Color of the Search Editor query matches."));A("searchEditor.findMatchBorder",{light:Je(Qu,.66),dark:Je(Qu,.66),hcDark:Qu,hcLight:Qu},g(2021,"Border color of the Search Editor query matches."))});function h0(n){let e=Zt(n);return new $X(e.left,e.top,e.width,e.height)}function u0(n,e,t){let i=e.width/n.offsetWidth,o=e.height/n.offsetHeight,r=(t.x-e.x)/i,s=(t.y-e.y)/o;return new qX(r,s)}function xHe(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var b_,oT,$X,qX,ch,M4,O4,P4,d0,jX,Rv=w(()=>{oe();su();px();Xa();Ye();B();Bt();ri();Fi();hi();yi();ki();Bi();Ii();Si();Wi();Hi();b_=class{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new oT(this.x-e.scrollX,this.y-e.scrollY)}},oT=class{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new b_(this.clientX+e.scrollX,this.clientY+e.scrollY)}},$X=class{constructor(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o,this._editorPagePositionBrand=void 0}},qX=class{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}};ch=class extends dn{constructor(e,t,i){super(Ce(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new b_(this.posx,this.posy),this.editorPos=h0(i),this.relativePos=u0(i,this.editorPos,this.pos)}},M4=class{constructor(e){this._editorViewDomNode=e}_create(e){return new ch(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return F(e,J.CONTEXT_MENU,i=>{t(this._create(i))})}onMouseUp(e,t){return F(e,J.MOUSE_UP,i=>{t(this._create(i))})}onMouseDown(e,t){return F(e,J.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return F(e,J.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return F(e,J.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return F(e,J.MOUSE_MOVE,i=>t(this._create(i)))}},O4=class{constructor(e){this._editorViewDomNode=e}_create(e){return new ch(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return F(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return F(e,J.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return F(e,J.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return F(e,"pointermove",i=>t(this._create(i)))}},P4=class extends E{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new oh),this._keydownListener=null}startMonitoring(e,t,i,o,r){this._keydownListener=_i(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,s=>{o(new ch(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),r(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}},d0=class n{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++n._idPool,this._counter=0,this._rules=new $m,this._garbageCollectionScheduler=new lt(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){let t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){let t=this.computeUniqueKey(e),i=this._rules.get(t);if(!i){let o=this._counter++;i=new jX(t,`dyn-rule-${this._instanceId}-${o}`,BC(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(let e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}},jX=class{constructor(e,t,i,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElementDisposables=new P,this._styleElement=_a(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(let o in t){let r=t[o],s;typeof r=="object"?s=re(r.id):s=r;let a=xHe(o);i+=`
+ ${a}: ${s};`}return i+=`
+}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}});var Yc,Av=w(()=>{B();Yc=class extends E{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,o=e.length;i{Av();yn=class extends Yc{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}},Pa=class{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){let t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){let i=[],o=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[o++]=this.read(e)),e=e.parentElement;let r=new Uint8Array(o);for(let s=0;s{KX=class{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;let i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}},F4=class extends KX{constructor(e,t,i,o){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=o}linesVisibleRangesForRange(e,t){let i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i??null;let o=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?o?i.concat(o).sort((r,s)=>r.lineNumber-s.lineNumber):i:o}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}},f0=class{constructor(e,t,i,o){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=o}},Mv=class n{static from(e){let t=new Array(e.length);for(let i=0,o=e.length;i{Sx();yx=class{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,o,r){let s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,o),s.getClientRects()}catch{return null}finally{this._detachRange(s,r)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(cu.compare);let t=[],i=0,o=e[0];for(let r=1,s=e.length;r=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[i++]=o,o=a)}return t[i++]=o,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;let o=[];for(let r=0,s=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&i===r&&i===0&&!e.children[t].firstChild){let u=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,s.clientRectDeltaLeft,s.clientRectScale)}t!==o&&o>0&&r===0&&(o--,r=1073741824);let c=e.children[t].firstChild,d=e.children[o].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&r===0&&o>0&&(d=e.children[o-1].firstChild,r=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),r=Math.min(d.textContent.length,Math.max(0,r));let h=this._readClientRects(c,i,d,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}}});var ba,B4,GX,W4,Ov=w(()=>{He();ba=class n{constructor(e,t,i,o){this.startColumn=e,this.endColumn=t,this.className=i,this.type=o,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){let i=e.length,o=t.length;if(i!==o)return!1;for(let r=0;r=r||(a[l++]=new n(Math.max(1,c.startColumn-o+1),Math.min(s+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,i,o){if(e.length===0)return[];let r=[],s=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;let h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:o;r[s++]=new n(h,u,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){let i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;let i=n._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,i);break}this.count++}},W4=class{static normalize(e,t){if(t.length===0)return[];let i=[],o=new GX,r=0;for(let s=0,a=t.length;s1){let p=e.charCodeAt(c-2);Dn(p)&&c--}if(d>1){let p=e.charCodeAt(d-2);Dn(p)&&d--}let f=c-1,m=d-2;r=o.consumeLowerThan(f,r,i),o.count===0&&(r=f),o.insert(m,h,u)}return o.consumeLowerThan(1073741824,r,i),i}}});var qo,UCe=w(()=>{qo=class{constructor(e,t,i,o){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}});function em(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,o=0;for(let s of n.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(' '),s.type===1&&(o|=1,t++),s.type===2&&(o|=2,i++));e.appendString(" ");let r=new sT(1,t+i);return r.setColumnInfo(1,t,0,0),new kx(r,o)}return n.renderNewLineWhenEmpty?e.appendString(`
+ `):e.appendString(" "),new kx(new sT(0,0),0)}return THe(SHe(n),e)}function g0(n){let e=new zl(1e4),t=em(n,e);return new YX(t.characterMapping,e.build(),t.containsForeignElements)}function SHe(n){let e=n.lineContent,t,i,o;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(r[s++]=new qo(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=o){let f=e?Bf(n.substring(a,o)):!1;r[s++]=new qo(o,h,0,f);break}let u=e?Bf(n.substring(a,d)):!1;r[s++]=new qo(d,h,0,u),a=d}return r}function kHe(n,e,t){let i=0,o=[],r=0;if(t)for(let s=0,a=e.length;s=50&&(o[r++]=new qo(f+1,d,h,u),m=f+1,f=-1);m!==c&&(o[r++]=new qo(c,d,h,u))}else o[r++]=l;i=c}else for(let s=0,a=e.length;s 50){let h=l.type,u=l.metadata,f=l.containsRTL,m=Math.ceil(d/50);for(let p=1;p=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function IHe(n,e){let t=[],i=new qo(0,"",0,!1),o=0;for(let r of e){let s=r.endIndex;for(;oi.endIndex&&(i=new qo(o,r.type,r.metadata,r.containsRTL),t.push(i)),i=new qo(o+1,"mtkcontrol",r.metadata,!1),t.push(i))}o>i.endIndex&&(i=new qo(s,r.type,r.metadata,r.containsRTL),t.push(i))}return t}function EHe(n,e,t,i){let o=n.continuesWithWrappedLine,r=n.fauxIndentLength,s=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,h=n.renderWhitespace===3,u=n.renderSpaceWidth!==n.spaceWidth,f=[],m=0,p=0,_=i[p].type,b=i[p].containsRTL,v=i[p].endIndex,x=i.length,C=!1,S=Gn(e),L;S===-1?(C=!0,S=t,L=t):L=ua(e);let I=!1,D=0,T=c&&c[D],O=a%s;for(let H=r;HL)Q=!0;else if(z===9)Q=!0;else if(z===32)if(d)if(I)Q=!0;else{let ee=H+1L),Q&&b&&H>=S&&H<=L&&(Q=!1),I){if(!Q||!l&&O>=s){if(u){let ee=m>0?f[m-1].endIndex:r;for(let pe=ee+1;pe<=H;pe++)f[m++]=new qo(pe,"mtkw",1,!1)}else f[m++]=new qo(H,"mtkw",1,!1);O=O%s}}else(H===v||Q&&H>r)&&(f[m++]=new qo(H,_,0,b),O=O%s);for(z===9?O=s:vd(z)?O+=2:O++,I=Q;H===v&&(p++,p0?e.charCodeAt(t-1):0,z=t>1?e.charCodeAt(t-2):0;H===32&&z!==32&&z!==9||(W=!0)}else W=!0;if(W)if(u){let H=m>0?f[m-1].endIndex:r;for(let z=H+1;z<=t;z++)f[m++]=new qo(z,"mtkw",1,!1)}else f[m++]=new qo(t,"mtkw",1,!1);else f[m++]=new qo(t,_,0,b);return f}function DHe(n,e,t,i){i.sort(ba.compare);let o=W4.normalize(n,i),r=o.length,s=0,a=[],l=0,c=0;for(let h=0,u=t.length;hc&&(c=v.startOffset,a[l++]=new qo(c,p,_,b)),v.endOffset+1<=m)c=v.endOffset+1,a[l++]=new qo(c,p+" "+v.className,_|v.metadata,b),s++;else{c=m,a[l++]=new qo(c,p+" "+v.className,_|v.metadata,b);break}}m>c&&(c=m,a[l++]=new qo(c,p,_,b))}let d=t[t.length-1].endIndex;if(s");for(let D=0,T=c.length;D=d&&(Oe+=pt)}}for(ee&&(e.appendString(' style="width:'),e.appendString(String(f*he)),e.appendString('px"')),e.appendASCIICharCode(62);x1?e.appendCharCode(8594):e.appendCharCode(65515);for(let pt=2;pt<=Qe;pt++)e.appendCharCode(160)}else Oe=2,Qe=1,e.appendCharCode(m),e.appendCharCode(8204);S+=Oe,L+=Qe,x>=d&&(C+=Qe)}}else for(e.appendASCIICharCode(62);x=d&&(C+=Oe)}pe?I++:I=0,x>=s&&!v&&O.isPseudoAfter()&&(v=!0,b.setColumnInfo(x+1,D,S,L)),e.appendString("")}return v||b.setColumnInfo(s+1,c.length-1,S,L),a&&(e.appendString(''),e.appendString(g(796,"Show more ({0})",RHe(l))),e.appendString(" ")),e.appendString(""),new kx(b,o)}function NHe(n){return n.toString(16).toUpperCase().padStart(4,"0")}function RHe(n){return n<1024?g(797,"{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}var jl,rT,sT,kx,YX,ZX,Pv=w(()=>{le();He();Gf();Ov();UCe();vo();jl=class{get isLTR(){return!this.containsRTL&&this.textDirection!==Ja.RTL}constructor(e,t,i,o,r,s,a,l,c,d,h,u,f,m,p,_,b,v,x,C,S,L=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=o,this.isBasicASCII=r,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ba.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=b,this.fontLigatures=v,this.selectionsOnLine=x&&x.sort((T,O)=>T.start>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,o){let r=(t<<16|i<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=o}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){let t=this.charOffsetToPartData(e-1),i=n.getPartIndex(t),o=n.getCharIndex(t);return new rT(i,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;let o=(e<<16|i<<0)>>>0,r=0,s=this.length-1;for(;r+1>>1,_=this._data[p];if(_===o)return p;_>o?s=p:r=p}if(r===s)return r;let a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;let c=n.getPartIndex(a),d=n.getCharIndex(a),h=n.getPartIndex(l),u;c!==h?u=t:u=n.getCharIndex(l);let f=i-d,m=u-i;return f<=m?r:s}},kx=class{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}};YX=class{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}};ZX=class{constructor(e,t,i,o,r,s,a,l,c,d,h,u,f,m,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=o,this.isOverflowing=r,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.renderSpaceCharCode=f,this.renderWhitespace=m,this.renderControlCharacters=p}}});function Ll(n){return n===Dd.HIGH_CONTRAST_DARK||n===Dd.HIGH_CONTRAST_LIGHT}function Td(n){return n===Dd.DARK||n===Dd.HIGH_CONTRAST_DARK}var Dd,Lx,dh=w(()=>{(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Dd||(Dd={}));(function(n){n.VS="vs",n.VS_DARK="vs-dark",n.HC_BLACK="hc-black",n.HC_LIGHT="hc-light"})(Lx||(Lx={}))});function MHe(n,e,t,i){return new XX(n,e,t,i)}function OHe(n,e,t,i){return new H4(n,e,t,i)}function v_(n,e,t){let i=e.textContent.length,o=-1;for(;e;)e=e.previousSibling,o++;return n.getColumn(new rT(o,t),i)}var AHe,_0,tm,p0,H4,XX,qCe,b0=w(()=>{Gs();ar();ct();zCe();Sx();Ov();Pv();dh();xs();Cn();vo();AHe=function(){return oc?!0:!(go||To||Pu)}(),_0=!0,tm=class n{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=gt(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Ll(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===2?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,o,r){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,o,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;let s=o.getViewLineRenderingData(e),a=this._options,l=ba.filter(s.inlineDecorations,e,s.minColumn,s.maxColumn),c=s.hasVariableFonts||a.experimentalWhitespaceRendering==="off"?a.renderWhitespace:"none",d=!s.hasVariableFonts,h=null;if(Ll(a.themeType)||c==="selection"){let p=o.selections;for(let _ of p){if(_.endLineNumbere)continue;let b=_.startLineNumber===e?_.startColumn:s.minColumn,v=_.endLineNumber===e?_.endColumn:s.maxColumn;b');let f=em(u,r);r.appendString("");let m=null;return d&&_0&&AHe&&s.isBasicASCII&&u.isLTR&&a.useMonospaceOptimizations&&f.containsForeignElements===0&&(m=new p0(this._renderedViewLine?this._renderedViewLine.domNode:null,u,f.characterMapping)),m||(m=qCe(this._renderedViewLine?this._renderedViewLine.domNode:null,u,f.characterMapping,f.containsForeignElements)),this._renderedViewLine=m,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return this._renderedViewLine?this._renderedViewLine.input.textDirection===Ja.RTL:!1}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof p0:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof p0?this._renderedViewLine.monospaceAssumptionsAreValid():_0}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof p0&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));let r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&i>r+1)return new xx(!0,[new cu(this.getWidth(o),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&i>r+1&&(i=r+1);let s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,o);return s&&s.length>0?new xx(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}},p0=class{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;let o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),_0=!1)}return _0}toSlowRenderedLine(){return qCe(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,o){let r=this._getColumnPixelOffset(e,t,o),s=this._getColumnPixelOffset(e,i,o);return[new cu(r,s-r)]}_getColumnPixelOffset(e,t,i){if(t<=300){let c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}let o=Math.floor((t-1)/300)-1,r=(o+1)*300+1,s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[o],s===-1&&(s=this._actualReadPixelOffset(e,r,i),this._keyColumnPixelOffsetCache[o]=s)),s===-1){let c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}let a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;let o=this._characterMapping.getDomPosition(t),r=yx.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,i);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return v_(this._characterMapping,e,t)}},H4=class{constructor(e,t,i,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,s=this._characterMapping.length;r<=s;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){let r=this._readPixelOffset(this.domNode,e,t,o);if(r===-1)return null;let s=this._readPixelOffset(this.domNode,e,i,o);return s===-1?null:[new cu(r,s-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,o)}_readVisibleRangesForRange(e,t,i,o,r){if(i===o){let s=this._readPixelOffset(e,t,i,r);return s===-1?null:[new cu(s,0)]}else return this._readRawVisibleRangesForRange(e,i,o,r)}_readPixelOffset(e,t,i,o){if(this.input.isLTR&&this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);let r=this._getReadingTarget(e);return r.firstChild?(o.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){let r=this._pixelOffsetCache[i];if(r!==-1)return r;let s=this._actualReadPixelOffset(e,t,i,o);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,o)}_actualReadPixelOffset(e,t,i,o){if(this._characterMapping.length===0){let l=yx.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);let r=this._characterMapping.getDomPosition(i),s=yx.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,o);if(!s||s.length===0)return-1;let a=s[0].left;if(this.input.isBasicASCII){let l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,o){if(this.input.isLTR&&t===1&&i===this._characterMapping.length)return[new cu(0,this.getWidth(o))];let r=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return yx.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,s.partIndex,s.charIndex,o)}getColumnOfNodeOffset(e,t){return v_(this._characterMapping,e,t)}},XX=class extends H4{_readVisibleRangesForRange(e,t,i,o,r){let s=super._readVisibleRangesForRange(e,t,i,o,r);if(!s||s.length===0||i===o||i===1&&o===this._characterMapping.length)return s;if(this.input.isLTR){let a=this._readPixelOffset(e,t,o,r);if(a!==-1){let l=s[s.length-1];l.leftr.left+r.width)_=m.length;else{let v=eQ.getInstance();for(let x=0;x{Rv();Fa();b0();Fe();de();yd();oe();qY();vo();Vu();ag=class{constructor(e=null){this.hitTarget=e,this.type=0}},V4=class{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}};(function(n){function e(t,i,o){let r=t.getPositionFromDOMInfo(i,o);return r?new V4(r,i,null):new ag(i)}n.createFromDOMInfo=e})(Ex||(Ex={}));z4=class{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}},Us=class{static _deduceRage(e,t=null){return!t&&e?new y(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,o,r,s){return{type:e,element:t,mouseColumn:i,position:o,range:r,detail:s}}static createViewZone(e,t,i,o,r){return{type:e,element:t,mouseColumn:i,position:o,range:this._deduceRage(o),detail:r}}static createContentText(e,t,i,o,r){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,o),detail:r}}static createContentEmpty(e,t,i,o){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:o}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,o){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:o}}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}},Il=class{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===7}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}},v0=class n{constructor(e,t,i){this.viewModel=e.viewModel;let o=e.configuration.options;this.layoutInfo=o.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=o.get(75),this.stickyTabStops=o.get(132),this.typicalHalfwidthCharacterWidth=o.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return n.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){let i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){let o=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount(),s=null,a,l=null;return i.afterLineNumber!==r&&(l=new M(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(s=new M(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,w0._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}},JX=class extends QX{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Pa.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,o,r){super(e,t,i,o),this.hitTestResult=new $n(()=>w0.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=r;let s=!!this._eventTarget;this._useHitTestTarget=!s}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
+ target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;let a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=r&&r<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){let o=t.isInContentArea?8:5;return t.fulfillViewZone(o,i.position,i)}return null}static _hitTestTextArea(e,t){return Il.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){let i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=i.range.getStartPosition(),r=Math.abs(t.relativePos.x),s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};if(r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth){let a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return s.glyphMarginLane=l[Math.floor(r/e.lineHeight)],t.fulfillMargin(2,o,i.range,s)}return r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,i.range,s):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,i.range,s))}return null}static _hitTestViewLines(e,t){if(!Il.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new M(1,1),jCe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){let o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new M(o,r),jCe)}if(Il.isStrictChildOfViewLines(t.targetPath)){let o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineLength(o),s=e.getLineWidth(o);if(r===0){let l=Ix(t.mouseContentHorizontalOffset-s);return t.fulfillContentEmpty(new M(o,1),l)}if(e.isRtl(o)){if(t.mouseContentHorizontalOffset+s<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let l=Ix(t.mouseContentHorizontalOffset-s),c=new M(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=s){let l=Ix(t.mouseContentHorizontalOffset-s),c=new M(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(c,l)}}else if(e.viewLinesGpu){let o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){let l=e.getLineWidth(o),c=Ix(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(new M(o,1),c)}let r=e.getLineWidth(o);if(e.isRtl(o)){if(t.mouseContentHorizontalOffset+r<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let l=Ix(t.mouseContentHorizontalOffset-r),c=new M(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=r){let l=Ix(t.mouseContentHorizontalOffset-r),c=new M(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(c,l)}let a=e.viewLinesGpu.getPositionAtCoordinate(o,t.mouseContentHorizontalOffset);if(a){let l={injectedText:null,mightBeForeignElement:!1};return t.fulfillContentText(a,y.fromPositions(a,a),l)}}let i=t.hitTestResult.value;return i.type===1?n.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Il.isChildOfMinimap(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new M(i,o))}return null}static _hitTestScrollbarSlider(e,t){if(Il.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){let i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){let o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new M(o,r))}}return null}static _hitTestScrollbar(e,t){if(Il.isChildOfScrollableElement(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new M(i,o))}return null}getMouseColumn(e){let t=this._context.configuration.options,i=t.get(165),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return n._getMouseColumn(o,t.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,o,r){let s=o.lineNumber,a=o.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){let b=Ix(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,b)}let c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(o);let d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!r,injectedText:r});let h=[];if(h.push({offset:c.left,column:a}),a>1){let b=e.visibleRangeForPosition(s,a-1);b&&h.push({offset:b.left,column:a-1})}let u=e.viewModel.getLineMaxColumn(s);if(ab.offset-v.offset);let f=t.pos.toClientCoordinates(Ce(e.viewDomNode)),m=i.getBoundingClientRect(),p=m.left<=f.clientX&&f.clientX<=m.right,_=null;for(let b=1;br)){let a=Math.floor((o+r)/2),l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);let c=new b_(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Ce(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Ce(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let i=Qh(e.viewDomNode),o;if(i?typeof i.caretRangeFromPoint>"u"?o=PHe(i,t.clientX,t.clientY):o=i.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new ag;let r=o.startContainer;if(r.nodeType===r.TEXT_NODE){let s=r.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===tm.CLASS_NAME?Ex.createFromDOMInfo(e,s,o.startOffset):new ag(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){let s=r.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===tm.CLASS_NAME?Ex.createFromDOMInfo(e,r,r.textContent.length):new ag(r)}return new ag}static _doHitTestWithCaretPositionFromPoint(e,t){let i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){let o=i.offsetNode.parentNode,r=o?o.parentNode:null,s=r?r.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===tm.CLASS_NAME?Ex.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new ag(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){let o=i.offsetNode.parentNode,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,s=o?o.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(r===tm.CLASS_NAME){let l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return Ex.createFromDOMInfo(e,l,0)}else if(a===tm.CLASS_NAME)return Ex.createFromDOMInfo(e,i.offsetNode,0)}return new ag(i.offsetNode)}static _snapToSoftTabBoundary(e,t){let i=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),r=XC.atomicPosition(i,e.column-1,o,2);return r!==-1?new M(e.lineNumber,r+1):e}static doHitTest(e,t){let i=new ag;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Ce(e.viewDomNode)))),i.type===1){let o=e.viewModel.getInjectedTextAt(i.position),r=e.viewModel.normalizePosition(i.position,2);(o||!r.equals(i.position))&&(i=new V4(r,i.spanNode,o))}return i}};eQ=class n{static{this._INSTANCE=null}static getInstance(){return n._INSTANCE||(n._INSTANCE=new n),n._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){let i=e+t;if(this._cache[i])return this._cache[i];let o=this._canvas.getContext("2d");o.font=t;let s=o.measureText(e).width;return this._cache[i]=s,s}}});function un(n,e,t){let i=null,o=null;if(typeof t.value=="function"?(i="value",o=t.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",o=t.get),!o)throw new Error("not supported");let r=`$memoize$${e}`;t[i]=function(...s){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[r]}}var w_=w(()=>{});var FHe,vi,jn,Zc=w(()=>{oe();ka();w_();ae();B();_d();FHe=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(vi||(vi={}));jn=class n extends E{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new Fn,this.ignoreTargets=new Fn,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(X.runAndSubscribe(Xp,({window:e,disposables:t})=>{t.add(F(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(F(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(F(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Et,disposables:this._store}))}static addTarget(e){if(!n.isTouchDevice())return E.None;n.INSTANCE||(n.INSTANCE=new n);let t=n.INSTANCE.targets.push(e);return se(t)}static ignoreTarget(e){if(!n.isTouchDevice())return E.None;n.INSTANCE||(n.INSTANCE=new n);let t=n.INSTANCE.ignoreTargets.push(e);return se(t)}static isTouchDevice(){return"ontouchstart"in Et||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,o=e.targetTouches.length;i=n.HOLD_DELAY&&Math.abs(l.initialPageX-l.rollingPageX.at(-1))<30&&Math.abs(l.initialPageY-l.rollingPageY.at(-1))<30){let d=this.newGestureEvent(vi.Contextmenu,l.initialTarget);d.pageX=l.rollingPageX.at(-1),d.pageY=l.rollingPageY.at(-1),this.dispatchEvent(d)}else if(o===1){let d=l.rollingPageX.at(-1),h=l.rollingPageY.at(-1),u=l.rollingTimestamps.at(-1)-l.rollingTimestamps[0],f=d-l.rollingPageX[0],m=h-l.rollingPageY[0],p=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,p,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(m)/u,m>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(vi.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===vi.Tap){let t=new Date().getTime(),i=0;t-this._lastSetTapCountTime>n.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===vi.Change||e.type===vi.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(e.initialTarget))return;let t=[];for(let i of this.targets)if(i.contains(e.initialTarget)){let o=0,r=e.initialTarget;for(;r&&r!==i;)o++,r=r.parentElement;t.push([o,i])}t.sort((i,o)=>i[0]-o[0]);for(let[i,o]of t)o.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,o,r,s,a,l,c){this.handle=Ms(e,()=>{let d=Date.now(),h=d-i,u=0,f=0,m=!0;o+=n.SCROLL_FRICTION*h,a+=n.SCROLL_FRICTION*h,o>0&&(m=!1,u=r*o*h),a>0&&(m=!1,f=l*a*h);let p=this.newGestureEvent(vi.Change);p.translationX=u,p.translationY=f,t.forEach(_=>_.dispatchEvent(p)),m||this.inertia(e,t,d,o,r,s+u,a,l,c+f)})}onTouchMove(e){let t=Date.now();for(let i=0,o=e.changedTouches.length;i3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(r.pageX),s.rollingPageY.push(r.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};FHe([un],jn,"isTouchDevice",null)});var ko,du=w(()=>{oe();ha();Xa();Zc();B();ko=class extends E{onclick(e,t){this._register(F(e,J.CLICK,i=>t(new dn(Ce(e),i))))}onmousedown(e,t){this._register(F(e,J.MOUSE_DOWN,i=>t(new dn(Ce(e),i))))}onmouseover(e,t){this._register(F(e,J.MOUSE_OVER,i=>t(new dn(Ce(e),i))))}onmouseleave(e,t){this._register(F(e,J.MOUSE_LEAVE,i=>t(new dn(Ce(e),i))))}onkeydown(e,t){this._register(F(e,J.KEY_DOWN,i=>t(new St(i))))}onkeyup(e,t){this._register(F(e,J.KEY_UP,i=>t(new St(i))))}oninput(e,t){this._register(F(e,J.INPUT,t))}onblur(e,t){this._register(F(e,J.BLUR,t))}onfocus(e,t){this._register(F(e,J.FOCUS,t))}ignoreGesture(e){return jn.ignoreTarget(e)}}});var Fv,$4,q4=w(()=>{px();du();Ye();Ui();oe();Fv=11,$4=class extends ko{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Ie.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Fv+"px",this.domNode.style.height=Fv+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new oh),this._register(_i(this.bgDomNode,J.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(_i(this.domNode,J.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new rv),this._pointerdownScheduleRepeatTimer=this._register(new io)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ce(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}});var j4,KCe=w(()=>{Ye();B();j4=class extends E{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new io)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}});var BHe,C0,tQ=w(()=>{oe();ar();px();q4();KCe();du();ct();BHe=140,C0=class extends ko{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new j4(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new oh),this._shouldRender=!0,this.domNode=gt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(F(this.domNode.domNode,J.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new $4(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,o){this.slider=gt(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(F(this.slider.domNode,J.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let s=Zt(this.domNode.domNode);t=e.pageX-s.left,i=e.pageY-s.top}let o=e.pointerType==="mouse",r=e.button===0;if(r||!o){let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s))}r&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-i);if(Qi&&a>BHe){this._setDesiredScrollPositionNow(o.getScrollPosition());return}let c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}});var Bv,K4=w(()=>{Bv=class n{constructor(e,t,i,o,r,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=r,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new n(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,o,r){let s=Math.max(0,i-e),a=Math.max(0,s-2*t),l=o>0&&o>i;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(i*a/o))),d=(a-c)/(o-i),h=r*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){let e=n._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,i=this._scrollPosition;return t{Xa();tQ();q4();K4();li();G4=class extends C0{constructor(e,t,i){let o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Bv(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,o.width,o.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){let s=(t.arrowSize-Fv)/2,a=(t.horizontalScrollbarSize-Fv)/2;this._createArrow({className:"scra",icon:j.scrollbarButtonLeft,top:a,left:s,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Uh(null,1,0))}),this._createArrow({className:"scra",icon:j.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Uh(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}});var Y4,YCe=w(()=>{Xa();tQ();q4();K4();li();Y4=class extends C0{constructor(e,t,i){let o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Bv(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){let s=(t.arrowSize-Fv)/2,a=(t.verticalScrollbarSize-Fv)/2;this._createArrow({className:"scra",icon:j.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Uh(null,0,1))}),this._createArrow({className:"scra",icon:j.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Uh(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}});function iQ(n,e){let t=e-n;return function(i){return n+t*VHe(i)}}function WHe(n,e,t){return function(i){return i{ae();B();nQ=class n{constructor(e,t,i,o,r,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,o=o|0,r=r|0,s=s|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>i&&(o=i-t),o<0&&(o=0),r<0&&(r=0),a+r>s&&(a=s-r),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=o,this.height=r,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new n(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new n(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let i=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:o,scrollLeftChanged:r,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}},hu=class extends E{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new nQ(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let o;t?o=new X4(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=X4.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Z4=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};X4=class n{constructor(e,t,i,o){this.from=e,this.to=t,this.duration=o,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,s;return e{});function UHe(n){let e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,inertialScroll:typeof n.inertialScroll<"u"?n.inertialScroll:!1,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,qe&&(e.className+=" mac"),e}var zHe,XCe,oQ,aT,lT,S0,lg,Ju,hh=w(()=>{Gs();oe();ar();Xa();GCe();YCe();du();Ye();ae();B();ct();x0();ZCe();zHe=500,XCe=50,oQ=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},aT=class n{static{this.INSTANCE=new n}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,o=this._rear;do{let r=o===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[o].score*r,o===this._front)break;o=(this._capacity+o-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(jb){let t=Ce(e.browserEvent),i=WE(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let o=null,r=new oQ(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(o=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,o)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){let o=Math.abs(e.deltaX),r=Math.abs(e.deltaY),s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(o,s),1),c=Math.max(Math.min(r,a),1),d=Math.max(o,s),h=Math.max(r,a);d%l===0&&h%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){let t=Number.EPSILON*100;return Math.abs(Math.round(e)-e)<.01+t}},lT=class extends ko{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new N),this._onWillScroll=this._register(new N),e.style.overflow="hidden",this._options=UHe(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let o={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Y4(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new G4(this._scrollable,this._options,o)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=gt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=gt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=gt(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new io),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=ut(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,qe&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Uh(e))}async _periodicSync(){let e=!1;(this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0)&&(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-this._inertialSpeed.Y*100,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-this._inertialSpeed.X*100}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0),e?(this._inertialTimeout||(this._inertialTimeout=new io),this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ut(this._mouseWheelToDispose),e)){let i=o=>{this._onMouseWheel(new Uh(o))};this._mouseWheelToDispose.push(F(this._listenOnDomNode,J.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=aT.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+r===0?s=r=0:Math.abs(r)>=Math.abs(s)?s=0:r=0),this._options.flipAxes&&([r,s]=[s,r]);let a=!qe&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!s&&(s=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(s=s*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let l=this._scrollable.getFutureScrollPosition(),c={};if(r){let d=XCe*r,h=l.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(c,h)}if(s){let d=XCe*s,h=l.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(c,h)}if(c=this._scrollable.validateScrollPosition(c),this._options.inertialScroll&&(s||r)&&!t.isPhysicalMouseWheel()){let d=!1;this._inertialSpeed.X===0&&this._inertialSpeed.Y===0&&(d=!0),this._inertialSpeed.Y=(r<0?-1:1)*Math.abs(r)**1.02,this._inertialSpeed.X=(s<0?-1:1)*Math.abs(s)**1.02,d&&this._periodicSync()}(l.scrollLeft!==c.scrollLeft||l.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),i=!0)}let o=i;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,o=i?" left":"",r=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${o}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),zHe)}},S0=class extends lT{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;let i=new hu({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Ms(Ce(e),o)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}},lg=class extends lT{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},Ju=class extends lT{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;let i=new hu({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Ms(Ce(e),o)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}});var Q4,J4,e5,rQ,t5,sQ,QCe=w(()=>{oe();B();Fe();Rv();U4();Q4=class extends E{constructor(e,t,i,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}},J4=class extends E{constructor(e,t,i,o,r,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=o,this._position=r,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Ms(Ce(s.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}},e5=class extends Q4{_createDragScrollingOperation(e,t){return new rQ(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},rQ=class extends J4{_getScrollSpeed(){let e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e=this._context.configuration.options.get(75),t=this._getScrollSpeed(),i=this._tick(),o=t*(i/1e3)*e,r=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();let s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber,l;{let c=h0(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(165).horizontalScrollbarHeight,h=new b_(this._mouseEvent.pos.x,c.y+c.height-d-.1),u=u0(this._viewHelper.viewDomNode,c,h);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,h,u,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Us.createOutsideEditor(this._position.mouseColumn,new M(a,1),"above",this._position.outsideDistance):l=Us.createOutsideEditor(this._position.mouseColumn,new M(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Ms(Ce(l.element),()=>this._execute())}},t5=class extends Q4{_createDragScrollingOperation(e,t){return new sQ(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},sQ=class extends J4{_getScrollSpeed(){let e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed(),i=this._tick(),o=t*(i/1e3)*e*.5,r=this._position.outsidePosition==="left"?-o:o;if(this._context.viewModel.viewLayout.deltaScrollNow(r,0),this._viewHelper.renderNow(),!this._position.position)return;let s=this._position.position.lineNumber,a;{let l=h0(this._viewHelper.viewDomNode),c=this._context.configuration.options.get(165).horizontalScrollbarHeight,d=new b_(this._mouseEvent.pos.x,l.y+l.height-c-.1),h=u0(this._viewHelper.viewDomNode,l,d);a=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,d,h,null)}this._position.outsidePosition==="left"?a=Us.createOutsideEditor(a.mouseColumn,new M(s,a.mouseColumn),"left",this._position.outsideDistance):a=Us.createOutsideEditor(a.mouseColumn,new M(s,a.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(a,!0,2),this._animationFrameDisposable=Ms(Ce(a.element),()=>this._execute())}}});var y0,aQ,lQ,JCe=w(()=>{oe();Xa();B();ct();U4();Rv();Zy();Fe();bi();Av();hh();QCe();y0=class extends Yc{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new w0(this._context,i),this._mouseDownOperation=this._register(new aQ(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;let o=new M4(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=F(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new ch(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let r=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{r=a})),this._register(F(this.viewHelper.viewDomNode,J.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=aT.INSTANCE,t=0,i=$l.getZoomLevel(),o=!1,r=0,s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(84))return;let c=new Uh(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){let d=$l.getZoomLevel(),h=c.deltaY>0?1:-1;$l.setZoomLevel(d+h),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=$l.getZoomLevel(),o=a(l),r=0),t=Date.now(),r+=c.deltaY,o&&($l.setZoomLevel(i+r/5),c.preventDefault(),c.stopPropagation())};this._register(F(this.viewHelper.viewDomNode,J.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return qe?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){let t=this._context.configuration.options.get(165).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){let o=new oT(e,t).toPageCoordinates(Ce(this.viewHelper.viewDomNode)),r=h0(this.viewHelper.viewDomNode);if(o.yr.y+r.height||o.xr.x+r.width)return null;let s=u0(this.viewHelper.viewDomNode,r,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,o,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){let o=Qh(this.viewHelper.viewDomNode);o&&(i=o.elementsFromPoint(e.posx,e.posy).find(s=>this.viewHelper.viewDomNode.contains(s))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(o||s&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(r)e.preventDefault();else if(l){let u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}},aQ=class extends E{constructor(e,t,i,o,r,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=o,this._createMouseTarget=r,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new P4(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new e5(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._leftRightDragScrolling=this._register(new t5(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new lQ,this._currentSelection=new ge(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13?t.outsidePosition==="above"||t.outsidePosition==="below"?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;let r=this._context.configuration.options;if(!r.get(104)&&r.get(42)&&!r.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),s=>{let a=this._findMousePosition(this._lastMouseEvent,!1);Ku(s)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,i=this._context.viewModel,o=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){let h=e.posy-t.y-t.height,u=o.getCurrentScrollTop()+e.relativePos.y,f=v0.getZoneAtCoord(this._context,u);if(f){let p=this._helpPositionJumpOverViewZone(f);if(p)return Us.createOutsideEditor(r,p,"below",h)}let m=o.getLineNumberAtVerticalOffset(u);return Us.createOutsideEditor(r,new M(m,i.getLineMaxColumn(m)),"below",h)}let s=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y),a=this._context.configuration.options.get(165),l=a.contentLeft;if(e.relativePos.x<=l){let h=l-e.relativePos.x;return Us.createOutsideEditor(r,new M(s,1),"left",h)}let d=a.minimap.minimapLeft===0?a.width-a.verticalScrollbarWidth:a.minimap.minimapLeft;if(e.relativePos.x>=d){let h=e.relativePos.x-d;return Us.createOutsideEditor(r,new M(s,i.getLineMaxColumn(s)),"right",h)}return null}_findMousePosition(e,t){let i=this._getPositionOutsideEditor(e);if(i)return i;let o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){let s=this._helpPositionJumpOverViewZone(o.detail);if(s)return Us.createViewZone(o.type,o.element,o.mouseColumn,s,o.detail)}return o}_helpPositionJumpOverViewZone(e){let t=new M(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,o=e.positionAfter;return i&&o?i.isBefore(t)?i:o:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}},lQ=class n{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){let i=new Date().getTime();i-this._lastSetMouseDownCountTime>n.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}});var jt,cg=w(()=>{ae();jt=class{get event(){return this.emitter.event}constructor(e,t,i){let o=r=>this.emitter.fire(r);this.emitter=new N({onWillAddFirstListener:()=>e.addEventListener(t,o,i),onDidRemoveLastListener:()=>e.removeEventListener(t,o,i)})}dispose(){this.emitter.dispose()}}});function i5(n,e,t,i){let o=n.getPlainTextToCopy(e,t,Qi),r=n.model.getEOL(),s=t&&e.length===1&&e[0].isEmpty(),a=Array.isArray(o)?o:null,l=Array.isArray(o)?o.join(r):o,c,d=null;if(n5.forceCopyWithSyntaxHighlighting||i&&l.length<65536){let u=n.getRichTextToCopy(e,t);u&&(c=u.html,d=u.mode)}return{isFromEmptySelection:s,multicursorText:a,text:l,html:c,mode:d}}var uh,n5,dg,k0=w(()=>{ct();bv();uh=class n{static{this.INSTANCE=new n}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}},n5={forceCopyWithSyntaxHighlighting:!1},dg={getTextData(n){let e=n.getData(wn.text),t=null,i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(r=>r.name).join(`
+`),null]:[e,t]},setTextData(n,e,t,i){n.setData(wn.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}}});var ol,cQ=w(()=>{He();ol=class n{static{this.EMPTY=new n("",0,0,null,void 0)}constructor(e,t,i,o,r){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=o,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){let i=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd(),s;if(t){let a=i.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new n(i,o,r,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new n(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){let i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){let o=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,o,-1)}if(e>=this.selectionEnd){let o=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,o,1)}let t=this.value.substring(this.selectionStart,e);if(t.indexOf("\u2026")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);let i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let o=0,r=-1;for(;(r=t.indexOf(`
+`,r+1))!==-1;)o++;return[e,i*t.length,o]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let o=Math.min(Ea(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(bd(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(o,e.value.length-r);let s=t.value.substring(o,t.value.length-r),a=e.selectionStart-o,l=e.selectionEnd-o,c=t.selectionStart-o,d=t.selectionEnd-o;if(c===d){let u=e.selectionStart-o;return{text:s,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}let h=l-a;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};let i=Math.min(Ea(e.value,t.value),e.selectionEnd),o=Math.min(bd(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(i,e.value.length-o),s=t.value.substring(i,t.value.length-o);e.selectionStart-i;let a=e.selectionEnd-i;t.selectionStart-i;let l=t.selectionEnd-i;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-s.length}}static fromScreenReaderContentState(e){return new n(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}}});function o5(n){return`${n}-${uu()}`}var uu,C_=w(()=>{uu=function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;let i=0,o="";return o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o+="-",o+=e[n[i++]],o+=e[n[i++]],o+="-",o+=e[n[i++]],o+=e[n[i++]],o+="-",o+=e[n[i++]],o+=e[n[i++]],o+="-",o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o+=e[n[i++]],o}}()});var $He,exe,cT,dQ,r5,s5,hQ=w(()=>{Gs();oe();cg();ha();kX();Ye();ae();B();He();bi();zs();So();k0();cQ();C_();$He=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},exe=function(n,e){return function(t,i){e(t,i,n)}};(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(cT||(cT={}));dQ=class{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";let t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}},r5=class extends E{get textAreaState(){return this._textAreaState}constructor(e,t,i,o,r,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=o,this._accessibilityService=r,this._logService=s,this._onFocus=this._register(new N),this.onFocus=this._onFocus.event,this._onBlur=this._register(new N),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new N),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new N),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new N),this.onCut=this._onCut.event,this._onPaste=this._register(new N),this.onPaste=this._onPaste.event,this._onType=this._register(new N),this.onType=this._onType.event,this._onCompositionStart=this._register(new N),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new N),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new N),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new N),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new tt),this._asyncTriggerCut=this._register(new lt(()=>this._onCut.fire(),0)),this._textAreaState=ol.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(X.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new lt(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{let c=new St(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{let c=new St(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{let c=new dQ;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{let c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){let h=ol.readFromTextArea(this._textArea,this._textAreaState),u=ol.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(l);return}let d=c.handleCompositionUpdate(l.data);this._textAreaState=ol.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{let c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){let h=ol.readFromTextArea(this._textArea,this._textAreaState),u=ol.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}let d=c.handleCompositionUpdate(l.data);this._textAreaState=ol.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;let c=ol.readFromTextArea(this._textArea,this._textAreaState),d=ol.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(Dn(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&(l.inputType==="insertFromPaste"?this._onPaste.fire({text:d.text,metadata:uh.INSTANCE.get(d.text)}):this._onType.fire(d)))})),this._register(this._textArea.onCut(l=>{this._logService.trace("TextAreaInput#onCut",l),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._logService.trace("TextAreaInput#onCopy",l),this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._logService.trace("TextAreaInput#onPaste",l),this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=dg.getTextData(l.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",d?.id," with text.length: ",c.length),c&&(d=d||uh.INSTANCE.get(c),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{let l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new lt(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return F(this._textArea.ownerDocument,"selectionchange",t=>{if(ig.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let i=Date.now(),o=i-e;if(e=i,o<5)return;let r=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;let s=this._textArea.getValue();if(this._textAreaState.value!==s)return;let a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;let c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),h=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new ge(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){let t=this._host.getDataToCopy(),i;this._logService.getLevel()===Uo.Trace&&(i=uu());let o={version:1,id:i,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};uh.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,`
+`):t.text,o),e.preventDefault(),e.clipboardData&&dg.setTextData(e.clipboardData,t.text,t.html,o),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}};r5=$He([exe(4,ji),exe(5,Tt)],r5);s5=class extends E{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new N),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new jt(this._actual,"keydown")).event,this.onKeyPress=this._register(new jt(this._actual,"keypress")).event,this.onKeyUp=this._register(new jt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new jt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new jt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new jt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new jt(this._actual,"beforeinput")).event,this.onInput=this._register(new jt(this._actual,"input")).event,this.onCut=this._register(new jt(this._actual,"cut")).event,this.onCopy=this._register(new jt(this._actual,"copy")).event,this.onPaste=this._register(new jt(this._actual,"paste")).event,this.onFocus=this._register(new jt(this._actual,"focus")).event,this.onBlur=this._register(new jt(this._actual,"blur")).event,this._register(this.onKeyDown(()=>ig.onKeyDown())),this._register(this.onBeforeInput(()=>ig.onBeforeInput())),this._register(this.onInput(()=>ig.onInput())),this._register(this.onKeyUp(()=>ig.onKeyUp())),this._register(F(this._actual,cT.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=Qh(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?hn()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){let o=this._actual,r=null,s=Qh(o);s?r=s.activeElement:r=hn();let a=Ce(r),l=r===o,c=o.selectionStart,d=o.selectionEnd;if(l&&c===t&&d===i){To&&a.parent!==a&&o.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,i),To&&a.parent!==a&&o.focus();return}try{let h=Cbe(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,i),xbe(o,h)}catch{}}}});var uQ,fQ,a5,txe=w(()=>{EO();oe();Zc();ka();B();ct();JCe();Rv();hQ();uQ=class extends y0{constructor(e,t,i){super(e,t,i),this._register(jn.addTarget(this.viewHelper.linesContentDomNode)),this._register(F(this.viewHelper.linesContentDomNode,vi.Tap,r=>this.onTap(r))),this._register(F(this.viewHelper.linesContentDomNode,vi.Change,r=>this.onChange(r))),this._register(F(this.viewHelper.linesContentDomNode,vi.Contextmenu,r=>this._onContextMenu(new ch(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(F(this.viewHelper.linesContentDomNode,"pointerdown",r=>{let s=r.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));let o=new O4(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,s)=>this._onMouseDown(r,s)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let i=this._createMouseTarget(new ch(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}},fQ=class extends y0{constructor(e,t,i){super(e,t,i),this._register(jn.addTarget(this.viewHelper.linesContentDomNode)),this._register(F(this.viewHelper.linesContentDomNode,vi.Tap,o=>this.onTap(o))),this._register(F(this.viewHelper.linesContentDomNode,vi.Change,o=>this.onChange(o))),this._register(F(this.viewHelper.linesContentDomNode,vi.Contextmenu,o=>this._onContextMenu(new ch(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new ch(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let i=document.createEvent("CustomEvent");i.initEvent(cT.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},a5=class extends E{constructor(e,t,i){super(),(La||o_e&&yO)&&Gb.pointerEvents?this.handler=this._register(new uQ(e,t,i)):Et.TouchEvent?this.handler=this._register(new fQ(e,t,i)):this.handler=this._register(new y0(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}});var l5,ixe=w(()=>{yo();Fe();ct();l5=class{constructor(e,t,i,o){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=o}paste(e,t,i,o){this.commandDelegate.paste(e,t,i,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,o){this.commandDelegate.compositionType(e,t,i,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ta.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):o?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){ta.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){ta.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ta.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ta.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){ta.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){ta.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){ta.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){ta.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){ta.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){ta.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){ta.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){ta.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){ta.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}});function rl(n,e){let t=ay();if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(i){De(i);return}try{return globalThis.trustedTypes?.createPolicy(n,e)}catch(i){De(i);return}}var im=w(()=>{Ae();Gs()});var dT,L0,mQ,c5=w(()=>{ar();im();Ae();Gf();dT=class{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new ke("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;let i=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let r=0,s=0;for(let l=i;l<=o;l++){let c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(r=c,s=1):s++)}if(e=o&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;let i=t-e+1,o=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=i,null;if(e>r)return null;if(i+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);let s=[];for(let h=0;hi)continue;let l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){let h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),o=!0}}return o}},L0=class{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new dT(this._lineFactory)}_createDomNode(){let e=gt(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){let i=this._linesCollection.getStartLineNumber(),o=this._linesCollection.getEndLineNumber();for(let r=i;r<=o;r++)this._linesCollection.getLine(r).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,o=t.length;ie})}constructor(e,t,i,o){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=o}render(e,t,i,o){let r={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(r.rendLineNumberStart+r.linesLength-1t){let s=t,a=Math.min(i,r.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(r,s,a,o,t),r.linesLength+=a-s+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,s),r.linesLength-=s)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1i){let s=Math.max(0,i-r.rendLineNumberStart+1),l=r.linesLength-1-s+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,o),r}_renderUntouchedLines(e,t,i,o,r){let s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){let c=s+l;a[l].layoutLine(c,o[c-r],this._lineHeightForLineNumber(c))}}_insertLinesBefore(e,t,i,o,r){let s=[],a=0;for(let l=t;l<=i;l++)s[a++]=this._lineFactory.createLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){let l=e.lines[a];o[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){let o=document.createElement("div");n._ttPolicy&&(t=n._ttPolicy.createHTML(t)),o.innerHTML=t;for(let r=0;r{ar();Ld();c5();Fa();d5=class extends yn{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new L0(this._context,{createLine:()=>new gQ(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;let i=this._context.configuration.options.get(59);xn(this.domNode,i),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,o=t.length;i'),r.appendString(s),r.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}},h5=class extends d5{constructor(e){super(e);let i=this._context.configuration.options.get(165);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let i=this._context.configuration.options.get(165);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}},u5=class extends d5{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(165);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),xn(this.domNode,t.get(59))}onConfigurationChanged(e){let t=this._context.configuration.options;xn(this.domNode,t.get(59));let i=t.get(165);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}});var I0,pQ=w(()=>{Fe();I0=class n{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return n.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new M(e.afterLineNumber,1)).lineNumber}}}});var oxe=w(()=>{});var f5,rxe=w(()=>{ar();oxe();Fa();f5=class extends yn{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=gt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1,i=this._context.configuration.options.get(165),o=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==o&&(this.contentWidth=o,e=!0);let r=i.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0,i=e.getDecorationsInViewport();for(let o of i){if(!o.options.blockClassName)continue;let r=this.blocks[t];r||(r=this.blocks[t]=gt(document.createElement("div")),this.domNode.appendChild(r));let s,a;o.options.blockIsAfterEnd?(s=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(s=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),a=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));let[l,c,d,h]=o.options.blockPadding??[0,0,0,0];r.setClassName("blockDecorations-block "+o.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+c),r.setTop(s-e.scrollTop-l),r.setHeight(a-s+l+d),t++}for(let o=t;o{oe();ar();Fa();m5=class extends yn{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=gt(document.createElement("div")),Pa.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=gt(document.createElement("div")),Pa.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){let t=Object.keys(this._widgets);for(let i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){let e=Object.keys(this._widgets);for(let t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){let t=new bQ(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,o,r){this._widgets[e.getId()].setPosition(t,i,o,r),this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let i=this._widgets[t];delete this._widgets[t];let o=i.domNode.domNode;o.remove(),o.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){let t=Object.keys(this._widgets);for(let i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){let t=Object.keys(this._widgets);for(let i of t)this._widgets[i].prepareRender(e)}render(e){let t=Object.keys(this._widgets);for(let i of t)this._widgets[i].render(e)}},bQ=class{constructor(e,t,i){this._primaryAnchor=new Dx(null,null),this._secondaryAnchor=new Dx(null,null),this._context=e,this._viewDomNode=t,this._actual=i;let o=this._context.configuration.options,r=o.get(165),s=o.get(4);this.domNode=gt(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=(this._actual.allowEditorOverflow||!1)&&s,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=o.get(51),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){let t=this._context.configuration.options;if(e.hasChanged(165)){let i=t.get(165);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=o(t,this._context.viewModel,this._affinity),this._secondaryAnchor=o(i,this._context.viewModel,this._affinity);function o(r,s,a){if(!r)return new Dx(null,null);let l=s.model.validatePosition(r);if(s.coordinatesConverter.modelPositionIsVisible(l)){let c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new Dx(r,c)}return new Dx(r,null)}}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,o){this._setPosition(o,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,o){let r=e.top,s=r,a=e.top+e.height,l=o.viewportHeight-a,c=r-i,d=s>=i,h=a,u=l>=i,f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fl){let u=h-(l-o);h-=u,i-=u}if(h=p,v=h+i<=u.height-_;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,p),fitsBelow:v,belowTop:h,left:m}:{fitsAbove:b,aboveTop:r,fitsBelow:v,belowTop:s,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Tx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){let t=r(this._primaryAnchor.viewPosition,this._affinity),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,o=r(i,this._affinity);return{primary:t,secondary:o};function r(s,a){if(!s)return null;let l=e.visibleRangeForPosition(s);if(!l)return null;let c=s.column===1&&a===3?0:l.left,d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.scrollTop,h=e.getLineHeightForLineNumber(s.lineNumber);return new g5(d,c,h)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;let o=this._context.configuration.options.get(59),r=t.left;return re.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&_Q(this._actual.afterRender,this._actual,null,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&_Q(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}},Dx=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},Tx=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},g5=class{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}});var axe=w(()=>{});var Kl,x_=w(()=>{Av();Kl=class extends Yc{}});function ln(n){return{id:n}}function hT(n){switch(n){case Dd.DARK:return Lx.VS_DARK;case Dd.HIGH_CONTRAST_DARK:return Lx.HC_BLACK;case Dd.HIGH_CONTRAST_LIGHT:return Lx.HC_LIGHT;default:return Lx.VS}}function lr(n){return lxe.onColorThemeChange(n)}var Mt,wQ,vQ,lxe,p5,Jt=w(()=>{ae();B();ye();_s();dh();Mt=Re("themeService");wQ={ThemingContribution:"base.contributions.theming"},vQ=class extends E{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new N)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),se(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}},lxe=new vQ;qt.add(wQ.ThemingContribution,lxe);p5=class extends E{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}});var CQ,xQ,E0,_5,b5,cxe,v5,dxe,w5,hxe,qHe,jHe,Nx,uxe,fxe,mxe,gxe,pxe,Rx,_xe,bxe,vxe,wxe,Cxe,KHe,xxe,Sxe,yxe,kxe,Lxe,Ixe,GHe,C5,Exe,Dxe,Txe,x5,S5,y5,k5,L5,I5,Nxe,Rxe,Axe,Mxe,Oxe,Pxe,Fxe,Bxe,Wxe,Hxe,Vxe,zxe,Uxe,Nd=w(()=>{le();en();Bt();ri();Fi();hi();yi();ki();Bi();Ii();Si();Wi();Hi();Jt();CQ=A("editor.lineHighlightBackground",null,g(610,"Background color for the highlight of line at the cursor position.")),xQ=A("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:xt},g(611,"Background color for the border around the line at the cursor position."));A("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(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."),!0);A("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Pi,hcLight:Pi},g(613,"Background color of the border around highlighted ranges."));A("editor.symbolHighlightBackground",{dark:lu,light:lu,hcDark:null,hcLight:null},g(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."),!0);A("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Pi,hcLight:Pi},g(615,"Background color of the border around highlighted symbols."));E0=A("editorCursor.foreground",{dark:"#AEAFAD",light:q.black,hcDark:q.white,hcLight:"#0F4A85"},g(616,"Color of the editor cursor.")),_5=A("editorCursor.background",null,g(617,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),b5=A("editorMultiCursor.primary.foreground",E0,g(618,"Color of the primary editor cursor when multiple cursors are present.")),cxe=A("editorMultiCursor.primary.background",_5,g(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.")),v5=A("editorMultiCursor.secondary.foreground",E0,g(620,"Color of secondary editor cursors when multiple cursors are present.")),dxe=A("editorMultiCursor.secondary.background",_5,g(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.")),w5=A("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(622,"Color of whitespace characters in the editor.")),hxe=A("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:q.white,hcLight:"#292929"},g(623,"Color of editor line numbers.")),qHe=A("editorIndentGuide.background",w5,g(624,"Color of the editor indentation guides."),!1,g(625,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),jHe=A("editorIndentGuide.activeBackground",w5,g(626,"Color of the active editor indentation guides."),!1,g(627,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Nx=A("editorIndentGuide.background1",qHe,g(628,"Color of the editor indentation guides (1).")),uxe=A("editorIndentGuide.background2","#00000000",g(629,"Color of the editor indentation guides (2).")),fxe=A("editorIndentGuide.background3","#00000000",g(630,"Color of the editor indentation guides (3).")),mxe=A("editorIndentGuide.background4","#00000000",g(631,"Color of the editor indentation guides (4).")),gxe=A("editorIndentGuide.background5","#00000000",g(632,"Color of the editor indentation guides (5).")),pxe=A("editorIndentGuide.background6","#00000000",g(633,"Color of the editor indentation guides (6).")),Rx=A("editorIndentGuide.activeBackground1",jHe,g(634,"Color of the active editor indentation guides (1).")),_xe=A("editorIndentGuide.activeBackground2","#00000000",g(635,"Color of the active editor indentation guides (2).")),bxe=A("editorIndentGuide.activeBackground3","#00000000",g(636,"Color of the active editor indentation guides (3).")),vxe=A("editorIndentGuide.activeBackground4","#00000000",g(637,"Color of the active editor indentation guides (4).")),wxe=A("editorIndentGuide.activeBackground5","#00000000",g(638,"Color of the active editor indentation guides (5).")),Cxe=A("editorIndentGuide.activeBackground6","#00000000",g(639,"Color of the active editor indentation guides (6).")),KHe=A("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Pi,hcLight:Pi},g(640,"Color of editor active line number"),!1,g(641,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));A("editorLineNumber.activeForeground",KHe,g(642,"Color of editor active line number"));xxe=A("editorLineNumber.dimmedForeground",null,g(643,"Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),Sxe=A("editorRuler.foreground",{dark:"#5A5A5A",light:q.lightgrey,hcDark:q.white,hcLight:"#292929"},g(644,"Color of the editor rulers."));A("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(645,"Foreground color of editor CodeLens"));A("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(646,"Background color behind matching brackets"));A("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:xt,hcLight:xt},g(647,"Color for matching brackets boxes"));yxe=A("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(648,"Color of the overview ruler border.")),kxe=A("editorOverviewRuler.background",null,g(649,"Background color of the editor overview ruler."));A("editorGutter.background",tn,g(650,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));A("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:q.fromHex("#fff").transparent(.8),hcLight:xt},g(651,"Border color of unnecessary (unused) source code in the editor."));Lxe=A("editorUnnecessaryCode.opacity",{dark:q.fromHex("#000a"),light:q.fromHex("#0007"),hcDark:null,hcLight:null},g(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.`));A("editorGhostText.border",{dark:null,light:null,hcDark:q.fromHex("#fff").transparent(.8),hcLight:q.fromHex("#292929").transparent(.8)},g(653,"Border color of ghost text in the editor."));Ixe=A("editorGhostText.foreground",{dark:q.fromHex("#ffffff56"),light:q.fromHex("#0007"),hcDark:null,hcLight:null},g(654,"Foreground color of the ghost text in the editor."));A("editorGhostText.background",null,g(655,"Background color of the ghost text in the editor."));GHe=new q(new Z(0,122,204,.6)),C5=A("editorOverviewRuler.rangeHighlightForeground",GHe,g(656,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Exe=A("editorOverviewRuler.errorForeground",{dark:new q(new Z(255,18,18,.7)),light:new q(new Z(255,18,18,.7)),hcDark:new q(new Z(255,50,50,1)),hcLight:"#B5200D"},g(657,"Overview ruler marker color for errors.")),Dxe=A("editorOverviewRuler.warningForeground",{dark:lh,light:lh,hcDark:Ev,hcLight:Ev},g(658,"Overview ruler marker color for warnings.")),Txe=A("editorOverviewRuler.infoForeground",{dark:Gc,light:Gc,hcDark:Dv,hcLight:Dv},g(659,"Overview ruler marker color for infos.")),x5=A("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(660,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),S5=A("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(661,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),y5=A("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(662,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),k5=A("editorBracketHighlight.foreground4","#00000000",g(663,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),L5=A("editorBracketHighlight.foreground5","#00000000",g(664,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),I5=A("editorBracketHighlight.foreground6","#00000000",g(665,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Nxe=A("editorBracketHighlight.unexpectedBracket.foreground",{dark:new q(new Z(255,18,18,.8)),light:new q(new Z(255,18,18,.8)),hcDark:new q(new Z(255,50,50,1)),hcLight:"#B5200D"},g(666,"Foreground color of unexpected brackets.")),Rxe=A("editorBracketPairGuide.background1","#00000000",g(667,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Axe=A("editorBracketPairGuide.background2","#00000000",g(668,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Mxe=A("editorBracketPairGuide.background3","#00000000",g(669,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Oxe=A("editorBracketPairGuide.background4","#00000000",g(670,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Pxe=A("editorBracketPairGuide.background5","#00000000",g(671,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Fxe=A("editorBracketPairGuide.background6","#00000000",g(672,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Bxe=A("editorBracketPairGuide.activeBackground1","#00000000",g(673,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Wxe=A("editorBracketPairGuide.activeBackground2","#00000000",g(674,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Hxe=A("editorBracketPairGuide.activeBackground3","#00000000",g(675,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Vxe=A("editorBracketPairGuide.activeBackground4","#00000000",g(676,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),zxe=A("editorBracketPairGuide.activeBackground5","#00000000",g(677,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Uxe=A("editorBracketPairGuide.activeBackground6","#00000000",g(678,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));A("editorUnicodeHighlight.border",lh,g(679,"Border color used to highlight unicode characters."));A("editorUnicodeHighlight.background",fwe,g(680,"Background color used to highlight unicode characters."));lr((n,e)=>{let t=n.getColor(tn),i=n.getColor(CQ),o=i&&!i.isTransparent()?i:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)})});var E5,D5,T5,$xe=w(()=>{axe();x_();Nd();We();Jt();bi();dh();Fe();E5=class extends Kl{constructor(e){super(),this._context=e;let t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ge(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let r of this._selections)t.add(r.positionLineNumber);let i=Array.from(t);i.sort((r,s)=>r-s),Pt(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);let o=this._selections.every(r=>r.isEmpty());return this._selectionIsEmpty!==o&&(this._selectionIsEmpty=o,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o=[];for(let s=t;s<=i;s++){let a=s-t;o[a]=""}if(this._wordWrap){let s=this._renderOne(e,!1);for(let a of this._cursorLineNumbers){let l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new M(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new M(c,1)).lineNumber,h=l.convertModelPositionToViewPosition(new M(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let m=u;m<=f;m++){let p=m-t;o[p]=s}}}let r=this._renderOne(e,!0);for(let s of this._cursorLineNumbers){if(si)continue;let a=s-t;o[a]=r}this._renderData=o}render(e,t){if(!this._renderData)return"";let i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},D5=class extends E5{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},T5=class extends E5{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}};lr((n,e)=>{let t=n.getColor(CQ);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(xQ)){let i=n.getColor(xQ);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Ll(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}})});var qxe=w(()=>{});var N5,jxe=w(()=>{qxe();x_();Sx();de();N5=class extends Kl{constructor(e){super(),this._context=e;let t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){let t=e.getDecorationsInViewport(),i=[],o=0;for(let l=0,c=t.length;l{if(l.options.zIndex