/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

export function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

export var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

export function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

export function __decorate(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 i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) 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;
}

export function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};

export function __runInitializers(thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};

export function __propKey(x) {
    return typeof x === "symbol" ? x : "".concat(x);
};

export function __setFunctionName(f, name, prefix) {
    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

export function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

export function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

export function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

export var __createBinding = Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
});

export function __exportStar(m, o) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

export function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

export function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

/** @deprecated */
export function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

/** @deprecated */
export function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
}

export function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
}

export function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

export function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

export function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

export function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

export function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
};

export function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
}

export function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

export function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

export function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

export function __classPrivateFieldIn(state, receiver) {
    if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof state === "function" ? receiver === state : state.has(receiver);
}

export function __addDisposableResource(env, value, async) {
    if (value !== null && value !== void 0) {
        if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
        var dispose, inner;
        if (async) {
            if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
            dispose = value[Symbol.asyncDispose];
        }
        if (dispose === void 0) {
            if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
            dispose = value[Symbol.dispose];
            if (async) inner = dispose;
        }
        if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
        if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
        env.stack.push({ value: value, dispose: dispose, async: async });
    }
    else if (async) {
        env.stack.push({ async: true });
    }
    return value;

}

var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

export function __disposeResources(env) {
    function fail(e) {
        env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
        env.hasError = true;
    }
    function next() {
        while (env.stack.length) {
            var rec = env.stack.pop();
            try {
                var result = rec.dispose && rec.dispose.call(rec.value);
                if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
            }
            catch (e) {
                fail(e);
            }
        }
        if (env.hasError) throw env.error;
    }
    return next();
}

export default {
    __extends: __extends,
    __assign: __assign,
    __rest: __rest,
    __decorate: __decorate,
    __param: __param,
    __metadata: __metadata,
    __awaiter: __awaiter,
    __generator: __generator,
    __createBinding: __createBinding,
    __exportStar: __exportStar,
    __values: __values,
    __read: __read,
    __spread: __spread,
    __spreadArrays: __spreadArrays,
    __spreadArray: __spreadArray,
    __await: __await,
    __asyncGenerator: __asyncGenerator,
    __asyncDelegator: __asyncDelegator,
    __asyncValues: __asyncValues,
    __makeTemplateObject: __makeTemplateObject,
    __importStar: __importStar,
    __importDefault: __importDefault,
    __classPrivateFieldGet: __classPrivateFieldGet,
    __classPrivateFieldSet: __classPrivateFieldSet,
    __classPrivateFieldIn: __classPrivateFieldIn,
    __addDisposableResource: __addDisposableResource,
    __disposeResources: __disposeResources,
};

var dF=Object.defineProperty;var cF=Object.getOwnPropertyDescriptor;var C1=r=>{throw TypeError(r)};var D=(r,e,t,n)=>{for(var o=n>1?void 0:n?cF(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&dF(e,t,o),o},C=(r,e)=>(t,n)=>e(t,n,r);var BC=(r,e,t)=>e.has(r)||C1("Cannot "+t);var Gt=(r,e,t)=>(BC(r,e,"read from private field"),t?t.call(r):e.get(r)),cc=(r,e,t)=>e.has(r)?C1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Tm=(r,e,t,n)=>(BC(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Em=(r,e,t)=>(BC(r,e,"access private method"),t);var dt=class{constructor(e){this.executor=e;this._state=0}get hasValue(){return this._state===2}get value(){if(this._state===0){this._state=1;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=2}}else if(this._state===1)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};var WC=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Jo.isErrorNoTelemetry(e)?new Jo(e.message+`

`+e.stack):new Error(e.message+`

`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},uc=new WC;function km(r){uc.setUnexpectedErrorHandler(r)}function js(r){uc.onUnexpectedError(r)}function ct(r){Tn(r)||uc.onUnexpectedError(r)}function _m(r){Tn(r)||uc.onUnexpectedExternalError(r)}function ni(r){if(r instanceof Error){let{name:e,message:t,cause:n}=r,o=r.stacktrace||r.stack;return{$isError:!0,name:e,message:t,stack:o,noTelemetry:Jo.isErrorNoTelemetry(r),cause:n?ni(n):void 0,code:r.code}}return r}function $C(r){let e;return r.noTelemetry?e=new Jo:(e=new Error,e.name=r.name),e.message=r.message,e.stack=r.stack,r.code&&(e.code=r.code),r.cause&&(e.cause=$C(r.cause)),e}var Th="Canceled";function Tn(r){return r instanceof xt?!0:r instanceof Error&&r.name===Th&&r.message===Th}var xt=class extends Error{constructor(){super(Th),this.name=this.message}},wm=class r extends Error{static{this._name="PendingMigrationError"}static is(e){return e instanceof r||e instanceof Error&&e.name===r._name}constructor(e){super(e),this.name=r._name}};function zC(){let r=new Error(Th);return r.name=r.message,r}function De(r){return r?new Error(`Illegal argument: ${r}`):new Error("Illegal argument")}function pc(r){return r?new Error(`Illegal state: ${r}`):new Error("Illegal state")}var Cr=class extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};function Pm(r){return r?r.message?r.message:r.stack?r.stack.split(`
`)[0]:String(r):"Error"}var Eh=class extends Error{constructor(e){super("NotImplemented"),e&&(this.message=e)}},Pl=class extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}};var Jo=class r extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof r)return e;let t=new r;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},St=class r extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,r.prototype)}};function E1(r,e,t=r.length-1){let n=uF(r,e,t);if(n!==-1)return r[n]}function uF(r,e,t=r.length-1){for(let n=t;n>=0;n--){let o=r[n];if(e(o,n))return n}return-1}function pF(r,e,t=0,n=r.length){let o=t,i=n;for(;o<i;){let s=Math.floor((o+i)/2);e(r[s])?o=s+1:i=s}return o-1}var T1=class r{constructor(e){this._array=e;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(e){if(r.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!e(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}let t=pF(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}};function Ht(r,e,t=(n,o)=>n===o){if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;for(let n=0,o=r.length;n<o;n++)if(!t(r[n],e[n]))return!1;return!0}function k1(r,e){let t=[],n;for(let o of r.slice(0).sort(e))!n||e(n[0],o)!==0?(n=[o],t.push(n)):n.push(o);return t}function KC(r,e,t){let n=[];function o(a,l,d){if(l===0&&d.length===0)return;let c=n[n.length-1];c&&c.start+c.deleteCount===a?(c.deleteCount+=l,c.toInsert.push(...d)):n.push({start:a,deleteCount:l,toInsert:d})}let i=0,s=0;for(;;){if(i===r.length){o(i,0,e.slice(s));break}if(s===e.length){o(i,r.length-i,[]);break}let a=r[i],l=e[s],d=t(a,l);d===0?(i+=1,s+=1):d<0?(o(i,1,[]),i+=1):d>0&&(o(i,0,[l]),s+=1)}return n}function _1(r,e,t){let n=KC(r,e,t),o=[],i=[];for(let s of n)o.push(...r.slice(s.start,s.start+s.deleteCount)),i.push(...s.toInsert);return{removed:o,added:i}}function Ze(r){return r.filter(e=>!!e)}function P1(r){let e=0;for(let t=0;t<r.length;t++)r[t]&&(r[e]=r[t],e+=1);r.length=e}function Dm(r){return!Array.isArray(r)||r.length===0}function Qs(r){return Array.isArray(r)&&r.length>0}function Xo(r,e=t=>t){let t=new Set;return r.filter(n=>{let o=e(n);return t.has(o)?!1:(t.add(o),!0)})}function qC(r,e){let t;if(typeof e=="number"){let n=e;t=()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)}}else t=Math.random;for(let n=r.length-1;n>0;n-=1){let o=Math.floor(t()*(n+1)),i=r[n];r[n]=r[o],r[o]=i}}function Rm(r,e){return Array.isArray(r)?r.map(e):e(r)}function hn(r){return Array.isArray(r)?r:[r]}var D1;(a=>{function r(l){return l<0}a.isLessThan=r;function e(l){return l<=0}a.isLessThanOrEqual=e;function t(l){return l>0}a.isGreaterThan=t;function n(l){return l===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(D1||={});function R1(r,e){return(t,n)=>e(r(t),r(n))}var M1=(r,e)=>r-e;var w1=class r{constructor(e){this.iterate=e}static{this.empty=new r(e=>{})}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new r(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new r(t=>this.iterate(n=>t(e(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(o=>((n||D1.isGreaterThan(e(o,t)))&&(n=!1,t=o),!0)),t}};function wh(r,e){let t=Object.create(null);for(let n of r){let o=e(n),i=t[o];i||(i=t[o]=[]),i.push(n)}return t}function GC(r,e){let t=[],n=[];for(let o of r)e.has(o)||t.push(o);for(let o of e)r.has(o)||n.push(o);return{removed:t,added:n}}var L1,O1,A1=class{constructor(e,t){this.toKey=t;this._map=new Map;this[L1]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(n=>e.call(t,n,n,this))}[(O1=Symbol.iterator,L1=Symbol.toStringTag,O1)](){return this.values()}};function XC(r,e,t){let n=r.get(e);return n===void 0&&(n=t,r.set(e,n)),n}var jC=class{constructor(e,t){this.uri=e;this.value=t}};function gF(r){return Array.isArray(r)}var N1,qe=class r{constructor(e,t){this[N1]="ResourceMap";if(e instanceof r)this.map=new Map(e.map),this.toKey=t??r.defaultToKey;else if(gF(e)){this.map=new Map,this.toKey=t??r.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??r.defaultToKey}static{this.defaultToKey=e=>e.toString()}set(e,t){return this.map.set(this.toKey(e),new jC(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(N1=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},U1,Yo=class{constructor(e,t){this[U1]="ResourceSet";!e||typeof e=="function"?this._map=new qe(e):(this._map=new qe(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((n,o)=>e.call(t,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(U1=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var F1,QC=class{constructor(){this[F1]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){let n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let o=this._map.get(e);if(o)o.value=t,n!==0&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,t=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}values(){let e=this,t=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}entries(){let e=this,t=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}[(F1=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.previous,n--;this._tail=t,this._size=n,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}},JC=class extends QC{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Zo=class extends JC{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}};var gc=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){let t=this.map.get(e);return t||new Set}};function fc(r,e){let t=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=r.apply(t,arguments)}finally{e()}else o=r.apply(t,arguments);return o}}function vn(r,e){if(!r)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function hc(r,e="Unreachable"){throw new Error(e)}function vc(r,e="unexpected state"){if(!r)throw typeof e=="string"?new St(`Assertion Failed: ${e}`):e}function Mm(r){if(!r()){debugger;r(),ct(new St("Assertion Failed"))}}function ke(r){return typeof r=="string"}function V1(r){return fF(r,ke)}function fF(r,e){return Array.isArray(r)&&r.every(e)}function ut(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function B1(r){let e=Object.getPrototypeOf(Uint8Array);return typeof r=="object"&&r instanceof e}function Lo(r){return typeof r=="number"&&!isNaN(r)}function W1(r){return!!r&&typeof r[Symbol.iterator]=="function"}function bc(r){return typeof r>"u"}function Kn(r){return!wt(r)}function wt(r){return bc(r)||r===null}function kh(r,e){if(!r)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Tr(r){return vc(r!=null,"Argument is `undefined` or `null`."),r}var hF=Object.prototype.hasOwnProperty;function yc(r){if(!ut(r))return!1;for(let e in r)if(hF.call(r,e))return!1;return!0}function YC(r){return typeof r=="function"}function $1(r,e){let t=Math.min(r.length,e.length);for(let n=0;n<t;n++)ZC(r[n],e[n])}function ZC(r,e){if(ke(e)){if(typeof r!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(YC(e)){try{if(r instanceof e)return}catch{}if(!wt(r)&&r.constructor===e||e.length===1&&e.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function oi(r,e){for(let t in e)if(!(t in r))return!1;return!0}var It;(G=>{function r(z){return!!z&&typeof z=="object"&&typeof z[Symbol.iterator]=="function"}G.is=r;let e=Object.freeze([]);function t(){return e}G.empty=t;function*n(z){yield z}G.single=n;function o(z){return r(z)?z:n(z)}G.wrap=o;function i(z){return z??e}G.from=i;function*s(z){for(let K=z.length-1;K>=0;K--)yield z[K]}G.reverse=s;function a(z){return!z||z[Symbol.iterator]().next().done===!0}G.isEmpty=a;function l(z){return z[Symbol.iterator]().next().value}G.first=l;function d(z,K){let Q=0;for(let X of z)if(K(X,Q++))return!0;return!1}G.some=d;function c(z,K){let Q=0;for(let X of z)if(!K(X,Q++))return!1;return!0}G.every=c;function u(z,K){for(let Q of z)if(K(Q))return Q}G.find=u;function*m(z,K){for(let Q of z)K(Q)&&(yield Q)}G.filter=m;function*g(z,K){let Q=0;for(let X of z)yield K(X,Q++)}G.map=g;function*v(z,K){let Q=0;for(let X of z)yield*K(X,Q++)}G.flatMap=v;function*h(...z){for(let K of z)W1(K)?yield*K:yield K}G.concat=h;function x(z,K,Q){let X=Q;for(let B of z)X=K(X,B);return X}G.reduce=x;function S(z){let K=0;for(let Q of z)K++;return K}G.length=S;function*T(z,K,Q=z.length){for(K<-z.length&&(K=0),K<0&&(K+=z.length),Q<0?Q+=z.length:Q>z.length&&(Q=z.length);K<Q;K++)yield z[K]}G.slice=T;function P(z,K=Number.POSITIVE_INFINITY){let Q=[];if(K===0)return[Q,z];let X=z[Symbol.iterator]();for(let B=0;B<K;B++){let He=X.next();if(He.done)return[Q,G.empty()];Q.push(He.value)}return[Q,{[Symbol.iterator](){return X}}]}G.consume=P;async function L(z){let K=[];for await(let Q of z)K.push(Q);return K}G.asyncToArray=L;async function Y(z){let K=[];for await(let Q of z)K=K.concat(Q);return K}G.asyncToArrayFlat=Y})(It||={});var vF=!1,Rl=null;var z1=class r{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let t=this.livingDisposables.get(e);return t||(t={parent:null,source:null,isSingleton:!1,value:e,idx:r.idx++},this.livingDisposables.set(e,t)),t}trackDisposable(e){let t=this.getDisposableData(e);t.source||(t.source=new Error().stack)}setParent(e,t){let n=this.getDisposableData(e);n.parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){let n=t.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let l=new Map,d=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(d.length===0)return;let c=new Set(d.map(u=>u.value));if(n=d.filter(u=>!(u.parent&&c.has(u.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(l){function d(u,m){for(;u.length>0&&m.some(g=>typeof g=="string"?g===u[0]:u[0].match(g));)u.shift()}let c=l.source.split(`
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return d(c,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),c.reverse()}let i=new gc;for(let l of n){let d=o(l);for(let c=0;c<=d.length;c++)i.add(d.slice(0,c).join(`
`),l)}n.sort(R1(l=>l.idx,M1));let s="",a=0;for(let l of n.slice(0,e)){a++;let d=o(l),c=[];for(let u=0;u<d.length;u++){let m=d[u];m=`(shared with ${i.get(d.slice(0,u+1).join(`
`)).size}/${n.length} leaks) at ${m}`;let v=i.get(d.slice(0,u).join(`
`)),h=wh([...v].map(x=>o(x)[u]),x=>x);delete h[d[u]];for(let[x,S]of Object.entries(h))S&&c.unshift(`    - stacktraces of ${S.length} other leaks continue with ${x}`);c.unshift(m)}s+=`


==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ====================
${c.join(`
`)}
============================================================

`}return n.length>e&&(s+=`


... and ${n.length-e} more leaking disposables

`),{leaks:n,details:s}}};function bF(r){Rl=r}if(vF){let r="__is_disposable_tracked__";bF(new class{trackDisposable(e){let t=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[r]||console.log(t)},3e3)}setParent(e,t){if(e&&e!==H.None)try{e[r]=!0}catch{}}markAsDisposed(e){if(e&&e!==H.None)try{e[r]=!0}catch{}}markAsSingleton(e){}})}function Xs(r){return Rl?.trackDisposable(r),r}function Ys(r){Rl?.markAsDisposed(r)}function Ml(r,e){Rl?.setParent(r,e)}function yF(r,e){if(Rl)for(let t of r)Rl.setParent(t,e)}function Am(r){return Rl?.markAsSingleton(r),r}function Ph(r){return typeof r=="object"&&r!==null&&typeof r.dispose=="function"&&r.dispose.length===0}function wn(r){if(It.is(r)){let e=[];for(let t of r)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function Ic(...r){let e=J(()=>wn(r));return yF(r,e),e}var eT=class{constructor(e){this._isDisposed=!1,this._fn=e,Xs(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Ys(this),this._fn()}}};function J(r){return new eT(r)}var q=class r{constructor(){this._toDispose=new Set;this._isDisposed=!1;Xs(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Ys(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{wn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===H.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Ml(e,this),this._isDisposed?r.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&Ml(e,null)}assertNotDisposed(){this._isDisposed&&ct(new St("Object disposed"))}},H=class{constructor(){this._store=new q;Xs(this),Ml(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){Ys(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}},En=class{constructor(){this._isDisposed=!1;Xs(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Ml(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ys(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Ml(e,null),e}};var Oo=class{constructor(e=new Map){this._isDisposed=!1;this._store=e,Xs(this)}dispose(){Ys(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{wn(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,t,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,t),Ml(t,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let t=this._store.get(e);return t&&Ml(t,null),this._store.delete(e),t}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};var _h=class extends Oo{constructor(){super(new qe)}};function Dh(r,e){return new tT(r,e)}var tT=class{constructor(e,t){this.reducer=e;this.options=t;this.state={flowing:!1,ended:!1,destroyed:!1};this.buffer={data:[],error:[]};this.listeners={data:[],error:[],end:[]};this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?ct(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(t);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let t=this.reducer(this.buffer.data);this.emitData(t)}else for(let t of this.buffer.data)this.emitData(t);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(t=>t())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function K1(r,e){let t=[],n;for(;(n=r.read())!==null;)t.push(n);return e(t)}function Rh(r,e){return new Promise((t,n)=>{let o=[];nT(r,{onData:i=>{e&&o.push(i)},onError:i=>{e?n(i):t(void 0)},onEnd:()=>{t(e?e(o):void 0)}})})}function nT(r,e,t){r.on("error",n=>{t?.isCancellationRequested||e.onError(n)}),r.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),r.on("data",n=>{t?.isCancellationRequested||e.onData(n)})}function q1(r,e){let t=Dh(e);return t.end(r),t}var Lm=typeof Buffer<"u",xF=new dt(()=>new Uint8Array(256)),oT,rT,ee=class r{static alloc(e){return Lm?new r(Buffer.allocUnsafe(e)):new r(new Uint8Array(e))}static wrap(e){return Lm&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new r(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&Lm?new r(Buffer.from(e)):(oT||(oT=new TextEncoder),new r(oT.encode(e)))}static fromByteArray(e){let t=r.alloc(e.length);for(let n=0,o=e.length;n<o;n++)t.buffer[n]=e[n];return t}static concat(e,t){if(typeof t>"u"){t=0;for(let i=0,s=e.length;i<s;i++)t+=e[i].byteLength}let n=r.alloc(t),o=0;for(let i=0,s=e.length;i<s;i++){let a=e[i];n.set(a,o),o+=a.byteLength}return n}static isNativeBuffer(e){return Lm&&Buffer.isBuffer(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}clone(){let e=r.alloc(this.byteLength);return e.set(this),e}toString(){return Lm?this.buffer.toString():(rT||(rT=new TextDecoder(void 0,{ignoreBOM:!0})),rT.decode(this.buffer))}slice(e,t){return new r(this.buffer.subarray(e,t))}set(e,t){if(e instanceof r)this.buffer.set(e.buffer,t);else if(e instanceof Uint8Array)this.buffer.set(e,t);else if(e instanceof ArrayBuffer)this.buffer.set(new Uint8Array(e),t);else if(ArrayBuffer.isView(e))this.buffer.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t);else throw new Error("Unknown argument 'array'")}readUInt32BE(e){return Om(this.buffer,e)}writeUInt32BE(e,t){Nm(this.buffer,e,t)}readUInt32LE(e){return CF(this.buffer,e)}writeUInt32LE(e,t){TF(this.buffer,e,t)}readUInt8(e){return EF(this.buffer,e)}writeUInt8(e,t){wF(this.buffer,e,t)}indexOf(e,t=0){return SF(this.buffer,e instanceof r?e.buffer:e,t)}equals(e){return this===e?!0:this.byteLength!==e.byteLength?!1:this.buffer.every((t,n)=>t===e.buffer[n])}};function SF(r,e,t=0){let n=e.byteLength,o=r.byteLength;if(n===0)return 0;if(n===1)return r.indexOf(e[0],t);if(n>o-t)return-1;let i=xF.value;i.fill(e.length);for(let d=0;d<e.length;d++)i[e[d]]=e.length-d-1;let s=t+e.length-1,a=s,l=-1;for(;s<o;)if(r[s]===e[a]){if(a===0){l=s;break}s--,a--}else s+=Math.max(e.length-a,i[r[s]]),a=e.length-1;return l}function Q1(r,e){return r[e+0]<<0>>>0|r[e+1]<<8>>>0}function J1(r,e,t){r[t+0]=e&255,e=e>>>8,r[t+1]=e&255}function Om(r,e){return r[e]*2**24+r[e+1]*2**16+r[e+2]*2**8+r[e+3]}function Nm(r,e,t){r[t+3]=e,e=e>>>8,r[t+2]=e,e=e>>>8,r[t+1]=e,e=e>>>8,r[t]=e}function CF(r,e){return r[e+0]<<0>>>0|r[e+1]<<8>>>0|r[e+2]<<16>>>0|r[e+3]<<24>>>0}function TF(r,e,t){r[t+0]=e&255,e=e>>>8,r[t+1]=e&255,e=e>>>8,r[t+2]=e&255,e=e>>>8,r[t+3]=e&255}function EF(r,e){return r[e]}function wF(r,e,t){r[t]=e}function X1(r){return K1(r,e=>ee.concat(e))}function iT(r){return Rh(r,e=>ee.concat(e))}function Y1(r){return q1(r,e=>ee.concat(e))}function No(r){let e=0,t=0,n=0,o=new Uint8Array(Math.floor(r.length/4*3)),i=a=>{switch(t){case 3:o[n++]=e|a,t=0;break;case 2:o[n++]=e|a>>>2,e=a<<6,t=3;break;case 1:o[n++]=e|a>>>4,e=a<<4,t=2;break;default:e=a<<2,t=1}};for(let a=0;a<r.length;a++){let l=r.charCodeAt(a);if(l>=65&&l<=90)i(l-65);else if(l>=97&&l<=122)i(l-97+26);else if(l>=48&&l<=57)i(l-48+52);else if(l===43||l===45)i(62);else if(l===47||l===95)i(63);else{if(l===61)break;throw new SyntaxError(`Unexpected base64 character ${r[a]}`)}}let s=n;for(;t>0;)i(0);return ee.wrap(o).slice(0,s)}var kF="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function er({buffer:r},e=!0,t=!1){let n=t?_F:kF,o="",i=r.byteLength%3,s=0;for(;s<r.byteLength-i;s+=3){let a=r[s+0],l=r[s+1],d=r[s+2];o+=n[a>>>2],o+=n[(a<<4|l>>>4)&63],o+=n[(l<<2|d>>>6)&63],o+=n[d&63]}if(i===1){let a=r[s+0];o+=n[a>>>2],o+=n[a<<4&63],e&&(o+="==")}else if(i===2){let a=r[s+0],l=r[s+1];o+=n[a>>>2],o+=n[(a<<4|l>>>4)&63],o+=n[l<<2&63],e&&(o+="=")}return o}var G1="0123456789abcdef";function Um({buffer:r}){let e="";for(let t=0;t<r.length;t++){let n=r[t];e+=G1[n>>>4],e+=G1[n&15]}return e}function Z1(r){if(r.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(r.length>>1);for(let t=0;t<r.length;)e[t>>1]=j1(r,t++)<<4|j1(r,t++);return ee.wrap(e)}function j1(r,e){let t=r.charCodeAt(e);if(t>=48&&t<=57)return t-48;if(t>=97&&t<=102)return t-87;if(t>=65&&t<=70)return t-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}var Vt=class r{static{this.Undefined=new r(void 0)}constructor(e){this.element=e,this.next=r.Undefined,this.prev=r.Undefined}},qn=class{constructor(){this._first=Vt.Undefined;this._last=Vt.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===Vt.Undefined}clear(){let e=this._first;for(;e!==Vt.Undefined;){let t=e.next;e.prev=Vt.Undefined,e.next=Vt.Undefined,e=t}this._first=Vt.Undefined,this._last=Vt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Vt(e);if(this._first===Vt.Undefined)this._first=n,this._last=n;else if(t){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==Vt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Vt.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==Vt.Undefined)return this._last.element}_remove(e){if(e.prev!==Vt.Undefined&&e.next!==Vt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Vt.Undefined&&e.next===Vt.Undefined?(this._first=Vt.Undefined,this._last=Vt.Undefined):e.next===Vt.Undefined?(this._last=this._last.prev,this._last.next=Vt.Undefined):e.prev===Vt.Undefined&&(this._first=this._first.next,this._first.prev=Vt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Vt.Undefined;)yield e.element,e=e.next}};var PF=globalThis.performance.now.bind(globalThis.performance),uo=class r{static create(e){return new r(e)}constructor(e){this._now=e===!1?Date.now:PF,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var t0=!1,DF=!1,Me;(Ve=>{Ve.None=()=>H.None;function e(ne){if(DF){let{onDidAddListener:te}=ne,Z=Fm.create(),re=0;ne.onDidAddListener=()=>{++re===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Z.print()),te?.()}}}function t(ne,te,Z){return g(ne,()=>{},0,void 0,te??!0,void 0,Z)}Ve.defer=t;function n(ne){return(te,Z=null,re)=>{let ie=!1,we;return we=ne(Ne=>{if(!ie)return we?we.dispose():ie=!0,te.call(Z,Ne)},null,re),ie&&we.dispose(),we}}Ve.once=n;function o(ne,te){return Ve.once(Ve.filter(ne,te))}Ve.onceIf=o;function i(ne,te,Z){return u((re,ie=null,we)=>ne(Ne=>re.call(ie,te(Ne)),null,we),Z)}Ve.map=i;function s(ne,te,Z){return u((re,ie=null,we)=>ne(Ne=>{te(Ne),re.call(ie,Ne)},null,we),Z)}Ve.forEach=s;function a(ne,te,Z){return u((re,ie=null,we)=>ne(Ne=>te(Ne)&&re.call(ie,Ne),null,we),Z)}Ve.filter=a;function l(ne){return ne}Ve.signal=l;function d(...ne){return(te,Z=null,re)=>{let ie=Ic(...ne.map(we=>we(Ne=>te.call(Z,Ne))));return m(ie,re)}}Ve.any=d;function c(ne,te,Z,re){let ie=Z;return i(ne,we=>(ie=te(ie,we),ie),re)}Ve.reduce=c;function u(ne,te){let Z,re={onWillAddFirstListener(){Z=ne(ie.fire,ie)},onDidRemoveLastListener(){Z?.dispose()}};te||e(re);let ie=new E(re);return te?.add(ie),ie.event}function m(ne,te){return te instanceof Array?te.push(ne):te&&te.add(ne),ne}function g(ne,te,Z=100,re=!1,ie=!1,we,Ne){let Ae,et,bt,Ke=0,Kt,nn={leakWarningThreshold:we,onWillAddFirstListener(){Ae=ne(Ks=>{Ke++,et=te(et,Ks),re&&!bt&&(zn.fire(et),et=void 0),Kt=()=>{let qs=et;et=void 0,bt=void 0,(!re||Ke>1)&&zn.fire(qs),Ke=0},typeof Z=="number"?(bt&&clearTimeout(bt),bt=setTimeout(Kt,Z)):bt===void 0&&(bt=null,queueMicrotask(Kt))})},onWillRemoveListener(){ie&&Ke>0&&Kt?.()},onDidRemoveLastListener(){Kt=void 0,Ae.dispose()}};Ne||e(nn);let zn=new E(nn);return Ne?.add(zn),zn.event}Ve.debounce=g;function v(ne,te=0,Z,re){return Ve.debounce(ne,(ie,we)=>ie?(ie.push(we),ie):[we],te,void 0,Z??!0,void 0,re)}Ve.accumulate=v;function h(ne,te,Z=100,re=!0,ie=!0,we,Ne){let Ae,et,bt,Ke=0,Kt={leakWarningThreshold:we,onWillAddFirstListener(){Ae=ne(zn=>{Ke++,et=te(et,zn),bt===void 0&&(re&&(nn.fire(et),et=void 0,Ke=0),typeof Z=="number"?bt=setTimeout(()=>{ie&&Ke>0&&nn.fire(et),et=void 0,bt=void 0,Ke=0},Z):(bt=0,queueMicrotask(()=>{ie&&Ke>0&&nn.fire(et),et=void 0,bt=void 0,Ke=0})))})},onDidRemoveLastListener(){Ae.dispose()}};Ne||e(Kt);let nn=new E(Kt);return Ne?.add(nn),nn.event}Ve.throttle=h;function x(ne,te=(re,ie)=>re===ie,Z){let re=!0,ie;return a(ne,we=>{let Ne=re||!te(we,ie);return re=!1,ie=we,Ne},Z)}Ve.latch=x;function S(ne,te,Z){return[Ve.filter(ne,te,Z),Ve.filter(ne,re=>!te(re),Z)]}Ve.split=S;function T(ne,te=!1,Z=[],re){let ie=Z.slice(),we=ne(et=>{ie?ie.push(et):Ae.fire(et)});re&&re.add(we);let Ne=()=>{ie?.forEach(et=>Ae.fire(et)),ie=null},Ae=new E({onWillAddFirstListener(){we||(we=ne(et=>Ae.fire(et)),re&&re.add(we))},onDidAddFirstListener(){ie&&(te?setTimeout(Ne):Ne())},onDidRemoveLastListener(){we&&we.dispose(),we=null}});return re&&re.add(Ae),Ae.event}Ve.buffer=T;function P(ne,te){return(re,ie,we)=>{let Ne=te(new Y);return ne(function(Ae){let et=Ne.evaluate(Ae);et!==L&&re.call(ie,et)},void 0,we)}}Ve.chain=P;let L=Symbol("HaltChainable");class Y{constructor(){this.steps=[]}map(te){return this.steps.push(te),this}forEach(te){return this.steps.push(Z=>(te(Z),Z)),this}filter(te){return this.steps.push(Z=>te(Z)?Z:L),this}reduce(te,Z){let re=Z;return this.steps.push(ie=>(re=te(re,ie),re)),this}latch(te=(Z,re)=>Z===re){let Z=!0,re;return this.steps.push(ie=>{let we=Z||!te(ie,re);return Z=!1,re=ie,we?ie:L}),this}evaluate(te){for(let Z of this.steps)if(te=Z(te),te===L)break;return te}}function G(ne,te,Z=re=>re){let re=(...Ae)=>Ne.fire(Z(...Ae)),ie=()=>ne.on(te,re),we=()=>ne.removeListener(te,re),Ne=new E({onWillAddFirstListener:ie,onDidRemoveLastListener:we});return Ne.event}Ve.fromNodeEventEmitter=G;function z(ne,te,Z=re=>re){let re=(...Ae)=>Ne.fire(Z(...Ae)),ie=()=>ne.addEventListener(te,re),we=()=>ne.removeEventListener(te,re),Ne=new E({onWillAddFirstListener:ie,onDidRemoveLastListener:we});return Ne.event}Ve.fromDOMEventEmitter=z;function K(ne,te){let Z,re,ie=new Promise(we=>{re=n(ne)(we),uT(re,te),Z=()=>{o0(re,te)}});return ie.cancel=Z,te&&ie.finally(()=>o0(re,te)),ie}Ve.toPromise=K;function Q(ne,te){return ne(Z=>te.fire(Z))}Ve.forward=Q;function X(ne,te,Z){return te(Z),ne(re=>te(re))}Ve.runAndSubscribe=X;class B{constructor(te,Z){this._observable=te;this._counter=0;this._hasChanged=!1;let re={onWillAddFirstListener:()=>{te.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{te.removeObserver(this)}};Z||e(re),this.emitter=new E(re),Z&&Z.add(this.emitter)}beginUpdate(te){this._counter++}handlePossibleChange(te){}handleChange(te,Z){this._hasChanged=!0}endUpdate(te){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function He(ne,te){return new B(ne,te).emitter.event}Ve.fromObservable=He;function Ge(ne){return(te,Z,re)=>{let ie=0,we=!1,Ne={beginUpdate(){ie++},endUpdate(){ie--,ie===0&&(ne.reportChanges(),we&&(we=!1,te.call(Z)))},handlePossibleChange(){},handleChange(){we=!0}};ne.addObserver(Ne),ne.reportChanges();let Ae={dispose(){ne.removeObserver(Ne)}};return uT(Ae,re),Ae}}Ve.fromObservableLight=Ge})(Me||={});var sT=class r{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${r._idPool++}`,r.all.add(this)}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new uo,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},n0=-1;var aT=class r{constructor(e,t,n=(r._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=t;this.name=n;this._warnCountdown=0}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[i,s]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${s}):`;console.warn(a),console.warn(i);let l=new lT(a,i);this._errorHandler(l)}return()=>{let i=this._stacks.get(e.value)||0;this._stacks.set(e.value,i-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,o]of this._stacks)(!e||t<o)&&(e=[n,o],t=o);return e}},Fm=class r{constructor(e){this.value=e}static create(){let e=new Error;return new r(e.stack??"")}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},lT=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},dT=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},RF=0,xc=class{constructor(e){this.value=e;this.id=RF++}},MF=2,r0=(r,e)=>{if(r instanceof xc)e(r);else for(let t=0;t<r.length;t++){let n=r[t];n&&e(n)}},E=class{constructor(e){this._size=0;this._options=e,this._leakageMon=n0>0||this._options?.leakWarningThreshold?new aT(e?.onListenerError??ct,this._options?.leakWarningThreshold??n0):void 0,this._perfMon=this._options?._profName?new sT(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(t0){let e=this._listeners;queueMicrotask(()=>{r0(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new dT(`${l}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||ct)(c),H.None}if(this._disposed)return H.None;t&&(e=e.bind(t));let o=new xc(e),i,s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Fm.create(),i=this._leakageMon.check(o.stack,this._size+1)),t0&&(o.stack=s??Fm.create()),this._listeners?this._listeners instanceof xc?(this._deliveryQueue??=new cT,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=J(()=>{i?.(),this._removeListener(o)});return uT(a,n),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*MF<=t.length){let i=0;for(let s=0;s<t.length;s++)t[s]?t[i++]=t[s]:o&&i<this._deliveryQueue.end&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=i}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||ct;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof xc)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}};var cT=class{constructor(){this.i=-1;this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},ri=class extends E{async fireAsync(e,t,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new qn),r0(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!t.isCancellationRequested;){let[o,i]=this._asyncDeliveryQueue.shift(),s=[],a={...i,token:t,waitUntil:l=>{if(Object.isFrozen(s))throw new Error("waitUntil can NOT be called asynchronous");n&&(l=n(l,o)),s.push(l)}};try{o(a)}catch(l){ct(l);continue}Object.freeze(s),await Promise.allSettled(s).then(l=>{for(let d of l)d.status==="rejected"&&ct(d.reason)})}}},Zs=class extends E{constructor(t){super(t);this._isPaused=0;this._eventQueue=new qn;this._mergeFn=t?.merge}get isPaused(){return this._isPaused!==0}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let t=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(t))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(t){this._size&&(this._isPaused!==0?this._eventQueue.push(t):super.fire(t))}},Mh=class extends Zs{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}},Ah=class extends E{constructor(t){super(t);this._queuedEvents=[];this._mergeFn=t?.merge}fire(t){this.hasListeners()&&(this._queuedEvents.push(t),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(n=>super.fire(n)),this._queuedEvents=[]}))}};function uT(r,e){e instanceof q?e.add(r):Array.isArray(e)&&e.push(r)}function o0(r,e){if(e instanceof q)e.delete(r);else if(Array.isArray(e)){let t=e.indexOf(r);t!==-1&&e.splice(t,1)}r.dispose()}var Lh=(t=>(t[t.Desktop=1]="Desktop",t[t.Web=2]="Web",t))(Lh||{});function pT(r){let e=ee.alloc(1);switch(r){case 0:e.writeUInt8(1,0);break;case 1:e.writeUInt8(2,0);break;case 2:e.writeUInt8(3,0);break}return e}function i0(r,e){if(r.byteLength!==1)return!1;switch(r.readUInt8(0)){case 1:return e===0;case 2:return e===1;case 3:return e===2;default:return!1}}function mT(r){let e=[];typeof r=="number"&&e.push("code/timeOrigin",r);function t(o,i){e.push(o,i?.startTime??Date.now())}function n(){let o=[];for(let i=0;i<e.length;i+=2)o.push({name:e[i],startTime:e[i+1]});return o}return{mark:t,getMarks:n}}function AF(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?mT():{mark(r,e){performance.mark(r,e)},getMarks(){let r=performance.timeOrigin;typeof r!="number"&&(r=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let e=[{name:"code/timeOrigin",startTime:Math.round(r)}];for(let t of performance.getEntriesByType("mark"))e.push({name:t.name,startTime:Math.round(r+t.startTime)});return e}};if(typeof process=="object"){let r=performance?.timeOrigin;return mT(r)}else return console.trace("perf-util loaded in UNKNOWN environment"),mT()}function LF(r){return r.MonacoPerformanceMarks||(r.MonacoPerformanceMarks=AF()),r.MonacoPerformanceMarks}var s0=LF(globalThis),bn=s0.mark,a0=s0.getMarks;function OF(){return globalThis._VSCODE_NLS_MESSAGES}function gT(){return globalThis._VSCODE_NLS_LANGUAGE}var NF=gT()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Nh(r,e){let t;return e.length===0?t=r:t=r.replace(/\{(\d+)\}/g,(n,o)=>{let i=o[0],s=e[i],a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),NF&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}function p(r,e,...t){return Nh(typeof r=="number"?l0(r,e):e,t)}function l0(r,e){let t=OF()?.[r];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${r} !!!`)}return t}function Al(r,e,...t){let n;typeof r=="number"?n=l0(r,e):n=e;let o=Nh(n,t);return{value:o,original:e===n?o:Nh(e,t)}}var ii="en",Vm=!1,Bm=!1,Hm=!1,UF=!1,p0=!1,hT=!1,FF=!1,vT=!1,m0=!1,g0=!1,Uh,Fh=ii,d0=ii,HF,Ki,qi=globalThis,yo;typeof qi.vscode<"u"&&typeof qi.vscode.process<"u"?yo=qi.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(yo=process);var f0=typeof yo?.versions?.electron=="string",VF=f0&&yo?.type==="renderer";if(typeof yo=="object"){Vm=yo.platform==="win32",Bm=yo.platform==="darwin",Hm=yo.platform==="linux",UF=Hm&&!!yo.env.SNAP&&!!yo.env.SNAP_REVISION,FF=f0,m0=!!yo.env.CI||!!yo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!yo.env.GITHUB_WORKSPACE,Uh=ii,Fh=ii;let r=yo.env.VSCODE_NLS_CONFIG;if(r)try{let e=JSON.parse(r);Uh=e.userLocale,d0=e.osLocale,Fh=e.resolvedLanguage||ii,HF=e.languagePack?.translationsConfigFile}catch{}p0=!0}else typeof navigator=="object"&&!VF?(Ki=navigator.userAgent,Vm=Ki.indexOf("Windows")>=0,Bm=Ki.indexOf("Macintosh")>=0,vT=(Ki.indexOf("Macintosh")>=0||Ki.indexOf("iPad")>=0||Ki.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Hm=Ki.indexOf("Linux")>=0,g0=Ki?.indexOf("Mobi")>=0,hT=!0,Fh=gT()||ii,Uh=navigator.language.toLowerCase(),d0=Uh):console.error("Unable to resolve platform.");function bT(r){switch(r){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}var fT=0;Bm?fT=1:Vm?fT=3:Hm&&(fT=2);var Ct=Vm,en=Bm,An=Hm;var Hh=p0;var Uo=hT,BF=hT&&typeof qi.importScripts=="function",h0=BF?qi.origin:void 0,v0=vT,b0=g0,ta=m0;var si=Ki,ea=Fh,WF;(n=>{function r(){return ea}n.value=r;function e(){return ea.length===2?ea==="en":ea.length>=3?ea[0]==="e"&&ea[1]==="n"&&ea[2]==="-":!1}n.isDefaultVariant=e;function t(){return ea==="en"}n.isDefault=t})(WF||={});var $F=typeof qi.postMessage=="function"&&!qi.importScripts,Vh=(()=>{if($F){let r=[];qi.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,o=r.length;n<o;n++){let i=r[n];if(i.id===t.data.vscodeScheduleAsyncWork){r.splice(n,1),i.callback();return}}});let e=0;return t=>{let n=++e;r.push({id:n,callback:t}),qi.postMessage({vscodeScheduleAsyncWork:n},"*")}}return r=>setTimeout(r)})();var ai=Bm||vT?2:Vm?1:3,c0=!0,u0=!1;function Bh(){if(!u0){u0=!0;let r=new Uint8Array(2);r[0]=1,r[1]=2,c0=new Uint16Array(r.buffer)[0]===513}return c0}var Wm=!!(si&&si.indexOf("Chrome")>=0),y0=!!(si&&si.indexOf("Firefox")>=0),I0=!!(!Wm&&si&&si.indexOf("Safari")>=0),Wh=!!(si&&si.indexOf("Edg/")>=0),J9=!!(si&&si.indexOf("Android")>=0);var Ol,yT=globalThis.vscode;if(typeof yT<"u"&&typeof yT.process<"u"){let r=yT.process;Ol={get platform(){return r.platform},get arch(){return r.arch},get env(){return r.env},cwd(){return r.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Ol={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Ol={get platform(){return Ct?"win32":en?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var Gi=Ol.cwd,Er=Ol.env,IT=Ol.platform,zF=Ol.arch;var KF=65,qF=97,GF=90,jF=122,Nl=46,Ln=47,Io=92,ji=58,QF=63,$h=class extends Error{constructor(e,t,n){let o;typeof t=="string"&&t.indexOf("not ")===0?(o="must not be",t=t.replace(/^not /,"")):o="must be";let i=e.indexOf(".")!==-1?"property":"argument",s=`The "${e}" ${i} ${o} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}};function JF(r,e){if(r===null||typeof r!="object")throw new $h(e,"Object",r)}function rn(r,e){if(typeof r!="string")throw new $h(e,"string",r)}var xo=IT==="win32";function je(r){return r===Ln||r===Io}function ST(r){return r===Ln}function Qi(r){return r>=KF&&r<=GF||r>=qF&&r<=jF}function zh(r,e,t,n){let o="",i=0,s=-1,a=0,l=0;for(let d=0;d<=r.length;++d){if(d<r.length)l=r.charCodeAt(d);else{if(n(l))break;l=Ln}if(n(l)){if(!(s===d-1||a===1))if(a===2){if(o.length<2||i!==2||o.charCodeAt(o.length-1)!==Nl||o.charCodeAt(o.length-2)!==Nl){if(o.length>2){let c=o.lastIndexOf(t);c===-1?(o="",i=0):(o=o.slice(0,c),i=o.length-1-o.lastIndexOf(t)),s=d,a=0;continue}else if(o.length!==0){o="",i=0,s=d,a=0;continue}}e&&(o+=o.length>0?`${t}..`:"..",i=2)}else o.length>0?o+=`${t}${r.slice(s+1,d)}`:o=r.slice(s+1,d),i=d-s-1;s=d,a=0}else l===Nl&&a!==-1?++a:a=-1}return o}function XF(r){return r?`${r[0]==="."?"":"."}${r}`:""}function x0(r,e){JF(e,"pathObject");let t=e.dir||e.root,n=e.base||`${e.name||""}${XF(e.ext)}`;return t?t===e.root?`${t}${n}`:`${t}${r}${n}`:n}var jt={resolve(...r){let e="",t="",n=!1;for(let o=r.length-1;o>=-1;o--){let i;if(o>=0){if(i=r[o],rn(i,`paths[${o}]`),i.length===0)continue}else e.length===0?i=Gi():(i=Er[`=${e}`]||Gi(),(i===void 0||i.slice(0,2).toLowerCase()!==e.toLowerCase()&&i.charCodeAt(2)===Io)&&(i=`${e}\\`));let s=i.length,a=0,l="",d=!1,c=i.charCodeAt(0);if(s===1)je(c)&&(a=1,d=!0);else if(je(c))if(d=!0,je(i.charCodeAt(1))){let u=2,m=u;for(;u<s&&!je(i.charCodeAt(u));)u++;if(u<s&&u!==m){let g=i.slice(m,u);for(m=u;u<s&&je(i.charCodeAt(u));)u++;if(u<s&&u!==m){for(m=u;u<s&&!je(i.charCodeAt(u));)u++;(u===s||u!==m)&&(l=`\\\\${g}\\${i.slice(m,u)}`,a=u)}}}else a=1;else Qi(c)&&i.charCodeAt(1)===ji&&(l=i.slice(0,2),a=2,s>2&&je(i.charCodeAt(2))&&(d=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${i.slice(a)}\\${t}`,n=d,d&&e.length>0)break}return t=zh(t,!n,"\\",je),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(r){rn(r,"path");let e=r.length;if(e===0)return".";let t=0,n,o=!1,i=r.charCodeAt(0);if(e===1)return ST(i)?"\\":r;if(je(i))if(o=!0,je(r.charCodeAt(1))){let a=2,l=a;for(;a<e&&!je(r.charCodeAt(a));)a++;if(a<e&&a!==l){let d=r.slice(l,a);for(l=a;a<e&&je(r.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!je(r.charCodeAt(a));)a++;if(a===e)return`\\\\${d}\\${r.slice(l)}\\`;a!==l&&(n=`\\\\${d}\\${r.slice(l,a)}`,t=a)}}}else t=1;else Qi(i)&&r.charCodeAt(1)===ji&&(n=r.slice(0,2),t=2,e>2&&je(r.charCodeAt(2))&&(o=!0,t=3));let s=t<e?zh(r.slice(t),!o,"\\",je):"";if(s.length===0&&!o&&(s="."),s.length>0&&je(r.charCodeAt(e-1))&&(s+="\\"),!o&&n===void 0&&r.includes(":")){if(s.length>=2&&Qi(s.charCodeAt(0))&&s.charCodeAt(1)===ji)return`.\\${s}`;let a=r.indexOf(":");do if(a===e-1||je(r.charCodeAt(a+1)))return`.\\${s}`;while((a=r.indexOf(":",a+1))!==-1)}return n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(r){rn(r,"path");let e=r.length;if(e===0)return!1;let t=r.charCodeAt(0);return je(t)||e>2&&Qi(t)&&r.charCodeAt(1)===ji&&je(r.charCodeAt(2))},join(...r){if(r.length===0)return".";let e,t;for(let i=0;i<r.length;++i){let s=r[i];rn(s,"path"),s.length>0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof t=="string"&&je(t.charCodeAt(0))){++o;let i=t.length;i>1&&je(t.charCodeAt(1))&&(++o,i>2&&(je(t.charCodeAt(2))?++o:n=!1))}if(n){for(;o<e.length&&je(e.charCodeAt(o));)o++;o>=2&&(e=`\\${e.slice(o)}`)}return jt.normalize(e)},relative(r,e){if(rn(r,"from"),rn(e,"to"),r===e)return"";let t=jt.resolve(r),n=jt.resolve(e);if(t===n||(r=t.toLowerCase(),e=n.toLowerCase(),r===e))return"";if(t.length!==r.length||n.length!==e.length){let v=t.split("\\"),h=n.split("\\");v[v.length-1]===""&&v.pop(),h[h.length-1]===""&&h.pop();let x=v.length,S=h.length,T=x<S?x:S,P;for(P=0;P<T&&v[P].toLowerCase()===h[P].toLowerCase();P++);return P===0?n:P===T?S>T?h.slice(P).join("\\"):x>T?"..\\".repeat(x-1-P)+"..":"":"..\\".repeat(x-P)+h.slice(P).join("\\")}let o=0;for(;o<r.length&&r.charCodeAt(o)===Io;)o++;let i=r.length;for(;i-1>o&&r.charCodeAt(i-1)===Io;)i--;let s=i-o,a=0;for(;a<e.length&&e.charCodeAt(a)===Io;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===Io;)l--;let d=l-a,c=s<d?s:d,u=-1,m=0;for(;m<c;m++){let v=r.charCodeAt(o+m);if(v!==e.charCodeAt(a+m))break;v===Io&&(u=m)}if(m!==c){if(u===-1)return n}else{if(d>c){if(e.charCodeAt(a+m)===Io)return n.slice(a+m+1);if(m===2)return n.slice(a+m)}s>c&&(r.charCodeAt(o+m)===Io?u=m:m===2&&(u=3)),u===-1&&(u=0)}let g="";for(m=o+u+1;m<=i;++m)(m===i||r.charCodeAt(m)===Io)&&(g+=g.length===0?"..":"\\..");return a+=u,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Io&&++a,n.slice(a,l))},toNamespacedPath(r){if(typeof r!="string"||r.length===0)return r;let e=jt.resolve(r);if(e.length<=2)return r;if(e.charCodeAt(0)===Io){if(e.charCodeAt(1)===Io){let t=e.charCodeAt(2);if(t!==QF&&t!==Nl)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Qi(e.charCodeAt(0))&&e.charCodeAt(1)===ji&&e.charCodeAt(2)===Io)return`\\\\?\\${e}`;return e},dirname(r){rn(r,"path");let e=r.length;if(e===0)return".";let t=-1,n=0,o=r.charCodeAt(0);if(e===1)return je(o)?r:".";if(je(o)){if(t=n=1,je(r.charCodeAt(1))){let a=2,l=a;for(;a<e&&!je(r.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&je(r.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!je(r.charCodeAt(a));)a++;if(a===e)return r;a!==l&&(t=n=a+1)}}}}else Qi(o)&&r.charCodeAt(1)===ji&&(t=e>2&&je(r.charCodeAt(2))?3:2,n=t);let i=-1,s=!0;for(let a=e-1;a>=n;--a)if(je(r.charCodeAt(a))){if(!s){i=a;break}}else s=!1;if(i===-1){if(t===-1)return".";i=t}return r.slice(0,i)},basename(r,e){e!==void 0&&rn(e,"suffix"),rn(r,"path");let t=0,n=-1,o=!0,i;if(r.length>=2&&Qi(r.charCodeAt(0))&&r.charCodeAt(1)===ji&&(t=2),e!==void 0&&e.length>0&&e.length<=r.length){if(e===r)return"";let s=e.length-1,a=-1;for(i=r.length-1;i>=t;--i){let l=r.charCodeAt(i);if(je(l)){if(!o){t=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=r.length),r.slice(t,n)}for(i=r.length-1;i>=t;--i)if(je(r.charCodeAt(i))){if(!o){t=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":r.slice(t,n)},extname(r){rn(r,"path");let e=0,t=-1,n=0,o=-1,i=!0,s=0;r.length>=2&&r.charCodeAt(1)===ji&&Qi(r.charCodeAt(0))&&(e=n=2);for(let a=r.length-1;a>=e;--a){let l=r.charCodeAt(a);if(je(l)){if(!i){n=a+1;break}continue}o===-1&&(i=!1,o=a+1),l===Nl?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||o===-1||s===0||s===1&&t===o-1&&t===n+1?"":r.slice(t,o)},format:x0.bind(null,"\\"),parse(r){rn(r,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;let t=r.length,n=0,o=r.charCodeAt(0);if(t===1)return je(o)?(e.root=e.dir=r,e):(e.base=e.name=r,e);if(je(o)){if(n=1,je(r.charCodeAt(1))){let u=2,m=u;for(;u<t&&!je(r.charCodeAt(u));)u++;if(u<t&&u!==m){for(m=u;u<t&&je(r.charCodeAt(u));)u++;if(u<t&&u!==m){for(m=u;u<t&&!je(r.charCodeAt(u));)u++;u===t?n=u:u!==m&&(n=u+1)}}}}else if(Qi(o)&&r.charCodeAt(1)===ji){if(t<=2)return e.root=e.dir=r,e;if(n=2,je(r.charCodeAt(2))){if(t===3)return e.root=e.dir=r,e;n=3}}n>0&&(e.root=r.slice(0,n));let i=-1,s=n,a=-1,l=!0,d=r.length-1,c=0;for(;d>=n;--d){if(o=r.charCodeAt(d),je(o)){if(!l){s=d+1;break}continue}a===-1&&(l=!1,a=d+1),o===Nl?i===-1?i=d:c!==1&&(c=1):i!==-1&&(c=-1)}return a!==-1&&(i===-1||c===0||c===1&&i===a-1&&i===s+1?e.base=e.name=r.slice(s,a):(e.name=r.slice(s,i),e.base=r.slice(s,a),e.ext=r.slice(i,a))),s>0&&s!==n?e.dir=r.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},YF=(()=>{if(xo){let r=/\\/g;return()=>{let e=Gi().replace(r,"/");return e.slice(e.indexOf("/"))}}return()=>Gi()})(),Le={resolve(...r){let e="",t=!1;for(let n=r.length-1;n>=0&&!t;n--){let o=r[n];rn(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,t=o.charCodeAt(0)===Ln)}if(!t){let n=YF();e=`${n}/${e}`,t=n.charCodeAt(0)===Ln}return e=zh(e,!t,"/",ST),t?`/${e}`:e.length>0?e:"."},normalize(r){if(rn(r,"path"),r.length===0)return".";let e=r.charCodeAt(0)===Ln,t=r.charCodeAt(r.length-1)===Ln;return r=zh(r,!e,"/",ST),r.length===0?e?"/":t?"./":".":(t&&(r+="/"),e?`/${r}`:r)},isAbsolute(r){return rn(r,"path"),r.length>0&&r.charCodeAt(0)===Ln},join(...r){if(r.length===0)return".";let e=[];for(let t=0;t<r.length;++t){let n=r[t];rn(n,"path"),n.length>0&&e.push(n)}return e.length===0?".":Le.normalize(e.join("/"))},relative(r,e){if(rn(r,"from"),rn(e,"to"),r===e||(r=Le.resolve(r),e=Le.resolve(e),r===e))return"";let t=1,n=r.length,o=n-t,i=1,s=e.length-i,a=o<s?o:s,l=-1,d=0;for(;d<a;d++){let u=r.charCodeAt(t+d);if(u!==e.charCodeAt(i+d))break;u===Ln&&(l=d)}if(d===a)if(s>a){if(e.charCodeAt(i+d)===Ln)return e.slice(i+d+1);if(d===0)return e.slice(i+d)}else o>a&&(r.charCodeAt(t+d)===Ln?l=d:d===0&&(l=0));let c="";for(d=t+l+1;d<=n;++d)(d===n||r.charCodeAt(d)===Ln)&&(c+=c.length===0?"..":"/..");return`${c}${e.slice(i+l)}`},toNamespacedPath(r){return r},dirname(r){if(rn(r,"path"),r.length===0)return".";let e=r.charCodeAt(0)===Ln,t=-1,n=!0;for(let o=r.length-1;o>=1;--o)if(r.charCodeAt(o)===Ln){if(!n){t=o;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":r.slice(0,t)},basename(r,e){e!==void 0&&rn(e,"suffix"),rn(r,"path");let t=0,n=-1,o=!0,i;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e===r)return"";let s=e.length-1,a=-1;for(i=r.length-1;i>=0;--i){let l=r.charCodeAt(i);if(l===Ln){if(!o){t=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=r.length),r.slice(t,n)}for(i=r.length-1;i>=0;--i)if(r.charCodeAt(i)===Ln){if(!o){t=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":r.slice(t,n)},extname(r){rn(r,"path");let e=-1,t=0,n=-1,o=!0,i=0;for(let s=r.length-1;s>=0;--s){let a=r[s];if(a==="/"){if(!o){t=s+1;break}continue}n===-1&&(o=!1,n=s+1),a==="."?e===-1?e=s:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||n===-1||i===0||i===1&&e===n-1&&e===t+1?"":r.slice(e,n)},format:x0.bind(null,"/"),parse(r){rn(r,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;let t=r.charCodeAt(0)===Ln,n;t?(e.root="/",n=1):n=0;let o=-1,i=0,s=-1,a=!0,l=r.length-1,d=0;for(;l>=n;--l){let c=r.charCodeAt(l);if(c===Ln){if(!a){i=l+1;break}continue}s===-1&&(a=!1,s=l+1),c===Nl?o===-1?o=l:d!==1&&(d=1):o!==-1&&(d=-1)}if(s!==-1){let c=i===0&&t?1:i;o===-1||d===0||d===1&&o===s-1&&o===i+1?e.base=e.name=r.slice(c,s):(e.name=r.slice(c,o),e.base=r.slice(c,s),e.ext=r.slice(o,s))}return i>0?e.dir=r.slice(0,i-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Le.win32=jt.win32=jt;Le.posix=jt.posix=Le;var tr=xo?jt.normalize:Le.normalize,Ji=xo?jt.isAbsolute:Le.isAbsolute,Sc=xo?jt.join:Le.join,S0=xo?jt.resolve:Le.resolve,Xi=xo?jt.relative:Le.relative,li=xo?jt.dirname:Le.dirname,dn=xo?jt.basename:Le.basename,Yi=xo?jt.extname:Le.extname,Z9=xo?jt.format:Le.format,e8=xo?jt.parse:Le.parse,t8=xo?jt.toNamespacedPath:Le.toNamespacedPath,kn=xo?jt.sep:Le.sep,n8=xo?jt.delimiter:Le.delimiter;var ZF=/^\w[\w\d+.-]*$/,e2=/^\//,t2=/^\/\//;function n2(r,e){if(!r.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${r.authority}", path: "${r.path}", query: "${r.query}", fragment: "${r.fragment}"}`);if(r.scheme&&!ZF.test(r.scheme)){let t=[...r.scheme.matchAll(/[^\w\d+.-]/gu)],n=t.length>0?` Found '${t[0][0]}' at index ${t[0].index} (${t.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${r.scheme.length})`)}if(r.path){if(r.authority){if(!e2.test(r.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(t2.test(r.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function o2(r,e){return!r&&!e?"file":r}function r2(r,e){switch(r){case"https":case"http":case"file":e?e[0]!==wr&&(e=wr+e):e=wr;break}return e}var Nt="",wr="/",i2=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,y=class r{static isUri(e){return e instanceof r?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,n,o,i,s=!1){typeof e=="object"?(this.scheme=e.scheme||Nt,this.authority=e.authority||Nt,this.path=e.path||Nt,this.query=e.query||Nt,this.fragment=e.fragment||Nt):(this.scheme=o2(e,s),this.authority=t||Nt,this.path=r2(this.scheme,n||Nt),this.query=o||Nt,this.fragment=i||Nt,n2(this,s))}get fsPath(){return $m(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:o,query:i,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Nt),n===void 0?n=this.authority:n===null&&(n=Nt),o===void 0?o=this.path:o===null&&(o=Nt),i===void 0?i=this.query:i===null&&(i=Nt),s===void 0?s=this.fragment:s===null&&(s=Nt),t===this.scheme&&n===this.authority&&o===this.path&&i===this.query&&s===this.fragment?this:new na(t,n,o,i,s)}static parse(e,t=!1){let n=i2.exec(e);return n?new na(n[2]||Nt,Kh(n[4]||Nt),Kh(n[5]||Nt),Kh(n[7]||Nt),Kh(n[9]||Nt),t):new na(Nt,Nt,Nt,Nt,Nt)}static file(e){let t=Nt;if(Ct&&(e=e.replace(/\\/g,wr)),e[0]===wr&&e[1]===wr){let n=e.indexOf(wr,2);n===-1?(t=e.substring(2),e=wr):(t=e.substring(2,n),e=e.substring(n)||wr)}return new na("file",t,e,Nt,Nt)}static from(e,t){return new na(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return Ct&&e.scheme==="file"?n=r.file(jt.join($m(e,!0),...t)).path:n=Le.join(e.path,...t),e.with({path:n})}toString(e=!1){return CT(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof r)return e;{let t=new na(e);return t._formatted=e.external??null,t._fsPath=e._sep===E0?e.fsPath??null:null,t}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};function oa(r){return!r||typeof r!="object"?!1:typeof r.scheme=="string"&&(typeof r.authority=="string"||typeof r.authority>"u")&&(typeof r.path=="string"||typeof r.path>"u")&&(typeof r.query=="string"||typeof r.query>"u")&&(typeof r.fragment=="string"||typeof r.fragment>"u")}var E0=Ct?1:void 0,na=class extends y{constructor(){super(...arguments);this._formatted=null;this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=$m(this,!1)),this._fsPath}toString(t=!1){return t?CT(this,!0):(this._formatted||(this._formatted=CT(this,!1)),this._formatted)}toJSON(){let t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=E0),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}},w0={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function C0(r,e,t){let n,o=-1;for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)o!==-1&&(n+=encodeURIComponent(r.substring(o,i)),o=-1),n!==void 0&&(n+=r.charAt(i));else{n===void 0&&(n=r.substr(0,i));let a=w0[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(r.substring(o,i)),o=-1),n+=a):o===-1&&(o=i)}}return o!==-1&&(n+=encodeURIComponent(r.substring(o))),n!==void 0?n:r}function s2(r){let e;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);n===35||n===63?(e===void 0&&(e=r.substr(0,t)),e+=w0[n]):e!==void 0&&(e+=r[t])}return e!==void 0?e:r}function $m(r,e){let t;return r.authority&&r.path.length>1&&r.scheme==="file"?t=`//${r.authority}${r.path}`:r.path.charCodeAt(0)===47&&(r.path.charCodeAt(1)>=65&&r.path.charCodeAt(1)<=90||r.path.charCodeAt(1)>=97&&r.path.charCodeAt(1)<=122)&&r.path.charCodeAt(2)===58?e?t=r.path.substr(1):t=r.path[1].toLowerCase()+r.path.substr(2):t=r.path,Ct&&(t=t.replace(/\//g,"\\")),t}function CT(r,e){let t=e?s2:C0,n="",{scheme:o,authority:i,path:s,query:a,fragment:l}=r;if(o&&(n+=o,n+=":"),(i||o==="file")&&(n+=wr,n+=wr),i){let d=i.indexOf("@");if(d!==-1){let c=i.substr(0,d);i=i.substr(d+1),d=c.lastIndexOf(":"),d===-1?n+=t(c,!1,!1):(n+=t(c.substr(0,d),!1,!1),n+=":",n+=t(c.substr(d+1),!1,!0)),n+="@"}i=i.toLowerCase(),d=i.lastIndexOf(":"),d===-1?n+=t(i,!1,!0):(n+=t(i.substr(0,d),!1,!0),n+=i.substr(d))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){let d=s.charCodeAt(1);d>=65&&d<=90&&(s=`/${String.fromCharCode(d+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){let d=s.charCodeAt(0);d>=65&&d<=90&&(s=`${String.fromCharCode(d+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:C0(l,!1,!1)),n}function k0(r){try{return decodeURIComponent(r)}catch{return r.length>3?r.substr(0,3)+k0(r.substr(3)):r}}var T0=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Kh(r){return r.match(T0)?r.replace(T0,e=>k0(e)):r}var zm=class r{constructor(e){this._proxyIdentifierBrand=void 0;this.sid=e,this.nid=++r.count}static{this.count=0}},_0=[];function U(r){let e=new zm(r);return _0[e.nid]=e,e}function Km(r){return _0[r].sid}var Pt=class{constructor(e){this.value=e}};var TT=(o=>(o[o.None=0]="None",o[o.Process=1]="Process",o[o.Output=2]="Output",o[o.Hybrid=3]="Hybrid",o))(TT||{}),P0=class r{static{this._n=0}static mixin(e){return e._id=r._n++,e}};var N={MainThreadAuthentication:U("MainThreadAuthentication"),MainThreadBulkEdits:U("MainThreadBulkEdits"),MainThreadLanguageModels:U("MainThreadLanguageModels"),MainThreadEmbeddings:U("MainThreadEmbeddings"),MainThreadChatAgents2:U("MainThreadChatAgents2"),MainThreadCodeMapper:U("MainThreadCodeMapper"),MainThreadLanguageModelTools:U("MainThreadChatSkills"),MainThreadClipboard:U("MainThreadClipboard"),MainThreadCommands:U("MainThreadCommands"),MainThreadComments:U("MainThreadComments"),MainThreadConfiguration:U("MainThreadConfiguration"),MainThreadConsole:U("MainThreadConsole"),MainThreadDebugService:U("MainThreadDebugService"),MainThreadDecorations:U("MainThreadDecorations"),MainThreadDiagnostics:U("MainThreadDiagnostics"),MainThreadDialogs:U("MainThreadDiaglogs"),MainThreadDocuments:U("MainThreadDocuments"),MainThreadDocumentContentProviders:U("MainThreadDocumentContentProviders"),MainThreadTextEditors:U("MainThreadTextEditors"),MainThreadEditorInsets:U("MainThreadEditorInsets"),MainThreadEditorTabs:U("MainThreadEditorTabs"),MainThreadErrors:U("MainThreadErrors"),MainThreadTreeViews:U("MainThreadTreeViews"),MainThreadDownloadService:U("MainThreadDownloadService"),MainThreadLanguageFeatures:U("MainThreadLanguageFeatures"),MainThreadLanguages:U("MainThreadLanguages"),MainThreadLogger:U("MainThreadLogger"),MainThreadMessageService:U("MainThreadMessageService"),MainThreadOutputService:U("MainThreadOutputService"),MainThreadProgress:U("MainThreadProgress"),MainThreadQuickDiff:U("MainThreadQuickDiff"),MainThreadQuickOpen:U("MainThreadQuickOpen"),MainThreadStatusBar:U("MainThreadStatusBar"),MainThreadSecretState:U("MainThreadSecretState"),MainThreadStorage:U("MainThreadStorage"),MainThreadSpeech:U("MainThreadSpeechProvider"),MainThreadTelemetry:U("MainThreadTelemetry"),MainThreadMeteredConnection:U("MainThreadMeteredConnection"),MainThreadTerminalService:U("MainThreadTerminalService"),MainThreadTerminalShellIntegration:U("MainThreadTerminalShellIntegration"),MainThreadWebviews:U("MainThreadWebviews"),MainThreadWebviewPanels:U("MainThreadWebviewPanels"),MainThreadWebviewViews:U("MainThreadWebviewViews"),MainThreadCustomEditors:U("MainThreadCustomEditors"),MainThreadUrls:U("MainThreadUrls"),MainThreadUriOpeners:U("MainThreadUriOpeners"),MainThreadProfileContentHandlers:U("MainThreadProfileContentHandlers"),MainThreadWorkspace:U("MainThreadWorkspace"),MainThreadFileSystem:U("MainThreadFileSystem"),MainThreadFileSystemEventService:U("MainThreadFileSystemEventService"),MainThreadExtensionService:U("MainThreadExtensionService"),MainThreadSCM:U("MainThreadSCM"),MainThreadSearch:U("MainThreadSearch"),MainThreadShare:U("MainThreadShare"),MainThreadTask:U("MainThreadTask"),MainThreadWindow:U("MainThreadWindow"),MainThreadPower:U("MainThreadPower"),MainThreadLabelService:U("MainThreadLabelService"),MainThreadNotebook:U("MainThreadNotebook"),MainThreadNotebookDocuments:U("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:U("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:U("MainThreadNotebookKernels"),MainThreadNotebookRenderers:U("MainThreadNotebookRenderers"),MainThreadInteractive:U("MainThreadInteractive"),MainThreadTheming:U("MainThreadTheming"),MainThreadTunnelService:U("MainThreadTunnelService"),MainThreadManagedSockets:U("MainThreadManagedSockets"),MainThreadTimeline:U("MainThreadTimeline"),MainThreadTesting:U("MainThreadTesting"),MainThreadLocalization:U("MainThreadLocalizationShape"),MainThreadMcp:U("MainThreadMcpShape"),MainThreadAiRelatedInformation:U("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:U("MainThreadAiEmbeddingVector"),MainThreadChatStatus:U("MainThreadChatStatus"),MainThreadAiSettingsSearch:U("MainThreadAiSettingsSearch"),MainThreadDataChannels:U("MainThreadDataChannels"),MainThreadChatSessions:U("MainThreadChatSessions"),MainThreadChatOutputRenderer:U("MainThreadChatOutputRenderer"),MainThreadChatContext:U("MainThreadChatContext")},me={ExtHostCodeMapper:U("ExtHostCodeMapper"),ExtHostCommands:U("ExtHostCommands"),ExtHostConfiguration:U("ExtHostConfiguration"),ExtHostDiagnostics:U("ExtHostDiagnostics"),ExtHostDebugService:U("ExtHostDebugService"),ExtHostDecorations:U("ExtHostDecorations"),ExtHostDocumentsAndEditors:U("ExtHostDocumentsAndEditors"),ExtHostDocuments:U("ExtHostDocuments"),ExtHostDocumentContentProviders:U("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:U("ExtHostDocumentSaveParticipant"),ExtHostEditors:U("ExtHostEditors"),ExtHostTreeViews:U("ExtHostTreeViews"),ExtHostFileSystem:U("ExtHostFileSystem"),ExtHostFileSystemInfo:U("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:U("ExtHostFileSystemEventService"),ExtHostLanguages:U("ExtHostLanguages"),ExtHostLanguageFeatures:U("ExtHostLanguageFeatures"),ExtHostQuickOpen:U("ExtHostQuickOpen"),ExtHostQuickDiff:U("ExtHostQuickDiff"),ExtHostStatusBar:U("ExtHostStatusBar"),ExtHostShare:U("ExtHostShare"),ExtHostExtensionService:U("ExtHostExtensionService"),ExtHostLogLevelServiceShape:U("ExtHostLogLevelServiceShape"),ExtHostTerminalService:U("ExtHostTerminalService"),ExtHostTerminalShellIntegration:U("ExtHostTerminalShellIntegration"),ExtHostSCM:U("ExtHostSCM"),ExtHostSearch:U("ExtHostSearch"),ExtHostTask:U("ExtHostTask"),ExtHostWorkspace:U("ExtHostWorkspace"),ExtHostWindow:U("ExtHostWindow"),ExtHostPower:U("ExtHostPower"),ExtHostWebviews:U("ExtHostWebviews"),ExtHostWebviewPanels:U("ExtHostWebviewPanels"),ExtHostCustomEditors:U("ExtHostCustomEditors"),ExtHostWebviewViews:U("ExtHostWebviewViews"),ExtHostEditorInsets:U("ExtHostEditorInsets"),ExtHostEditorTabs:U("ExtHostEditorTabs"),ExtHostProgress:U("ExtHostProgress"),ExtHostComments:U("ExtHostComments"),ExtHostSecretState:U("ExtHostSecretState"),ExtHostStorage:U("ExtHostStorage"),ExtHostUrls:U("ExtHostUrls"),ExtHostUriOpeners:U("ExtHostUriOpeners"),ExtHostChatOutputRenderer:U("ExtHostChatOutputRenderer"),ExtHostProfileContentHandlers:U("ExtHostProfileContentHandlers"),ExtHostOutputService:U("ExtHostOutputService"),ExtHostLabelService:U("ExtHostLabelService"),ExtHostNotebook:U("ExtHostNotebook"),ExtHostNotebookDocuments:U("ExtHostNotebookDocuments"),ExtHostNotebookEditors:U("ExtHostNotebookEditors"),ExtHostNotebookKernels:U("ExtHostNotebookKernels"),ExtHostNotebookRenderers:U("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:U("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:U("ExtHostInteractive"),ExtHostChatAgents2:U("ExtHostChatAgents"),ExtHostLanguageModelTools:U("ExtHostChatSkills"),ExtHostChatProvider:U("ExtHostChatProvider"),ExtHostChatContext:U("ExtHostChatContext"),ExtHostSpeech:U("ExtHostSpeech"),ExtHostEmbeddings:U("ExtHostEmbeddings"),ExtHostAiRelatedInformation:U("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:U("ExtHostAiEmbeddingVector"),ExtHostAiSettingsSearch:U("ExtHostAiSettingsSearch"),ExtHostTheming:U("ExtHostTheming"),ExtHostTunnelService:U("ExtHostTunnelService"),ExtHostManagedSockets:U("ExtHostManagedSockets"),ExtHostAuthentication:U("ExtHostAuthentication"),ExtHostTimeline:U("ExtHostTimeline"),ExtHostTesting:U("ExtHostTesting"),ExtHostTelemetry:U("ExtHostTelemetry"),ExtHostMeteredConnection:U("ExtHostMeteredConnection"),ExtHostLocalization:U("ExtHostLocalization"),ExtHostMcp:U("ExtHostMcp"),ExtHostDataChannels:U("ExtHostDataChannels"),ExtHostChatSessions:U("ExtHostChatSessions")};var D0=Object.freeze(function(r,e){let t=setTimeout(r.bind(e),0);return{dispose(){clearTimeout(t)}}}),be;(n=>{function r(o){return o===n.None||o===n.Cancelled||o instanceof Cc?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=r,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Me.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D0})})(be||={});var Cc=class{constructor(){this._isCancelled=!1;this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?D0:(this._emitter||(this._emitter=new E),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Re=class{constructor(e){this._token=void 0;this._parentListener=void 0;this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Cc),this._token}cancel(){this._token?this._token instanceof Cc&&this._token.cancel():this._token=be.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Cc&&this._token.dispose():this._token=be.None}};function a2(r){return r}var qh=class{constructor(e,t){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=a2):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}};function ET(r){return r<0?0:r>255?255:r|0}function Ul(r){return r<0?0:r>4294967295?4294967295:r|0}function di(r){return!r||typeof r!="string"?!0:r.trim().length===0}var d2=/{(\d+)}/g;function O0(r,...e){return e.length===0?r:r.replace(d2,function(t,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?t:e[o]})}var c2=/{([^}]+)}/g;function PT(r,e){return Object.keys(e).length===0?r:r.replace(c2,(t,n)=>e[n]??t)}function or(r){return r.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N0(r,e){let t=0,n=r.indexOf(e);for(;n!==-1;)t++,n=r.indexOf(e,n+e.length);return t}function DT(r,e){if(!r||!e)return r;let t=e.length,n=0;if(t===1){let o=e.charCodeAt(0);for(;n<r.length&&r.charCodeAt(n)===o;)n++}else for(;r.startsWith(e,n);)n+=t;return r.substring(n)}function Fl(r,e){if(!r||!e)return r;let t=e.length,n=r.length;if(t===1){let i=n,s=e.charCodeAt(0);for(;i>0&&r.charCodeAt(i-1)===s;)i--;return r.substring(0,i)}let o=n;for(;o>0&&r.endsWith(e,o);)o-=t;return r.substring(0,o)}function U0(r,e,t={}){if(!r)throw new Error("Cannot create regex from empty string");e||(r=or(r)),t.wholeWord&&(/\B/.test(r.charAt(0))||(r="\\b"+r),/\B/.test(r.charAt(r.length-1))||(r=r+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(r,n)}function jh(r){return r.source==="^"||r.source==="^$"||r.source==="$"||r.source==="^\\s*$"?!1:!!(r.exec("")&&r.lastIndex===0)}function Qh(r){return r.split(/\r\n|\r|\n/)}function Jh(r){for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n!==32&&n!==9)return e}return-1}function F0(r,e=r.length-1){for(let t=e;t>=0;t--){let n=r.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function kr(r,e){return r<e?-1:r>e?1:0}function Xh(r,e,t=0,n=r.length,o=0,i=e.length){for(;t<n&&o<i;t++,o++){let l=r.charCodeAt(t),d=e.charCodeAt(o);if(l<d)return-1;if(l>d)return 1}let s=n-t,a=i-o;return s<a?-1:s>a?1:0}function qm(r,e){return Hl(r,e,0,r.length,0,e.length)}function Hl(r,e,t=0,n=r.length,o=0,i=e.length){for(;t<n&&o<i;t++,o++){let l=r.charCodeAt(t),d=e.charCodeAt(o);if(l===d)continue;if(l>=128||d>=128)return Xh(r.toLowerCase(),e.toLowerCase(),t,n,o,i);R0(l)&&(l-=32),R0(d)&&(d-=32);let c=l-d;if(c!==0)return c}let s=n-t,a=i-o;return s<a?-1:s>a?1:0}function R0(r){return r>=97&&r<=122}function Nn(r,e){return r.length===e.length&&Hl(r,e)===0}function Yh(r,e,t){return r===e||!!t&&r!==void 0&&e!==void 0&&Nn(r,e)}function ra(r,e){let t=e.length;return t<=r.length&&Hl(r,e,0,t)===0}function H0(r,e){let t=r.length,n=t-e.length;return n>=0&&Hl(r,e,n,t)===0}function V0(r,e){let t=Math.min(r.length,e.length),n;for(n=0;n<t;n++)if(r.charCodeAt(n)!==e.charCodeAt(n))return n;return t}function Vl(r){return 55296<=r&&r<=56319}function Gm(r){return 56320<=r&&r<=57343}function Zh(r,e){return(r-55296<<10)+(e-56320)+65536}function RT(r,e,t){let n=r.charCodeAt(t);if(Vl(n)&&t+1<e){let o=r.charCodeAt(t+1);if(Gm(o))return Zh(n,o)}return n}function u2(r,e){let t=r.charCodeAt(e-1);if(Gm(t)&&e>1){let n=r.charCodeAt(e-2);if(Vl(n))return Zh(n,t)}return t}var kT=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=u2(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=RT(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}},_T=class{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new kT(e,t)}nextGraphemeLength(){let e=Gh.getInstance(),t=this._iterator,n=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let i=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(M0(o,s)){t.setOffset(i);break}o=s}return t.offset-n}prevGraphemeLength(){let e=Gh.getInstance(),t=this._iterator,n=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let i=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(M0(s,o)){t.setOffset(i);break}o=s}return n-t.offset}eol(){return this._iterator.eol()}};function MT(r,e){return new _T(r,e).nextGraphemeLength()}var wT;function p2(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function ev(r){return wT||(wT=p2()),wT.test(r)}var m2=/^[\t\n\r\x20-\x7E]*$/;function B0(r){return m2.test(r)}var g2=/[\u2028\u2029]/;function tv(r){return g2.test(r)}var f2=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,h2=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,v2=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,T8=new RegExp("(?:"+[f2.source,h2.source,v2.source].join("|")+")","g");var W0=String.fromCharCode(65279);function $0(r){return!!(r&&r.length>0&&r.charCodeAt(0)===65279)}function AT(r,e=!1){return r?(e&&(r=r.replace(/\\./g,"")),r.toLowerCase()!==r):!1}function z0(r,e=1){if(e===0)return"";let t=-1;do t=r.indexOf(`
`,t+1),e--;while(e>0&&t>=0);return t===-1?r:(r[t-1]==="\r"&&t--,r.substr(0,t))}function M0(r,e){return r===0?e!==5&&e!==7:r===2&&e===3?!1:r===4||r===2||r===3||e===4||e===2||e===3?!0:!(r===8&&(e===8||e===9||e===11||e===12)||(r===11||r===9)&&(e===9||e===10)||(r===12||r===10)&&e===10||e===5||e===13||e===7||r===1||r===13&&e===14||r===6&&e===6)}var Gh=class r{static{this._INSTANCE=null}static getInstance(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this._data=b2()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let t=this._data,n=t.length/3,o=1;for(;o<=n;)if(e<t[3*o])o=2*o;else if(e>t[3*o+1])o=2*o+1;else return t[3*o+2];return 0}};function b2(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}var A0=class r{constructor(e){this.confusableDictionary=e}static{this.ambiguousCharacterData=new dt(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new qh(e=>{let t=e.split(",");function n(u){let m=new Map;for(let g=0;g<u.length;g+=2)m.set(u[g],u[g+1]);return m}function o(u,m){let g=new Map(u);for(let[v,h]of m)g.set(v,h);return g}function i(u,m){if(!u)return m;let g=new Map;for(let[v,h]of u)m.has(v)&&g.set(v,h);return g}let s=this.ambiguousCharacterData.value,a=t.filter(u=>!u.startsWith("_")&&Object.hasOwn(s,u));a.length===0&&(a=["_default"]);let l;for(let u of a){let m=n(s[u]);l=i(l,m)}let d=n(s._common),c=o(d,l);return new r(c)})}static getInstance(e){return r.cache.get(Array.from(e).join(","))}static{this._locales=new dt(()=>Object.keys(r.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return r._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(typeof n=="number"&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},L0=class r{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(r.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return r.getData().has(e)}static containsInvisibleCharacter(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(typeof n=="number"&&(r.isInvisibleCharacter(n)||n===32))return!0}return!1}static get codePoints(){return r.getData()}};function ia(r){return r===47||r===92}function nv(r){return r.replace(/[\\/]/g,Le.sep)}function K0(r){return r.indexOf("/")===-1&&(r=nv(r)),/^[a-zA-Z]:(\/|$)/.test(r)&&(r="/"+r),r}function LT(r,e=Le.sep){if(!r)return"";let t=r.length,n=r.charCodeAt(0);if(ia(n)){if(ia(r.charCodeAt(1))&&!ia(r.charCodeAt(2))){let i=3,s=i;for(;i<t&&!ia(r.charCodeAt(i));i++);if(s!==i&&!ia(r.charCodeAt(i+1))){for(i+=1;i<t;i++)if(ia(r.charCodeAt(i)))return r.slice(0,i+1).replace(/[\\/]/g,e)}}return e}else if(G0(n)&&r.charCodeAt(1)===58)return ia(r.charCodeAt(2))?r.slice(0,2)+e:r.slice(0,2);let o=r.indexOf("://");if(o!==-1){for(o+=3;o<t;o++)if(ia(r.charCodeAt(o)))return r.slice(0,o+1)}return""}var y2=/[\\/:\*\?"<>\|]/g,I2=/[/]/g,x2=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function q0(r,e=Ct){let t=e?y2:I2;return!(!r||r.length===0||/^\s+$/.test(r)||(t.lastIndex=0,t.test(r))||e&&x2.test(r)||r==="."||r===".."||e&&r[r.length-1]==="."||e&&r.length!==r.trim().length||r.length>255)}function Bl(r,e,t,n=kn){if(r===e)return!0;if(!r||!e||e.length>r.length)return!1;if(t){if(!ra(r,e))return!1;if(e.length===r.length)return!0;let i=e.length;return e.charAt(e.length-1)===n&&i--,r.charAt(i)===n}return e.charAt(e.length-1)!==n&&(e+=n),r.indexOf(e)===0}function G0(r){return r>=65&&r<=90||r>=97&&r<=122}function j0(r,e=Ct){return e?G0(r.charCodeAt(0))&&r.charCodeAt(1)===58:!1}var $;(he=>(he.inMemory="inmemory",he.vscode="vscode",he.internal="private",he.walkThrough="walkThrough",he.walkThroughSnippet="walkThroughSnippet",he.http="http",he.https="https",he.file="file",he.mailto="mailto",he.untitled="untitled",he.data="data",he.command="command",he.vscodeRemote="vscode-remote",he.vscodeRemoteResource="vscode-remote-resource",he.vscodeManagedRemoteResource="vscode-managed-remote-resource",he.vscodeUserData="vscode-userdata",he.vscodeCustomEditor="vscode-custom-editor",he.vscodeNotebookCell="vscode-notebook-cell",he.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",he.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",he.vscodeNotebookCellOutput="vscode-notebook-cell-output",he.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",he.vscodeNotebookMetadata="vscode-notebook-metadata",he.vscodeInteractiveInput="vscode-interactive-input",he.vscodeSettings="vscode-settings",he.vscodeWorkspaceTrust="vscode-workspace-trust",he.vscodeTerminal="vscode-terminal",he.vscodeChatCodeBlock="vscode-chat-code-block",he.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",he.vscodeChatEditor="vscode-chat-editor",he.vscodeChatInput="chatSessionInput",he.vscodeLocalChatSession="vscode-chat-session",he.webviewPanel="webview-panel",he.vscodeWebview="vscode-webview",he.vscodeBrowser="vscode-browser",he.extension="extension",he.vscodeFileResource="vscode-file",he.tmp="tmp",he.vsls="vsls",he.vscodeSourceControl="vscode-scm",he.commentsInput="comment",he.codeSetting="code-setting",he.outputChannel="output",he.accessibleView="accessible-view",he.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",he.chatEditingModel="chat-editing-text-model",he.copilotPr="copilot-pr"))($||={});function ov(r,e){return y.isUri(r)?Nn(r.scheme,e):ra(r,e+":")}function J0(r,...e){return e.some(t=>ov(r,t))}var S2="tkn",OT=class{constructor(){this._hosts=Object.create(null);this._ports=Object.create(null);this._connectionTokens=Object.create(null);this._preferredWebSchema="http";this._delegate=null;this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=Le.join(t??"/",T2(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Le.join(this._serverRootPath,$.vscodeRemoteResource)}set(e,t,n){this._hosts[e]=t,this._ports[e]=n}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return ct(a),e}let t=e.authority,n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[t],i=this._connectionTokens[t],s=`path=${encodeURIComponent(e.path)}`;return typeof i=="string"&&(s+=`&${S2}=${encodeURIComponent(i)}`),y.from({scheme:Uo?this._preferredWebSchema:$.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:s})}},C2=new OT;function T2(r){return`${r.quality??"oss"}-${r.commit??"dev"}`}var X0="vs/../../node_modules",Y0="vs/../../node_modules.asar";var UT="vscode-app",NT=class r{static{this.FALLBACK_AUTHORITY=UT}asBrowserUri(e){let t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===$.vscodeRemote?C2.rewrite(e):e.scheme===$.file&&(Hh||h0===`${$.vscodeFileResource}://${r.FALLBACK_AUTHORITY}`)?e.with({scheme:$.vscodeFileResource,authority:e.authority||r.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let t=this.toUri(e);return this.uriToFileUri(t)}uriToFileUri(e){return e.scheme===$.vscodeFileResource?e.with({scheme:$.file,authority:e.authority!==r.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(y.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let t=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(t))return y.joinPath(y.parse(t,!0),e);let n=Sc(t,e);return y.file(n)}throw new Error("Cannot determine URI for module id!")}},rv=new NT,M8=Object.freeze({"Cache-Control":"no-cache, no-store"}),A8=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"}),E2;(i=>{let r=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(r.get("3"));let t="vscode-coi";function n(s){let a;typeof s=="string"?a=new URL(s).searchParams:s instanceof URL?a=s.searchParams:y.isUri(s)&&(a=new URL(s.toString(!0)).searchParams);let l=a?.get(t);if(l)return r.get(l)}i.getHeadersFromQuery=n;function o(s,a,l){if(!globalThis.crossOriginIsolated)return;let d=a&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(t,d):s[t]=d}i.addSearchParam=o})(E2||={});function rr(r){return $m(r,!0)}var ui=class{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:kr(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}ignorePathCasing(e){return this._ignorePathCasing(e)}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===$.file)return Bl(rr(e),rr(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(Z0(e.authority,t.authority))return Bl(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return y.joinPath(e,...t)}basenameOrAuthority(e){return Bt(e)||e.authority}basename(e){return Le.basename(e.path)}extname(e){return Le.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===$.file?t=y.file(li(rr(e))).path:(t=Le.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===$.file?t=y.file(tr(rr(e))).path:t=Le.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Z0(e.authority,t.authority))return;if(e.scheme===$.file){let i=Xi(rr(e),rr(t));return Ct?nv(i):i}let n=e.path||"/",o=t.path||"/";if(this._ignorePathCasing(e)){let i=0;for(let s=Math.min(n.length,o.length);i<s&&!(n.charCodeAt(i)!==o.charCodeAt(i)&&n.charAt(i).toLowerCase()!==o.charAt(i).toLowerCase());i++);n=o.substr(0,i)+n.substr(i)}return Le.relative(n,o)}resolvePath(e,t){if(e.scheme===$.file){let n=y.file(S0(rr(e),t));return e.with({authority:n.authority,path:n.path})}return t=K0(t),e.with({path:Le.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&Nn(e,t)}hasTrailingPathSeparator(e,t=kn){if(e.scheme===$.file){let n=rr(e);return n.length>LT(n).length&&n[n.length-1]===t}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=kn){return eM(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=kn){let n=!1;if(e.scheme===$.file){let o=rr(e);n=o!==void 0&&o.length===LT(o).length&&o[o.length-1]===t}else{t="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!eM(e,t)?e.with({path:e.path+"/"}):e}},tt=new ui(()=>!1),FT=new ui(r=>r.scheme===$.file?!An:!0),HT=new ui(r=>!0),_r=tt.isEqual.bind(tt),w2=tt.isEqualOrParent.bind(tt),V8=tt.getComparisonKey.bind(tt),jm=tt.basenameOrAuthority.bind(tt),Bt=tt.basename.bind(tt),VT=tt.extname.bind(tt),es=tt.dirname.bind(tt),Ut=tt.joinPath.bind(tt),B8=tt.normalizePath.bind(tt),Qm=tt.relativePath.bind(tt),W8=tt.resolvePath.bind(tt),tM=tt.isAbsolutePath.bind(tt),Z0=tt.isEqualAuthority.bind(tt),eM=tt.hasTrailingPathSeparator.bind(tt),$8=tt.removeTrailingPathSeparator.bind(tt),z8=tt.addTrailingPathSeparator.bind(tt);var k2;(i=>{i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function o(s){let a=new Map;s.path.substring(s.path.indexOf(";")+1,s.path.lastIndexOf(";")).split(";").forEach(c=>{let[u,m]=c.split(":");u&&m&&a.set(u,m)});let d=s.path.substring(0,s.path.indexOf(";"));return d&&a.set(i.META_DATA_MIME,d),a}i.parseMetaData=o})(k2||={});var nM=Symbol("MicrotaskDelay");function ir(r){return!!r&&typeof r.then=="function"}function _2(r){let e=new Re,t=r(e.token),n=!1,o=new Promise((i,s)=>{let a=e.token.onCancellationRequested(()=>{n=!0,a.dispose(),s(new xt)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),n?Ph(l)&&l.dispose():i(l)},l=>{a.dispose(),e.dispose(),s(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(i,s){return o.then(i,s)}catch(i){return this.then(void 0,i)}finally(i){return o.finally(i)}}}function pv(r,e,t){return new Promise((n,o)=>{let i=e.onCancellationRequested(()=>{i.dispose(),n(t)});r.then(n,o).finally(()=>i.dispose())})}function kc(r,e){return new Promise((t,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new xt)});r.then(t,n).finally(()=>o.dispose())})}function Qt(r){return new Promise((e,t)=>{let n=r();ir(n)?n.then(e,t):e(n)})}function GT(){let r,e;return{promise:new Promise((n,o)=>{r=n,e=o}),resolve:r,reject:e}}var BT=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new Re}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let t=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((t,n)=>{this.activePromise.then(o=>{this.activePromise=null,t(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}},av=class{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}},sa=class{constructor(){this.promiseMap=new Map}queue(e,t){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}},P2=(r,e)=>{let t=!0,n=setTimeout(()=>{t=!1,e()},r);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},D2=r=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,r())}),{isTriggered:()=>e,dispose:()=>{e=!1}}},WT=class{constructor(e){this.defaultDelay=e;this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,i)=>{this.doResolve=o,this.doReject=i}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===nM?D2(n):P2(t,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new xt),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},Tc=class{constructor(e){this.delayer=new WT(e),this.throttler=new BT}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},yn=class{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};function cn(r,e){return e?new Promise((t,n)=>{let o=setTimeout(()=>{i.dispose(),t()},r),i=e.onCancellationRequested(()=>{clearTimeout(o),i.dispose(),n(new xt)})}):_2(t=>cn(r,t))}function oM(r,e=0,t){let n=setTimeout(()=>{r(),t&&o.dispose()},e),o=J(()=>{clearTimeout(n),t?.delete(o)});return t?.add(o),o}var $T=class{constructor(e){this._size=0;this._isDisposed=!1;this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new E}whenIdle(){return this.size>0?Me.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((t,n)=>{this.outstandingPromises.push({factory:e,c:t,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let e=this.outstandingPromises.shift();this.runningPromises++;let t=e.factory();t.then(e.c,e.e),t.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},zT=class extends $T{constructor(){super(1)}};var lv=class{constructor(){this.queues=new Map;this.drainers=new Set;this.drainListeners=void 0;this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new _n;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=tt){let n=t.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,t,n=tt){let o=n.getComparisonKey(e),i=this.queues.get(o);if(!i){i=new zT;let s=this.drainListenerCount++,a=Me.once(i.onDrained)(()=>{i?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(s),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Oo),this.drainListeners.set(s,a),this.queues.set(o,i)}return i.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};var dv=class{constructor(){this.disposable=void 0;this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new St("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},t);this.disposable=J(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Xn=class{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};var jT,sv;(function(){let r=globalThis;typeof r.requestIdleCallback!="function"||typeof r.cancelIdleCallback!="function"?sv=(e,t,n)=>{Vh(()=>{if(o)return;let i=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:sv=(e,t,n)=>{let o=e.requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(o))}}},jT=(e,t)=>sv(globalThis,e,t)})();var KT=class{constructor(e,t){this._didRun=!1;this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=sv(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},cv=class extends KT{constructor(e){super(globalThis,e)}};var _n=class r{static fromPromise(e){let t=new r;return t.settleWith(e),t}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}settleWith(e){return e.then(t=>this.complete(t),t=>this.error(t))}cancel(){return this.error(new xt)}},aa;(t=>{async function r(n){let o,i=await Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o<"u")throw o;return i}t.settled=r;function e(n){return new Promise(async(o,i)=>{try{await n(o,i)}catch(s){i(s)}})}t.withAsyncBody=e})(aa||={});var Ec=class r{static fromArray(e){return new r(t=>{t.emitMany(e)})}static fromPromise(e){return new r(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new r(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new r(async t=>{await Promise.all(e.map(async n=>{for await(let o of n)t.emitOne(o)}))})}static{this.EMPTY=r.fromArray([])}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new E,queueMicrotask(async()=>{let n={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Me.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new r(async n=>{for await(let o of e)n.emitOne(t(o))})}map(e){return r.map(this,e)}static filter(e,t){return new r(async n=>{for await(let o of e)t(o)&&n.emitOne(o)})}filter(e){return r.filter(this,e)}static coalesce(e){return r.filter(e,t=>!!t)}coalesce(){return r.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return r.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};var uv=class{constructor(e){this._deferred=new _n;this._asyncIterable=new Ec(o=>{if(t){o.reject(t);return}return n&&o.emitMany(n),this._errorFn=i=>o.reject(i),this._emitOneFn=i=>o.emitOne(i),this._emitManyFn=i=>o.emitMany(i),this._deferred.p},e);let t,n;this._errorFn=o=>{t||(t=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(i=>n.push(i)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};var qT=class{constructor(){this._unsatisfiedConsumers=[];this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new St("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new _n;return this._unsatisfiedConsumers.push(e),e.p}}},wc=class r{constructor(e,t){this._onReturn=t;this._producerConsumer=new qT;this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})};queueMicrotask(async()=>{let n=e({emitOne:o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),emitMany:o=>{for(let i of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}})},reject:o=>this._finishError(o)});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new r(t=>{t.emitMany(e)})}static fromPromise(e){return new r(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new r(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new r(async t=>{await Promise.all(e.map(async n=>{for await(let o of n)t.emitOne(o)}))})}static{this.EMPTY=r.fromArray([])}static map(e,t){return new r(async n=>{for await(let o of e)n.emitOne(t(o))})}static tee(e){let t,n,o=new _n,i=async()=>{if(!(!t||!n))try{for await(let l of e)t.emitOne(l),n.emitOne(l)}catch(l){t.reject(l),n.reject(l)}finally{o.complete()}},s=new r(async l=>(t=l,i(),o.p)),a=new r(async l=>(n=l,i(),o.p));return[s,a]}map(e){return r.map(this,e)}static coalesce(e){return r.filter(e,t=>!!t)}coalesce(){return r.coalesce(this)}static filter(e,t){return new r(async n=>{for await(let o of e)t(o)&&n.emitOne(o)})}filter(e){return r.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};var c$=new class{transformIncoming(r){return r}transformOutgoing(r){return r}transformOutgoingURI(r){return r}transformOutgoingScheme(r){return r}};function rM(r,e,t,n){if(!r||n>200)return null;if(typeof r=="object"){if(r.$mid===1)return t?y.revive(e.transformIncoming(r)):e.transformIncoming(r);if(r instanceof ee)return null;for(let o in r)if(Object.hasOwnProperty.call(r,o)){let i=rM(r[o],e,t,n+1);i!==null&&(r[o]=i)}}return null}function _c(r,e){let t=rM(r,e,!1,0);return t===null?r:t}var Jm=class{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||(this._actual=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)})),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):ct(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}},mv=class extends Jm{constructor(){super(),this._hasErr=!0,this._err=new xt}};function QT(r,e){try{return JSON.stringify(r,e)}catch{return"null"}}var XT="$$ref$$",R2={[XT]:-1};function iM(r,e=null,t=!1){let n=[];return{jsonString:(t?QT:JSON.stringify)(r,(i,s)=>{if(typeof s>"u")return R2;if(typeof s=="object"){if(s instanceof ee){let a=n.push(s)-1;return{[XT]:a}}if(e)return e(i,s)}return s}),referencedBuffers:n}}function dM(r,e,t){return JSON.parse(r,(n,o)=>{if(o){let i=o[XT];if(typeof i=="number")return e[i];if(t&&o.$mid===1)return t.transformIncoming(o)}return o})}function sM(r,e){return JSON.stringify(r,e)}function M2(r){return r?(e,t)=>t&&t.$mid===1?r.transformOutgoing(t):t:null}var A2=()=>{},L2=Symbol.for("rpcProtocol"),O2=Symbol.for("rpcProxy"),aM,lM,gv=class r extends(lM=H,aM=L2,lM){constructor(t,n=null,o=null){super();this[aM]=!0;this._onDidChangeResponsiveState=this._register(new E);this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event;this._protocol=t,this._logger=n,this._uriTransformer=o,this._uriReplacer=M2(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let i=0,s=zm.count;i<s;i++)this._locals[i]=null,this._proxies[i]=null;this._lastMessageId=0,this._cancelInvokedHandlers=Object.create(null),this._pendingRPCReplies={},this._responsiveState=0,this._unacknowledgedCount=0,this._unresponsiveTime=0,this._asyncCheckUresponsive=this._register(new Xn(()=>this._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(i=>this._receiveOneMessage(i)))}static{this.UNRESPONSIVE_TIME=3*1e3}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(t=>{let n=this._pendingRPCReplies[t];delete this._pendingRPCReplies[t],n.resolveErr(zC())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(t){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+r.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(t){this._unresponsiveTime=Date.now()+r.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(0)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(1):this._asyncCheckUresponsive.schedule())}_setResponsiveState(t){this._responsiveState!==t&&(this._responsiveState=t,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(t){return this._uriTransformer?_c(t,this._uriTransformer):t}getProxy(t){let{nid:n,sid:o}=t;return this._proxies[n]||(this._proxies[n]=this._createProxy(n,o)),this._proxies[n]}_createProxy(t,n){let o={get:(i,s)=>(typeof s=="string"&&!i[s]&&s.charCodeAt(0)===36&&(i[s]=(...a)=>this._remoteCall(t,s,a)),s===O2?n:i[s])};return new Proxy(Object.create(null),o)}set(t,n){return this._locals[t.nid]=n,n}assertRegistered(t){for(let n=0,o=t.length;n<o;n++){let i=t[n];if(!this._locals[i.nid])throw new Error(`Missing proxy instance ${i.sid}`)}}_receiveOneMessage(t){if(this._isDisposed)return;let n=t.byteLength,o=Jt.read(t,0),i=o.readUInt8(),s=o.readUInt32();switch(i){case 1:case 2:{let{rpcId:a,method:l,args:d}=So.deserializeRequestJSONArgs(o);this._uriTransformer&&(d=_c(d,this._uriTransformer)),this._receiveRequest(n,s,a,l,d,i===2);break}case 3:case 4:{let{rpcId:a,method:l,args:d}=So.deserializeRequestMixedArgs(o);this._uriTransformer&&(d=_c(d,this._uriTransformer)),this._receiveRequest(n,s,a,l,d,i===4);break}case 5:{this._logger?.logIncoming(n,s,0,"ack"),this._onDidReceiveAcknowledge(s);break}case 6:{this._receiveCancel(n,s);break}case 7:{this._receiveReply(n,s,void 0);break}case 9:{let a=So.deserializeReplyOKJSON(o);this._uriTransformer&&(a=_c(a,this._uriTransformer)),this._receiveReply(n,s,a);break}case 10:{let a=So.deserializeReplyOKJSONWithBuffers(o,this._uriTransformer);this._receiveReply(n,s,a);break}case 8:{let a=So.deserializeReplyOKVSBuffer(o);this._receiveReply(n,s,a);break}case 11:{let a=So.deserializeReplyErrError(o);this._uriTransformer&&(a=_c(a,this._uriTransformer)),this._receiveReplyErr(n,s,a);break}case 12:{this._receiveReplyErr(n,s,void 0);break}default:console.error("received unexpected message"),console.error(t)}}_receiveRequest(t,n,o,i,s,a){this._logger?.logIncoming(t,n,1,`receiveRequest ${Km(o)}.${i}(`,s);let l=String(n),d,c;if(a){let m=new Re;s.push(m.token),d=this._invokeHandler(o,i,s),c=()=>m.cancel()}else d=this._invokeHandler(o,i,s),c=A2;this._cancelInvokedHandlers[l]=c;let u=So.serializeAcknowledged(n);this._logger?.logOutgoing(u.byteLength,n,1,"ack"),this._protocol.send(u),d.then(m=>{delete this._cancelInvokedHandlers[l];let g=So.serializeReplyOK(n,m,this._uriReplacer);this._logger?.logOutgoing(g.byteLength,n,1,"reply:",m),this._protocol.send(g)},m=>{delete this._cancelInvokedHandlers[l];let g=So.serializeReplyErr(n,m);this._logger?.logOutgoing(g.byteLength,n,1,"replyErr:",m),this._protocol.send(g)})}_receiveCancel(t,n){this._logger?.logIncoming(t,n,1,"receiveCancel");let o=String(n);this._cancelInvokedHandlers[o]?.()}_receiveReply(t,n,o){this._logger?.logIncoming(t,n,0,"receiveReply:",o);let i=String(n);if(!this._pendingRPCReplies.hasOwnProperty(i))return;let s=this._pendingRPCReplies[i];delete this._pendingRPCReplies[i],s.resolveOk(o)}_receiveReplyErr(t,n,o){this._logger?.logIncoming(t,n,0,"receiveReplyErr:",o);let i=String(n);if(!this._pendingRPCReplies.hasOwnProperty(i))return;let s=this._pendingRPCReplies[i];delete this._pendingRPCReplies[i];let a;o&&(o.$isError?(a=new Error,a.name=o.name,a.message=o.message,a.stack=o.stack):a=o),s.resolveErr(a)}_invokeHandler(t,n,o){try{return Promise.resolve(this._doInvokeHandler(t,n,o))}catch(i){return Promise.reject(i)}}_doInvokeHandler(t,n,o){let i=this._locals[t];if(!i)throw new Error("Unknown actor "+Km(t));let s=i[n];if(typeof s!="function")throw new Error("Unknown method "+n+" on actor "+Km(t));return s.apply(i,o)}_remoteCall(t,n,o){if(this._isDisposed)return new mv;let i=null;if(o.length>0&&be.isCancellationToken(o[o.length-1])&&(i=o.pop()),i&&i.isCancellationRequested)return Promise.reject(zC());let s=So.serializeRequestArguments(o,this._uriReplacer),a=++this._lastMessageId,l=String(a),d=new Jm,c=new q;i&&c.add(i.onCancellationRequested(()=>{let m=So.serializeCancel(a);this._logger?.logOutgoing(m.byteLength,a,0,"cancel"),this._protocol.send(m)})),this._pendingRPCReplies[l]=new JT(d,c),this._onWillSendRequest(a);let u=So.serializeRequest(a,t,n,s,!!i);return this._logger?.logOutgoing(u.byteLength,a,0,`request: ${Km(t)}.${n}(`,o),this._protocol.send(u),d}},JT=class{constructor(e,t){this._promise=e;this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}},Jt=class r{static alloc(e,t,n){let o=new r(ee.alloc(n+1+4),0);return o.writeUInt8(e),o.writeUInt32(t),o}static read(e,t){return new r(e,t)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}static{this.sizeUInt32=4}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){let e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){let e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let n=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,n}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let n=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,n}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let n=0,o=e.length;n<o;n++){let i=e[n];switch(t+=1,i.type){case 1:t+=this.sizeLongString(i.value);break;case 2:t+=this.sizeVSBuffer(i.value);break;case 3:t+=this.sizeUInt32,t+=this.sizeLongString(i.value);for(let s=0;s<i.buffers.length;++s)t+=this.sizeVSBuffer(i.buffers[s]);break;case 4:break}}return t}writeMixedArray(e){this._buff.writeUInt8(e.length,this._offset),this._offset+=1;for(let t=0,n=e.length;t<n;t++){let o=e[t];switch(o.type){case 1:this.writeUInt8(1),this.writeLongString(o.value);break;case 2:this.writeUInt8(2),this.writeVSBuffer(o.value);break;case 3:this.writeUInt8(3),this.writeUInt32(o.buffers.length),this.writeLongString(o.value);for(let i=0;i<o.buffers.length;++i)this.writeBuffer(o.buffers[i]);break;case 4:this.writeUInt8(4);break}}}readMixedArray(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let t=new Array(e);for(let n=0;n<e;n++)switch(this.readUInt8()){case 1:t[n]=this.readLongString();break;case 2:t[n]=this.readVSBuffer();break;case 3:{let i=this.readUInt32(),s=this.readLongString(),a=[];for(let l=0;l<i;++l)a.push(this.readVSBuffer());t[n]=new Pt(dM(s,a,null));break}case 4:t[n]=void 0;break}return t}};var So=class{static _useMixedArgSerialization(e){for(let t=0,n=e.length;t<n;t++)if(e[t]instanceof ee||e[t]instanceof Pt||typeof e[t]>"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){let n=[];for(let o=0,i=e.length;o<i;o++){let s=e[o];if(s instanceof ee)n[o]={type:2,value:s};else if(typeof s>"u")n[o]={type:4};else if(s instanceof Pt){let{jsonString:a,referencedBuffers:l}=iM(s.value,t);n[o]={type:3,value:ee.fromString(a),buffers:l}}else n[o]={type:1,value:ee.fromString(sM(s,t))}}return{type:1,args:n}}return{type:0,args:sM(e,t)}}static serializeRequest(e,t,n,o,i){switch(o.type){case 0:return this._requestJSONArgs(e,t,n,o.args,i);case 1:return this._requestMixedArgs(e,t,n,o.args,i)}}static _requestJSONArgs(e,t,n,o,i){let s=ee.fromString(n),a=ee.fromString(o),l=0;l+=Jt.sizeUInt8(),l+=Jt.sizeShortString(s),l+=Jt.sizeLongString(a);let d=Jt.alloc(i?2:1,e,l);return d.writeUInt8(t),d.writeShortString(s),d.writeLongString(a),d.buffer}static deserializeRequestJSONArgs(e){let t=e.readUInt8(),n=e.readShortString(),o=e.readLongString();return{rpcId:t,method:n,args:JSON.parse(o)}}static _requestMixedArgs(e,t,n,o,i){let s=ee.fromString(n),a=0;a+=Jt.sizeUInt8(),a+=Jt.sizeShortString(s),a+=Jt.sizeMixedArray(o);let l=Jt.alloc(i?4:3,e,a);return l.writeUInt8(t),l.writeShortString(s),l.writeMixedArray(o),l.buffer}static deserializeRequestMixedArgs(e){let t=e.readUInt8(),n=e.readShortString(),o=e.readMixedArray(),i=new Array(o.length);for(let s=0,a=o.length;s<a;s++){let l=o[s];typeof l=="string"?i[s]=JSON.parse(l):i[s]=l}return{rpcId:t,method:n,args:i}}static serializeAcknowledged(e){return Jt.alloc(5,e,0).buffer}static serializeCancel(e){return Jt.alloc(6,e,0).buffer}static serializeReplyOK(e,t,n){if(typeof t>"u")return this._serializeReplyOKEmpty(e);if(t instanceof ee)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof Pt){let{jsonString:o,referencedBuffers:i}=iM(t.value,n,!0);return this._serializeReplyOKJSONWithBuffers(e,o,i)}else return this._serializeReplyOKJSON(e,QT(t,n))}static _serializeReplyOKEmpty(e){return Jt.alloc(7,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let n=0;n+=Jt.sizeVSBuffer(t);let o=Jt.alloc(8,e,n);return o.writeVSBuffer(t),o.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){let n=ee.fromString(t),o=0;o+=Jt.sizeLongString(n);let i=Jt.alloc(9,e,o);return i.writeLongString(n),i.buffer}static _serializeReplyOKJSONWithBuffers(e,t,n){let o=ee.fromString(t),i=0;i+=Jt.sizeUInt32,i+=Jt.sizeLongString(o);for(let a of n)i+=Jt.sizeVSBuffer(a);let s=Jt.alloc(10,e,i);s.writeUInt32(n.length),s.writeLongString(o);for(let a of n)s.writeBuffer(a);return s.buffer}static deserializeReplyOKJSON(e){let t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){let n=e.readUInt32(),o=e.readLongString(),i=[];for(let s=0;s<n;++s)i.push(e.readVSBuffer());return new Pt(dM(o,i,t))}static serializeReplyErr(e,t){let n=t?QT(ni(t),null):void 0;if(typeof n!="string")return this._serializeReplyErrEmpty(e);let o=ee.fromString(n),i=0;i+=Jt.sizeLongString(o);let s=Jt.alloc(11,e,i);return s.writeLongString(o),s.buffer}static deserializeReplyErrError(e){let t=e.readLongString();return JSON.parse(t)}static _serializeReplyErrEmpty(e){return Jt.alloc(12,e,0).buffer}};var Pr;(o=>{o.serviceIds=new Map,o.DI_TARGET="$di$target",o.DI_DEPENDENCIES="$di$dependencies";function n(i){return i[o.DI_DEPENDENCIES]||[]}o.getServiceDependencies=n})(Pr||={});var po=M("instantiationService");function N2(r,e,t){e[Pr.DI_TARGET]===e?e[Pr.DI_DEPENDENCIES].push({id:r,index:t}):(e[Pr.DI_DEPENDENCIES]=[{id:r,index:t}],e[Pr.DI_TARGET]=e)}function M(r){if(Pr.serviceIds.has(r))return Pr.serviceIds.get(r);let e=function(t,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N2(e,t,o)};return e.toString=()=>r,Pr.serviceIds.set(r,e),e}function Xm(r){if(!r)return;let e=r.indexOf("+");return e<0?r:r.substr(0,e)}var fv=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"];var _e=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(typeof e>"u"||e===null)return typeof t>"u"||t===null;if(typeof t>"u"||t===null)return!1;if(typeof e=="string"||typeof t=="string"){let n=typeof e=="string"?e:e.value,o=typeof t=="string"?t:t.value;return Nn(n,o)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}},Yn=class{constructor(e){this._set=new Set;if(e)for(let t of e)this.add(t)}get size(){return this._set.size}add(e){this._set.add(_e.toKey(e))}delete(e){return this._set.delete(_e.toKey(e))}has(e){return this._set.has(_e.toKey(e))}},Un=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(_e.toKey(e))}get(e){return this._map.get(_e.toKey(e))}has(e){return this._map.has(_e.toKey(e))}set(e,t){this._map.set(_e.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}},Pc=class extends Error{constructor(e,t,n){super(`Error in extension ${_e.toKey(e)}: ${n??t.message}`,{cause:t}),this.name="ExtensionError",this.extension=e}};var N$=M("IBuiltinExtensionsScannerService");function YT(r,e){return e&&(r.stack||r.stacktrace)?p(114,null,uM(r),cM(r.stack)||cM(r.stacktrace)):uM(r)}function cM(r){return Array.isArray(r)?r.join(`
`):r}function uM(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?p(113,null,r.message):r.message||p(111,null)}function Dr(r=null,e=!1){if(!r)return p(111,null);if(Array.isArray(r)){let t=Ze(r),n=Dr(t[0],e);return t.length>1?p(112,null,n,t.length):n}if(ke(r))return r;if(r.detail){let t=r.detail;if(t.error)return YT(t.error,e);if(t.exception)return YT(t.exception,e)}return r.stack?YT(r,e):r.message?r.message:p(111,null)}function Rr(r){return eE(r,0)}function eE(r,e){switch(typeof r){case"object":return r===null?ts(349,e):Array.isArray(r)?F2(r,e):H2(r,e);case"string":return hv(r,e);case"boolean":return U2(r,e);case"number":return ts(r,e);case"undefined":return ts(937,e);default:return ts(617,e)}}function ts(r,e){return(e<<5)-e+r|0}function U2(r,e){return ts(r?433:863,e)}function hv(r,e){e=ts(149417,e);for(let t=0,n=r.length;t<n;t++)e=ts(r.charCodeAt(t),e);return e}function F2(r,e){return e=ts(104579,e),r.reduce((t,n)=>eE(n,t),e)}function H2(r,e){return e=ts(181387,e),Object.keys(r).sort().reduce((t,n)=>(t=hv(n,t),eE(r[n],t)),e)}function ZT(r,e,t=32){let n=t-e,o=~((1<<n)-1);return(r<<e|(o&r)>>>n)>>>0}function Ym(r,e=32){return r instanceof ArrayBuffer?Um(ee.wrap(new Uint8Array(r))):(r>>>0).toString(16).padStart(e/4,"0")}var pM=class r{constructor(){this._h0=1732584193;this._h1=4023233417;this._h2=2562383102;this._h3=271733878;this._h4=3285377520;this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}update(e){let t=e.length;if(t===0)return;let n=this._buff,o=this._buffLen,i=this._leftoverHighSurrogate,s,a;for(i!==0?(s=i,a=-1,i=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(Vl(s))if(a+1<t){let d=e.charCodeAt(a+1);Gm(d)?(a++,l=Zh(s,d)):l=65533}else{i=s;break}else Gm(s)&&(l=65533);if(o=this._push(n,o,l),a++,a<t)s=e.charCodeAt(a);else break}this._buffLen=o,this._leftoverHighSurrogate=i}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Ym(this._h0)+Ym(this._h1)+Ym(this._h2)+Ym(this._h3)+Ym(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=r._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,ZT(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let n=this._h0,o=this._h1,i=this._h2,s=this._h3,a=this._h4,l,d,c;for(let u=0;u<80;u++)u<20?(l=o&i|~o&s,d=1518500249):u<40?(l=o^i^s,d=1859775393):u<60?(l=o&i|o&s|i&s,d=2400959708):(l=o^i^s,d=3395469782),c=ZT(n,5)+l+a+d+e.getUint32(u*4,!1)&4294967295,a=s,s=i,i=ZT(o,30),o=n,n=c;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+i&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}};function tE(...r){switch(r.length){case 1:return p(1851,null,r[0]);case 2:return p(1852,null,r[0],r[1]);case 3:return p(1853,null,r[0],r[1],r[2]);default:return}}var V2=p(1850,null),B2=p(1849,null),la=class r{constructor(){this._input="";this._start=0;this._current=0;this._tokens=[];this._errors=[];this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw pc(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(tE("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(tE("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(tE("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(o)}_string(){this.stringRe.lastIndex=this._start;let e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;let t=this._input.substring(this._start,this._current),n=r._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(V2);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(B2);return}let i=this._input.charCodeAt(e);if(t)t=!1;else if(i===47&&!n){e++;break}else i===91?n=!0:i===92?t=!0:i===93&&(n=!1);e++}for(;e<this._input.length&&r._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;let o=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:o,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};var Pn=new Map;Pn.set("false",!1);Pn.set("true",!0);Pn.set("isMac",en);Pn.set("isLinux",An);Pn.set("isWindows",Ct);Pn.set("isWeb",Uo);Pn.set("isMacNative",en&&!Uo);Pn.set("isEdge",Wh);Pn.set("isFirefox",y0);Pn.set("isChrome",Wm);Pn.set("isSafari",I0);var W2=Object.prototype.hasOwnProperty;var $2={regexParsingWithErrorRecovery:!0},z2=p(1830,null),K2=p(1831,null),q2=p(1833,null),mM=p(1829,null),G2=p(1836,null),j2=p(1837,null),Q2=p(1834,null),J2=p(1835,null),vv=class r{constructor(e=$2){this._config=e;this._scanner=new la;this._tokens=[];this._current=0;this._parsingErrors=[];this._flagsGYRe=/g|y/g}static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}parse(e){if(e===""){this._parsingErrors.push({message:z2,offset:0,lexeme:"",additionalInfo:K2});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{let t=this._expr();if(!this._isAtEnd()){let n=this._peek(),o=n.type===17?j2:void 0;throw this._parsingErrors.push({message:G2,offset:n.offset,lexeme:la.getLexeme(n),additionalInfo:o}),r._parseError}return t}catch(t){if(t!==r._parseError)throw t;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(16);){let t=this._and();e.push(t)}return e.length===1?e[0]:Tt.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(15);){let t=this._term();e.push(t)}return e.length===1?e[0]:Tt.and(...e)}_term(){if(this._matchOne(2)){let e=this._peek();switch(e.type){case 11:return this._advance(),jn.INSTANCE;case 12:return this._advance(),Zn.INSTANCE;case 0:{this._advance();let t=this._expr();return this._consume(1,mM),t?.negate()}case 17:return this._advance(),$l.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){let e=this._peek();switch(e.type){case 11:return this._advance(),Tt.true();case 12:return this._advance(),Tt.false();case 0:{this._advance();let t=this._expr();return this._consume(1,mM),t}case 17:{let t=e.lexeme;if(this._advance(),this._matchOne(9)){let o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);let i=o.lexeme,s=i.lastIndexOf("/"),a=s===i.length-1?void 0:this._removeFlagsGY(i.substring(s+1)),l;try{l=new RegExp(i.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return ig.create(t,l)}switch(o.type){case 10:case 19:{let i=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let m=0;m<o.lexeme.length;m++)o.lexeme.charCodeAt(m)===40?a++:o.lexeme.charCodeAt(m)===41&&a--;for(;!this._isAtEnd()&&s.type!==15&&s.type!==16;){switch(s.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let m=0;m<s.lexeme.length;m++)s.lexeme.charCodeAt(m)===40?a++:o.lexeme.charCodeAt(m)===41&&a--}if(a<0)break;i.push(la.getLexeme(s)),this._advance(),s=this._peek()}let l=i.join(""),d=l.lastIndexOf("/"),c=d===l.length-1?void 0:this._removeFlagsGY(l.substring(d+1)),u;try{u=new RegExp(l.substring(1,d),c)}catch{throw this._errExpectedButGot("REGEX",o)}return Tt.regex(t,u)}case 18:{let i=o.lexeme;this._advance();let s=null;if(!di(i)){let a=i.indexOf("/"),l=i.lastIndexOf("/");if(a!==l&&a>=0){let d=i.slice(a+1,l),c=i[l+1]==="i"?"i":"";try{s=new RegExp(d,c)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return ig.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,q2);let o=this._value();return Tt.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();let o=this._value();if(this._previous().type===18)return Tt.equals(t,o);switch(o){case"true":return Tt.has(t);case"false":return Tt.not(t);default:return Tt.equals(t,o)}}case 4:{this._advance();let o=this._value();if(this._previous().type===18)return Tt.notEquals(t,o);switch(o){case"true":return Tt.not(t);case"false":return Tt.has(t);default:return Tt.notEquals(t,o)}}case 5:return this._advance(),og.create(t,this._value());case 6:return this._advance(),rg.create(t,this._value());case 7:return this._advance(),Dc.create(t,this._value());case 8:return this._advance(),ng.create(t,this._value());case 13:return this._advance(),Tt.in(t,this._value());default:return Tt.has(t)}}case 20:throw this._parsingErrors.push({message:Q2,offset:e.offset,lexeme:"",additionalInfo:J2}),r._parseError;default:throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,n){let o=p(1832,null,e,la.getLexeme(t)),i=t.offset,s=la.getLexeme(t);return this._parsingErrors.push({message:o,offset:i,lexeme:s,additionalInfo:n}),r._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},Tt=class{static false(){return jn.INSTANCE}static true(){return Zn.INSTANCE}static has(e){return Wl.create(e)}static equals(e,t){return eg.create(e,t)}static notEquals(e,t){return tg.create(e,t)}static regex(e,t){return ig.create(e,t)}static in(e,t){return bv.create(e,t)}static notIn(e,t){return yv.create(e,t)}static not(e){return $l.create(e)}static and(...e){return Iv.create(e,null,!0)}static or(...e){return sg.create(e,null,!0)}static greater(e,t){return Dc.create(e,t)}static greaterEquals(e,t){return ng.create(e,t)}static smaller(e,t){return og.create(e,t)}static smallerEquals(e,t){return rg.create(e,t)}static{this._parser=new vv({regexParsingWithErrorRecovery:!1})}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};function fM(r){let e=new vv({regexParsingWithErrorRecovery:!1});return r.map(t=>(e.parse(t),e.lexingErrors.length>0?e.lexingErrors.map(n=>({errorMessage:n.additionalInfo?p(1839,null,n.additionalInfo):p(1838,null),offset:n.offset,length:n.lexeme.length})):e.parsingErrors.length>0?e.parsingErrors.map(n=>({errorMessage:n.additionalInfo?`${n.message}. ${n.additionalInfo}`:n.message,offset:n.offset,length:n.lexeme.length})):[]))}function Zm(r,e){return r.cmp(e)}var jn=class r{constructor(){this.type=0}static{this.INSTANCE=new r}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}map(e){return this}negate(){return Zn.INSTANCE}},Zn=class r{constructor(){this.type=1}static{this.INSTANCE=new r}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}map(e){return this}negate(){return jn.INSTANCE}},Wl=class r{constructor(e,t){this.key=e;this.negated=t;this.type=2}static create(e,t=null){let n=Pn.get(e);return typeof n=="boolean"?n?Zn.INSTANCE:jn.INSTANCE:new r(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:vM(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=Pn.get(this.key);return typeof e=="boolean"?e?Zn.INSTANCE:jn.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(e){return e.mapDefined(this.key)}negate(){return this.negated||(this.negated=$l.create(this.key,this)),this.negated}},eg=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=4}static create(e,t,n=null){if(typeof t=="boolean")return t?Wl.create(e,n):$l.create(e,n);let o=Pn.get(e);return typeof o=="boolean"?t===(o?"true":"false")?Zn.INSTANCE:jn.INSTANCE:new r(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=Pn.get(this.key);if(typeof e=="boolean"){let t=e?"true":"false";return this.value===t?Zn.INSTANCE:jn.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(e){return e.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=tg.create(this.key,this.value,this)),this.negated}},bv=class r{constructor(e,t){this.key=e;this.valueKey=t;this.type=10;this.negated=null}static create(e,t){return new r(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?W2.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(e){return e.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=yv.create(this.key,this.valueKey)),this.negated}},yv=class r{constructor(e,t){this.key=e;this.valueKey=t;this.type=11;this._negated=bv.create(e,t)}static create(e,t){return new r(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(e){return e.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},tg=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=5}static create(e,t,n=null){if(typeof t=="boolean")return t?$l.create(e,n):Wl.create(e,n);let o=Pn.get(e);return typeof o=="boolean"?t===(o?"true":"false")?jn.INSTANCE:Zn.INSTANCE:new r(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=Pn.get(this.key);if(typeof e=="boolean"){let t=e?"true":"false";return this.value===t?jn.INSTANCE:Zn.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(e){return e.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=eg.create(this.key,this.value,this)),this.negated}},$l=class r{constructor(e,t){this.key=e;this.negated=t;this.type=3}static create(e,t=null){let n=Pn.get(e);return typeof n=="boolean"?n?jn.INSTANCE:Zn.INSTANCE:new r(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:vM(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=Pn.get(this.key);return typeof e=="boolean"?e?jn.INSTANCE:Zn.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(e){return e.mapNot(this.key)}negate(){return this.negated||(this.negated=Wl.create(this.key,this)),this.negated}};function xv(r,e){if(typeof r=="string"){let t=parseFloat(r);isNaN(t)||(r=t)}return typeof r=="string"||typeof r=="number"?e(r):jn.INSTANCE}var Dc=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=12}static create(e,t,n=null){return xv(t,o=>new r(e,o,n))}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=rg.create(this.key,this.value,this)),this.negated}},ng=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=13}static create(e,t,n=null){return xv(t,o=>new r(e,o,n))}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=og.create(this.key,this.value,this)),this.negated}},og=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=14}static create(e,t,n=null){return xv(t,o=>new r(e,o,n))}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=ng.create(this.key,this.value,this)),this.negated}},rg=class r{constructor(e,t,n){this.key=e;this.value=t;this.negated=n;this.type=15}static create(e,t,n=null){return xv(t,o=>new r(e,o,n))}cmp(e){return e.type!==this.type?this.type-e.type:zl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=Dc.create(this.key,this.value,this)),this.negated}},ig=class r{constructor(e,t){this.key=e;this.regexp=t;this.type=7;this.negated=null}static create(e,t){return new r(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;let t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return t<n?-1:t>n?1:0}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}map(e){return e.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=nE.create(this)),this.negated}},nE=class r{constructor(e){this._actual=e;this.type=8}static create(e){return new r(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(e){return new r(this._actual.map(e))}negate(){return this._actual}};function hM(r){let e=null;for(let t=0,n=r.length;t<n;t++){let o=r[t].substituteConstants();if(r[t]!==o&&e===null){e=[];for(let i=0;i<t;i++)e[i]=r[i]}e!==null&&(e[t]=o)}return e===null?r:e}var Iv=class r{constructor(e,t){this.expr=e;this.negated=t;this.type=6}static create(e,t,n){return r._normalizeArr(e,t,n)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let o=Zm(this.expr[t],e.expr[t]);if(o!==0)return o}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let e=hM(this.expr);return e===this.expr?this:r.create(e,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,n){let o=[],i=!1;for(let s of e)if(s){if(s.type===1){i=!0;continue}if(s.type===0)return jn.INSTANCE;if(s.type===6){o.push(...s.expr);continue}o.push(s)}if(o.length===0&&i)return Zn.INSTANCE;if(o.length!==0){if(o.length===1)return o[0];o.sort(Zm);for(let s=1;s<o.length;s++)o[s-1].equals(o[s])&&(o.splice(s,1),s--);if(o.length===1)return o[0];for(;o.length>1;){let s=o[o.length-1];if(s.type!==9)break;o.pop();let a=o.pop(),l=o.length===0,d=sg.create(s.expr.map(c=>r.create([c,a],null,n)),null,l);d&&(o.push(d),o.sort(Zm))}if(o.length===1)return o[0];if(n){for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++)if(o[s].negate().equals(o[a]))return jn.INSTANCE;if(o.length===1)return o[0]}return new r(o,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(e){return new r(this.expr.map(t=>t.map(e)),null)}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=sg.create(e,this,!0)}return this.negated}},sg=class r{constructor(e,t){this.expr=e;this.negated=t;this.type=9}static create(e,t,n){return r._normalizeArr(e,t,n)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let o=Zm(this.expr[t],e.expr[t]);if(o!==0)return o}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let e=hM(this.expr);return e===this.expr?this:r.create(e,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,n){let o=[],i=!1;if(e){for(let s=0,a=e.length;s<a;s++){let l=e[s];if(l){if(l.type===0){i=!0;continue}if(l.type===1)return Zn.INSTANCE;if(l.type===9){o=o.concat(l.expr);continue}o.push(l)}}if(o.length===0&&i)return jn.INSTANCE;o.sort(Zm)}if(o.length!==0){if(o.length===1)return o[0];for(let s=1;s<o.length;s++)o[s-1].equals(o[s])&&(o.splice(s,1),s--);if(o.length===1)return o[0];if(n){for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++)if(o[s].negate().equals(o[a]))return Zn.INSTANCE;if(o.length===1)return o[0]}return new r(o,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(e){return new r(this.expr.map(t=>t.map(e)),null)}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){let t=e.shift(),n=e.shift(),o=[];for(let i of gM(t))for(let s of gM(n))o.push(Iv.create([i,s],null,!1));e.unshift(r.create(o,null,!1))}this.negated=r.create(e,this,!0)}return this.negated}},w=class r extends Wl{static{this._info=[]}static all(){return r._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?r._info.push({...n,key:e}):n!==!0&&r._info.push({key:e,description:n,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return eg.create(this.key,e)}notEqualsTo(e){return tg.create(this.key,e)}greater(e){return Dc.create(this.key,e)}},sr=M("contextKeyService");function vM(r,e){return r<e?-1:r>e?1:0}function zl(r,e,t,n){return r<t?-1:r>t?1:e<n?-1:e>n?1:0}function gM(r){return r.type===9?r.expr:[r]}var ue=M("logService"),Ho=M("loggerService");var ag=(s=>(s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error",s))(ag||{}),X2=3;function Ev(r,e){return r!==0&&r<=e}function bM(r,e,t){switch(e){case 1:r.trace(t);break;case 2:r.debug(t);break;case 3:r.info(t);break;case 4:r.warn(t);break;case 5:r.error(t);break;case 0:break;default:throw new Error(`Invalid log level ${e}`)}}function Rc(r,e=!1){let t="";for(let n=0;n<r.length;n++){let o=r[n];if(o instanceof Error&&(o=Dr(o,e)),typeof o=="object")try{o=JSON.stringify(o)}catch{}t+=(n>0?" ":"")+o}return t}var Sv=class extends H{constructor(){super(...arguments);this.level=X2;this._onDidChangeLogLevel=this._register(new E)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(t){this.level!==t&&(this.level=t,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(t){return Ev(this.level,t)}canLog(t){return this._store.isDisposed?!1:this.checkLogLevel(t)}},Mc=class extends Sv{constructor(t){super();this.logAlways=t}checkLogLevel(t){return this.logAlways||super.checkLogLevel(t)}trace(t,...n){this.canLog(1)&&this.log(1,Rc([t,...n],!0))}debug(t,...n){this.canLog(2)&&this.log(2,Rc([t,...n]))}info(t,...n){this.canLog(3)&&this.log(3,Rc([t,...n]))}warn(t,...n){this.canLog(4)&&this.log(4,Rc([t,...n]))}error(t,...n){if(this.canLog(5))if(t instanceof Error){let o=Array.prototype.slice.call(arguments);o[0]=t.stack,this.log(5,Rc(o))}else this.log(5,Rc([t,...n]))}flush(){}};var Cv=class extends Sv{constructor(t){super();this.loggers=t;t.length&&this.setLevel(t[0].getLevel())}setLevel(t){for(let n of this.loggers)n.setLevel(t);super.setLevel(t)}trace(t,...n){for(let o of this.loggers)o.trace(t,...n)}debug(t,...n){for(let o of this.loggers)o.debug(t,...n)}info(t,...n){for(let o of this.loggers)o.info(t,...n)}warn(t,...n){for(let o of this.loggers)o.warn(t,...n)}error(t,...n){for(let o of this.loggers)o.error(t,...n)}flush(){for(let t of this.loggers)t.flush()}dispose(){for(let t of this.loggers)t.dispose();super.dispose()}},Tv=class extends H{constructor(t,n,o){super();this.logLevel=t;this.logsHome=n;this._loggers=new qe;this._onDidChangeLoggers=this._register(new E);this.onDidChangeLoggers=this._onDidChangeLoggers.event;this._onDidChangeLogLevel=this._register(new E);this.onDidChangeLogLevel=this._onDidChangeLogLevel.event;this._onDidChangeVisibility=this._register(new E);this.onDidChangeVisibility=this._onDidChangeVisibility.event;if(o)for(let i of o)this._loggers.set(i.resource,{logger:void 0,info:i})}getLoggerEntry(t){return ke(t)?[...this._loggers.values()].find(n=>n.info.id===t):this._loggers.get(t)}getLogger(t){return this.getLoggerEntry(t)?.logger}createLogger(t,n){let o=this.toResource(t),i=ke(t)?t:n?.id??Rr(o.toString()).toString(16),s=this._loggers.get(o)?.logger,a=n?.logLevel==="always"?1:n?.logLevel;s||(s=this.doCreateLogger(o,a??this.getLogLevel(o)??this.logLevel,{...n,id:i}));let l={logger:s,info:{resource:o,id:i,logLevel:a,name:n?.name,hidden:n?.hidden,group:n?.group,extensionId:n?.extensionId,when:n?.when}};return this.registerLogger(l.info),this._loggers.set(o,l),s}toResource(t){return ke(t)?Ut(this.logsHome,`${t.replace(/[\\/:\*\?"<>\|]/g,"")}.log`):t}setLogLevel(t,n){if(y.isUri(t)){let o=t,i=n,s=this._loggers.get(o);s&&i!==s.info.logLevel&&(s.info.logLevel=i===this.logLevel?void 0:i,s.logger?.setLevel(i),this._loggers.set(s.info.resource,s),this._onDidChangeLogLevel.fire([o,i]))}else{this.logLevel=t;for(let[o,i]of this._loggers.entries())this._loggers.get(o)?.info.logLevel===void 0&&i.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(t,n){let o=this.getLoggerEntry(t);o&&n!==!o.info.hidden&&(o.info.hidden=!n,this._loggers.set(o.info.resource,o),this._onDidChangeVisibility.fire([o.info.resource,n]))}getLogLevel(t){let n;return t&&(n=this._loggers.get(t)?.info.logLevel),n??this.logLevel}registerLogger(t){let n=this._loggers.get(t.resource);n?n.info.hidden!==t.hidden&&this.setVisibility(t.resource,!t.hidden):(this._loggers.set(t.resource,{info:t,logger:void 0}),this._onDidChangeLoggers.fire({added:[t],removed:[]}))}deregisterLogger(t){let n=this.toResource(t),o=this._loggers.get(n);o&&(o.logger&&o.logger.dispose(),this._loggers.delete(n),this._onDidChangeLoggers.fire({added:[],removed:[o.info]}))}*getRegisteredLoggers(){for(let t of this._loggers.values())yield t.info}getRegisteredLogger(t){return this._loggers.get(t)?.info}dispose(){this._loggers.forEach(t=>t.logger?.dispose()),this._loggers.clear(),super.dispose()}};function Y2(r){switch(r){case 1:return"trace";case 2:return"debug";case 3:return"info";case 4:return"warn";case 5:return"error";case 0:return"off"}}var h6=new w("logLevel",Y2(3));var mo=class{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}};var yM=[];function Qe(r,e,t){e instanceof mo||(e=new mo(e,[],!!t)),yM.push([r,e])}function IM(){return yM}var da=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};var nt=M("IExtHostInitDataService");var oE=class{constructor(e,t){this.key=e;this.data=t;this.incoming=new Map;this.outgoing=new Map}},lg=class{constructor(e){this._hashFn=e;this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let t=this._hashFn(e);this._nodes.delete(t);for(let n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),n=this._nodes.get(t);return n||(n=new oE(t,e),this._nodes.set(t,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}
	(-> incoming)[${[...n.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...n.outgoing.keys()].join(",")}]
`);return e.join(`
`)}findCycleSlow(){for(let[e,t]of this._nodes){let n=new Set([e]),o=this._findCycle(t,n);if(o)return o}}_findCycle(e,t){for(let[n,o]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);let i=this._findCycle(o,t);if(i)return i;t.delete(n)}}};var Z2=!1,wv=class extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
${e.toString()}`}},kv=class r{constructor(e=new da,t=!1,n,o=Z2){this._services=e;this._strict=t;this._parent=n;this._enableTracing=o;this._isDisposed=!1;this._servicesToMaybeDispose=new Set;this._children=new Set;this._activeInstantiations=new Set;this._services.set(po,this),this._globalGraph=o?n?._globalGraph??new lg(i=>i):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,wn(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)Ph(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();let n=this,o=new class extends r{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),t?.add(o),o}invokeFunction(e,...t){this._throwIfDisposed();let n=dg.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:s=>{if(o)throw pc("service accessor is only valid during the invocation of its target method");let a=this._getOrCreateServiceInstance(s,n);return a||this._throwIfStrict(`[invokeFunction] unknown service '${s}'`,!1),a}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){this._throwIfDisposed();let n,o;return e instanceof mo?(n=dg.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=dg.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,n)),n.stop(),o}_createInstance(e,t=[],n){let o=Pr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),i=[];for(let a of o){let l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),i.push(l)}let s=o.length>0?o[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);let a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(i))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof mo)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof mo?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){let o=new lg(l=>l.id.toString()),i=0,s=[{id:e,desc:t,_trace:n}],a=new Set;for(;s.length;){let l=s.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),o.lookupOrInsertNode(l),i++>1e3)throw new wv(o);for(let d of Pr.getServiceDependencies(l.desc.ctor)){let c=this._getServiceInstanceOrDescriptor(d.id);if(c||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(d.id)),c instanceof mo){let u={id:d.id,desc:c,_trace:l._trace.branch(d.id,!0)};o.insertEdge(l,u),s.push(u)}}}}for(;;){let l=o.roots();if(l.length===0){if(!o.isEmpty())throw new wv(o);break}for(let{data:d}of l){if(this._getServiceInstanceOrDescriptor(d.id)instanceof mo){let u=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,u)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],o,i){if(this._services.get(e)instanceof mo)return this._createServiceInstance(e,t,n,o,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,o,i);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,n=[],o,i,s){if(o){let a=new r(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);let l=new Map,d=new cv(()=>{let c=a._createInstance(t,n,i);for(let[u,m]of l){let g=c[u];if(typeof g=="function")for(let v of m)v.disposable=g.apply(c,v.listener)}return l.clear(),s.add(c),c});return new Proxy(Object.create(null),{get(c,u){if(!d.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let v=l.get(u);return v||(v=new qn,l.set(u,v)),(x,S,T)=>{if(d.isInitialized)return d.value[u](x,S,T);{let P={listener:[x,S,T],disposable:void 0},L=v.push(P);return J(()=>{L(),P.disposable?.dispose()})}}}if(u in c)return c[u];let m=d.value,g=m[u];return typeof g!="function"||(g=g.bind(m),c[u]=g),g},set(c,u,m){return d.value[u]=m,!0},getPrototypeOf(c){return t.prototype}})}else{let a=this._createInstance(t,n,i);return s.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}};var dg=class r{constructor(e,t){this.type=e;this.name=t;this._start=Date.now();this._dep=[]}static{this.all=new Set}static{this._None=new class extends r{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,t){return e?new r(2,t.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):r._None}static traceCreation(e,t){return e?new r(1,t.name):r._None}static{this._totals=0}branch(e,t){let n=new r(3,e.toString());return this._dep.push([e,t,n]),n}stop(){let e=Date.now()-this._start;r._totals+=e;let t=!1;function n(i,s){let a=[],l=new Array(i+1).join("	");for(let[d,c,u]of s._dep)if(c&&u){t=!0,a.push(`${l}CREATES -> ${d}`);let m=n(i+1,u);m&&a.push(m)}else a.push(`${l}uses -> ${d}`);return a.join(`
`)}let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${r._totals.toFixed(2)}ms)`];(e>2||t)&&r.all.add(o.join(`
`))}};var ge=M("IExtHostRpcService"),_v=class{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}};var ca=M("IURITransformerService"),Pv=class{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}};var rE=class{constructor(){this._value="";this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){let t=e.charCodeAt(0),n=this._value.charCodeAt(this._pos);return t-n}value(){return this._value[this._pos]}},iE=class{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?Xh(e,this._value,0,e.length,this._from,this._to):Hl(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},Dv=class{constructor(e=!0,t=!0){this._splitOnBackslash=e;this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){let n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){let t=this._value.charCodeAt(this._to);if(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?Xh(e,this._value,0,e.length,this._from,this._to):Hl(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}};var cg=class{constructor(e,t){this._ignorePathCasing=e;this._ignoreQueryAndFragment=t;this._states=[];this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new Dv(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return qm(e,this._value.scheme);if(this._states[this._stateIdx]===2)return qm(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return kr(e,this._value.query);if(this._states[this._stateIdx]===5)return kr(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}},ns=class r{static{this.Val=Symbol("undefined_placeholder")}static wrap(e){return e===void 0?r.Val:e}static unwrap(e){return e===r.Val?void 0:e}},Ac=class{constructor(){this.height=1;this.value=void 0;this.key=void 0;this.left=void 0;this.mid=void 0;this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){let e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}};var go=class r{static forUris(e=()=>!1,t=()=>!1){return new r(new cg(e,t))}static forPaths(e=!1){return new r(new Dv(void 0,!e))}static forStrings(){return new r(new rE)}static forConfigKeys(){return new r(new iE)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){let n=t.slice(0);qC(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);qC(n);for(let o of n)this.set(o[0],o[1])}}set(e,t){let n=this._iter.reset(e),o;this._root||(this._root=new Ac,this._root.segment=n.value());let i=[];for(o=this._root;;){let a=n.cmp(o.segment);if(a>0)o.left||(o.left=new Ac,o.left.segment=n.value()),i.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new Ac,o.right.segment=n.value()),i.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Ac,o.mid.segment=n.value()),i.push([0,o]),o=o.mid;else break}let s=ns.unwrap(o.value);o.value=ns.wrap(t),o.key=e;for(let a=i.length-1;a>=0;a--){let l=i[a][1];l.updateHeight();let d=l.balanceFactor();if(d<-1||d>1){let c=i[a][0],u=i[a+1][0];if(c===1&&u===1)i[a][1]=l.rotateLeft();else if(c===-1&&u===-1)i[a][1]=l.rotateRight();else if(c===1&&u===-1)l.right=i[a+1][1]=i[a+1][1].rotateRight(),i[a][1]=l.rotateLeft();else if(c===-1&&u===1)l.left=i[a+1][1]=i[a+1][1].rotateLeft(),i[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(i[a-1][0]){case-1:i[a-1][1].left=i[a][1];break;case 1:i[a-1][1].right=i[a][1];break;case 0:i[a-1][1].mid=i[a][1];break}else this._root=i[0][1]}}return s}get(e){return ns.unwrap(this._getNode(e)?.value)}_getNode(e){let t=this._iter.reset(e),n=this._root;for(;n;){let o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){let t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){let n=this._iter.reset(e),o=[],i=this._root;for(;i;){let s=n.cmp(i.segment);if(s>0)o.push([-1,i]),i=i.left;else if(s<0)o.push([1,i]),i=i.right;else if(n.hasNext())n.next(),o.push([0,i]),i=i.mid;else break}if(i){if(t?(i.left=void 0,i.mid=void 0,i.right=void 0,i.height=1):(i.key=void 0,i.value=void 0),!i.mid&&!i.value)if(i.left&&i.right){let s=[[1,i]],a=this._min(i.right,s);if(a.key){i.key=a.key,i.value=a.value,i.segment=a.segment;let l=a.right;if(s.length>1){let[c,u]=s[s.length-1];switch(c){case-1:u.left=l;break;case 0:vc(!1);case 1:vc(!1)}}else i.right=l;let d=this._balanceByStack(s);if(o.length>0){let[c,u]=o[o.length-1];switch(c){case-1:u.left=d;break;case 0:u.mid=d;break;case 1:u.right=d;break}}else this._root=d}}else{let s=i.left??i.right;if(o.length>0){let[a,l]=o[o.length-1];switch(a){case-1:l.left=s;break;case 0:l.mid=s;break;case 1:l.right=s;break}}else this._root=s}this._root=this._balanceByStack(o)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){let n=e[t][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[t][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[t][1]=n.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){let t=this._iter.reset(e),n=this._root,o;for(;n;){let i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else if(t.hasNext())t.next(),o=ns.unwrap(n.value)||o,n=n.mid;else break}return n&&ns.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){let n=this._iter.reset(e),o=this._root;for(;o;){let i=n.cmp(o.segment);if(i>0)o=o.left;else if(i<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?ns.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,ns.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){let e=t=>{if(!t)return!0;let n=t.balanceFactor();return n<-1||n>1?!1:e(t.left)&&e(t.right)};return e(this._root)}};function lt(r){if(!r||typeof r!="object"||r instanceof RegExp)return r;let e=Array.isArray(r)?[]:{};return Object.entries(r).forEach(([t,n])=>{e[t]=n&&typeof n=="object"?lt(n):n}),e}function ug(r){if(!r||typeof r!="object")return r;let e=[r];for(;e.length>0;){let t=e.shift();Object.freeze(t);for(let n in t)if(xM.call(t,n)){let o=t[n];typeof o=="object"&&!Object.isFrozen(o)&&!B1(o)&&e.push(o)}}return r}var xM=Object.prototype.hasOwnProperty;function os(r,e){return sE(r,e,new Set)}function sE(r,e,t){if(wt(r))return r;let n=e(r);if(typeof n<"u")return n;if(Array.isArray(r)){let o=[];for(let i of r)o.push(sE(i,e,t));return o}if(ut(r)){if(t.has(r))throw new Error("Cannot clone recursive data-structure");t.add(r);let o={};for(let i in r)xM.call(r,i)&&(o[i]=sE(r[i],e,t));return t.delete(r),o}return r}function ar(r,e,t=!0){return ut(r)?(ut(e)&&Object.keys(e).forEach(n=>{n in r?t&&(ut(r[n])&&ut(e[n])?ar(r[n],e[n],t):r[n]=e[n]):r[n]=e[n]}),r):e}function Wt(r,e){if(r===e)return!0;if(r==null||e===null||e===void 0||typeof r!=typeof e||typeof r!="object"||Array.isArray(r)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(t=0;t<r.length;t++)if(!Wt(r[t],e[t]))return!1}else{let o=[];for(n in r)o.push(n);o.sort();let i=[];for(n in e)i.push(n);if(i.sort(),!Wt(o,i))return!1;for(t=0;t<o.length;t++)if(!Wt(r[o[t]],e[o[t]]))return!1}return!0}function aE(r){let e=new Set;return JSON.stringify(r,(t,n)=>{if(ut(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}function lE(r,e){let t=Object.create(null);for(let[n,o]of Object.entries(r))e(n,o)&&(t[n]=o);return t}var Rv=class{constructor(){this._next=0}getNext(){return this._next++}};var ql=M("fileService");var Lc=(o=>(o[o.Unknown=0]="Unknown",o[o.File=1]="File",o[o.Directory=2]="Directory",o[o.SymbolicLink=64]="SymbolicLink",o))(Lc||{}),mg=(n=>(n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked",n[n.Executable=4]="Executable",n))(mg||{});var pg=class r extends Error{constructor(t,n){super(t);this.code=n}static create(t,n){let o=new r(t.toString(),n);return cE(o,n),o}};function cE(r,e){return r.name=e?`${e} (FileSystemError)`:"FileSystemError",r}function Oc(r){if(!r)return"Unknown";if(r instanceof pg)return r.code;let e=/^(.+) \(FileSystemError\)$/.exec(r.name);if(!e)return"Unknown";switch(e[1]){case"EntryExists":return"EntryExists";case"EntryIsADirectory":return"EntryIsADirectory";case"EntryNotADirectory":return"EntryNotADirectory";case"EntryNotFound":return"EntryNotFound";case"EntryTooLarge":return"EntryTooLarge";case"EntryWriteLocked":return"EntryWriteLocked";case"NoPermissions":return"NoPermissions";case"Unavailable":return"Unavailable"}return"Unknown"}function CM(r){if(r instanceof ua)return r.fileOperationResult;switch(Oc(r)){case"EntryNotFound":return 1;case"EntryIsADirectory":return 0;case"EntryNotADirectory":return 9;case"EntryWriteLocked":return 5;case"NoPermissions":return 6;case"EntryExists":return 4;case"EntryTooLarge":return 7;default:return 10}}var SM=class r{constructor(e,t){this.ignorePathCasing=t;this.correlationId=void 0;this.added=new dt(()=>{let e=go.forUris(()=>this.ignorePathCasing);return e.fill(this.rawAdded.map(t=>[t,!0])),e});this.updated=new dt(()=>{let e=go.forUris(()=>this.ignorePathCasing);return e.fill(this.rawUpdated.map(t=>[t,!0])),e});this.deleted=new dt(()=>{let e=go.forUris(()=>this.ignorePathCasing);return e.fill(this.rawDeleted.map(t=>[t,!0])),e});this.rawAdded=[];this.rawUpdated=[];this.rawDeleted=[];for(let n of e){switch(n.type){case 1:this.rawAdded.push(n.resource);break;case 0:this.rawUpdated.push(n.resource);break;case 2:this.rawDeleted.push(n.resource);break}this.correlationId!==r.MIXED_CORRELATION&&(typeof n.cId=="number"?this.correlationId===void 0?this.correlationId=n.cId:this.correlationId!==n.cId&&(this.correlationId=r.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=r.MIXED_CORRELATION))}}static{this.MIXED_CORRELATION=null}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...n){if(!e)return!1;let o=n.length>0;return!!((!o||n.includes(1))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!o||n.includes(0))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!o||n.includes(2))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}};var ua=class extends Error{constructor(t,n,o){super(t);this.fileOperationResult=n;this.options=o}};var TM="";function uE(r){if(!(typeof r.size!="number"||typeof r.mtime!="number"))return r.mtime.toString(29)+r.size.toString(31)}var dE=class r{static{this.KB=1024}static{this.MB=r.KB*r.KB}static{this.GB=r.MB*r.KB}static{this.TB=r.GB*r.KB}static formatSize(e){return Lo(e)||(e=0),e<r.KB?p(2045,null,e.toFixed(0)):e<r.MB?p(2047,null,(e/r.KB).toFixed(2)):e<r.GB?p(2048,null,(e/r.MB).toFixed(2)):e<r.TB?p(2046,null,(e/r.GB).toFixed(2)):p(2049,null,(e/r.TB).toFixed(2))}};var Av=(o=>(o[o.Ignore=0]="Ignore",o[o.Info=1]="Info",o[o.Warning=2]="Warning",o[o.Error=3]="Error",o))(Av||{});(a=>{let r="error",e="warning",t="warn",n="info",o="ignore";function i(l){return l?Nn(r,l)?3:Nn(e,l)||Nn(t,l)?2:Nn(n,l)?1:0:0}a.fromValue=i;function s(l){switch(l){case 3:return r;case 2:return e;case 1:return n;default:return o}}a.toString=s})(Av||={});var $e=Av;var EM=$e,f3=M("notificationService");var pa=M("contextService");function wM(r){let e=r;return typeof e?.id=="string"&&y.isUri(e.uri)}function kM(r){let e=r;return typeof e?.id=="string"&&y.isUri(e.configPath)}var Lv=class{constructor(e,t,n,o,i){this._id=e;this._transient=n;this._configuration=o;this.ignorePathCasing=i;this.foldersMap=go.forUris(this.ignorePathCasing,()=>!0),this.folders=t}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this.ignorePathCasing=e.ignorePathCasing,this.folders=e.folders}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this.foldersMap.findSubstr(e)||null}updateFoldersMap(){this.foldersMap=go.forUris(this.ignorePathCasing,()=>!0);for(let e of this.folders)this.foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}},gg=class{constructor(e,t){this.raw=t;this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Ut(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function fg(r){return new gg({uri:r,index:0,name:jm(r)},{uri:r.toString()})}var _M="code-workspace",E3=`.${_M}`,w3=[{name:p(2715,null),extensions:[_M]}];var Ov=class{constructor(){this._systemSchemes=new Set(Object.keys($));this._providerInfo=new Map;this.extUri=new ui(e=>{let t=this._providerInfo.get(e.scheme);return!(t===void 0||t&1024)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}},lr=M("IExtHostFileSystemInfo");var pt=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128;let n=0,o="";return o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o+="-",o+=e[r[n++]],o+=e[r[n++]],o+="-",o+=e[r[n++]],o+=e[r[n++]],o+="-",o+=e[r[n++]],o+=e[r[n++]],o+="-",o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o+=e[r[n++]],o}})();var Uv=Object.freeze({create:r=>Xo(r.map(e=>e.toString())).join(`\r
`),split:r=>r.split(`\r
`),parse:r=>Uv.split(r).filter(e=>!e.startsWith("#"))});var H3=new Uint32Array(10);var V3=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),B3=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),W3=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),$3=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);var q3=new Zo(1e4);var eH=new Zo(1e4);function tH(r){return oH(r,"NFD",eH)}var nH=/[^\u0000-\u0080]/;function oH(r,e,t){if(!r)return r;let n=t.get(r);if(n)return n;let o;return nH.test(r)?o=r.normalize(e):o=r,t.set(r,o),o}var rH=(function(){let r=new Zo(1e4),e=/[\u0300-\u036f]/g;return function(t){let n=r.get(t);if(n)return n;let o=tH(t).replace(e,""),i=(o.length===t.length?o:t).toLowerCase();return r.set(t,i),i}})();function DM(...r){return function(e,t){for(let n=0,o=r.length;n<o;n++){let i=r[n](e,t);if(i)return i}return null}}var tz=MM.bind(void 0,!1),RM=MM.bind(void 0,!0);function MM(r,e,t){if(!t||t.length<e.length)return null;let n;return r?n=ra(t,e):n=t.indexOf(e)===0,n?e.length>0?[{start:0,end:e.length}]:[]:null}function iH(r,e){if(r.length>e.length)return null;let t=e.toLowerCase().indexOf(r.toLowerCase());return t===-1?null:[{start:t,end:t+r.length}]}function sH(r,e){return r.length>e.length?null:pE(r.toLowerCase(),e.toLowerCase(),0,0)}function pE(r,e,t,n){if(t===r.length)return[];if(n===e.length)return null;if(r[t]===e[n]){let o=null;return(o=pE(r,e,t+1,n+1))?LM({start:n,end:n+1},o):null}return pE(r,e,t,n+1)}function gE(r){return 97<=r&&r<=122}function Hv(r){return 65<=r&&r<=90}function fE(r){return 48<=r&&r<=57}function aH(r){return r===32||r===9||r===10||r===13}var lH=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(r=>lH.add(r.charCodeAt(0)));function AM(r){return gE(r)||Hv(r)||fE(r)}function LM(r,e){return e.length===0?e=[r]:r.end===e[0].start?e[0].start=r.start:e.unshift(r),e}function OM(r,e){for(let t=e;t<r.length;t++){let n=r.charCodeAt(t);if(Hv(n)||fE(n)||t>0&&!AM(r.charCodeAt(t-1)))return t}return r.length}function mE(r,e,t,n){if(t===r.length)return[];if(n===e.length)return null;if(r[t]!==e[n].toLowerCase())return null;{let o=null,i=n+1;for(o=mE(r,e,t+1,n+1);!o&&(i=OM(e,i))<e.length;)o=mE(r,e,t+1,i),i++;return o===null?null:LM({start:n,end:n+1},o)}}function dH(r){let e=0,t=0,n=0,o=0,i=0;for(let c=0;c<r.length;c++)i=r.charCodeAt(c),Hv(i)&&e++,gE(i)&&t++,AM(i)&&n++,fE(i)&&o++;let s=e/r.length,a=t/r.length,l=n/r.length,d=o/r.length;return{upperPercent:s,lowerPercent:a,alphaPercent:l,numericPercent:d}}function cH(r){let{upperPercent:e,lowerPercent:t}=r;return t===0&&e>.6}function uH(r){let{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:o}=r;return t>.2&&e<.8&&n>.6&&o<.2}function pH(r){let e=0,t=0,n=0,o=0;for(let i=0;i<r.length;i++)n=r.charCodeAt(i),Hv(n)&&e++,gE(n)&&t++,aH(n)&&o++;return(e===0||t===0)&&o===0?r.length<=30:e<=5}function NM(r,e){if(!e||(e=e.trim(),e.length===0)||!pH(r))return null;e.length>60&&(e=e.substring(0,60));let t=dH(e);if(!uH(t)){if(!cH(t))return null;e=e.toLowerCase()}let n=null,o=0;for(r=r.toLowerCase();o<e.length&&(n=mE(r,e,0,o))===null;)o=OM(e,o+1);return n}var nz=DM(RM,NM,iH),oz=DM(RM,NM,sH),rz=new Zo(1e4);var Fv=128;function hE(){let r=[],e=[];for(let t=0;t<=Fv;t++)e[t]=0;for(let t=0;t<=Fv;t++)r.push(e.slice(0));return r}function UM(r){let e=[];for(let t=0;t<=r;t++)e[t]=0;return e}var iz=UM(2*Fv),sz=UM(2*Fv),az=hE(),lz=hE(),dz=hE();var mH;(t=>{t.Default=[-100,0];function e(n){return!n||n.length===2&&n[0]===-100&&n[1]===0}t.isDefault=e})(mH||={});var PM=class{constructor(e,t){this.firstMatchCanBeWeak=e;this.boostFullMatch=t}static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}};var vE=Object.create(null);function f(r,e){if(ke(e)){let t=vE[e];if(t===void 0)throw new Error(`${r} references an unknown codicon: ${e}`);e=t}return vE[r]=e,{id:r}}function FM(){return vE}var HM={add:f("add",6e4),plus:f("plus",6e4),gistNew:f("gist-new",6e4),repoCreate:f("repo-create",6e4),lightbulb:f("lightbulb",60001),lightBulb:f("light-bulb",60001),repo:f("repo",60002),repoDelete:f("repo-delete",60002),gistFork:f("gist-fork",60003),repoForked:f("repo-forked",60003),gitPullRequest:f("git-pull-request",60004),gitPullRequestAbandoned:f("git-pull-request-abandoned",60004),recordKeys:f("record-keys",60005),keyboard:f("keyboard",60005),tag:f("tag",60006),gitPullRequestLabel:f("git-pull-request-label",60006),tagAdd:f("tag-add",60006),tagRemove:f("tag-remove",60006),person:f("person",60007),personFollow:f("person-follow",60007),personOutline:f("person-outline",60007),personFilled:f("person-filled",60007),sourceControl:f("source-control",60008),mirror:f("mirror",60009),mirrorPublic:f("mirror-public",60009),star:f("star",60010),starAdd:f("star-add",60010),starDelete:f("star-delete",60010),starEmpty:f("star-empty",60010),comment:f("comment",60011),commentAdd:f("comment-add",60011),alert:f("alert",60012),warning:f("warning",60012),search:f("search",60013),searchSave:f("search-save",60013),logOut:f("log-out",60014),signOut:f("sign-out",60014),logIn:f("log-in",60015),signIn:f("sign-in",60015),eye:f("eye",60016),eyeUnwatch:f("eye-unwatch",60016),eyeWatch:f("eye-watch",60016),circleFilled:f("circle-filled",60017),primitiveDot:f("primitive-dot",60017),closeDirty:f("close-dirty",60017),debugBreakpoint:f("debug-breakpoint",60017),debugBreakpointDisabled:f("debug-breakpoint-disabled",60017),debugHint:f("debug-hint",60017),terminalDecorationSuccess:f("terminal-decoration-success",60017),primitiveSquare:f("primitive-square",60018),edit:f("edit",60019),pencil:f("pencil",60019),info:f("info",60020),issueOpened:f("issue-opened",60020),gistPrivate:f("gist-private",60021),gitForkPrivate:f("git-fork-private",60021),lock:f("lock",60021),mirrorPrivate:f("mirror-private",60021),close:f("close",60022),removeClose:f("remove-close",60022),x:f("x",60022),repoSync:f("repo-sync",60023),sync:f("sync",60023),clone:f("clone",60024),desktopDownload:f("desktop-download",60024),beaker:f("beaker",60025),microscope:f("microscope",60025),vm:f("vm",60026),deviceDesktop:f("device-desktop",60026),file:f("file",60027),more:f("more",60028),ellipsis:f("ellipsis",60028),kebabHorizontal:f("kebab-horizontal",60028),mailReply:f("mail-reply",60029),reply:f("reply",60029),organization:f("organization",60030),organizationFilled:f("organization-filled",60030),organizationOutline:f("organization-outline",60030),newFile:f("new-file",60031),fileAdd:f("file-add",60031),newFolder:f("new-folder",60032),fileDirectoryCreate:f("file-directory-create",60032),trash:f("trash",60033),trashcan:f("trashcan",60033),history:f("history",60034),clock:f("clock",60034),folder:f("folder",60035),fileDirectory:f("file-directory",60035),symbolFolder:f("symbol-folder",60035),logoGithub:f("logo-github",60036),markGithub:f("mark-github",60036),github:f("github",60036),terminal:f("terminal",60037),console:f("console",60037),repl:f("repl",60037),zap:f("zap",60038),symbolEvent:f("symbol-event",60038),error:f("error",60039),stop:f("stop",60039),variable:f("variable",60040),symbolVariable:f("symbol-variable",60040),array:f("array",60042),symbolArray:f("symbol-array",60042),symbolModule:f("symbol-module",60043),symbolPackage:f("symbol-package",60043),symbolNamespace:f("symbol-namespace",60043),symbolObject:f("symbol-object",60043),symbolMethod:f("symbol-method",60044),symbolFunction:f("symbol-function",60044),symbolConstructor:f("symbol-constructor",60044),symbolBoolean:f("symbol-boolean",60047),symbolNull:f("symbol-null",60047),symbolNumeric:f("symbol-numeric",60048),symbolNumber:f("symbol-number",60048),symbolStructure:f("symbol-structure",60049),symbolStruct:f("symbol-struct",60049),symbolParameter:f("symbol-parameter",60050),symbolTypeParameter:f("symbol-type-parameter",60050),symbolKey:f("symbol-key",60051),symbolText:f("symbol-text",60051),symbolReference:f("symbol-reference",60052),goToFile:f("go-to-file",60052),symbolEnum:f("symbol-enum",60053),symbolValue:f("symbol-value",60053),symbolRuler:f("symbol-ruler",60054),symbolUnit:f("symbol-unit",60054),activateBreakpoints:f("activate-breakpoints",60055),archive:f("archive",60056),arrowBoth:f("arrow-both",60057),arrowDown:f("arrow-down",60058),arrowLeft:f("arrow-left",60059),arrowRight:f("arrow-right",60060),arrowSmallDown:f("arrow-small-down",60061),arrowSmallLeft:f("arrow-small-left",60062),arrowSmallRight:f("arrow-small-right",60063),arrowSmallUp:f("arrow-small-up",60064),arrowUp:f("arrow-up",60065),bell:f("bell",60066),bold:f("bold",60067),book:f("book",60068),bookmark:f("bookmark",60069),debugBreakpointConditionalUnverified:f("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:f("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:f("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:f("debug-breakpoint-data-unverified",60072),debugBreakpointData:f("debug-breakpoint-data",60073),debugBreakpointDataDisabled:f("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:f("debug-breakpoint-log-unverified",60074),debugBreakpointLog:f("debug-breakpoint-log",60075),debugBreakpointLogDisabled:f("debug-breakpoint-log-disabled",60075),briefcase:f("briefcase",60076),broadcast:f("broadcast",60077),browser:f("browser",60078),bug:f("bug",60079),calendar:f("calendar",60080),caseSensitive:f("case-sensitive",60081),check:f("check",60082),checklist:f("checklist",60083),chevronDown:f("chevron-down",60084),chevronLeft:f("chevron-left",60085),chevronRight:f("chevron-right",60086),chevronUp:f("chevron-up",60087),chromeClose:f("chrome-close",60088),chromeMaximize:f("chrome-maximize",60089),chromeMinimize:f("chrome-minimize",60090),chromeRestore:f("chrome-restore",60091),circleOutline:f("circle-outline",60092),circle:f("circle",60092),debugBreakpointUnverified:f("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:f("terminal-decoration-incomplete",60092),circleSlash:f("circle-slash",60093),circuitBoard:f("circuit-board",60094),clearAll:f("clear-all",60095),clippy:f("clippy",60096),closeAll:f("close-all",60097),cloudDownload:f("cloud-download",60098),cloudUpload:f("cloud-upload",60099),code:f("code",60100),collapseAll:f("collapse-all",60101),colorMode:f("color-mode",60102),commentDiscussion:f("comment-discussion",60103),creditCard:f("credit-card",60105),dash:f("dash",60108),dashboard:f("dashboard",60109),database:f("database",60110),debugContinue:f("debug-continue",60111),debugDisconnect:f("debug-disconnect",60112),debugPause:f("debug-pause",60113),debugRestart:f("debug-restart",60114),debugStart:f("debug-start",60115),debugStepInto:f("debug-step-into",60116),debugStepOut:f("debug-step-out",60117),debugStepOver:f("debug-step-over",60118),debugStop:f("debug-stop",60119),debug:f("debug",60120),deviceCameraVideo:f("device-camera-video",60121),deviceCamera:f("device-camera",60122),deviceMobile:f("device-mobile",60123),diffAdded:f("diff-added",60124),diffIgnored:f("diff-ignored",60125),diffModified:f("diff-modified",60126),diffRemoved:f("diff-removed",60127),diffRenamed:f("diff-renamed",60128),diff:f("diff",60129),diffSidebyside:f("diff-sidebyside",60129),discard:f("discard",60130),editorLayout:f("editor-layout",60131),emptyWindow:f("empty-window",60132),exclude:f("exclude",60133),extensions:f("extensions",60134),eyeClosed:f("eye-closed",60135),fileBinary:f("file-binary",60136),fileCode:f("file-code",60137),fileMedia:f("file-media",60138),filePdf:f("file-pdf",60139),fileSubmodule:f("file-submodule",60140),fileSymlinkDirectory:f("file-symlink-directory",60141),fileSymlinkFile:f("file-symlink-file",60142),fileZip:f("file-zip",60143),files:f("files",60144),filter:f("filter",60145),flame:f("flame",60146),foldDown:f("fold-down",60147),foldUp:f("fold-up",60148),fold:f("fold",60149),folderActive:f("folder-active",60150),folderOpened:f("folder-opened",60151),gear:f("gear",60152),gift:f("gift",60153),gistSecret:f("gist-secret",60154),gist:f("gist",60155),gitCommit:f("git-commit",60156),gitCompare:f("git-compare",60157),compareChanges:f("compare-changes",60157),gitMerge:f("git-merge",60158),githubAction:f("github-action",60159),githubAlt:f("github-alt",60160),globe:f("globe",60161),grabber:f("grabber",60162),graph:f("graph",60163),gripper:f("gripper",60164),heart:f("heart",60165),home:f("home",60166),horizontalRule:f("horizontal-rule",60167),hubot:f("hubot",60168),inbox:f("inbox",60169),issueReopened:f("issue-reopened",60171),issues:f("issues",60172),italic:f("italic",60173),jersey:f("jersey",60174),json:f("json",60175),bracket:f("bracket",60175),kebabVertical:f("kebab-vertical",60176),key:f("key",60177),law:f("law",60178),lightbulbAutofix:f("lightbulb-autofix",60179),linkExternal:f("link-external",60180),link:f("link",60181),listOrdered:f("list-ordered",60182),listUnordered:f("list-unordered",60183),liveShare:f("live-share",60184),loading:f("loading",60185),location:f("location",60186),mailRead:f("mail-read",60187),mail:f("mail",60188),markdown:f("markdown",60189),megaphone:f("megaphone",60190),mention:f("mention",60191),milestone:f("milestone",60192),gitPullRequestMilestone:f("git-pull-request-milestone",60192),mortarBoard:f("mortar-board",60193),move:f("move",60194),multipleWindows:f("multiple-windows",60195),mute:f("mute",60196),noNewline:f("no-newline",60197),note:f("note",60198),octoface:f("octoface",60199),openPreview:f("open-preview",60200),package:f("package",60201),paintcan:f("paintcan",60202),pin:f("pin",60203),play:f("play",60204),run:f("run",60204),plug:f("plug",60205),preserveCase:f("preserve-case",60206),preview:f("preview",60207),project:f("project",60208),pulse:f("pulse",60209),question:f("question",60210),quote:f("quote",60211),radioTower:f("radio-tower",60212),reactions:f("reactions",60213),references:f("references",60214),refresh:f("refresh",60215),regex:f("regex",60216),remoteExplorer:f("remote-explorer",60217),remote:f("remote",60218),remove:f("remove",60219),replaceAll:f("replace-all",60220),replace:f("replace",60221),repoClone:f("repo-clone",60222),repoForcePush:f("repo-force-push",60223),repoPull:f("repo-pull",60224),repoPush:f("repo-push",60225),report:f("report",60226),requestChanges:f("request-changes",60227),rocket:f("rocket",60228),rootFolderOpened:f("root-folder-opened",60229),rootFolder:f("root-folder",60230),rss:f("rss",60231),ruby:f("ruby",60232),saveAll:f("save-all",60233),saveAs:f("save-as",60234),save:f("save",60235),screenFull:f("screen-full",60236),screenNormal:f("screen-normal",60237),searchStop:f("search-stop",60238),server:f("server",60240),settingsGear:f("settings-gear",60241),settings:f("settings",60242),shield:f("shield",60243),smiley:f("smiley",60244),sortPrecedence:f("sort-precedence",60245),splitHorizontal:f("split-horizontal",60246),splitVertical:f("split-vertical",60247),squirrel:f("squirrel",60248),starFull:f("star-full",60249),starHalf:f("star-half",60250),symbolClass:f("symbol-class",60251),symbolColor:f("symbol-color",60252),symbolConstant:f("symbol-constant",60253),symbolEnumMember:f("symbol-enum-member",60254),symbolField:f("symbol-field",60255),symbolFile:f("symbol-file",60256),symbolInterface:f("symbol-interface",60257),symbolKeyword:f("symbol-keyword",60258),symbolMisc:f("symbol-misc",60259),symbolOperator:f("symbol-operator",60260),symbolProperty:f("symbol-property",60261),wrench:f("wrench",60261),wrenchSubaction:f("wrench-subaction",60261),symbolSnippet:f("symbol-snippet",60262),tasklist:f("tasklist",60263),telescope:f("telescope",60264),textSize:f("text-size",60265),threeBars:f("three-bars",60266),thumbsdown:f("thumbsdown",60267),thumbsup:f("thumbsup",60268),tools:f("tools",60269),triangleDown:f("triangle-down",60270),triangleLeft:f("triangle-left",60271),triangleRight:f("triangle-right",60272),triangleUp:f("triangle-up",60273),twitter:f("twitter",60274),unfold:f("unfold",60275),unlock:f("unlock",60276),unmute:f("unmute",60277),unverified:f("unverified",60278),verified:f("verified",60279),versions:f("versions",60280),vmActive:f("vm-active",60281),vmOutline:f("vm-outline",60282),vmRunning:f("vm-running",60283),watch:f("watch",60284),whitespace:f("whitespace",60285),wholeWord:f("whole-word",60286),window:f("window",60287),wordWrap:f("word-wrap",60288),zoomIn:f("zoom-in",60289),zoomOut:f("zoom-out",60290),listFilter:f("list-filter",60291),listFlat:f("list-flat",60292),listSelection:f("list-selection",60293),selection:f("selection",60293),listTree:f("list-tree",60294),debugBreakpointFunctionUnverified:f("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:f("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:f("debug-breakpoint-function-disabled",60296),debugStackframeActive:f("debug-stackframe-active",60297),circleSmallFilled:f("circle-small-filled",60298),debugStackframeDot:f("debug-stackframe-dot",60298),terminalDecorationMark:f("terminal-decoration-mark",60298),debugStackframe:f("debug-stackframe",60299),debugStackframeFocused:f("debug-stackframe-focused",60299),debugBreakpointUnsupported:f("debug-breakpoint-unsupported",60300),symbolString:f("symbol-string",60301),debugReverseContinue:f("debug-reverse-continue",60302),debugStepBack:f("debug-step-back",60303),debugRestartFrame:f("debug-restart-frame",60304),debugAlt:f("debug-alt",60305),callIncoming:f("call-incoming",60306),callOutgoing:f("call-outgoing",60307),menu:f("menu",60308),expandAll:f("expand-all",60309),feedback:f("feedback",60310),gitPullRequestReviewer:f("git-pull-request-reviewer",60310),groupByRefType:f("group-by-ref-type",60311),ungroupByRefType:f("ungroup-by-ref-type",60312),account:f("account",60313),gitPullRequestAssignee:f("git-pull-request-assignee",60313),bellDot:f("bell-dot",60314),debugConsole:f("debug-console",60315),library:f("library",60316),output:f("output",60317),runAll:f("run-all",60318),syncIgnored:f("sync-ignored",60319),pinned:f("pinned",60320),githubInverted:f("github-inverted",60321),serverProcess:f("server-process",60322),serverEnvironment:f("server-environment",60323),pass:f("pass",60324),issueClosed:f("issue-closed",60324),stopCircle:f("stop-circle",60325),playCircle:f("play-circle",60326),record:f("record",60327),debugAltSmall:f("debug-alt-small",60328),vmConnect:f("vm-connect",60329),cloud:f("cloud",60330),merge:f("merge",60331),export:f("export",60332),graphLeft:f("graph-left",60333),magnet:f("magnet",60334),notebook:f("notebook",60335),redo:f("redo",60336),checkAll:f("check-all",60337),pinnedDirty:f("pinned-dirty",60338),passFilled:f("pass-filled",60339),circleLargeFilled:f("circle-large-filled",60340),circleLarge:f("circle-large",60341),circleLargeOutline:f("circle-large-outline",60341),combine:f("combine",60342),gather:f("gather",60342),table:f("table",60343),variableGroup:f("variable-group",60344),typeHierarchy:f("type-hierarchy",60345),typeHierarchySub:f("type-hierarchy-sub",60346),typeHierarchySuper:f("type-hierarchy-super",60347),gitPullRequestCreate:f("git-pull-request-create",60348),runAbove:f("run-above",60349),runBelow:f("run-below",60350),notebookTemplate:f("notebook-template",60351),debugRerun:f("debug-rerun",60352),workspaceTrusted:f("workspace-trusted",60353),workspaceUntrusted:f("workspace-untrusted",60354),workspaceUnknown:f("workspace-unknown",60355),terminalCmd:f("terminal-cmd",60356),terminalDebian:f("terminal-debian",60357),terminalLinux:f("terminal-linux",60358),terminalPowershell:f("terminal-powershell",60359),terminalTmux:f("terminal-tmux",60360),terminalUbuntu:f("terminal-ubuntu",60361),terminalBash:f("terminal-bash",60362),arrowSwap:f("arrow-swap",60363),copy:f("copy",60364),personAdd:f("person-add",60365),filterFilled:f("filter-filled",60366),wand:f("wand",60367),debugLineByLine:f("debug-line-by-line",60368),inspect:f("inspect",60369),layers:f("layers",60370),layersDot:f("layers-dot",60371),layersActive:f("layers-active",60372),compass:f("compass",60373),compassDot:f("compass-dot",60374),compassActive:f("compass-active",60375),azure:f("azure",60376),issueDraft:f("issue-draft",60377),gitPullRequestClosed:f("git-pull-request-closed",60378),gitPullRequestDraft:f("git-pull-request-draft",60379),debugAll:f("debug-all",60380),debugCoverage:f("debug-coverage",60381),runErrors:f("run-errors",60382),folderLibrary:f("folder-library",60383),debugContinueSmall:f("debug-continue-small",60384),beakerStop:f("beaker-stop",60385),graphLine:f("graph-line",60386),graphScatter:f("graph-scatter",60387),pieChart:f("pie-chart",60388),bracketDot:f("bracket-dot",60389),bracketError:f("bracket-error",60390),lockSmall:f("lock-small",60391),azureDevops:f("azure-devops",60392),verifiedFilled:f("verified-filled",60393),newline:f("newline",60394),layout:f("layout",60395),layoutActivitybarLeft:f("layout-activitybar-left",60396),layoutActivitybarRight:f("layout-activitybar-right",60397),layoutPanelLeft:f("layout-panel-left",60398),layoutPanelCenter:f("layout-panel-center",60399),layoutPanelJustify:f("layout-panel-justify",60400),layoutPanelRight:f("layout-panel-right",60401),layoutPanel:f("layout-panel",60402),layoutSidebarLeft:f("layout-sidebar-left",60403),layoutSidebarRight:f("layout-sidebar-right",60404),layoutStatusbar:f("layout-statusbar",60405),layoutMenubar:f("layout-menubar",60406),layoutCentered:f("layout-centered",60407),target:f("target",60408),indent:f("indent",60409),recordSmall:f("record-small",60410),errorSmall:f("error-small",60411),terminalDecorationError:f("terminal-decoration-error",60411),arrowCircleDown:f("arrow-circle-down",60412),arrowCircleLeft:f("arrow-circle-left",60413),arrowCircleRight:f("arrow-circle-right",60414),arrowCircleUp:f("arrow-circle-up",60415),layoutSidebarRightOff:f("layout-sidebar-right-off",60416),layoutPanelOff:f("layout-panel-off",60417),layoutSidebarLeftOff:f("layout-sidebar-left-off",60418),blank:f("blank",60419),heartFilled:f("heart-filled",60420),map:f("map",60421),mapHorizontal:f("map-horizontal",60421),foldHorizontal:f("fold-horizontal",60421),mapFilled:f("map-filled",60422),mapHorizontalFilled:f("map-horizontal-filled",60422),foldHorizontalFilled:f("fold-horizontal-filled",60422),circleSmall:f("circle-small",60423),bellSlash:f("bell-slash",60424),bellSlashDot:f("bell-slash-dot",60425),commentUnresolved:f("comment-unresolved",60426),gitPullRequestGoToChanges:f("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:f("git-pull-request-new-changes",60428),searchFuzzy:f("search-fuzzy",60429),commentDraft:f("comment-draft",60430),send:f("send",60431),sparkle:f("sparkle",60432),insert:f("insert",60433),mic:f("mic",60434),thumbsdownFilled:f("thumbsdown-filled",60435),thumbsupFilled:f("thumbsup-filled",60436),coffee:f("coffee",60437),snake:f("snake",60438),game:f("game",60439),vr:f("vr",60440),chip:f("chip",60441),piano:f("piano",60442),music:f("music",60443),micFilled:f("mic-filled",60444),repoFetch:f("repo-fetch",60445),copilot:f("copilot",60446),lightbulbSparkle:f("lightbulb-sparkle",60447),robot:f("robot",60448),sparkleFilled:f("sparkle-filled",60449),diffSingle:f("diff-single",60450),diffMultiple:f("diff-multiple",60451),surroundWith:f("surround-with",60452),share:f("share",60453),gitStash:f("git-stash",60454),gitStashApply:f("git-stash-apply",60455),gitStashPop:f("git-stash-pop",60456),vscode:f("vscode",60457),vscodeInsiders:f("vscode-insiders",60458),codeOss:f("code-oss",60459),runCoverage:f("run-coverage",60460),runAllCoverage:f("run-all-coverage",60461),coverage:f("coverage",60462),githubProject:f("github-project",60463),mapVertical:f("map-vertical",60464),foldVertical:f("fold-vertical",60464),mapVerticalFilled:f("map-vertical-filled",60465),foldVerticalFilled:f("fold-vertical-filled",60465),goToSearch:f("go-to-search",60466),percentage:f("percentage",60467),sortPercentage:f("sort-percentage",60467),attach:f("attach",60468),goToEditingSession:f("go-to-editing-session",60469),editSession:f("edit-session",60470),codeReview:f("code-review",60471),copilotWarning:f("copilot-warning",60472),python:f("python",60473),copilotLarge:f("copilot-large",60474),copilotWarningLarge:f("copilot-warning-large",60475),keyboardTab:f("keyboard-tab",60476),copilotBlocked:f("copilot-blocked",60477),copilotNotConnected:f("copilot-not-connected",60478),flag:f("flag",60479),lightbulbEmpty:f("lightbulb-empty",60480),symbolMethodArrow:f("symbol-method-arrow",60481),copilotUnavailable:f("copilot-unavailable",60482),repoPinned:f("repo-pinned",60483),keyboardTabAbove:f("keyboard-tab-above",60484),keyboardTabBelow:f("keyboard-tab-below",60485),gitPullRequestDone:f("git-pull-request-done",60486),mcp:f("mcp",60487),extensionsLarge:f("extensions-large",60488),layoutPanelDock:f("layout-panel-dock",60489),layoutSidebarLeftDock:f("layout-sidebar-left-dock",60490),layoutSidebarRightDock:f("layout-sidebar-right-dock",60491),copilotInProgress:f("copilot-in-progress",60492),copilotError:f("copilot-error",60493),copilotSuccess:f("copilot-success",60494),chatSparkle:f("chat-sparkle",60495),searchSparkle:f("search-sparkle",60496),editSparkle:f("edit-sparkle",60497),copilotSnooze:f("copilot-snooze",60498),sendToRemoteAgent:f("send-to-remote-agent",60499),commentDiscussionSparkle:f("comment-discussion-sparkle",60500),chatSparkleWarning:f("chat-sparkle-warning",60501),chatSparkleError:f("chat-sparkle-error",60502),collection:f("collection",60503),newCollection:f("new-collection",60504),thinking:f("thinking",60505),build:f("build",60506),commentDiscussionQuote:f("comment-discussion-quote",60507),cursor:f("cursor",60508),eraser:f("eraser",60509),fileText:f("file-text",60510),quotes:f("quotes",60512),rename:f("rename",60513),runWithDeps:f("run-with-deps",60514),debugConnected:f("debug-connected",60515),strikethrough:f("strikethrough",60516),openInProduct:f("open-in-product",60517),indexZero:f("index-zero",60518),agent:f("agent",60519),editCode:f("edit-code",60520),repoSelected:f("repo-selected",60521),skip:f("skip",60522),mergeInto:f("merge-into",60523),gitBranchChanges:f("git-branch-changes",60524),gitBranchStagedChanges:f("git-branch-staged-changes",60525),gitBranchConflicts:f("git-branch-conflicts",60526),gitBranch:f("git-branch",60527),gitBranchCreate:f("git-branch-create",60527),gitBranchDelete:f("git-branch-delete",60527),searchLarge:f("search-large",60528),terminalGitBash:f("terminal-git-bash",60529),windowActive:f("window-active",60530),forward:f("forward",60531),download:f("download",60532),clockface:f("clockface",60533),unarchive:f("unarchive",60534),sessionInProgress:f("session-in-progress",60535),collectionSmall:f("collection-small",60536),vmSmall:f("vm-small",60537),cloudSmall:f("cloud-small",60538),addSmall:f("add-small",60539),removeSmall:f("remove-small",60540),worktreeSmall:f("worktree-small",60541),worktree:f("worktree",60542),screenCut:f("screen-cut",60543),ask:f("ask",60544),openai:f("openai",60545),claude:f("claude",60546),openInWindow:f("open-in-window",60547)};var gH={dialogError:f("dialog-error","error"),dialogWarning:f("dialog-warning","warning"),dialogInfo:f("dialog-info","info"),dialogClose:f("dialog-close","close"),treeItemExpanded:f("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:f("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:f("tree-filter-on-type-off","list-selection"),treeFilterClear:f("tree-filter-clear","close"),treeItemLoading:f("tree-item-loading","loading"),menuSelection:f("menu-selection","check"),menuSubmenu:f("menu-submenu","chevron-right"),menuBarMore:f("menubar-more","more"),scrollbarButtonLeft:f("scrollbar-button-left","triangle-left"),scrollbarButtonRight:f("scrollbar-button-right","triangle-right"),scrollbarButtonUp:f("scrollbar-button-up","triangle-up"),scrollbarButtonDown:f("scrollbar-button-down","triangle-down"),toolBarMore:f("toolbar-more","more"),quickInputBack:f("quick-input-back","arrow-left"),dropDownButton:f("drop-down-button",60084),symbolCustomColor:f("symbol-customcolor",60252),exportIcon:f("export",60332),workspaceUnspecified:f("workspace-unspecified",60355),newLine:f("newline",60394),thumbsDownFilled:f("thumbsdown-filled",60435),thumbsUpFilled:f("thumbsup-filled",60436),gitFetch:f("git-fetch",60445),lightbulbSparkleAutofix:f("lightbulb-sparkle-autofix",60447),debugBreakpointPending:f("debug-breakpoint-pending",60377)},le={...HM,...gH};var Nc;(e=>{function r(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}e.isThemeColor=r})(Nc||={});var vt;(S=>{S.iconNameSegment="[A-Za-z0-9]+",S.iconNameExpression="[A-Za-z0-9-]+",S.iconModifierExpression="~[A-Za-z]+",S.iconNameCharacter="[A-Za-z0-9~-]";let o=new RegExp(`^(${S.iconNameExpression})(${S.iconModifierExpression})?$`);function i(T){let P=o.exec(T.id);if(!P)return i(le.error);let[,L,Y]=P,G=["codicon","codicon-"+L];return Y&&G.push("codicon-modifier-"+Y.substring(1)),G}S.asClassNameArray=i;function s(T){return i(T).join(" ")}S.asClassName=s;function a(T){return"."+i(T).join(".")}S.asCSSSelector=a;function l(T){return!!T&&typeof T=="object"&&typeof T.id=="string"&&(typeof T.color>"u"||Nc.isThemeColor(T.color))}S.isThemeIcon=l;let d=new RegExp(`^\\$\\((${S.iconNameExpression}(?:${S.iconModifierExpression})?)\\)$`);function c(T){let P=d.exec(T);if(!P)return;let[,L]=P;return{id:L}}S.fromString=c;function u(T){return{id:T}}S.fromId=u;function m(T,P){let L=T.id,Y=L.lastIndexOf("~");return Y!==-1&&(L=L.substring(0,Y)),P&&(L=`${L}~${P}`),{id:L}}S.modify=m;function g(T){let P=T.id.lastIndexOf("~");if(P!==-1)return T.id.substring(P+1)}S.getModifier=g;function v(T,P){return T.id===P.id&&T.color?.id===P.color?.id}S.isEqual=v;function h(T){return T?.id===le.file.id}S.isFile=h;function x(T){return T?.id===le.folder.id}S.isFolder=x})(vt||={});var bE=new RegExp(`\\$\\(${vt.iconNameExpression}(?:${vt.iconModifierExpression})?\\)`,"g"),fH=new RegExp(`(\\\\)?${bE.source}`,"g");function VM(r){return r.replace(fH,(e,t)=>t?e:`\\${e}`)}var Ez=new RegExp(`\\\\${bE.source}`,"g");var wz=new RegExp(`(\\s)?(\\\\)?${bE.source}(\\s)?`,"g");var kz=new RegExp(`\\$\\(${vt.iconNameCharacter}+\\)`,"g");var fo=class r{static lift(e){let t=new r(e.value,e);return t.uris=e.uris,t.baseUri=e.baseUri?y.revive(e.baseUri):void 0,t}constructor(e="",t=!1){if(this.value=e,typeof this.value!="string")throw De("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1,this.supportAlertSyntax=t.supportAlertSyntax??!1)}appendText(e,t=0){return this.value+=hH(this.supportThemeIcons?VM(e):e).replace(/([ \t]+)/g,(n,o)=>"&nbsp;".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
`:`

`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`
${vH(t,e)}
`,this}appendLink(e,t,n){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,t){let n=new RegExp(or(t),"g");return e.replace(n,(o,i)=>e.charAt(i-1)!=="\\"?`\\${o}`:o)}};function Mr(r){return r instanceof fo?!0:r&&typeof r=="object"?typeof r.value=="string"&&(typeof r.isTrusted=="boolean"||typeof r.isTrusted=="object"||r.isTrusted===void 0)&&(typeof r.supportThemeIcons=="boolean"||r.supportThemeIcons===void 0)&&(typeof r.supportAlertSyntax=="boolean"||r.supportAlertSyntax===void 0):!1}function hH(r){return r.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function vH(r,e){let t=r.match(/^`+/gm)?.reduce((o,i)=>o.length>i.length?o:i).length??0,n=t>=3?t+1:3;return[`${"`".repeat(n)}${e}`,r,`${"`".repeat(n)}`].join(`
`)}function BM(r){let e=[],t=r.split("|").map(o=>o.trim());r=t[0];let n=t[1];if(n){let o=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=o?o[1]:"",a=i?i[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(s));l&&e.push(`width="${a}"`),d&&e.push(`height="${s}"`)}return{href:r,dimensions:e}}function xE(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jl=xE();function GM(r){jl=r}var jM=/[&<>"']/,yH=new RegExp(jM.source,"g"),QM=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,IH=new RegExp(QM.source,"g"),xH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},WM=r=>xH[r];function Vo(r,e){if(e){if(jM.test(r))return r.replace(yH,WM)}else if(QM.test(r))return r.replace(IH,WM);return r}var SH=/(^|[^\[])\^/g;function Rt(r,e){let t=typeof r=="string"?r:r.source;e=e||"";let n={replace:(o,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(SH,"$1"),t=t.replace(o,s),n},getRegex:()=>new RegExp(t,e)};return n}function $M(r){try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}var bg={exec:()=>null};function zM(r,e){let t=r.replace(/\|/g,(i,s,a)=>{let l=!1,d=s;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function hg(r,e,t){let n=r.length;if(n===0)return"";let o=0;for(;o<n;){let i=r.charAt(n-o-1);if(i===e&&!t)o++;else if(i!==e&&t)o++;else break}return r.slice(0,n-o)}function CH(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])t++;else if(r[n]===e[1]&&(t--,t<0))return n;return-1}function KM(r,e,t,n){let o=e.href,i=e.title?Vo(e.title):null,s=r[1].replace(/\\([\[\]])/g,"$1");if(r[0].charAt(0)!=="!"){n.state.inLink=!0;let a={type:"link",raw:t,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:o,title:i,text:Vo(s)}}function TH(r,e){let t=r.match(/^(\s+)(?:```)/);if(t===null)return e;let n=t[1];return e.split(`
`).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(`
`)}var Fc=class{options;rules;lexer;constructor(e){this.options=e||jl}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:hg(n,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],o=TH(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:o}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){let o=hg(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:hg(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=hg(t[0],`
`).split(`
`),o="",i="",s=[];for(;n.length>0;){let a=!1,l=[],d;for(d=0;d<n.length;d++)if(/^ {0,3}>/.test(n[d]))l.push(n[d]),a=!0;else if(!a)l.push(n[d]);else break;n=n.slice(d);let c=l.join(`
`),u=c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
    $1`).replace(/^ {0,3}>[ \t]?/gm,"");o=o?`${o}
${c}`:c,i=i?`${i}
${u}`:u;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=m,n.length===0)break;let g=s[s.length-1];if(g?.type==="code")break;if(g?.type==="blockquote"){let v=g,h=v.raw+`
`+n.join(`
`),x=this.blockquote(h);s[s.length-1]=x,o=o.substring(0,o.length-v.raw.length)+x.raw,i=i.substring(0,i.length-v.text.length)+x.text;break}else if(g?.type==="list"){let v=g,h=v.raw+`
`+n.join(`
`),x=this.list(h);s[s.length-1]=x,o=o.substring(0,o.length-g.raw.length)+x.raw,i=i.substring(0,i.length-v.raw.length)+x.raw,n=h.substring(s[s.length-1].raw.length).split(`
`);continue}}return{type:"blockquote",raw:o,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let s=new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`),a=!1;for(;e;){let l=!1,d="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let u=t[2].split(`
`,1)[0].replace(/^\t+/,S=>" ".repeat(3*S.length)),m=e.split(`
`,1)[0],g=!u.trim(),v=0;if(this.options.pedantic?(v=2,c=u.trimStart()):g?v=t[1].length+1:(v=t[2].search(/[^ ]/),v=v>4?1:v,c=u.slice(v),v+=t[1].length),g&&/^ *$/.test(m)&&(d+=m+`
`,e=e.substring(m.length+1),l=!0),!l){let S=new RegExp(`^ {0,${Math.min(3,v-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),T=new RegExp(`^ {0,${Math.min(3,v-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),P=new RegExp(`^ {0,${Math.min(3,v-1)}}(?:\`\`\`|~~~)`),L=new RegExp(`^ {0,${Math.min(3,v-1)}}#`);for(;e;){let Y=e.split(`
`,1)[0];if(m=Y,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),P.test(m)||L.test(m)||S.test(m)||T.test(e))break;if(m.search(/[^ ]/)>=v||!m.trim())c+=`
`+m.slice(v);else{if(g||u.search(/[^ ]/)>=4||P.test(u)||L.test(u)||T.test(u))break;c+=`
`+m}!g&&!m.trim()&&(g=!0),d+=Y+`
`,e=e.substring(Y.length+1),u=m.slice(v)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(d)&&(a=!0));let h=null,x;this.options.gfm&&(h=/^\[[ xX]\] /.exec(c),h&&(x=h[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:d,task:!!h,checked:x,loose:!1,text:c,tokens:[]}),i.raw+=d}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let l=0;l<i.items.length;l++)if(this.lexer.state.top=!1,i.items[l].tokens=this.lexer.blockTokens(i.items[l].text,[]),!i.loose){let d=i.items[l].tokens.filter(u=>u.type==="space"),c=d.length>0&&d.some(u=>/\n.*\n/.test(u.raw));i.loose=c}if(i.loose)for(let l=0;l<i.items.length;l++)i.items[l].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(/\s+/g," "),o=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:o,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=zM(t[1]),o=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===o.length){for(let a of o)/^ *-+: *$/.test(a)?s.align.push("right"):/^ *:-+: *$/.test(a)?s.align.push("center"):/^ *:-+ *$/.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(zM(a,s.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[d]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Vo(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let s=hg(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=CH(t[2],"()");if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let o=t[2],i="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),KM(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let o=(n[2]||n[1]).replace(/\s+/g," "),i=t[o.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return KM(n,i,n[0],this.lexer)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrongLDelim.exec(e);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...o[0]].length-1,a,l,d=s,c=0,u=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(o=u.exec(t))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){d+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+c);let m=[...o[0]][0].length,g=e.slice(0,s+o.index+m+l);if(Math.min(s,l)%2){let h=g.slice(1,-1);return{type:"em",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}let v=g.slice(2,-2);return{type:"strong",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," "),o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=Vo(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,o;return t[2]==="@"?(n=Vo(t[1]),o="mailto:"+n):(n=Vo(t[1]),o=n),{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,o;if(t[2]==="@")n=Vo(t[0]),o="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=Vo(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Vo(t[0]),{type:"text",raw:t[0],text:n}}}},EH=/^(?: *(?:\n|$))+/,wH=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,kH=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ig=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_H=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,JM=/(?:[*+-]|\d{1,9}[.)])/,XM=Rt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,JM).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),SE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,PH=/^[^\n]+/,CE=/(?!\s*\])(?:\\.|[^\[\]\\])+/,DH=Rt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",CE).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),RH=Rt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,JM).getRegex(),Wv="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",TE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MH=Rt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",TE).replace("tag",Wv).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),YM=Rt(SE).replace("hr",Ig).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wv).getRegex(),AH=Rt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",YM).getRegex(),EE={blockquote:AH,code:wH,def:DH,fences:kH,heading:_H,hr:Ig,html:MH,lheading:XM,list:RH,newline:EH,paragraph:YM,table:bg,text:PH},qM=Rt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ig).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wv).getRegex(),LH={...EE,table:qM,paragraph:Rt(SE).replace("hr",Ig).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qM).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wv).getRegex()},OH={...EE,html:Rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",TE).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bg,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Rt(SE).replace("hr",Ig).replace("heading",` *#{1,6} *[^
]`).replace("lheading",XM).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ZM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,NH=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,eA=/^( {2,}|\\)\n(?!\s*$)/,UH=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xg="\\p{P}\\p{S}",FH=Rt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,xg).getRegex(),HH=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,VH=Rt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,xg).getRegex(),BH=Rt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,xg).getRegex(),WH=Rt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,xg).getRegex(),$H=Rt(/\\([punct])/,"gu").replace(/punct/g,xg).getRegex(),zH=Rt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),KH=Rt(TE).replace("(?:-->|$)","-->").getRegex(),qH=Rt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",KH).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bv=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,GH=Rt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Bv).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tA=Rt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bv).replace("ref",CE).getRegex(),nA=Rt(/^!?\[(ref)\](?:\[\])?/).replace("ref",CE).getRegex(),jH=Rt("reflink|nolink(?!\\()","g").replace("reflink",tA).replace("nolink",nA).getRegex(),wE={_backpedal:bg,anyPunctuation:$H,autolink:zH,blockSkip:HH,br:eA,code:NH,del:bg,emStrongLDelim:VH,emStrongRDelimAst:BH,emStrongRDelimUnd:WH,escape:ZM,link:GH,nolink:nA,punctuation:FH,reflink:tA,reflinkSearch:jH,tag:qH,text:UH,url:bg},QH={...wE,link:Rt(/^!?\[(label)\]\((.*?)\)/).replace("label",Bv).getRegex(),reflink:Rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bv).getRegex()},yE={...wE,escape:Rt(ZM).replace("])","~|])").getRegex(),url:Rt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},JH={...yE,br:Rt(eA).replace("{2,}","*").getRegex(),text:Rt(yE.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vv={normal:EE,gfm:LH,pedantic:OH},vg={normal:wE,gfm:yE,breaks:JH,pedantic:QH},rs=class r{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jl,this.options.tokenizer=this.options.tokenizer||new Fc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:Vv.normal,inline:vg.normal};this.options.pedantic?(t.block=Vv.pedantic,t.inline=vg.pedantic):this.options.gfm&&(t.block=Vv.gfm,this.options.breaks?t.inline=vg.breaks:t.inline=vg.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vv,inline:vg}}static lex(e,t){return new r(t).lex(e)}static lexInline(e,t){return new r(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic?e=e.replace(/\t/g,"    ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,d)=>l+"    ".repeat(d.length));let o,i,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(o=a.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))){if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length),o.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+o.raw,i.text+=`
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(s=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=e.slice(1),d;this.options.extensions.startBlock.forEach(c=>{d=c.call({lexer:this},l),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){i=t[t.length-1],n&&i?.type==="paragraph"?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(o),n=s.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(o);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,o,i,s=e,a,l,d;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(d=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(n=c.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),o=t[t.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),o=t[t.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,d)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0,u=e.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},u),typeof m=="number"&&m>=0&&(c=Math.min(c,m))}),c<1/0&&c>=0&&(i=e.substring(0,c+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(d=n.raw.slice(-1)),l=!0,o=t[t.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},Hc=class{options;parser;constructor(e){this.options=e||jl}space(e){return""}code({text:e,lang:t,escaped:n}){let o=(t||"").match(/^\S*/)?.[0],i=e.replace(/\n$/,"")+`
`;return o?'<pre><code class="language-'+Vo(o)+'">'+(n?i:Vo(i,!0))+`</code></pre>
`:"<pre><code>"+(n?i:Vo(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,n=e.start,o="";for(let a=0;a<e.items.length;a++){let l=e.items[a];o+=this.listitem(l)}let i=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
`+o+"</"+i+`>
`}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let o="";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+o+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let o=this.parser.parseInline(n),i=$M(e);if(i===null)return o;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+o+"</a>",s}image({href:e,title:t,text:n}){let o=$M(e);if(o===null)return n;e=o;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},yg=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},is=class r{options;renderer;textRenderer;constructor(e){this.options=e||jl,this.options.renderer=this.options.renderer||new Hc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new yg}static parse(e,t){return new r(t).parse(e)}static parseInline(e,t){return new r(t).parseInline(e)}parse(e,t=!0){let n="";for(let o=0;o<e.length;o++){let i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=l||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let a=s,l=this.renderer.text(a);for(;o+1<e.length&&e[o+1].type==="text";)a=e[++o],l+=`
`+this.renderer.text(a);t?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):n+=l;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let o=0;o<e.length;o++){let i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case"escape":{n+=t.text(s);break}case"html":{n+=t.html(s);break}case"link":{n+=t.link(s);break}case"image":{n+=t.image(s);break}case"strong":{n+=t.strong(s);break}case"em":{n+=t.em(s);break}case"codespan":{n+=t.codespan(s);break}case"br":{n+=t.br(s);break}case"del":{n+=t.del(s);break}case"text":{n+=t.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},Uc=class{options;constructor(e){this.options=e||jl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},IE=class{defaults=xE();options=this.setOptions;parse=this.parseMarkdown(rs.lex,is.parse);parseInline=this.parseMarkdown(rs.lexInline,is.parseInline);Parser=is;Renderer=Hc;TextRenderer=yg;Lexer=rs;Tokenizer=Fc;Hooks=Uc;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{let i=o;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),o.extensions=t),n.renderer){let i=this.defaults.renderer||new Hc(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=n.renderer[a],d=i[a];i[a]=(...c)=>{let u=l.apply(i,c);return u===!1&&(u=d.apply(i,c)),u||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Fc(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=n.tokenizer[a],d=i[a];i[a]=(...c)=>{let u=l.apply(i,c);return u===!1&&(u=d.apply(i,c)),u}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Uc;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;let a=s,l=n.hooks[a],d=i[a];Uc.passThroughHooks.has(s)?i[a]=c=>{if(this.defaults.async)return Promise.resolve(l.call(i,c)).then(m=>d.call(i,m));let u=l.call(i,c);return d.call(i,u)}:i[a]=(...c)=>{let u=l.apply(i,c);return u===!1&&(u=d.apply(i,c)),u}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rs.lex(e,t??this.defaults)}parser(e,t){return is.parse(e,t??this.defaults)}parseMarkdown(e,t){return(o,i)=>{let s={...i},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(o):o).then(d=>e(d,a)).then(d=>a.hooks?a.hooks.processAllTokens(d):d).then(d=>a.walkTokens?Promise.all(this.walkTokens(d,a.walkTokens)).then(()=>d):d).then(d=>t(d,a)).then(d=>a.hooks?a.hooks.postprocess(d):d).catch(l);try{a.hooks&&(o=a.hooks.preprocess(o));let d=e(o,a);a.hooks&&(d=a.hooks.processAllTokens(d)),a.walkTokens&&this.walkTokens(d,a.walkTokens);let c=t(d,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(d){return l(d)}}}onError(e,t){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let o="<p>An error occurred:</p><pre>"+Vo(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}}},Gl=new IE;function kt(r,e){return Gl.parse(r,e)}kt.options=kt.setOptions=function(r){return Gl.setOptions(r),kt.defaults=Gl.defaults,GM(kt.defaults),kt};kt.getDefaults=xE;kt.defaults=jl;kt.use=function(...r){return Gl.use(...r),kt.defaults=Gl.defaults,GM(kt.defaults),kt};kt.walkTokens=function(r,e){return Gl.walkTokens(r,e)};kt.parseInline=Gl.parseInline;kt.Parser=is;kt.parser=is.parse;kt.Renderer=Hc;kt.TextRenderer=yg;kt.Lexer=rs;kt.lexer=rs.lex;kt.Tokenizer=Fc;kt.Hooks=Uc;kt.parse=kt;var Nz=kt.options,Uz=kt.setOptions,Fz=kt.use,Hz=kt.walkTokens,Vz=kt.parseInline;var Bz=is.parse,Wz=rs.lex;function oA(r){return JSON.stringify(r,YH)}function $v(r){let e=JSON.parse(r);return e=$t(e),e}function YH(r,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function $t(r,e=0){if(!r||e>200)return r;if(typeof r=="object"){switch(r.$mid){case 1:return y.revive(r);case 2:return new RegExp(r.source,r.flags);case 17:return new Date(r.source)}if(r instanceof ee||r instanceof Uint8Array)return r;if(Array.isArray(r))for(let t=0;t<r.length;++t)r[t]=$t(r[t],e+1);else for(let t in r)Object.hasOwnProperty.call(r,t)&&(r[t]=$t(r[t],e+1))}return r}var eo=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"});var ZH=/^(.+)\/(.+?)(;.+)?$/;function kE(r,e){let t=ZH.exec(r);return t?`${t[1].toLowerCase()}/${t[2].toLowerCase()}${t[3]??""}`:e?void 0:r}function zv(r){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(r)}var to=Symbol("unset"),Kv=class{constructor(){this.root=new Sg;this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||It.empty()}get entries(){return this.root.children?.entries()||It.empty()}insert(e,t,n){this.opNode(e,o=>o._value=t,n)}mutate(e,t){this.opNode(e,n=>n._value=t(n._value===to?void 0:n._value))}mutatePath(e,t){this.opNode(e,()=>{},n=>t(n))}delete(e){let t=this.getPathToKey(e);if(!t)return;let n=t.length-1,o=t[n].node._value;if(o!==to){for(this._size--,t[n].node._value=to;n>0;n--){let{node:i,part:s}=t[n];if(i.children?.size||i._value!==to)break;t[n-1].node.children.delete(s)}return o}}*deleteRecursive(e){let t=this.getPathToKey(e);if(!t)return;let n=t[t.length-1].node;for(let o=t.length-1;o>0;o--){let i=t[o-1];if(i.node.children.delete(t[o].part),i.node.children.size>0||i.node._value!==to)break}for(let o of rA(n))o._value!==to&&(this._size--,yield o._value);n===this.root&&(this.root._value=to,this.root.children=void 0)}find(e){let t=this.root;for(let n of e){let o=t.children?.get(n);if(!o)return;t=o}return t._value===to?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(let n of e){let o=t.children?.get(n);if(!o)return!1;if(o._value!==to)return!0;t=o}return!1}hasKeyOrChildren(e){let t=this.root;for(let n of e){let o=t.children?.get(n);if(!o)return!1;t=o}return!0}hasKey(e){let t=this.root;for(let n of e){let o=t.children?.get(n);if(!o)return!1;t=o}return t._value!==to}getPathToKey(e){let t=[{part:"",node:this.root}],n=0;for(let o of e){let i=t[n].node.children?.get(o);if(!i)return;t.push({part:o,node:i}),n++}return t}opNode(e,t,n){let o=this.root;for(let a of e){if(o.children)if(o.children.has(a))o=o.children.get(a);else{let l=new Sg;o.children.set(a,l),o=l}else{let l=new Sg;o.children=new Map([[a,l]]),o=l}n?.(o)}let i=o._value===to?0:1;t(o);let s=o._value===to?0:1;this._size+=s-i}*values(){for(let{_value:e}of rA(this.root))e!==to&&(yield e)}};function*rA(r){let e=[r];for(;e.length>0;){let t=e.pop();if(yield t,t.children)for(let n of t.children.values())e.push(n)}}var Sg=class{constructor(){this._value=to}get value(){return this._value===to?void 0:this._value}set value(e){this._value=e===void 0?to:e}};var iA=new class{constructor(){this._zoomLevel=0;this._onDidChangeZoomLevel=new E;this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(r){r=Math.min(Math.max(-5,r),20),this._zoomLevel!==r&&(this._zoomLevel=r,this._onDidChangeZoomLevel.fire(this._zoomLevel))}};var e4=en?1.5:1.35,_E=8,PE=class r{constructor(e){this._bareFontInfoBrand=void 0;this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}static _create(e,t,n,o,i,s,a,l,d){s===0?s=e4*n:s<_E&&(s=s*n),s=Math.round(s),s<_E&&(s=_E);let c=1+(d?0:iA.getZoomLevel()*.1);return n*=c,s*=c,i===RE&&(t==="normal"||t==="bold"?i=DE:(i=`'wght' ${parseInt(t,10)}`,t="normal")),new r({pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:n,fontFeatureSettings:o,fontVariationSettings:i,lineHeight:s,letterSpacing:a})}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let e=Ar.fontFamily,t=r._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},t4=2,qv=class extends PE{constructor(t,n){super(t);this._editorStylingBrand=void 0;this.version=t4;this.isTrusted=n,this.isMonospace=t.isMonospace,this.typicalHalfwidthCharacterWidth=t.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=t.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=t.canUseHalfwidthRightwardsArrow,this.spaceWidth=t.spaceWidth,this.middotWidth=t.middotWidth,this.wsmiddotWidth=t.wsmiddotWidth,this.maxDigitWidth=t.maxDigitWidth}equals(t){return this.fontFamily===t.fontFamily&&this.fontWeight===t.fontWeight&&this.fontSize===t.fontSize&&this.fontFeatureSettings===t.fontFeatureSettings&&this.fontVariationSettings===t.fontVariationSettings&&this.lineHeight===t.lineHeight&&this.letterSpacing===t.letterSpacing&&this.typicalHalfwidthCharacterWidth===t.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===t.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===t.canUseHalfwidthRightwardsArrow&&this.spaceWidth===t.spaceWidth&&this.middotWidth===t.middotWidth&&this.wsmiddotWidth===t.wsmiddotWidth&&this.maxDigitWidth===t.maxDigitWidth}},DE="normal",RE="translate",n4="Consolas, 'Courier New', monospace",o4="Menlo, Monaco, 'Courier New', monospace",r4="'Droid Sans Mono', monospace",Ar={fontFamily:en?o4:Ct?n4:r4,fontWeight:"normal",fontSize:en?12:14,lineHeight:0,letterSpacing:0};var ME={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var AE="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function i4(r=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let t of AE)r.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}var s4=i4();function LE(r){let e=s4;if(r&&r instanceof RegExp)if(r.global)e=r;else{let t="g";r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.unicode&&(t+="u"),e=new RegExp(r.source,t)}return e.lastIndex=0,e}var sA=new qn;sA.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function OE(r,e,t,n,o){if(e=LE(e),o||(o=It.first(sA)),t.length>o.maxLen){let d=r-o.maxLen/2;return d<0?d=0:n+=d,t=t.substring(d,r+o.maxLen/2),OE(r,e,t,n,o)}let i=Date.now(),s=r-1-n,a=-1,l=null;for(let d=1;!(Date.now()-i>=o.timeBudget);d++){let c=s-o.windowSize*d;e.lastIndex=Math.max(0,c);let u=a4(e,t,s,a);if(!u&&l||(l=u,c<=0))break;a=c}if(l){let d={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function a4(r,e,t,n){let o;for(;o=r.exec(e);){let i=o.index||0;if(i<=t&&r.lastIndex>=t)return o;if(n>0&&i>n)return null}return null}var aA=M("accessibilityService");var hK=new w("accessibilityModeEnabled",!1);var l4=8;var NE=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},ht=class{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return Gv(e,t)}compute(e,t,n){return n}},Vc=class{constructor(e,t){this.newValue=e;this.didChange=t}};function Gv(r,e){if(typeof r!="object"||typeof e!="object"||!r||!e)return new Vc(e,r!==e);if(Array.isArray(r)||Array.isArray(e)){let n=Array.isArray(r)&&Array.isArray(e)&&Ht(r,e);return new Vc(e,!n)}let t=!1;for(let n in e)if(e.hasOwnProperty(n)){let o=Gv(r[n],e[n]);o.didChange&&(r[n]=o.newValue,t=!0)}return new Vc(r,t)}var pi=class{constructor(e,t){this.schema=void 0;this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return Gv(e,t)}validate(e){return this.defaultValue}},ma=class{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return Gv(e,t)}compute(e,t,n){return n}};function se(r,e){return typeof r>"u"?e:r==="false"?!1:!!r}var ye=class extends ma{constructor(e,t,n,o=void 0){typeof o<"u"&&(o.type="boolean",o.default=n),super(e,t,n,o)}validate(e){return se(e,this.defaultValue)}};function d4(r,e,t,n){if(typeof r=="string"&&(r=parseInt(r,10)),typeof r!="number"||isNaN(r))return e;let o=r;return o=Math.max(t,o),o=Math.min(n,o),o|0}var Je=class r extends ma{static clampedInt(e,t,n,o){return d4(e,t,n,o)}constructor(e,t,n,o,i,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=i),super(e,t,n,s),this.minimum=o,this.maximum=i}validate(e){return r.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}};var Co=class r extends ma{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,n,o,i,s,a){typeof i<"u"&&(i.type="number",i.default=n,i.minimum=s,i.maximum=a),super(e,t,n,i),this.validationFn=o,this.minimum=s,this.maximum=a}validate(e){return this.validationFn(r.float(e,this.defaultValue))}},Fn=class r extends ma{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,o=void 0){typeof o<"u"&&(o.type="string",o.default=n),super(e,t,n,o)}validate(e){return r.string(e,this.defaultValue)}};function ft(r,e,t,n){return typeof r!="string"?e:n&&r in n?n[r]:t.indexOf(r)===-1?e:r}var gt=class extends ma{constructor(e,t,n,o,i=void 0){typeof i<"u"&&(i.type="string",i.enum=o.slice(0),i.default=n),super(e,t,n,i),this._allowedValues=o}validate(e){return ft(e,this.defaultValue,this._allowedValues)}},Jl=class extends ht{constructor(e,t,n,o,i,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=i,a.default=o),super(e,t,n,a),this._allowedValues=i,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function c4(r){switch(r){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}var UE=class extends ht{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p(313,null),p(315,null),p(314,null)],default:"auto",tags:["accessibility"],description:p(312,null)})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}},FE=class extends ht{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p(343,null)},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p(342,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertSpace:se(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:se(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};function u4(r){switch(r){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var ww=(s=>(s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin",s))(ww||{});function lA(r){switch(r){case"line":return 1;case"block":return 2;case"underline":return 3;case"line-thin":return 4;case"block-outline":return 5;case"underline-thin":return 6}}var HE=class extends pi{constructor(){super(162,"")}compute(e,t,n){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(" ")}},VE=class extends ye{constructor(){super(45,"emptySelectionClipboard",!0,{description:p(466,null)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},BE=class extends ht{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:p(478,null)},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p(402,null),p(401,null),p(403,null)],description:p(484,null)},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[p(396,null),p(394,null),p(395,null)],description:p(477,null)},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p(480,null),included:en},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p(476,null)},"editor.find.loop":{type:"boolean",default:e.loop,description:p(482,null)},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[p(397,null),p(398,null)],description:p(481,null)},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[p(399,null),p(400,null)],description:p(483,null)},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:p(479,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{cursorMoveOnType:se(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:se(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":ft(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":ft(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:se(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:se(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:se(t.loop,this.defaultValue.loop),history:ft(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:ft(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}},WE=class r extends ht{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",r.OFF,{anyOf:[{type:"boolean",description:p(494,null)},{type:"string",description:p(493,null)}],description:p(495,null),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?r.OFF:e==="true"?r.ON:e:e?r.ON:r.OFF}},$E=class r extends ht{static{this.OFF=DE}static{this.TRANSLATE=RE}constructor(){super(63,"fontVariations",r.OFF,{anyOf:[{type:"boolean",description:p(497,null)},{type:"string",description:p(498,null)}],description:p(499,null),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?r.OFF:e==="true"?r.TRANSLATE:e:e?r.TRANSLATE:r.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}},zE=class extends pi{constructor(){super(59,new qv({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,n){return e.fontInfo}},KE=class extends pi{constructor(){super(161,1)}compute(e,t,n){return e.inputMode==="overtype"?t.get(92):t.get(34)}},qE=class extends pi{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}},GE=class extends pi{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}},jE=class extends ma{constructor(){super(61,"fontSize",Ar.fontSize,{type:"number",minimum:6,maximum:100,default:Ar.fontSize,description:p(496,null)})}validate(e){let t=Co.float(e,this.defaultValue);return t===0?Ar.fontSize:Co.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},QE=class r extends ht{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",Ar.fontWeight,{anyOf:[{type:"number",minimum:r.MINIMUM_VALUE,maximum:r.MAXIMUM_VALUE,errorMessage:p(501,null)},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:r.SUGGESTION_VALUES}],default:Ar.fontWeight,description:p(500,null)})}validate(e){return e==="normal"||e==="bold"?e:String(Je.clampedInt(e,Ar.fontWeight,r.MINIMUM_VALUE,r.MAXIMUM_VALUE))}},JE=class extends ht{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:[p(407,null),p(406,null),p(405,null)]},n=["","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:p(404,null)},"editor.gotoLocation.multipleDefinitions":{description:p(390,null),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p(393,null),...t},"editor.gotoLocation.multipleDeclarations":{description:p(389,null),...t},"editor.gotoLocation.multipleImplementations":{description:p(391,null),...t},"editor.gotoLocation.multipleReferences":{description:p(392,null),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:p(320,null)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:p(323,null)},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:p(319,null)},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:p(321,null)},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:p(322,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{multiple:ft(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:ft(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:ft(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:ft(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:ft(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:ft(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:ft(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Fn.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Fn.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Fn.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Fn.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Fn.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Fn.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},XE=class extends ht{constructor(){let e={enabled:"on",delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"string",enum:["on","off","onKeyboardModifier"],default:e.enabled,markdownEnumDescriptions:[p(510,null),p(509,null),p(511,null,en?"Command":"Control")],description:p(508,null)},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p(507,null)},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p(513,null)},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:p(512,null)},"editor.hover.above":{type:"boolean",default:e.above,description:p(506,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:ft(t.enabled,this.defaultValue.enabled,["on","off","onKeyboardModifier"]),delay:Je.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:se(t.sticky,this.defaultValue.sticky),hidingDelay:Je.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:se(t.above,this.defaultValue.above)}}};var YE=class r extends pi{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,n){return r.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,n=Math.floor(e.paddingTop/e.lineHeight),o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));let i=(n+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:i,minimapLineCount:s}}static _computeMinimapLayout(e,t){let n=e.outerWidth,o=e.outerHeight,i=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(i*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,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,u=e.minimap.renderCharacters,m=i>=2?Math.round(e.minimap.scale*2):e.minimap.scale,g=e.minimap.maxColumn,v=e.minimap.size,h=e.minimap.side,x=e.verticalScrollbarWidth,S=e.viewLineCount,T=e.remainingWidth,P=e.isViewportWrapping,L=u?2:3,Y=Math.floor(i*o),G=Y/i,z=!1,K=!1,Q=L*m,X=m/i,B=1;if(v==="fill"||v==="fit"){let{typicalViewportLineCount:re,extraLinesBeforeFirstLine:ie,extraLinesBeyondLastLine:we,desiredRatio:Ne,minimapLineCount:Ae}=r.computeContainedMinimapLineCount({viewLineCount:S,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:i});if(S/Ae>1)z=!0,K=!0,m=1,Q=1,X=m/i;else{let bt=!1,Ke=m+1;if(v==="fit"){let Kt=Math.ceil((ie+S+we)*Q);P&&a&&T<=t.stableFitRemainingWidth?(bt=!0,Ke=t.stableFitMaxMinimapScale):bt=Kt>Y}if(v==="fill"||bt){z=!0;let Kt=m;Q=Math.min(l*i,Math.max(1,Math.floor(1/Ne))),P&&a&&T<=t.stableFitRemainingWidth&&(Ke=t.stableFitMaxMinimapScale),m=Math.min(Ke,Math.max(1,Math.floor(Q/L))),m>Kt&&(B=Math.min(2,m/Kt)),X=m/i/B,Y=Math.ceil(Math.max(re,ie+S+we)*Q),P?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=T,t.stableFitMaxMinimapScale=m):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}let He=Math.floor(g*X),Ge=Math.min(He,Math.max(0,Math.floor((T-x-2)*X/(d+X)))+l4),Ve=Math.floor(i*Ge),ne=Ve/i;Ve=Math.floor(Ve*B);let te=u?1:2,Z=h==="left"?0:n-Ge-x;return{renderMinimap:te,minimapLeft:Z,minimapWidth:Ge,minimapHeightIsEditorHeight:z,minimapIsSampling:K,minimapScale:m,minimapLineHeight:Q,minimapCanvasInnerWidth:Ve,minimapCanvasInnerHeight:Y,minimapCanvasOuterWidth:ne,minimapCanvasOuterHeight:G}}static computeLayout(e,t){let n=t.outerWidth|0,o=t.outerHeight|0,i=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,u=e.get(154),m=u==="inherit"?e.get(153):u,g=m==="inherit"?e.get(149):m,v=e.get(152),h=t.isDominatedByLongLines,x=e.get(66),S=e.get(76).renderType!==0,T=e.get(77),P=e.get(119),L=e.get(96),Y=e.get(81),G=e.get(117),z=G.verticalScrollbarSize,K=G.verticalHasArrows,Q=G.arrowSize,X=G.horizontalScrollbarSize,B=e.get(52),He=e.get(126)!=="never",Ge=e.get(74);B&&He&&(Ge+=16);let Ve=0;if(S){let zn=Math.max(s,T);Ve=Math.round(zn*l)}let ne=0;x&&(ne=i*t.glyphMarginDecorationLaneCount);let te=0,Z=te+ne,re=Z+Ve,ie=re+Ge,we=n-ne-Ve-Ge,Ne=!1,Ae=!1,et=-1;e.get(2)===2&&m==="inherit"&&h?(Ne=!0,Ae=!0):g==="on"||g==="bounded"?Ae=!0:g==="wordWrapColumn"&&(et=v);let bt=r._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:i,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:P,paddingTop:L.top,paddingBottom:L.bottom,minimap:Y,verticalScrollbarWidth:z,viewLineCount:c,remainingWidth:we,isViewportWrapping:Ae},t.memory||new NE);bt.renderMinimap!==0&&bt.minimapLeft===0&&(te+=bt.minimapWidth,Z+=bt.minimapWidth,re+=bt.minimapWidth,ie+=bt.minimapWidth);let Ke=we-bt.minimapWidth,Kt=Math.max(1,Math.floor((Ke-z-2)/a)),nn=K?Q:0;return Ae&&(et=Math.max(1,Kt),g==="bounded"&&(et=Math.min(et,v))),{width:n,height:o,glyphMarginLeft:te,glyphMarginWidth:ne,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:Z,lineNumbersWidth:Ve,decorationsLeft:re,decorationsWidth:Ge,contentLeft:ie,contentWidth:Ke,minimap:bt,viewportColumn:Kt,isWordWrapMinified:Ne,isViewportWrapping:Ae,wrappingColumn:et,verticalScrollbarWidth:z,horizontalScrollbarHeight:X,overviewRuler:{top:nn,width:z,height:o-2*nn,right:0}}}},ZE=class extends ht{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p(726,null),p(725,null)],type:"string",enum:["simple","advanced"],default:"simple",description:p(724,null)}})}validate(e){return ft(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}};var ew=class extends ht{constructor(){let e={enabled:"onCode"};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:["off","onCode","on"],default:e.enabled,enumDescriptions:[p(428,null),p(430,null),p(429,null)],description:p(467,null)}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ft(e.enabled,this.defaultValue.enabled,["off","onCode","on"])}}},tw=class extends ht{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p(432,null)},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:p(433,null)},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p(431,null)},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:p(434,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),maxLineCount:Je.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:ft(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:se(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},nw=class extends ht{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:p(515,null),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p(424,null),p(425,null,en?"Ctrl+Option":"Ctrl+Alt"),p(423,null,en?"Ctrl+Option":"Ctrl+Alt"),p(422,null)]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p(517,null,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p(516,null,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:p(519,null)},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:p(518,null)}})}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:ft(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Je.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Fn.string(t.fontFamily,this.defaultValue.fontFamily),padding:se(t.padding,this.defaultValue.padding),maximumLength:Je.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}},ow=class extends ht{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Je.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?Je.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},rw=class extends Co{constructor(){super(75,"lineHeight",Ar.lineHeight,e=>Co.clamp(e,0,150),{markdownDescription:p(541,null)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}},iw=class extends ht{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*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p(554,null)},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[p(552,null),p(551,null),p(553,null)],default:e.autohide,description:p(550,null)},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p(568,null),p(566,null),p(567,null)],default:e.size,description:p(565,null)},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p(564,null)},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p(563,null)},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p(558,null)},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p(557,null)},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p(556,null)},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p(562,null)},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p(561,null)},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:p(555,null)},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p(559,null)},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p(560,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e,n=this.defaultValue.markSectionHeaderRegex,o=t.markSectionHeaderRegex;if(typeof o=="string")try{new RegExp(o,"d"),n=o}catch{}return{enabled:se(t.enabled,this.defaultValue.enabled),autohide:ft(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:ft(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:ft(t.side,this.defaultValue.side,["right","left"]),showSlider:ft(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:se(t.renderCharacters,this.defaultValue.renderCharacters),scale:Je.clampedInt(t.scale,1,1,3),maxColumn:Je.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:se(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:se(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:Co.clamp(Co.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:Co.clamp(Co.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};function p4(r){return r==="ctrlCmd"?en?"metaKey":"ctrlKey":"altKey"}var sw=class extends ht{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p(593,null)},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p(592,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{top:Je.clampedInt(t.top,0,0,1e3),bottom:Je.clampedInt(t.bottom,0,0,1e3)}}},aw=class extends ht{constructor(){let e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p(595,null)},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p(594,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),cycle:se(t.cycle,this.defaultValue.cycle)}}},lw=class extends pi{constructor(){super(163,1)}compute(e,t,n){return e.pixelRatio}},dw=class extends ht{constructor(){super(100,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}},cw=class extends ht{constructor(){let e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[p(588,null),p(520,null),p(586,null),p(587,null)]}];super(102,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[p(610,null),p(607,null),p(608,null),p(609,null)]},{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:p(606,null)},comments:{anyOf:t,default:e.comments,description:p(604,null)},other:{anyOf:t,default:e.other,description:p(605,null)}}}],default:e,markdownDescription:p(603,null,"`#editor.suggestOnTriggerCharacters#`"),experiment:{mode:"auto"}}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){let d=e?"on":"off";return{comments:d,strings:d,other:d}}if(typeof e=="string"){let d=["on","inline","off","offWhenInlineCompletions"],c=ft(e,this.defaultValue.other,d);return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;let{other:t,comments:n,strings:o}=e,i=["on","inline","off","offWhenInlineCompletions"],s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=ft(t,this.defaultValue.other,i),typeof n=="boolean"?a=n?"on":"off":a=ft(n,this.defaultValue.comments,i),typeof o=="boolean"?l=o?"on":"off":l=ft(o,this.defaultValue.strings,i),{other:s,comments:a,strings:l}}};var uw=class extends ht{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p(544,null),p(545,null),p(546,null),p(543,null)],default:"on",description:p(542,null)})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}};var pw=class extends ht{constructor(){let e=[],t={type:"number",description:p(627,null)};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p(626,null),format:"color-hex"}}}]},default:e,description:p(625,null)})}validate(e){if(Array.isArray(e)){let t=[];for(let n of e)if(typeof n=="number")t.push({column:Je.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){let o=n;t.push({column:Je.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((n,o)=>n.column-o.column),t}return this.defaultValue}},mw=class extends ht{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}};function dA(r,e){if(typeof r!="string")return e;switch(r){case"hidden":return 2;case"visible":return 3;default:return 1}}var gw=class extends ht{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:[p(637,null),p(639,null),p(638,null)],default:"auto",description:p(636,null)},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p(630,null),p(632,null),p(631,null)],default:"auto",description:p(629,null)},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p(640,null)},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p(633,null)},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p(635,null)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:p(634,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e,n=Je.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=Je.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Je.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:dA(t.vertical,this.defaultValue.vertical),horizontal:dA(t.horizontal,this.defaultValue.horizontal),useShadows:se(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:se(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:se(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:se(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:se(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:Je.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:Je.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:se(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:se(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},Lr="inUntrustedWorkspace",Ql={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"},fw=class extends ht{constructor(){let e={nonBasicASCII:Lr,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Lr,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[Ql.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lr],default:e.nonBasicASCII,description:p(701,null)},[Ql.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:p(700,null)},[Ql.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:p(697,null)},[Ql.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lr],default:e.includeComments,description:p(698,null)},[Ql.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lr],default:e.includeStrings,description:p(699,null)},[Ql.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:p(695,null),additionalProperties:{type:"boolean"}},[Ql.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:p(696,null)}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(Wt(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(Wt(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));let o=super.applyUpdate(e,t);return n?new Vc(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{nonBasicASCII:Bc(t.nonBasicASCII,Lr,[!0,!1,Lr]),invisibleCharacters:se(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:se(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Bc(t.includeComments,Lr,[!0,!1,Lr]),includeStrings:Bc(t.includeStrings,Lr,[!0,!1,Lr]),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 n={};for(let[o,i]of Object.entries(e))i===!0&&(n[o]=!0);return n}},hw=class extends ht{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",showLongDistanceHint:!0},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p(527,null)},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p(532,null),p(534,null),p(533,null)],description:p(531,null)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:p(538,null)},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:p(537,null)},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:p(536,null)},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:p(529,null)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:p(535,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:p(526,null),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:p(539,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:p(530,null),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:p(528,null)},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:p(522,null),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showLongDistanceHint":{type:"boolean",default:e.edits.showLongDistanceHint,description:p(525,null),tags:["nextEditSuggestions","experimental"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:p(523,null),enum:["auto","never"],enumDescriptions:[p(426,null),p(427,null)],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:p(524,null),tags:["nextEditSuggestions"]}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),mode:ft(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:ft(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:se(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:se(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Fn.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:se(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:Je.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:se(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:se(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:se(t.enabled,this.defaultValue.edits.enabled),showCollapsed:se(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:ft(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),showLongDistanceHint:se(t.showLongDistanceHint,this.defaultValue.edits.showLongDistanceHint),renderSideBySide:ft(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])}}_validateExperimental(e){if(!e||typeof e!="object")return this.defaultValue.experimental;let t=e;return{suppressInlineSuggestions:Fn.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:ft(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:se(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},vw=class extends ht{constructor(){let e={enabled:ME.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:ME.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:p(333,null,"`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:p(334,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:se(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},bw=class extends ht{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:[p(411,null),p(409,null),p(410,null)],default:e.bracketPairs,description:p(408,null)},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p(415,null),p(413,null),p(414,null)],default:e.bracketPairsHorizontal,description:p(412,null)},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p(416,null)},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p(421,null)},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[p(420,null),p(418,null),p(419,null)],default:e.highlightActiveIndentation,description:p(417,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{bracketPairs:Bc(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Bc(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:se(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:se(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Bc(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}};function Bc(r,e,t){let n=t.indexOf(r);return n===-1?e:t[n]}var yw=class extends ht{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:[p(667,null),p(669,null)],default:e.insertMode,description:p(665,null)},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:p(664,null)},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p(672,null)},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p(676,null)},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[p(666,null),p(668,null),p(671,null),p(670,null)],default:e.selectionMode,markdownDescription:p(675,null,"`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p(680,null)},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p(677,null)},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p(679,null)},"editor.suggest.preview":{type:"boolean",default:e.preview,description:p(674,null)},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p(678,null)},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p(673,null)},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p(359,null)},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:p(452,null)},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p(448,null)},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p(439,null)},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p(441,null)},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:p(435,null)},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p(445,null)},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p(464,null)},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p(436,null)},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p(458,null)},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p(449,null)},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p(453,null)},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p(455,null)},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p(444,null)},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p(454,null)},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p(461,null)},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p(463,null)},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p(438,null)},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p(443,null)},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p(442,null)},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p(451,null)},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p(459,null)},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p(437,null)},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p(446,null)},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p(456,null)},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p(440,null)},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p(447,null)},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p(460,null)},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p(457,null)},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p(462,null)},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p(450,null)}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertMode:ft(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:se(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:se(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:se(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:se(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:ft(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:se(t.showIcons,this.defaultValue.showIcons),showStatusBar:se(t.showStatusBar,this.defaultValue.showStatusBar),preview:se(t.preview,this.defaultValue.preview),previewMode:ft(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:se(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:se(t.showMethods,this.defaultValue.showMethods),showFunctions:se(t.showFunctions,this.defaultValue.showFunctions),showConstructors:se(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:se(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:se(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:se(t.showFields,this.defaultValue.showFields),showVariables:se(t.showVariables,this.defaultValue.showVariables),showClasses:se(t.showClasses,this.defaultValue.showClasses),showStructs:se(t.showStructs,this.defaultValue.showStructs),showInterfaces:se(t.showInterfaces,this.defaultValue.showInterfaces),showModules:se(t.showModules,this.defaultValue.showModules),showProperties:se(t.showProperties,this.defaultValue.showProperties),showEvents:se(t.showEvents,this.defaultValue.showEvents),showOperators:se(t.showOperators,this.defaultValue.showOperators),showUnits:se(t.showUnits,this.defaultValue.showUnits),showValues:se(t.showValues,this.defaultValue.showValues),showConstants:se(t.showConstants,this.defaultValue.showConstants),showEnums:se(t.showEnums,this.defaultValue.showEnums),showEnumMembers:se(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:se(t.showKeywords,this.defaultValue.showKeywords),showWords:se(t.showWords,this.defaultValue.showWords),showColors:se(t.showColors,this.defaultValue.showColors),showFiles:se(t.showFiles,this.defaultValue.showFiles),showReferences:se(t.showReferences,this.defaultValue.showReferences),showFolders:se(t.showFolders,this.defaultValue.showFolders),showTypeParameters:se(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:se(t.showSnippets,this.defaultValue.showSnippets),showUsers:se(t.showUsers,this.defaultValue.showUsers),showIssues:se(t.showIssues,this.defaultValue.showIssues)}}},Iw=class extends ht{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p(649,null),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:p(650,null),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:se(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:se(e.selectSubwords,this.defaultValue.selectSubwords)}}},xw=class extends ht{constructor(){let e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:p(710,null),type:"array",items:{type:"string"},default:e})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){let t=[];for(let n of e)if(typeof n=="string")try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}};var Sw=class extends ht{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[p(722,null),p(723,null),p(721,null),p(720,null)],description:p(719,null),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,n){return t.get(2)===2?0:n}},Cw=class extends pi{constructor(){super(166,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,n){let o=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}},Tw=class extends ht{constructor(){let e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:p(362,null)},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:p(363,null),enum:["afterDrop","never"],enumDescriptions:[p(364,null),p(365,null)],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showDropSelector:ft(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},Ew=class extends ht{constructor(){let e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:p(596,null)},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:p(597,null),enum:["afterPaste","never"],enumDescriptions:[p(598,null),p(599,null)],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showPasteSelector:ft(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},m4=[];function O(r){return m4[r.id]=r,r}var wK={acceptSuggestionOnCommitCharacter:O(new ye(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p(308,null)})),acceptSuggestionOnEnter:O(new gt(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p(310,null),""],markdownDescription:p(309,null)})),accessibilitySupport:O(new UE),accessibilityPageSize:O(new Je(3,"accessibilityPageSize",500,1,1073741824,{description:p(311,null),tags:["accessibility"]})),allowOverflow:O(new ye(4,"allowOverflow",!0)),allowVariableLineHeights:O(new ye(5,"allowVariableLineHeights",!0,{description:p(318,null)})),allowVariableFonts:O(new ye(6,"allowVariableFonts",!0,{description:p(316,null)})),allowVariableFontsInAccessibilityMode:O(new ye(7,"allowVariableFontsInAccessibilityMode",!1,{description:p(317,null),tags:["accessibility"]})),ariaLabel:O(new Fn(8,"ariaLabel",p(465,null))),ariaRequired:O(new ye(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:O(new ye(12,"screenReaderAnnounceInlineSuggestion",!0,{description:p(628,null),tags:["accessibility"]})),autoClosingBrackets:O(new gt(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p(368,null),p(367,null),""],description:p(324,null)})),autoClosingComments:O(new gt(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p(370,null),p(369,null),""],description:p(325,null)})),autoClosingDelete:O(new gt(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p(371,null),""],description:p(326,null)})),autoClosingOvertype:O(new gt(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p(372,null),""],description:p(327,null)})),autoClosingQuotes:O(new gt(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p(374,null),p(373,null),""],description:p(328,null)})),autoIndent:O(new Jl(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],c4,{enumDescriptions:[p(379,null),p(378,null),p(376,null),p(375,null),p(377,null)],description:p(329,null)})),autoIndentOnPaste:O(new ye(17,"autoIndentOnPaste",!1,{description:p(330,null)})),autoIndentOnPasteWithinString:O(new ye(18,"autoIndentOnPasteWithinString",!0,{description:p(331,null)})),automaticLayout:O(new ye(19,"automaticLayout",!1)),autoSurround:O(new gt(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p(381,null),p(382,null),p(380,null),""],description:p(332,null)})),bracketPairColorization:O(new vw),bracketPairGuides:O(new bw),stickyTabStops:O(new ye(132,"stickyTabStops",!1,{description:p(663,null)})),codeLens:O(new ye(23,"codeLens",!0,{description:p(335,null)})),codeLensFontFamily:O(new Fn(24,"codeLensFontFamily","",{description:p(336,null)})),codeLensFontSize:O(new Je(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p(337,null)})),colorDecorators:O(new ye(26,"colorDecorators",!0,{description:p(339,null)})),colorDecoratorActivatedOn:O(new gt(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[p(384,null),p(385,null),p(383,null)],description:p(338,null)})),colorDecoratorsLimit:O(new Je(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:p(340,null)})),columnSelection:O(new ye(28,"columnSelection",!1,{description:p(341,null)})),comments:O(new FE),contextmenu:O(new ye(30,"contextmenu",!0)),copyWithSyntaxHighlighting:O(new ye(31,"copyWithSyntaxHighlighting",!0,{description:p(344,null)})),cursorBlinking:O(new Jl(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],u4,{description:p(345,null)})),cursorSmoothCaretAnimation:O(new gt(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[p(349,null),p(348,null),p(350,null)],description:p(347,null)})),cursorStyle:O(new Jl(34,"cursorStyle",1,"line",["line","block","underline","line-thin","block-outline","underline-thin"],lA,{description:p(351,null)})),overtypeCursorStyle:O(new Jl(92,"overtypeCursorStyle",2,"block",["line","block","underline","line-thin","block-outline","underline-thin"],lA,{description:p(589,null)})),cursorSurroundingLines:O(new Je(35,"cursorSurroundingLines",0,0,1073741824,{description:p(352,null)})),cursorSurroundingLinesStyle:O(new gt(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p(355,null),p(354,null)],markdownDescription:p(353,null)})),cursorWidth:O(new Je(37,"cursorWidth",0,0,1073741824,{markdownDescription:p(356,null)})),cursorHeight:O(new Je(38,"cursorHeight",0,0,1073741824,{markdownDescription:p(346,null)})),disableLayerHinting:O(new ye(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:O(new ye(40,"disableMonospaceOptimizations",!1)),domReadOnly:O(new ye(41,"domReadOnly",!1)),doubleClickSelectsBlock:O(new ye(173,"doubleClickSelectsBlock",!0,{description:p(360,null)})),dragAndDrop:O(new ye(42,"dragAndDrop",!0,{description:p(361,null)})),emptySelectionClipboard:O(new VE),dropIntoEditor:O(new Tw),editContext:O(new ye(44,"editContext",!0,{description:p(366,null),included:Wm||Wh||Hh})),renderRichScreenReaderContent:O(new ye(107,"renderRichScreenReaderContent",!1,{markdownDescription:p(619,null)})),stickyScroll:O(new tw),experimentalGpuAcceleration:O(new gt(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[p(469,null),p(470,null)],description:p(468,null)})),experimentalWhitespaceRendering:O(new gt(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[p(474,null),p(472,null),p(473,null)],description:p(471,null)})),extraEditorClassName:O(new Fn(48,"extraEditorClassName","")),fastScrollSensitivity:O(new Co(49,"fastScrollSensitivity",5,r=>r<=0?5:r,{markdownDescription:p(475,null)})),find:O(new BE),fixedOverflowWidgets:O(new ye(51,"fixedOverflowWidgets",!1)),folding:O(new ye(52,"folding",!0,{description:p(485,null)})),foldingStrategy:O(new gt(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p(490,null),p(491,null)],description:p(489,null)})),foldingHighlight:O(new ye(54,"foldingHighlight",!0,{description:p(486,null)})),foldingImportsByDefault:O(new ye(55,"foldingImportsByDefault",!1,{description:p(487,null)})),foldingMaximumRegions:O(new Je(56,"foldingMaximumRegions",5e3,10,65e3,{description:p(488,null)})),unfoldOnClickAfterEndOfLine:O(new ye(57,"unfoldOnClickAfterEndOfLine",!1,{description:p(694,null)})),fontFamily:O(new Fn(58,"fontFamily",Ar.fontFamily,{description:p(492,null)})),fontInfo:O(new zE),fontLigatures2:O(new WE),fontSize:O(new jE),fontWeight:O(new QE),fontVariations:O(new $E),formatOnPaste:O(new ye(64,"formatOnPaste",!1,{description:p(502,null)})),formatOnType:O(new ye(65,"formatOnType",!1,{description:p(503,null)})),glyphMargin:O(new ye(66,"glyphMargin",!0,{description:p(504,null)})),gotoLocation:O(new JE),hideCursorInOverviewRuler:O(new ye(68,"hideCursorInOverviewRuler",!1,{description:p(505,null)})),hover:O(new XE),inDiffEditor:O(new ye(70,"inDiffEditor",!1)),inertialScroll:O(new ye(158,"inertialScroll",!1,{description:p(514,null)})),letterSpacing:O(new Co(72,"letterSpacing",Ar.letterSpacing,r=>Co.clamp(r,-5,20),{description:p(540,null)})),lightbulb:O(new ew),lineDecorationsWidth:O(new ow),lineHeight:O(new rw),lineNumbers:O(new uw),lineNumbersMinChars:O(new Je(77,"lineNumbersMinChars",5,1,300)),linkedEditing:O(new ye(78,"linkedEditing",!1,{description:p(547,null)})),links:O(new ye(79,"links",!0,{description:p(548,null)})),matchBrackets:O(new gt(80,"matchBrackets","always",["always","near","never"],{description:p(549,null)})),minimap:O(new iw),mouseStyle:O(new gt(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:O(new Co(83,"mouseWheelScrollSensitivity",1,r=>r===0?1:r,{markdownDescription:p(570,null)})),mouseWheelZoom:O(new ye(84,"mouseWheelZoom",!1,{markdownDescription:en?p(572,null):p(571,null)})),multiCursorMergeOverlapping:O(new ye(85,"multiCursorMergeOverlapping",!0,{description:p(574,null)})),multiCursorModifier:O(new Jl(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],p4,{markdownEnumDescriptions:[p(577,null),p(576,null)],markdownDescription:p(575,null)})),mouseMiddleClickAction:O(new gt(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:p(569,null)})),multiCursorPaste:O(new gt(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p(580,null),p(579,null)],markdownDescription:p(578,null)})),multiCursorLimit:O(new Je(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:p(573,null)})),occurrencesHighlight:O(new gt(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[p(583,null),p(584,null),p(582,null)],markdownDescription:p(581,null)})),occurrencesHighlightDelay:O(new Je(91,"occurrencesHighlightDelay",0,0,2e3,{description:p(585,null),tags:["preview"]})),overtypeOnPaste:O(new ye(93,"overtypeOnPaste",!0,{description:p(590,null)})),overviewRulerBorder:O(new ye(94,"overviewRulerBorder",!0,{description:p(591,null)})),overviewRulerLanes:O(new Je(95,"overviewRulerLanes",3,0,3)),padding:O(new sw),pasteAs:O(new Ew),parameterHints:O(new aw),peekWidgetDefaultFocus:O(new gt(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p(602,null),p(601,null)],description:p(600,null)})),placeholder:O(new dw),definitionLinkOpensInPeek:O(new ye(101,"definitionLinkOpensInPeek",!1,{description:p(358,null)})),quickSuggestions:O(new cw),quickSuggestionsDelay:O(new Je(103,"quickSuggestionsDelay",10,0,1073741824,{description:p(611,null),experiment:{mode:"auto"}})),readOnly:O(new ye(104,"readOnly",!1)),readOnlyMessage:O(new mw),renameOnType:O(new ye(106,"renameOnType",!1,{description:p(612,null),markdownDeprecationMessage:p(613,null)})),renderControlCharacters:O(new ye(108,"renderControlCharacters",!0,{description:p(614,null),restricted:!0})),renderFinalNewline:O(new gt(109,"renderFinalNewline",An?"dimmed":"on",["off","on","dimmed"],{description:p(615,null)})),renderLineHighlight:O(new gt(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p(617,null)],description:p(616,null)})),renderLineHighlightOnlyWhenFocus:O(new ye(111,"renderLineHighlightOnlyWhenFocus",!1,{description:p(618,null)})),renderValidationDecorations:O(new gt(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:O(new gt(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p(621,null),p(622,null),p(623,null),""],description:p(620,null)})),revealHorizontalRightPadding:O(new Je(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:O(new ye(115,"roundedSelection",!0,{description:p(624,null)})),rulers:O(new pw),scrollbar:O(new gw),scrollBeyondLastColumn:O(new Je(118,"scrollBeyondLastColumn",4,0,1073741824,{description:p(641,null)})),scrollBeyondLastLine:O(new ye(119,"scrollBeyondLastLine",!0,{description:p(642,null)})),scrollOnMiddleClick:O(new ye(171,"scrollOnMiddleClick",!1,{description:p(643,null)})),scrollPredominantAxis:O(new ye(120,"scrollPredominantAxis",!0,{description:p(644,null)})),selectionClipboard:O(new ye(121,"selectionClipboard",!0,{description:p(645,null),included:An})),selectionHighlight:O(new ye(122,"selectionHighlight",!0,{description:p(646,null)})),selectionHighlightMaxLength:O(new Je(123,"selectionHighlightMaxLength",200,0,1073741824,{description:p(647,null)})),selectionHighlightMultiline:O(new ye(124,"selectionHighlightMultiline",!1,{description:p(648,null)})),selectOnLineNumbers:O(new ye(125,"selectOnLineNumbers",!0)),showFoldingControls:O(new gt(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[p(653,null),p(655,null),p(654,null)],description:p(652,null)})),showUnused:O(new ye(127,"showUnused",!0,{description:p(656,null)})),showDeprecated:O(new ye(157,"showDeprecated",!0,{description:p(651,null)})),inlayHints:O(new nw),snippetSuggestions:O(new gt(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p(662,null),p(659,null),p(660,null),p(661,null)],description:p(658,null)})),smartSelect:O(new Iw),smoothScrolling:O(new ye(130,"smoothScrolling",!1,{description:p(657,null)})),stopRenderingLineAfter:O(new Je(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:O(new yw),inlineSuggest:O(new hw),inlineCompletionsAccessibilityVerbose:O(new ye(169,"inlineCompletionsAccessibilityVerbose",!1,{description:p(521,null)})),suggestFontSize:O(new Je(135,"suggestFontSize",0,0,1e3,{markdownDescription:p(681,null,"`0`","`#editor.fontSize#`")})),suggestLineHeight:O(new Je(136,"suggestLineHeight",0,0,1e3,{markdownDescription:p(682,null,"`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:O(new ye(137,"suggestOnTriggerCharacters",!0,{description:p(683,null)})),suggestSelection:O(new gt(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p(685,null),p(686,null),p(687,null)],description:p(684,null)})),tabCompletion:O(new gt(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p(690,null),p(689,null),p(691,null)],description:p(688,null)})),tabIndex:O(new Je(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:O(new ye(141,"trimWhitespaceOnDelete",!1,{description:p(693,null)})),unicodeHighlight:O(new fw),unusualLineTerminators:O(new gt(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p(703,null),p(704,null),p(705,null)],description:p(702,null)})),useShadowDOM:O(new ye(144,"useShadowDOM",!0)),useTabStops:O(new ye(145,"useTabStops",!0,{description:p(706,null)})),wordBreak:O(new gt(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[p(709,null),p(708,null)],description:p(707,null)})),wordSegmenterLocales:O(new xw),wordSeparators:O(new Fn(148,"wordSeparators",AE,{description:p(711,null)})),wordWrap:O(new gt(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p(714,null),p(715,null),p(716,null),p(713,null)],description:p(712,null)})),wordWrapBreakAfterCharacters:O(new Fn(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:O(new Fn(151,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:O(new Je(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:p(717,null)})),wordWrapOverride1:O(new gt(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:O(new gt(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:O(new ye(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:p(718,null)})),effectiveCursorStyle:O(new KE),editorClassName:O(new HE),defaultColorDecorators:O(new gt(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[p(387,null),p(386,null),p(388,null)],description:p(357,null)})),pixelRatio:O(new lw),tabFocusMode:O(new ye(164,"tabFocusMode",!1,{markdownDescription:p(692,null)})),layoutInfo:O(new YE),wrappingInfo:O(new Cw),wrappingIndent:O(new Sw),wrappingStrategy:O(new ZE),effectiveEditContextEnabled:O(new qE),effectiveAllowVariableFonts:O(new GE)};var sn=class r{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new r(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return r.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return r.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return r.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let n=e.lineNumber|0,o=t.lineNumber|0;if(n===o){let i=e.column|0,s=t.column|0;return i-s}return n-o}clone(){return new r(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new r(e.lineNumber,e.column)}static isIPosition(e){return!!e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}};var Oe=class r{constructor(e,t,n,o){e>n||e===n&&t>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return r.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return r.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return r.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return r.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return r.plusRange(this,e)}static plusRange(e,t){let n,o,i,s;return t.startLineNumber<e.startLineNumber?(n=t.startLineNumber,o=t.startColumn):t.startLineNumber===e.startLineNumber?(n=t.startLineNumber,o=Math.min(t.startColumn,e.startColumn)):(n=e.startLineNumber,o=e.startColumn),t.endLineNumber>e.endLineNumber?(i=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(i=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(i=e.endLineNumber,s=e.endColumn),new r(n,o,i,s)}intersectRanges(e){return r.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,o=e.startColumn,i=e.endLineNumber,s=e.endColumn,a=t.startLineNumber,l=t.startColumn,d=t.endLineNumber,c=t.endColumn;return n<a?(n=a,o=l):n===a&&(o=Math.max(o,l)),i>d?(i=d,s=c):i===d&&(s=Math.min(s,c)),n>i||n===i&&o>s?null:new r(n,o,i,s)}equalsRange(e){return r.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return r.getEndPosition(this)}static getEndPosition(e){return new sn(e.endLineNumber,e.endColumn)}getStartPosition(){return r.getStartPosition(this)}static getStartPosition(e){return new sn(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new r(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new r(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return r.collapseToStart(this)}static collapseToStart(e){return new r(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return r.collapseToEnd(this)}static collapseToEnd(e){return new r(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new r(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new r(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new r(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){let i=e.startLineNumber|0,s=t.startLineNumber|0;if(i===s){let a=e.startColumn|0,l=t.startColumn|0;if(a===l){let d=e.endLineNumber|0,c=t.endLineNumber|0;if(d===c){let u=e.endColumn|0,m=t.endColumn|0;return u-m}return d-c}return a-l}return i-s}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}};var jv=class{constructor(){this._tokenizationSupports=new Map;this._factories=new Map;this._onDidChange=new E;this.onDidChange=this._onDidChange.event;this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),J(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();let n=new kw(this,e,t);return this._factories.set(e,n),J(()=>{let o=this._factories.get(e);!o||o!==n||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let n=this._factories.get(e);return!!(!n||n.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},kw=class extends H{constructor(t,n,o){super();this._registry=t;this._languageId=n;this._factory=o;this._isDisposed=!1;this._resolvePromise=null;this._isResolved=!1}get isResolved(){return this._isResolved}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){let t=await this._factory.tokenizationSupport;this._isResolved=!0,t&&!this._isDisposed&&this._register(this._registry.register(this._languageId,t))}};var f4;(i=>{let r=new Map;r.set(0,le.symbolMethod),r.set(1,le.symbolFunction),r.set(2,le.symbolConstructor),r.set(3,le.symbolField),r.set(4,le.symbolVariable),r.set(5,le.symbolClass),r.set(6,le.symbolStruct),r.set(7,le.symbolInterface),r.set(8,le.symbolModule),r.set(9,le.symbolProperty),r.set(10,le.symbolEvent),r.set(11,le.symbolOperator),r.set(12,le.symbolUnit),r.set(13,le.symbolValue),r.set(15,le.symbolEnum),r.set(14,le.symbolConstant),r.set(15,le.symbolEnum),r.set(16,le.symbolEnumMember),r.set(17,le.symbolKeyword),r.set(28,le.symbolSnippet),r.set(18,le.symbolText),r.set(19,le.symbolColor),r.set(20,le.symbolFile),r.set(21,le.symbolReference),r.set(22,le.symbolCustomColor),r.set(23,le.symbolFolder),r.set(24,le.symbolTypeParameter),r.set(25,le.account),r.set(26,le.issues),r.set(27,le.tools);function e(s){let a=r.get(s);return a||(console.info("No codicon found for CompletionItemKind "+s),a=le.symbolProperty),a}i.toIcon=e;function t(s){switch(s){case 0:return p(886,null);case 1:return p(882,null);case 2:return p(874,null);case 3:return p(879,null);case 4:return p(899,null);case 5:return p(871,null);case 6:return p(892,null);case 7:return p(883,null);case 8:return p(887,null);case 9:return p(889,null);case 10:return p(878,null);case 11:return p(888,null);case 12:return p(896,null);case 13:return p(898,null);case 14:return p(873,null);case 15:return p(876,null);case 16:return p(877,null);case 17:return p(885,null);case 18:return p(893,null);case 19:return p(872,null);case 20:return p(880,null);case 21:return p(890,null);case 22:return p(875,null);case 23:return p(881,null);case 24:return p(895,null);case 25:return p(897,null);case 26:return p(884,null);case 27:return p(894,null);case 28:return p(891,null);default:return""}}i.toLabel=t;let n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",28),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),n.set("tool",27);function o(s,a){let l=n.get(s);return typeof l>"u"&&!a&&(l=9),l}i.fromString=o})(f4||={});function uA(r){return!!r&&y.isUri(r.uri)&&Oe.isIRange(r.range)&&(Oe.isIRange(r.originSelectionRange)||Oe.isIRange(r.targetSelectionRange))}function pA(r){return!!r&&y.isUri(r.uri)&&Oe.isIRange(r.range)}var XK={17:p(847,null),16:p(848,null),4:p(849,null),13:p(850,null),8:p(851,null),9:p(852,null),21:p(853,null),23:p(854,null),7:p(855,null),0:p(856,null),11:p(857,null),10:p(858,null),19:p(859,null),5:p(860,null),1:p(861,null),2:p(862,null),20:p(863,null),15:p(864,null),18:p(865,null),24:p(866,null),3:p(867,null),6:p(868,null),14:p(869,null),22:p(870,null),25:p(901,null),12:p(902,null)};var _w;(o=>{let r=new Map;r.set(0,le.symbolFile),r.set(1,le.symbolModule),r.set(2,le.symbolNamespace),r.set(3,le.symbolPackage),r.set(4,le.symbolClass),r.set(5,le.symbolMethod),r.set(6,le.symbolProperty),r.set(7,le.symbolField),r.set(8,le.symbolConstructor),r.set(9,le.symbolEnum),r.set(10,le.symbolInterface),r.set(11,le.symbolFunction),r.set(12,le.symbolVariable),r.set(13,le.symbolConstant),r.set(14,le.symbolString),r.set(15,le.symbolNumber),r.set(16,le.symbolBoolean),r.set(17,le.symbolArray),r.set(18,le.symbolObject),r.set(19,le.symbolKey),r.set(20,le.symbolNull),r.set(21,le.symbolEnumMember),r.set(22,le.symbolStruct),r.set(23,le.symbolEvent),r.set(24,le.symbolOperator),r.set(25,le.symbolTypeParameter);function e(i){let s=r.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=le.symbolProperty),s}o.toIcon=e;let t=new Map;t.set(0,20),t.set(1,8),t.set(2,8),t.set(3,8),t.set(4,5),t.set(5,0),t.set(6,9),t.set(7,3),t.set(8,2),t.set(9,15),t.set(10,7),t.set(11,1),t.set(12,4),t.set(13,14),t.set(14,18),t.set(15,13),t.set(16,13),t.set(17,13),t.set(18,13),t.set(19,17),t.set(20,13),t.set(21,16),t.set(22,6),t.set(23,10),t.set(24,11),t.set(25,24);function n(i){let s=t.get(i);return s===void 0&&(console.info("No completion kind found for SymbolKind "+i),s=20),s}o.toCompletionKind=n})(_w||={});var ss=class r{constructor(e){this.value=e}static{this.Comment=new r("comment")}static{this.Imports=new r("imports")}static{this.Region=new r("region")}static fromValue(e){switch(e){case"comment":return r.Comment;case"imports":return r.Imports;case"region":return r.Region}return new r(e)}};var Pw;(e=>{function r(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}e.is=r})(Pw||={});var YK=new jv;var Dw=(o=>(o[o.Left=1]="Left",o[o.Center=2]="Center",o[o.Right=4]="Right",o[o.Full=7]="Full",o))(Dw||{});var Xl=class{constructor(e,t){this._findMatchBrand=void 0;this.range=e,this.matches=t}};var Jv=class{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}},Xv=class{constructor(e,t,n){this.reverseEdits=e;this.changes=t;this.trimAutoWhitespaceLineNumbers=n}};var Wc=(o=>(o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error",o))(Wc||{});(a=>{function r(l,d){return d-l}a.compare=r;let e=Object.create(null);e[8]=p(2135,null),e[4]=p(2139,null),e[2]=p(2137,null);function t(l){return e[l]||""}a.toString=t;let n=Object.create(null);n[8]=p(2136,null),n[4]=p(2140,null),n[2]=p(2138,null);function o(l){return n[l]||""}a.toStringPlural=o;function i(l){switch(l){case $e.Error:return 8;case $e.Warning:return 4;case $e.Info:return 2;case $e.Ignore:return 1}}a.fromSeverity=i;function s(l){switch(l){case 8:return $e.Error;case 4:return $e.Warning;case 2:return $e.Info;case 1:return $e.Ignore}}a.toSeverity=s})(Wc||={});var h4;(n=>{function e(o){return t(o,!0)}n.makeKey=e;function t(o,i){let s=[""];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(""),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(""),o.severity!==void 0&&o.severity!==null?s.push(Wc.toString(o.severity)):s.push(""),o.message&&i?s.push(o.message.replace("\xA6","\\\xA6")):s.push(""),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(""),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(""),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(""),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(""),s.push(""),s.join("\xA6")}n.makeKeyOptionalMessage=t})(h4||={});var rq=M("markerService");var v4=M("progressService");var uq=Object.freeze({total(){},worked(){},done(){}}),ga=class{constructor(e){this.callback=e}static{this.None=Object.freeze({report(){}})}get value(){return this._value}report(e){this._value=e,this.callback(this._value)}},Yv=class extends H{constructor(t,n){super();this.deferred=new _n;n.withProgress(t,o=>(this.reporter=o,this.lastStep&&o.report(this.lastStep),this.deferred.p)),this._register(J(()=>this.deferred.complete()))}report(t){this.reporter?this.reporter.report(t):this.lastStep=t}};Yv=D([C(1,v4)],Yv);var pq=M("editorProgressService");var Rw=class{constructor(){this.data=new Map}add(e,t){vn(ke(e)),vn(ut(t)),vn(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}knows(e){return this.data.has(e)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach(e=>{YC(e.dispose)&&e.dispose()}),this.data.clear()}},ot=new Rw;var Mw=class extends H{constructor(t,n="",o="",i=!0,s){super();this._onDidChange=this._register(new E);this._enabled=!0;this._id=t,this._label=n,this._cssClass=o,this._enabled=i,this._actionCallback=s}get onDidChange(){return this._onDidChange.event}get id(){return this._id}get label(){return this._label}set label(t){this._setLabel(t)}_setLabel(t){this._label!==t&&(this._label=t,this._onDidChange.fire({label:t}))}get tooltip(){return this._tooltip||""}set tooltip(t){this._setTooltip(t)}_setTooltip(t){this._tooltip!==t&&(this._tooltip=t,this._onDidChange.fire({tooltip:t}))}get class(){return this._cssClass}set class(t){this._setClass(t)}_setClass(t){this._cssClass!==t&&(this._cssClass=t,this._onDidChange.fire({class:t}))}get enabled(){return this._enabled}set enabled(t){this._setEnabled(t)}_setEnabled(t){this._enabled!==t&&(this._enabled=t,this._onDidChange.fire({enabled:t}))}get checked(){return this._checked}set checked(t){this._setChecked(t)}_setChecked(t){this._checked!==t&&(this._checked=t,this._onDidChange.fire({checked:t}))}async run(t,n){this._actionCallback&&await this._actionCallback(t)}};var gA=class r{constructor(){this.id=r.ID;this.label="";this.tooltip="";this.class="separator";this.enabled=!1;this.checked=void 0}static join(...e){let t=[];for(let n of e)n.length&&(t.length?t=[...t,new r,...n]:t=n);return t}static{this.ID="vs.actions.separator"}async run(){}};var fA=class r extends Mw{static{this.ID="vs.actions.empty"}constructor(){super(r.ID,p(44,null),void 0,!1)}};var hA={EditorPane:"workbench.contributions.editors",EditorFactory:"workbench.contributions.editor.inputFactories"},Nw={id:"default",displayName:p(4566,null),providerDisplayName:p(4563,null)};var vA="workbench.editors.textDiffEditor",bA="workbench.editors.binaryResourceDiffEditor";function eb(r,e,t){for(let n of t.visibleEditorPanes)if(n.group.id===e&&r.matches(n.input))return n.getViewState()}function yA(r){if(To(r))return!1;let e=r;return y.isUri(e?.resource)}function Or(r){if(To(r))return!1;let e=r;return e?.original!==void 0&&e.modified!==void 0}function $c(r){if(To(r))return!1;let e=r;return!e||e.resources&&!Array.isArray(e.resources)?!1:!!e.resources||!!e.multiDiffSource}function ha(r){if(To(r)||Or(r))return!1;let e=r;return e?.primary!==void 0&&e.secondary!==void 0}function fa(r){if(To(r))return!1;let e=r;return y.isUri(e?.base?.resource)&&y.isUri(e?.input1?.resource)&&y.isUri(e?.input2?.resource)&&y.isUri(e?.result?.resource)}var Aw=class{constructor(){this.mapIdToSaveSource=new Map}registerSource(e,t){let n=this.mapIdToSaveSource.get(e);return n||(n={source:e,label:t},this.mapIdToSaveSource.set(e,n)),n.source}getSourceLabel(e){return this.mapIdToSaveSource.get(e)?.label??e}},$q=new Aw;var Cg=class extends H{};function To(r){return r instanceof Cg}function b4(r){let e=r;return y.isUri(e?.preferredResource)}function y4(r){let e=r;return To(e?.primary)&&To(e?.secondary)}function Uw(r){let e=r;return To(e?.modified)&&To(e?.original)}var Lw=class{getOriginalUri(e,t){if(!e)return;if(fa(e))return Zv.getOriginalUri(e.result,t);if(t?.supportSideBySide){let{primary:o,secondary:i}=this.getSideEditors(e);if(o&&i){if(t?.supportSideBySide===3)return{primary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(i,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===4)return this.getOriginalUri(o,{filterByScheme:t.filterByScheme})??this.getOriginalUri(i,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===1?o:i}}if(Or(e)||$c(e)||ha(e)||fa(e))return;let n=b4(e)?e.preferredResource:e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}getSideEditors(e){return y4(e)||ha(e)?{primary:e.primary,secondary:e.secondary}:Uw(e)||Or(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(fa(e))return Zv.getCanonicalUri(e.result,t);if(t?.supportSideBySide){let{primary:o,secondary:i}=this.getSideEditors(e);if(o&&i){if(t?.supportSideBySide===3)return{primary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(i,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===4)return this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(i,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===1?o:i}}if(Or(e)||$c(e)||ha(e)||fa(e))return;let n=e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(n=>e.scheme===n))return e}else if(t===e.scheme)return e}};var Zv=new Lw;var Ow=class{constructor(){this.editorSerializerConstructors=new Map;this.editorSerializerInstances=new Map}start(e){let t=this.instantiationService=e.get(po);for(let[n,o]of this.editorSerializerConstructors)this.createEditorSerializer(n,o,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,n){let o=n.createInstance(t);this.editorSerializerInstances.set(e,o)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return Tr(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),J(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}};ot.add(hA.EditorFactory,new Ow);var Fw="local";var I4=M("chatSessionsService");var va;(s=>{s.scheme=$.vscodeLocalChatSession;function e(a){let l=er(ee.wrap(new TextEncoder().encode(a)),!1,!0);return y.from({scheme:s.scheme,authority:Fw,path:"/"+l})}s.forSession=e;function t(){let a=Math.floor(Math.random()*1e9);return e(`chat-${a}`)}s.getNewSessionUri=t;function n(a){let l=i(a);return l?.chatSessionType===Fw?l.sessionId:void 0}s.parseLocalSessionId=n;function o(a){return!!n(a)}s.isLocalSession=o;function i(a){if(a.scheme!==s.scheme||!a.authority)return;let l=a.path.split("/");if(l.length!==2)return;let d=a.authority,c=No(l[1]);return{chatSessionType:d,sessionId:new TextDecoder().decode(c.buffer)}}})(va||={});function IA(r){let e=va.parseLocalSessionId(r);return e||r.toString()}var Hw;(i=>{i.icon=le.error;function e(s){return{filterUri:s.resource,owner:s.owner,problemMessage:s.message,filterRange:{startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,startColumn:s.startColumn,endColumn:s.endColumn}}}i.fromMarker=e;function t(s){return{id:n(s),name:o(s),icon:i.icon,value:s,kind:"diagnostic",...s}}i.toEntry=t;function n(s){return[s.filterUri,s.owner,s.filterSeverity,s.filterRange?.startLineNumber,s.filterRange?.startColumn].join(":")}i.id=n;function o(s){let a;if((u=>(u[u.MaxChars=30]="MaxChars",u[u.MaxSpaceLookback=10]="MaxSpaceLookback"))(a||={}),s.problemMessage){if(s.problemMessage.length<30)return s.problemMessage;let d=s.problemMessage.lastIndexOf(" ",30);return d===-1||d+10<30?s.problemMessage.substring(0,30)+"\u2026":s.problemMessage.substring(0,d)+"\u2026"}let l=p(7639,null);return s.filterUri&&(l=p(7640,null,Bt(s.filterUri))),l}i.label=o})(Hw||={});var Vw;(n=>{function r(o){return y.isUri(o.value)?o.value:pA(o.value)?o.value.uri:void 0}n.toUri=r;function e(o){if(o.value instanceof Uint8Array){let i={...o};return i.value={$base64:er(ee.wrap(o.value))},i}return o}n.toExport=e;function t(o){if(o&&"values"in o&&Array.isArray(o.values))return{kind:"generic",id:o.id??"",name:o.name,value:o.values[0]?.value,range:o.range,modelDescription:o.modelDescription,references:o.references};if(o.value&&typeof o.value=="object"&&"$base64"in o.value&&typeof o.value.$base64=="string"){let i={...o};return i.value=No(o.value.$base64).buffer,i}return o}n.fromExport=t})(Vw||={});function xA(r){return r.kind==="image"}function Tg(r){return r.kind==="promptFile"}function SA(r){return r.kind==="promptText"}function tb(r,e,t,n=!1,o){return{id:`${e}__${r.toString()}`,name:`prompt:${Bt(r)}`,value:r,kind:"promptFile",modelDescription:"Prompt instructions file",isRoot:e!=="vscode.prompt.instructions",originLabel:t,toolReferences:o,automaticallyAdded:n}}function CA(r,e=!1,t){return{id:"vscode.prompt.instructions.text",name:"prompt:instructionsList",value:r,kind:"promptText",modelDescription:"Prompt instructions list",automaticallyAdded:e,toolReferences:t}}function TA(r,e){return{kind:"tool",id:r.id,icon:vt.isThemeIcon(r.icon)?r.icon:void 0,name:r.displayName,value:void 0,range:e}}var Yl=class{constructor(e){this._ids=new Set;this._entries=[];e&&this.add(...e)}add(...e){for(let t of e)this._ids.has(t.id)||(this._ids.add(t.id),this._entries.push(t))}insertFirst(e){this._ids.has(e.id)||(this._ids.add(e.id),this._entries.unshift(e))}remove(e){this._ids.delete(e.id),this._entries=this._entries.filter(t=>t.id!==e.id)}has(e){return this._ids.has(e.id)}asArray(){return this._entries.slice(0)}get length(){return this._entries.length}};var mi=(o=>(o.Chat="panel",o.Terminal="terminal",o.Notebook="notebook",o.EditorInline="editor",o))(mi||{});(e=>{function r(t){switch(t){case"panel":return"panel";case"terminal":return"terminal";case"notebook":return"notebook";case"editor":return"editor"}return"panel"}e.fromRaw=r})(mi||={});var pG=new Set([$.vscodeChatEditor,$.walkThrough,$.vscodeLocalChatSession,$.vscodeSettings,$.webviewPanel,$.vscodeUserData,$.extension,"ccreq","openai-codex"]);var mG=new w("inModelsEditor",!1),gG=new w("inModelsSearch",!1);function Kc(r,e=Ct){return j0(r,e)?r.charAt(0).toUpperCase()+r.slice(1):r}function Bw(r,e){return r.replace(/^~($|\/|\\)/,`${e}$1`)}var EA="\u2026",Eg="\\\\",wg="~";function wA(r,e=kn){let t=new Array(r.length),n=!1;for(let o=0;o<r.length;o++){let i=r[o];if(i===""){t[o]=`.${e}`;continue}if(!i){t[o]=i;continue}n=!0;let s="",a=i;a.indexOf(Eg)===0?(s=a.substr(0,a.indexOf(Eg)+Eg.length),a=a.substr(a.indexOf(Eg)+Eg.length)):a.indexOf(e)===0?(s=a.substr(0,a.indexOf(e)+e.length),a=a.substr(a.indexOf(e)+e.length)):a.indexOf(wg)===0&&(s=a.substr(0,a.indexOf(wg)+wg.length),a=a.substr(a.indexOf(wg)+wg.length));let l=a.split(e);for(let d=1;n&&d<=l.length;d++)for(let c=l.length-d;n&&c>=0;c--){n=!1;let u=l.slice(c,c+d).join(e);for(let m=0;!n&&m<r.length;m++)if(m!==o&&r[m]&&r[m].indexOf(u)>-1){let g=c+d===l.length,v=c>0&&r[m].indexOf(e)>-1?e+u:u,h=r[m].endsWith(v);n=!g||h}if(!n){let m="";(l[0].endsWith(":")||s!=="")&&(c===1&&(c=0,d++,u=l[0]+e+u),c>0&&(m=l[0]+e),m=s+m),c>0&&(m=m+EA+e),m=m+u,c+d<l.length&&(m=m+e+EA),t[o]=m}}n&&(t[o]=i)}return t}var kG=[{id:"SessionStart",label:p(7733,null),description:p(7732,null)},{id:"UserPromptSubmit",label:p(7741,null),description:p(7740,null)},{id:"PreToolUse",label:p(7731,null),description:p(7730,null)},{id:"PostToolUse",label:p(7727,null),description:p(7726,null)},{id:"PreCompact",label:p(7729,null),description:p(7728,null)},{id:"SubagentStart",label:p(7737,null),description:p(7736,null)},{id:"SubagentStop",label:p(7739,null),description:p(7738,null)},{id:"Stop",label:p(7735,null),description:p(7734,null)}],x4={type:"object",additionalProperties:!0,required:["type"],anyOf:[{required:["command"]},{required:["windows"]},{required:["linux"]},{required:["osx"]},{required:["bash"]},{required:["powershell"]}],errorMessage:p(7706,null),properties:{type:{type:"string",enum:["command"],description:p(7712,null)},command:{type:"string",description:p(7705,null)},windows:{type:"string",description:p(7713,null)},linux:{type:"string",description:p(7709,null)},osx:{type:"string",description:p(7710,null)},cwd:{type:"string",description:p(7707,null)},env:{type:"object",additionalProperties:{type:"string"},description:p(7708,null)},timeout:{type:"number",default:30,description:p(7711,null)}}},ba={type:"array",items:x4},_G={$schema:"http://json-schema.org/draft-07/schema#",type:"object",description:p(7714,null),additionalProperties:!0,required:["hooks"],properties:{hooks:{type:"object",description:p(7715,null),additionalProperties:!0,properties:{SessionStart:{...ba,description:p(7719,null)},UserPromptSubmit:{...ba,description:p(7725,null)},PreToolUse:{...ba,description:p(7718,null)},PostToolUse:{...ba,description:p(7716,null)},PreCompact:{...ba,description:p(7717,null)},SubagentStart:{...ba,description:p(7723,null)},SubagentStop:{...ba,description:p(7724,null)},Stop:{...ba,description:p(7722,null)}}}},defaultSnippets:[{label:p(7720,null),description:p(7721,null),body:{hooks:{SessionStart:[{type:"command",command:'${1:echo "Session started" >> session.log}'}],PreToolUse:[{type:"command",command:"${2:./scripts/validate.sh}",timeout:15}]}}}]};function kA(r,e){return e===1&&r.windows?r.windows:e===2&&r.osx?r.osx:e===3&&r.linux?r.linux:r.command}var no=class{constructor(e,t,n){this.owner=e;this.debugNameSource=t;this.referenceFn=n}getDebugName(e){return RA(e,this)}},_A=new Map,Ww=new WeakMap;function RA(r,e){let t=Ww.get(r);if(t)return t;let n=S4(r,e);if(n){let o=_A.get(n)??0;o++,_A.set(n,o);let i=o===1?n:`${n}#${o}`;return Ww.set(r,i),i}}function S4(r,e){let t=Ww.get(r);if(t)return t;let n=e.owner?T4(e.owner)+".":"",o,i=e.debugNameSource;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return n+o}else return n+i;let s=e.referenceFn;if(s!==void 0&&(o=kg(s),o!==void 0))return n+o;if(e.owner!==void 0){let a=C4(e.owner,r);if(a!==void 0)return n+a}}function C4(r,e){for(let t in r)if(r[t]===e)return t}var PA=new Map,DA=new WeakMap;function T4(r){let e=DA.get(r);if(e)return e;let t=$w(r)??"Object",n=PA.get(t)??0;n++,PA.set(t,n);let o=n===1?t:`${t}#${n}`;return DA.set(r,o),o}function $w(r){let e=r.constructor;if(e)return e.name==="Object"?void 0:e.name}function kg(r){let e=r.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}function dr(r,e){return r===e}function E4(){return(r,e)=>r===e}function w4(r,e,t){return Ht(r,e,t??dr)}function k4(r){return(e,t)=>Ht(e,t,r??dr)}function qc(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!qc(r[t],e[t]))return!1;return!0}if(r&&typeof r=="object"&&e&&typeof e=="object"&&Object.getPrototypeOf(r)===Object.prototype&&Object.getPrototypeOf(e)===Object.prototype){let t=r,n=e,o=Object.keys(t),i=Object.keys(n),s=new Set(i);if(o.length!==i.length)return!1;for(let a of o)if(!s.has(a)||!qc(t[a],n[a]))return!1;return!0}return!1}function _4(){return(r,e)=>qc(r,e)}function P4(r,e){return JSON.stringify(r)===JSON.stringify(e)}function D4(){return(r,e)=>JSON.stringify(r)===JSON.stringify(e)}function R4(){return(r,e)=>r.equals(e)}function M4(r,e,t){return r==null||e===void 0||e===null?e===r:t(r,e)}function A4(r){return(e,t)=>e==null||t===void 0||t===null?t===e:r(e,t)}var L4;(u=>(u.strict=dr,u.strictC=E4,u.array=w4,u.arrayC=k4,u.structural=qc,u.structuralC=_4,u.jsonStringify=P4,u.jsonStringifyC=D4,u.thisC=R4,u.ifDefined=M4,u.ifDefinedC=A4))(L4||={});function zw(r){let e=new Error("BugIndicatingErrorRecovery: "+r);ct(e),console.error("recovered from an error that indicates a bug",e)}var Zl;function _g(r){Zl?Zl instanceof nb?Zl.loggers.push(r):Zl=new nb([Zl,r]):Zl=r}function zt(){return Zl}var Kw;function MA(r){Kw=r}function AA(r){Kw&&Kw(r)}var nb=class{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(let n of this.loggers)n.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(let n of this.loggers)n.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(let n of this.loggers)n.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(let n of this.loggers)n.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(let t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,t,n)}handleAutorunStarted(e){for(let t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(let t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,t,n)}handleDerivedCleared(e){for(let t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(let t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(let t of this.loggers)t.handleEndTransaction(e)}};function Gc(r,e){let t=new ed(r,e);try{r(t)}finally{t.finish()}}function qw(r,e,t){r?e(r):Gc(e,t)}var ed=class{constructor(e,t){this._fn=e;this._getDebugName=t;this._updatingObservers=[];zt()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():kg(this._fn)}updateObserver(e,t){if(!this._updatingObservers){zw("Transaction already finished!"),Gc(n=>{n.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){let e=this._updatingObservers;if(!e){zw("transaction.finish() has already been called!");return}for(let t=0;t<e.length;t++){let{observer:n,observable:o}=e[t];n.endUpdate(o)}this._updatingObservers=null,zt()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}};var In;(n=>{let r=!1;function e(){r=!0}n.enable=e;function t(){if(!r)return;let o=Error,i=o.stackTraceLimit;o.stackTraceLimit=3;let s=new Error().stack;return o.stackTraceLimit=i,Gw.fromStack(s,2)}n.ofCaller=t})(In||={});var Gw=class r{constructor(e,t,n,o){this.fileName=e;this.line=t;this.column=n;this.id=o}static fromStack(e,t){let n=e.split(`
`),o=O4(n[t+1]);if(o)return new r(o.fileName,o.line,o.column,o.id)}};function O4(r){let e=r.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:r};let t=r.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:r}}var jw;function LA(r){jw=r}var OA;function NA(r){OA=r}var UA;function FA(r){UA=r}var Qw;function HA(r){Qw=r}var ob=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,n=In.ofCaller()){let o=t===void 0?void 0:e,i=t===void 0?e:t;return jw({owner:o,debugName:()=>{let s=kg(i);if(s!==void 0)return s;let l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());if(l)return`${this.debugName}.${l[2]}`;if(!o)return`${this.debugName} (mapped)`},debugReferenceFn:i},s=>i(this.read(s),s),n)}flatten(){return jw({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(OA(this,t)),this}keepObserved(e){return e.add(UA(this)),this}get debugValue(){return this.get()}get debug(){return new Jw(this)}},Jw=class{constructor(e){this.observable=e}getDependencyGraph(){return Qw(this.observable,{type:"dependencies"})}getObserverGraph(){return Qw(this.observable,{type:"observers"})}},Nr=class extends ob{constructor(t){super();this._observers=new Set;zt()?.handleObservableCreated(this,t)}addObserver(t){let n=this._observers.size;this._observers.add(t),n===0&&this.onFirstObserverAdded(),n!==this._observers.size&&zt()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(t){let n=this._observers.delete(t);n&&this._observers.size===0&&this.onLastObserverRemoved(),n&&zt()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let t=!!zt();return AA(this),t||zt()?.handleObservableCreated(this,In.ofCaller()),this}debugGetObservers(){return this._observers}};function td(r,e,t=In.ofCaller()){let n;return typeof r=="string"?n=new no(void 0,r,void 0):n=new no(r,void 0,void 0),new as(n,e,dr,t)}var as=class extends Nr{constructor(t,n,o,i){super(i);this._debugNameData=t;this._equalityComparator=o;this._value=n,zt()?.handleObservableUpdated(this,{hadValue:!1,newValue:n,change:void 0,didChange:!0,oldValue:void 0})}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}get(){return this._value}set(t,n,o){if(o===void 0&&this._equalityComparator(this._value,t))return;let i;n||(n=i=new ed(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(t),zt()?.handleObservableUpdated(this,{oldValue:s,newValue:t,change:o,didChange:!0,hadValue:!0});for(let a of this._observers)n.updateObserver(a,this),a.handleChange(this,o)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(t){this._value=t}debugGetState(){return{value:this._value}}debugSetValue(t){this._value=t}};function N4(r){switch(r){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var ls=class{constructor(e,t,n,o){this._debugNameData=e;this._runFn=t;this._changeTracker=n;this._state=2;this._updateCount=0;this._disposed=!1;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._isRunning=!1;this._iteration=0;this._store=void 0;this._delayedStore=void 0;this._changeSummary=this._changeTracker?.createChangeSummary(void 0),zt()?.handleAutorunCreated(this,o),this._run(),Xs(this)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),zt()?.handleAutorunDisposed(this),Ys(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){zt()?.handleAutorunStarted(this);let t=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(o){js(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||zt()?.handleAutorunFinished(this);for(let t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}Mm(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,t){if(this._isDependency(e)){zt()?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:o=>o===e},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){js(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new St("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new St("Cannot access store after dispose");return this._store===void 0&&(this._store=new q),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new St("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new q),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:N4(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?(js(new St(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};function gi(r,e=In.ofCaller()){return new ls(new no(void 0,void 0,r),r,void 0,e)}function U4(r){switch(r){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var Hn=class extends Nr{constructor(t,n,o,i=void 0,s,a){super(a);this._debugNameData=t;this._computeFn=n;this._changeTracker=o;this._handleLastObserverRemoved=i;this._equalityComparator=s;this._state=0;this._value=void 0;this._updateCount=0;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._changeSummary=void 0;this._isUpdating=!1;this._isComputing=!1;this._didReportChange=!1;this._isInBeforeUpdate=!1;this._isReaderValid=!1;this._store=void 0;this._delayedStore=void 0;this._removedObserverToCallEndUpdateOn=null;this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}onLastObserverRemoved(){this._state=0,this._value=void 0,zt()?.handleDerivedCleared(this);for(let t of this._dependencies)t.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let n;try{this._isReaderValid=!0;let o;this._changeTracker&&(o=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,o)),n=this._computeFn(this,o)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),n}else{do{if(this._state===1){for(let n of this._dependencies)if(n.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let t=!1;this._isComputing=!0,this._didReportChange=!1;let n=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=n;try{let o=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,o),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(o));let i=this._state!==0,s=this._value;this._state=3;let a=this._delayedStore;a!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,o)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),a!==void 0&&a.dispose()}t=this._didReportChange||i&&!this._equalityComparator(s,this._value),zt()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:t,hadValue:i})}catch(o){js(o)}if(this._isComputing=!1,!this._didReportChange&&t)for(let o of this._observers)o.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(t){if(this._isUpdating)throw new St("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let n=this._updateCount===1;if(this._state===3&&(this._state=1,!n))for(let o of this._observers)o.handlePossibleChange(this);if(n)for(let o of this._observers)o.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(t){if(this._updateCount--,this._updateCount===0){let n=[...this._observers];for(let o of n)o.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let o=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let i of o)i.endUpdate(this)}}Mm(()=>this._updateCount>=0)}handlePossibleChange(t){if(this._state===3&&this._dependencies.has(t)&&!this._dependenciesToBeRemoved.has(t)){this._state=1;for(let n of this._observers)n.handlePossibleChange(this)}}handleChange(t,n){if(this._dependencies.has(t)&&!this._dependenciesToBeRemoved.has(t)||this._isInBeforeUpdate){zt()?.handleDerivedDependencyChanged(this,t,n);let o=!1;try{o=this._changeTracker?this._changeTracker.handleChange({changedObservable:t,change:n,didChange:s=>s===t},this._changeSummary):!0}catch(s){js(s)}let i=this._state===3;if(o&&(this._state===1||i)&&(this._state=2,i))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new St("The reader object cannot be used outside its compute function!")}readObservable(t){this._ensureReaderValid(),t.addObserver(this);let n=t.get();return this._dependencies.add(t),this._dependenciesToBeRemoved.delete(t),n}reportChange(t){this._ensureReaderValid(),this._didReportChange=!0;for(let n of this._observers)n.handleChange(this,t)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new q),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new q),this._delayedStore}addObserver(t){let n=!this._observers.has(t)&&this._updateCount>0;super.addObserver(t),n&&(this._removedObserverToCallEndUpdateOn?.delete(t)||t.beginUpdate(this))}removeObserver(t){this._observers.has(t)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(t)),super.removeObserver(t)}debugGetState(){return{state:this._state,stateStr:U4(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(t){this._value=t}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(t,n,o){this._value=t;let i=this._observers;n.updateObserver(this,this);for(let s of i)s.handleChange(this,o)}};function Pg(r,e,t=In.ofCaller()){return new Hn(new no(r.owner,r.debugName,r.debugReferenceFn),e,void 0,r.onLastObserverRemoved,r.equalsFn??dr,t)}LA(Pg);function fi(...r){let e,t,n,o;return r.length===2?[t,n]=r:[e,t,n,o]=r,new cr(new no(e,void 0,n),t,n,()=>cr.globalTransaction,dr,o??In.ofCaller())}var cr=class extends Nr{constructor(t,n,o,i,s,a){super(a);this._debugNameData=t;this.event=n;this._getValue=o;this._getTransaction=i;this._equalityComparator=s;this._hasValue=!1;this.handleEvent=t=>{let n=this._getValue(t),o=this._value,i=!this._hasValue||!this._equalityComparator(o,n),s=!1;i&&(this._value=n,this._hasValue&&(s=!0,qw(this._getTransaction(),a=>{zt()?.handleObservableUpdated(this,{oldValue:o,newValue:n,change:void 0,didChange:i,hadValue:this._hasValue});for(let l of this._observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{let a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")})),this._hasValue=!0),s||zt()?.handleObservableUpdated(this,{oldValue:o,newValue:n,change:void 0,didChange:i,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let t=this.getDebugName();return"From Event"+(t?`: ${t}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(t){this._value=t}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(t=>{t.Observer=cr;function e(n,o){let i=!1;cr.globalTransaction===void 0&&(cr.globalTransaction=n,i=!0);try{o()}finally{i&&(cr.globalTransaction=void 0)}}t.batchEventsGlobally=e})(fi||={});function VA(r){let e=new rb(!1,void 0);return r.addObserver(e),J(()=>{r.removeObserver(e)})}FA(VA);function BA(r,e){let t=new rb(!0,e);r.addObserver(t);try{t.beginUpdate(r)}finally{t.endUpdate(r)}return J(()=>{r.removeObserver(t)})}NA(BA);var rb=class{constructor(e,t){this._forceRecompute=e;this._handleValue=t;this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}};var ib;function $A(r){ib||(ib=new Dg,_g(ib)),ib.addFilteredObj(r)}var Dg=class{constructor(){this.indentation=0;this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return $4([jc(q4("|  ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[jc(" "),ur(Bo(e.oldValue,70),{color:"red",strikeThrough:!0}),jc(" "),ur(Bo(e.newValue,60),{color:"green"})]:[jc(" (unchanged)")]:[jc(" "),ur(Bo(e.newValue,60),{color:"green"}),jc(" (initial)")]}handleObservableCreated(e){if(e instanceof Hn){let t=e;if(this.changedObservablesSets.set(t,new Set),!1){let o=[];t.__debugUpdating=o;let i=t.beginUpdate;t.beginUpdate=a=>(o.push(a),i.apply(t,[a]));let s=t.endUpdate;t.endUpdate=a=>{let l=o.indexOf(a);return l===-1&&console.error("endUpdate called without beginUpdate",t.debugName,a.debugName),o.splice(l,1),s.apply(t,[a])}}}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){if(this._isIncluded(e)){if(e instanceof Hn){this._handleDerivedRecomputed(e,t);return}console.log(...this.textToConsoleArgs([Qc("observable value changed"),ur(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t)]))}}formatChanges(e){if(e.size!==0)return ur(" (changed deps: "+[...e].map(t=>t.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,t,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Qc("derived recomputed"),ur(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Qc("derived cleared"),ur(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,t){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Qc("observable from event triggered"),ur(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,t,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){let t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Qc("autorun"),ur(e.debugName,{color:"BlueViolet"}),this.formatChanges(t),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),t.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();t===void 0&&(t=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Qc("transaction"),ur(t,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};function $4(r){let e=new Array,t=[],n="";function o(s){if("length"in s)for(let a of s)a&&o(a);else"text"in s?(n+=`%c${s.text}`,e.push(s.style),s.data&&t.push(...s.data)):"data"in s&&t.push(...s.data)}o(r);let i=[n,...e];return i.push(...t),i}function jc(r){return ur(r,{color:"black"})}function Qc(r){return ur(G4(`${r}: `,10),{color:"black",bold:!0})}function ur(r,e={color:"black"}){function t(o){return Object.entries(o).reduce((i,[s,a])=>`${i}${s}:${a};`,"")}let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:r,style:t(n)}}function Bo(r,e){switch(typeof r){case"number":return""+r;case"string":return r.length+2<=e?`"${r}"`:`"${r.substr(0,e-7)}"+...`;case"boolean":return r?"true":"false";case"undefined":return"undefined";case"object":return r===null?"null":Array.isArray(r)?z4(r,e):K4(r,e);case"symbol":return r.toString();case"function":return`[[Function${r.name?" "+r.name:""}]]`;default:return""+r}}function z4(r,e){let t="[ ",n=!0;for(let o of r){if(n||(t+=", "),t.length-5>e){t+="...";break}n=!1,t+=`${Bo(o,e-t.length)}`}return t+=" ]",t}function K4(r,e){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString){let i=r.toString();return i.length<=e?i:i.substring(0,e-3)+"..."}let t=$w(r),n=t?t+"(":"{ ",o=!0;for(let[i,s]of Object.entries(r)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${i}: ${Bo(s,e-n.length)}`}return n+=t?")":" }",n}function q4(r,e){let t="";for(let n=1;n<=e;n++)t+=r;return t}function G4(r,e){for(;r.length<e;)r+=" ";return r}var sb=class r{constructor(e,t){this._channelFactory=e;this._getHandler=t;this._channel=this._channelFactory({handleNotification:i=>{let s=i,a=this._getHandler().notifications[s[0]];if(!a)throw new Error(`Unknown notification "${s[0]}"!`);a(...s[1])},handleRequest:i=>{let s=i;try{return{type:"result",value:this._getHandler().requests[s[0]](...s[1])}}catch(a){return{type:"error",value:a}}}});let n=new Proxy({},{get:(i,s)=>async(...a)=>{let l=await this._channel.sendRequest([s,a]);if(l.type==="error")throw l.value;return l.value}}),o=new Proxy({},{get:(i,s)=>(...a)=>{this._channel.sendNotification([s,a])}});this.api={notifications:o,requests:n}}static createHost(e,t){return new r(e,t)}static createClient(e,t){return new r(e,t)}};function zA(r,e){let t=globalThis,n=[],o,{channel:i,handler:s}=j4({sendNotification:l=>{o?o.sendNotification(l):n.push(l)}}),a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[r]=l=>{a=e(),o=l;for(let d of n)l.sendNotification(d);return n=[],s},sb.createClient(i,()=>{if(!a)throw new Error("Not supported");return a})}function j4(r){let e;return{channel:n=>(e=n,{sendNotification:o=>{r.sendNotification(o)},sendRequest:o=>{throw new Error("not supported")}}),handler:{handleRequest:n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data)}}}var ab=class{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};function Yw(r,e){for(let t in e)r[t]&&typeof r[t]=="object"&&e[t]&&typeof e[t]=="object"?Yw(r[t],e[t]):r[t]=e[t]}function Zw(r,e){for(let t in e)e[t]===null?delete r[t]:r[t]&&typeof r[t]=="object"&&e[t]&&typeof e[t]=="object"?Zw(r[t],e[t]):r[t]=e[t]}var lb=class r{constructor(){this._declarationId=0;this._instanceId=0;this._declarations=new Map;this._instanceInfos=new WeakMap;this._aliveInstances=new Map;this._activeTransactions=new Set;this._channel=zA("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{let e={};for(let t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(Kn)}),getDerivedInfo:e=>{let t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(Kn),observers:[...t.debugGetObservers()].map(n=>this._formatObserver(n)).filter(Kn)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(Kn)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{let n=this._aliveInstances.get(e);if(n instanceof Hn)n.debugSetValue(t);else if(n instanceof as)n.debugSetValue(t);else if(n instanceof cr)n.debugSetValue(t);else throw new St("Observable is not supported");let o=[...n.debugGetObservers()];for(let i of o)i.beginUpdate(n);for(let i of o)i.handleChange(n,void 0);for(let i of o)i.endUpdate(n)},getValue:e=>{let t=this._aliveInstances.get(e);if(t instanceof Hn)return Bo(t.debugGetState().value,200);if(t instanceof as)return Bo(t.debugGetState().value,200)},logValue:e=>{let t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new St("Observable is not supported")},rerun:e=>{let t=this._aliveInstances.get(e);if(t instanceof Hn)t.debugRecompute();else if(t instanceof ls)t.debugRerun();else throw new St("Observable is not supported")}}}));this._pendingChanges=null;this._changeThrottler=new ab;this._fullState={};this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)};In.enable()}static{this._instance=void 0}static getInstance(){return r._instance===void 0&&(r._instance=new r),r._instance}getTransactionState(){let e=[],t=[...this._activeTransactions];if(t.length===0)return;let n=t.flatMap(i=>i.debugGetUpdatingObservers()??[]).map(i=>i.observer),o=new Set;for(;n.length>0;){let i=n.shift();if(o.has(i))continue;o.add(i);let s=this._getInfo(i,a=>{o.has(a)||n.push(a)});s&&e.push(s)}return{names:t.map(i=>i.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let t=this._instanceInfos.get(e);if(!t){ct(new St("No info found"));return}return t}_getAutorunInfo(e){let t=this._instanceInfos.get(e);if(!t){ct(new St("No info found"));return}return t}_getInfo(e,t){if(e instanceof Hn){let n=[...e.debugGetObservers()];for(let l of n)t(l);let o=this._getObservableInfo(e);if(!o)return;let i=e.debugGetState(),s={name:e.debugName,instanceId:o.instanceId,updateCount:i.updateCount},a=[...o.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(Kn);if(i.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(i.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof ls){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},i=[...n.changedObservables].map(s=>this._instanceInfos.get(s).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:i};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:i};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof Hn)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}_handleChange(e){Zw(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:Yw(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let n=this._declarations.get(t.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,t){let o={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,t){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&t>0){let o=e instanceof Hn?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&t===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof Hn){this._handleDerivedRecomputed(e,t);return}let n=this._getObservableInfo(e);n&&t.didChange&&(n.lastValue=Bo(t.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,t){let o={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){let t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(t)}_handleDerivedRecomputed(e,t){let n=this._getObservableInfo(e);if(!n)return;let o=Bo(t.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};function KA(r,e){let t=e?.debugNamePostProcessor??(i=>i),n=nd.from(r,t);if(!n)return"";let o=new Set;return e.type==="observers"?GA(n,0,o,e).trim():qA(n,0,o,e).trim()}function qA(r,e,t,n){let o="		".repeat(e),i=[];if(t.has(r.sourceObj))return i.push(`${o}* ${r.type} ${r.name} (already listed)`),i.join(`
`);if(t.add(r.sourceObj),i.push(`${o}* ${r.type} ${r.name}:`),i.push(`${o}  value: ${Bo(r.value,50)}`),i.push(`${o}  state: ${r.state}`),r.dependencies.length>0){i.push(`${o}  dependencies:`);for(let a of r.dependencies){let l=nd.from(a,n.debugNamePostProcessor??(d=>d))??nd.unknown(a);i.push(qA(l,e+1,t,n))}}return i.join(`
`)}function GA(r,e,t,n){let o="		".repeat(e),i=[];if(t.has(r.sourceObj))return i.push(`${o}* ${r.type} ${r.name} (already listed)`),i.join(`
`);if(t.add(r.sourceObj),i.push(`${o}* ${r.type} ${r.name}:`),i.push(`${o}  value: ${Bo(r.value,50)}`),i.push(`${o}  state: ${r.state}`),r.observers.length>0){i.push(`${o}  observers:`);for(let a of r.observers){let l=nd.from(a,n.debugNamePostProcessor??(d=>d))??nd.unknown(a);i.push(GA(l,e+1,t,n))}}return i.join(`
`)}var nd=class r{constructor(e,t,n,o,i,s,a){this.sourceObj=e;this.name=t;this.type=n;this.value=o;this.state=i;this.dependencies=s;this.observers=a}static from(e,t){if(e instanceof ls){let n=e.debugGetState();return new r(e,t(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof Hn){let n=e.debugGetState();return new r(e,t(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof as){let n=e.debugGetState();return new r(e,t(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof cr){let n=e.debugGetState();return new r(e,t(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new r(e,"(unknown)","unknown",void 0,"unknown",[],[])}};HA(KA);MA($A);var Y4=!1;Y4&&_g(new Dg);Er&&Er.VSCODE_DEV_DEBUG_OBSERVABLES&&_g(lb.getInstance());var Eo;(i=>{i.Internal={type:"internal",label:"Built-In"},i.External={type:"external",label:"External"};function t(s){switch(s.type){case"extension":return`extension:${s.extensionId.value}`;case"mcp":return`mcp:${s.collectionId}:${s.definitionId}`;case"user":return`user:${s.file.toString()}`;case"internal":return"internal";case"external":return"external"}}i.toKey=t;function n(s,a){return t(s)===t(a)}i.equals=n;function o(s){return s.type==="internal"?{ordinal:1,label:p(7961,null)}:s.type==="mcp"?{ordinal:2,label:s.label}:s.type==="user"?{ordinal:0,label:p(7963,null)}:{ordinal:3,label:s.label}}i.classify=o})(Eo||={});function jA(r){return r!==null&&typeof r=="object"&&y.isUri(r.sessionResource)}function QA(r){return!!r&&r.getTools!==void 0}var od=M("ILanguageModelToolsService");var Z4;(a=>(a.execute="execute",a.edit="edit",a.search="search",a.agent="agent",a.read="read",a.web="web",a.todo="todo"))(Z4||={});var Rg;(t=>(t.runSubagent="runSubagent",t.vscode="vscode"))(Rg||={});var db=M("productService"),JA="vscode://schemas/vscode-product";var oo=M("configurationService");function cb(r,e){let t=Object.create(null);for(let n in r)ek(t,n,r[n],e);return t}function ek(r,e,t,n){let o=e.split("."),i=o.pop(),s=r;for(let a=0;a<o.length;a++){let l=o[a],d=s[l];switch(typeof d){case"undefined":d=s[l]=Object.create(null);break;case"object":if(d===null){n(`Ignoring ${e} as ${o.slice(0,a+1).join(".")} is null`);return}break;default:n(`Ignoring ${e} as ${o.slice(0,a+1).join(".")} is ${JSON.stringify(d)}`);return}s=d}if(typeof s=="object"&&s!==null)try{s[i]=t}catch{n(`Ignoring ${e} as ${o.join(".")} is ${JSON.stringify(s)}`)}else n(`Ignoring ${e} as ${o.join(".")} is ${JSON.stringify(s)}`)}function XA(r,e){let t=e.split(".");YA(r,t)}function YA(r,e){if(!r)return;let t=r,n=e.shift();if(e.length===0){delete t[n];return}if(Object.keys(t).indexOf(n)!==-1){let o=t[n];typeof o=="object"&&!Array.isArray(o)&&(YA(o,e),Object.keys(o).length===0&&delete t[n])}}function Mg(r,e,t){function n(s,a){let l=s;for(let d of a){if(typeof l!="object"||l===null)return;l=l[d]}return l}let o=e.split("."),i=n(r,o);return typeof i>"u"?t:i}function ZA(r){return r.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}function eL(r){let e=!1,t=new Map,n=new Map;if(eV(r,c=>{if(r===c)return!0;let u=JSON.stringify(c);if(u.length<30)return!0;let m=t.get(u);if(!m){let g={schemas:[c]};return t.set(u,g),n.set(c,g),!0}return m.schemas.push(c),n.set(c,m),e=!0,!1}),t.clear(),!e)return JSON.stringify(r);let i="$defs";for(;r.hasOwnProperty(i);)i+="_";let s=[];function a(c){return JSON.stringify(c,(u,m)=>{if(m!==c){let g=n.get(m);if(g&&g.schemas.length>1)return g.id||(g.id=`_${s.length}`,s.push(g.schemas[0])),{$ref:`#/${i}/${g.id}`}}return m})}let l=a(r),d=[];for(let c=0;c<s.length;c++)d.push(`"_${c}":${a(s[c])}`);return d.length?`${l.substring(0,l.length-1)},"${i}":{${d.join(",")}}}`:l}function Jc(r){return typeof r=="object"&&r!==null}function eV(r,e){if(!r||typeof r!="object")return;let t=(...l)=>{for(let d of l)Jc(d)&&s.push(d)},n=(...l)=>{for(let d of l)if(Jc(d))for(let c in d){let u=d[c];Jc(u)&&s.push(u)}},o=(...l)=>{for(let d of l)if(Array.isArray(d))for(let c of d)Jc(c)&&s.push(c)},i=l=>{if(Array.isArray(l))for(let d of l)Jc(d)&&s.push(d);else Jc(l)&&s.push(l)},s=[r],a=s.pop();for(;a;)e(a)&&(t(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),n(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),o(a.anyOf,a.allOf,a.oneOf,a.prefixItems),i(a.items)),a=s.pop()}var rd={JSONContribution:"base.contributions.json"};function tL(r){return r.length>0&&r.charAt(r.length-1)==="#"?r.substring(0,r.length-1):r}var tk=class extends H{constructor(){super(...arguments);this.schemasById={};this.schemaAssociations={};this._onDidChangeSchema=this._register(new E);this.onDidChangeSchema=this._onDidChangeSchema.event;this._onDidChangeSchemaAssociations=this._register(new E);this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(t,n,o){let i=tL(t);this.schemasById[i]=n,this._onDidChangeSchema.fire(t),o&&o.add(J(()=>{delete this.schemasById[i],this._onDidChangeSchema.fire(t)}))}registerSchemaAssociation(t,n){let o=tL(t);return this.schemaAssociations[o]||(this.schemaAssociations[o]=[]),this.schemaAssociations[o].includes(n)||(this.schemaAssociations[o].push(n),this._onDidChangeSchemaAssociations.fire()),J(()=>{let i=this.schemaAssociations[o];if(i){let s=i.indexOf(n);s!==-1&&(i.splice(s,1),i.length===0&&delete this.schemaAssociations[o],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(t){this._onDidChangeSchema.fire(t)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(t){let n=this.schemasById[t];return n?eL(n):void 0}hasSchemaContent(t){return!!this.schemasById[t]}getSchemaAssociations(){return this.schemaAssociations}},tV=new tk;ot.add(rd.JSONContribution,tV);var wo,nk=globalThis.vscode;if(typeof nk<"u"&&typeof nk.context<"u"){let r=nk.context.configuration();if(r)wo=r.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(wo=globalThis._VSCODE_PRODUCT_JSON,Er.VSCODE_DEV&&Object.assign(wo,{nameShort:`${wo.nameShort} Dev`,nameLong:`${wo.nameLong} Dev`,dataFolderName:`${wo.dataFolderName}-dev`,serverDataFolderName:wo.serverDataFolderName?`${wo.serverDataFolderName}-dev`:void 0}),!wo.version){let r=globalThis._VSCODE_PACKAGE_JSON;Object.assign(wo,{version:r.version})}}else wo={nameShort:"Deva IDE",nameLong:"Deva IDE",applicationName:"devseccode-ide",dataFolderName:".devseccode-ide",win32MutexName:"devseccodeide",licenseName:"MIT",licenseUrl:"https://github.com/devseccode/DevSecCode-IDE/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/devseccode/DevSecCode-IDE/blob/main/LICENSE.txt",serverGreeting:[],serverLicense:[],serverLicensePrompt:"",serverApplicationName:"devseccode-server",serverDataFolderName:".devseccode-server",tunnelApplicationName:"devseccode-tunnel",win32DirName:"Deva IDE",win32NameVersion:"Deva IDE",win32RegValueName:"DevSecCodeIDE",win32x64AppId:"{4C4A0F3C-0F55-4A0D-9146-8B24F26D74F9}",win32arm64AppId:"{F5C24F88-1CEB-4A77-8FB7-9F0C0EBD15A8}",win32x64UserAppId:"{E5C2B5D7-13BD-4D2F-9D27-62807C7D4994}",win32arm64UserAppId:"{A8D86CF0-58C7-46D8-9AC4-62D04E9CE9A7}",win32AppUserModelId:"Deva.IDE",win32ShellNameShort:"Deva &&IDE",win32TunnelServiceMutex:"devseccode-tunnelservice",win32TunnelMutex:"devseccode-tunnel",darwinBundleIdentifier:"com.devseccode.ide",darwinProfileUUID:"52F63D5F-9C7E-45AD-A4A7-C78A15CA5F9D",darwinProfilePayloadUUID:"3B6A6C46-D4A1-4EF3-81D0-48C23F73D57F",linuxIconName:"devseccode-ide",licenseFileName:"LICENSE.txt",reportIssueUrl:"https://github.com/devseccode/DevSecCode-IDE/issues/new",downloadUrl:"https://devseccode.ai/download",nodejsRepository:"https://nodejs.org",urlProtocol:"devseccode-ide",webviewContentExternalBaseUrlTemplate:"https://cdn.devseccode.ai/{{uuid}}/out/vs/workbench/contrib/webview/browser/pre/",builtInExtensions:[],extensionsGallery:{serviceUrl:"https://open-vsx.org/vscode/gallery",itemUrl:"https://open-vsx.org/vscode/item",resourceUrlTemplate:"https://open-vsx.org/vscode/unpkg/{publisher}/{name}/{version}/{path}",controlUrl:"",nlsBaseUrl:"",publisherUrl:"https://open-vsx.org/namespace/{publisher}"},dscServices:{llmProxyUrl:"https://us-central1-devseccode-9dc41.cloudfunctions.net/dsc-llm-proxy",marketplaceUrl:"https://dsc-marketplace-3h3bbdfu4a-uc.a.run.app"},enableTelemetry:!1,enabledTelemetryLevels:{error:!1,usage:!1},showTelemetryOptOut:!1,removeTelemetryMachineId:!0,defaultChatAgent:{extensionId:"devseccode.core",chatExtensionId:"devseccode.chat",chatExtensionOutputId:"devseccode.chat.log",documentationUrl:"https://docs.devseccode.ai/ide/chat",termsStatementUrl:"https://devseccode.ai/legal/terms",privacyStatementUrl:"https://devseccode.ai/legal/privacy",skusDocumentationUrl:"https://docs.devseccode.ai/ide/plans",publicCodeMatchesUrl:"https://docs.devseccode.ai/ide/code-attribution",manageSettingsUrl:"https://docs.devseccode.ai/ide/settings",managePlanUrl:"https://devseccode.ai/account/plan",manageOverageUrl:"https://devseccode.ai/account/usage",upgradePlanUrl:"https://devseccode.ai/pricing",signUpUrl:"https://devseccode.ai/signup",provider:{default:{id:"devseccode",name:"Deva"},enterprise:{id:"devseccode-enterprise",name:"Deva Enterprise"},google:{id:"google",name:"Google"},apple:{id:"apple",name:"Apple"}},providerUriSetting:"devsecai.enterprise.uri",providerScopes:[["openid","profile","email"],["openid","email"],["openid"]],entitlementUrl:"https://api.devseccode.ai/chat/entitlement",entitlementSignupLimitedUrl:"https://api.devseccode.ai/chat/entitlement/signup",chatQuotaExceededContext:"devseccode.chat.quotaExceeded",completionsQuotaExceededContext:"devseccode.completions.quotaExceeded",walkthroughCommand:"workbench.action.chat.open",completionsMenuCommand:"devseccode.action.openAIMenu",completionsRefreshTokenCommand:"devseccode.account.signIn",chatRefreshTokenCommand:"devseccode.chat.refreshAuth",generateCommitMessageCommand:"devseccode.chat.generateCommitMessage",resolveMergeConflictsCommand:"devseccode.chat.resolveMergeConflicts",completionsAdvancedSetting:"devsecAI.advanced",completionsEnablementSetting:"devsecAI.enableCompletions",nextEditSuggestionsSetting:"devsecAI.nextEditSuggestions.enabled",tokenEntitlementUrl:"https://api.devseccode.ai/chat/token",mcpRegistryDataUrl:"https://api.devseccode.ai/mcp/registry"},version:"1.110.0",commit:"071d09d3bfa1c7434837e456163beced5e5e1266",date:"2026-05-31T21:12:07.847Z"},Object.keys(wo).length===0&&Object.assign(wo,{version:"1.104.0-dev",nameShort:"Deva IDE Dev",nameLong:"Deva IDE Dev",applicationName:"devseccode-ide",dataFolderName:".devseccode-ide",urlProtocol:"devseccode-ide",reportIssueUrl:"https://github.com/devseccode/DevSecCode-IDE/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/devseccode/DevSecCode-IDE/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/devseccode/DevSecCode-IDE/blob/main/LICENSE.txt",defaultChatAgent:{extensionId:"devseccode.core",chatExtensionId:"devseccode.chat",provider:{default:{id:"devseccode",name:"Deva"},enterprise:{id:"devseccode-enterprise",name:"Deva Enterprise"}},providerScopes:[]}});var Wo=wo;var ko={Configuration:"base.contributions.configuration"};var ub={properties:{},patternProperties:{}},pb={properties:{},patternProperties:{}},mb={properties:{},patternProperties:{}},gb={properties:{},patternProperties:{}},fb={properties:{},patternProperties:{}},hb={properties:{},patternProperties:{}},Ag={properties:{},patternProperties:{}},id="vscode://schemas/settings/resourceLanguage";var vb=ot.as(rd.JSONContribution),ok=class extends H{constructor(){super();this.registeredConfigurationDefaults=[];this.overrideIdentifiers=new Set;this._onDidSchemaChange=this._register(new E);this.onDidSchemaChange=this._onDidSchemaChange.event;this._onDidUpdateConfiguration=this._register(new E);this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event;this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:p(1825,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},vb.registerSchema(id,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(t,n=!0){return this.registerConfigurations([t],n),t}registerConfigurations(t,n=!0){let o=new Set;this.doRegisterConfigurations(t,n,o),vb.registerSchema(id,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}deregisterConfigurations(t){let n=new Set;this.doDeregisterConfigurations(t,n),vb.registerSchema(id,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}updateConfigurations({add:t,remove:n}){let o=new Set;this.doDeregisterConfigurations(n,o),this.doRegisterConfigurations(t,!1,o),vb.registerSchema(id,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}registerDefaultConfigurations(t){let n=new Set;this.doRegisterDefaultConfigurations(t,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doRegisterDefaultConfigurations(t,n){this.registeredConfigurationDefaults.push(...t);let o=[];for(let{overrides:i,source:s}of t)for(let a in i){n.add(a);let l=this.configurationDefaultsOverrides.get(a)??this.configurationDefaultsOverrides.set(a,{configurationDefaultOverrides:[]}).get(a),d=i[a];if(l.configurationDefaultOverrides.push({value:d,source:s}),pr.test(a)){let c=this.mergeDefaultConfigurationsForOverrideIdentifier(a,d,s,l.configurationDefaultOverrideValue);if(!c)continue;l.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(a,c,s),o.push(...Xc(a))}else{let c=this.mergeDefaultConfigurationsForConfigurationProperty(a,d,s,l.configurationDefaultOverrideValue);if(!c)continue;l.configurationDefaultOverrideValue=c;let u=this.configurationProperties[a];u&&(this.updatePropertyDefaultValue(a,u),this.updateSchema(a,u))}}this.doRegisterOverrideIdentifiers(o)}deregisterDefaultConfigurations(t){let n=new Set;this.doDeregisterDefaultConfigurations(t,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(t,n){for(let o of t){let i=this.registeredConfigurationDefaults.indexOf(o);i!==-1&&this.registeredConfigurationDefaults.splice(i,1)}for(let{overrides:o,source:i}of t)for(let s in o){let a=this.configurationDefaultsOverrides.get(s);if(!a)continue;let l=a.configurationDefaultOverrides.findIndex(d=>i?d.source?.id===i.id:d.value===o[s]);if(l!==-1){if(a.configurationDefaultOverrides.splice(l,1),a.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(s),pr.test(s)){let d;for(let c of a.configurationDefaultOverrides)d=this.mergeDefaultConfigurationsForOverrideIdentifier(s,c.value,c.source,d);d&&!yc(d.value)?(a.configurationDefaultOverrideValue=d,this.updateDefaultOverrideProperty(s,d,i)):(this.configurationDefaultsOverrides.delete(s),delete this.configurationProperties[s],delete this.defaultLanguageConfigurationOverridesNode.properties[s])}else{let d;for(let u of a.configurationDefaultOverrides)d=this.mergeDefaultConfigurationsForConfigurationProperty(s,u.value,u.source,d);a.configurationDefaultOverrideValue=d;let c=this.configurationProperties[s];c&&(this.updatePropertyDefaultValue(s,c),this.updateSchema(s,c))}n.add(s)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(t,n,o){let i={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:n.value,description:p(1824,null,ZA(t)),$ref:id,defaultDefaultValue:n.value,source:o,defaultValueSource:o};this.configurationProperties[t]=i,this.defaultLanguageConfigurationOverridesNode.properties[t]=i}mergeDefaultConfigurationsForOverrideIdentifier(t,n,o,i){let s=i?.value||{},a=i?.source??new Map;if(!(a instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let l of Object.keys(n)){let d=n[l];if(ut(d)&&(bc(s[l])||ut(s[l]))){if(s[l]={...s[l]??{},...d},o)for(let u in d)a.set(`${l}.${u}`,o)}else s[l]=d,o?a.set(l,o):a.delete(l)}return{value:s,source:a}}mergeDefaultConfigurationsForConfigurationProperty(t,n,o,i){let s=this.configurationProperties[t],a=i?.value??s?.defaultDefaultValue,l=o;if(ut(n)&&(s!==void 0&&s.type==="object"||s===void 0&&(bc(a)||ut(a)))){if(l=i?.source??new Map,!(l instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let c in n)o&&l.set(`${t}.${c}`,o);n={...ut(a)?a:{},...n}}return{value:n,source:l}}deltaConfiguration(t){let n=!1,o=new Set;t.removedDefaults&&(this.doDeregisterDefaultConfigurations(t.removedDefaults,o),n=!0),t.addedDefaults&&(this.doRegisterDefaultConfigurations(t.addedDefaults,o),n=!0),t.removedConfigurations&&this.doDeregisterConfigurations(t.removedConfigurations,o),t.addedConfigurations&&this.doRegisterConfigurations(t.addedConfigurations,!1,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:n})}notifyConfigurationSchemaUpdated(...t){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(t){this.doRegisterOverrideIdentifiers(t),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(t){for(let n of t)this.overrideIdentifiers.add(n);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(t,n,o){t.forEach(i=>{this.validateAndRegisterProperties(i,n,i.extensionInfo,i.restrictedProperties,void 0,o),this.configurationContributors.push(i),this.registerJSONConfiguration(i)})}doDeregisterConfigurations(t,n){let o=i=>{if(i.properties)for(let s in i.properties){n.add(s);let a=this.configurationProperties[s];a?.policy?.name&&this.policyConfigurations.delete(a.policy.name),delete this.configurationProperties[s],this.removeFromSchema(s,i.properties[s])}i.allOf?.forEach(s=>o(s))};for(let i of t){o(i);let s=this.configurationContributors.indexOf(i);s!==-1&&this.configurationContributors.splice(s,1)}}validateAndRegisterProperties(t,n=!0,o,i,s=4,a){s=wt(t.scope)?s:t.scope;let l=t.properties;if(l)for(let c in l){let u=l[c];if(u.section={id:t.id,title:t.title,order:t.order,extensionInfo:t.extensionInfo},n&&oV(c,u,o?.id)){delete l[c];continue}u.source=o,u.defaultDefaultValue=l[c].default,this.updatePropertyDefaultValue(c,u),pr.test(c)?u.scope=void 0:(u.scope=wt(u.scope)?s:u.scope,u.restricted=wt(u.restricted)?!!i?.includes(c):u.restricted),u.experiment?u.tags?.some(v=>v.toLowerCase()==="onexp")||(u.tags=u.tags??[],u.tags.push("onExP")):u.tags?.some(v=>v.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${c}'. Please use 'experiment' property instead.`),u.experiment={mode:"startup"});let m=l[c].hasOwnProperty("included")&&!l[c].included,g=l[c].policy?.name;m?(this.excludedConfigurationProperties[c]=l[c],g&&(this.policyConfigurations.set(g,c),a.add(c)),delete l[c]):(a.add(c),g&&this.policyConfigurations.set(g,c),this.configurationProperties[c]=l[c],!l[c].deprecationMessage&&l[c].markdownDeprecationMessage&&(l[c].deprecationMessage=l[c].markdownDeprecationMessage))}let d=t.allOf;if(d)for(let c of d)this.validateAndRegisterProperties(c,n,o,i,s,a)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){let t=new Map;for(let[n,o]of this.configurationDefaultsOverrides)o.configurationDefaultOverrideValue&&t.set(n,o.configurationDefaultOverrideValue);return t}registerJSONConfiguration(t){let n=o=>{let i=o.properties;if(i)for(let a in i)this.updateSchema(a,i[a]);o.allOf?.forEach(n)};n(t)}updateSchema(t,n){switch(ub.properties[t]=n,n.scope){case 1:pb.properties[t]=n;break;case 2:gb.properties[t]=n;break;case 3:mb.properties[t]=n;break;case 7:fb.properties[t]=n;break;case 4:hb.properties[t]=n;break;case 5:Ag.properties[t]=n;break;case 6:Ag.properties[t]=n,this.resourceLanguageSettingsSchema.properties[t]=n;break}}removeFromSchema(t,n){switch(delete ub.properties[t],n.scope){case 1:delete pb.properties[t];break;case 2:delete gb.properties[t];break;case 3:delete mb.properties[t];break;case 7:delete fb.properties[t];break;case 4:delete hb.properties[t];break;case 5:case 6:delete Ag.properties[t],delete this.resourceLanguageSettingsSchema.properties[t];break}}updateOverridePropertyPatternKey(){for(let t of this.overrideIdentifiers.values()){let n=`[${t}]`,o={type:"object",description:p(1826,null),errorMessage:p(1827,null),$ref:id};this.updatePropertyDefaultValue(n,o),ub.properties[n]=o,pb.properties[n]=o,mb.properties[n]=o,gb.properties[n]=o,fb.properties[n]=o,hb.properties[n]=o,Ag.properties[n]=o}}registerOverridePropertyPatternKey(){let t={type:"object",description:p(1826,null),errorMessage:p(1827,null),$ref:id};ub.patternProperties[ya]=t,pb.patternProperties[ya]=t,mb.patternProperties[ya]=t,gb.patternProperties[ya]=t,fb.patternProperties[ya]=t,hb.patternProperties[ya]=t,Ag.patternProperties[ya]=t,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(t,n){let o=this.configurationDefaultsOverrides.get(t)?.configurationDefaultOverrideValue,i,s;o&&(!n.disallowConfigurationDefault||!o.source)&&(i=o.value,s=o.source),bc(i)&&(i=n.defaultDefaultValue,s=void 0),bc(i)&&(i=nV(n.type)),n.default=i,n.defaultValueSource=s}},oL="\\[([^\\]]+)\\]",nL=new RegExp(oL,"g"),ya=`^(${oL})+$`,pr=new RegExp(ya);function Xc(r){let e=[];if(pr.test(r)){let t=nL.exec(r);for(;t?.length;){let n=t[1].trim();n&&e.push(n),t=nL.exec(r)}}return Xo(e)}function nV(r){switch(Array.isArray(r)?r[0]:r){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}var bb=new ok;ot.add(ko.Configuration,bb);function oV(r,e,t){return r.trim()?pr.test(r)?p(1823,null,r):bb.getConfigurationProperties()[r]!==void 0&&(!t||!rV.has(t.toLowerCase()))?p(1821,null,r):e.policy?.name&&bb.getPolicyConfigurations().get(e.policy?.name)!==void 0?p(1820,null,r,e.policy?.name,bb.getPolicyConfigurations().get(e.policy?.name)):null:p(1822,null)}var rV=new Set(Wo.defaultChatAgent?[Wo.defaultChatAgent.extensionId,Wo.defaultChatAgent.chatExtensionId].map(r=>r.toLowerCase()):[]);var Ib=M("requestService");function iV(r){return r.res.statusCode&&r.res.statusCode>=200&&r.res.statusCode<300||r.res.statusCode===1223}function sL(r){return r.res.statusCode===204}async function ik(r){return sL(r)?null:(await iT(r.stream)).toString()}async function aL(r){if(!iV(r))throw new Error("Server returned "+r.res.statusCode);if(sL(r))return null;let t=(await iT(r.stream)).toString();try{return JSON.parse(t)}catch(n){throw n.message+=`:
`+t,n}}var sV=!1,rk=[],rL,iL;function aV(r=!0,e=!0){if(rL===r&&iL===e)return;rL=r,iL=e;let t=ot.as(ko.Configuration),n=rk;rk=[{id:"http",order:15,title:p(2252,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:e,markdownDescription:p(2267,null),restricted:!0}}},{id:"http",order:15,title:p(2252,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:p(2250,null),restricted:!0}}},{id:"http",order:15,title:p(2252,null),type:"object",scope:r?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:p(2255,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:p(2263,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:p(2257,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:p(2254,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:p(2256,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[p(2260,null),p(2261,null),p(2259,null),p(2262,null)],default:"override",markdownDescription:p(2258,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:p(2264,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificatesNode":{type:"boolean",tags:["experimental"],default:sV,markdownDescription:p(2265,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:p(2266,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:p(2251,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.experimental.networkInterfaceCheckInterval":{type:"number",default:300,minimum:-1,tags:["experimental"],markdownDescription:p(2253,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}}}}],t.updateConfigurations({add:rk,remove:n})}aV();var sk=class{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===$.file?e.resource.fsPath:e.resource?.path}},mZ=new sk,lL=M("quickInputService");var dL=M("encryptionService"),hZ=M("encryptionMainService");var Yc=class r extends H{constructor(t,n=Object.create(null)){super();this.database=t;this.options=n;this._onDidChangeStorage=this._register(new Zs);this.onDidChangeStorage=this._onDidChangeStorage.event;this.state=0;this.cache=new Map;this.flushDelayer=this._register(new Tc(r.DEFAULT_FLUSH_DELAY));this.pendingDeletes=new Set;this.pendingInserts=new Map;this.pendingClose=void 0;this.whenFlushedCallbacks=[];this.registerListeners()}static{this.DEFAULT_FLUSH_DELAY=100}registerListeners(){this._register(this.database.onDidChangeItemsExternal(t=>this.onDidChangeItemsExternal(t)))}onDidChangeItemsExternal(t){this._onDidChangeStorage.pause();try{t.changed?.forEach((n,o)=>this.acceptExternal(o,n)),t.deleted?.forEach(n=>this.acceptExternal(n,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(t,n){if(this.state===2)return;let o=!1;wt(n)?o=this.cache.delete(t):this.cache.get(t)!==n&&(this.cache.set(t,n),o=!0),o&&this._onDidChangeStorage.fire({key:t,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===0&&(this.state=1,this.options.hint!==0&&(this.cache=await this.database.getItems()))}get(t,n){let o=this.cache.get(t);return wt(o)?n:o}getBoolean(t,n){let o=this.get(t);return wt(o)?n:o==="true"}getNumber(t,n){let o=this.get(t);return wt(o)?n:parseInt(o,10)}getObject(t,n){let o=this.get(t);return wt(o)?n:$v(o)}async set(t,n,o=!1){if(this.state===2)return;if(wt(n))return this.delete(t,o);let i=ut(n)||Array.isArray(n)?oA(n):String(n);if(this.cache.get(t)!==i)return this.cache.set(t,i),this.pendingInserts.set(t,i),this.pendingDeletes.delete(t),this._onDidChangeStorage.fire({key:t,external:o}),this.doFlush()}async delete(t,n=!1){if(!(this.state===2||!this.cache.delete(t)))return this.pendingDeletes.has(t)||this.pendingDeletes.add(t),this.pendingInserts.delete(t),this._onDidChangeStorage.fire({key:t,external:n}),this.doFlush()}async optimize(){if(this.state!==2)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=2;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let t={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(t).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(t){if(!(this.state===2||this.pendingClose))return this.doFlush(t)}async doFlush(t){return this.options.hint===1?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),t)}async whenFlushed(){if(this.hasPending)return new Promise(t=>this.whenFlushedCallbacks.push(t))}isInMemory(){return this.options.hint===1}},Zc=class{constructor(){this.onDidChangeItemsExternal=Me.None;this.items=new Map}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,n)=>this.items.set(n,t)),e.delete?.forEach(t=>this.items.delete(t))}async optimize(){}async close(){}};var Lg=M("environmentService"),wZ=Lg;var xb=M("IUriIdentityService");function cL(r){let e=r;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.isDefault=="boolean"&&typeof e.name=="string"&&y.isUri(e.location)&&y.isUri(e.globalStorageHome)&&y.isUri(e.settingsResource)&&y.isUri(e.keybindingsResource)&&y.isUri(e.tasksResource)&&y.isUri(e.snippetsHome)&&y.isUri(e.promptsHome)&&y.isUri(e.extensionsResource)&&y.isUri(e.mcpResource))}var uL=M("IUserDataProfilesService");function Sb(r,e,t,n,o,i){return{id:r,name:e,location:t,isDefault:!1,icon:o?.icon,globalStorageHome:i&&o?.useDefaultFlags?.globalState?i.globalStorageHome:Ut(t,"globalStorage"),settingsResource:i&&o?.useDefaultFlags?.settings?i.settingsResource:Ut(t,"settings.json"),keybindingsResource:i&&o?.useDefaultFlags?.keybindings?i.keybindingsResource:Ut(t,"keybindings.json"),tasksResource:i&&o?.useDefaultFlags?.tasks?i.tasksResource:Ut(t,"tasks.json"),snippetsHome:i&&o?.useDefaultFlags?.snippets?i.snippetsHome:Ut(t,"snippets"),promptsHome:i&&o?.useDefaultFlags?.prompts?i.promptsHome:Ut(t,"prompts"),extensionsResource:i&&o?.useDefaultFlags?.extensions?i.extensionsResource:Ut(t,"extensions.json"),mcpResource:i&&o?.useDefaultFlags?.mcp?i.mcpResource:Ut(t,"mcp.json"),cacheHome:Ut(n,r),useDefaultFlags:o?.useDefaultFlags,isTransient:o?.transient,workspaces:o?.workspaces}}var Cb=class extends H{constructor(t,n,o,i){super();this.environmentService=t;this.fileService=n;this.uriIdentityService=o;this.logService=i;this._onDidChangeProfiles=this._register(new E);this.onDidChangeProfiles=this._onDidChangeProfiles.event;this._onWillCreateProfile=this._register(new E);this.onWillCreateProfile=this._onWillCreateProfile.event;this._onWillRemoveProfile=this._register(new E);this.onWillRemoveProfile=this._onWillRemoveProfile.event;this._onDidResetWorkspaces=this._register(new E);this.onDidResetWorkspaces=this._onDidResetWorkspaces.event;this.profileCreationPromises=new Map;this.transientProfilesObject={profiles:[],emptyWindows:new Map};this.profilesHome=Ut(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=Ut(this.environmentService.cacheHome,"CachedProfilesData")}static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){let t=this.createDefaultProfile(),n=[t];try{for(let i of this.getStoredProfiles()){if(this.isInvalidProfile(i)){this.logService.warn("Skipping the invalid stored profile",i.location||i.name);continue}let s=Bt(i.location);n.push(Sb(s,i.name,i.location,this.profilesCacheHome,{icon:i.icon,useDefaultFlags:i.useDefaultFlags},t))}}catch(i){this.logService.error(i)}let o=new Map;if(n.length)try{let i=this.getStoredProfileAssociations();if(i.workspaces)for(let[s,a]of Object.entries(i.workspaces)){let l=y.parse(s),d=n.find(c=>c.id===a);if(d){let c=d.workspaces?d.workspaces.slice(0):[];c.push(l),d.workspaces=c}}if(i.emptyWindows)for(let[s,a]of Object.entries(i.emptyWindows)){let l=n.find(d=>d.id===a);l&&o.set(s,l)}}catch(i){this.logService.error(i)}this._profilesObject={profiles:n,emptyWindows:o}}return this._profilesObject}isInvalidProfile(t){return!!(!t.name||!ke(t.name)||!t.location||t.isSystem||this.uriIdentityService.extUri.basename(this.uriIdentityService.extUri.dirname(t.location))==="builtin")}createDefaultProfile(){let t=Sb("__default__profile__",p(2674,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...t,extensionsResource:this.getDefaultProfileExtensionsLocation()??t.extensionsResource,isDefault:!0}}async createTransientProfile(t){let n="Temp",o=new RegExp(`${or(n)}\\s(\\d+)`),i=0;for(let a of this.profiles){let l=o.exec(a.name),d=l?parseInt(l[1]):0;i=d>i?d:i}let s=`${n} ${i+1}`;return this.createProfile(Rr(pt()).toString(16),s,{transient:!0},t)}async createNamedProfile(t,n,o){return this.createProfile(Rr(pt()).toString(16),t,n,o)}async createProfile(t,n,o,i){return await this.doCreateProfile(t,n,o,i)}async doCreateProfile(t,n,o,i){if(!ke(n)||!n)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(n);return s||(s=(async()=>{try{if(this.profiles.find(u=>u.id===t||!u.isTransient&&!o?.transient&&u.name===n))throw new Error(`Profile with ${n} name already exists`);let l=i?this.getWorkspace(i):void 0;y.isUri(l)&&(o={...o,workspaces:[l]});let d=Sb(t,n,this.uriIdentityService.extUri.joinPath(this.profilesHome,t),this.profilesCacheHome,o,this.defaultProfile);await this.fileService.createFolder(d.location);let c=[];return this._onWillCreateProfile.fire({profile:d,join(u){c.push(u)}}),await aa.settled(c),l&&!y.isUri(l)&&this.updateEmptyWindowAssociation(l,d,!!d.isTransient),this.updateProfiles([d],[],[]),d}finally{this.profileCreationPromises.delete(n)}})(),this.profileCreationPromises.set(n,s)),s}async updateProfile(t,n){let o=[];for(let s of this.profiles){let a;if(t.id===s.id)s.isDefault?n.workspaces&&(a=s,a.workspaces=n.workspaces):a=Sb(s.id,n.name??s.name,s.location,this.profilesCacheHome,{icon:n.icon===null?void 0:n.icon??s.icon,transient:n.transient??s.isTransient,useDefaultFlags:n.useDefaultFlags??s.useDefaultFlags,workspaces:n.workspaces??s.workspaces},this.defaultProfile);else if(n.workspaces){let l=s.workspaces?.filter(d=>!n.workspaces?.some(c=>this.uriIdentityService.extUri.isEqual(d,c)));s.workspaces?.length!==l?.length&&(a=s,a.workspaces=l)}a&&o.push(a)}if(!o.length)throw t.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${t.name}' does not exist`);this.updateProfiles([],[],o);let i=this.profiles.find(s=>s.id===t.id);if(!i)throw new Error(`Profile '${t.name}' was not updated`);return i}async removeProfile(t){if(t.isDefault)throw new Error("Cannot remove default profile");let n=this.profiles.find(i=>i.id===t.id);if(!n)throw new Error(`Profile '${t.name}' does not exist`);let o=[];this._onWillRemoveProfile.fire({profile:n,join(i){o.push(i)}});try{await Promise.allSettled(o)}catch(i){this.logService.error(i)}this.updateProfiles([],[n],[]);try{await this.fileService.del(n.cacheHome,{recursive:!0})}catch(i){CM(i)!==1&&this.logService.error(i)}}async setProfileForWorkspace(t,n){let o=this.profiles.find(s=>s.id===n.id);if(!o)throw new Error(`Profile '${n.name}' does not exist`);let i=this.getWorkspace(t);if(y.isUri(i)){let s=o.workspaces?[...o.workspaces]:[];s.some(a=>this.uriIdentityService.extUri.isEqual(a,i))||(s.push(i),await this.updateProfile(o,{workspaces:s}))}else this.updateEmptyWindowAssociation(i,o,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(t,n=!1){let o=this.getWorkspace(t);if(y.isUri(o)){let i=this.getProfileForWorkspace(t);i&&this.updateProfile(i,{workspaces:i.workspaces?.filter(s=>!this.uriIdentityService.extUri.isEqual(s,o))})}else this.updateEmptyWindowAssociation(o,void 0,n),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(let t of this.profiles)t.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){try{if(await this.fileService.exists(this.profilesHome)){let t=this.uriIdentityService.extUri.joinPath(this.profilesHome,"builtin");if(await this.fileService.exists(t))try{await this.fileService.del(t,{recursive:!0})}catch(o){this.logService.error(o)}let n=await this.fileService.resolve(this.profilesHome);await Promise.all((n.children||[]).filter(o=>o.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,o.resource))).map(o=>this.fileService.del(o.resource,{recursive:!0})))}}catch(t){this.logService.error("Error deleting redundant profile folders",t)}try{let t=this.getStoredProfiles(),n=[];for(let o of this.getStoredProfiles())this.isInvalidProfile(o)?this.logService.warn(`Invalid user data profile found: ${o.name}`):n.push(o);t.length!==n.length&&this.saveStoredProfiles(n)}catch(t){this.logService.error("Error removing invalid stored profiles",t)}}async cleanUpTransientProfiles(){let t=this.transientProfilesObject.profiles.filter(n=>!this.isProfileAssociatedToWorkspace(n));await Promise.allSettled(t.map(n=>this.removeProfile(n)))}getProfileForWorkspace(t){let n=this.getWorkspace(t);return y.isUri(n)?this.profiles.find(o=>o.workspaces?.some(i=>this.uriIdentityService.extUri.isEqual(i,n))):this.profilesObject.emptyWindows.get(n)??this.transientProfilesObject.emptyWindows.get(n)}getWorkspace(t){return wM(t)?t.uri:kM(t)?t.configPath:t.id}isProfileAssociatedToWorkspace(t){return!!(t.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,t.location))||[...this.transientProfilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,t.location)))}updateProfiles(t,n,o,i=!1){let s=[...this.profiles,...t],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let l=[];for(let d of s){if(n.some(c=>d.id===c.id)){for(let c of[...this.profilesObject.emptyWindows.keys()])d.id===this.profilesObject.emptyWindows.get(c)?.id&&this.profilesObject.emptyWindows.delete(c);continue}if(!d.isDefault){d=o.find(u=>d.id===u.id)??d;let c=a.find(u=>d.id===u.id);if(d.isTransient)this.transientProfilesObject.profiles.push(d);else if(c){for(let[u,m]of this.transientProfilesObject.emptyWindows.entries())if(d.id===m.id){this.transientProfilesObject.emptyWindows.delete(u),this.profilesObject.emptyWindows.set(u,d);break}}}d.workspaces?.length===0&&(d.workspaces=void 0),l.push(d)}this.updateStoredProfiles(l),i||this.triggerProfilesChanges(t,n,o)}triggerProfilesChanges(t,n,o){this._onDidChangeProfiles.fire({added:t,removed:n,updated:o,all:this.profiles})}updateEmptyWindowAssociation(t,n,o){o=n?.isTransient?!0:o,o?n?this.transientProfilesObject.emptyWindows.set(t,n):this.transientProfilesObject.emptyWindows.delete(t):(this.transientProfilesObject.emptyWindows.delete(t),n?this.profilesObject.emptyWindows.set(t,n):this.profilesObject.emptyWindows.delete(t))}updateStoredProfiles(t){let n=[],o={},i={};for(let s of t)if(!s.isTransient&&(s.isDefault||n.push({location:s.location,name:s.name,icon:s.icon,useDefaultFlags:s.useDefaultFlags}),s.workspaces))for(let a of s.workspaces)o[a.toString()]=s.id;for(let[s,a]of this.profilesObject.emptyWindows.entries())i[s.toString()]=a.id;this.saveStoredProfileAssociations({workspaces:o,emptyWindows:i}),this.saveStoredProfiles(n),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(t){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(t){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};Cb=D([C(0,Lg),C(1,ql),C(2,xb),C(3,ue)],Cb);var dV="__$__isNewStorageMarker",Tb="__$__targetStorageMarker",ds=M("storageService");function cV(r){let e=r.get(Tb);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}var lk=class r extends H{constructor(t={flushInterval:r.DEFAULT_FLUSH_INTERVAL}){super();this._onDidChangeValue=this._register(new Zs);this._onDidChangeTarget=this._register(new Zs);this.onDidChangeTarget=this._onDidChangeTarget.event;this._onWillSaveState=this._register(new E);this.onWillSaveState=this._onWillSaveState.event;this.runFlushWhenIdle=this._register(new En);this._workspaceKeyTargets=void 0;this._profileKeyTargets=void 0;this._applicationKeyTargets=void 0;this.flushWhenIdleScheduler=this._register(new Xn(()=>this.doFlushWhenIdle(),t.flushInterval))}static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}onDidChangeValue(t,n,o){return Me.filter(this._onDidChangeValue.event,i=>i.scope===t&&(n===void 0||i.key===n),o)}doFlushWhenIdle(){this.runFlushWhenIdle.value=jT(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){wn([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{bn("code/willInitStorage");try{await this.doInitialize()}finally{bn("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(t,n){let{key:o,external:i}=n;if(o===Tb){switch(t){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:t})}else this._onDidChangeValue.fire({scope:t,key:o,target:this.getKeyTargets(t)[o],external:i})}emitWillSaveState(t){this._onWillSaveState.fire({reason:t})}get(t,n,o){return this.getStorage(n)?.get(t,o)}getBoolean(t,n,o){return this.getStorage(n)?.getBoolean(t,o)}getNumber(t,n,o){return this.getStorage(n)?.getNumber(t,o)}getObject(t,n,o){return this.getStorage(n)?.getObject(t,o)}storeAll(t,n){this.withPausedEmitters(()=>{for(let o of t)this.store(o.key,o.value,o.scope,o.target,n)})}store(t,n,o,i,s=!1){if(wt(n)){this.remove(t,o,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(t,o,i),this.getStorage(o)?.set(t,n,s)})}remove(t,n,o=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(t,n,void 0),this.getStorage(n)?.delete(t,o)})}withPausedEmitters(t){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{t()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(t,n){let o=[],i=this.getKeyTargets(t);for(let s of Object.keys(i))i[s]===n&&o.push(s);return o}updateKeyTarget(t,n,o,i=!1){let s=this.getKeyTargets(n);typeof o=="number"?s[t]!==o&&(s[t]=o,this.getStorage(n)?.set(Tb,JSON.stringify(s),i)):typeof s[t]=="number"&&(delete s[t],this.getStorage(n)?.set(Tb,JSON.stringify(s),i))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(t){switch(t){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(t){let n=this.getStorage(t);return n?cV(n):Object.create(null)}isNew(t){return this.getBoolean(dV,t)===!0}async flush(t=0){this._onWillSaveState.fire({reason:t});let n=this.getStorage(-1),o=this.getStorage(0),i=this.getStorage(1);switch(t){case 0:await aa.settled([n?.whenFlushed()??Promise.resolve(),o?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve()]);break;case 1:await aa.settled([n?.flush(0)??Promise.resolve(),o?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve()]);break}}async log(){let t=this.getStorage(-1)?.items??new Map,n=this.getStorage(0)?.items??new Map,o=this.getStorage(1)?.items??new Map;return uV(t,n,o,this.getLogDetails(-1)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async optimize(t){return await this.flush(),this.getStorage(t)?.optimize()}async switch(t,n){return this.emitWillSaveState(0),cL(t)?this.switchToProfile(t,n):this.switchToWorkspace(t,n)}canSwitchProfile(t,n){return!(t.id===n.id||pL(n)&&pL(t))}switchData(t,n,o){this.withPausedEmitters(()=>{let i=new Set;for(let[s,a]of t)i.add(s),n.get(s)!==a&&this.emitDidChangeValue(o,{key:s,external:!0});for(let[s]of n.items)i.has(s)||this.emitDidChangeValue(o,{key:s,external:!0})})}};function pL(r){return r.isDefault||!!r.useDefaultFlags?.globalState}var Eb=class extends lk{constructor(){super();this.applicationStorage=this._register(new Yc(new Zc,{hint:1}));this.profileStorage=this._register(new Yc(new Zc,{hint:1}));this.workspaceStorage=this._register(new Yc(new Zc,{hint:1}));this._register(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(1,t))),this._register(this.profileStorage.onDidChangeStorage(t=>this.emitDidChangeValue(0,t))),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(-1,t)))}getStorage(t){switch(t){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(t){switch(t){case-1:return"inMemory (application)";case 0:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(t){return!1}};async function uV(r,e,t,n,o,i){let s=h=>{try{return JSON.parse(h)}catch{return h}},a=new Map,l=new Map;r.forEach((h,x)=>{a.set(x,h),l.set(x,s(h))});let d=new Map,c=new Map;e.forEach((h,x)=>{d.set(x,h),c.set(x,s(h))});let u=new Map,m=new Map;t.forEach((h,x)=>{u.set(x,h),m.set(x,s(h))}),console.group(n!==o?`Storage: Application (path: ${n})`:`Storage: Application & Profile (path: ${n}, default profile)`);let g=[];if(a.forEach((h,x)=>{g.push({key:x,value:h})}),console.table(g),console.groupEnd(),console.log(l),n!==o){console.group(`Storage: Profile (path: ${o}, profile specific)`);let h=[];d.forEach((x,S)=>{h.push({key:S,value:x})}),console.table(h),console.groupEnd(),console.log(c)}console.group(`Storage: Workspace (path: ${i})`);let v=[];u.forEach((h,x)=>{v.push({key:x,value:h})}),console.table(v),console.groupEnd(),console.log(m)}var mL=M("secretStorageService"),wb=class extends H{constructor(t,n,o,i){super();this._useInMemoryStorage=t;this._storageService=n;this._encryptionService=o;this._logService=i;this._storagePrefix="secret://";this.onDidChangeSecretEmitter=this._register(new E);this.onDidChangeSecret=this.onDidChangeSecretEmitter.event;this._sequencer=new sa;this._type="unknown";this._onDidChangeValueDisposable=this._register(new q);this._lazyStorageService=new dt(()=>this.initialize())}get type(){return this._type}get resolvedStorageService(){return this._lazyStorageService.value}get(t){return this._sequencer.queue(t,async()=>{let n=await this.resolvedStorageService,o=this.getKey(t);this._logService.trace("[secrets] getting secret for key:",o);let i=n.get(o,-1);if(!i){this._logService.trace("[secrets] no secret found for key:",o);return}try{this._logService.trace("[secrets] decrypting gotten secret for key:",o);let s=this._type==="in-memory"?i:await this._encryptionService.decrypt(i);return this._logService.trace("[secrets] decrypted secret for key:",o),s}catch(s){this._logService.error(s),this.delete(t);return}})}set(t,n){return this._sequencer.queue(t,async()=>{let o=await this.resolvedStorageService;this._logService.trace("[secrets] encrypting secret for key:",t);let i;try{i=this._type==="in-memory"?n:await this._encryptionService.encrypt(n)}catch(a){throw this._logService.error(a),a}let s=this.getKey(t);this._logService.trace("[secrets] storing encrypted secret for key:",s),o.store(s,i,-1,1),this._logService.trace("[secrets] stored encrypted secret for key:",s)})}delete(t){return this._sequencer.queue(t,async()=>{let n=await this.resolvedStorageService,o=this.getKey(t);this._logService.trace("[secrets] deleting secret for key:",o),n.remove(o,-1),this._logService.trace("[secrets] deleted secret for key:",o)})}keys(){return this._sequencer.queue("__keys__",async()=>{let t=await this.resolvedStorageService;this._logService.trace("[secrets] fetching keys of all secrets");let n=t.keys(-1,1);return this._logService.trace("[secrets] fetched keys of all secrets"),n.filter(o=>o.startsWith(this._storagePrefix)).map(o=>o.slice(this._storagePrefix.length))})}async initialize(){let t;if(!this._useInMemoryStorage&&await this._encryptionService.isEncryptionAvailable())this._logService.trace("[SecretStorageService] Encryption is available, using persisted storage"),this._type="persisted",t=this._storageService;else{if(this._type==="in-memory")return this._storageService;this._logService.trace("[SecretStorageService] Encryption is not available, falling back to in-memory storage"),this._type="in-memory",t=this._register(new Eb)}return this._onDidChangeValueDisposable.clear(),this._onDidChangeValueDisposable.add(t.onDidChangeValue(-1,void 0,this._onDidChangeValueDisposable)(n=>{this.onDidChangeValue(n.key)})),t}reinitialize(){this._lazyStorageService=new dt(()=>this.initialize())}onDidChangeValue(t){if(!t.startsWith(this._storagePrefix))return;let n=t.slice(this._storagePrefix.length);this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${n}`),this.onDidChangeSecretEmitter.fire(n)}getKey(t){return`${this._storagePrefix}${t}`}};wb=D([C(1,ds),C(2,dL),C(3,ue)],wb);var Eee={Extensions:{name:{key:"extensionsConfigurationTitle",value:p(136,null)}},IntegratedTerminal:{name:{key:"terminalIntegratedConfigurationTitle",value:p(139,null)}},InteractiveSession:{name:{key:"interactiveSessionConfigurationTitle",value:p(137,null)}},Telemetry:{name:{key:"telemetryConfigurationTitle",value:p(138,null)}},Update:{name:{key:"updateConfigurationTitle",value:p(140,null)}}};var Ng="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",$ee=new RegExp(Ng);var zee=M("extensionGalleryService");var Kee=M("extensionManagementService");var qee=M("IGlobalExtensionEnablementService"),Gee=M("IExtensionTipsService"),jee=M("IAllowedExtensionsService");var Qee=Al(1952,"Extensions"),Jee=Al(1969,"Preferences"),pV="extensions.allowed";ot.as(ko.Configuration).registerConfiguration({id:"extensions",order:30,title:p(1968,null),type:"object",properties:{[pV]:{type:"object",markdownDescription:p(1958,null),default:"*",defaultSnippets:[{body:{},description:p(1963,null)},{body:{"*":!0},description:p(1959,null)}],scope:1,policy:{name:"AllowedExtensions",category:"Extensions",minimumVersion:"1.96",localization:{description:{key:"extensions.allowed.policy",value:p(1964,null)}}},additionalProperties:!1,patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{anyOf:[{type:["boolean","string"],enum:[!0,!1,"stable"],description:p(1956,null),enumDescriptions:[p(1962,null),p(1960,null),p(1961,null)]},{type:"array",items:{type:"string"},description:p(1957,null)}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:["boolean","string"],enum:[!0,!1,"stable"],description:p(1951,null),enumDescriptions:[p(1967,null),p(1965,null),p(1966,null)]},"\\*":{type:"boolean",enum:[!0,!1],description:p(1953,null),enumDescriptions:[p(1955,null),p(1954,null)]}}}}});var Ia=M("telemetryService");var rte=M("customEndpointTelemetryService");var xa=class{constructor(e){this.value=e;this.isTrustedTelemetryValue=!0}},ck=class{constructor(){this.telemetryLevel=0;this.sessionId="someValue.sessionId";this.machineId="someValue.machineId";this.sqmId="someValue.sqmId";this.devDeviceId="someValue.devDeviceId";this.firstSessionDate="someValue.firstSessionDate";this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}},xte=new ck;var gV="telemetry",vL={id:gV,name:p(2291,null)};function bL(r,e){if(!r)return"none";let t=Xm(r),n=e?.remoteExtensionTips;if(n&&Object.prototype.hasOwnProperty.call(n,t))return t;let o=e?.virtualWorkspaceExtensionTips;return o&&Object.prototype.hasOwnProperty.call(o,t)?t:"other"}function fV(r,e){if(!r||!r.includes("/")&&!r.includes("\\"))return r;let t=r,n=[];for(let l of e)for(;;){let d=l.exec(r);if(!d)break;n.push([d.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,i=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,a=0;for(t="";;){let l=s.exec(r);if(!l)break;let d=n.some(([c,u])=>l.index<u&&c<s.lastIndex);if(!o.test(l[0])&&!d){let c=i.exec(l[0]);c?t+=r.substring(a,l.index)+"<REDACTED: user-file-path>/"+c[2]:t+=r.substring(a,l.index)+"<REDACTED: user-file-path>",a=s.lastIndex}}return a<r.length&&(t+=r.substr(a)),t}function hV(r){if(!r)return r;let e=[{label:"URL",regex:/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*/},{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:"JWT",regex:/eyJ[0eXAiOiJKV1Qi|hbGci|a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"GitHub Token",regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"CLI Credentials",regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:"Microsoft Entra ID",regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:"Email",regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}];for(let t of e)if(t.regex.test(r))return`<REDACTED: ${t.label}>`;return r}function uk(r,e){return r?os(r,t=>{if(t instanceof xa||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let n=t.replaceAll("%20"," ");n=fV(n,e);for(let o of e)n=n.replace(o,"");return n=hV(n),n}}):{}}function yL(r,e){return r.uuid&&e.uuid?r.uuid===e.uuid:r.id===e.id?!0:qm(r.id,e.id)===0}var Hte=new _e("pprice.better-merge");var pk=class{constructor(){this._generators=new Map;this._cache=new WeakMap}register(e,t){this._generators.set(e,t)}readActivationEvents(e){return this._cache.has(e)||this._cache.set(e,this._readActivationEvents(e)),this._cache.get(e)}createActivationEventsMap(e){let t=Object.create(null);for(let n of e){let o=this.readActivationEvents(n);o.length>0&&(t[_e.toKey(n.identifier)]=o)}return t}_readActivationEvents(e){if(typeof e.main>"u"&&typeof e.browser>"u")return[];let t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let n=0;n<t.length;n++)t[n]==="onUri"&&(t[n]=`onUri:${_e.toKey(e.identifier)}`);if(!e.contributes)return t;for(let n in e.contributes){let o=this._generators.get(n);if(!o)continue;let i=e.contributes[n],s=Array.isArray(i)?i:[i];try{t.push(...o(s))}catch(a){ct(a)}}return t}},mk=new pk;var IL=Object.freeze({identifier:new _e("nullExtensionDescription"),name:"Null Extension Description",version:"0.0.0",publisher:"vscode",engines:{vscode:""},extensionLocation:y.parse("void:location"),isBuiltin:!1,targetPlatform:"undefined",isUserBuiltin:!1,isUnderDevelopment:!1,preRelease:!1});var xL=M("extensionService"),Ug=class{constructor(e){this.dependency=e}};function Fe(r,e){return r.enabledApiProposals?r.enabledApiProposals.includes(e):!1}function A(r,e){if(!Fe(r,e))throw new Error(`Extension '${r.identifier.value}' CANNOT use API proposal: ${e}.
Its package.json#enabledApiProposals-property declares: ${r.enabledApiProposals?.join(", ")??"[]"} but NOT ${e}.
 The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${r.identifier.value}`)}var vV={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},agentSessionsWorkspace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentSessionsWorkspace.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiSettingsSearch:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",version:2},authIssuers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authIssuers.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authProviderSpecific:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authProviderSpecific.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},authenticationChallenges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authenticationChallenges.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatContextProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts"},chatHooks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatHooks.d.ts",version:6},chatOutputRenderer:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatOutputRenderer.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts",version:3},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:14},chatPromptFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts",version:1},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",version:4},chatReferenceBinaryData:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts"},chatReferenceDiagnostic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts"},chatSessionsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts",version:3},chatStatusItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribChatEditorInlineGutterMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatEditorInlineGutterMenu.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDebugCreateConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribLanguageModelToolSets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLanguageModelToolSets.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlArtifactGroupMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactGroupMenu.d.ts"},contribSourceControlArtifactMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlHistoryTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewContainerTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},css:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.css.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},dataChannels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dataChannels.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",version:4},devDeviceId:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.devDeviceId.d.ts"},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},envIsAppPortable:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envIsAppPortable.d.ts"},envIsConnectionMetered:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envIsConnectionMetered.d.ts"},environmentPower:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.environmentPower.d.ts"},extensionAffinity:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionAffinity.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",version:2},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelCapabilities:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts"},languageModelProxy:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelProxy.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageModelThinkingPart:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelThinkingPart.d.ts",version:1},languageModelToolResultAudience:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolResultAudience.d.ts"},languageModelToolSupportsModel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolSupportsModel.d.ts",version:1},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},markdownAlertSyntax:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownAlertSyntax.d.ts"},mcpServerDefinitions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpServerDefinitions.d.ts"},mcpToolDefinitions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpToolDefinitions.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},nativeWindowHandle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookReplDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},remoteCodingAgents:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.remoteCodingAgents.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmArtifactProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmArtifactProvider.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmProviderOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmProviderOptions.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},statusBarItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskExecutionTerminal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskExecutionTerminal.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},taskProblemMatcherStatus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalCompletionProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellEnv:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textDocumentChangeReason:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textDocumentChangeReason.d.ts"},textEditorDiffInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts"},textSearchComplete2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},toolProgress:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts"},treeItemMarkdownLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemMarkdownLabel.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},valueSelectionInQuickPick:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},eu=Object.freeze(vV);var bk=ot.as(rd.JSONContribution);var gk=class r{constructor(e,t){this.added=e;this.removed=t}static _toSet(e){let t=new Yn;for(let n=0,o=e.length;n<o;n++)t.add(e[n].description.identifier);return t}static compute(e,t){if(!e||!e.length)return new r(t,[]);if(!t||!t.length)return new r([],e);let n=this._toSet(e),o=this._toSet(t),i=t.filter(a=>!n.has(a.description.identifier)),s=e.filter(a=>!o.has(a.description.identifier));return new r(i,s)}},fk=class{constructor(e,t,n){this.name=e,this.defaultExtensionKind=t,this.canHandleResolver=n,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=gk.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){ct(e)}}},bV={type:"string",enum:["ui","workspace"],enumDescriptions:[p(20144,null),p(20224,null)]},SL="vscode://schemas/vscode-extensions",hk={properties:{engines:{type:"object",description:p(20208,null),properties:{vscode:{type:"string",description:p(20209,null),default:"^1.22.0"}}},publisher:{description:p(20220,null),type:"string"},displayName:{description:p(20205,null),type:"string"},categories:{description:p(20199,null),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:fv},{type:"string",const:"Languages",deprecationMessage:p(20200,null)}]}},galleryBanner:{type:"object",description:p(20212,null),properties:{color:{description:p(20213,null),type:"string"},theme:{description:p(20214,null),type:"string",enum:["dark","light"]}}},contributes:{description:p(20201,null),type:"object",properties:{},default:{}},preview:{type:"boolean",description:p(20218,null)},enableProposedApi:{type:"boolean",deprecationMessage:p(20207,null)},enabledApiProposals:{markdownDescription:p(20206,null),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(eu).map(r=>r),markdownEnumDescriptions:Object.values(eu).map(r=>r.proposal)}},api:{markdownDescription:p(20179,null),type:"string",enum:["none"],enumDescriptions:[p(20180,null)]},activationEvents:{description:p(20145,null),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:p(20176,null),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:p(20159,null),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:p(20149,null),body:"onCommand:${2:commandId}"},{label:"onDebug",description:p(20151,null),body:"onDebug"},{label:"onDebugInitialConfigurations",description:p(20154,null),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:p(20153,null),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:p(20155,null),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:p(20152,null),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:p(20178,null),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:p(20167,null),body:"onStartupFinished"},{label:"onTaskType",description:p(20168,null),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:p(20157,null),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:p(20156,null),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:p(20166,null),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:p(20174,null)},{label:"onUri",body:"onUri",description:p(20173,null)},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:p(20164,null)},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:p(20150,null)},{label:"onNotebook",body:"onNotebook:${1:type}",description:p(20163,null)},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:p(20146,null)},{label:"onRenderer",description:p(20165,null),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:p(20170,null)},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:p(20171,null)},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:p(20175,null)},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:p(20158,null)},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:p(20148,null)},{label:"onChatContextProvider",body:"onChatContextProvider:${1:contextProviderId}",description:p(20147,null)},{label:"onLanguageModelChatProvider",body:"onLanguageModelChatProvider:${1:vendor}",description:p(20160,null)},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolId}",description:p(20161,null)},{label:"onTerminal",body:"onTerminal:{1:shellType}",description:p(20169,null)},{label:"onTerminalShellIntegration",body:"onTerminalShellIntegration:${1:shellType}",description:p(20172,null)},{label:"onMcpCollection",description:p(20162,null),body:"onMcpCollection:${2:collectionId}"},{label:"*",description:p(20177,null),body:"*"}]}},badges:{type:"array",description:p(20181,null),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:p(20184,null)},href:{type:"string",description:p(20183,null)},description:{type:"string",description:p(20182,null)}}}},markdown:{type:"string",description:p(20217,null),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:p(20221,null),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:p(20211,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:Ng}},extensionAffinity:{description:p(20210,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:Ng}},extensionPack:{description:p(20202,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:Ng}},extensionKind:{description:p(20137,null),type:"array",items:bV,default:["workspace"],defaultSnippets:[{body:["ui"],description:p(20139,null)},{body:["workspace"],description:p(20141,null)},{body:["ui","workspace"],description:p(20140,null)},{body:["workspace","ui"],description:p(20142,null)},{body:[],description:p(20138,null)}]},capabilities:{description:p(20185,null),type:"object",properties:{virtualWorkspaces:{description:p(20193,null),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:p(20195,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[p(20197,null),p(20198,null),p(20196,null)]},description:{type:"string",markdownDescription:p(20194,null)}}},untrustedWorkspaces:{description:p(20186,null),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:p(20189,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[p(20191,null),p(20192,null),p(20190,null)]},restrictedConfigurations:{description:p(20188,null),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:p(20187,null)}}}}},sponsor:{description:p(20203,null),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:p(20204,null),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:p(20222,null),type:"string"},"vscode:uninstall":{description:p(20223,null),type:"string"}}},icon:{type:"string",description:p(20215,null)},l10n:{type:"string",description:p(20216,null)},pricing:{type:"string",markdownDescription:p(20219,null),enum:["Free","Trial"],default:"Free"}}},vk=class{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);let t=new fk(e.extensionPoint,e.defaultExtensionKind,e.canHandleResolver);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&mk.register(e.extensionPoint,e.activationEventsGenerator),hk.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,bk.registerSchema(SL,hk),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}},CL={ExtensionsRegistry:"ExtensionsRegistry"};ot.add(CL.ExtensionsRegistry,new vk);var kb=ot.as(CL.ExtensionsRegistry);bk.registerSchema(SL,hk);bk.registerSchema(JA,{properties:{extensionEnabledApiProposals:{description:p(20143,null),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(eu),markdownEnumDescriptions:Object.values(eu).map(r=>r.proposal)}}]}}}});var xne=new w("isMac",en,p(1843,null)),Sne=new w("isLinux",An,p(1842,null)),Cne=new w("isWindows",Ct,p(1847,null)),TL=new w("isWeb",Uo,p(1846,null)),Tne=new w("isMacNative",en&&!Uo,p(1844,null)),Ene=new w("isIOS",v0,p(1841,null)),wne=new w("isMobile",b0,p(1845,null)),kne=new w("isDevelopment",!1,!0),_ne=new w("productQualityType","",p(1848,null)),yV="inputFocus",Pne=new w(yV,!1,p(1840,null));var Fg=M("languageService");var Hg=M("modelService");var Vg=class extends Cg{constructor(){super(...arguments);this._onDidChangeDirty=this._register(new E);this._onDidChangeLabel=this._register(new E);this._onDidChangeCapabilities=this._register(new E);this._onWillDispose=this._register(new E);this.onDidChangeDirty=this._onDidChangeDirty.event;this.onDidChangeLabel=this._onDidChangeLabel.event;this.onDidChangeCapabilities=this._onDidChangeCapabilities.event;this.onWillDispose=this._onWillDispose.event}get editorId(){}get capabilities(){return 2}hasCapability(t){return t===0?this.capabilities===0:(this.capabilities&t)!==0}isReadonly(){return this.hasCapability(2)}getName(){return`Editor ${this.typeId}`}getDescription(t){}getTitle(t){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(0)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(t,n){return this}async saveAs(t,n){return this}async revert(t,n){}async rename(t,n){}copy(){return this}canMove(t,n){return!0}canReopen(){return!0}matches(t){if(To(t))return this===t;let n=t.options?.override;return this.editorId!==n&&n!==void 0&&this.editorId!==void 0?!1:_r(this.resource,Zv.getCanonicalUri(t))}prefersEditorPane(t){return t.at(0)}toUntyped(t){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}};var wL=M("editorGroupsService");var _b=M("editorService"),kL=-1,_L=-2;var Ur=class extends Vg{constructor(t,n,o,i,s){super();this.preferredName=t;this.preferredDescription=n;this.secondary=o;this.primary=i;this.editorService=s;this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}static{this.ID="workbench.editorinputs.sidebysideEditorInput"}get typeId(){return Ur.ID}get capabilities(){let t=this.primary.capabilities;return t&=-33,this.secondary.hasCapability(16)&&(t|=16),this.secondary.hasCapability(8)&&(t|=8),t|=256,t}get resource(){if(this.hasIdenticalSides)return this.primary.resource}registerListeners(){this._register(Me.once(Me.any(this.primary.onWillDispose,this.secondary.onWillDispose))(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.secondary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.secondary.onDidChangeLabel(()=>this._onDidChangeLabel.fire()))}getName(){let t=this.getPreferredName();return t||(this.hasIdenticalSides?this.primary.getName():p(4568,null,this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(t){let n=this.getPreferredDescription();return n||(this.hasIdenticalSides?this.primary.getDescription(t):super.getDescription(t))}getPreferredDescription(){return this.preferredDescription}getTitle(t){let n;this.hasIdenticalSides?n=this.primary.getTitle(t)??this.getName():n=super.getTitle(t);let o=this.getPreferredTitle();return o&&(n=`${o} (${n})`),n}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getLabelExtraClasses(){return this.hasIdenticalSides?this.primary.getLabelExtraClasses():super.getLabelExtraClasses()}getAriaLabel(){return this.hasIdenticalSides?this.primary.getAriaLabel():super.getAriaLabel()}getTelemetryDescriptor(){return{...this.primary.getTelemetryDescriptor(),...super.getTelemetryDescriptor()}}isDirty(){return this.primary.isDirty()}isSaving(){return this.primary.isSaving()}async save(t,n){let o=await this.primary.save(t,n);return this.saveResultToEditor(o)}async saveAs(t,n){let o=await this.primary.saveAs(t,n);return this.saveResultToEditor(o)}saveResultToEditor(t){if(!t||!this.hasIdenticalSides)return t;if(this.primary.matches(t))return this;if(t instanceof Vg)return new Ur(this.preferredName,this.preferredDescription,t,t,this.editorService);if(!Or(t)&&!$c(t)&&!ha(t)&&!fa(t))return{primary:t,secondary:t,label:this.preferredName,description:this.preferredDescription}}revert(t,n){return this.primary.revert(t,n)}async rename(t,n){if(!this.hasIdenticalSides)return;let o=await this.primary.rename(t,n);if(o){if(To(o.editor))return{editor:new Ur(this.preferredName,this.preferredDescription,o.editor,o.editor,this.editorService),options:{...o.options,viewState:eb(this,t,this.editorService)}};if(yA(o.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:o.editor,secondary:o.editor,options:{...o.options,viewState:eb(this,t,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(t){let n=this.primary.toUntyped(t),o=this.secondary.toUntyped(t);if(n&&o&&!Or(n)&&!Or(o)&&!$c(n)&&!$c(o)&&!ha(n)&&!ha(o)&&!fa(n)&&!fa(o)){let i={label:this.preferredName,description:this.preferredDescription,primary:n,secondary:o};return typeof t?.preserveViewState=="number"&&(i.options={viewState:eb(this,t.preserveViewState,this.editorService)}),i}}matches(t){return this===t?!0:Uw(t)||Or(t)?!1:t instanceof Ur?this.primary.matches(t.primary)&&this.secondary.matches(t.secondary):ha(t)?this.primary.matches(t.primary)&&this.secondary.matches(t.secondary):!1}};Ur=D([C(4,_b)],Ur);var tu=class extends H{constructor(){super(...arguments);this._onWillDispose=this._register(new E);this.onWillDispose=this._onWillDispose.event;this.resolved=!1}async resolve(){this.resolved=!0}isResolved(){return this.resolved}isDisposed(){return this._store.isDisposed}dispose(){this._onWillDispose.fire(),super.dispose()}};var xV={ModesRegistry:"editor.modesRegistry"},yk=class extends H{constructor(){super();this._onDidChangeLanguages=this._register(new E);this.onDidChangeLanguages=this._onDidChangeLanguages.event;this._languages=[]}registerLanguage(t){return this._languages.push(t),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let n=0,o=this._languages.length;n<o;n++)if(this._languages[n]===t){this._languages.splice(n,1);return}}}}getLanguages(){return this._languages}},PL=new yk;ot.add(xV.ModesRegistry,PL);var Bg="plaintext",SV=".txt";PL.registerLanguage({id:Bg,extensions:[SV],aliases:[p(903,null),"text"],mimetypes:[eo.text]});ot.as(ko.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1},"[go]":{"editor.insertSpaces":!1},"[makefile]":{"editor.insertSpaces":!1},"[shellscript]":{"files.eol":`
`},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}]);var DL=M("ILanguageDetectionService"),Ik="languageDetection";var cs=class extends tu{constructor(t,n,o,i,s){super();this.modelService=t;this.languageService=n;this.languageDetectionService=o;this.accessibilityService=i;this.textEditorModelHandle=void 0;this.modelDisposeListener=this._register(new En);this.autoDetectLanguageThrottler=this._register(new Tc(cs.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY));this._blockLanguageChangeListener=!1;this._languageChangeSource=void 0;s&&this.handleExistingModel(s)}static{this.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600}handleExistingModel(t){let n=this.modelService.getModel(t);if(!n)throw new Error(`Document with resource ${t.toString(!0)} does not exist`);this.textEditorModelHandle=t,this.registerModelDisposeListener(n)}registerModelDisposeListener(t){this.modelDisposeListener.value=t.onWillDispose(()=>{this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get languageChangeSource(){return this._languageChangeSource}get hasLanguageSetExplicitly(){return typeof this._languageChangeSource=="string"}setLanguageId(t,n){this._languageChangeSource="user",this.setLanguageIdInternal(t,n)}setLanguageIdInternal(t,n){if(this.isResolved()&&!(!t||t===this.textEditorModel.getLanguageId())){this._blockLanguageChangeListener=!0;try{this.textEditorModel.setLanguage(this.languageService.createById(t),n)}finally{this._blockLanguageChangeListener=!1}}}installModelListeners(t){let n=this._register(t.onDidChangeLanguage(o=>{o.source===Ik||this._blockLanguageChangeListener||(this._languageChangeSource="api",n.dispose())}))}getLanguageId(){return this.textEditorModel?.getLanguageId()}autoDetectLanguage(){return this.autoDetectLanguageThrottler.trigger(()=>this.doAutoDetectLanguage())}async doAutoDetectLanguage(){if(this.hasLanguageSetExplicitly||!this.textEditorModelHandle||!this.languageDetectionService.isEnabledForLanguage(this.getLanguageId()??Bg))return;let t=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),n=this.getLanguageId();if(t&&t!==n&&!this.isDisposed()){this.setLanguageIdInternal(t,Ik);let o=this.languageService.getLanguageName(t);this.accessibilityService.alert(p(4569,null,o??t))}}createTextEditorModel(t,n,o){let i=this.getFirstLineText(t),s=this.getOrCreateLanguage(n,this.languageService,o,i);return this.doCreateTextEditorModel(t,s,n)}doCreateTextEditorModel(t,n,o){let i=o&&this.modelService.getModel(o);return i?this.updateTextEditorModel(t,n.languageId):(i=this.modelService.createModel(t,n,o),this.createdEditorModel=!0,this.registerModelDisposeListener(i)),this.textEditorModelHandle=i.uri,i}getFirstLineText(t){let n=t;return typeof n.getFirstLineText=="function"?n.getFirstLineText(1e3):t.getLineContent(1).substr(0,1e3)}getOrCreateLanguage(t,n,o,i){return!o||o===Bg?n.createByFilepathOrFirstLine(t??null,i):n.createById(o)}updateTextEditorModel(t,n,o){this.isResolved()&&(t&&this.modelService.updateModel(this.textEditorModel,t,o),n&&n!==Bg&&this.textEditorModel.getLanguageId()!==n&&this.textEditorModel.setLanguage(this.languageService.createById(n)))}createSnapshot(){return this.textEditorModel?this.textEditorModel.createSnapshot(!0):null}isResolved(){return!!this.textEditorModelHandle}dispose(){this.modelDisposeListener.dispose(),this.textEditorModelHandle&&this.createdEditorModel&&this.modelService.destroyModel(this.textEditorModelHandle),this.textEditorModelHandle=void 0,this.createdEditorModel=!1,super.dispose()}};cs=D([C(0,Hg),C(1,Fg),C(2,DL),C(3,aA)],cs);var nu=class extends tu{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}};var Pb=class extends nu{constructor(t,n){super(t,n);this._textDiffEditorModel=void 0;this._originalModel=t,this._modifiedModel=n,this.updateTextDiffEditorModel()}get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}async resolve(){await super.resolve(),this.updateTextDiffEditorModel()}updateTextDiffEditorModel(){this.originalModel?.isResolved()&&this.modifiedModel?.isResolved()&&(this._textDiffEditorModel?(this._textDiffEditorModel.original=this.originalModel.textEditorModel,this._textDiffEditorModel.modified=this.modifiedModel.textEditorModel):this._textDiffEditorModel={original:this.originalModel.textEditorModel,modified:this.modifiedModel.textEditorModel})}isResolved(){return!!this._textDiffEditorModel}isReadonly(){return!!this.modifiedModel&&this.modifiedModel.isReadonly()}dispose(){this._textDiffEditorModel=void 0,super.dispose()}};function xk(r){let e=r;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Sa=class extends Ur{constructor(t,n,o,i,s,a){super(t,n,o,i,a);this.original=o;this.modified=i;this.forceOpenAsBinary=s;this.cachedModel=void 0;this.labels=this.computeLabels()}static{this.ID="workbench.editors.diffEditorInput"}get typeId(){return Sa.ID}get editorId(){return this.modified.editorId===this.original.editorId?this.modified.editorId:void 0}get capabilities(){let t=super.capabilities;return this.labels.forceDescription&&(t|=64),t}computeLabels(){let t,n=!1;if(this.preferredName)t=this.preferredName;else{let u=this.original.getName(),m=this.modified.getName();t=p(4567,null,u,m),n=u===m}let o,i,s;if(this.preferredDescription)o=this.preferredDescription,i=this.preferredDescription,s=this.preferredDescription;else{o=this.computeLabel(this.original.getDescription(0),this.modified.getDescription(0)),s=this.computeLabel(this.original.getDescription(2),this.modified.getDescription(2));let u=this.original.getDescription(1),m=this.modified.getDescription(1);if(typeof u=="string"&&typeof m=="string"&&(u||m)){let[g,v]=wA([u,m]);i=this.computeLabel(g,v)}}let a=this.computeLabel(this.original.getTitle(0)??this.original.getName(),this.modified.getTitle(0)??this.modified.getName()," \u2194 "),l=this.computeLabel(this.original.getTitle(1)??this.original.getName(),this.modified.getTitle(1)??this.modified.getName()," \u2194 "),d=this.computeLabel(this.original.getTitle(2)??this.original.getName(),this.modified.getTitle(2)??this.modified.getName()," \u2194 "),c=this.getPreferredTitle();return c&&(a=`${c} (${a})`,l=`${c} (${l})`,d=`${c} (${d})`),{name:t,shortDescription:o,mediumDescription:i,longDescription:s,forceDescription:n,shortTitle:a,mediumTitle:l,longTitle:d}}computeLabel(t,n,o=" - "){if(!(!t||!n))return t===n?n:`${t}${o}${n}`}getName(){return this.labels.name}getDescription(t=1){switch(t){case 0:return this.labels.shortDescription;case 2:return this.labels.longDescription;case 1:default:return this.labels.mediumDescription}}getTitle(t){switch(t){case 0:return this.labels.shortTitle;case 2:return this.labels.longTitle;default:case 1:return this.labels.mediumTitle}}async resolve(){let t=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=t,this.cachedModel}prefersEditorPane(t){return this.forceOpenAsBinary?t.find(n=>n.typeId===bA):t.find(n=>n.typeId===vA)}async createModel(){let[t,n]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return n instanceof cs&&t instanceof cs?new Pb(t,n):new nu(xk(t)?t:void 0,xk(n)?n:void 0)}toUntyped(t){let n=super.toUntyped(t);if(n)return{...n,modified:n.primary,original:n.secondary}}matches(t){return this===t?!0:t instanceof Sa?this.modified.matches(t.modified)&&this.original.matches(t.original)&&t.forceOpenAsBinary===this.forceOpenAsBinary:Or(t)?this.modified.matches(t.modified)&&this.original.matches(t.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}};Sa=D([C(5,_b)],Sa);var Jre=new w("workbenchState",void 0,{type:"string",description:p(4561,null)}),Xre=new w("workspaceFolderCount",0,p(4562,null)),Yre=new w("openFolderWorkspaceSupport",!0,!0),Zre=new w("enterMultiRootWorkspaceSupport",!0,!0),eie=new w("emptyWorkspaceSupport",!0,!0),tie=new w("dirtyWorkingCopies",!1,p(4507,null)),RL=new w("remoteName","",p(4539,null)),nie=new w("virtualWorkspace","",p(4560,null)),oie=new w("temporaryWorkspace",!1,p(4554,null)),rie=new w("isSessionsWindow",!1,p(4526,null)),iie=new w("hasWebFileSystemAccess",!1,!0),sie=new w("embedderIdentifier",void 0,p(4515,null)),aie=new w("inAutomation",!1,p(4518,null)),lie=new w("isFullscreen",!1,p(4524,null)),die=new w("isAuxiliaryWindowFocusedContext",!1,p(4521,null)),cie=new w("isWindowAlwaysOnTop",!1,p(4527,null)),uie=new w("isAuxiliaryWindow",!1,p(4520,null)),pie=new w("activeEditorIsDirty",!1,p(4495,null)),mie=new w("activeEditorIsNotPreview",!1,p(4498,null)),gie=new w("activeEditorIsFirstInGroup",!1,p(4496,null)),fie=new w("activeEditorIsLastInGroup",!1,p(4497,null)),hie=new w("activeEditorIsPinned",!1,p(4499,null)),vie=new w("activeEditorIsReadonly",!1,p(4500,null)),bie=new w("activeCompareEditorCanSwap",!1,p(4486,null)),yie=new w("activeEditorCanToggleReadonly",!0,p(4490,null)),Iie=new w("activeEditorCanRevert",!1,p(4489,null)),xie=new w("activeEditorCanSplitInGroup",!0),Sie=new w("activeEditor",null,{type:"string",description:p(4487,null)}),Cie=new w("activeEditorAvailableEditorIds","",p(4488,null)),Tie=new w("textCompareEditorVisible",!1,p(4556,null)),Eie=new w("textCompareEditorActive",!1,p(4555,null)),wie=new w("sideBySideEditorActive",!1,p(4551,null)),kie=new w("groupEditorsCount",0,p(4517,null)),_ie=new w("activeEditorGroupEmpty",!1,p(4491,null)),Pie=new w("activeEditorGroupIndex",0,p(4492,null)),Die=new w("activeEditorGroupLast",!1,p(4493,null)),Rie=new w("activeEditorGroupLocked",!1,p(4494,null)),CV=new w("multipleEditorGroups",!1,p(4529,null)),Mie=CV.toNegated(),Aie=new w("multipleEditorsSelectedInGroup",!1,p(4530,null)),Lie=new w("twoEditorsSelectedInGroup",!1,p(4559,null)),Oie=new w("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,p(4548,null)),TV=new w("editorPartMultipleEditorGroups",!1,p(4513,null)),Nie=TV.toNegated(),Uie=new w("editorPartMaximizedEditorGroup",!1,p(4509,null)),Fie=new w("editorPartModal",!1,p(4510,null)),Hie=new w("editorPartModalMaximized",!1,p(4511,null)),Vie=new w("editorPartModalNavigation",!1,p(4512,null)),Bie=new w("editorIsOpen",!1,p(4508,null)),Wie=new w("inZenMode",!1,p(4519,null)),$ie=new w("isCenteredLayout",!1,p(4525,null)),zie=new w("splitEditorsVertically",!1,p(4552,null)),Kie=new w("mainEditorAreaVisible",!0,p(4528,null)),qie=new w("editorTabsVisible",!0,p(4514,null)),Gie=new w("sideBarVisible",!1,p(4550,null)),jie=new w("sideBarFocus",!1,p(4549,null)),Qie=new w("activeViewlet","",p(4502,null)),Jie=new w("statusBarFocused",!1,p(4553,null)),Xie=new w("titleBarStyle","custom",p(4557,null)),Yie=new w("titleBarVisible",!1,p(4558,null)),Zie=new w("isCompactTitleBar",!1,p(4522,null)),ese=new w("bannerFocused",!1,p(4506,null)),tse=new w("notificationFocus",!0,p(4532,null)),nse=new w("notificationCenterVisible",!1,p(4531,null)),ose=new w("notificationToastsVisible",!1,p(4533,null)),rse=new w("activeAuxiliary","",p(4485,null)),ise=new w("auxiliaryBarFocus",!1,p(4503,null)),sse=new w("auxiliaryBarVisible",!1,p(4505,null)),ase=new w("auxiliaryBarMaximized",!1,p(4504,null)),lse=new w("activePanel","",p(4501,null)),dse=new w("panelFocus",!1,p(4535,null)),cse=new w("panelPosition","bottom",p(4537,null)),use=new w("panelAlignment","center",p(4534,null)),pse=new w("panelVisible",!1,p(4538,null)),mse=new w("panelMaximized",!1,p(4536,null)),gse=new w("focusedView","",p(4516,null));var ho=class{constructor(e,t,n,o){this._contextKeyService=e;this._fileService=t;this._languageService=n;this._modelService=o;this._schemeKey=ho.Scheme.bindTo(this._contextKeyService),this._filenameKey=ho.Filename.bindTo(this._contextKeyService),this._dirnameKey=ho.Dirname.bindTo(this._contextKeyService),this._pathKey=ho.Path.bindTo(this._contextKeyService),this._langIdKey=ho.LangId.bindTo(this._contextKeyService),this._resourceKey=ho.Resource.bindTo(this._contextKeyService),this._extensionKey=ho.Extension.bindTo(this._contextKeyService),this._hasResource=ho.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=ho.IsFileSystemResource.bindTo(this._contextKeyService)}static{this.Scheme=new w("resourceScheme",void 0,{type:"string",description:p(4546,null)})}static{this.Filename=new w("resourceFilename",void 0,{type:"string",description:p(4543,null)})}static{this.Dirname=new w("resourceDirname",void 0,{type:"string",description:p(4541,null)})}static{this.Path=new w("resourcePath",void 0,{type:"string",description:p(4545,null)})}static{this.LangId=new w("resourceLangId",void 0,{type:"string",description:p(4544,null)})}static{this.Resource=new w("resource",void 0,{type:"URI",description:p(4540,null)})}static{this.Extension=new w("resourceExtname",void 0,{type:"string",description:p(4542,null)})}static{this.HasResource=new w("resourceSet",void 0,{type:"boolean",description:p(4547,null)})}static{this.IsFileSystemResource=new w("isFileSystemResource",void 0,{type:"boolean",description:p(4523,null)})}_setLangId(){let e=this.get();if(!e){this._langIdKey.set(null);return}let t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!_r(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?Bt(e):null),this._dirnameKey.set(e?this.uriToPath(es(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?VT(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===$.file?e.fsPath:e.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}};ho=D([C(0,sr),C(1,ql),C(2,Fg),C(3,Hg)],ho);var Db=class extends ho{constructor(t,n,o,i){super(t,n,o,i);this._disposables=new q;this._disposables.add(n.onDidChangeFileSystemProviderRegistrations(()=>{let s=this.get();this._isFileSystemResource.set(!!(s&&n.hasProvider(s)))})),this._disposables.add(i.onModelAdded(s=>{_r(s.uri,this.get())&&this._setLangId()})),this._disposables.add(i.onModelLanguageChanged(s=>{_r(s.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}};Db=D([C(0,sr),C(1,ql),C(2,Fg),C(3,Hg)],Db);var ML=M("dialogService");var Ese=M("fileDialogService");var Rb="__";function AL(r){return typeof r=="object"&&r!==null&&"wwwAuthenticate"in r&&typeof r.wwwAuthenticate=="string"}var LL=M("IAuthenticationService");var _se=M("IAuthenticationExtensionsService");var OL=M("openerService");var Mb=Lg;var NL=M("lifecycleService");var UL=M("defaultAccountService");var Ce;(i=>(i.Setup={hidden:new w("chatSetupHidden",!1,!0),installed:new w("chatSetupInstalled",!1,!0),disabled:new w("chatSetupDisabled",!1,!0),untrusted:new w("chatSetupUntrusted",!1,!0),later:new w("chatSetupLater",!1,!0),registered:new w("chatSetupRegistered",!1,!0)},i.Entitlement={signedOut:new w("chatEntitlementSignedOut",!1,!0),canSignUp:new w("chatPlanCanSignUp",!1,!0),planFree:new w("chatPlanFree",!1,!0),planPro:new w("chatPlanPro",!1,!0),planProPlus:new w("chatPlanProPlus",!1,!0),planBusiness:new w("chatPlanBusiness",!1,!0),planEnterprise:new w("chatPlanEnterprise",!1,!0),organisations:new w("chatEntitlementOrganisations",void 0,!0),internal:new w("chatEntitlementInternal",!1,!0),sku:new w("chatEntitlementSku",void 0,!0)},i.chatQuotaExceeded=new w("chatQuotaExceeded",!1,!0),i.completionsQuotaExceeded=new w("completionsQuotaExceeded",!1,!0),i.chatAnonymous=new w("chatAnonymous",!1,!0)))(Ce||={});var EV=M("chatEntitlementService");function wV(r){return r===6||r===7||r===8||r===9}var Ab={upgradePlanUrl:Wo.defaultChatAgent?.upgradePlanUrl??"",providerUriSetting:Wo.defaultChatAgent?.providerUriSetting??"",entitlementSignupLimitedUrl:Wo.defaultChatAgent?.entitlementSignupLimitedUrl??"",chatQuotaExceededContext:Wo.defaultChatAgent?.chatQuotaExceededContext??"",completionsQuotaExceededContext:Wo.defaultChatAgent?.completionsQuotaExceededContext??""},FL="chat.allowAnonymousAccess";function Ck(r,e,t){return!(r.getValue(FL)!==!0||e!==1||t.hidden||t.disabled)}function HL(r,e,t){t.publicLog2("chatEntitlements",{chatHidden:!!r.hidden,chatDisabled:!!r.disabled,chatEntitlement:r.entitlement,chatRegistered:!!r.registered,chatAnonymous:Ck(e,r.entitlement,r)})}var Wg=class extends H{constructor(t,n,o,i,s,a){super();this.contextKeyService=i;this.configurationService=s;this.telemetryService=a;this._onDidChangeQuotaExceeded=this._register(new E);this.onDidChangeQuotaExceeded=this._onDidChangeQuotaExceeded.event;this._onDidChangeQuotaRemaining=this._register(new E);this.onDidChangeQuotaRemaining=this._onDidChangeQuotaRemaining.event;this._quotas={};this.ExtensionQuotaContextKeys={chatQuotaExceeded:Ab.chatQuotaExceededContext,completionsQuotaExceeded:Ab.completionsQuotaExceededContext};this._onDidChangeAnonymous=this._register(new E);this.onDidChangeAnonymous=this._onDidChangeAnonymous.event;this.anonymousObs=fi(this.onDidChangeAnonymous,()=>this.anonymous);if(this.chatQuotaExceededContextKey=Ce.chatQuotaExceeded.bindTo(this.contextKeyService),this.completionsQuotaExceededContextKey=Ce.completionsQuotaExceeded.bindTo(this.contextKeyService),this.anonymousContextKey=Ce.chatAnonymous.bindTo(this.contextKeyService),this.anonymousContextKey.set(this.anonymous),Ce.Setup.installed.bindTo(this.contextKeyService).set(!0),Ce.Setup.hidden.bindTo(this.contextKeyService).set(!1),Ce.Setup.disabled.bindTo(this.contextKeyService).set(!1),Ce.Setup.registered.bindTo(this.contextKeyService).set(!0),Ce.Entitlement.signedOut.bindTo(this.contextKeyService).set(!1),Ce.Entitlement.planPro.bindTo(this.contextKeyService).set(!0),this.chatQuotaExceededContextKey.set(!1),this.completionsQuotaExceededContextKey.set(!1),this.onDidChangeEntitlement=Me.map(Me.filter(this.contextKeyService.onDidChangeContext,d=>d.affectsSome(new Set([Ce.Entitlement.planPro.key,Ce.Entitlement.planBusiness.key,Ce.Entitlement.planEnterprise.key,Ce.Entitlement.planProPlus.key,Ce.Entitlement.planFree.key,Ce.Entitlement.canSignUp.key,Ce.Entitlement.signedOut.key,Ce.Entitlement.organisations.key,Ce.Entitlement.internal.key,Ce.Entitlement.sku.key])),this._store),()=>{},this._store),this.entitlementObs=fi(this.onDidChangeEntitlement,()=>this.entitlement),this.onDidChangeSentiment=Me.map(Me.filter(this.contextKeyService.onDidChangeContext,d=>d.affectsSome(new Set([Ce.Setup.hidden.key,Ce.Setup.disabled.key,Ce.Setup.untrusted.key,Ce.Setup.installed.key,Ce.Setup.later.key,Ce.Setup.registered.key])),this._store),()=>{},this._store),this.sentimentObs=fi(this.onDidChangeSentiment,()=>this.sentiment),Uo&&!o.remoteAuthority){Ce.Setup.hidden.bindTo(this.contextKeyService).set(!0);return}if(!n.defaultChatAgent)return;let l=this.context=new dt(()=>this._register(t.createInstance(hi)));this.requests=new dt(()=>this._register(t.createInstance($g,l.value,{clearQuotas:()=>this.clearQuotas(),acceptQuotas:d=>this.acceptQuotas(d)}))),this.registerListeners()}get entitlement(){return this.contextKeyService.getContextKeyValue(Ce.Entitlement.planPro.key)===!0?6:this.contextKeyService.getContextKeyValue(Ce.Entitlement.planBusiness.key)===!0?8:this.contextKeyService.getContextKeyValue(Ce.Entitlement.planEnterprise.key)===!0?9:this.contextKeyService.getContextKeyValue(Ce.Entitlement.planProPlus.key)===!0?7:this.contextKeyService.getContextKeyValue(Ce.Entitlement.planFree.key)===!0?5:this.contextKeyService.getContextKeyValue(Ce.Entitlement.canSignUp.key)===!0?3:this.contextKeyService.getContextKeyValue(Ce.Entitlement.signedOut.key)===!0?1:2}get isInternal(){return this.contextKeyService.getContextKeyValue(Ce.Entitlement.internal.key)===!0}get organisations(){return this.contextKeyService.getContextKeyValue(Ce.Entitlement.organisations.key)}get sku(){return this.contextKeyService.getContextKeyValue(Ce.Entitlement.sku.key)}get copilotTrackingId(){return this.context?.value.state.copilotTrackingId}get previewFeaturesDisabled(){return this.contextKeyService.getContextKeyValue("github.copilot.previewFeaturesDisabled")===!0}get quotas(){return this._quotas}registerListeners(){let t=new Set([this.ExtensionQuotaContextKeys.chatQuotaExceeded,this.ExtensionQuotaContextKeys.completionsQuotaExceeded]),n=this._register(new En);this._register(this.contextKeyService.onDidChangeContext(s=>{s.affectsSome(t)&&(n.value&&n.value.cancel(),n.value=new Re,this.update(n.value.token))}));let o=this.anonymous,i=()=>{let s=this.anonymous;s!==o&&(o=s,this.anonymousContextKey.set(s),this.context?.hasValue&&HL(this.context.value.state,this.configurationService,this.telemetryService),this._onDidChangeAnonymous.fire())};this._register(this.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(FL)&&i()})),this._register(this.onDidChangeEntitlement(()=>i())),this._register(this.onDidChangeSentiment(()=>i()))}acceptQuotas(t){let n=this._quotas;this._quotas=t,this.updateContextKeys();let{changed:o}=this.compareQuotas(n.chat,t.chat),{changed:i}=this.compareQuotas(n.completions,t.completions),{changed:s}=this.compareQuotas(n.premiumChat,t.premiumChat);(o.exceeded||i.exceeded||s.exceeded)&&this._onDidChangeQuotaExceeded.fire(),(o.remaining||i.remaining||s.remaining)&&this._onDidChangeQuotaRemaining.fire()}compareQuotas(t,n){return{changed:{exceeded:t?.percentRemaining===0!=(n?.percentRemaining===0),remaining:t?.percentRemaining!==n?.percentRemaining}}}clearQuotas(){this.acceptQuotas({})}updateContextKeys(){this.chatQuotaExceededContextKey.set(this._quotas.chat?.percentRemaining===0),this.completionsQuotaExceededContextKey.set(this._quotas.completions?.percentRemaining===0)}get sentiment(){return{installed:this.contextKeyService.getContextKeyValue(Ce.Setup.installed.key)===!0,hidden:this.contextKeyService.getContextKeyValue(Ce.Setup.hidden.key)===!0,disabled:this.contextKeyService.getContextKeyValue(Ce.Setup.disabled.key)===!0,untrusted:this.contextKeyService.getContextKeyValue(Ce.Setup.untrusted.key)===!0,later:this.contextKeyService.getContextKeyValue(Ce.Setup.later.key)===!0,registered:this.contextKeyService.getContextKeyValue(Ce.Setup.registered.key)===!0}}get anonymous(){return Ck(this.configurationService,this.entitlement,this.sentiment)}markAnonymousRateLimited(){this.anonymous&&(this.chatQuotaExceededContextKey.set(!0),this._onDidChangeQuotaExceeded.fire())}async update(t){await this.requests?.value.forceResolveEntitlement(t)}};Wg=D([C(0,po),C(1,db),C(2,Mb),C(3,sr),C(4,oo),C(5,Ia)],Wg);var $g=class extends H{constructor(t,n,o,i,s,a,l,d,c,u){super();this.context=t;this.chatQuotasAccessor=n;this.telemetryService=o;this.logService=i;this.requestService=s;this.dialogService=a;this.openerService=l;this.lifecycleService=d;this.defaultAccountService=c;this.authenticationService=u;this.pendingResolveCts=new Re;this.state={entitlement:this.context.state.entitlement},this.registerListeners(),this.resolve()}registerListeners(){this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>this.resolve())),this._register(this.context.onDidChange(()=>{(!this.context.state.installed||this.context.state.disabled||this.context.state.entitlement===1)&&(this.state={entitlement:this.state.entitlement,quotas:void 0},this.chatQuotasAccessor.clearQuotas())}))}async resolve(){this.pendingResolveCts.dispose(!0);let t=this.pendingResolveCts=new Re,n=await this.defaultAccountService.getDefaultAccount();if(t.token.isCancellationRequested)return;let o;n?this.state.entitlement===1&&(o={entitlement:2}):o={entitlement:1},o&&this.update(o),n&&await this.resolveEntitlement(n,t.token)}async resolveEntitlement(t,n){let o=await this.doResolveEntitlement(t,n);return typeof o?.entitlement=="number"&&!n.isCancellationRequested&&this.update(o),o}async doResolveEntitlement(t,n){if(n.isCancellationRequested)return;let o=t.entitlementsData;if(!o)return this.logService.trace("[chat entitlement]: no entitlements data available on default account"),{entitlement:o===null?1:2};let i;o.access_type_sku==="free_limited_copilot"?i=5:o.can_signup_for_limited?i=3:o.copilot_plan==="individual"?i=6:o.copilot_plan==="individual_pro"?i=7:o.copilot_plan==="business"?i=8:o.copilot_plan==="enterprise"?i=9:i=4;let s={entitlement:i,organisations:o.organization_login_list,quotas:this.toQuotas(o),sku:o.access_type_sku,copilotTrackingId:o.analytics_tracking_id};return this.logService.trace(`[chat entitlement]: resolved to ${s.entitlement}, quotas: ${JSON.stringify(s.quotas)}`),this.telemetryService.publicLog2("chatInstallEntitlement",{entitlement:s.entitlement,tid:o.analytics_tracking_id,sku:s.sku,quotaChat:s.quotas?.chat?.remaining,quotaPremiumChat:s.quotas?.premiumChat?.remaining,quotaCompletions:s.quotas?.completions?.remaining,quotaResetDate:s.quotas?.resetDate}),s}toQuotas(t){let n={resetDate:t.quota_reset_date_utc??t.quota_reset_date??t.limited_user_reset_date,resetDateHasTime:typeof t.quota_reset_date_utc=="string"};if(t.monthly_quotas?.chat&&typeof t.limited_user_quotas?.chat=="number"&&(n.chat={total:t.monthly_quotas.chat,remaining:t.limited_user_quotas.chat,percentRemaining:Math.min(100,Math.max(0,t.limited_user_quotas.chat/t.monthly_quotas.chat*100)),overageEnabled:!1,overageCount:0,unlimited:!1}),t.monthly_quotas?.completions&&typeof t.limited_user_quotas?.completions=="number"&&(n.completions={total:t.monthly_quotas.completions,remaining:t.limited_user_quotas.completions,percentRemaining:Math.min(100,Math.max(0,t.limited_user_quotas.completions/t.monthly_quotas.completions*100)),overageEnabled:!1,overageCount:0,unlimited:!1}),t.quota_snapshots)for(let o of["chat","completions","premium_interactions"]){let i=t.quota_snapshots[o];if(!i)continue;let s={total:i.entitlement,remaining:i.remaining,percentRemaining:Math.min(100,Math.max(0,i.percent_remaining)),overageEnabled:i.overage_permitted,overageCount:i.overage_count,unlimited:i.unlimited};switch(o){case"chat":n.chat=s;break;case"completions":n.completions=s;break;case"premium_interactions":n.premiumChat=s;break}}return n}async request(t,n,o,i,s){let a;for(let l of i){if(s.isCancellationRequested)return a;try{let d=await this.requestService.request({type:n,url:t,data:n==="POST"?JSON.stringify(o):void 0,disableCache:!0,headers:{Authorization:`Bearer ${l.accessToken}`}},s),c=d.res.statusCode;if(c&&c!==200){a=d;continue}return d}catch(d){s.isCancellationRequested||this.logService.error(`[chat entitlement] request: error ${d}`)}}return a}update(t){this.state=t,this.context.update({entitlement:this.state.entitlement,organisations:this.state.organisations,sku:this.state.sku,copilotTrackingId:this.state.copilotTrackingId}),t.quotas&&this.chatQuotasAccessor.acceptQuotas(t.quotas)}async forceResolveEntitlement(t=be.None){let n=await this.defaultAccountService.refresh();if(n)return this.resolveEntitlement(n,t)}async signUpFree(){let t=await this.getSessions();if(t.length!==0)return this.doSignUpFree(t)}async doSignUpFree(t){let n={restricted_telemetry:this.telemetryService.telemetryLevel===0?"disabled":"enabled",public_code_suggestions:"enabled"},o=await this.request(Ab.entitlementSignupLimitedUrl,"POST",n,t,be.None);if(!o)return await this.onUnknownSignUpError(p(19884,null),"[chat entitlement] sign-up: no response")?this.doSignUpFree(t):{errorCode:1};if(o.res.statusCode&&o.res.statusCode!==200){if(o.res.statusCode===422)try{let l=await ik(o);if(l){let d=JSON.parse(l);if(typeof d.message=="string"&&d.message)return this.onUnprocessableSignUpError(`[chat entitlement] sign-up: unprocessable entity (${d.message})`,d.message),{errorCode:o.res.statusCode}}}catch{}return await this.onUnknownSignUpError(p(19885,null,o.res.statusCode),`[chat entitlement] sign-up: unexpected status code ${o.res.statusCode}`)?this.doSignUpFree(t):{errorCode:o.res.statusCode}}let i=null;try{i=await ik(o)}catch{}if(!i)return await this.onUnknownSignUpError(p(19883,null),"[chat entitlement] sign-up: response has no content")?this.doSignUpFree(t):{errorCode:2};let s;try{s=JSON.parse(i),this.logService.trace(`[chat entitlement] sign-up: response is ${i}`)}catch(a){return await this.onUnknownSignUpError(p(19882,null),`[chat entitlement] sign-up: error parsing response (${a})`)?this.doSignUpFree(t):{errorCode:3}}return this.update({entitlement:5}),!!s?.subscribed}async getSessions(){let t=await this.defaultAccountService.getDefaultAccount();if(t){let o=(await this.authenticationService.getSessions(t.authenticationProvider.id)).filter(i=>i.id===t.sessionId);if(o.length)return o}return[...await this.authenticationService.getSessions(this.defaultAccountService.getDefaultAccountAuthenticationProvider().id)]}async onUnknownSignUpError(t,n){if(this.logService.error(n),!this.lifecycleService.willShutdown){let{confirmed:o}=await this.dialogService.confirm({type:$e.Error,message:p(19886,null),detail:t,primaryButton:p(19881,null)});return o}return!1}onUnprocessableSignUpError(t,n){this.logService.error(t),this.lifecycleService.willShutdown||this.dialogService.prompt({type:$e.Error,message:p(19887,null),detail:n,buttons:[{label:p(19875,null),run:()=>{}},{label:p(19874,null),run:()=>this.openerService.open(y.parse(Ab.upgradePlanUrl))}]})}async signIn(t){let n=await this.defaultAccountService.signIn({additionalScopes:t?.additionalScopes,extraAuthorizeParameters:{get_started_with:"copilot-vscode"},provider:t?.useSocialProvider});if(!n)return{};let o=await this.doResolveEntitlement(n,be.None);return{defaultAccount:n,entitlements:o}}dispose(){this.pendingResolveCts.dispose(!0),super.dispose()}};$g=D([C(2,Ia),C(3,ue),C(4,Ib),C(5,ML),C(6,OL),C(7,NL),C(8,UL),C(9,LL)],$g);var hi=class extends H{constructor(t,n,o,i,s){super();this.storageService=n;this.logService=o;this.configurationService=i;this.telemetryService=s;this.suspendedState=void 0;this._onDidChange=this._register(new E);this.onDidChange=this._onDidChange.event;this.updateBarrier=void 0;this.canSignUpContextKey=Ce.Entitlement.canSignUp.bindTo(t),this.signedOutContextKey=Ce.Entitlement.signedOut.bindTo(t),this.freeContextKey=Ce.Entitlement.planFree.bindTo(t),this.proContextKey=Ce.Entitlement.planPro.bindTo(t),this.proPlusContextKey=Ce.Entitlement.planProPlus.bindTo(t),this.businessContextKey=Ce.Entitlement.planBusiness.bindTo(t),this.enterpriseContextKey=Ce.Entitlement.planEnterprise.bindTo(t),this.organisationsContextKey=Ce.Entitlement.organisations.bindTo(t),this.isInternalContextKey=Ce.Entitlement.internal.bindTo(t),this.skuContextKey=Ce.Entitlement.sku.bindTo(t),this.hiddenContext=Ce.Setup.hidden.bindTo(t),this.laterContext=Ce.Setup.later.bindTo(t),this.installedContext=Ce.Setup.installed.bindTo(t),this.disabledContext=Ce.Setup.disabled.bindTo(t),this.untrustedContext=Ce.Setup.untrusted.bindTo(t),this.registeredContext=Ce.Setup.registered.bindTo(t),this._state=this.storageService.getObject(hi.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,0)??{entitlement:1,organisations:void 0,sku:void 0,copilotTrackingId:void 0},this.updateContextSync(),this.registerListeners()}static{this.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY="chat.setupContext"}static{this.CHAT_DISABLED_CONFIGURATION_KEY="chat.disableAIFeatures"}get state(){return this.withConfiguration(this.suspendedState??this._state)}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(hi.CHAT_DISABLED_CONFIGURATION_KEY)&&this.updateContext()}))}withConfiguration(t){return this.configurationService.getValue(hi.CHAT_DISABLED_CONFIGURATION_KEY)===!0?{...t,hidden:!0}:t}async update(t){this.logService.trace(`[chat entitlement context] update(): ${JSON.stringify(t)}`);let n=JSON.stringify(this._state);if(typeof t.installed=="boolean"&&typeof t.disabled=="boolean"&&typeof t.untrusted=="boolean"&&(this._state.installed=t.installed,this._state.disabled=t.disabled,this._state.untrusted=t.untrusted,t.installed&&!t.disabled&&(t.hidden=!1)),typeof t.hidden=="boolean"&&(this._state.hidden=t.hidden),typeof t.later=="boolean"&&(this._state.later=t.later),typeof t.entitlement=="number"&&(this._state.entitlement=t.entitlement,this._state.organisations=t.organisations,this._state.sku=t.sku,this._state.copilotTrackingId=t.copilotTrackingId,this._state.entitlement===5||wV(this._state.entitlement)?this._state.registered=!0:this._state.entitlement===3&&(this._state.registered=!1)),Ck(this.configurationService,this._state.entitlement,this._state)&&(this._state.sku="no_auth_limited_copilot"),n!==JSON.stringify(this._state))return this.storageService.store(hi.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,{...this._state,later:void 0},0,1),this.updateContext()}async updateContext(){await this.updateBarrier?.wait(),this.updateContextSync()}updateContextSync(){let t=this.withConfiguration(this._state);this.signedOutContextKey.set(t.entitlement===1),this.canSignUpContextKey.set(t.entitlement===3),this.freeContextKey.set(t.entitlement===5),this.proContextKey.set(t.entitlement===6),this.proPlusContextKey.set(t.entitlement===7),this.businessContextKey.set(t.entitlement===8),this.enterpriseContextKey.set(t.entitlement===9),this.organisationsContextKey.set(t.organisations),this.isInternalContextKey.set(!!t.organisations?.some(n=>n==="github"||n==="microsoft"||n==="ms-copilot"||n==="MicrosoftCopilot")),this.skuContextKey.set(t.sku),this.hiddenContext.set(!!t.hidden),this.laterContext.set(!!t.later),this.installedContext.set(!!t.installed),this.disabledContext.set(!!t.disabled),this.untrustedContext.set(!!t.untrusted),this.registeredContext.set(!!t.registered),this.logService.trace(`[chat entitlement context] updateContext(): ${JSON.stringify(t)}`),HL(t,this.configurationService,this.telemetryService),this._onDidChange.fire()}suspend(){this.suspendedState={...this._state},this.updateBarrier=new yn}resume(){this.suspendedState=void 0,this.updateBarrier?.open(),this.updateBarrier=void 0}};hi=D([C(0,sr),C(1,ds),C(2,ue),C(3,oo),C(4,Ia)],hi);Qe(EV,Wg,0);var Fr;(oe=>{oe.responseVote=new w("chatSessionResponseVote","",{type:"string",description:p(7635,null)}),oe.responseDetectedAgentCommand=new w("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:p(7616,null)}),oe.responseSupportsIssueReporting=new w("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:p(7610,null)}),oe.responseIsFiltered=new w("chatSessionResponseFiltered",!1,{type:"boolean",description:p(7609,null)}),oe.responseHasError=new w("chatSessionResponseError",!1,{type:"boolean",description:p(7608,null)}),oe.requestInProgress=new w("chatSessionRequestInProgress",!1,{type:"boolean",description:p(7634,null)}),oe.currentlyEditing=new w("chatSessionCurrentlyEditing",!1,{type:"boolean",description:p(7632,null)}),oe.currentlyEditingInput=new w("chatSessionCurrentlyEditingInput",!1,{type:"boolean",description:p(7633,null)});let l;(on=>(on.Sent="s",on.QueueOrSteer="qs"))(l=oe.EditingRequestType||={}),oe.editingRequestType=new w("chatEditingSentRequest",void 0,{type:"string",description:p(7588,null)}),oe.isResponse=new w("chatResponse",!1,{type:"boolean",description:p(7607,null)}),oe.isRequest=new w("chatRequest",!1,{type:"boolean",description:p(7605,null)}),oe.isPendingRequest=new w("chatRequestIsPending",!1,{type:"boolean",description:p(7606,null)}),oe.itemId=new w("chatItemId","",{type:"string",description:p(7596,null)}),oe.lastItemId=new w("chatLastItemId",[],{type:"string",description:p(7597,null)}),oe.editApplied=new w("chatEditApplied",!1,{type:"boolean",description:p(7582,null)}),oe.inputHasText=new w("chatInputHasText",!1,{type:"boolean",description:p(7631,null)}),oe.inputHasFocus=new w("chatInputHasFocus",!1,{type:"boolean",description:p(7630,null)}),oe.inChatInput=new w("inChatInput",!1,{type:"boolean",description:p(7628,null)}),oe.inChatSession=new w("inChat",!1,{type:"boolean",description:p(7623,null)}),oe.inChatEditor=new w("inChatEditor",!1,{type:"boolean",description:p(7624,null)}),oe.inChatTodoList=new w("inChatTodoList",!1,{type:"boolean",description:p(7627,null)}),oe.inChatTip=new w("inChatTip",!1,{type:"boolean",description:p(7626,null)}),oe.inChatTerminalToolOutput=new w("inChatTerminalToolOutput",!1,{type:"boolean",description:p(7625,null)}),oe.chatModeKind=new w("chatAgentKind","ask",{type:"string",description:p(7568,null)}),oe.chatModeName=new w("chatModeName","",{type:"string",description:p(7600,null)}),oe.chatModelId=new w("chatModelId","",{type:"string",description:p(7598,null)}),oe.supported=Tt.or(TL.negate(),RL.notEqualsTo(""),Tt.has("config.chat.experimental.serverlessWebEnabled")),oe.enabled=new w("chatIsEnabled",!1,{type:"boolean",description:p(7594,null)}),oe.lockedToCodingAgent=new w("lockedToCodingAgent",!1,{type:"boolean",description:p(7636,null)}),oe.chatSessionHasCustomAgentTarget=new w("chatSessionHasCustomAgentTarget",!1,{type:"boolean",description:p(7611,null)}),oe.chatSessionHasTargetedModels=new w("chatSessionHasTargetedModels",!1,{type:"boolean",description:p(7613,null)}),oe.agentSupportsAttachments=new w("agentSupportsAttachments",!1,{type:"boolean",description:p(7579,null)}),oe.withinEditSessionDiff=new w("withinEditSessionDiff",!1,{type:"boolean",description:p(7638,null)}),oe.filePartOfEditSession=new w("filePartOfEditSession",!1,{type:"boolean",description:p(7620,null)}),oe.extensionParticipantRegistered=new w("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:p(7601,null)}),oe.panelParticipantRegistered=new w("chatPanelParticipantRegistered",!1,{type:"boolean",description:p(7603,null)}),oe.chatEditingCanUndo=new w("chatEditingCanUndo",!1,{type:"boolean",description:p(7584,null)}),oe.chatEditingCanRedo=new w("chatEditingCanRedo",!1,{type:"boolean",description:p(7583,null)}),oe.languageModelsAreUserSelectable=new w("chatModelsAreUserSelectable",!1,{type:"boolean",description:p(7599,null)}),oe.chatSessionHasModels=new w("chatSessionHasModels",!1,{type:"boolean",description:p(7612,null)}),oe.chatSessionOptionsValid=new w("chatSessionOptionsValid",!0,{type:"boolean",description:p(7615,null)}),oe.extensionInvalid=new w("chatExtensionInvalid",!1,{type:"boolean",description:p(7589,null)}),oe.inputCursorAtTop=new w("chatCursorAtTop",!1),oe.inputHasAgent=new w("chatInputHasAgent",!1),oe.location=new w("chatLocation",void 0),oe.inQuickChat=new w("quickChatHasFocus",!1,{type:"boolean",description:p(7629,null)}),oe.inAgentSessionsWelcome=new w("inAgentSessionsWelcome",!1,{type:"boolean",description:p(7622,null)}),oe.chatSessionType=new w("chatSessionType","",{type:"string",description:p(7617,null)}),oe.hasFileAttachments=new w("chatHasFileAttachments",!1,{type:"boolean",description:p(7592,null)}),oe.chatSessionIsEmpty=new w("chatSessionIsEmpty",!0,{type:"boolean",description:p(7614,null)}),oe.hasPendingRequests=new w("chatHasPendingRequests",!1,{type:"boolean",description:p(7593,null)}),oe.remoteJobCreating=new w("chatRemoteJobCreating",!1,{type:"boolean",description:p(7604,null)}),oe.hasRemoteCodingAgent=new w("hasRemoteCodingAgent",!1,p(7621,null)),oe.hasCanDelegateProviders=new w("chatHasCanDelegateProviders",!1,{type:"boolean",description:p(7591,null)}),oe.enableRemoteCodingAgentPromptFileOverlay=new w("enableRemoteCodingAgentPromptFileOverlay",!1,p(7619,null)),oe.skipChatRequestInProgressMessage=new w("chatSkipRequestInProgressMessage",!1,{type:"boolean",description:p(7618,null)}),oe.Setup=Ce.Setup,oe.Entitlement=Ce.Entitlement,oe.chatQuotaExceeded=Ce.chatQuotaExceeded,oe.completionsQuotaExceeded=Ce.completionsQuotaExceeded,oe.Editing={hasToolConfirmation:new w("chatHasToolConfirmation",!1,{type:"boolean",description:p(7587,null)}),hasElicitationRequest:new w("chatHasElicitationRequest",!1,{type:"boolean",description:p(7585,null)}),hasQuestionCarousel:new w("chatHasQuestionCarousel",!1,{type:"boolean",description:p(7586,null)})},oe.Tools={toolsCount:new w("toolsCount",0,{type:"number",description:p(7637,null)})},oe.Modes={hasCustomChatModes:new w("chatHasCustomAgents",!1,{type:"boolean",description:p(7590,null)}),agentModeDisabledByPolicy:new w("chatAgentModeDisabledByPolicy",!1,{type:"boolean",description:p(7580,null)})},oe.panelLocation=new w("chatPanelLocation",void 0,{type:"number",description:p(7602,null)}),oe.agentSessionsViewerFocused=new w("agentSessionsViewerFocused",!0,{type:"boolean",description:p(7574,null)}),oe.agentSessionsViewerOrientation=new w("agentSessionsViewerOrientation",void 0,{type:"number",description:p(7575,null)}),oe.agentSessionsViewerPosition=new w("agentSessionsViewerPosition",void 0,{type:"number",description:p(7576,null)}),oe.agentSessionsViewerVisible=new w("agentSessionsViewerVisible",void 0,{type:"boolean",description:p(7577,null)}),oe.agentSessionType=new w("chatSessionType","",{type:"string",description:p(7578,null)}),oe.agentSessionSection=new w("agentSessionSection","",{type:"string",description:p(7573,null)}),oe.isArchivedAgentSession=new w("agentSessionIsArchived",!1,{type:"boolean",description:p(7571,null)}),oe.isReadAgentSession=new w("agentSessionIsRead",!1,{type:"boolean",description:p(7572,null)}),oe.hasMultipleAgentSessionsSelected=new w("agentSessionHasMultipleSelected",!1,{type:"boolean",description:p(7570,null)}),oe.hasAgentSessionChanges=new w("agentSessionHasChanges",!1,{type:"boolean",description:p(7569,null)}),oe.isKatexMathElement=new w("chatIsKatexMathElement",!1,{type:"boolean",description:p(7595,null)}),oe.contextUsageHasBeenOpened=new w("chatContextUsageHasBeenOpened",!1,{type:"boolean",description:p(7581,null)})})(Fr||={});var kV;(t=>(t.inEditingMode=Tt.or(Fr.chatModeKind.isEqualTo("edit"),Fr.chatModeKind.isEqualTo("agent")),t.chatSetupTriggerContext=Tt.or(Fr.Setup.installed.negate(),Fr.Entitlement.canSignUp)))(kV||={});var VL=M("ILanguageModelsConfigurationService");var KL;(n=>{function r(o){return(typeof o.capabilities?.agentMode>"u"||o.capabilities.agentMode)&&!!o.capabilities?.toolCalling}n.suitableForAgentMode=r;function e(o){return`${o.name} (${o.vendor})`}n.asQualifiedName=e;function t(o,i){return i.vendor==="copilot"&&o===i.name?!0:o===e(i)}n.matchesQualifiedName=t})(KL||={});var Lb=M("ILanguageModelsService"),BL={type:"object",required:["vendor","displayName"],properties:{vendor:{type:"string",description:p(7665,null)},displayName:{type:"string",description:p(7661,null)},configuration:{type:"object",description:p(7659,null),anyOf:[{$ref:"http://json-schema.org/draft-07/schema#"},{properties:{properties:{type:"object",additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:p(7660,null)}}}},additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:p(7660,null)}}}}}]},managementCommand:{type:"string",description:p(7663,null),deprecated:!0,deprecationMessage:p(7664,null)},when:{type:"string",description:p(7667,null)}}},_V=kb.registerExtensionPoint({extensionPoint:"languageModelChatProviders",jsonSchema:{description:p(7658,null),oneOf:[BL,{type:"array",items:BL}]},activationEventsGenerator:function*(r){for(let e of r)yield`onLanguageModelChatProvider:${e.vendor}`}}),Ek="chatModelPickerPreferences",WL="chatModelRecentlyUsed",$L="chatModelSeenNewModels",wk="chat.participantNameRegistry",kk="chat.curatedModels";function zL(r){return r.map(e=>typeof e=="string"?{id:e}:e)}var sd=class{constructor(e,t,n,o,i,s,a,l,d){this._extensionService=e;this._logService=t;this._storageService=n;this._contextKeyService=o;this._languageModelsConfigurationService=i;this._quickInputService=s;this._secretStorageService=a;this._productService=l;this._requestService=d;this._store=new q;this._providers=new Map;this._vendors=new Map;this._onDidChangeLanguageModelVendors=this._store.add(new E);this.onDidChangeLanguageModelVendors=this._onDidChangeLanguageModelVendors.event;this._modelsGroups=new Map;this._modelCache=new Map;this._resolveLMSequencer=new sa;this._modelPickerUserPreferences={};this._onLanguageModelChange=this._store.add(new E);this.onDidChangeLanguageModels=this._onLanguageModelChange.event;this._recentlyUsedModelIds=[];this._curatedModels={free:[],paid:[]};this._newModelIds=new Set;this._seenNewModelIds=new Set;this._chatControlDisposed=!1;this._restrictedChatParticipants=td(this,Object.create(null));this.restrictedChatParticipants=this._restrictedChatParticipants;this._onDidChangeNewModelIds=this._store.add(new E);this.onDidChangeNewModelIds=this._onDidChangeNewModelIds.event;this._hasUserSelectableModels=Fr.languageModelsAreUserSelectable.bindTo(o),this._modelPickerUserPreferences=this._readModelPickerPreferences(),this._recentlyUsedModelIds=this._readRecentlyUsedModels(),this._seenNewModelIds=this._readSeenNewModels(),this._initChatControlData(),this._store.add(this._storageService.onDidChangeValue(0,Ek,this._store)(()=>this._onDidChangeModelPickerPreferences())),this._store.add(this.onDidChangeLanguageModels(()=>this._hasUserSelectableModels.set(this._modelCache.size>0&&Array.from(this._modelCache.values()).some(c=>c.isUserSelectable)))),this._store.add(this._languageModelsConfigurationService.onDidChangeLanguageModelGroups(c=>this._onDidChangeLanguageModelGroups(c))),this._store.add(_V.setHandler((c,{added:u,removed:m})=>{let g=[],v=[];for(let h of u)for(let x of It.wrap(h.value)){if(this._vendors.has(x.vendor)){h.collector.error(p(7666,null,x.vendor));continue}if(di(x.vendor)){h.collector.error(p(7662,null));continue}if(x.vendor.trim()!==x.vendor){h.collector.error(p(7668,null));continue}g.push(x)}for(let h of m)for(let x of It.wrap(h.value))v.push(x);this.deltaLanguageModelChatProviderDescriptors(g,v)}))}static{this.SECRET_KEY_PREFIX="chat.lm.secret."}static{this.SECRET_INPUT="${input:{0}}"}deltaLanguageModelChatProviderDescriptors(e,t){let n=[],o=[];for(let i of e){if(this._vendors.has(i.vendor)){this._logService.error(`The vendor '${i.vendor}' is already registered and cannot be registered twice`);continue}if(di(i.vendor)){this._logService.error("The vendor field cannot be empty.");continue}if(i.vendor.trim()!==i.vendor){this._logService.error("The vendor field cannot start or end with whitespace.");continue}let s={vendor:i.vendor,displayName:i.displayName,configuration:i.configuration,managementCommand:i.managementCommand,when:i.when,isDefault:i.vendor==="copilot"};this._vendors.set(i.vendor,s),n.push(i.vendor),this._hasStoredModelForVendor(i.vendor)&&this._extensionService.activateByEvent(`onLanguageModelChatProvider:${i.vendor}`)}for(let i of t)this._vendors.delete(i.vendor),this._providers.delete(i.vendor),this._clearModelCache(i.vendor),o.push(i.vendor);for(let[i,s]of this._providers)this._vendors.has(i)||this._providers.delete(i);if((n.length>0||o.length>0)&&(this._onDidChangeLanguageModelVendors.fire([...n,...o]),o.length>0))for(let i of o)this._onLanguageModelChange.fire(i)}async _onDidChangeLanguageModelGroups(e){let t=new Set(e.map(n=>n.vendor));await Promise.all(Array.from(t).map(n=>this._resolveAllLanguageModels(n,!0)))}_readModelPickerPreferences(){return this._storageService.getObject(Ek,0,{})}_onDidChangeModelPickerPreferences(){let e=this._readModelPickerPreferences(),t=this._modelPickerUserPreferences,n=new Set,o=!1;for(let i in e)if(t[i]!==e[i]){o=!0;let s=this._modelCache.get(i);s&&n.add(s.vendor)}for(let i in t)if(!e.hasOwnProperty(i)){o=!0;let s=this._modelCache.get(i);s&&n.add(s.vendor)}if(o){this._logService.trace("[LM] Updated model picker preferences from storage"),this._modelPickerUserPreferences=e;for(let i of n)this._onLanguageModelChange.fire(i)}}_hasStoredModelForVendor(e){return Object.keys(this._modelPickerUserPreferences).some(t=>t.startsWith(e))}_saveModelPickerPreferences(){this._storageService.store(Ek,this._modelPickerUserPreferences,0,0)}updateModelPickerPreference(e,t){let n=this._modelCache.get(e);if(!n){this._logService.warn(`[LM] Cannot update model picker preference for unknown model ${e}`);return}this._modelPickerUserPreferences[e]=t,t===n.isUserSelectable?(delete this._modelPickerUserPreferences[e],this._saveModelPickerPreferences()):n.isUserSelectable!==t&&this._saveModelPickerPreferences(),this._onLanguageModelChange.fire(n.vendor),this._logService.trace(`[LM] Updated model picker preference for ${e} to ${t}`)}getVendors(){return Array.from(this._vendors.values()).filter(e=>{if(!e.when)return!0;let t=Tt.deserialize(e.when);return t?this._contextKeyService.contextMatchesRules(t):!1})}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(e){let t=this._modelCache.get(e);return t&&this._modelPickerUserPreferences[e]!==void 0?{...t,isUserSelectable:this._modelPickerUserPreferences[e]}:t}lookupLanguageModelByQualifiedName(e){for(let[t,n]of this._modelCache.entries())if(KL.matchesQualifiedName(e,n))return{metadata:n,identifier:t}}async _resolveAllLanguageModels(e,t){let n=this._vendors.get(e);if(!n)return;await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${e}`);let o=this._providers.get(e);if(!o){this._logService.warn(`[LM] No provider registered for vendor ${e}`);return}return this._resolveLMSequencer.queue(e,async()=>{let i=[],s=[];try{let c=await o.provideLanguageModelChatInfo({silent:t},be.None);if(c.length){i.push(...c);let u=[];for(let m of c)n.isDefault?m.metadata.isUserSelectable||this._modelPickerUserPreferences[m.identifier]===!0?u.push(m.identifier):this._logService.trace(`[LM] Skipping model ${m.identifier} from model picker as it is not user selectable.`):u.push(m.identifier);s.push({modelIdentifiers:u})}}catch(c){s.push({modelIdentifiers:[],status:{message:Pm(c),severity:$e.Error}})}let a=this._languageModelsConfigurationService.getLanguageModelsProviderGroups();for(let c of a){if(c.vendor!==e)continue;let u=await this._resolveConfiguration(c,n.configuration);try{let m=await o.provideLanguageModelChatInfo({group:c.name,silent:t,configuration:u},be.None);m.length&&(i.push(...m),s.push({group:c,modelIdentifiers:m.map(g=>g.identifier)}))}catch(m){s.push({group:c,modelIdentifiers:[],status:{message:Pm(m),severity:$e.Error}})}}this._modelsGroups.set(e,s);let l=this._clearModelCache(e),d=!1;for(let c of i){if(this._modelCache.has(c.identifier)){this._logService.warn(`[LM] Model ${c.identifier} is already registered. Skipping.`);continue}this._modelCache.set(c.identifier,c.metadata),d=d||!Wt(l.get(c.identifier),c.metadata),l.delete(c.identifier)}this._logService.trace(`[LM] Resolved language models for vendor ${e}`,i),d=d||l.size>0,d?this._onLanguageModelChange.fire(e):this._logService.trace(`[LM] No changes in language models for vendor ${e}`)})}getLanguageModelGroups(e){return this._modelsGroups.get(e)??[]}async selectLanguageModels(e){if(e.vendor)await this._resolveAllLanguageModels(e.vendor,!0);else{let n=Array.from(this._vendors.keys());await Promise.all(n.map(o=>this._resolveAllLanguageModels(o,!0)))}let t=[];for(let[n,o]of this._modelCache)(e.vendor===void 0||o.vendor===e.vendor)&&(e.family===void 0||o.family===e.family)&&(e.version===void 0||o.version===e.version)&&(e.id===void 0||o.id===e.id)&&t.push(n);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelProvider(e,t){if(this._logService.trace("[LM] registering language model provider",e,t),!this._vendors.has(e))throw new Error(`Chat model provider uses UNKNOWN vendor ${e}.`);if(this._providers.has(e))throw new Error(`Chat model provider for vendor ${e} is already registered.`);this._providers.set(e,t),this._hasStoredModelForVendor(e)&&this._resolveAllLanguageModels(e,!0);let n=t.onDidChange(()=>{this._resolveAllLanguageModels(e,!0)});return J(()=>{this._logService.trace("[LM] UNregistered language model provider",e),this._clearModelCache(e),this._providers.delete(e),n.dispose()})}async sendChatRequest(e,t,n,o,i){let s=this._providers.get(this._modelCache.get(e)?.vendor||"");if(!s)throw new Error(`Chat provider for model ${e} is not registered.`);return s.sendChatRequest(e,n,t,o,i)}computeTokenLength(e,t,n){let o=this._modelCache.get(e);if(!o)throw new Error(`Chat model ${e} could not be found.`);let i=this._providers.get(o.vendor);if(!i)throw new Error(`Chat provider for model ${e} is not registered.`);return i.provideTokenCount(e,t,n)}async configureLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:l})=>l===e);if(!n)throw new Error(`Vendor ${e} not found.`);if(n.managementCommand){await this._resolveAllLanguageModels(n.vendor,!1);return}let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=o.find(l=>l.vendor===e&&l.name===t),s=await this.promptForName(o,n,i);if(!s)return;let a=i?await this._resolveConfiguration(i,n.configuration):void 0;try{let l=n.configuration?await this.promptForConfiguration(s,n.configuration,a):void 0;if(n.configuration&&!l)return;let d=await this._resolveLanguageModelProviderGroup(s,e,l,n.configuration),c=i?await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,d):await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(d);if(n.configuration&&this.requireConfiguring(n.configuration)){let u=this.getSnippetForFirstUnconfiguredProperty(l??{},n.configuration);await this._languageModelsConfigurationService.configureLanguageModels({group:c,snippet:u})}}catch(l){if(Tn(l))return;throw l}}async addLanguageModelsProviderGroup(e,t,n){let o=this.getVendors().find(({vendor:s})=>s===t);if(!o)throw new Error(`Vendor ${t} not found.`);let i=await this._resolveLanguageModelProviderGroup(e,t,n,o.configuration);await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(i)}async removeLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:s})=>s===e);if(!n)throw new Error(`Vendor ${e} not found.`);let i=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(s=>s.vendor===e&&s.name===t);if(!i)throw new Error(`Language model provider group ${t} for vendor ${e} not found.`);await this._deleteSecretsInConfiguration(i,n.configuration),await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i)}requireConfiguring(e){if(e.additionalProperties)return!0;if(!e.properties)return!1;for(let t of Object.keys(e.properties))if(!this.canPromptForProperty(e.properties[t]))return!0;return!1}getSnippetForFirstUnconfiguredProperty(e,t){if(t.properties){for(let n of Object.keys(t.properties))if(e[n]===void 0){let o=t.properties[n];if(o&&typeof o!="boolean"&&o.defaultSnippets?.[0]){let i=o.defaultSnippets[0],s=i.bodyText??JSON.stringify(i.body,null,"	");return s=s.replace(/"(\^[^"]*)"/g,(a,l)=>l.substring(1)),`"${n}": ${s}`}}}}async promptForName(e,t,n){let o=n?.name;if(!o){o=t.displayName;let a=1;for(;e.some(l=>l.vendor===t.vendor&&l.name===o);)a++,o=`${t.displayName} ${a}`}let i,s=new q;try{await new Promise(a=>{let l=s.add(this._quickInputService.createInputBox());l.title=p(7650,null),l.placeholder=p(7653,null),l.value=o,l.ignoreFocusOut=!0,s.add(l.onDidChangeValue(d=>{if(!d){l.validationMessage=p(7651,null),l.severity=$e.Error;return}if(!n&&e.some(c=>c.name===d)){l.validationMessage=p(7654,null),l.severity=$e.Error;return}l.validationMessage=void 0,l.severity=$e.Ignore})),s.add(l.onDidAccept(async()=>{i=l.value,l.hide()})),s.add(l.onDidHide(()=>a())),l.show()})}finally{s.dispose()}return i}async promptForConfiguration(e,t,n){if(!t.properties)return;let o=n?{...n}:{};for(let i of Object.keys(t.properties)){let s=t.properties[i],a=!!t.required?.includes(i),l=await this.promptForValue(e,i,s,a,n);l!==void 0&&(o[i]=l)}return o}async promptForValue(e,t,n,o,i){if(!n||!this.canPromptForProperty(n))return;if(n.type==="array"&&n.items&&!Array.isArray(n.items)&&n.items.enum){let a=await this.promptForArray(e,t,n);return a===void 0?void 0:a}let s=await this.promptForInput(e,t,n,o,i);if(s!==void 0)return s}canPromptForProperty(e){return!e||typeof e=="boolean"?!1:!!(e.type==="array"&&e.items&&!Array.isArray(e.items)&&e.items.enum||e.type==="string"||e.type==="number"||e.type==="integer"||e.type==="boolean")}async promptForArray(e,t,n){if(!n.items||Array.isArray(n.items)||!n.items.enum)return;let o=n.items.enum,i=new q;try{return await new Promise(s=>{let a=i.add(this._quickInputService.createQuickPick());a.title=`${e}: ${n.title??t}`,a.items=o.map(l=>({label:l})),a.placeholder=n.description??p(7656,null,t),a.canSelectMany=!0,a.ignoreFocusOut=!0,i.add(a.onDidAccept(()=>{s(a.selectedItems.map(l=>l.label)),a.hide()})),i.add(a.onDidHide(()=>{s(void 0)})),a.show()})}finally{i.dispose()}}async promptForInput(e,t,n,o,i){let s=new q;try{let a=await new Promise((l,d)=>{let c=s.add(this._quickInputService.createInputBox());c.title=`${e}: ${n.title??t}`,c.placeholder=p(7652,null,t),c.password=!!n.secret,c.ignoreFocusOut=!0,i?.[t]?c.value=String(i?.[t]):n.default&&(c.value=String(n.default)),n.description&&(c.prompt=n.description),s.add(c.onDidChangeValue(u=>{if(!u&&o){c.validationMessage=p(7657,null),c.severity=$e.Error;return}if((n.type==="number"||n.type==="integer")&&isNaN(Number(u))){c.validationMessage=p(7655,null),c.severity=$e.Error;return}if(n.type==="boolean"&&u!=="true"&&u!=="false"){c.validationMessage=p(7649,null),c.severity=$e.Error;return}c.validationMessage=void 0,c.severity=$e.Ignore})),s.add(c.onDidAccept(()=>{if(!c.value&&o){c.validationMessage=p(7657,null),c.severity=$e.Error;return}l(c.value),c.hide()})),s.add(c.onDidHide(u=>{u.reason===2?d(new xt):l(void 0)})),c.show()});return a?n.type==="number"||n.type==="integer"?Number(a):n.type==="boolean"?a==="true":a:void 0}finally{s.dispose()}}encodeSecretKey(e){return O0(sd.SECRET_INPUT,e)}decodeSecretKey(e){if(ke(e))return e.substring(e.indexOf(":")+1,e.length-1)}_clearModelCache(e){let t=new Map;for(let[n,o]of this._modelCache.entries())o.vendor===e&&(t.set(n,o),this._modelCache.delete(n));return t}async _resolveConfiguration(e,t){if(!t)return{};let n={};for(let o in e){if(o==="vendor"||o==="name"||o==="range")continue;let i=e[o];if(t.properties?.[o]?.secret){let s=this.decodeSecretKey(i);i=s?await this._secretStorageService.get(s):void 0}n[o]=i}return n}async _resolveLanguageModelProviderGroup(e,t,n,o){if(!o)return{name:e,vendor:t};let i={};for(let s in n){let a=n[s];if(o.properties?.[s]?.secret&&ke(a)){let l=`${sd.SECRET_KEY_PREFIX}${Rr(pt()).toString(16)}`;await this._secretStorageService.set(l,a),a=this.encodeSecretKey(l)}i[s]=a}return{name:e,vendor:t,...i}}async _deleteSecretsInConfiguration(e,t){if(!t)return;let{vendor:n,name:o,range:i,...s}=e;for(let a in s){let l=e[a];if(t.properties?.[a]?.secret){let d=this.decodeSecretKey(l);d&&await this._secretStorageService.delete(d)}}}async migrateLanguageModelsProviderGroup(e){let{vendor:t,name:n,...o}=e;if(!this._vendors.get(t))throw new Error(`Vendor ${t} not found.`);await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${t}`);let i=this._providers.get(t);if(!i)throw new Error(`Chat model provider for vendor ${t} is not registered.`);let s=await i.provideLanguageModelChatInfo({group:n,silent:!1,configuration:o},be.None);for(let a of s){let l=`${t}/${a.metadata.id}`;this._modelPickerUserPreferences[l]===!0&&(this._modelPickerUserPreferences[a.identifier]=!0),delete this._modelPickerUserPreferences[l]}this._saveModelPickerPreferences(),await this.addLanguageModelsProviderGroup(n,t,o)}_readRecentlyUsedModels(){return this._storageService.getObject(WL,0,[])}_saveRecentlyUsedModels(){this._storageService.store(WL,this._recentlyUsedModelIds,0,0)}getRecentlyUsedModelIds(e=7){return this._recentlyUsedModelIds.filter(t=>this._modelCache.has(t)).slice(0,e)}recordModelUsage(e){let t=this._recentlyUsedModelIds.indexOf(e);t!==-1&&this._recentlyUsedModelIds.splice(t,1),this._recentlyUsedModelIds.unshift(e),this._recentlyUsedModelIds.length>20&&(this._recentlyUsedModelIds.length=20),this._saveRecentlyUsedModels()}getCuratedModels(){return this._curatedModels}_setCuratedModels(e){let t=o=>({id:o.id,isNew:o.isNew,minVSCodeVersion:o.minVSCodeVersion});this._curatedModels={free:e.filter(o=>!o.paidOnly).map(t),paid:e.filter(o=>o.paidOnly).map(t)};let n=new Set;for(let o of e)o.isNew&&n.add(o.id);this._newModelIds=n,this._onDidChangeNewModelIds.fire()}getNewModelIds(){let e=[];for(let t of this._newModelIds)this._seenNewModelIds.has(t)||e.push(t);return e}markNewModelsAsSeen(){let e=!1;for(let t of this._newModelIds)this._seenNewModelIds.has(t)||(this._seenNewModelIds.add(t),e=!0);e&&(this._saveSeenNewModels(),this._onDidChangeNewModelIds.fire())}_readSeenNewModels(){return new Set(this._storageService.getObject($L,0,[]))}_saveSeenNewModels(){this._storageService.store($L,[...this._seenNewModelIds],0,0)}_initChatControlData(){if(this._chatControlUrl=this._productService.chatParticipantRegistry,!this._chatControlUrl)return;let e=this._storageService.get(wk,-1);try{this._restrictedChatParticipants.set(JSON.parse(e??"{}"),void 0)}catch{this._storageService.remove(wk,-1)}let t=this._storageService.get(kk,-1);try{let n=JSON.parse(t??"[]");Array.isArray(n)&&this._setCuratedModels(zL(n))}catch{this._storageService.remove(kk,-1)}this._refreshChatControlData()}_refreshChatControlData(){this._chatControlDisposed||this._fetchChatControlData().catch(e=>this._logService.warn("Failed to fetch chat control data",e)).then(()=>cn(300*1e3)).then(()=>this._refreshChatControlData())}async _fetchChatControlData(){let e=await this._requestService.request({type:"GET",url:this._chatControlUrl},be.None);if(e.res.statusCode!==200)throw new Error("Could not get chat control data.");let t=await aL(e);if(!t||t.version!==1)throw new Error("Unexpected chat control response.");let n=t.restrictedChatParticipants;this._restrictedChatParticipants.set(n,void 0),this._storageService.store(wk,JSON.stringify(n),-1,1),t.curatedModels&&Array.isArray(t.curatedModels)&&(this._setCuratedModels(zL(t.curatedModels)),this._storageService.store(kk,JSON.stringify(t.curatedModels),-1,1))}dispose(){this._chatControlDisposed=!0,this._store.dispose(),this._providers.clear()}};sd=D([C(0,xL),C(1,ue),C(2,ds),C(3,sr),C(4,VL),C(5,lL),C(6,mL),C(7,db),C(8,Ib)],sd);var cle=new w("debugType",void 0,{type:"string",description:p(9101,null)}),ule=new w("debugConfigurationType",void 0,{type:"string",description:p(9092,null)}),ple=new w("debugState","inactive",{type:"string",description:p(9100,null)}),DV="debugUx",mle=new w(DV,"default",{type:"string",description:p(9102,null)}),gle=new w("hasDebugged",!1,{type:"boolean",description:p(9110,null)}),fle=new w("inDebugMode",!1,{type:"boolean",description:p(9112,null)}),hle=new w("inDebugRepl",!1,{type:"boolean",description:p(9113,null)}),vle=new w("breakpointWidgetVisible",!1,{type:"boolean",description:p(9082,null)}),ble=new w("inBreakpointWidget",!1,{type:"boolean",description:p(9111,null)}),yle=new w("breakpointsFocused",!0,{type:"boolean",description:p(9080,null)}),Ile=new w("watchExpressionsFocused",!0,{type:"boolean",description:p(9138,null)}),xle=new w("watchExpressionsExist",!1,{type:"boolean",description:p(9137,null)}),Sle=new w("variablesFocused",!0,{type:"boolean",description:p(9134,null)}),Cle=new w("expressionSelected",!1,{type:"boolean",description:p(9106,null)}),Tle=new w("breakpointInputFocused",!1,{type:"boolean",description:p(9076,null)}),Ele=new w("callStackItemType",void 0,{type:"string",description:p(9088,null)}),wle=new w("callStackSessionIsAttach",!1,{type:"boolean",description:p(9090,null)}),kle=new w("callStackItemStopped",!1,{type:"boolean",description:p(9087,null)}),_le=new w("callStackSessionHasOneThread",!1,{type:"boolean",description:p(9089,null)}),Ple=new w("callStackFocused",!0,{type:"boolean",description:p(9086,null)}),Dle=new w("watchItemType",void 0,{type:"string",description:p(9139,null)}),Rle=new w("canViewMemory",void 0,{type:"boolean",description:p(9091,null)}),Mle=new w("breakpointItemType",void 0,{type:"string",description:p(9078,null)}),Ale=new w("breakpointItemBytes",void 0,{type:"boolean",description:p(9077,null)}),Lle=new w("breakpointHasModes",!1,{type:"boolean",description:p(9075,null)}),Ole=new w("breakpointSupportsCondition",!1,{type:"boolean",description:p(9081,null)}),Nle=new w("loadedScriptsSupported",!1,{type:"boolean",description:p(9118,null)}),Ule=new w("loadedScriptsItemType",void 0,{type:"string",description:p(9117,null)}),Fle=new w("focusedSessionIsAttach",!1,{type:"boolean",description:p(9107,null)}),Hle=new w("focusedSessionIsNoDebug",!1,{type:"boolean",description:p(9108,null)}),Vle=new w("stepBackSupported",!1,{type:"boolean",description:p(9123,null)}),Ble=new w("restartFrameSupported",!1,{type:"boolean",description:p(9121,null)}),Wle=new w("stackFrameSupportsRestart",!1,{type:"boolean",description:p(9122,null)}),$le=new w("jumpToCursorSupported",!1,{type:"boolean",description:p(9115,null)}),zle=new w("stepIntoTargetsSupported",!1,{type:"boolean",description:p(9124,null)}),Kle=new w("breakpointsExist",!1,{type:"boolean",description:p(9079,null)}),qle=new w("debuggersAvailable",!1,{type:"boolean",description:p(9095,null)}),Gle=new w("debugExtensionAvailable",!0,{type:"boolean",description:p(9093,null)}),jle=new w("debugProtocolVariableMenuContext",void 0,{type:"string",description:p(9096,null)}),Qle=new w("debugSetVariableSupported",!1,{type:"boolean",description:p(9099,null)}),Jle=new w("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:p(9097,null)}),Xle=new w("debugSetExpressionSupported",!1,{type:"boolean",description:p(9098,null)}),Yle=new w("breakWhenValueChangesSupported",!1,{type:"boolean",description:p(9083,null)}),Zle=new w("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:p(9084,null)}),ede=new w("breakWhenValueIsReadSupported",!1,{type:"boolean",description:p(9085,null)}),tde=new w("terminateDebuggeeSupported",!1,{type:"boolean",description:p(9126,null)}),nde=new w("suspendDebuggeeSupported",!1,{type:"boolean",description:p(9125,null)}),ode=new w("terminateThreadsSupported",!1,{type:"boolean",description:p(9127,null)}),rde=new w("variableEvaluateNamePresent",!1,{type:"boolean",description:p(9128,null)}),ide=new w("variableIsReadonly",!1,{type:"boolean",description:p(9131,null)}),sde=new w("variableValue",!1,{type:"string",description:p(9136,null)}),ade=new w("variableType",!1,{type:"string",description:p(9135,null)}),lde=new w("variableInterfaces",!1,{type:"array",description:p(9130,null)}),dde=new w("variableName",!1,{type:"string",description:p(9133,null)}),cde=new w("variableLanguage",!1,{type:"string",description:p(9132,null)}),ude=new w("variableExtensionId",!1,{type:"string",description:p(9129,null)}),pde=new w("exceptionWidgetVisible",!1,{type:"boolean",description:p(9105,null)}),mde=new w("multiSessionRepl",!1,{type:"boolean",description:p(9120,null)}),gde=new w("multiSessionDebug",!1,{type:"boolean",description:p(9119,null)}),fde=new w("disassembleRequestSupported",!1,{type:"boolean",description:p(9103,null)}),hde=new w("disassemblyViewFocus",!1,{type:"boolean",description:p(9104,null)}),vde=new w("languageSupportsDisassembleRequest",!1,{type:"boolean",description:p(9116,null)}),bde=new w("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:p(9109,null)});var yde={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:p(9114,null)};var _k=(t=>(t[t.Initial=1]="Initial",t[t.Dynamic=2]="Dynamic",t))(_k||{});var Ide=M("debugService");var RV;(t=>(t.deserialize=n=>n,t.serialize=n=>n))(RV||={});var MV;(t=>(t.deserialize=n=>({id:n.id,name:n.name,iconPath:n.iconPath&&{light:y.revive(n.iconPath.light),dark:y.revive(n.iconPath.dark)},iconClass:n.iconClass,visualization:n.visualization}),t.serialize=n=>n))(MV||={});var Cde=M("IMcpGalleryManifestService");var Ob;(l=>(l.LATEST_PROTOCOL_VERSION="2025-11-25",l.JSONRPC_VERSION="2.0",l.PARSE_ERROR=-32700,l.INVALID_REQUEST=-32600,l.METHOD_NOT_FOUND=-32601,l.INVALID_PARAMS=-32602,l.INTERNAL_ERROR=-32603,l.URL_ELICITATION_REQUIRED=-32042))(Ob||={});function qL(r,e){return _e.toKey(r)+"/"+e}var AV;(e=>{function r(t,n){return t.id===n.id&&t.remoteAuthority===n.remoteAuthority&&t.label===n.label&&t.trustBehavior===n.trustBehavior}e.equals=r})(AV||={});var LV;(n=>{function r(o){return o}n.toSerialized=r;function e(o){return{id:o.id,label:o.label,cacheNonce:o.cacheNonce,staticMetadata:o.staticMetadata,launch:ad.fromSerialized(o.launch),variableReplacement:o.variableReplacement?GL.fromSerialized(o.variableReplacement):void 0}}n.fromSerialized=e;function t(o,i){return o.id===i.id&&o.label===i.label&&o.cacheNonce===i.cacheNonce&&Ht(o.roots,i.roots,(s,a)=>s.toString()===a.toString())&&Wt(o.launch,i.launch)&&Wt(o.presentation,i.presentation)&&Wt(o.variableReplacement,i.variableReplacement)&&Wt(o.devMode,i.devMode)}n.equals=t})(LV||={});var GL;(t=>{function r(n){return n}t.toSerialized=r;function e(n){return{section:n.section,folder:n.folder?{...n.folder,uri:y.revive(n.folder.uri)}:void 0,target:n.target}}t.fromSerialized=e})(GL||={});var OV;(e=>e.Empty={working:!1,starting:[],serversRequiringInteraction:[]})(OV||={});var $de=M("IMcpService");var NV;(e=>{let r;(s=>(s[s.Trusted=0]="Trusted",s[s.TrustedOnNonce=1]="TrustedOnNonce",s[s.Untrusted=2]="Untrusted",s[s.Unknown=3]="Unknown"))(r=e.Kind||={})})(NV||={});var ad;(n=>{function r(o){return o}n.toSerialized=r;function e(o){switch(o.type){case 2:return{type:o.type,uri:y.revive(o.uri),headers:o.headers,authentication:o.authentication};case 1:return{type:o.type,cwd:o.cwd,command:o.command,args:o.args,env:o.env,envFile:o.envFile}}}n.fromSerialized=e;async function t(o){let i=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(o)));return Um(ee.wrap(new Uint8Array(i)))}n.hash=t})(ad||={});var Hr;(i=>{let r;(c=>(c[c.Stopped=0]="Stopped",c[c.Starting=1]="Starting",c[c.Running=2]="Running",c[c.Error=3]="Error"))(r=i.Kind||={}),i.toString=s=>{switch(s.state){case 0:return p(14717,null);case 1:return p(14716,null);case 2:return p(14715,null);case 3:return p(14714,null,s.message);default:hc(s)}},i.toKindString=s=>{switch(s){case 0:return"stopped";case 1:return"starting";case 2:return"running";case 3:return"error";default:hc(s)}},i.canBeStarted=s=>s===3||s===0,i.isRunning=s=>!(0,i.canBeStarted)(s.state)})(Hr||={});var zg=class r extends Error{constructor(t){super(`${r.prefix}${t}`);this.reason=t}static{this.prefix="User interaction required: "}static is(t){return t.message.startsWith(this.prefix)}};var UV=M("IMcpWorkbenchService"),Nb=class extends H{constructor(t,n){super();this.containers=t;this._register(n.onChange(this.update,this))}set mcpServer(t){this.containers.forEach(n=>n.mcpServer=t)}update(t){for(let n of this.containers)t&&n.mcpServer?t.id===n.mcpServer.id&&(n.mcpServer=t):n.update()}};Nb=D([C(1,UV)],Nb);var zde=new w("mcpServersGalleryStatus","unavailable"),Kde=new w("hasInstalledMcpServers",!0);var FV;(o=>{o.scheme="mcp-resource";let e="dylo78gyp";function t(i,s){return typeof s=="string"&&(s=y.parse(s)),s.with({scheme:o.scheme,authority:Um(ee.fromString(i.id)),path:["",s.scheme,s.authority||e].join("/")+s.path})}o.fromServer=t;function n(i){if(typeof i=="string"&&(i=y.parse(i)),i.scheme!==o.scheme)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let s=i.path.split("/");if(s.length<3)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let[,a,l,...d]=s,c=new URL(`${a}://${l.toLowerCase()===e?"":l}`);return c.pathname=d.length?"/"+d.join("/"):"",c.search=i.query,c.hash=i.fragment,{definitionId:Z1(i.authority).toString(),resourceURL:c}}o.toServer=n})(FV||={});var qde=M("IMcpServerSampling");var Gde=M("IMcpElicitationService");var us="**",Hb="/",Ub="[/\\\\]",Fb="[^/\\\\]",HV=/\//g;function jL(r,e){switch(r){case 0:return"";case 1:return`${Fb}*?`;default:return`(?:${Ub}|${Fb}+${Ub}${e?`|${Ub}${Fb}+`:""})*?`}}function ou(r,e){if(!r)return[];let t=[],n=!1,o=!1,i="";for(let s of r){switch(s){case e:if(!n&&!o){t.push(i),i="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}i+=s}return i&&t.push(i),t}function ZL(r){if(!r)return"";let e="",t=ou(r,Hb);if(t.every(n=>n===us))e=".*";else{let n=!1;t.forEach((o,i)=>{if(o===us){if(n)return;e+=jL(2,i===t.length-1)}else{let s=!1,a="",l=!1,d="";for(let c of o){if(c!=="}"&&s){a+=c;continue}if(l&&(c!=="]"||!d)){let u;c==="-"?u=c:(c==="^"||c==="!")&&!d?u="^":c===Hb?u="":u=or(c),d+=u;continue}switch(c){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{let m=`(?:${ou(a,",").map(g=>ZL(g)).join("|")})`;e+=m,s=!1,a="";break}case"]":{e+="["+d+"]",l=!1,d="";break}case"?":e+=Fb;continue;case"*":e+=jL(1);continue;default:e+=or(c)}}i<t.length-1&&(t[i+1]!==us||i+2<t.length)&&(e+=Ub)}n=o===us})}return e}var VV=/^\*\*\/\*\.[\w\.-]+$/,BV=/^\*\*\/([\w\.-]+)\/?$/,WV=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,$V=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,zV=/^\*\*((\/[\w\.-]+)+)\/?$/,KV=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,QL=new Zo(1e4),JL=function(){return!1},vi=function(){return null};function Dk(r,e){if(!r)return vi;let t;typeof r!="string"?t=r.pattern:t=r,t=t.trim();let n=e.ignoreCase??!1,o={...e,equals:n?Nn:(l,d)=>l===d,endsWith:n?H0:(l,d)=>l.endsWith(d),isEqualOrParent:(l,d)=>Bl(l,d,!An||n)},i=`${n?t.toLowerCase():t}_${!!e.trimForExclusions}_${n}`,s=QL.get(i);if(s)return XL(s,r,o);let a;return VV.test(t)?s=qV(t.substring(4),t,o):(a=BV.exec(Pk(t,o)))?s=GV(a[1],t,o):(e.trimForExclusions?$V:WV).test(t)?s=jV(t,o):(a=zV.exec(Pk(t,o)))?s=YL(a[1].substring(1),t,!0,o):(a=KV.exec(Pk(t,o)))?s=YL(a[1],t,!1,o):s=QV(t,o),QL.set(i,s),XL(s,r,o)}function XL(r,e,t){if(typeof e=="string")return r;let n=function(o,i){return t.isEqualOrParent(o,e.base)?r(DT(o.substring(e.base.length),kn),i):null};return n.allBasenames=r.allBasenames,n.allPaths=r.allPaths,n.basenames=r.basenames,n.patterns=r.patterns,n}function Pk(r,e){return e.trimForExclusions&&r.endsWith("/**")?r.substring(0,r.length-2):r}function qV(r,e,t){return function(n,o){return typeof n=="string"&&t.endsWith(n,r)?e:null}}function GV(r,e,t){let n=`/${r}`,o=`\\${r}`,i=function(a,l){return typeof a!="string"?null:l?t.equals(l,r)?e:null:t.equals(a,r)||t.endsWith(a,n)||t.endsWith(a,o)?e:null},s=[r];return i.basenames=s,i.patterns=[e],i.allBasenames=s,i}function jV(r,e){let t=tO(r.slice(1,-1).split(",").map(a=>Dk(a,e)).filter(a=>a!==vi),r),n=t.length;if(!n)return vi;if(n===1)return t[0];let o=function(a,l){for(let d=0,c=t.length;d<c;d++)if(t[d](a,l))return r;return null},i=t.find(a=>!!a.allBasenames);i&&(o.allBasenames=i.allBasenames);let s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function YL(r,e,t,n){let o=kn===Le.sep,i=o?r:r.replace(HV,kn),s=kn+i,a=Le.sep+r,l;return t?l=function(d,c){return typeof d=="string"&&(n.equals(d,i)||n.endsWith(d,s)||!o&&(n.equals(d,r)||n.endsWith(d,a)))?e:null}:l=function(d,c){return typeof d=="string"&&(n.equals(d,i)||!o&&n.equals(d,r))?e:null},l.allPaths=[(t?"*/":"./")+r],l}function QV(r,e){try{let t=new RegExp(`^${ZL(r)}$`,e.ignoreCase?"i":void 0);return function(n){return t.lastIndex=0,typeof n=="string"&&t.test(n)?r:null}}catch{return vi}}function Vr(r,e,t){return!r||typeof e!="string"?!1:Br(r,t)(e)}function Br(r,e={}){if(!r)return JL;if(typeof r=="string"||eO(r)){let t=Dk(r,e);if(t===vi)return JL;let n=function(o,i){return!!t(o,i)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return JV(r,e)}function eO(r){let e=r;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function JV(r,e){let t=tO(Object.getOwnPropertyNames(r).map(a=>XV(a,r[a],e)).filter(a=>a!==vi)),n=t.length;if(!n)return vi;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];let a=function(c,u){let m;for(let g=0,v=t.length;g<v;g++){let h=t[g](c,u);if(typeof h=="string")return h;ir(h)&&(m||(m=[]),m.push(h))}return m?(async()=>{for(let g of m){let v=await g;if(typeof v=="string")return v}return null})():null},l=t.find(c=>!!c.allBasenames);l&&(a.allBasenames=l.allBasenames);let d=t.reduce((c,u)=>u.allPaths?c.concat(u.allPaths):c,[]);return d.length&&(a.allPaths=d),a}let o=function(a,l,d){let c,u;for(let m=0,g=t.length;m<g;m++){let v=t[m];v.requiresSiblings&&d&&(l||(l=dn(a)),c||(c=l.substring(0,l.length-Yi(a).length)));let h=v(a,l,c,d);if(typeof h=="string")return h;ir(h)&&(u||(u=[]),u.push(h))}return u?(async()=>{for(let m of u){let g=await m;if(typeof g=="string")return g}return null})():null},i=t.find(a=>!!a.allBasenames);i&&(o.allBasenames=i.allBasenames);let s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function XV(r,e,t){if(e===!1)return vi;let n=Dk(r,t);if(n===vi)return vi;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let i=(s,a,l,d)=>{if(!d||!n(s,a))return null;let c=o.replace("$(basename)",()=>l),u=d(c);return ir(u)?u.then(m=>m?r:null):u?r:null};return i.requiresSiblings=!0,i}}return n}function tO(r,e){let t=r.filter(a=>!!a.basenames);if(t.length<2)return r;let n=t.reduce((a,l)=>{let d=l.basenames;return d?a.concat(d):a},[]),o;if(e){o=[];for(let a=0,l=n.length;a<l;a++)o.push(e)}else o=t.reduce((a,l)=>{let d=l.patterns;return d?a.concat(d):a},[]);let i=function(a,l){if(typeof a!="string")return null;if(!l){let c;for(c=a.length;c>0;c--){let u=a.charCodeAt(c-1);if(u===47||u===92)break}l=a.substring(c)}let d=n.indexOf(l);return d!==-1?o[d]:null};i.basenames=n,i.patterns=o,i.allBasenames=n;let s=r.filter(a=>!a.basenames);return s.push(i),s}var YV=M("notebookDocumentService"),Rk=["W","X","Y","Z","a","b","c","d","e","f"],ZV=new RegExp(`^[${Rk.join("")}]+`),nO=7;function Vb(r){if(r.scheme!==$.vscodeNotebookCell)return;let e=r.fragment.indexOf("s");if(e<0)return;let t=parseInt(r.fragment.substring(0,e).replace(ZV,""),nO),n=No(r.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:r.with({scheme:n,fragment:null})}}function oO(r,e){let t=e.toString(nO),o=`${t.length<Rk.length?Rk[t.length-1]:"z"}${t}s${er(ee.fromString(r.scheme),!0,!0)}`;return r.with({scheme:$.vscodeNotebookCell,fragment:o})}function rO(r){if(r.scheme!==$.vscodeNotebookMetadata)return;let e=No(r.fragment).toString();return r.with({scheme:e,fragment:null})}function iO(r){let e=`${er(ee.fromString(r.scheme),!0,!0)}`;return r.with({scheme:$.vscodeNotebookMetadata,fragment:e})}function Ak(r){if(r.scheme!==$.vscodeNotebookCellOutput)return;let e=new URLSearchParams(r.query),t=e.get("openIn");if(!t)return;let n=e.get("outputId")??void 0,o=Vb(r.with({scheme:$.vscodeNotebookCell,query:null})),i=e.get("outputIndex")?parseInt(e.get("outputIndex")||"",10):void 0,s=o?o.notebook:r.with({scheme:e.get("notebookScheme")||$.file,fragment:null,query:null}),a=e.get("cellIndex")?parseInt(e.get("cellIndex")||"",10):void 0;return{notebook:s,openIn:t,outputId:n,outputIndex:i,cellHandle:o?.handle,cellFragment:r.fragment,cellIndex:a}}var Mk=class{constructor(){this._documents=new qe}getNotebook(e){if(e.scheme===$.vscodeNotebookCell){let t=Vb(e);if(t){let n=this._documents.get(t.notebook);if(n)return n}}if(e.scheme===$.vscodeNotebookCellOutput){let t=Ak(e);if(t){let n=this._documents.get(t.notebook);if(n)return n}}return this._documents.get(e)}addNotebookDocument(e){this._documents.set(e.uri,e)}removeNotebookDocument(e){this._documents.delete(e.uri)}};Qe(YV,Mk,1);var bce=["application/json","application/javascript","text/html","image/svg+xml",eo.latex,eo.markdown,"image/png","image/jpeg",eo.text],yce=[eo.latex,eo.markdown,"application/json","text/html","image/svg+xml","image/png","image/jpeg",eo.text];var e5;(n=>{n.scheme=$.vscodeNotebookMetadata;function e(o){return iO(o)}n.generate=e;function t(o){return rO(o)}n.parse=t})(e5||={});var Ok;(d=>{d.scheme=$.vscodeNotebookCell;function e(c,u){return oO(c,u)}d.generate=e;function t(c){return Vb(c)}d.parse=t;function n(c,u){return c.with({scheme:$.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"editor",outputId:u??"",notebookScheme:c.scheme!==$.file?c.scheme:""}).toString()})}d.generateCellOutputUriWithId=n;function o(c,u,m){return c.with({scheme:$.vscodeNotebookCellOutput,fragment:u.fragment,query:new URLSearchParams({openIn:"notebook",outputIndex:String(m)}).toString()})}d.generateCellOutputUriWithIndex=o;function i(c,u,m,g,v){return c.with({scheme:$.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"notebookOutputEditor",notebook:c.toString(),cellIndex:String(m),outputId:g,outputIndex:String(v)}).toString()})}d.generateOutputEditorUri=i;function s(c){return Ak(c)}d.parseCellOutputUri=s;function a(c,u,m){return d.generate(c,u).with({scheme:m})}d.generateCellPropertyUri=a;function l(c,u){if(c.scheme===u)return d.parse(c.with({scheme:d.scheme}))}d.parseCellPropertyUri=l})(Ok||={});var Ice=new w("notebookEditorCursorAtBoundary","none"),xce=new w("notebookEditorCursorAtLineBoundary","none");var sO=class r{static{this._prefix="notebook/"}static create(e,t){return`${r._prefix}${e}/${t??e}`}static parse(e){if(e.startsWith(r._prefix)){let t=e.substring(r._prefix.length).split("/");if(t.length===2)return{notebookType:t[0],viewType:t[1]}}}},t5=new TextDecoder;function aO(r){let e=[],t=!1;for(let s of r)(e.length===0||t)&&(e.push(s),t=!0);let n=o5(e),o=ee.concat(e.map(s=>ee.wrap(s))),i=l5(o);return n=n||i.byteLength!==o.byteLength,{data:i,didCompression:n}}var Bb="\x1B[A",Lk=Bb.split("").map(r=>r.charCodeAt(0)),n5=10;function o5(r){let e=!1;return r.forEach((t,n)=>{if(n===0||t.length<Bb.length)return;let o=r[n-1],i=t.subarray(0,Bb.length);if(i[0]===Lk[0]&&i[1]===Lk[1]&&i[2]===Lk[2]){let s=o.lastIndexOf(n5);if(s===-1)return;e=!0,r[n-1]=o.subarray(0,s),r[n]=t.subarray(Bb.length)}}),e}function r5(r){let e=r;do r=e,e=r.replace(/[^\n]\x08/gm,"");while(e.length<r.length);return r}function i5(r){for(r=r.replace(/\r+\n/gm,`
`);r.search(/\r[^$]/g)>-1;){let e=r.match(/^(.*)\r+/m)[1],t=r.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),r=r.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return r}var s5=8,a5=13;function l5(r){return!r.buffer.includes(s5)&&!r.buffer.includes(a5)?r:ee.fromString(i5(r5(t5.decode(r.buffer))))}var Cce=M("scm");var Tce=M("scmView");var ze=class r{constructor(e,t=e.length){this.path=e;this.viewEnd=t;if(e.length===0||t<1)throw new Error("cannot create test with empty path")}static fromExtHostTestItem(e,t,n=e.parent){if(e._isRoot)return new r([t]);let o=[e.id];for(let i=n;i&&i.id!==t;i=i.parent)o.push(i.id);return o.push(t),new r(o.reverse())}static isRoot(e){return!e.includes("\0")}static root(e){let t=e.indexOf("\0");return t===-1?e:e.slice(0,t)}static fromString(e){return new r(e.split("\0"))}static join(e,t){return new r([...e.path,t])}static split(e){return e.split("\0")}static joinToString(e,t){return e.toString()+"\0"+t}static parentId(e){let t=e.lastIndexOf("\0");return t===-1?void 0:e.slice(0,t)}static localId(e){let t=e.lastIndexOf("\0");return t===-1?e:e.slice(t+1)}static isChild(e,t){return t[e.length]==="\0"&&t.startsWith(e)}static compare(e,t){return e===t?0:r.isChild(e,t)?2:r.isChild(t,e)?3:1}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let n=0;for(;n<e-1;){for(let o=1;o<e;o++){let i=t(o-1),s=t(o);if(i.path[n]!==s.path[n])return n}n++}return n}get rootId(){return new r(this.path,1)}get parentId(){return this.viewEnd>1?new r(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let e=1;e<=this.viewEnd;e++)yield new r(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new r(this.path,e)}compare(e){if(typeof e=="string")return r.compare(this.toString(),e);for(let t=0;t<e.viewEnd&&t<this.viewEnd;t++)if(e.path[t]!==this.path[t])return 1;return e.viewEnd>this.viewEnd?2:e.viewEnd<this.viewEnd?3:0}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let e=1;e<this.viewEnd;e++)this.stringifed+="\0",this.stringifed+=this.path[e]}return this.stringifed}};var Oce={2:p(18625,null),4:p(18624,null),8:p(18623,null)};var dO=r=>"runId"in r,qg;(t=>(t.serialize=n=>({range:n.range.toJSON(),uri:n.uri.toJSON()}),t.deserialize=(n,o)=>({range:Oe.lift(o.range),uri:n.asCanonicalUri(y.revive(o.uri))})))(qg||={});var Nk;(t=>(t.serialize=n=>({label:n.label,uri:n.uri?.toJSON(),position:n.position?.toJSON()}),t.deserialize=(n,o)=>({label:o.label,uri:o.uri?n.asCanonicalUri(y.revive(o.uri)):void 0,position:o.position?sn.lift(o.position):void 0})))(Nk||={});var Uk;(t=>(t.serialize=n=>({message:n.message,type:0,expected:n.expected,actual:n.actual,contextValue:n.contextValue,location:n.location&&qg.serialize(n.location),stackTrace:n.stackTrace?.map(Nk.serialize)}),t.deserialize=(n,o)=>({message:o.message,type:0,expected:o.expected,actual:o.actual,contextValue:o.contextValue,location:o.location&&qg.deserialize(n,o.location),stackTrace:o.stackTrace&&o.stackTrace.map(i=>Nk.deserialize(n,i))})))(Uk||={});var Fk;(t=>(t.serialize=n=>({message:n.message,type:1,offset:n.offset,length:n.length,location:n.location&&qg.serialize(n.location)}),t.deserialize=(n,o)=>({message:o.message,type:1,offset:o.offset,length:o.length,location:o.location&&qg.deserialize(n,o.location)})))(Fk||={});var Hk;(n=>(n.serialize=o=>o.type===0?Uk.serialize(o):Fk.serialize(o),n.deserialize=(o,i)=>i.type===0?Uk.deserialize(o,i):Fk.deserialize(o,i),n.isDiffable=o=>o.type===0&&o.actual!==void 0&&o.expected!==void 0))(Hk||={});var Wb;(n=>(n.serializeWithoutMessages=o=>({state:o.state,duration:o.duration,messages:[]}),n.serialize=o=>({state:o.state,duration:o.duration,messages:o.messages.map(Hk.serialize)}),n.deserialize=(o,i)=>({state:i.state,duration:i.duration,messages:i.messages.map(s=>Hk.deserialize(o,s))})))(Wb||={});var cO="\0",ru=(r,e)=>r+cO+e,Kb=r=>{let e=r.indexOf(cO);return{ctrlId:r.slice(0,e),tagId:r.slice(e+1)}},Vk;(t=>(t.serialize=n=>({extId:n.extId,label:n.label,tags:n.tags,busy:n.busy,children:void 0,uri:n.uri?.toJSON(),range:n.range?.toJSON()||null,description:n.description,error:n.error,sortText:n.sortText}),t.deserialize=(n,o)=>({extId:o.extId,label:o.label,tags:o.tags,busy:o.busy,children:void 0,uri:o.uri?n.asCanonicalUri(y.revive(o.uri)):void 0,range:o.range?Oe.lift(o.range):null,description:o.description,error:o.error,sortText:o.sortText})))(Vk||={});var ld;(t=>(t.serialize=n=>({expand:n.expand,item:Vk.serialize(n.item)}),t.deserialize=(n,o)=>({controllerId:ze.root(o.item.extId),expand:o.expand,item:Vk.deserialize(n,o.item)})))(ld||={});var $b;(t=>(t.serialize=n=>{let o;return n.item&&(o={},n.item.label!==void 0&&(o.label=n.item.label),n.item.tags!==void 0&&(o.tags=n.item.tags),n.item.busy!==void 0&&(o.busy=n.item.busy),n.item.uri!==void 0&&(o.uri=n.item.uri?.toJSON()),n.item.range!==void 0&&(o.range=n.item.range?.toJSON()),n.item.description!==void 0&&(o.description=n.item.description),n.item.error!==void 0&&(o.error=n.item.error),n.item.sortText!==void 0&&(o.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:o}},t.deserialize=n=>{let o;return n.item&&(o={},n.item.label!==void 0&&(o.label=n.item.label),n.item.tags!==void 0&&(o.tags=n.item.tags),n.item.busy!==void 0&&(o.busy=n.item.busy),n.item.range!==void 0&&(o.range=n.item.range?Oe.lift(n.item.range):null),n.item.description!==void 0&&(o.description=n.item.description),n.item.error!==void 0&&(o.error=n.item.error),n.item.sortText!==void 0&&(o.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:o}}))($b||={});var qb=(r,e)=>{e.expand!==void 0&&(r.expand=e.expand),e.item!==void 0&&(r.item=r.item?Object.assign(r.item,e.item):e.item)},d5;(n=>(n.serializeWithoutMessages=o=>({...ld.serialize(o),ownComputedState:o.ownComputedState,computedState:o.computedState,tasks:o.tasks.map(Wb.serializeWithoutMessages)}),n.serialize=o=>({...ld.serialize(o),ownComputedState:o.ownComputedState,computedState:o.computedState,tasks:o.tasks.map(Wb.serialize)}),n.deserialize=(o,i)=>({...ld.deserialize(o,i),ownComputedState:i.ownComputedState,computedState:i.computedState,tasks:i.tasks.map(s=>Wb.deserialize(o,s)),retired:!0})))(d5||={});var uO;(t=>(t.empty=()=>({covered:0,total:0}),t.sum=(n,o)=>{n.covered+=o.covered,n.total+=o.total}))(uO||={});var c5;(n=>(n.serialize=o=>({id:o.id,statement:o.statement,branch:o.branch,declaration:o.declaration,testIds:o.testIds,uri:o.uri.toJSON()}),n.deserialize=(o,i)=>({id:i.id,statement:i.statement,branch:i.branch,declaration:i.declaration,testIds:i.testIds,uri:o.asCanonicalUri(y.revive(i.uri))}),n.empty=(o,i)=>({id:o,uri:i,statement:uO.empty()})))(c5||={});function zk(r){return{...r,location:r.location?.toJSON()}}function Kk(r){return r.location=r.location?sn.isIPosition(r.location)?sn.lift(r.location):Oe.lift(r.location):void 0,r}var u5;(t=>(t.serialize=n=>n.type===0?Wk.serialize(n):$k.serialize(n),t.deserialize=n=>n.type===0?Wk.deserialize(n):$k.deserialize(n)))(u5||={});var Bk;(t=>(t.serialize=zk,t.deserialize=Kk))(Bk||={});var Wk;(t=>(t.serialize=zk,t.deserialize=Kk))(Wk||={});var $k;(t=>(t.serialize=n=>({...zk(n),branches:n.branches?.map(Bk.serialize)}),t.deserialize=n=>({...Kk(n),branches:n.branches?.map(Bk.deserialize)})))($k||={});var Gb;(t=>(t.deserialize=(n,o)=>o.op===0?{op:o.op,item:ld.deserialize(n,o.item)}:o.op===1?{op:o.op,item:$b.deserialize(o.item)}:o.op===2?{op:o.op,uri:n.asCanonicalUri(y.revive(o.uri)),docv:o.docv}:o,t.serialize=n=>n.op===0?{op:n.op,item:ld.serialize(n.item)}:n.op===1?{op:n.op,item:$b.serialize(n.item)}:n))(Gb||={});var zb=class{constructor(e){this.uriIdentity=e;this._tags=new Map;this.items=new Map;this.roots=new Set;this.busyControllerCount=0;this.pendingRootCount=0;this.tags=this._tags}apply(e){let t=this.createChangeCollector();for(let n of e)switch(n.op){case 0:this.add(ld.deserialize(this.uriIdentity,n.item),t);break;case 1:this.update($b.deserialize(n.item),t);break;case 3:this.remove(n.itemId,t);break;case 5:this.retireTest(n.itemId);break;case 4:this.updatePendingRoots(n.amount);break;case 6:this._tags.set(n.tag.id,n.tag);break;case 7:this._tags.delete(n.id);break}t.complete?.()}add(e,t){let n=ze.parentId(e.item.extId)?.toString(),o;if(!n)o=this.createItem(e),this.roots.add(o),this.items.set(e.item.extId,o);else if(this.items.has(n)){let i=this.items.get(n);i.children.add(e.item.extId),o=this.createItem(e,i),this.items.set(e.item.extId,o)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(o),e.expand===2&&this.busyControllerCount++,o}update(e,t){let n=this.items.get(e.extId);if(n)return e.expand!==void 0&&(n.expand===2&&this.busyControllerCount--,e.expand===2&&this.busyControllerCount++),qb(n,e),t.update?.(n),n}remove(e,t){let n=this.items.get(e);if(!n)return;let o=ze.parentId(n.item.extId)?.toString();o?this.items.get(o).children.delete(n.item.extId):this.roots.delete(n);let i=[[e]];for(;i.length;)for(let s of i.pop()){let a=this.items.get(s);a&&(i.push(a.children),this.items.delete(s),t.remove?.(a,a!==n),a.expand===2&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}};var Fce=M("IAiSettingsSearchService");var Gg=(r,e)=>r===e,p5={range:(r,e)=>r===e?!0:!r||!e?!1:r.equalsRange(e),busy:Gg,label:Gg,description:Gg,error:Gg,sortText:Gg,tags:(r,e)=>!(r.length!==e.length||r.some(t=>!e.includes(t)))},m5=Object.entries(p5),g5=(r,e)=>{let t;for(let[n,o]of m5)o(r[n],e[n])||(t?t[n]=e[n]:t={[n]:e[n]});return t},jb=class extends H{constructor(t){super();this.options=t;this.debounceSendDiff=this._register(new Xn(()=>this.flushDiff(),200));this.diffOpEmitter=this._register(new E);this.tree=new Map;this.tags=new Map;this.diff=[];this.onDidGenerateDiff=this.diffOpEmitter.event;this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}get root(){return this.options.root}set resolveHandler(t){this._resolveHandler=t;for(let n of this.tree.values())this.updateExpandability(n)}get resolveHandler(){return this._resolveHandler}collectDiff(){let t=this.diff;return this.diff=[],t}pushDiff(t){switch(t.op){case 2:{for(let n of this.diff)if(n.op===2&&n.uri===t.uri){n.docv=t.docv;return}break}case 1:{let n=this.diff[this.diff.length-1];if(n){if(n.op===1&&n.item.extId===t.item.extId){qb(n.item,t.item);return}if(n.op===0&&n.item.item.extId===t.item.extId){qb(n.item,t.item);return}}break}}this.diff.push(t),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(t,n){let o=this.tree.get(t);if(o){if((o.expandLevels===void 0||n>o.expandLevels)&&(o.expandLevels=n),o.expand===1){let i=this.resolveChildren(o);return i.isOpen()?this.expandChildren(o,n-1):i.wait().then(()=>this.expandChildren(o,n-1))}else if(o.expand===3)return o.resolveBarrier?.isOpen()===!1?o.resolveBarrier.wait().then(()=>this.expandChildren(o,n-1)):this.expandChildren(o,n-1)}}dispose(){for(let t of this.tree.values())this.options.getApiFor(t.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(t,n){switch(n.op){case 3:this.removeItem(ze.joinToString(t.fullId,n.id));break;case 0:this.upsertItem(n.item,t);break;case 5:for(let o of n.ops)this.onTestItemEvent(t,o);break;case 1:this.diffTagRefs(n.new,n.old,t.fullId.toString());break;case 2:this.updateExpandability(t);break;case 4:this.pushDiff({op:1,item:{extId:t.fullId.toString(),item:n.update}});break;case 6:this.documentSynced(t.actual.uri);break;default:hc(n)}}documentSynced(t){t&&this.pushDiff({op:2,uri:t,docv:this.options.getDocumentVersion(t)})}upsertItem(t,n){let o=ze.fromExtHostTestItem(t,this.root.id,n?.actual),i=this.options.getApiFor(t);i.parent&&i.parent!==n?.actual&&this.options.getChildren(i.parent).delete(t.id);let s=this.tree.get(o.toString());if(!s){s={fullId:o,actual:t,expandLevels:n?.expandLevels?n.expandLevels-1:void 0,expand:0},t.tags.forEach(this.incrementTagRefs,this),this.tree.set(s.fullId.toString(),s),this.setItemParent(t,n),this.pushDiff({op:0,item:{controllerId:this.options.controllerId,expand:s.expand,item:this.options.toITestItem(t)}}),this.connectItemAndChildren(t,s,n);return}if(s.actual===t){this.connectItem(t,s,n);return}if(s.actual.uri?.toString()!==t.uri?.toString())return this.removeItem(o.toString()),this.upsertItem(t,n);let a=this.options.getChildren(s.actual),l=s.actual,d=g5(this.options.toITestItem(l),this.options.toITestItem(t));this.options.getApiFor(l).listener=void 0,s.actual=t,s.resolveBarrier=void 0,s.expand=0,d&&(d.hasOwnProperty("tags")&&(this.diffTagRefs(t.tags,l.tags,o.toString()),delete d.tags),this.onTestItemEvent(s,{op:4,update:d})),this.connectItemAndChildren(t,s,n);for(let[u,m]of a)this.options.getChildren(t).get(m.id)||this.removeItem(ze.joinToString(o,m.id));let c=s.expandLevels;c!==void 0&&queueMicrotask(()=>{s.expand===1&&(s.expandLevels=void 0,this.expand(o.toString(),c))}),this.documentSynced(s.actual.uri)}diffTagRefs(t,n,o){let i=new Set(n.map(s=>s.id));for(let s of t)i.delete(s.id)||this.incrementTagRefs(s);this.pushDiff({op:1,item:{extId:o,item:{tags:t.map(s=>ru(this.options.controllerId,s.id))}}}),i.forEach(this.decrementTagRefs,this)}incrementTagRefs(t){let n=this.tags.get(t.id);n?n.refCount++:(this.tags.set(t.id,{refCount:1}),this.pushDiff({op:6,tag:{id:ru(this.options.controllerId,t.id)}}))}decrementTagRefs(t){let n=this.tags.get(t);n&&!--n.refCount&&(this.tags.delete(t),this.pushDiff({op:7,id:ru(this.options.controllerId,t)}))}setItemParent(t,n){this.options.getApiFor(t).parent=n&&n.actual!==this.root?n.actual:void 0}connectItem(t,n,o){this.setItemParent(t,o);let i=this.options.getApiFor(t);i.parent=o?.actual,i.listener=s=>this.onTestItemEvent(n,s),this.updateExpandability(n)}connectItemAndChildren(t,n,o){this.connectItem(t,n,o);for(let[i,s]of this.options.getChildren(t))this.upsertItem(s,n)}updateExpandability(t){let n;this._resolveHandler?t.resolveBarrier?n=t.resolveBarrier.isOpen()?3:2:n=t.actual.canResolveChildren?1:0:n=0,n!==t.expand&&(t.expand=n,this.pushDiff({op:1,item:{extId:t.fullId.toString(),expand:n}}),n===1&&t.expandLevels!==void 0&&this.resolveChildren(t))}expandChildren(t,n){if(n<0)return;let o=[];for(let[i,s]of this.options.getChildren(t.actual)){let a=this.expand(ze.joinToString(t.fullId,s.id),n);ir(a)&&o.push(a)}if(o.length)return Promise.all(o).then(()=>{})}resolveChildren(t){if(t.resolveBarrier)return t.resolveBarrier;if(!this._resolveHandler){let s=new yn;return s.open(),s}t.expand=2,this.pushExpandStateUpdate(t);let n=t.resolveBarrier=new yn,o=s=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,s)},i;try{i=this._resolveHandler(t.actual===this.root?void 0:t.actual)}catch(s){o(s)}return ir(i)?i.catch(o).then(()=>{n.open(),this.updateExpandability(t)}):(n.open(),this.updateExpandability(t)),t.resolveBarrier}pushExpandStateUpdate(t){this.pushDiff({op:1,item:{extId:t.fullId.toString(),expand:t.expand}})}removeItem(t){let n=this.tree.get(t);if(!n)throw new Error("attempting to remove non-existent child");this.pushDiff({op:3,itemId:t});let o=[n];for(;o.length;){let i=o.pop();if(i){this.options.getApiFor(i.actual).listener=void 0;for(let s of i.actual.tags)this.decrementTagRefs(s.id);this.tree.delete(i.fullId.toString());for(let[s,a]of this.options.getChildren(i.actual))o.push(this.tree.get(ze.joinToString(i.fullId,a.id)))}}}flushDiff(){let t=this.collectDiff();t.length&&this.diffOpEmitter.fire(t)}},qk=class extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}},Ca=class extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}},Gk=class extends Error{constructor(e,t,n){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${n}".`)}},pO=(r,e,t)=>{let n=new Map;return{get size(){return n.size},forEach(o,i){for(let s of n.values())o.call(i,s,this)},[Symbol.iterator](){return n.entries()},replace(o){let i=new Map,s=new Set(n.keys()),a={op:5,ops:[]};for(let l of o){if(!(l instanceof t))throw new Ca(l.id);let d=e(l).controllerId;if(d!==r.controllerId)throw new Gk(l.id,d,r.controllerId);if(i.has(l.id))throw new qk(l.id);i.set(l.id,l),s.delete(l.id),a.ops.push({op:0,item:l})}for(let l of s.keys())a.ops.push({op:3,id:l});r.listener?.(a),n=i},add(o){if(!(o instanceof t))throw new Ca(o.id);n.set(o.id,o),r.listener?.({op:0,item:o})},delete(o){n.delete(o)&&r.listener?.({op:3,id:o})},get(o){return n.get(o)},toJSON(){return Array.from(n.values())}}};var mO=new WeakMap,gO=(r,e)=>{let t={controllerId:e};return mO.set(r,t),t},iu=r=>{let e=mO.get(r);if(!e)throw new Ca(r?.id||"<unknown>");return e};var rue=M("remoteAuthorityResolverService");var Qb=class{constructor(e){this.id=e;this.type=1}toString(){return`Managed(${this.id})`}},Jb=class{constructor(e,t){this.host=e;this.port=t;this.type=0}toString(){return`WebSocket(${this.host}:${this.port})`}};function jk(r){let e=r.indexOf("+");return e===-1?r:r.substring(0,e)}function de(r){return Object.assign(r,{apply:function(...t){if(t.length===0)return Reflect.construct(r,[]);{let n=t.length===1?[]:t[1];return Reflect.construct(r,n,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(r,[]);{let[n,...o]=t;return Reflect.construct(r,o,n.constructor)}}})}var Dn,Mt=class{constructor(e,t=!1){cc(this,Dn);Tm(this,Dn,new fo(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof Mt?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Gt(this,Dn).value}set value(e){Gt(this,Dn).value=e}get isTrusted(){return Gt(this,Dn).isTrusted}set isTrusted(e){Gt(this,Dn).isTrusted=e}get supportThemeIcons(){return Gt(this,Dn).supportThemeIcons}set supportThemeIcons(e){Gt(this,Dn).supportThemeIcons=e}get supportHtml(){return Gt(this,Dn).supportHtml}set supportHtml(e){Gt(this,Dn).supportHtml=e}get supportAlertSyntax(){return Gt(this,Dn).supportAlertSyntax}set supportAlertSyntax(e){Gt(this,Dn).supportAlertSyntax=e}get baseUri(){return Gt(this,Dn).baseUri}set baseUri(e){Gt(this,Dn).baseUri=e}appendText(e){return Gt(this,Dn).appendText(e),this}appendMarkdown(e){return Gt(this,Dn).appendMarkdown(e),this}appendCodeblock(e,t){return Gt(this,Dn).appendCodeblock(t??"",e),this}};Dn=new WeakMap,Mt=D([de],Mt);var Ie=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let n=1;n<e.length;n++){let o=e[n];o.isBefore(t)&&(t=o)}return t}static Max(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let n=1;n<e.length;n++){let o=e[n];o.isAfter(t)&&(t=o)}return t}static isPosition(e){if(!e)return!1;if(e instanceof Ie)return!0;let{line:t,character:n}=e;return typeof t=="number"&&typeof n=="number"}static of(e){if(e instanceof Ie)return e;if(this.isPosition(e))return new Ie(e.line,e.character);throw new Error("Invalid argument, is NOT a position-like object")}get line(){return this._line}get character(){return this._character}constructor(e,t){if(e<0)throw De("line must be non-negative");if(t<0)throw De("character must be non-negative");this._line=e,this._character=t}isBefore(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<e._character}isBeforeOrEqual(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<=e._character}isAfter(e){return!this.isBeforeOrEqual(e)}isAfterOrEqual(e){return!this.isBefore(e)}isEqual(e){return this._line===e._line&&this._character===e._character}compareTo(e){return this._line<e._line?-1:this._line>e.line?1:this._character<e._character?-1:this._character>e._character?1:0}translate(e,t=0){if(e===null||t===null)throw De();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&t===0?this:new Ie(this.line+n,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw De();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),n===this.line&&t===this.character?this:new Ie(n,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Ie=D([de],Ie);var pe=class{static isRange(e){return e instanceof pe?!0:!e||typeof e!="object"?!1:Ie.isPosition(e.start)&&Ie.isPosition(e.end)}static of(e){if(e instanceof pe)return e;if(this.isRange(e))return new pe(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,n,o){let i,s;if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number"?(i=new Ie(e,t),s=new Ie(n,o)):Ie.isPosition(e)&&Ie.isPosition(t)&&(i=Ie.of(e),s=Ie.of(t)),!i||!s)throw new Error("Invalid arguments");i.isBefore(s)?(this._start=i,this._end=s):(this._start=s,this._end=i)}contains(e){return pe.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ie.isPosition(e)?!(Ie.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let t=Ie.Max(e.start,this._start),n=Ie.Min(e.end,this._end);if(!t.isAfter(n))return new pe(t,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let t=Ie.Min(e.start,this._start),n=Ie.Max(e.end,this.end);return new pe(t,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw De();let n;return e?Ie.isPosition(e)?n=e:(n=e.start||this.start,t=e.end||this.end):n=this.start,n.isEqual(this._start)&&t.isEqual(this.end)?this:new pe(n,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Qk(this)}};pe=D([de],pe);function Qk(r){return r.isEmpty?`[${r.start.line}:${r.start.character})`:`[${r.start.line}:${r.start.character} -> ${r.end.line}:${r.end.character})`}var at=class{constructor(e){this.value=e}append(e){return new at(this.value?this.value+at.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+at.sep)}};at.sep=".",at=D([de],at);at.Empty=new at("");at.QuickFix=at.Empty.append("quickfix");at.Refactor=at.Empty.append("refactor");at.RefactorExtract=at.Refactor.append("extract");at.RefactorInline=at.Refactor.append("inline");at.RefactorMove=at.Refactor.append("move");at.RefactorRewrite=at.Refactor.append("rewrite");at.Source=at.Empty.append("source");at.SourceOrganizeImports=at.Source.append("organizeImports");at.SourceFixAll=at.Source.append("fixAll");at.Notebook=at.Empty.append("notebook");var jg=(t=>(t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated",t))(jg||{}),dd=(o=>(o[o.Hint=3]="Hint",o[o.Information=2]="Information",o[o.Warning=1]="Warning",o[o.Error=0]="Error",o))(dd||{}),bi=class{static is(e){return e?typeof e.message=="string"&&e.location&&pe.isRange(e.location.range)&&y.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};bi=D([de],bi);var ps=class{constructor(e,t,n=0){if(!pe.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=n}toJSON(){return{severity:dd[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&Ht(e.tags,t.tags)&&Ht(e.relatedInformation,t.relatedInformation,bi.isEqual)}};ps=D([de],ps);var At=class{static isLocation(e){return e instanceof At?!0:e?pe.isRange(e.range)&&y.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(pe.isRange(t))this.range=pe.of(t);else if(Ie.isPosition(t))this.range=new pe(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};At=D([de],At);var Qg=(t=>(t[t.Markup=1]="Markup",t[t.Code=2]="Code",t))(Qg||{}),Rn=class r{static isNotebookRange(e){return e instanceof r?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw De("start must be positive");if(t<0)throw De("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,n=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(n=e.end),t===this._start&&n===this._end?this:new r(t,n)}},yi=class r{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>r.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,n,o,i,s,a){this.kind=e,this.value=t,this.languageId=n,this.mime=o,this.outputs=i??[],this.metadata=s,this.executionSummary=a,r.validate(this)}},cd=class{constructor(e){this.cells=e}},ro=class{static isNotebookCellEdit(e){return e instanceof ro?!0:e?Rn.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new ro(e,t)}static insertCells(e,t){return new ro(new Rn(e,e),t)}static deleteCells(e){return new ro(e,[])}static updateCellMetadata(e,t){let n=new ro(new Rn(e,e),[]);return n.newCellMetadata=t,n}static updateNotebookMetadata(e){let t=new ro(new Rn(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};ro=D([de],ro);var ud=class r{constructor(e,t){this.data=e;this.mime=t;let n=kE(t,!0);if(!n)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}static isNotebookCellOutputItem(e){return e instanceof r?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let t={name:e.name,message:e.message,stack:e.stack};return r.json(t,"application/vnd.code.notebook.error")}static stdout(e){return r.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return r.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new r(e,t)}static#e=new TextEncoder;static text(e,t=eo.text){let n=r.#e.encode(String(e));return new r(n,t)}static json(e,t="text/x-json"){let n=JSON.stringify(e,void 0,"	");return r.text(n,t)}},Ii=class r{static isNotebookCellOutput(e){return e instanceof r?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){let n=new Set,o=new Set;for(let i=0;i<e.length;i++){let s=e[i],a=kE(s.mime);if(!n.has(a)||zv(a)){n.add(a);continue}o.add(i),t&&console.warn(`DUPLICATED mime type '${s.mime}' will be dropped`)}return o.size===0?e:e.filter((i,s)=>!o.has(s))}constructor(e,t,n){this.items=r.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=n):(this.id=pt(),this.metadata=t??n)}};var xn=class extends pe{static isSelection(e){return e instanceof xn?!0:!e||typeof e!="object"?!1:pe.isRange(e)&&Ie.isPosition(e.anchor)&&Ie.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,n,o){let i,s;if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number"?(i=new Ie(e,t),s=new Ie(n,o)):Ie.isPosition(e)&&Ie.isPosition(t)&&(i=Ie.of(e),s=Ie.of(t)),!i||!s)throw new Error("Invalid arguments");super(i,s),this._anchor=i,this._active=s}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return f5(this)}};xn=D([de],xn);function f5(r){let e=Qk(r);return r.isEmpty||(r.active.isEqual(r.start)?e=`|${e}`:e=`${e}|`),e}var Sn=class{constructor(e){this._tabstop=1;this.value=e||""}static isSnippetString(e){return e instanceof Sn?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}appendText(e){return this.value+=Sn._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if(typeof e=="function"){let n=new Sn;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Sn._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,t=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){let n=new Sn;n._tabstop=this._tabstop,t(n),this._tabstop=n._tabstop,t=n.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};Sn=D([de],Sn);var ms=class r{static isSnippetTextEdit(e){return e instanceof r?!0:e?pe.isRange(e.range)&&Sn.isSnippetString(e.snippet):!1}static replace(e,t){return new r(e,t)}static insert(e,t){return r.replace(new pe(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var su=(X=>(X[X.File=0]="File",X[X.Module=1]="Module",X[X.Namespace=2]="Namespace",X[X.Package=3]="Package",X[X.Class=4]="Class",X[X.Method=5]="Method",X[X.Property=6]="Property",X[X.Field=7]="Field",X[X.Constructor=8]="Constructor",X[X.Enum=9]="Enum",X[X.Interface=10]="Interface",X[X.Function=11]="Function",X[X.Variable=12]="Variable",X[X.Constant=13]="Constant",X[X.String=14]="String",X[X.Number=15]="Number",X[X.Boolean=16]="Boolean",X[X.Array=17]="Array",X[X.Object=18]="Object",X[X.Key=19]="Key",X[X.Null=20]="Null",X[X.EnumMember=21]="EnumMember",X[X.Struct=22]="Struct",X[X.Event=23]="Event",X[X.Operator=24]="Operator",X[X.TypeParameter=25]="TypeParameter",X))(su||{}),Jg=(e=>(e[e.Deprecated=1]="Deprecated",e))(Jg||{}),$o=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,n,o,i){this.name=e,this.kind=t,this.containerName=i,typeof n=="string"&&(this.containerName=n),o instanceof At?this.location=o:n instanceof pe&&(this.location=new At(o,n)),$o.validate(this)}toJSON(){return{name:this.name,kind:su[this.kind],location:this.location,containerName:this.containerName}}};$o=D([de],$o);var pd=(t=>(t[t.LF=1]="LF",t[t.CRLF=2]="CRLF",t))(pd||{}),un=class{static isTextEdit(e){return e instanceof un?!0:!e||typeof e!="object"?!1:pe.isRange(e)&&typeof e.newText=="string"}static replace(e,t){return new un(e,t)}static insert(e,t){return un.replace(new pe(e,e),t)}static delete(e){return un.replace(e,"")}static setEndOfLine(e){let t=new un(new pe(new Ie(0,0),new Ie(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!pe.isRange(e))throw De("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw De("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw De("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};un=D([de],un);var _o=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,n,o){this._edits.push({_type:1,from:e,to:t,options:n,metadata:o})}createFile(e,t,n){this._edits.push({_type:1,from:void 0,to:e,options:t,metadata:n})}deleteFile(e,t,n){this._edits.push({_type:1,from:e,to:void 0,options:t,metadata:n})}replaceNotebookMetadata(e,t,n){this._edits.push({_type:3,metadata:n,uri:e,edit:{editType:5,metadata:t}})}replaceNotebookCells(e,t,n,o){let i=t.start,s=t.end;(i!==s||n.length>0)&&this._edits.push({_type:5,uri:e,index:i,count:s-i,cells:n,metadata:o})}replaceNotebookCellMetadata(e,t,n,o){this._edits.push({_type:3,metadata:o,uri:e,edit:{editType:3,index:t,metadata:n}})}replace(e,t,n,o){this._edits.push({_type:2,uri:e,edit:new un(t,n),metadata:o})}insert(e,t,n,o){this.replace(e,new pe(t,t),n,o)}delete(e,t,n){this.replace(e,t,"",n)}has(e){return this._edits.some(t=>t._type===2&&t.uri.toString()===e.toString())}set(e,t){if(t)for(let n of t){if(!n)continue;let o,i;Array.isArray(n)?(o=n[0],i=n[1]):o=n,ro.isNotebookCellEdit(o)?o.newCellMetadata?this.replaceNotebookCellMetadata(e,o.range.start,o.newCellMetadata,i):o.newNotebookMetadata?this.replaceNotebookMetadata(e,o.newNotebookMetadata,i):this.replaceNotebookCells(e,o.range,o.newCells,i):ms.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:i,keepWhitespace:o.keepWhitespace}):this._edits.push({_type:2,uri:e,edit:o,metadata:i})}else{for(let n=0;n<this._edits.length;n++){let o=this._edits[n];switch(o._type){case 2:case 6:case 3:case 5:o.uri.toString()===e.toString()&&(this._edits[n]=void 0);break}}P1(this._edits)}}get(e){let t=[];for(let n of this._edits)n._type===2&&n.uri.toString()===e.toString()&&t.push(n.edit);return t}entries(){let e=new qe;for(let t of this._edits)if(t._type===2){let n=e.get(t.uri);n||(n=[t.uri,[]],e.set(t.uri,n)),n[1].push(t.edit)}return[...e.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};_o=D([de],_o);var Jk=(t=>(t[t.Top=0]="Top",t[t.Bottom=1]="Bottom",t))(Jk||{});var vd,fe=class{constructor(e){cc(this,vd);Tm(this,vd,e)}static from(...e){let t=e;return new fe(function(){if(t){for(let n of t)n&&typeof n.dispose=="function"&&n.dispose();t=void 0}})}dispose(){typeof Gt(this,vd)=="function"&&(Gt(this,vd).call(this),Tm(this,vd,void 0))}};vd=new WeakMap,fe=D([de],fe);var vO=r=>{if(typeof r!="string"||r.length===0||!/^[0-9A-Za-z_\-]+$/.test(r))throw De("connectionToken")},Xb=class{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,n){if(typeof e!="string"||e.length===0)throw De("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw De("port");typeof n<"u"&&vO(n),this.host=e,this.port=Math.round(t),this.connectionToken=n}},Ba=class{constructor(e,t){this.makeConnection=e;this.connectionToken=t;typeof t<"u"&&vO(t)}static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}},_i=class r extends Error{static NotAvailable(e,t){return new r(e,"NotAvailable",t)}static TemporarilyNotAvailable(e){return new r(e,"TemporarilyNotAvailable")}constructor(e,t="Unknown",n){super(e),this._message=e,this._code=t,this._detail=n,Object.setPrototypeOf(this,r.prototype)}},Cy=(n=>(n[n.Replace=1]="Replace",n[n.Append=2]="Append",n[n.Prepend=3]="Prepend",n))(Cy||{}),md=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};md=D([de],md);var Ta=class extends md{constructor(e,t,n,o){super(e,t),this.canIncreaseVerbosity=n,this.canDecreaseVerbosity=o}};Ta=D([de],Ta);var Xk=(t=>(t[t.Increase=0]="Increase",t[t.Decrease=1]="Decrease",t))(Xk||{}),Ty=(n=>(n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write",n))(Ty||{}),Ea=class{constructor(e,t=0){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:Ty[this.kind]}}};Ea=D([de],Ea);var wa=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};wa=D([de],wa);var zo=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(zo.validate)}constructor(e,t,n,o,i){this.name=e,this.detail=t,this.kind=n,this.range=o,this.selectionRange=i,this.children=[],zo.validate(this)}};zo=D([de],zo);var Ey=(t=>(t[t.Invoke=1]="Invoke",t[t.Automatic=2]="Automatic",t))(Ey||{}),Si=class{constructor(e,t){this.title=e,this.kind=t}};Si=D([de],Si);var Ci=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};Ci=D([de],Ci);var Wa=class{constructor(e,t,n,o,i,s){this.kind=e,this.name=t,this.detail=n,this.uri=o,this.range=i,this.selectionRange=s}},hu=class{constructor(e,t){this.fromRanges=t,this.from=e}},vu=class{constructor(e,t){this.fromRanges=t,this.to=e}},wy=(n=>(n[n.Information=0]="Information",n[n.Warning=1]="Warning",n[n.Error=2]="Error",n))(wy||{}),ka=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};ka=D([de],ka);var au=class{constructor(e,t){this.label=e,this.documentation=t}};au=D([de],au);var lu=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};lu=D([de],lu);var du=class{constructor(){this.activeSignature=0;this.activeParameter=0;this.signatures=[]}};du=D([de],du);var Yk=(n=>(n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange",n))(Yk||{}),Zk=(t=>(t[t.Type=1]="Type",t[t.Parameter=2]="Parameter",t))(Zk||{}),_a=class{constructor(e){this.value=e}};_a=D([de],_a);var Pa=class{constructor(e,t,n){this.position=e,this.label=t,this.kind=n}};Pa=D([de],Pa);var ky=(n=>(n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions",n))(ky||{}),Yg=(B=>(B[B.Text=0]="Text",B[B.Method=1]="Method",B[B.Function=2]="Function",B[B.Constructor=3]="Constructor",B[B.Field=4]="Field",B[B.Variable=5]="Variable",B[B.Class=6]="Class",B[B.Interface=7]="Interface",B[B.Module=8]="Module",B[B.Property=9]="Property",B[B.Unit=10]="Unit",B[B.Value=11]="Value",B[B.Enum=12]="Enum",B[B.Keyword=13]="Keyword",B[B.Snippet=14]="Snippet",B[B.Color=15]="Color",B[B.File=16]="File",B[B.Reference=17]="Reference",B[B.Folder=18]="Folder",B[B.EnumMember=19]="EnumMember",B[B.Constant=20]="Constant",B[B.Struct=21]="Struct",B[B.Event=22]="Event",B[B.Operator=23]="Operator",B[B.TypeParameter=24]="TypeParameter",B[B.User=25]="User",B[B.Issue=26]="Issue",B))(Yg||{}),_y=(e=>(e[e.Deprecated=1]="Deprecated",e))(_y||{}),Da=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&Yg[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};Da=D([de],Da);var Wr=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};Wr=D([de],Wr);var cu=class{constructor(e,t,n){this.insertText=e,this.range=t,this.command=n}};cu=D([de],cu);var uu=class{constructor(e){this.commands=void 0;this.suppressSuggestions=void 0;this.items=e}};uu=D([de],uu);var Py=(o=>(o[o.Unknown=0]="Unknown",o[o.Word=1]="Word",o[o.Line=2]="Line",o[o.Suggest=3]="Suggest",o))(Py||{}),Dy=(n=>(n[n.Accepted=0]="Accepted",n[n.Rejected=1]="Rejected",n[n.Ignored=2]="Ignored",n))(Dy||{}),Ry=(t=>(t[t.Code=1]="Code",t[t.Label=2]="Label",t))(Ry||{}),My=(u=>(u[u.Active=-1]="Active",u[u.Beside=-2]="Beside",u[u.One=1]="One",u[u.Two=2]="Two",u[u.Three=3]="Three",u[u.Four=4]="Four",u[u.Five=5]="Five",u[u.Six=6]="Six",u[u.Seven=7]="Seven",u[u.Eight=8]="Eight",u[u.Nine=9]="Nine",u))(My||{}),Ay=(t=>(t[t.Left=1]="Left",t[t.Right=2]="Right",t))(Ay||{});function bO(r,e){return`${_e.toKey(r)}.${e}`}var Ly=(o=>(o[o.Off=0]="Off",o[o.On=1]="On",o[o.Relative=2]="Relative",o[o.Interval=3]="Interval",o))(Ly||{}),Oy=(n=>(n[n.Manual=1]="Manual",n[n.AfterDelay=2]="AfterDelay",n[n.FocusOut=3]="FocusOut",n))(Oy||{}),Ny=(o=>(o[o.Default=0]="Default",o[o.InCenter=1]="InCenter",o[o.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",o[o.AtTop=3]="AtTop",o))(Ny||{}),Pd=(n=>(n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command",n))(Pd||{}),Uy=(n=>(n[n.Addition=1]="Addition",n[n.Deletion=2]="Deletion",n[n.Modification=3]="Modification",n))(Uy||{}),Fy=(t=>(t[t.Undo=1]="Undo",t[t.Redo=2]="Redo",t))(Fy||{}),Hy=(o=>(o[o.OpenOpen=0]="OpenOpen",o[o.ClosedClosed=1]="ClosedClosed",o[o.OpenClosed=2]="OpenClosed",o[o.ClosedOpen=3]="ClosedOpen",o))(Hy||{});(e=>{function r(t){switch(t){case"keyboard":return 1;case"mouse":return 2;case"api":case"code.jump":case"code.navigation":return 3}}e.fromValue=r})(Pd||={});var Dd=(o=>(o[o.Other=0]="Other",o[o.Comment=1]="Comment",o[o.String=2]="String",o[o.RegEx=3]="RegEx",o))(Dd||{});(e=>{function r(t){switch(t){case 0:return"other";case 1:return"comment";case 2:return"string";case 3:return"regex"}return"other"}e.toString=r})(Dd||={});var Ra=class{constructor(e,t){if(t&&!y.isUri(t))throw De("target");if(!pe.isRange(e)||e.isEmpty)throw De("range");this.range=e,this.target=t}};Ra=D([de],Ra);var $r=class{constructor(e,t,n,o){this.red=e,this.green=t,this.blue=n,this.alpha=o}};$r=D([de],$r);var Ma=class{constructor(e,t){if(t&&!(t instanceof $r))throw De("color");if(!pe.isRange(e)||e.isEmpty)throw De("range");this.range=e,this.color=t}};Ma=D([de],Ma);var Aa=class{constructor(e){if(!e||typeof e!="string")throw De("label");this.label=e}};Aa=D([de],Aa);var Vy=(n=>(n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Information=2]="Information",n))(Vy||{}),e_=(i=>(i[i.Unknown=0]="Unknown",i[i.Shutdown=1]="Shutdown",i[i.Process=2]="Process",i[i.User=3]="User",i[i.Extension=4]="Extension",i))(e_||{}),By=(n=>(n[n.Low=0]="Low",n[n.Medium=1]="Medium",n[n.High=2]="High",n))(By||{}),t_=(v=>(v[v.Sh=1]="Sh",v[v.Bash=2]="Bash",v[v.Fish=3]="Fish",v[v.Csh=4]="Csh",v[v.Ksh=5]="Ksh",v[v.Zsh=6]="Zsh",v[v.CommandPrompt=7]="CommandPrompt",v[v.GitBash=8]="GitBash",v[v.PowerShell=9]="PowerShell",v[v.Python=10]="Python",v[v.Julia=11]="Julia",v[v.NuShell=12]="NuShell",v[v.Node=13]="Node",v[v.Xonsh=14]="Xonsh",v))(t_||{}),Yb=class{constructor(e,t,n){this.startIndex=e;this.length=t;this.tooltip=n;if(typeof e!="number"||e<0)throw De("startIndex");if(typeof t!="number"||t<1)throw De("length");if(n!==void 0&&typeof n!="string")throw De("tooltip")}},Zb=class{constructor(e){this.uri=e}},ey=class{constructor(e){this.terminalCommand=e}},n_=(t=>(t[t.Panel=1]="Panel",t[t.Editor=2]="Editor",t))(n_||{}),ty=class{constructor(e){this.options=e;if(typeof e!="object")throw De("options")}},o_=(S=>(S[S.File=0]="File",S[S.Folder=1]="Folder",S[S.Method=2]="Method",S[S.Alias=3]="Alias",S[S.Argument=4]="Argument",S[S.Option=5]="Option",S[S.OptionValue=6]="OptionValue",S[S.Flag=7]="Flag",S[S.SymbolicLinkFile=8]="SymbolicLinkFile",S[S.SymbolicLinkFolder=9]="SymbolicLinkFolder",S[S.ScmCommit=10]="ScmCommit",S[S.ScmBranch=11]="ScmBranch",S[S.ScmTag=12]="ScmTag",S[S.ScmStash=13]="ScmStash",S[S.ScmRemote=14]="ScmRemote",S[S.PullRequest=15]="PullRequest",S[S.PullRequestDone=16]="PullRequestDone",S))(o_||{}),ny=class{constructor(e,t,n,o,i,s,a,l){this.label=e,this.replacementRange=t,this.kind=n,this.detail=o,this.documentation=i,this.isFile=s,this.isDirectory=a,this.isKeyword=l}},oy=class{constructor(e,t){this.items=e??[],this.resourceOptions=t}},r_=(n=>(n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never",n))(r_||{}),i_=(g=>(g.Changed="changed",g.ProcessStarted="processStarted",g.ProcessEnded="processEnded",g.Terminated="terminated",g.Start="start",g.AcquiredInput="acquiredInput",g.DependsOnStarted="dependsOnStarted",g.Active="active",g.Inactive="inactive",g.End="end",g.ProblemMatcherStarted="problemMatcherStarted",g.ProblemMatcherEnded="problemMatcherEnded",g.ProblemMatcherFoundErrors="problemMatcherFoundErrors",g))(i_||{}),s_=(n=>(n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New",n))(s_||{}),an=class{constructor(e,t){this.label=t;if(typeof e!="string")throw De("name");if(typeof t!="string")throw De("name");this._id=e}static from(e){switch(e){case"clean":return an.Clean;case"build":return an.Build;case"rebuild":return an.Rebuild;case"test":return an.Test;default:return}}get id(){return this._id}};an.Clean=new an("clean","Clean"),an.Build=new an("build","Build"),an.Rebuild=new an("rebuild","Rebuild"),an.Test=new an("test","Test"),an=D([de],an);function yO(r){let e="";for(let t=0;t<r.length;t++)e+=r[t].replace(/,/g,",,")+",";return e}var Ti=class{constructor(e,t,n){if(typeof e!="string")throw De("process");this._args=[],this._process=e,t!==void 0&&(Array.isArray(t)?(this._args=t,this._options=n):this._options=t)}get process(){return this._process}set process(e){if(typeof e!="string")throw De("process");this._process=e}get args(){return this._args}set args(e){Array.isArray(e)||(e=[]),this._args=e}get options(){return this._options}set options(e){this._options=e}computeId(){let e=[];if(e.push("process"),this._process!==void 0&&e.push(this._process),this._args&&this._args.length>0)for(let t of this._args)e.push(t);return yO(e)}};Ti=D([de],Ti);var zr=class{constructor(e,t,n){this._args=[];if(Array.isArray(t)){if(!e)throw De("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw De("command");this._command=e,t&&(this._args=t),this._options=n}else{if(typeof e!="string")throw De("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw De("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw De("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){let e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(let t of this._args)e.push(typeof t=="string"?t:t.value);return yO(e)}};zr=D([de],zr);var a_=(n=>(n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak",n))(a_||{}),Wy=(t=>(t[t.Global=1]="Global",t[t.Workspace=2]="Workspace",t))(Wy||{}),Id=class{constructor(e){this._callback=e}computeId(){return"customExecution"+pt()}set callback(e){this._callback=e}get callback(){return this._callback}},pn=class{constructor(e,t,n,o,i,s){this.__deprecated=!1;this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=n,this.execution=o,a=i,this.__deprecated=!0):t===1||t===2?(this.target=t,this._name=this.name=n,this._source=this.source=o,this.execution=i,a=s):(this.target=t,this._name=this.name=n,this._source=this.source=o,this.execution=i,a=s),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof Ti?this._definition={type:pn.ProcessType,id:this._execution.computeId()}:this._execution instanceof zr?this._definition={type:pn.ShellType,id:this._execution.computeId()}:this._execution instanceof Id?this._definition={type:pn.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:pn.EmptyType,id:pt()}}get definition(){return this._definition}set definition(e){if(e==null)throw De("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw De("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;let t=this._definition.type;(pn.EmptyType===t||pn.ProcessType===t||pn.ShellType===t||pn.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw De("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}};pn.ExtensionCallbackType="customExecution",pn.ProcessType="process",pn.ShellType="shell",pn.EmptyType="$empty",pn=D([de],pn);var Zg=(n=>(n[n.SourceControl=1]="SourceControl",n[n.Window=10]="Window",n[n.Notification=15]="Notification",n))(Zg||{}),l_;(e=>{function r(t){let n=t;return Lo(n.value)?n.tooltip&&!ke(n.tooltip)?(console.log("INVALID view badge, invalid tooltip",n.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",n.value),!1)}e.isViewBadge=r})(l_||={});var Ei=class{constructor(e,t=0){this.collapsibleState=t;y.isUri(e)?this.resourceUri=e:this.label=e}static isTreeItem(e,t){let n=e;if(n.checkboxState!==void 0){let o=Lo(n.checkboxState)?n.checkboxState:ut(n.checkboxState)&&Lo(n.checkboxState.state)?n.checkboxState.state:void 0,i=!Lo(n.checkboxState)&&ut(n.checkboxState)?n.checkboxState.tooltip:void 0;if(o===void 0||o!==1&&o!==0||i!==void 0&&!ke(i))return console.log("INVALID tree item, invalid checkboxState",n.checkboxState),!1}if(e instanceof Ei)return!0;if(n.label!==void 0&&!ke(n.label)&&!n.label?.label)return console.log("INVALID tree item, invalid label",n.label),!1;if(n.id!==void 0&&!ke(n.id))return console.log("INVALID tree item, invalid id",n.id),!1;if(n.iconPath!==void 0&&!ke(n.iconPath)&&!y.isUri(n.iconPath)&&(!n.iconPath||!ke(n.iconPath.id))){let o=n.iconPath;if(!o||!ke(o.light)&&!y.isUri(o.light)&&!ke(o.dark)&&!y.isUri(o.dark))return console.log("INVALID tree item, invalid iconPath",n.iconPath),!1}return n.description!==void 0&&!ke(n.description)&&typeof n.description!="boolean"?(console.log("INVALID tree item, invalid description",n.description),!1):n.resourceUri!==void 0&&!y.isUri(n.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",n.resourceUri),!1):n.tooltip!==void 0&&!ke(n.tooltip)&&!(n.tooltip instanceof Mt)?(console.log("INVALID tree item, invalid tooltip",n.tooltip),!1):n.command!==void 0&&!n.command.command?(console.log("INVALID tree item, invalid command",n.command),!1):n.collapsibleState!==void 0&&n.collapsibleState<0&&n.collapsibleState>2?(console.log("INVALID tree item, invalid collapsibleState",n.collapsibleState),!1):n.contextValue!==void 0&&!ke(n.contextValue)?(console.log("INVALID tree item, invalid contextValue",n.contextValue),!1):n.accessibilityInformation!==void 0&&!n.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",n.accessibilityInformation),!1):!0}};Ei=D([de],Ei);var $y=(n=>(n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded",n))($y||{}),zy=(t=>(t[t.Unchecked=0]="Unchecked",t[t.Checked=1]="Checked",t))(zy||{}),gd=class{constructor(e){this.value=e}async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}};gd=D([de],gd);var $a=class extends gd{},ry=class extends $a{#e;constructor(e){super(""),this.#e=e}asFile(){return this.#e}},iy=class{constructor(e,t,n,o){this.name=e,this.uri=t,this._itemId=n,this._getData=o}data(){return this._getData()}},gs,bd,Xg,mr=class{constructor(e){cc(this,bd);cc(this,gs,new Map);for(let[t,n]of e??[]){let o=Gt(this,gs).get(Em(this,bd,Xg).call(this,t));o?o.push(n):Gt(this,gs).set(Em(this,bd,Xg).call(this,t),[n])}}get(e){return Gt(this,gs).get(Em(this,bd,Xg).call(this,e))?.[0]}set(e,t){Gt(this,gs).set(Em(this,bd,Xg).call(this,e),[t])}forEach(e,t){for(let[n,o]of Gt(this,gs))for(let i of o)e.call(t,i,n,this)}*[Symbol.iterator](){for(let[e,t]of Gt(this,gs))for(let n of t)yield[e,n]}};gs=new WeakMap,bd=new WeakSet,Xg=function(e){return e.toLowerCase()},mr=D([de],mr);var pu=class{constructor(e,t,n){this.insertText=e,this.title=t,this.kind=n}};pu=D([de],pu);var d_=(t=>(t[t.Automatic=0]="Automatic",t[t.PasteAs=1]="PasteAs",t))(d_||{}),gr=class r{constructor(e){this.value=e}static{this.sep="."}append(...e){return new r((this.value?[this.value,...e]:e).join(r.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+r.sep)}};gr.Empty=new gr("");gr.Text=new gr("text");gr.TextUpdateImports=gr.Text.append("updateImports");var sy=class{constructor(e,t,n){this.title=t,this.insertText=e,this.kind=n}},ln=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};ln=D([de],ln);ln.File=new ln("file");ln.Folder=new ln("folder");var fs=class{constructor(e){this.id=e}};fs=D([de],fs);var Ky=(n=>(n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.WorkspaceFolder=3]="WorkspaceFolder",n))(Ky||{}),wi=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=y.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!y.isUri(e)&&!y.isUri(e.uri)))throw De("base");if(typeof t!="string")throw De("pattern");typeof e=="string"?this.baseUri=y.file(e):y.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};wi=D([de],wi);var IO=new WeakMap;function xO(r,e){IO.set(r,e)}var hs=class{constructor(e,t,n,o,i){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof n=="string"&&(this.hitCondition=n),typeof o=="string"&&(this.logMessage=o),typeof i=="string"&&(this.mode=i)}get id(){return this._id||(this._id=IO.get(this)??pt()),this._id}};hs=D([de],hs);var Kr=class extends hs{constructor(e,t,n,o,i,s){if(super(t,n,o,i,s),e===null)throw De("location");this.location=e}};Kr=D([de],Kr);var qr=class extends hs{constructor(e,t,n,o,i,s){super(t,n,o,i,s),this.functionName=e}};qr=D([de],qr);var fd=class extends hs{constructor(e,t,n,o,i,s,a,l){if(super(o,i,s,a,l),!t)throw De("dataId");this.label=e,this.dataId=t,this.canPersist=n}};fd=D([de],fd);var La=class{constructor(e,t,n){this.command=e,this.args=t||[],this.options=n}};La=D([de],La);var vs=class{constructor(e,t){this.port=e,this.host=t}};vs=D([de],vs);var Oa=class{constructor(e){this.path=e}};Oa=D([de],Oa);var bs=class{constructor(e){this.implementation=e}};bs=D([de],bs);var bu=class{constructor(e,t,n){this.session=e;this.threadId=t;this.frameId=n}},yu=class{constructor(e,t){this.session=e;this.threadId=t}},Na=class{constructor(e,t){this.range=e,this.expression=t}};Na=D([de],Na);var qy=(t=>(t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic",t))(qy||{}),Gy=(i=>(i[i.Other=0]="Other",i[i.Empty=1]="Empty",i[i.TokenCancellation=2]="TokenCancellation",i[i.LostRace=3]="LostRace",i[i.NotTaken=4]="NotTaken",i))(Gy||{}),Ua=class{constructor(e,t){this.range=e,this.text=t}};Ua=D([de],Ua);var Fa=class{constructor(e,t,n=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=n}};Fa=D([de],Fa);var Ha=class{constructor(e,t){this.range=e,this.expression=t}};Ha=D([de],Ha);var mu=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};mu=D([de],mu);var c_=(e=>(e[e.AIGenerated=1]="AIGenerated",e))(c_||{}),jy=(t=>(t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic",t))(jy||{}),ay=class{constructor(e,t){this.newSymbolName=e,this.tags=t}},Qy=(n=>(n[n.Changed=1]="Changed",n[n.Created=2]="Created",n[n.Deleted=3]="Deleted",n))(Qy||{}),rt=class extends Error{static FileExists(e){return new rt(e,"EntryExists",rt.FileExists)}static FileNotFound(e){return new rt(e,"EntryNotFound",rt.FileNotFound)}static FileNotADirectory(e){return new rt(e,"EntryNotADirectory",rt.FileNotADirectory)}static FileIsADirectory(e){return new rt(e,"EntryIsADirectory",rt.FileIsADirectory)}static NoPermissions(e){return new rt(e,"NoPermissions",rt.NoPermissions)}static Unavailable(e){return new rt(e,"Unavailable",rt.Unavailable)}constructor(e,t="Unknown",n){super(y.isUri(e)?e.toString(!0):e),this.code=n?.name??"Unknown",cE(this,t),Object.setPrototypeOf(this,rt.prototype),typeof Error.captureStackTrace=="function"&&typeof n=="function"&&Error.captureStackTrace(this,n)}};rt=D([de],rt);var gu=class{constructor(e,t,n){this.start=e,this.end=t,this.kind=n}};gu=D([de],gu);var Jy=(n=>(n[n.Comment=1]="Comment",n[n.Imports=2]="Imports",n[n.Region=3]="Region",n))(Jy||{}),Xy=(t=>(t[t.Collapsed=0]="Collapsed",t[t.Expanded=1]="Expanded",t))(Xy||{}),u_=(t=>(t[t.Editing=0]="Editing",t[t.Preview=1]="Preview",t))(u_||{}),p_=(t=>(t[t.Published=0]="Published",t[t.Draft=1]="Draft",t))(p_||{}),Yy=(t=>(t[t.Unresolved=0]="Unresolved",t[t.Resolved=1]="Resolved",t))(Yy||{}),Zy=(t=>(t[t.Current=0]="Current",t[t.Outdated=1]="Outdated",t))(Zy||{}),eI=(t=>(t[t.Reply=1]="Reply",t[t.Comment=2]="Comment",t))(eI||{}),xd=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function b5(r){return typeof r>"u"||V1(r)}var ly=class r{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,n=e.tokenTypes.length;t<n;t++)this._tokenTypeStrToInt.set(e.tokenTypes[t],t);for(let t=0,n=e.tokenModifiers.length;t<n;t++)this._tokenModifierStrToInt.set(e.tokenModifiers[t],t)}}push(e,t,n,o,i){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number"&&(typeof i=="number"||typeof i>"u"))return typeof i>"u"&&(i=0),this._pushEncoded(e,t,n,o,i);if(pe.isRange(e)&&typeof t=="string"&&b5(n))return this._push(e,t,n);throw De()}_push(e,t,n){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");let o=e.start.line,i=e.start.character,s=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t),l=0;if(n)for(let d of n){if(!this._tokenModifierStrToInt.has(d))throw new Error("`tokenModifier` is not in the provided legend");let c=this._tokenModifierStrToInt.get(d);l|=1<<c>>>0}this._pushEncoded(o,i,s,a,l)}_pushEncoded(e,t,n,o,i){if(this._dataIsSortedAndDeltaEncoded&&(e<this._prevLine||e===this._prevLine&&t<this._prevChar)){this._dataIsSortedAndDeltaEncoded=!1;let l=this._data.length/5|0,d=0,c=0;for(let u=0;u<l;u++){let m=this._data[5*u],g=this._data[5*u+1];m===0?(m=d,g+=c):m+=d,this._data[5*u]=m,this._data[5*u+1]=g,d=m,c=g}}let s=e,a=t;this._dataIsSortedAndDeltaEncoded&&this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){let t=[],n=e.length/5|0;for(let a=0;a<n;a++)t[a]=a;t.sort((a,l)=>{let d=e[5*a],c=e[5*l];if(d===c){let u=e[5*a+1],m=e[5*l+1];return u-m}return d-c});let o=new Uint32Array(e.length),i=0,s=0;for(let a=0;a<n;a++){let l=5*t[a],d=e[l+0],c=e[l+1],u=e[l+2],m=e[l+3],g=e[l+4],v=d-i,h=v===0?c-s:c,x=5*a;o[x+0]=v,o[x+1]=h,o[x+2]=u,o[x+3]=m,o[x+4]=g,i=d,s=c}return o}build(e){return this._dataIsSortedAndDeltaEncoded?new Gr(new Uint32Array(this._data),e):new Gr(r._sortAndDeltaEncode(this._data),e)}},Gr=class{constructor(e,t){this.resultId=t,this.data=e}},Iu=class{constructor(e,t,n){this.start=e,this.deleteCount=t,this.data=n}},za=class{constructor(e,t){this.resultId=t,this.edits=e}},tI=(t=>(t[t.Separate=0]="Separate",t[t.MergeWithParent=1]="MergeWithParent",t))(tI||{}),dy=class{constructor(e){this.name=e}},m_=(n=>(n[n.Title=1]="Title",n[n.Inline=2]="Inline",n[n.Input=3]="Input",n))(m_||{}),xi=class{constructor(){}};xi.Back={iconPath:new ln("arrow-left")},xi=D([de],xi);var nI=(t=>(t[t.Separator=-1]="Separator",t[t.Default=0]="Default",t))(nI||{}),oI=(n=>(n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error",n))(oI||{}),rI=(t=>(t[t.UI=1]="UI",t[t.Workspace=2]="Workspace",t))(rI||{}),Sd=class{static validate(e){if(typeof e.badge=="string"){let t=MT(e.badge,0);if(t<e.badge.length&&(t+=MT(e.badge,t)),e.badge.length>t)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!ln.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,n){this.badge=e,this.tooltip=t,this.color=n}},hd=class{constructor(e){this.kind=e}};hd=D([de],hd);var iI=(o=>(o[o.Light=1]="Light",o[o.Dark=2]="Dark",o[o.HighContrast=3]="HighContrast",o[o.HighContrastLight=4]="HighContrastLight",o))(iI||{}),cy=class{constructor(e,t,n){this.label=e;this.uri=t;this.position=n}},g_=(n=>(n[n.Idle=1]="Idle",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing",n))(g_||{}),sI=(t=>(t[t.Left=1]="Left",t[t.Right=2]="Right",t))(sI||{}),aI=(o=>(o[o.Default=0]="Default",o[o.InCenter=1]="InCenter",o[o.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",o[o.AtTop=3]="AtTop",o))(aI||{}),uy=class{constructor(e,t){this.text=e;this.alignment=t}},f_=(t=>(t[t.Default=1]="Default",t[t.Preferred=2]="Preferred",t))(f_||{}),lI=(n=>(n[n.Default=1]="Default",n[n.Preferred=2]="Preferred",n[n.Hidden=-1]="Hidden",n))(lI||{}),xu=class{constructor(e,t=[]){this.uri=e;this.provides=hn(t)}},py=class{constructor(e){this.label=e}},dI=(t=>(t[t.Named=1]="Named",t[t.Indexed=2]="Indexed",t))(dI||{}),fu=class{constructor(e,t){this.label=e;this.timestamp=t}};fu=D([de],fu);var cI=(n=>(n[n.Production=1]="Production",n[n.Development=2]="Development",n[n.Test=3]="Test",n))(cI||{}),uI=(t=>(t[t.Node=1]="Node",t[t.Webworker=2]="Webworker",t))(uI||{}),ef=(o=>(o[o.Other=0]="Other",o[o.Comment=1]="Comment",o[o.String=2]="String",o[o.RegEx=3]="RegEx",o))(ef||{}),my=class{constructor(e,t){this.ranges=e;this.wordPattern=t}},gy=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}},h_=(s=>(s[s.Queued=1]="Queued",s[s.Running=2]="Running",s[s.Passed=3]="Passed",s[s.Failed=4]="Failed",s[s.Skipped=5]="Skipped",s[s.Errored=6]="Errored",s))(h_||{}),pI=(n=>(n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage",n))(pI||{}),Su=class{constructor(e,t,n){this.controllerId=e;this.profileId=t;this.kind=n}},Va=class{constructor(e=void 0,t=void 0,n=void 0,o=!1,i=!0){this.include=e;this.exclude=t;this.profile=n;this.continuous=o;this.preserveFocus=i}};Va=D([de],Va);var ki=class{constructor(e){this.message=e}static diff(e,t,n){let o=new ki(e);return o.expectedOutput=t,o.actualOutput=n,o}};ki=D([de],ki);var ys=class{constructor(e){this.id=e}};ys=D([de],ys);var fy=class{constructor(e,t,n){this.label=e;this.uri=t;this.position=n}},yd=class{constructor(e,t){this.covered=e;this.total=t;tf(this)}};function tf(r){if(r){if(r.covered>r.total)throw new Error(`The total number of covered items (${r.covered}) cannot be greater than the total (${r.total})`);if(r.total<0)throw new Error(`The number of covered items (${r.total}) cannot be negative`)}}var Is=class r{constructor(e,t,n,o,i=[]){this.uri=e;this.statementCoverage=t;this.branchCoverage=n;this.declarationCoverage=o;this.includesTests=i}static fromDetails(e,t){let n=new yd(0,0),o=new yd(0,0),i=new yd(0,0);for(let a of t)if("branches"in a){n.total+=1,n.covered+=a.executed?1:0;for(let l of a.branches)o.total+=1,o.covered+=l.executed?1:0}else i.total+=1,i.covered+=a.executed?1:0;let s=new r(e,n,o.total>0?o:void 0,i.total>0?i:void 0);return s.detailedCoverage=t,s}},Cu=class{constructor(e,t,n=[]){this.executed=e;this.location=t;this.branches=n}get executionCount(){return+this.executed}set executionCount(e){this.executed=e}},Tu=class{constructor(e,t,n){this.executed=e;this.location=t;this.label=n}get executionCount(){return+this.executed}set executionCount(e){this.executed=e}},Eu=class{constructor(e,t,n){this.name=e;this.executed=t;this.location=n}get executionCount(){return+this.executed}set executionCount(e){this.executed=e}},v_=(o=>(o[o.None=0]="None",o[o.Option=1]="Option",o[o.Default=2]="Default",o[o.Preferred=3]="Preferred",o))(v_||{}),b_=(n=>(n[n.Untrusted=0]="Untrusted",n[n.Trusted=1]="Trusted",n[n.Unspecified=2]="Unspecified",n))(b_||{}),y_=(s=>(s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce",s))(y_||{}),Ka=class{constructor(e,t,n,o,i,s){this.kind=e,this.name=t,this.detail=n,this.uri=o,this.range=i,this.selectionRange=s}},qa=class{constructor(e){this.uri=e}},xs=class{constructor(e,t){this.original=e;this.modified=t}},wu=class{constructor(e,t,n,o){this.base=e;this.input1=t;this.input2=n;this.result=o}},Ga=class{constructor(e,t){this.uri=e;this.viewType=t}},ku=class{constructor(e){this.viewType=e}},ja=class{constructor(e,t){this.uri=e;this.notebookType=t}},Qa=class{constructor(e,t,n){this.original=e;this.modified=t;this.notebookType=n}},_u=class{constructor(){}},Pu=class{constructor(e,t){this.uri=e;this.inputBoxUri=t}},Du=class{constructor(){}},Ru=class{constructor(e){this.textDiffs=e}},I_=(t=>(t[t.Down=0]="Down",t[t.Up=1]="Up",t))(I_||{}),x_=(t=>(t[t.Action=1]="Action",t[t.Toolbar=2]="Toolbar",t))(x_||{}),S_=(n=>(n[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Full=3]="Full",n))(S_||{}),hy=class{constructor(e,t,n){this.id=e,this.label=t,this.values=n}},mI=(n=>(n[n.Accepted=1]="Accepted",n[n.Rejected=2]="Rejected",n[n.Saved=3]="Saved",n))(mI||{}),C_=(n=>(n[n.Keep=1]="Keep",n[n.Undo=2]="Undo",n[n.UserModification=3]="UserModification",n))(C_||{}),T_=(i=>(i[i.Unhelpful=0]="Unhelpful",i[i.Helpful=1]="Helpful",i[i.Undone=2]="Undone",i[i.Accepted=3]="Accepted",i[i.Bug=4]="Bug",i))(T_||{}),gI=(t=>(t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t))(gI||{}),Ss=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new Mt(e):e}},Pi=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new Mt(e):e,this.vulnerabilities=t}},Cs=class{constructor(e,t,n,o){this.title=e,this.message=t,this.data=n,this.buttons=o}},Ts=class{constructor(e,t){this.value=e,this.baseUri=t}},Cd=class{constructor(e,t,n){this.value=e,this.title=t,this.readOnly=n}},vy=class{constructor(e,t){this.data=e,this.mimeType=t}},Mu=class{constructor(e,t,n,o){this.description=e,this.agentName=t,this.prompt=n,this.result=o}},Td=class{constructor(e,t){this.uris=e;this.callback=t;this.applied=new Promise(n=>{this.didGetApplied=n})}},Di=class{constructor(e,t){this.value=e,this.value2=e,this.title=t}},Ed=class{constructor(e){this.value=e}},Ja=class{constructor(e,t){this.value=e,this.task=t}},jr=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}},Es=class{constructor(e,t,n,o){this.hookType=e,this.stopReason=t,this.systemMessage=n,this.metadata=o}},Ri=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new Mt(e):e}},ws=class{constructor(e){this.value=e}},fr=class{constructor(e,t,n){this.value=e,this.iconPath=t,this.options=n}},ks=class{constructor(e,t,n){this.value=e,this.isEdit=t,this.undoStopId=n}},_s=class{constructor(e,t,n){this.value=e,this.license=t,this.snippet=n}},Ps=class{constructor(e,t){this.uri=e;this.range=t}},Xa=class{constructor(e){this.extensions=e}},Ya=class{constructor(e,t,n,o,i){this.title=t;this.description=n;this.author=o;this.linkTag=i;oa(e)?(this.uri=e,this.command={title:"Open Pull Request",command:"vscode.open",arguments:[e]}):this.command=e}toJSON(){return{$mid:26,uri:this.uri,title:this.title,description:this.description,author:this.author}}},fI=(n=>(n[n.Text=1]="Text",n[n.SingleSelect=2]="SingleSelect",n[n.MultiSelect=3]="MultiSelect",n))(fI||{}),Au=class{constructor(e,t,n,o){this.id=e,this.type=t,this.title=n,this.message=o?.message,this.options=o?.options,this.defaultValue=o?.defaultValue,this.allowFreeformInput=o?.allowFreeformInput}},Mi=class{constructor(e,t=!0){this.questions=e,this.allowSkip=t}},Ai=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},Ds=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},Za=class{constructor(e){this.edits=e}},hI=(n=>(n[n.NotStarted=1]="NotStarted",n[n.InProgress=2]="InProgress",n[n.Completed=3]="Completed",n))(hI||{}),wd=class{constructor(e,t,n){this.toolName=e,this.toolCallId=t,this.errorMessage=n}},Rs=class{constructor(e,t,n,o,i,s,a,l){this.prompt=e;this.command=t;this.references=n;this.participant=o;this.toolReferences=i;this.editedFileEvents=s;this.id=a;this.modelId=l}},Lu=class{constructor(e,t,n,o){this.response=e;this.result=t;this.participant=n;this.command=o}},by=class{constructor(e,t,n,o){this.response=e;this.result=t;this.participant=n;this.command=o}},vI=(o=>(o[o.Panel=1]="Panel",o[o.Terminal=2]="Terminal",o[o.Notebook=3]="Notebook",o[o.Editor=4]="Editor",o))(vI||{}),E_=(o=>(o[o.Failed=0]="Failed",o[o.Completed=1]="Completed",o[o.InProgress=2]="InProgress",o[o.NeedsInput=3]="NeedsInput",o))(E_||{}),yy=class{constructor(e,t,n,o){this.modifiedUri=e;this.insertions=t;this.deletions=n;this.originalUri=o}},Iy=class{constructor(e,t,n,o,i){this.uri=e;this.originalUri=t;this.modifiedUri=n;this.insertions=o;this.deletions=i}},w_=(n=>(n[n.Complete=1]="Complete",n[n.Partial=2]="Partial",n[n.Omitted=3]="Omitted",n))(w_||{}),k_=(n=>(n[n.NoReason=0]="NoReason",n[n.FilteredContentRetry=1]="FilteredContentRetry",n[n.CopyrightContentRetry=2]="CopyrightContentRetry",n))(k_||{}),Ou=class{constructor(e,t,n,o){this.editor=e;this.document=t;this.selection=n;this.wholeRange=o}},Nu=class{constructor(e){this.cell=e}},Uu=class{constructor(e,t,n){this.mimeType=e,this.data=t,this.reference=n}},el=class{constructor(e){this.diagnostics=e}},nf=(n=>(n[n.User=1]="User",n[n.Assistant=2]="Assistant",n[n.System=3]="System",n))(nf||{}),Li=class{constructor(e,t,n){this.callId=e,this.content=t,this.isError=n??!1}},__=(n=>(n[n.Info=0]="Info",n[n.Warning=1]="Warning",n[n.Error=2]="Error",n))(__||{}),Fu=class r{constructor(e,t,n){this._content=[];this.role=e,this.content=t,this.name=n}static User(e,t){return new r(1,e,t)}static Assistant(e,t){return new r(2,e,t)}set content(e){typeof e=="string"?this._content=[new Lt(e)]:this._content=e}get content(){return this._content}},Hu=class r{constructor(e,t,n){this._content=[];this.role=e,this.content=t,this.name=n}static User(e,t){return new r(1,e,t)}static Assistant(e,t){return new r(2,e,t)}set content(e){typeof e=="string"?this._content=[new Lt(e)]:this._content=e}get content(){return this._content}set content2(e){e&&(this.content=e.map(t=>typeof t=="string"?new Lt(t):t))}get content2(){return this.content.map(e=>e instanceof Lt?e.value:e)}},hr=class{constructor(e,t,n){this.callId=e,this.name=t,this.input=n}},bI=(n=>(n[n.Assistant=0]="Assistant",n[n.User=1]="User",n[n.Extension=2]="Extension",n))(bI||{}),Lt=class{constructor(e,t){this.value=e,t=t}toJSON(){return{$mid:21,value:this.value,audience:this.audience}}},mn=class r{constructor(e,t,n){this.mimeType=t,this.data=e,this.audience=n}static image(e,t){return new r(e,t)}static json(e,t="text/x-json"){let n=JSON.stringify(e,void 0,"	");return new r(ee.fromString(n).buffer,t)}static text(e,t=eo.text){return new r(ee.fromString(e).buffer,t)}toJSON(){return{$mid:24,mimeType:this.mimeType,data:this.data,audience:this.audience}}},P_=(i=>(i.PNG="image/png",i.JPEG="image/jpeg",i.GIF="image/gif",i.WEBP="image/webp",i.BMP="image/bmp",i))(P_||{}),Qr=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}toJSON(){return{$mid:22,value:this.value,id:this.id,metadata:this.metadata}}},vr=class{constructor(e){this.value=e}toJSON(){return{$mid:23,value:this.value}}};var Po=class r extends Error{static#e="LanguageModelError";static NotFound(e){return new r(e,r.NotFound.name)}static NoPermissions(e){return new r(e,r.NoPermissions.name)}static Blocked(e){return new r(e,r.Blocked.name)}static tryDeserialize(e){if(e.name===r.#e)return new r(e.message,e.code,e.cause)}constructor(e,t,n){super(e,{cause:n}),this.name=r.#e,this.code=t??""}},tl=class{constructor(e){this.content=e}toJSON(){return{$mid:20,content:this.content}}},xy=class{constructor(e){this.content=e}toJSON(){return{$mid:20,content:this.content}}},Sy=class extends tl{},yI=(t=>(t[t.Auto=1]="Auto",t[t.Required=2]="Required",t))(yI||{}),Vu=class{constructor(e,t){this.id=e;this.label=t}},Bu=class{constructor(e,t,n){this.label=e;this.name=t;this.instructions=n}},D_=(o=>(o[o.SymbolInformation=1]="SymbolInformation",o[o.CommandInformation=2]="CommandInformation",o[o.SearchInformation=3]="SearchInformation",o[o.SettingInformation=4]="SettingInformation",o))(D_||{}),R_=(n=>(n[n.EMBEDDED=1]="EMBEDDED",n[n.LLM_RANKED=2]="LLM_RANKED",n[n.CANCELED=3]="CANCELED",n))(R_||{}),M_=(i=>(i[i.Started=1]="Started",i[i.Recognizing=2]="Recognizing",i[i.Recognized=3]="Recognized",i[i.Stopped=4]="Stopped",i[i.Error=5]="Error",i))(M_||{}),A_=(n=>(n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error",n))(A_||{}),L_=(t=>(t[t.Recognized=1]="Recognized",t[t.Stopped=2]="Stopped",t))(L_||{}),II=(t=>(t[t.Initial=0]="Initial",t[t.Dynamic=1]="Dynamic",t))(II||{}),kd=class{constructor(e,t,n,o={},i,s){this.label=e;this.command=t;this.args=n;this.env=o;this.version=i;this.metadata=s}},_d=class{constructor(e,t,n={},o,i,s){this.label=e;this.uri=t;this.headers=n;this.version=o;this.metadata=i;this.authentication=s}};var Qn;(t=>{function r(n){let{selectionStartLineNumber:o,selectionStartColumn:i,positionLineNumber:s,positionColumn:a}=n,l=new Ie(o-1,i-1),d=new Ie(s-1,a-1);return new xn(l,d)}t.to=r;function e(n){let{anchor:o,active:i}=n;return{selectionStartLineNumber:o.line+1,selectionStartColumn:o.character+1,positionLineNumber:i.line+1,positionColumn:i.character+1}}t.from=e})(Qn||={});var V;(t=>{function r(n){if(!n)return;let{start:o,end:i}=n;return{startLineNumber:o.line+1,startColumn:o.character+1,endLineNumber:i.line+1,endColumn:i.character+1}}t.from=r;function e(n){if(!n)return;let{startLineNumber:o,startColumn:i,endLineNumber:s,endColumn:a}=n;return new pe(o-1,i-1,s-1,a-1)}t.to=e})(V||={});var br;(t=>{function r(n){return{uri:n.uri,range:V.from(n.range)}}t.from=r;function e(n){return new At(y.revive(n.uri),V.to(n.range))}t.to=e})(br||={});var W_;(e=>{function r(t){switch(t){case 1:return 1;case 0:return 0;case 3:return 3;case 2:return 2}}e.to=r})(W_||={});var Xe;(t=>{function r(n){return new Ie(n.lineNumber-1,n.column-1)}t.to=r;function e(n){return{lineNumber:n.line+1,column:n.character+1}}t.from=e})(Xe||={});var Jr;(n=>{function r(o,i,s){return Ze(hn(o).map(a=>e(a,i,s)))}n.from=r;function e(o,i,s){if(typeof o=="string")return{$serialized:!0,language:o,isBuiltin:s?.isBuiltin};if(o)return{$serialized:!0,language:o.language,scheme:t(o.scheme,i),pattern:so.from(o.pattern)??void 0,exclusive:o.exclusive,notebookType:o.notebookType,isBuiltin:s?.isBuiltin}}function t(o,i){return i&&typeof o=="string"?i.transformOutgoingScheme(o):o}})(Jr||={});var O_;(t=>{function r(n){switch(n){case 1:return 1;case 2:return 2}}t.from=r;function e(n){switch(n){case 1:return 1;case 2:return 2;default:return}}t.to=e})(O_||={});var Ls;(t=>{function r(n){let o;return n.code&&(ke(n.code)||Lo(n.code)?o=String(n.code):o={value:String(n.code.value),target:n.code.target}),{...V.from(n.range),message:n.message,source:n.source,code:o,severity:xI.from(n.severity),relatedInformation:n.relatedInformation&&n.relatedInformation.map(N_.from),tags:Array.isArray(n.tags)?Ze(n.tags.map(O_.from)):void 0}}t.from=r;function e(n){let o=new ps(V.to(n),n.message,xI.to(n.severity));return o.source=n.source,o.code=ke(n.code)?n.code:n.code?.value,o.relatedInformation=n.relatedInformation&&n.relatedInformation.map(N_.to),o.tags=n.tags&&Ze(n.tags.map(O_.to)),o}t.to=e})(Ls||={});var N_;(t=>{function r(n){return{...V.from(n.location.range),message:n.message,resource:n.location.uri}}t.from=r;function e(n){return new bi(new At(n.resource,V.to(n)),n.message)}t.to=e})(N_||={});var xI;(t=>{function r(n){switch(n){case 0:return 8;case 1:return 4;case 2:return 2;case 3:return 1}return 8}t.from=r;function e(n){switch(n){case 2:return 2;case 4:return 1;case 8:return 0;case 1:return 3;default:return 0}}t.to=e})(xI||={});var _t;(t=>{function r(n){return typeof n=="number"&&n>=1?n-1:n===-2?_L:kL}t.from=r;function e(n){if(typeof n=="number"&&n>=0)return n+1;throw new Error("invalid 'EditorGroupColumn'")}t.to=e})(_t||={});function E5(r){return typeof r.range<"u"}function $_(r){return r.length===0?!0:!!E5(r[0])}var ce;(s=>{function r(a){return a.map(s.from)}s.fromMany=r;function e(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function t(a){let l;if(e(a)){let{language:u,value:m}=a;l={value:"```"+u+`
`+m+"\n```\n"}}else Mt.isMarkdownString(a)?l={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,supportAlertSyntax:a.supportAlertSyntax,baseUri:a.baseUri}:typeof a=="string"?l={value:a}:l={value:""};let d=Object.create(null);l.uris=d;let c=({href:u})=>{try{let m=y.parse(u,!0);m=m.with({query:n(m.query,d)}),d[u]=m}catch{}return""};return kt.walkTokens(kt.lexer(l.value),u=>{u.type==="link"?c({href:u.href}):u.type==="image"&&typeof u.href=="string"&&c(BM(u.href))}),l}s.from=t;function n(a,l){if(!a)return a;let d;try{d=$v(a)}catch{}if(!d)return a;let c=!1;return d=os(d,u=>{if(y.isUri(u)){let m=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[m]=u,c=!0,m}else return}),c?JSON.stringify(d):a}function o(a){let l=new Mt(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.supportAlertSyntax=a.supportAlertSyntax,l.baseUri=a.baseUri?y.from(a.baseUri):void 0,l}s.to=o;function i(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=i})(ce||={});function CO(r){return $_(r)?r.map(e=>({range:V.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?ce.fromMany(e.hoverMessage):e.hoverMessage?ce.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):r.map(e=>({range:V.from(e)}))}function uf(r){return typeof r>"u"?r:typeof r=="string"?y.file(r):r}var of;(e=>{function r(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?uf(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}e.from=r})(of||={});var U_;(e=>{function r(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?uf(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?of.from(t.before):void 0,after:t.after?of.from(t.after):void 0}}e.from=r})(U_||={});var TO;(e=>{function r(t){if(typeof t>"u")return t;switch(t){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3}}e.from=r})(TO||={});var z_;(e=>{function r(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?TO.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?U_.from(t.light):void 0,dark:t.dark?U_.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?uf(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?of.from(t.before):void 0,after:t.after?of.from(t.after):void 0}}e.from=r})(z_||={});var tn;(t=>{function r(n){return{text:n.newText,eol:n.newEol&&Ad.from(n.newEol),range:V.from(n.range)}}t.from=r;function e(n){let o=new un(V.to(n.range),n.text);return o.newEol=typeof n.eol>"u"?void 0:Ad.to(n.eol),o}t.to=e})(tn||={});var Bn;(t=>{function r(n,o){let i={edits:[]};if(n instanceof _o){let s=new Yo;for(let a of n._allEntries())a._type===1&&y.isUri(a.to)&&a.from===void 0&&s.add(a.to);for(let a of n._allEntries())if(a._type===1){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:er(ee.wrap(a.options.contents))}:l={type:"dataTransferItem",id:a.options.contents._itemId}),i.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:l},metadata:a.metadata})}else a._type===2?i.edits.push({resource:a.uri,textEdit:tn.from(a.edit),versionId:s.has(a.uri)?void 0:o?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===6?i.edits.push({resource:a.uri,textEdit:{range:V.from(a.range),text:a.edit.value,insertAsSnippet:!0,keepWhitespace:a.keepWhitespace},versionId:s.has(a.uri)?void 0:o?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===3?i.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:o?.getNotebookDocumentVersion(a.uri)}):a._type===5&&i.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:o?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:1,index:a.index,count:a.count,cells:a.cells.map(sf.from)}})}return i}t.from=r;function e(n){let o=new _o,i=new qe;for(let s of n.edits)if(s.textEdit){let a=s,l=y.revive(a.resource),d=V.to(a.textEdit.range),c=a.textEdit.text,u=a.textEdit.insertAsSnippet,m;u?m=ms.replace(d,new Sn(c)):m=un.replace(d,c);let g=i.get(l);g?g.push(m):i.set(l,[m])}else o.renameFile(y.revive(s.oldResource),y.revive(s.newResource),s.options);for(let[s,a]of i)o.set(s,a);return o}t.to=e})(Bn||={});var Ko;(n=>{let r=Object.create(null);r[0]=0,r[1]=1,r[2]=2,r[3]=3,r[4]=4,r[5]=5,r[6]=6,r[7]=7,r[8]=8,r[9]=9,r[10]=10,r[11]=11,r[12]=12,r[13]=13,r[14]=14,r[15]=15,r[16]=16,r[17]=17,r[18]=18,r[19]=19,r[20]=20,r[21]=21,r[22]=22,r[23]=23,r[24]=24,r[25]=25;function e(o){return typeof r[o]=="number"?r[o]:6}n.from=e;function t(o){for(let i in r)if(r[i]===o)return Number(i);return 6}n.to=t})(Ko||={});var Ms;(t=>{function r(n){if(n===1)return 1}t.from=r;function e(n){if(n===1)return 1}t.to=e})(Ms||={});var nl;(t=>{function r(n){return{name:n.name,kind:Ko.from(n.kind),tags:n.tags&&n.tags.map(Ms.from),containerName:n.containerName,location:Vn.from(n.location)}}t.from=r;function e(n){let o=new $o(n.name,Ko.to(n.kind),n.containerName,Vn.to(n.location));return o.tags=n.tags&&n.tags.map(Ms.to),o}t.to=e})(nl||={});var K_;(t=>{function r(n){let o={name:n.name||"!!MISSING: name!!",detail:n.detail,range:V.from(n.range),selectionRange:V.from(n.selectionRange),kind:Ko.from(n.kind),tags:n.tags?.map(Ms.from)??[]};return n.children&&(o.children=n.children.map(r)),o}t.from=r;function e(n){let o=new zo(n.name,n.detail,Ko.to(n.kind),V.to(n.range),V.to(n.selectionRange));return Qs(n.tags)&&(o.tags=n.tags.map(Ms.to)),n.children&&(o.children=n.children.map(e)),o}t.to=e})(K_||={});var Os;(t=>{function r(n){let o=new Wa(Ko.to(n.kind),n.name,n.detail||"",y.revive(n.uri),V.to(n.range),V.to(n.selectionRange));return o._sessionId=n._sessionId,o._itemId=n._itemId,o}t.to=r;function e(n,o,i){if(o=o??n._sessionId,i=i??n._itemId,o===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:o,_itemId:i,name:n.name,detail:n.detail,kind:Ko.from(n.kind),uri:n.uri,range:V.from(n.range),selectionRange:V.from(n.selectionRange),tags:n.tags?.map(Ms.from)}}t.from=e})(Os||={});var q_;(e=>{function r(t){return new hu(Os.to(t.from),t.fromRanges.map(n=>V.to(n)))}e.to=r})(q_||={});var G_;(e=>{function r(t){return new vu(Os.to(t.to),t.fromRanges.map(n=>V.to(n)))}e.to=r})(G_||={});var Vn;(t=>{function r(n){return{range:n.range&&V.from(n.range),uri:n.uri}}t.from=r;function e(n){return new At(y.revive(n.uri),V.to(n.range))}t.to=e})(Vn||={});var zu;(t=>{function r(n){let o=n,i=n;return{originSelectionRange:o.originSelectionRange?V.from(o.originSelectionRange):void 0,uri:o.targetUri?o.targetUri:i.uri,range:V.from(o.targetRange?o.targetRange:i.range),targetSelectionRange:o.targetSelectionRange?V.from(o.targetSelectionRange):void 0}}t.from=r;function e(n){return{targetUri:y.revive(n.uri),targetRange:V.to(n.range),targetSelectionRange:n.targetSelectionRange?V.to(n.targetSelectionRange):void 0,originSelectionRange:n.originSelectionRange?V.to(n.originSelectionRange):void 0}}t.to=e})(zu||={});var Ku;(t=>{function r(n){return{range:V.from(n.range),contents:ce.fromMany(n.contents),canIncreaseVerbosity:n.canIncreaseVerbosity,canDecreaseVerbosity:n.canDecreaseVerbosity}}t.from=r;function e(n){let o=n.contents.map(ce.to),i=V.to(n.range),s=n.canIncreaseVerbosity,a=n.canDecreaseVerbosity;return new Ta(o,i,s,a)}t.to=e})(Ku||={});var j_;(t=>{function r(n){return{range:V.from(n.range),expression:n.expression}}t.from=r;function e(n){return new Na(V.to(n.range),n.expression)}t.to=e})(j_||={});var pf;(t=>{function r(n){if(n instanceof Ua)return{type:"text",range:V.from(n.range),text:n.text};if(n instanceof Fa)return{type:"variable",range:V.from(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};if(n instanceof Ha)return{type:"expression",range:V.from(n.range),expression:n.expression};throw new Error("Unknown 'InlineValue' type")}t.from=r;function e(n){switch(n.type){case"text":return{range:V.to(n.range),text:n.text};case"variable":return{range:V.to(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};case"expression":return{range:V.to(n.range),expression:n.expression}}}t.to=e})(pf||={});var mf;(t=>{function r(n){return{frameId:n.frameId,stoppedLocation:V.from(n.stoppedLocation)}}t.from=r;function e(n){return new mu(n.frameId,V.to(n.stoppedLocation))}t.to=e})(mf||={});var Md;(t=>{function r(n){return{range:V.from(n.range),kind:n.kind}}t.from=r;function e(n){return new Ea(V.to(n.range),n.kind)}t.to=e})(Md||={});var Q_;(t=>{function r(n){return{uri:n.uri,highlights:n.highlights.map(Md.from)}}t.from=r;function e(n){return new wa(y.revive(n.uri),n.highlights.map(Md.to))}t.to=e})(Q_||={});var EO;(e=>{function r(t){switch(t){case 1:return 1;case 2:return 2;case 0:default:return 0}}e.to=r})(EO||={});var J_;(e=>{function r(t){return{triggerKind:EO.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}e.to=r})(J_||={});var SI;(t=>{function r(n){if(n===1)return 1}t.from=r;function e(n){if(n===1)return 1}t.to=e})(SI||={});var X_;(e=>{function r(t,n,o){return"icon"in t&&"command"in t?{command:n.toInternal(t.command,o),icon:Xr.fromThemeIcon(t.icon)}:{command:n.toInternal(t,o)}}e.from=r})(X_||={});var CI;(o=>{let r=new Map([[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,7],[21,6],[8,8],[9,9],[10,12],[11,13],[20,14],[12,15],[19,16],[13,17],[14,28],[0,18],[15,19],[16,20],[17,21],[18,23],[22,10],[23,11],[24,24],[26,26],[25,25]]);function e(i){return r.get(i)??9}o.from=e;let t=new Map([[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[7,7],[6,21],[8,8],[9,9],[12,10],[13,11],[14,20],[15,12],[16,19],[17,13],[28,14],[18,0],[19,15],[20,16],[21,17],[23,18],[10,22],[11,23],[24,24],[25,25],[26,26]]);function n(i){return t.get(i)??9}o.to=n})(CI||={});var Y_;(e=>{function r(t,n){let o=new Da(t.label);return o.insertText=t.insertText,o.kind=CI.to(t.kind),o.tags=t.tags?.map(SI.to),o.detail=t.detail,o.documentation=Mr(t.documentation)?ce.to(t.documentation):t.documentation,o.sortText=t.sortText,o.filterText=t.filterText,o.preselect=t.preselect,o.commitCharacters=t.commitCharacters,Oe.isIRange(t.range)?o.range=V.to(t.range):typeof t.range=="object"&&(o.range={inserting:V.to(t.range.insert),replacing:V.to(t.range.replace)}),o.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&1),typeof t.insertTextRules<"u"&&t.insertTextRules&4?o.insertText=new Sn(t.insertText):(o.insertText=t.insertText,o.textEdit=o.range instanceof pe?new un(o.range,o.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(o.additionalTextEdits=t.additionalTextEdits.map(i=>tn.to(i))),o.command=n&&t.command?n.fromInternal(t.command):void 0,o}e.to=r})(Y_||={});var F_;(t=>{function r(n){if(typeof n.label!="string"&&!Array.isArray(n.label))throw new TypeError("Invalid label");return{label:n.label,documentation:ce.fromStrict(n.documentation)}}t.from=r;function e(n){return{label:n.label,documentation:Mr(n.documentation)?ce.to(n.documentation):n.documentation}}t.to=e})(F_||={});var H_;(t=>{function r(n){return{label:n.label,documentation:ce.fromStrict(n.documentation),parameters:Array.isArray(n.parameters)?n.parameters.map(F_.from):[],activeParameter:n.activeParameter}}t.from=r;function e(n){return{label:n.label,documentation:Mr(n.documentation)?ce.to(n.documentation):n.documentation,parameters:Array.isArray(n.parameters)?n.parameters.map(F_.to):[],activeParameter:n.activeParameter}}t.to=e})(H_||={});var qu;(t=>{function r(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(H_.from):[]}}t.from=r;function e(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(H_.to):[]}}t.to=e})(qu||={});var Z_;(e=>{function r(t,n){let o=new Pa(Xe.to(n.position),typeof n.label=="string"?n.label:n.label.map(wO.to.bind(void 0,t)),n.kind&&TI.to(n.kind));return o.textEdits=n.textEdits&&n.textEdits.map(tn.to),o.tooltip=Mr(n.tooltip)?ce.to(n.tooltip):n.tooltip,o.paddingLeft=n.paddingLeft,o.paddingRight=n.paddingRight,o}e.to=r})(Z_||={});var wO;(e=>{function r(t,n){let o=new _a(n.label);return o.tooltip=Mr(n.tooltip)?ce.to(n.tooltip):n.tooltip,Pw.is(n.command)&&(o.command=t.fromInternal(n.command)),n.location&&(o.location=Vn.to(n.location)),o}e.to=r})(wO||={});var TI;(t=>{function r(n){return n}t.from=r;function e(n){return n}t.to=e})(TI||={});var Ns;(t=>{function r(n){return{range:V.from(n.range),url:n.target,tooltip:n.tooltip}}t.from=r;function e(n){let o;if(n.url)try{o=typeof n.url=="string"?y.parse(n.url,!0):y.revive(n.url)}catch{}let i=new Ra(V.to(n.range),o);return i.tooltip=n.tooltip,i}t.to=e})(Ns||={});var gf;(t=>{function r(n){let o=new Aa(n.label);return n.textEdit&&(o.textEdit=tn.to(n.textEdit)),n.additionalTextEdits&&(o.additionalTextEdits=n.additionalTextEdits.map(i=>tn.to(i))),o}t.to=r;function e(n){return{label:n.label,textEdit:n.textEdit?tn.from(n.textEdit):void 0,additionalTextEdits:n.additionalTextEdits?n.additionalTextEdits.map(o=>tn.from(o)):void 0}}t.from=e})(gf||={});var Ud;(t=>{function r(n){return new $r(n[0],n[1],n[2],n[3])}t.to=r;function e(n){return[n.red,n.green,n.blue,n.alpha]}t.from=e})(Ud||={});var eP;(t=>{function r(n){return{range:V.from(n.range)}}t.from=r;function e(n){return new Ci(V.to(n.range))}t.to=e})(eP||={});var ff;(e=>{function r(t){switch(t){case 2:return 2;case 1:return 1;case 3:case 4:return 3}}e.to=r})(ff||={});var Fd;(t=>{function r(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}t.from=r;function e(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}t.to=e})(Fd||={});var Ad;(t=>{function r(n){if(n===2)return 1;if(n===1)return 0}t.from=r;function e(n){if(n===1)return 2;if(n===0)return 1}t.to=e})(Ad||={});var EI;(e=>{function r(t){if(typeof t=="object")return t.viewId;switch(t){case 1:return 3;case 10:return 10;case 15:return 15}throw new Error("Unknown 'ProgressLocation'")}e.from=r})(EI||={});var hf;(t=>{function r(n){let o={start:n.start+1,end:n.end+1};return n.kind&&(o.kind=V_.from(n.kind)),o}t.from=r;function e(n){let o={start:n.start-1,end:n.end-1};return n.kind&&(o.kind=V_.to(n.kind)),o}t.to=e})(hf||={});var V_;(t=>{function r(n){if(n)switch(n){case 1:return ss.Comment;case 2:return ss.Imports;case 3:return ss.Region}}t.from=r;function e(n){if(n)switch(n.value){case ss.Comment.value:return 1;case ss.Imports.value:return 2;case ss.Region.value:return 3}}t.to=e})(V_||={});var vf;(e=>{function r(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?V.from(t.selection):void 0,override:typeof t.override=="boolean"?Nw.id:void 0}}e.from=r})(vf||={});var so;(o=>{function r(i){return i instanceof wi?i.toJSON():typeof i=="string"?i:e(i)||t(i)?new wi(i.baseUri??i.base,i.pattern).toJSON():i}o.from=r;function e(i){let s=i;return s?y.isUri(s.baseUri)&&typeof s.pattern=="string":!1}function t(i){let s=i;return s?typeof s.base=="string"&&typeof s.pattern=="string":!1}function n(i){return typeof i=="string"?i:new wi(y.revive(i.baseUri),i.pattern)}o.to=n})(so||={});var tP;(e=>{function r(t){if(t){if(Array.isArray(t))return t.map(r);if(typeof t=="string")return t;{let n=t;return{language:n.language,scheme:n.scheme,pattern:so.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType}}}else return}e.from=r})(tP||={});var qo;(t=>{function r(n){return{start:n.start,end:n.end}}t.from=r;function e(n){return new Rn(n.start,n.end)}t.to=e})(qo||={});var Wu;(t=>{function r(n){return{timing:typeof n.runStartTime=="number"&&typeof n.runEndTime=="number"?{startTime:n.runStartTime,endTime:n.runEndTime}:void 0,executionOrder:n.executionOrder,success:n.lastRunSuccess}}t.to=r;function e(n){return{lastRunSuccess:n.success,runStartTime:n.timing?.startTime,runEndTime:n.timing?.endTime,executionOrder:n.executionOrder}}t.from=e})(Wu||={});var rf;(t=>{function r(n){switch(n){case 1:return 1;case 2:default:return 2}}t.from=r;function e(n){switch(n){case 1:return 1;case 2:default:return 2}}t.to=e})(rf||={});var ol;(t=>{function r(n){let o={metadata:n.metadata??Object.create(null),cells:[]};for(let i of n.cells)yi.validate(i),o.cells.push(sf.from(i));return o}t.from=r;function e(n){let o=new cd(n.cells.map(sf.to));return yc(n.metadata)||(o.metadata=n.metadata),o}t.to=e})(ol||={});var sf;(t=>{function r(n){return{cellKind:rf.from(n.kind),language:n.languageId,mime:n.mime,source:n.value,metadata:n.metadata,internalMetadata:Wu.from(n.executionSummary??{}),outputs:n.outputs?n.outputs.map(As.from):[]}}t.from=r;function e(n){return new yi(rf.to(n.cellKind),n.source,n.language,n.mime,n.outputs?n.outputs.map(As.to):void 0,n.metadata,n.internalMetadata?Wu.to(n.internalMetadata):void 0)}t.to=e})(sf||={});var Ld;(t=>{function r(n){return{mime:n.mime,valueBytes:ee.wrap(n.data)}}t.from=r;function e(n){return new ud(n.valueBytes.buffer,n.mime)}t.to=e})(Ld||={});var As;(t=>{function r(n){return{outputId:n.id,items:n.items.map(Ld.from),metadata:n.metadata}}t.from=r;function e(n){let o=n.items.map(Ld.to);return new Ii(o,n.outputId,n.metadata)}t.to=e})(As||={});var bf;(n=>{function r(o){return t(o)?{include:so.from(o.include)??void 0,exclude:so.from(o.exclude)??void 0}:so.from(o)??void 0}n.from=r;function e(o){return t(o)?{include:so.to(o.include),exclude:so.to(o.exclude)}:so.to(o)}n.to=e;function t(o){let i=o;return i?!wt(i.include)&&!wt(i.exclude):!1}})(bf||={});var nP;(e=>{function r(t,n,o){let i=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===1?1:2,command:n.toInternal(i,o),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}e.from=r})(nP||={});var oP;(e=>{function r(t,n,o){let i=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:n.toInternal(i,o),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}e.from=r})(oP||={});var rP;(e=>{function r(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}e.from=r})(rP||={});var wI;(t=>{function r(n){return{uri:n.uri,provides:n.provides}}t.from=r;function e(n){return new xu(y.revive(n.uri),n.provides)}t.to=e})(wI||={});var Gu;(t=>{function r(n){return{message:ce.fromStrict(n.message)||"",type:0,expected:n.expectedOutput,actual:n.actualOutput,contextValue:n.contextValue,location:n.location&&{range:V.from(n.location.range),uri:n.location.uri},stackTrace:n.stackTrace?.map(o=>({label:o.label,position:o.position&&Xe.from(o.position),uri:o.uri&&y.revive(o.uri).toJSON()}))}}t.from=r;function e(n){let o=new ki(typeof n.message=="string"?n.message:ce.to(n.message));return o.actualOutput=n.actual,o.expectedOutput=n.expected,o.contextValue=n.contextValue,o.location=n.location?Vn.to(n.location):void 0,o}t.to=e})(Gu||={});var yr;(t=>(t.namespace=ru,t.denamespace=Kb))(yr||={});var iP;(e=>{function r(t){return{controllerId:t.controllerId,profileId:t.profileId,group:ju.from(t.kind)}}e.from=r})(iP||={});var ju;(t=>{let r={3:8,2:4,1:2};function e(n){return r.hasOwnProperty(n)?r[n]:2}t.from=e})(ju||={});var Oi;(t=>{function r(n){let o=iu(n).controllerId;return{extId:ze.fromExtHostTestItem(n,o).toString(),label:n.label,uri:y.revive(n.uri),busy:n.busy,tags:n.tags.map(i=>yr.namespace(o,i.id)),range:Oe.lift(V.from(n.range)),description:n.description||null,sortText:n.sortText||null,error:n.error&&ce.fromStrict(n.error)||null}}t.from=r;function e(n){return{parent:void 0,error:void 0,id:ze.fromString(n.extId).localId,label:n.label,uri:y.revive(n.uri),tags:(n.tags||[]).map(o=>{let{tagId:i}=yr.denamespace(o);return new ys(i)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:V.to(n.range||void 0),canResolveChildren:!1,busy:n.busy,description:n.description||void 0,sortText:n.sortText||void 0}}t.toPlain=e})(Oi||={});(t=>{function r(n){return{id:n.id}}t.from=r;function e(n){return new ys(n.id)}t.to=e})(yr||={});var sP;(t=>{let r=(n,o)=>{let i=n.value;if(!i)return;let s={...Oi.toPlain(i.item),parent:o,taskStates:i.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===0).map(Gu.to)})),children:[]};if(n.children)for(let a of n.children.values()){let l=r(a,s);l&&s.children.push(l)}return s};function e(n){let o=new Kv;for(let a of n.items)o.insert(ze.fromString(a.item.extId).path,a);let i=[o.nodes],s=[];for(;i.length;)for(let a of i.pop())a.value?s.push(a):a.children&&i.push(a.children.values());return{completedAt:n.completedAt,results:s.map(a=>r(a)).filter(Kn)}}t.to=e})(sP||={});var yf;(s=>{function r(a){return{covered:a.covered,total:a.total}}function e(a){return"line"in a?Xe.from(a):V.from(a)}function t(a){if(a)return"endLineNumber"in a?V.to(a):Xe.to(a)}function n(a){if(a.type===1){let l=[];if(a.branches)for(let d of a.branches)l.push({executed:d.count,location:t(d.location),label:d.label});return new Cu(a.count,t(a.location),a.branches?.map(d=>new Tu(d.count,t(d.location),d.label)))}else return new Eu(a.name,a.count,t(a.location))}s.to=n;function o(a){if(typeof a.executed=="number"&&a.executed<0)throw new Error(`Invalid coverage count ${a.executed}`);return"branches"in a?{count:a.executed,location:e(a.location),type:1,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&e(l.location),label:l.label})):void 0}:{type:0,name:a.name,count:a.executed,location:e(a.location)}}s.fromDetails=o;function i(a,l,d){return tf(d.statementCoverage),tf(d.branchCoverage),tf(d.declarationCoverage),{id:l,uri:d.uri,statement:r(d.statementCoverage),branch:d.branchCoverage&&r(d.branchCoverage),declaration:d.declarationCoverage&&r(d.declarationCoverage),testIds:d instanceof Is&&d.includesTests.length?d.includesTests.map(c=>ze.fromExtHostTestItem(c,a).toString()):void 0}}s.fromFile=i})(yf||={});var aP;(e=>{function r(t){switch(t){case 1:return 1;case 2:return 2}}e.to=r})(aP||={});var Us;(t=>{function r(n){let o=new Ka(Ko.to(n.kind),n.name,n.detail||"",y.revive(n.uri),V.to(n.range),V.to(n.selectionRange));return o._sessionId=n._sessionId,o._itemId=n._itemId,o}t.to=r;function e(n,o,i){if(o=o??n._sessionId,i=i??n._itemId,o===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:o,_itemId:i,kind:Ko.from(n.kind),name:n.name,detail:n.detail??"",uri:n.uri,range:V.from(n.range),selectionRange:V.from(n.selectionRange),tags:n.tags?.map(Ms.from)}}t.from=e})(Us||={});var If;(e=>{function r(t){if(t)return{value:t.value,tooltip:t.tooltip}}e.from=r})(If||={});var Rd;(o=>{function r(i,s,a){let l=s.fileData;return l?new ry(new iy(l.name,y.revive(l.uri),l.id,fc(()=>a(l.id)))):i===eo.uriList&&s.uriListData?new $a(n(s.uriListData)):new $a(s.asString)}o.to=r;async function e(i,s,a=pt()){let l=await s.asString();if(i===eo.uriList)return{id:a,asString:l,fileData:void 0,uriListData:t(l)};let d=s.asFile();return{id:a,asString:l,fileData:d?{name:d.name,uri:d.uri,id:d._itemId??d.id}:void 0}}o.from=e;function t(i){return Uv.split(i).map(s=>{if(s.startsWith("#"))return s;try{return y.parse(s)}catch{}return s})}function n(i){return Uv.create(i.map(s=>typeof s=="string"?s:y.revive(s)))}})(Rd||={});var Hd;(n=>{function r(o,i){let s=o.items.map(([a,l])=>[a,Rd.to(a,l,i)]);return new mr(s)}n.toDataTransfer=r;async function e(o){return{items:await Promise.all(Array.from(o,async([s,a])=>[s,await Rd.from(s,a)]))}}n.from=e;async function t(o){return{items:await Promise.all(Array.from(o,async([s,a])=>[s,await Rd.from(s,a,a.id)]))}}n.fromList=t})(Hd||={});var kI;(t=>{function r(n,o){return{kind:"reply",agentId:n.participant??o?.agentId??"",subCommand:n.command??o?.command,message:n.prompt,title:n.label}}t.from=r;function e(n){return{prompt:n.message,label:n.title,participant:n.agentId,command:n.subCommand}}t.to=e})(kI||={});var af;(t=>{function r(n){switch(n){case 0:return 3;case 1:return 1;case 2:return 2}}t.to=r;function e(n){switch(n){case 3:return 0;case 1:return 1;case 2:return 2}return 1}t.from=e})(af||={});var w5;(t=>{function r(n){let o=n.content.map(a=>{if(a.type==="text")return new Lt(a.value,a.audience);if(a.type==="tool_result"){let l=Ze(a.value.map(d=>d.type==="text"?new Lt(d.value,d.audience):d.type==="data"?new mn(d.data.buffer,d.mimeType):d.type==="prompt_tsx"?new vr(d.value):void 0));return new Li(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return new mn(a.value.data.buffer,a.value.mimeType);if(a.type==="data")return new mn(a.data.buffer,a.mimeType);if(a.type==="tool_use")return new hr(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),i=af.to(n.role);return new Fu(i,o,n.name)}t.to=r;function e(n){let o=af.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new Lt(s)]);let a=s.map(l=>{if(l instanceof Li)return{type:"tool_result",toolCallId:l.callId,value:Ze(l.content.map(d=>d instanceof Lt?{type:"text",value:d.value,audience:d.audience}:d instanceof vr?{type:"prompt_tsx",value:d.value}:d instanceof mn?{type:"data",mimeType:d.mimeType,data:ee.wrap(d.data),audience:d.audience}:void 0)),isError:l.isError};if(l instanceof mn)return kO(l)?{type:"image_url",value:{mimeType:l.mimeType,data:ee.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:ee.wrap(l.data),audience:l.audience};if(l instanceof hr)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Lt)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type");return{type:"text",value:l}});return{role:o,name:i,content:a}}t.from=e})(w5||={});var _I;(t=>{function r(n){let o=n.content.map(a=>{if(a.type==="text")return new Lt(a.value,a.audience);if(a.type==="tool_result"){let l=a.value.map(d=>d.type==="text"?new Lt(d.value,d.audience):d.type==="data"?new mn(d.data.buffer,d.mimeType):new vr(d.value));return new Li(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new mn(a.value.data.buffer,a.value.mimeType):a.type==="data"?new mn(a.data.buffer,a.mimeType):a.type==="thinking"?new Qr(a.value,a.id,a.metadata):new hr(a.toolCallId,a.name,a.parameters)}),i=af.to(n.role);return new Hu(i,o,n.name)}t.to=r;function e(n){let o=af.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new Lt(s)]);let a=s.map(l=>{if(l instanceof Li)return{type:"tool_result",toolCallId:l.callId,value:Ze(l.content.map(d=>d instanceof Lt?{type:"text",value:d.value,audience:d.audience}:d instanceof vr?{type:"prompt_tsx",value:d.value}:d instanceof mn?{type:"data",mimeType:d.mimeType,data:ee.wrap(d.data),audience:d.audience}:void 0)),isError:l.isError};if(l instanceof mn)return kO(l)?{type:"image_url",value:{mimeType:l.mimeType,data:ee.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:ee.wrap(l.data),audience:l.audience};if(l instanceof hr)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof Lt)return{type:"text",value:l.value};if(l instanceof Qr)return{type:"thinking",value:l.value,id:l.id,metadata:l.metadata};if(typeof l!="string")throw new Error("Unexpected chat message content type llm 2");return{type:"text",value:l}});return{role:o,name:i,content:a}}t.from=e})(_I||={});function kO(r){switch(typeof r.mimeType=="string"?r.mimeType.toLowerCase():""){case"image/png":case"image/jpeg":case"image/jpg":case"image/gif":case"image/webp":case"image/bmp":return!0;default:return!1}}var lf;(t=>{function r(n){return{kind:"markdownContent",content:ce.from(n.value)}}t.from=r;function e(n){return new Ss(ce.to(n.content))}t.to=e})(lf||={});var PI;(t=>{function r(n){return{kind:"codeblockUri",uri:n.value,isEdit:n.isEdit,undoStopId:n.undoStopId}}t.from=r;function e(n){return new ks(y.revive(n.uri),n.isEdit,n.undoStopId)}t.to=e})(PI||={});var DI;(t=>{function r(n){return{kind:"markdownVuln",content:ce.from(n.value),vulnerabilities:n.vulnerabilities}}t.from=r;function e(n){return new Pi(ce.to(n.content),n.vulnerabilities)}t.to=e})(DI||={});var RI;(e=>{function r(t){return{kind:"confirmation",title:t.title,message:ce.from(t.message),data:t.data,buttons:t.buttons}}e.from=r})(RI||={});var MI;(o=>{function r(i){switch(i){case 1:return"text";case 2:return"singleSelect";case 3:return"multiSelect";default:return"text"}}function e(i){switch(i){case"text":return 1;case"singleSelect":return 2;case"multiSelect":return 3;default:return 1}}function t(i){return{kind:"questionCarousel",questions:i.questions.map(s=>({id:s.id,type:r(s.type),title:s.title,message:s.message?ce.from(s.message):void 0,options:s.options,defaultValue:s.defaultValue,allowFreeformInput:s.allowFreeformInput})),allowSkip:i.allowSkip}}o.from=t;function n(i){let s=i.questions.map(a=>new Au(a.id,e(a.type),a.title,{message:a.message?typeof a.message=="string"?new Mt(a.message):ce.to(a.message):void 0,options:a.options?.map(l=>({id:l.id,label:l.label,value:l.value})),defaultValue:a.defaultValue,allowFreeformInput:a.allowFreeformInput}));return new Mi(s,i.allowSkip)}o.to=n})(MI||={});var df;(t=>{function r(n){let{value:o,baseUri:i}=n;function s(a,l){return a.map(d=>{let c=y.joinPath(l,d.name);return{label:d.name,uri:c,children:d.children&&s(d.children,c)}})}return{kind:"treeData",treeData:{label:Bt(i),uri:i,children:s(o,i)}}}t.from=r;function e(n){let o=$t(n.treeData);function i(l){return l.map(d=>({name:d.label,children:d.children&&i(d.children)}))}let s=o.uri,a=o.children?i(o.children):[];return new Ts(a,s)}t.to=e})(df||={});var _O;(t=>{function r(n){return{kind:"multiDiffData",multiDiffData:{title:n.title,resources:n.value.map(o=>({originalUri:o.originalUri,modifiedUri:o.modifiedUri,goToFileUri:o.goToFileUri,added:o.added,removed:o.removed}))},readOnly:n.readOnly}}t.from=r;function e(n){let o=n.multiDiffData.resources.map(i=>({originalUri:i.originalUri?y.revive(i.originalUri):void 0,modifiedUri:i.modifiedUri?y.revive(i.modifiedUri):void 0,goToFileUri:i.goToFileUri?y.revive(i.goToFileUri):void 0,added:i.added,removed:i.removed}));return new Cd(o,n.multiDiffData.title,n.readOnly)}t.to=e})(_O||={});var $u;(t=>{function r(n){let o=s=>y.isUri(s),i=s=>"name"in s;return{kind:"inlineReference",name:n.title,inlineReference:o(n.value)?n.value:i(n.value)?nl.from(n.value):br.from(n.value)}}t.from=r;function e(n){let o=$t(n);return new Di(y.isUri(o.inlineReference)?o.inlineReference:"location"in o.inlineReference?nl.to(o.inlineReference):br.to(o.inlineReference),n.name)}t.to=e})($u||={});var xf;(t=>{function r(n){return{kind:"progressMessage",content:ce.from(n.value)}}t.from=r;function e(n){return new Ed(n.content.value)}t.to=e})(xf||={});var Sf;(t=>{function r(n){return{kind:"thinking",value:n.value,id:n.id,metadata:n.metadata}}t.from=r;function e(n){return new jr(n.value??"",n.id,n.metadata)}t.to=e})(Sf||={});var AI;(t=>{function r(n){return{kind:"hook",hookType:n.hookType,stopReason:n.stopReason,systemMessage:n.systemMessage,metadata:n.metadata}}t.from=r;function e(n){return new Es(n.hookType,n.stopReason,n.systemMessage,n.metadata)}t.to=e})(AI||={});var Cf;(t=>{function r(n){return{kind:"warning",content:ce.from(n.value)}}t.from=r;function e(n){return new Ri(n.content.value)}t.to=e})(Cf||={});var PO;(e=>{function r(t){return{kind:"extensions",extensions:t.extensions}}e.from=r})(PO||={});var DO;(e=>{function r(t,n,o){let i;if(t.command)i=n.toInternal(t.command,o);else{if(!t.uri)throw new Error("Pull request part must have a command if URI is provided");i={title:"Open Pull Request",id:"vscode.open",arguments:[t.uri]}}return{kind:"pullRequest",author:t.author,title:t.title,description:t.description,uri:t.uri,linkTag:t.linkTag,command:i}}e.from=r})(DO||={});var RO;(t=>{function r(n){return{kind:"move",uri:n.uri,range:V.from(n.range)}}t.from=r;function e(n){return new Ps(y.revive(n.uri),V.to(n.range))}t.to=e})(RO||={});var MO;(l=>{function r(d){let c,u;d.toolSpecificData&&e(d.toolSpecificData)?(c=t(d.toolSpecificData,d.isError),u=void 0):u=d.toolSpecificData?n(d.toolSpecificData):void 0;let m=d.presentation==="hidden"?"hidden":d.presentation==="hiddenAfterComplete"?"hiddenAfterComplete":void 0;return d.enablePartialUpdate?{kind:"externalToolInvocationUpdate",toolCallId:d.toolCallId,toolName:d.toolName,isComplete:!!d.isComplete,invocationMessage:d.invocationMessage?ce.from(d.invocationMessage):void 0,pastTenseMessage:d.pastTenseMessage?ce.from(d.pastTenseMessage):void 0,toolSpecificData:u,subagentInvocationId:d.subAgentInvocationId}:{kind:"toolInvocationSerialized",toolCallId:d.toolCallId,toolId:d.toolName,invocationMessage:d.invocationMessage?ce.from(d.invocationMessage):d.toolName,originMessage:d.originMessage?ce.from(d.originMessage):void 0,pastTenseMessage:d.pastTenseMessage?ce.from(d.pastTenseMessage):void 0,isConfirmed:d.isConfirmed,isComplete:!0,source:Eo.External,toolSpecificData:u,resultDetails:c,presentation:m,subAgentInvocationId:d.subAgentInvocationId}}l.from=r;function e(d){return d!==null&&typeof d=="object"&&"input"in d&&typeof d.input=="string"&&"output"in d&&Array.isArray(d.output)}function t(d,c){return{input:d.input,output:d.output.map(u=>{let m=u.mimeType.startsWith("text/");return{type:"embed",mimeType:u.mimeType,value:m?ee.wrap(u.data).toString():er(ee.wrap(u.data)),isText:m}}),isError:c??!1}}function n(d){return"command"in d&&"language"in d?{kind:"terminal",command:d.command,language:d.language}:"commandLine"in d&&"language"in d?{kind:"terminal",commandLine:d.commandLine,language:d.language,terminalCommandOutput:typeof d.output?.text=="string"?{text:d.output.text}:void 0,terminalCommandState:d.state?{exitCode:d.state.exitCode,duration:d.state.duration}:void 0}:"todoList"in d&&Array.isArray(d.todoList)?{kind:"todoList",todoList:d.todoList.map(c=>({id:String(c.id),title:c.title,status:o(c.status)}))}:"input"in d&&"output"in d&&!Array.isArray(d.output)?{kind:"simpleToolInvocation",input:typeof d.input=="string"?d.input:"",output:typeof d.output=="string"?d.output:""}:d&&"values"in d&&Array.isArray(d.values)?{kind:"resources",values:d.values.map(c=>c instanceof At?br.from(c):y.revive(c))}:d instanceof Mu?{kind:"subagent",description:d.description,agentName:d.agentName,prompt:d.prompt,result:d.result}:d}function o(d){switch(d){case 1:return"not-started";case 2:return"in-progress";case 3:return"completed";default:return"not-started"}}function i(d){switch(d){case"not-started":return 1;case"in-progress":return 2;case"completed":return 3;default:return 1}}function s(d){let c=new wd(d.toolId||d.toolName,d.toolCallId,d.errorMessage);return d.invocationMessage&&(c.invocationMessage=d.invocationMessage),d.originMessage&&(c.originMessage=d.originMessage),d.pastTenseMessage&&(c.pastTenseMessage=d.pastTenseMessage),d.isConfirmed!==void 0&&(c.isConfirmed=d.isConfirmed),d.isComplete!==void 0&&(c.isComplete=d.isComplete),d.toolSpecificData&&(c.toolSpecificData=a(d.toolSpecificData)),c.subAgentInvocationId=d.subAgentInvocationId,c.subAgentName=d.subAgentName,c}l.to=s;function a(d){if(d.kind==="terminal")if(d.commandLine){let c={commandLine:d.commandLine,language:d.language};return d.terminalCommandOutput&&(c.output={text:d.terminalCommandOutput.text,truncated:d.terminalCommandOutput.truncated,lineCount:d.terminalCommandOutput.lineCount}),d.terminalCommandState&&(c.state={exitCode:d.terminalCommandState.exitCode,duration:d.terminalCommandState.duration}),c}else return{command:d.command,language:d.language};else{if(d.kind==="terminal2")return{commandLine:d.commandLine,language:d.language};if(d.kind==="todoList")return{todoList:d.todoList.map((c,u)=>{let m=Number(c.id);return{id:Number.isFinite(m)?m:u,title:c.title,status:i(c.status)}})}}return d}})(MO||={});var LI;(e=>{function r(t){return{kind:"progressTask",content:ce.from(t.value)}}e.from=r})(LI||={});var lP;(e=>{function r(t){return{kind:"progressTaskResult",content:typeof t=="string"?ce.from(t):void 0}}e.from=r})(lP||={});var cf;(t=>{function r(n,o,i){return{kind:"command",command:o.toInternal(n.value,i)??{command:n.value.command,title:n.value.title}}}t.from=r;function e(n,o){return new ws(o.fromInternal(n.command)??{command:n.command.id,title:n.command.title})}t.to=e})(cf||={});var OI;(t=>{function r(n){return{kind:"textEdit",uri:n.uri,edits:n.edits.map(o=>tn.from(o)),done:n.isDone}}t.from=r;function e(n){let o=new Ai(y.revive(n.uri),n.edits.map(i=>tn.to(i)));return o.isDone=n.done,o}t.to=e})(OI||={});var NI;(e=>{function r(t){return t.newCellMetadata?{editType:3,index:t.range.start,metadata:t.newCellMetadata}:t.newNotebookMetadata?{editType:5,metadata:t.newNotebookMetadata}:{editType:1,index:t.range.start,count:t.range.end-t.range.start,cells:t.newCells.map(sf.from)}}e.from=r})(NI||={});var UI;(e=>{function r(t){return{kind:"notebookEdit",uri:t.uri,edits:t.edits.map(NI.from),done:t.isDone}}e.from=r})(UI||={});var FI;(e=>{function r(t){return{kind:"workspaceEdit",edits:t.edits.map(n=>({oldResource:n.oldResource,newResource:n.newResource}))}}e.from=r})(FI||={});var Od;(t=>{function r(n){let o=vt.isThemeIcon(n.iconPath)?n.iconPath:y.isUri(n.iconPath)?{light:y.revive(n.iconPath)}:n.iconPath&&"light"in n.iconPath&&"dark"in n.iconPath&&y.isUri(n.iconPath.light)&&y.isUri(n.iconPath.dark)?{light:y.revive(n.iconPath.light),dark:y.revive(n.iconPath.dark)}:void 0;return typeof n.value=="object"&&"variableName"in n.value?{kind:"reference",reference:{variableName:n.value.variableName,value:y.isUri(n.value.value)||!n.value.value?n.value.value:br.from(n.value.value)},iconPath:o,options:n.options}:{kind:"reference",reference:y.isUri(n.value)||typeof n.value=="string"?n.value:br.from(n.value),iconPath:o,options:n.options}}t.from=r;function e(n){let o=$t(n),i=s=>y.isUri(s)?s:br.to(s);return new fr(typeof o.reference=="string"?o.reference:"variableName"in o.reference?{variableName:o.reference.variableName,value:o.reference.value&&i(o.reference.value)}:i(o.reference))}t.to=e})(Od||={});var HI;(e=>{function r(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}e.from=r})(HI||={});var Qu;(n=>{function r(o,i,s){return o instanceof Ss?lf.from(o):o instanceof Di?$u.from(o):o instanceof fr?Od.from(o):o instanceof Ed?xf.from(o):o instanceof jr?Sf.from(o):o instanceof Es?AI.from(o):o instanceof Ts?df.from(o):o instanceof Cd?_O.from(o):o instanceof ws?cf.from(o,i,s):o instanceof Ai?OI.from(o):o instanceof Ds?UI.from(o):o instanceof Pi?DI.from(o):o instanceof ks?PI.from(o):o instanceof Ri?Cf.from(o):o instanceof Cs?RI.from(o):o instanceof Mi?MI.from(o):o instanceof _s?HI.from(o):o instanceof Ps?RO.from(o):o instanceof Xa?PO.from(o):o instanceof Ya?DO.from(o,i,s):o instanceof wd?MO.from(o):o instanceof Za?FI.from(o):{kind:"markdownContent",content:ce.from("")}}n.from=r;function e(o,i){switch(o.kind){case"reference":return Od.to(o);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return t(o,i)}}n.to=e;function t(o,i){switch(o.kind){case"markdownContent":return lf.to(o);case"inlineReference":return $u.to(o);case"progressMessage":return;case"treeData":return df.to(o);case"command":return cf.to(o,i)}}n.toContent=t})(Qu||={});var Ju;(e=>{function r(t,n,o,i,s,a,l){let d=[],c=[];for(let g of t.variables.variables)g.kind==="tool"?d.push(g):g.kind==="toolset"?d.push(...g.value):c.push(g);let u=va.parseLocalSessionId(t.sessionResource)??t.sessionResource.toString(),m={id:t.requestId,prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,isParticipantDetected:t.isParticipantDetected??!1,sessionId:u,sessionResource:t.sessionResource,references:c.map(g=>VI.to(g,i,l)).filter(Kn),toolReferences:d.map(Nd.to),location:Xu.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:n,toolInvocationToken:Object.freeze({sessionResource:t.sessionResource}),tools:s,model:o,editedFileEvents:t.editedFileEvents,modeInstructions:t.modeInstructions?.content,modeInstructions2:AO.to(t.modeInstructions),subAgentInvocationId:t.subAgentInvocationId,subAgentName:t.subAgentName,parentRequestId:t.parentRequestId,hasHooksEnabled:t.hasHooksEnabled??!1,hooks:t.hooks?NO.to(t.hooks):void 0};return Fe(a,"chatParticipantPrivate")||(delete m.id,delete m.attempt,delete m.enableCommandDetection,delete m.isParticipantDetected,delete m.location,delete m.location2,delete m.editedFileEvents,delete m.sessionId,delete m.subAgentInvocationId,delete m.subAgentName,delete m.parentRequestId,delete m.hasHooksEnabled,delete m.hooks),Fe(a,"chatParticipantAdditions")||(delete m.acceptedConfirmationData,delete m.rejectedConfirmationData,delete m.tools),m}e.to=r})(Ju||={});var Xu;(t=>{function r(n){switch(n){case"notebook":return 3;case"terminal":return 2;case"panel":return 1;case"editor":return 4}}t.to=r;function e(n){switch(n){case 3:return"notebook";case 2:return"terminal";case 1:return"panel";case 4:return"editor"}}t.from=e})(Xu||={});var VI;(e=>{function r(t,n,o){let i=t.value;if(!i){let a;try{a=JSON.stringify(t)}catch{a=`kind=${t.kind}, id=${t.id}, name=${t.name}`}o.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${a}`);return}if(oa(i))i=y.revive(i);else if(i&&typeof i=="object"&&"uri"in i&&"range"in i&&oa(i.uri))i=br.to($t(i));else if(xA(t)){let a=t.references?.[0]?.reference;i=new Uu(t.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(t.value))),a&&y.isUri(a)?a:void 0)}else if(t.kind==="diagnostic"){let a=t.filterSeverity&&xI.to(t.filterSeverity),l=t.filterUri&&y.revive(t.filterUri).toString();i=new el(n.map(([d,c])=>t.filterUri&&d.toString()!==l?[d,[]]:[d,c.filter(u=>!(a&&u.severity>a||t.filterRange&&!Oe.areIntersectingOrTouching(t.filterRange,V.from(u.range))))]).filter(([,d])=>d.length>0))}let s;return(Tg(t)||SA(t))&&t.toolReferences&&(s=dP.to(t.toolReferences)),{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],toolReferences:s,value:i,modelDescription:t.modelDescription}}e.to=r})(VI||={});var Nd;(e=>{function r(t){if(t.value)throw new Error("Invalid tool reference");return{name:t.id,range:t.range&&[t.range.start,t.range.endExclusive]}}e.to=r})(Nd||={});var dP;(e=>{function r(t){let n=[];for(let o of t)if(o.kind==="tool")n.push(Nd.to(o));else if(o.kind==="toolset")n.push(...o.value.map(Nd.to));else throw new Error("Invalid tool reference in prompt variables");return n}e.to=r})(dP||={});var AO;(e=>{function r(t){if(t)return{name:t.name,content:t.content,toolReferences:dP.to(t.toolReferences),metadata:t.metadata}}e.to=r})(AO||={});var cP;(e=>{function r(t,n,o){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:n.toInternal(t.command,o)}}e.from=r})(cP||={});var Yu;(n=>{function r(o){return{errorDetails:o.errorDetails,metadata:t(o.metadata),nextQuestion:o.nextQuestion,details:o.details}}n.to=r;function e(o){return{errorDetails:o.errorDetails,metadata:o.metadata,nextQuestion:o.nextQuestion,details:o.details}}n.from=e;function t(o){return os(o,i=>{if(i.$mid===20)return new tl(os(i.content,t));if(i.$mid===21)return new Lt(i.value);if(i.$mid===22)return new Qr(i.value,i.id,i.metadata);if(i.$mid===23)return new vr(i.value)})}})(Yu||={});var uP;(e=>{function r(t,n,o){if(n.action.kind==="vote")return;let i=Yu.to(t);if(n.action.kind==="command"){let s=n.action.commandButton.command;return{action:{kind:"command",commandButton:{command:o.fromInternal(s)??{command:s.id,title:s.title}}},result:i}}else return n.action.kind==="followUp"?{action:{kind:"followUp",followup:kI.to(n.action.followup)},result:i}:n.action.kind==="inlineChat"?{action:{kind:"editor",accepted:n.action.action==="accepted"},result:i}:n.action.kind==="chatEditingSessionAction"?{action:{kind:"chatEditingSessionAction",outcome:new Map([["accepted",1],["rejected",2],["saved",3]]).get(n.action.outcome)??2,uri:y.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits},result:i}:n.action.kind==="chatEditingHunkAction"?{action:{kind:"chatEditingHunkAction",outcome:new Map([["accepted",1],["rejected",2]]).get(n.action.outcome)??2,uri:y.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits,lineCount:n.action.lineCount,linesAdded:n.action.linesAdded,linesRemoved:n.action.linesRemoved},result:i}:{action:n.action,result:i}}e.to=r})(uP||={});var BI;(e=>{function r(t,n,o){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:n.toInternal(t,o)}e.from=r})(BI||={});var B_;(e=>{function r(t){return{...t,documentation:ce.fromStrict(t.documentation)}}e.from=r})(B_||={});var pP;(e=>{function r(t,n){return Array.isArray(t)?{items:t.map(o=>B_.from(o))}:{items:t.items.map(o=>B_.from(o)),resourceOptions:t.resourceOptions?LO.from(t.resourceOptions,n):void 0}}e.from=r})(pP||={});var LO;(e=>{function r(t,n){return{...t,pathSeparator:n,cwd:t.cwd,globPattern:so.from(t.globPattern)??void 0}}e.from=r})(LO||={});var mP;(e=>{function r(t){return{kind:OO.to(t.kind),acceptedLength:t.acceptedLength}}e.to=r})(mP||={});var OO;(e=>{function r(t){switch(t){case 0:return 1;case 1:return 2;case 2:return 3;default:return 0}}e.to=r})(OO||={});var gP;(e=>{function r(t,n){if(t.kind===2){let o=t.supersededBy?n(t.supersededBy):void 0;return{kind:2,supersededBy:o,userTypingDisagreed:t.userTypingDisagreed}}else if(t.kind===0)return{kind:0};return{kind:1}}e.to=r})(gP||={});var fP;(t=>{function r(n){return n===2?2:1}t.from=r;function e(n){return n===2?2:1}t.to=e})(fP||={});var hP;(e=>{function r(t,n){return{id:n,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||0,contextValue:t.contextValue}}e.from=r})(hP||={});var vP;(e=>{function r(t){return t.type==="mcp"?new Bu(t.label,t.serverLabel||t.label,t.instructions):t.type==="extension"?new Vu(t.extensionId.value,t.label):void 0}e.to=r})(vP||={});var WI;(t=>{function r(n){let o=new tl(n.content.map(i=>i.kind==="text"?new Lt(i.value,i.audience):i.kind==="data"?new mn(i.value.data.buffer,i.value.mimeType,i.audience):new vr(i.value)));return n.toolMetadata!==void 0&&(o.toolMetadata=n.toolMetadata),o}t.to=r;function e(n,o){n.toolResultMessage&&A(o,"chatParticipantPrivate");let i=d=>{d.audience&&A(o,"languageModelToolResultAudience")},s=!1,a;Array.isArray(n.toolResultDetails)?a=n.toolResultDetails?.map(d=>y.isUri(d)?d:br.from(d)):n.toolResultDetails2&&(a={output:{type:"data",mimeType:n.toolResultDetails2.mime,value:ee.wrap(n.toolResultDetails2.value)}},s=!0);let l={content:n.content.map(d=>{if(d instanceof Lt)return i(d),{kind:"text",value:d.value,audience:d.audience};if(d instanceof vr)return{kind:"promptTsx",value:d.value};if(d instanceof mn)return i(d),s=!0,{kind:"data",value:{mimeType:d.mimeType,data:ee.wrap(d.data)},audience:d.audience};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:ce.fromStrict(n.toolResultMessage),toolResultDetails:a,toolMetadata:n.toolMetadata};return s?new Pt(l):l}t.from=e})(WI||={});var Xr;(n=>{function r(o){return o}n.fromThemeIcon=r;function e(o){if(o){if(vt.isThemeIcon(o))return o;if(y.isUri(o))return o;if(typeof o=="string")return y.file(o);if(typeof o=="object"&&o!==null&&"dark"in o){let i=typeof o.dark=="string"?y.file(o.dark):o.dark,s=typeof o.light=="string"?y.file(o.light):o.light;return i?{dark:i,light:s??i}:void 0}else return}else return}n.from=e;function t(o){if(o){if(vt.isThemeIcon(o))return o;if(oa(o))return y.revive(o);{let i=o;return{light:y.revive(i.light),dark:y.revive(i.dark)}}}else return}n.to=t})(Xr||={});var bP;(t=>{function r(n){return{query:n.query,kind:e(n.kind),settings:n.settings}}t.fromSettingsSearchResult=r;function e(n){switch(n){case 1:return 1;case 2:return 2;case 3:return 3;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(bP||={});var Zu;(n=>{function r(o){return!!o.uri}function e(o){return ad.toSerialized(r(o)?{type:2,uri:o.uri,headers:Object.entries(o.headers),authentication:o.authentication?{providerId:o.authentication.providerId,scopes:o.authentication.scopes}:void 0}:{type:1,cwd:o.cwd?.fsPath,args:o.args,command:o.command,env:o.env,envFile:void 0})}n.from=e;function t(o){let i=ad.fromSerialized(o.launch);if(i.type===2)return new _d(o.label,i.uri,Object.fromEntries(i.headers),o.cacheNonce==="$$NONE"?void 0:o.cacheNonce);{let s=new kd(o.label,i.command,[...i.args],Object.fromEntries(Object.entries(i.env).map(([a,l])=>[a,l===null?null:String(l)])),o.cacheNonce==="$$NONE"?void 0:o.cacheNonce);return i.cwd&&(s.cwd=y.file(i.cwd)),s}}n.to=t})(Zu||={});var yP;(e=>{function r(t){switch(t){case 0:return 0;case 1:return 1;case 2:return 2;default:throw new Error("Unknown SourceControlInputBoxValidationType")}}e.from=r})(yP||={});var NO;(e=>{function r(t){let n={};for(let[o,i]of Object.entries(t)){if(!i||i.length===0)continue;let s=[];for(let a of i){let l=UO.to(a);l&&s.push(l)}s.length>0&&(n[o]=s)}return n}e.to=r})(NO||={});var UO;(e=>{function r(t){let n=kA(t,ai);if(n)return{command:n,cwd:t.cwd,env:t.env,timeout:t.timeout}}e.to=r})(UO||={});var Tf;(t=>{function r(n){if(n!==void 0)switch(n){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return}}function e(n){let o=n.timing,i=o?.created??o?.startTime??0,s=o?.lastRequestStarted??o?.startTime,a=o?.lastRequestEnded??o?.endTime;return{resource:n.resource,label:n.label,description:n.description?ce.from(n.description):void 0,badge:n.badge?ce.from(n.badge):void 0,status:r(n.status),archived:n.archived,tooltip:ce.fromStrict(n.tooltip),timing:{created:i,lastRequestStarted:s,lastRequestEnded:a},changes:n.changes instanceof Array?n.changes:void 0,metadata:n.metadata}}t.from=e})(Tf||={});var Do=class{constructor(e,t,n){this.uri=e;this.ranges=t;this.previewText=n}},rl=class{constructor(e,t,n){this.uri=e;this.text=t;this.lineNumber=n}},Vd=class{constructor(e){this.keyword=e}},$I=(n=>(n[n.None=1]="None",n[n.FilesExclude=2]="FilesExclude",n[n.SearchAndFilesExclude=3]="SearchAndFilesExclude",n))($I||{}),Ef=(t=>(t[t.Information=1]="Information",t[t.Warning=2]="Warning",t))(Ef||{});var qI=2e4,FO="\u27EA ",HO=" characters skipped \u27EB",k5=(FO.length+HO.length+5)*2,_5=M("searchService");function xP(r){return!!r.rangeLocations&&!!r.previewText}var zI=class{constructor(e,t,n,o){this.rangeLocations=[];this.webviewIndex=o;let i=Array.isArray(t)?t:[t];if(n&&n.matchLines===1&&P5(i)){e=z0(e,n.matchLines);let s="",a=0,l=0,d=Math.floor(n.charsPerLine/5);for(let c of i){let u=Math.max(c.startColumn-d,0),m=c.startColumn+n.charsPerLine;if(u>l+d+k5){let g=FO+(u-l)+HO;s+=g+e.slice(u,m),a+=u-(l+g.length)}else s+=e.slice(l,m);l=m,this.rangeLocations.push({source:c,preview:new IP(0,c.startColumn-a,c.endColumn-a)})}this.previewText=s}else{let s=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,a=Rm(t,l=>({preview:new KI(l.startLineNumber-s,l.startColumn,l.endLineNumber-s,l.endColumn),source:l}));this.rangeLocations=Array.isArray(a)?a:[a],this.previewText=e}}};function P5(r){let e=r[0].startLineNumber;for(let t of r)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}var KI=class{constructor(e,t,n,o){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o}},IP=class extends KI{constructor(e,t,n){super(e,t,e,n)}};function VO(r,e=!0){let t=r&&r.files&&r.files.exclude,n=e&&r&&r.search&&r.search.exclude;if(!t&&!n)return;if(!t||!n)return t||n||void 0;let o=Object.create(null);return o=ar(o,lt(t)),o=ar(o,lt(n),!0),o}function SP(r,e){let t=r.ignoreGlobCase?{ignoreCase:!0}:void 0;return r.excludePattern&&Vr(r.excludePattern,e,t)?!1:r.includePattern||r.usingSearchPaths?r.includePattern&&Vr(r.includePattern,e,t)?!0:r.usingSearchPaths?!!r.folderQueries&&r.folderQueries.some(n=>{let o=n.folder.fsPath;if(Bl(e,o,r.ignoreGlobCase)){let i=Xi(o,e);return!n.includePattern||!!Vr(n.includePattern,i,t)}else return!1}):!1:!0}function il(r,e){let t={...r||{},...e||{}};return Object.keys(t).filter(n=>{let o=t[n];return typeof o=="boolean"&&o})}var ep=class{constructor(e,t){this._parsedIncludeExpression=null;let n=e.ignoreGlobCase||t.ignoreGlobCase?{ignoreCase:!0}:void 0;this._excludeExpression=t.excludePattern?.map(i=>({...e.excludePattern||{},...i.pattern||{}}))??[],this._excludeExpression.length===0&&(this._excludeExpression=[e.excludePattern||{}]),this._parsedExcludeExpression=this._excludeExpression.map(i=>Br(i,n));let o=e.includePattern;t.includePattern&&(o?o={...o,...t.includePattern}:o=t.includePattern),o&&(this._parsedIncludeExpression=Br(o,n))}_evalParsedExcludeExpression(e,t,n){let o=null;for(let i of this._parsedExcludeExpression){let s=i(e,t,n);if(typeof s=="string"){o=s;break}}return o}matchesExcludesSync(e,t,n){return!!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n))}includedInQuerySync(e,t,n){return!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,n))}includedInQuery(e,t,n){let o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,n):!0;return Promise.all(this._parsedExcludeExpression.map(i=>{let s=i(e,t,n);return ir(s)?s.then(a=>a?!1:o()):o()})).then(i=>i.some(s=>!!s))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>D5(t)||e,!1)}};function D5(r){for(let e in r)if(typeof r[e]!="boolean")return!0;return!1}function BO(r){if(!r)return;let e;return t=>(e||(e=(r()||Promise.resolve([])).then(n=>n?$O(n):{})),e.then(n=>!!n[t]))}function WO(r){if(!r)return;let e;return t=>{if(!e){let n=r();e=n?$O(n):{}}return!!e[t]}}function $O(r){let e={};for(let t of r)e[t]=!0;return e}function GI(r){return r.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}var wf={matchLines:100,charsPerLine:1e4};var R5=!1,TP=class{constructor(e,t,n){this.id=e;this.dependencies=t;this.callback=n}};var EP=class r{constructor(){this._isWebWorker=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope";this._isRenderer=typeof document=="object";this._defineCalls=[];this._state=1}static{this.INSTANCE=new r}_initialize(){if(this._state===1){if(globalThis.define){this._state=3;return}}else return;this._state=2,globalThis.define=(e,t,n)=>{typeof e!="string"&&(n=t,t=e,e=null),(typeof t!="object"||!Array.isArray(t))&&(n=t,t=null),this._defineCalls.push(new TP(e,t,n))},globalThis.define.amd=!0,this._isRenderer?this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){if(e.startsWith(window.location.origin)||e.startsWith(`${$.vscodeFileResource}://${UT}`))return e;throw new Error(`[trusted_script_src] Invalid script url: ${e}`)}}):this._isWebWorker&&(this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){return e}}))}async load(e){if(this._initialize(),this._state===3)return new Promise(s=>{let a=pt();globalThis.define(a,[e],function(l){s(l)})});let t=await(this._isWebWorker?this._workerLoadScript(e):this._isRenderer?this._rendererLoadScript(e):this._nodeJSLoadScript(e));if(!t){console.warn(`Did not receive a define call from script ${e}`);return}let n={},o=[],i=[];if(Array.isArray(t.dependencies))for(let s of t.dependencies)s==="exports"?o.push(n):i.push(s);if(i.length>0)throw new Error(`Cannot resolve dependencies for script ${e}. The dependencies are: ${i.join(", ")}`);return typeof t.callback=="function"?t.callback(...o)??n:t.callback}_rendererLoadScript(e){return new Promise((t,n)=>{let o=document.createElement("script");o.setAttribute("async","async"),o.setAttribute("type","text/javascript");let i=()=>{o.removeEventListener("load",s),o.removeEventListener("error",a)},s=l=>{i(),t(this._defineCalls.pop())},a=l=>{i(),n(l)};o.addEventListener("load",s),o.addEventListener("error",a),this._amdPolicy&&(e=this._amdPolicy.createScriptURL(e)),o.setAttribute("src",e),window.document.getElementsByTagName("head")[0].appendChild(o)})}async _workerLoadScript(e){return this._amdPolicy&&(e=this._amdPolicy.createScriptURL(e)),await import(e),this._defineCalls.pop()}async _nodeJSLoadScript(e){try{let t=(await import("fs")).default,n=(await import("vm")).default,o=(await import("module")).default,i=y.parse(e).fsPath,s=t.readFileSync(i).toString(),a=o.wrap(s.replace(/^#!.*/,""));return new n.Script(a).runInThisContext().apply(),this._defineCalls.pop()}catch(t){throw t}}},CP=new Map;async function jI(r,e,t){t===void 0&&(t=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit);let n=e?`${r}/${e}`:r;if(CP.has(n))return CP.get(n);let o;if(/^\w[\w\d+.-]*:\/\//.test(n))o=n;else{let l=`${R5&&t&&!Uo?Y0:X0}/${n}`;o=rv.asBrowserUri(l).toString(!0)}let i=EP.INSTANCE.load(o);return CP.set(n,i),i}var _f="utf8",DP="utf8bom",JI="utf16be",XI="utf16le";var QI=[254,255],kP=[255,254],kf=[239,187,191],M5=512,A5=512,L5=512*8,O5=512*128;var _P=class extends Error{constructor(t,n){super(t);this.decodeStreamErrorKind=n}},PP=class r{constructor(e){this.iconvLiteDecoder=e}static async create(e){let t;if(e!==_f)t=(await jI("@vscode/iconv-lite-umd","lib/iconv-lite-umd.js")).getDecoder(qO(e));else{let n=new TextDecoder;t={write(o){return n.decode(o,{stream:!0})},end(){return n.decode()}}}return new r(t)}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}};function zO(r,e){let t=e.minBytesRequiredForDetection??(e.guessEncoding?L5:A5);return new Promise((n,o)=>{let i=Dh(u=>u.join("")),s=[],a=0,l,d=new Re,c=async()=>{try{let u=await $5({buffer:ee.concat(s),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(u.seemsBinary&&e.acceptTextOnly)throw new _P("Stream is binary but only text is accepted for decoding",1);u.encoding=await e.overwriteEncoding(u.encoding),l=await PP.create(u.encoding);let m=l.write(ee.concat(s).buffer);i.write(m),s.length=0,a=0,n({stream:i,detected:u})}catch(u){d.cancel(),i.destroy(),o(u)}};nT(r,{onData:async u=>{l?i.write(l.write(u.buffer)):(s.push(u),a+=u.byteLength,a>=t&&(r.pause(),await c(),setTimeout(()=>r.resume())))},onError:u=>i.error(u),onEnd:async()=>{l||await c(),i.end(l?.end())}},d.token)})}async function KO(r,e,t){let o=(await jI("@vscode/iconv-lite-umd","lib/iconv-lite-umd.js")).getEncoder(qO(e),t),i=!1,s=!1;return{read(){if(s)return null;let a=r.read();if(typeof a!="string"){if(s=!0,!i&&t?.addBOM)switch(e){case _f:case DP:return ee.wrap(Uint8Array.from(kf));case JI:return ee.wrap(Uint8Array.from(QI));case XI:return ee.wrap(Uint8Array.from(kP))}let l=o.end();return l&&l.length>0?(i=!0,ee.wrap(l)):null}return i=!0,ee.wrap(o.write(a))}}}function qO(r){return r===DP||r===null?_f:r}function N5(r,e){if(!r||e<QI.length)return null;let t=r.readUInt8(0),n=r.readUInt8(1);if(t===QI[0]&&n===QI[1])return JI;if(t===kP[0]&&n===kP[1])return XI;if(e<kf.length)return null;let o=r.readUInt8(2);return t===kf[0]&&n===kf[1]&&o===kf[2]?DP:null}var U5=["ascii","utf-16","utf-32"];async function F5(r,e){let t=await jI("jschardet","dist/jschardet.min.js"),n=r.slice(0,O5),o=W5(n.buffer);e&&(e=Ze(e.map(a=>B5(a))),e.length===0&&(e=void 0));let i;try{i=t.detect(o,e?{detectEncodings:e}:void 0)}catch{return null}if(!i?.encoding)return null;let s=i.encoding.toLowerCase();return 0<=U5.indexOf(s)?null:V5(i.encoding)}var H5={ibm866:"cp866",big5:"cp950"};function GO(r){return r.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function V5(r){let e=GO(r);return H5[e]||e}function B5(r){let e=GO(r),t=z5[e];return t?t.guessableName:void 0}function W5(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e}function $5({buffer:r,bytesRead:e},t,n){let o=N5(r,e),i=!1;if(o!==JI&&o!==XI&&r){let s=!0,a=!0,l=!1;for(let d=0;d<e&&d<M5;d++){let c=d%2===1,u=r.readUInt8(d)===0;if(u&&(l=!0),s&&(c&&!u||!c&&u)&&(s=!1),a&&(c&&u||!c&&!u)&&(a=!1),u&&!s&&!a)break}l&&(s?o=XI:a?o=JI:i=!0)}return t&&!i&&!o&&r?F5(r.slice(0,e),n).then(s=>({seemsBinary:!1,encoding:s})):{seemsBinary:i,encoding:o}}var wP={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},cp1125:{labelLong:"Cyrillic (CP 1125)",labelShort:"CP 1125",order:21,guessableName:"IBM1125"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:22,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:23,guessableName:"KOI8-R"},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:24},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:25},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:26,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:27,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:28,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:29,guessableName:"ISO-8859-8"},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:30},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:31},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:32},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:33},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:34},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:35},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:36},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:37,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:38},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:39,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:40,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:41,guessableName:"EUC-KR"},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:42},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:43},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:44},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:45},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:46,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:47},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:48}},z5=(()=>{let r={};for(let e in wP)wP[e].guessableName&&(r[e]=wP[e]);return r})();var Sfe=M("textFileService");function jO(r){let e=!1;return{read(){return e?null:(e=!0,r)}}}function Df(r,e,t){return new ui(n=>ZI(n,t)).isEqual(r,e)}function K5(r,e,t){return Df(r.uri,e.uri,t)?0:kr(r.uri.toString(),e.uri.toString())}function q5(r,e,t){return r.index!==e.index?r.index<e.index?-1:1:Df(r.uri,e.uri,t)?kr(r.name,e.name):kr(r.uri.toString(),e.uri.toString())}function JO(r,e,t,n){let o=r.slice(0).sort((s,a)=>t(s,a,n)),i=e.slice(0).sort((s,a)=>t(s,a,n));return _1(o,i,(s,a)=>t(s,a,n))}function ZI(r,e){let t=e.getCapabilities(r.scheme);return!(t&&t&1024)}var Pf=class r extends Lv{constructor(t,n,o,i,s,a,l){super(t,o.map(d=>new gg(d)),i,s,l);this._name=n;this._isUntitled=a;this._workspaceFolders=[];this._structure=go.forUris(l,()=>!0),o.forEach(d=>{this._workspaceFolders.push(d),this._structure.set(d.uri,d)})}static toExtHostWorkspace(t,n,o,i){if(!t)return{workspace:null,added:[],removed:[]};let{id:s,name:a,folders:l,configuration:d,transient:c,isUntitled:u}=t,m=[],g=n;n?l.forEach((S,T)=>{let P=y.revive(S.uri),L=r._findFolder(o||n,P,i);L?(L.name=S.name,L.index=S.index,m.push(L)):m.push({uri:P,name:S.name,index:T})}):m.push(...l.map(({uri:S,name:T,index:P})=>({uri:y.revive(S),name:T,index:P}))),m.sort((S,T)=>S.index<T.index?-1:1);let v=new r(s,a,m,!!c,d?y.revive(d):null,!!u,S=>ZI(S,i)),{added:h,removed:x}=JO(g?g.workspaceFolders:[],v.workspaceFolders,K5,i);return{workspace:v,added:h,removed:x}}static _findFolder(t,n,o){for(let i=0;i<t.folders.length;i++){let s=t.workspaceFolders[i];if(Df(s.uri,n,o))return s}}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(t,n){return n&&this._structure.get(t)&&(t=es(t)),this._structure.findSubstr(t)}resolveWorkspaceFolder(t){return this._structure.get(t)}},tp=class{constructor(e,t,n,o,i){this._onDidChangeWorkspace=new E;this.onDidChangeWorkspace=this._onDidChangeWorkspace.event;this._onDidGrantWorkspaceTrust=new E;this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event;this._onDidChangeWorkspaceTrustedFolders=new E;this.onDidChangeWorkspaceTrustedFolders=this._onDidChangeWorkspaceTrustedFolders.event;this._activeSearchCallbacks=[];this._trusted=!1;this._editSessionIdentityProviders=new Map;this._providerHandlePool=0;this._onWillCreateEditSessionIdentityEvent=new ri;this._canonicalUriProviders=new Map;this._logService=o,this._extHostFileSystemInfo=n,this._uriTransformerService=i,this._requestIdProvider=new Rv,this._barrier=new yn,this._proxy=e.getProxy(N.MainThreadWorkspace),this._messageService=e.getProxy(N.MainThreadMessageService);let s=t.workspace;this._confirmedWorkspace=s?new Pf(s.id,s.name,[],!!s.transient,s.configuration?y.revive(s.configuration):null,!!s.isUntitled,a=>ZI(a,n)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?y.from({scheme:$.untitled,path:Bt(es(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,n,...o){let i=[];if(Array.isArray(o)&&o.forEach(c=>{y.isUri(c.uri)&&!i.some(u=>Df(u.uri,c.uri,this._extHostFileSystemInfo))&&i.push({uri:c.uri,name:c.name||jm(c.uri)})}),this._unconfirmedWorkspace||[t,n].some(c=>typeof c!="number"||c<0)||n===0&&i.length===0)return!1;let s=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+n>s.length)return!1;let a=s.slice(0);a.splice(t,n,...i.map(c=>({uri:c.uri,name:c.name||jm(c.uri),index:void 0})));for(let c=0;c<a.length;c++){let u=a[c];if(a.some((m,g)=>g!==c&&Df(u.uri,m.uri,this._extHostFileSystemInfo)))return!1}a.forEach((c,u)=>c.index=u);let{added:l,removed:d}=JO(s,a,q5,this._extHostFileSystemInfo);if(l.length===0&&d.length===0)return!1;if(this._proxy){let c=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(c,t,n,i).then(void 0,u=>{this._unconfirmedWorkspace=void 0;let m={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(EM.Error,p(3175,null,c,u.toString()),m,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;let{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let n,o="";if(typeof e=="string"?(n=y.file(e),o=e):typeof e<"u"&&(n=e,o=e.fsPath),!n)return o;let i=this.getWorkspaceFolder(n,!0);if(!i)return o;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let s=Qm(i.uri,n);return t&&i.name&&(s=`${i.name}/${s}`),s}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=Pf.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){let{workspace:t,added:n,removed:o}=Pf.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:n,removed:o}))}findFiles(e,t,n,o,i=be.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${o.value}, entryPoint: findFiles`);let s="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?s=t:s=t.pattern),this._findFilesImpl({type:"include",value:e},{exclude:[s],maxResults:n,useExcludeSettings:a?2:1,useIgnoreFiles:{local:!1}},i)}findFiles2(e,t={},n,o=be.None){return this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${n.value}, entryPoint: findFiles2New`),this._findFilesImpl({type:"filePatterns",value:e},t,o)}async _findFilesImpl(e,t,n){if(n.isCancellationRequested)return Promise.resolve([]);let o=e.type==="include"?[e.value]:e.value??[];if(!Array.isArray(o))throw console.error("Invalid file pattern provided",o),new Error(`Invalid file pattern provided ${JSON.stringify(o)}`);let i=o.map(s=>{let a=QO(t.exclude),l={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local=="boolean"?!t.useIgnoreFiles.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===1,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==3,maxResults:t.maxResults,excludePattern:a.length>0?a:void 0,_reason:"startFileSearch",shouldGlobSearch:e.type==="include"?void 0:!0},d=YI(so.from(s)),c=d?.folder;return e.type==="include"?l.includePattern=d?.pattern:l.filePattern=d?.pattern,{folder:c,options:l}});return this._findFilesBase(i,n)}async _findFilesBase(e,t){let o=(await Promise.all(e?.map(a=>this._proxy.$startFileSearch(a.folder??null,a.options,t).then(l=>Array.isArray(l)?l.map(d=>y.revive(d)):[]))??[])).flat(),i=new ui(a=>ZI(a,this._extHostFileSystemInfo)),s=new Map;for(let a of o){let l=i.getComparisonKey(a);s.has(l)||s.set(l,a)}return Array.from(s.values())}findTextInFiles2(e,t,n,o=be.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${n.value}, entryPoint: findTextInFiles2`);let i=m=>{if(!t)return{folder:void 0,options:{}};let g=m?YI(so.from(m)):void 0,v=t.exclude?QO(t.exclude):void 0;return{options:{ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles?.local=="boolean"?!t.useIgnoreFiles?.local:void 0,disregardGlobalIgnoreFiles:typeof t.useIgnoreFiles?.global=="boolean"?!t.useIgnoreFiles?.global:void 0,disregardParentIgnoreFiles:typeof t.useIgnoreFiles?.parent=="boolean"?!t.useIgnoreFiles?.parent:void 0,disregardExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings===1,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==3,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:t.previewOptions?{matchLines:t.previewOptions?.numMatchLines??100,charsPerLine:t.previewOptions?.charsPerLine??1e4}:void 0,surroundingContext:t.surroundingContext,includePattern:g?.pattern,excludePattern:v},folder:g?.folder}},a=(t?.include?.map(m=>i(m))??[i(void 0)]).filter(m=>!!m),l=new q,d=l.add(new E),c=this.findTextInFilesBase(e,a,(m,g)=>d.fire({result:m,uri:g}),o);return{results:new wc(async m=>{l.add(d.event(g=>{let v=g.result,h=g.uri;xP(v)?m.emitOne(new Do(h,v.rangeLocations.map(x=>({previewRange:new pe(x.preview.startLineNumber,x.preview.startColumn,x.preview.endLineNumber,x.preview.endColumn),sourceRange:new pe(x.source.startLineNumber,x.source.startColumn,x.source.endLineNumber,x.source.endColumn)})),v.previewText)):m.emitOne(new rl(h,v.text,v.lineNumber))})),await c}),complete:c.then(m=>(l.dispose(),{limitHit:m?.limitHit??!1}))}}async findTextInFilesBase(e,t,n,o=be.None){let i=this._requestIdProvider.getNext(),s=!1;if(o.onCancellationRequested(a=>{s=!0}),this._activeSearchCallbacks[i]=a=>{if(s)return;let l=y.revive(a.resource);a.results.forEach(d=>{let c=$t(d);n(c,l)})},o.isCancellationRequested)return{};try{let a=await Promise.all(t?.map(l=>this._proxy.$startTextSearch(e,l.folder??null,l.options,i,o)||{})??[]);return delete this._activeSearchCallbacks[i],a.reduce((l,d)=>({limitHit:l?.limitHit||(d?.limitHit??!1),message:[l?.message??[],d?.message??[]].flat()}),{})??{limitHit:!1}}catch(a){throw delete this._activeSearchCallbacks[i],a}}async findTextInFiles(e,t,n,o,i=be.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${o.value}, entryPoint: findTextInFiles`);let s=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,a=YI(so.from(t.include)),l=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,d={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:s,surroundingContext:t.afterContext,includePattern:a?.pattern,excludePattern:l?[{pattern:l}]:void 0},c=(u,m)=>{xP(u)?n({uri:m,preview:{text:u.previewText,matches:Rm(u.rangeLocations,g=>new pe(g.preview.startLineNumber,g.preview.startColumn,g.preview.endLineNumber,g.preview.endColumn))},ranges:Rm(u.rangeLocations,g=>new pe(g.source.startLineNumber,g.source.startColumn,g.source.endLineNumber,g.source.endColumn))}):n({uri:m,text:u.text,lineNumber:u.lineNumber})};return this.findTextInFilesBase(e,[{options:d,folder:a?.folder}],c,i)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){let t=await this._proxy.$save(e,{saveAs:!1});return y.revive(t)}async saveAs(e){let t=await this._proxy.$save(e,{saveAs:!0});return y.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestResourceTrust(e){return this._proxy.$requestResourceTrust(e)}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}$onDidChangeWorkspaceTrustedFolders(){this._onDidChangeWorkspaceTrustedFolders.fire()}isResourceTrusted(e){return this._proxy.$isResourceTrusted(e)}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),o=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(o,n),J(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(o)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);let n=await this.resolveWorkspaceFolder(y.revive(e));if(!n){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",n);let o=this._editSessionIdentityProviders.get(n.uri.scheme);if(this._logService.info(`Provider for scheme ${n.uri.scheme} is defined: `,!!o),!o)return;let i=await o.provideEditSessionIdentity(n,t);if(this._logService.info("Provider returned edit session identifier: ",i),!!i)return i}async $provideEditSessionIdentityMatch(e,t,n,o){this._logService.info("Getting edit session identifier for workspaceFolder",e);let i=await this.resolveWorkspaceFolder(y.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);let s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;let a=await s.provideEditSessionIdentityMatch?.(t,n,o);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,n,o)=>{let i=function(a){t.call(n,a)};return i.extension=e,this._onWillCreateEditSessionIdentityEvent.event(i,void 0,o)}}async $onWillCreateEditSessionIdentity(e,t,n){let o=await this.resolveWorkspaceFolder(y.revive(e));if(o===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:o},t,async(i,s)=>{let a=Date.now();await Promise.resolve(i),Date.now()-a>n&&this._logService.warn("SLOW edit session create-participant",s.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),o=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(o,n),J(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(o)})}async provideCanonicalUri(e,t,n){let o=this._canonicalUriProviders.get(e.scheme);if(!o)return;let i=await o.provideCanonicalUri?.(y.revive(e),t,n);if(i)return i}async $provideCanonicalUri(e,t,n){return this.provideCanonicalUri(y.revive(e),{targetScheme:t},n)}async decode(e,t){let[n,o]=this.toEncodeDecodeParameters(t),i=await this._proxy.$resolveDecoding(n,o),s=(await zO(Y1(ee.wrap(e)),{...i,acceptTextOnly:!0,overwriteEncoding:a=>a===null||a===i.preferredEncoding?Promise.resolve(i.preferredEncoding):this._proxy.$validateDetectedEncoding(n,a,o)})).stream;return Rh(s,a=>a.join(""))}async encode(e,t){let[n,o]=this.toEncodeDecodeParameters(t),{encoding:i,addBOM:s}=await this._proxy.$resolveEncoding(n,o);if(i===_f&&!s)return ee.fromString(e).buffer;let a=await KO(jO(e),i,{addBOM:s});return X1(a).buffer}toEncodeDecodeParameters(e){let t=oa(e?.uri)?e.uri:void 0,n=typeof e?.encoding=="string"?e.encoding:void 0;return[t,n?{encoding:n}:void 0]}};tp=D([C(0,ge),C(1,nt),C(2,lr),C(3,ue),C(4,ca)],tp);var Wn=M("IExtHostWorkspace");function YI(r){let e,t;if(r)return typeof r=="string"?e=r:(e=r.pattern,t=y.revive(r.baseUri)),{pattern:e,folder:t}}function QO(r){return(r?.map(e=>{if(typeof e=="string")return e===""?void 0:{pattern:e,uri:void 0};{let t=YI(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}var XO;(e=>e.DEFAULT={allowTrailingComma:!0})(XO||={});function G5(r,e=!1){let t=0,n=r.length,o="",i=0,s=16,a=0;function l(h){let x=0,S=0;for(;x<h;){let T=r.charCodeAt(t);if(T>=48&&T<=57)S=S*16+T-48;else if(T>=65&&T<=70)S=S*16+T-65+10;else if(T>=97&&T<=102)S=S*16+T-97+10;else break;t++,x++}return x<h&&(S=-1),S}function d(h){t=h,o="",i=0,s=16,a=0}function c(){let h=t;if(r.charCodeAt(t)===48)t++;else for(t++;t<r.length&&np(r.charCodeAt(t));)t++;if(t<r.length&&r.charCodeAt(t)===46)if(t++,t<r.length&&np(r.charCodeAt(t)))for(t++;t<r.length&&np(r.charCodeAt(t));)t++;else return a=3,r.substring(h,t);let x=t;if(t<r.length&&(r.charCodeAt(t)===69||r.charCodeAt(t)===101))if(t++,(t<r.length&&r.charCodeAt(t)===43||r.charCodeAt(t)===45)&&t++,t<r.length&&np(r.charCodeAt(t))){for(t++;t<r.length&&np(r.charCodeAt(t));)t++;x=t}else a=3;return r.substring(h,x)}function u(){let h="",x=t;for(;;){if(t>=n){h+=r.substring(x,t),a=2;break}let S=r.charCodeAt(t);if(S===34){h+=r.substring(x,t),t++;break}if(S===92){if(h+=r.substring(x,t),t++,t>=n){a=2;break}switch(r.charCodeAt(t++)){case 34:h+='"';break;case 92:h+="\\";break;case 47:h+="/";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+=`
`;break;case 114:h+="\r";break;case 116:h+="	";break;case 117:{let P=l(4);P>=0?h+=String.fromCharCode(P):a=4;break}default:a=5}x=t;continue}if(S>=0&&S<=31)if(ex(S)){h+=r.substring(x,t),a=2;break}else a=6;t++}return h}function m(){if(o="",a=0,i=t,t>=n)return i=n,s=17;let h=r.charCodeAt(t);if(RP(h)){do t++,o+=String.fromCharCode(h),h=r.charCodeAt(t);while(RP(h));return s=15}if(ex(h))return t++,o+=String.fromCharCode(h),h===13&&r.charCodeAt(t)===10&&(t++,o+=`
`),s=14;switch(h){case 123:return t++,s=1;case 125:return t++,s=2;case 91:return t++,s=3;case 93:return t++,s=4;case 58:return t++,s=6;case 44:return t++,s=5;case 34:return t++,o=u(),s=10;case 47:{let x=t-1;if(r.charCodeAt(t+1)===47){for(t+=2;t<n&&!ex(r.charCodeAt(t));)t++;return o=r.substring(x,t),s=12}if(r.charCodeAt(t+1)===42){t+=2;let S=n-1,T=!1;for(;t<S;){if(r.charCodeAt(t)===42&&r.charCodeAt(t+1)===47){t+=2,T=!0;break}t++}return T||(t++,a=1),o=r.substring(x,t),s=13}return o+=String.fromCharCode(h),t++,s=16}case 45:if(o+=String.fromCharCode(h),t++,t===n||!np(r.charCodeAt(t)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=c(),s=11;default:for(;t<n&&g(h);)t++,h=r.charCodeAt(t);if(i!==t){switch(o=r.substring(i,t),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(h),t++,s=16}}function g(h){if(RP(h)||ex(h))return!1;switch(h){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let h;do h=m();while(h>=12&&h<=15);return h}return{setPosition:d,getPosition:()=>t,scan:e?v:m,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>t-i,getTokenError:()=>a}}function RP(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function ex(r){return r===10||r===13||r===8232||r===8233}function np(r){return r>=48&&r<=57}function YO(r,e,t=XO.DEFAULT){let n=G5(r,!1);function o(Q){return Q?()=>Q(n.getTokenOffset(),n.getTokenLength()):()=>!0}function i(Q){return Q?X=>Q(X,n.getTokenOffset(),n.getTokenLength()):()=>!0}let s=o(e.onObjectBegin),a=i(e.onObjectProperty),l=o(e.onObjectEnd),d=o(e.onArrayBegin),c=o(e.onArrayEnd),u=i(e.onLiteralValue),m=i(e.onSeparator),g=o(e.onComment),v=i(e.onError),h=t&&t.disallowComments,x=t&&t.allowTrailingComma;function S(){for(;;){let Q=n.scan();switch(n.getTokenError()){case 4:T(14);break;case 5:T(15);break;case 3:T(13);break;case 1:h||T(11);break;case 2:T(12);break;case 6:T(16);break}switch(Q){case 12:case 13:h?T(10):g();break;case 16:T(1);break;case 15:case 14:break;default:return Q}}}function T(Q,X=[],B=[]){if(v(Q),X.length+B.length>0){let He=n.getToken();for(;He!==17;){if(X.indexOf(He)!==-1){S();break}else if(B.indexOf(He)!==-1)break;He=S()}}}function P(Q){let X=n.getTokenValue();return Q?u(X):a(X),S(),!0}function L(){switch(n.getToken()){case 11:{let Q=0;try{Q=JSON.parse(n.getTokenValue()),typeof Q!="number"&&(T(2),Q=0)}catch{T(2)}u(Q);break}case 7:u(null);break;case 8:u(!0);break;case 9:u(!1);break;default:return!1}return S(),!0}function Y(){return n.getToken()!==10?(T(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(m(":"),S(),K()||T(4,[],[2,5])):T(5,[],[2,5]),!0)}function G(){s(),S();let Q=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(Q||T(4,[],[]),m(","),S(),n.getToken()===2&&x)break}else Q&&T(6,[],[]);Y()||T(4,[],[2,5]),Q=!0}return l(),n.getToken()!==2?T(7,[2],[]):S(),!0}function z(){d(),S();let Q=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(Q||T(4,[],[]),m(","),S(),n.getToken()===4&&x)break}else Q&&T(6,[],[]);K()||T(4,[],[4,5]),Q=!0}return c(),n.getToken()!==4?T(8,[4],[]):S(),!0}function K(){switch(n.getToken()){case 3:return z();case 1:return G();case 10:return P(!0);default:return L()}}return S(),n.getToken()===17?t.allowEmptyContent?!0:(T(4,[],[]),!1):K()?(n.getToken()!==17&&T(9,[],[]),!0):(T(4,[],[]),!1)}function Rf(r){return Object.isFrozen(r)?r:ug(r)}var al=class r{constructor(e,t,n,o,i){this._contents=e;this._keys=t;this._overrides=n;this._raw=o;this.logService=i;this.overrideConfigurations=new Map}static createEmptyModel(e){return new r({},[],[],void 0,e)}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let e=(Array.isArray(this._raw)?this._raw:[this._raw]).map(t=>{if(t instanceof r)return t;let n=new MP("",this.logService);return n.parseRaw(t),n.configurationModel});this._rawConfiguration=e.reduce((t,n)=>n===t?n:t.merge(n),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}get raw(){if(this._raw&&!(Array.isArray(this._raw)&&this._raw.every(e=>e instanceof r)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Mg(this.contents,e):this.contents}inspect(e,t){let n=this;return{get value(){return Rf(n.rawConfiguration.getValue(e))},get override(){return t?Rf(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return Rf(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){let o=[];for(let{contents:i,identifiers:s,keys:a}of n.rawConfiguration.overrides){let l=new r(i,a,[],void 0,n.logService).getValue(e);l!==void 0&&o.push({identifiers:s,value:l})}return o.length?Rf(o):void 0}}}getOverrideValue(e,t){let n=this.getContentsForOverrideIdentifer(t);return n?e?Mg(n,e):n:void 0}getKeysForOverrideIdentifier(e){let t=[];for(let n of this.overrides)n.identifiers.includes(e)&&t.push(...n.keys);return Xo(t)}getAllOverrideIdentifiers(){let e=[];for(let t of this.overrides)e.push(...t.identifiers);return Xo(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){let t=lt(this.contents),n=lt(this.overrides),o=[...this.keys],i=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let s of e)if(i.push(...s._raw?Array.isArray(s._raw)?s._raw:[s._raw]:[s]),!s.isEmpty()){this.mergeContents(t,s.contents);for(let a of s.overrides){let[l]=n.filter(d=>Ht(d.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Xo(l.keys)):n.push(lt(a))}for(let a of s.keys)o.indexOf(a)===-1&&o.push(a)}return new r(t,o,n,!i.length||i.every(s=>s instanceof r)?void 0:i,this.logService)}createOverrideConfigurationModel(e){let t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;let n={};for(let o of Xo([...Object.keys(this.contents),...Object.keys(t)])){let i=this.contents[o],s=t[o];s&&(typeof i=="object"&&typeof s=="object"?(i=lt(i),this.mergeContents(i,s)):i=s),n[o]=i}return new r(n,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(let n of Object.keys(t)){if(n in e&&ut(e[n])&&ut(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=lt(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null,o=i=>{i&&(n?this.mergeContents(n,i):n=lt(i))};for(let i of this.overrides)i.identifiers.length===1&&i.identifiers[0]===e?t=i.contents:i.identifiers.includes(e)&&o(i.contents);return o(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){let t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),XA(this.contents,e),pr.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Ht(n.identifiers,Xc(e))),1))}updateValue(e,t,n){if(ek(this.contents,e,t,o=>this.logService.error(o)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),pr.test(e)){let o=this.contents[e],i=Xc(e),s={identifiers:i,keys:Object.keys(o),contents:cb(o,l=>this.logService.error(l))},a=this.overrides.findIndex(l=>Ht(l.identifiers,i));a!==-1?this.overrides[a]=s:this.overrides.push(s)}}},MP=class{constructor(e,t){this._name=e;this.logService=t;this._raw=null;this._configurationModel=null;this._restrictedConfigurations=[];this._parseErrors=[]}get configurationModel(){return this._configurationModel||al.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!wt(e)){let n=this.doParseContent(e);this.parseRaw(n,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;let{contents:n,keys:o,overrides:i,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new al(n,o,i,a?[e]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseContent(e){let t={},n=null,o=[],i=[],s=[];function a(d){Array.isArray(o)?o.push(d):n!==null&&(o[n]=d)}let l={onObjectBegin:()=>{let d={};a(d),i.push(o),o=d,n=null},onObjectProperty:d=>{n=d},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let d=[];a(d),i.push(o),o=d,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:a,onError:(d,c,u)=>{s.push({error:d,offset:c,length:u})}};if(e)try{YO(e,l),t=o[0]||{}}catch(d){this.logService.error(`Error while parsing settings file ${this._name}: ${d}`),this._parseErrors=[d]}return t}doParseRaw(e,t){let n=ot.as(ko.Configuration),o=n.getConfigurationProperties(),i=n.getExcludedConfigurationProperties(),s=this.filter(e,o,i,!0,t);e=s.raw;let a=cb(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),l=Object.keys(e),d=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:a,keys:l,overrides:d,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,n,o,i){let s=!1;if(!i?.scopes&&!i?.skipRestricted&&!i?.skipUnregistered&&!i?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:s};let a={},l=[];for(let d in e)if(pr.test(d)&&o){let c=this.filter(e[d],t,n,!1,i);a[d]=c.raw,s=s||c.hasExcludedProperties,l.push(...c.restricted)}else{let c=t[d];c?.restricted&&l.push(d),this.shouldInclude(d,c,n,i)?a[d]=e[d]:s=!0}return{raw:a,restricted:l,hasExcludedProperties:s}}shouldInclude(e,t,n,o){if(o.exclude?.includes(e))return!1;if(o.include?.includes(e))return!0;if(o.skipRestricted&&t?.restricted||o.skipUnregistered&&!t)return!1;let i=t??n[e],s=i?typeof i.scope<"u"?i.scope:4:void 0;return s===void 0||o.scopes===void 0?!0:o.scopes.includes(s)}toOverrides(e,t){let n=[];for(let o of Object.keys(e))if(pr.test(o)){let i={},s=e[o];for(let a in s)i[a]=s[a];n.push({identifiers:Xc(o),keys:Object.keys(i),contents:cb(i,t)})}return n}};var AP=class{constructor(e,t,n,o,i,s,a,l,d,c,u,m,g){this.key=e;this.overrides=t;this._value=n;this.overrideIdentifiers=o;this.defaultConfiguration=i;this.policyConfiguration=s;this.applicationConfiguration=a;this.userConfiguration=l;this.localUserConfiguration=d;this.remoteUserConfiguration=c;this.workspaceConfiguration=u;this.folderConfigurationModel=m;this.memoryConfigurationModel=g}get value(){return Rf(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}},op=class r{constructor(e,t,n,o,i,s,a,l,d,c){this._defaultConfiguration=e;this._policyConfiguration=t;this._applicationConfiguration=n;this._localUserConfiguration=o;this._remoteUserConfiguration=i;this._workspaceConfiguration=s;this._folderConfigurations=a;this._memoryConfiguration=l;this._memoryConfigurationByResource=d;this.logService=c;this._workspaceConsolidatedConfiguration=null;this._foldersConsolidatedConfigurations=new qe;this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=al.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){let o=this.getConsolidatedConfigurationModel(e,t,n),i=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(let l of o.overrides)for(let d of l.identifiers)o.getOverrideValue(e,d)!==void 0&&a.add(d);return new AP(e,t,o.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,i||void 0,s)}keys(e){let t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),policy:this._policyConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){let n=[];if(!t){let{added:o,updated:i,removed:s}=sl(this._defaultConfiguration,e);t=[...o,...i,...s]}for(let o of t)for(let i of Xc(o)){let s=this._defaultConfiguration.getKeysForOverrideIdentifier(i),a=e.getKeysForOverrideIdentifier(i),l=[...a.filter(d=>s.indexOf(d)===-1),...s.filter(d=>a.indexOf(d)===-1),...s.filter(d=>!Wt(this._defaultConfiguration.override(i).getValue(d),e.override(i).getValue(d)))];n.push([i,l])}return this.updateDefaultConfiguration(e),{keys:t,overrides:n}}compareAndUpdatePolicyConfiguration(e){let{added:t,updated:n,removed:o}=sl(this._policyConfiguration,e),i=[...t,...n,...o];return i.length&&this.updatePolicyConfiguration(e),{keys:i,overrides:[]}}compareAndUpdateApplicationConfiguration(e){let{added:t,updated:n,removed:o,overrides:i}=sl(this.applicationConfiguration,e),s=[...t,...n,...o];return s.length&&this.updateApplicationConfiguration(e),{keys:s,overrides:i}}compareAndUpdateLocalUserConfiguration(e){let{added:t,updated:n,removed:o,overrides:i}=sl(this.localUserConfiguration,e),s=[...t,...n,...o];return s.length&&this.updateLocalUserConfiguration(e),{keys:s,overrides:i}}compareAndUpdateRemoteUserConfiguration(e){let{added:t,updated:n,removed:o,overrides:i}=sl(this.remoteUserConfiguration,e),s=[...t,...n,...o];return s.length&&this.updateRemoteUserConfiguration(e),{keys:s,overrides:i}}compareAndUpdateWorkspaceConfiguration(e){let{added:t,updated:n,removed:o,overrides:i}=sl(this.workspaceConfiguration,e),s=[...t,...n,...o];return s.length&&this.updateWorkspaceConfiguration(e),{keys:s,overrides:i}}compareAndUpdateFolderConfiguration(e,t){let n=this.folderConfigurations.get(e),{added:o,updated:i,removed:s,overrides:a}=sl(n,t),l=[...o,...i,...s];return(l.length||!n)&&this.updateFolderConfiguration(e,t),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(e){let t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);let{added:n,updated:o,removed:i,overrides:s}=sl(t,void 0);return{keys:[...n,...o,...i],overrides:s}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new al(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,n){let o=this.getConsolidatedConfigurationModelForResource(t,n);if(t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){o=o.merge();for(let i of this._policyConfiguration.keys)o.setValue(i,this._policyConfiguration.getValue(i))}return o}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){let o=t.getFolder(e);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);let i=this._memoryConfigurationByResource.get(e);i&&(n=n.merge(i))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){let n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=n.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){let n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{let{contents:n,overrides:o,keys:i}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:o,keys:i}]),e},[])}}allKeys(){let e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(n=>e.add(n))),[...e.values()]}allOverrideIdentifiers(){let e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(n=>e.add(n))),[...e.values()]}getAllKeysForOverrideIdentifier(e){let t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(n=>t.add(n)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(n=>t.add(n)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(n=>t.add(n)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(e).forEach(o=>t.add(o))),[...t.values()]}static parse(e,t){let n=this.parseConfigurationModel(e.defaults,t),o=this.parseConfigurationModel(e.policy,t),i=this.parseConfigurationModel(e.application,t),s=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),d=e.folders.reduce((c,u)=>(c.set(y.revive(u[0]),this.parseConfigurationModel(u[1],t)),c),new qe);return new r(n,o,i,s,a,l,d,al.createEmptyModel(t),new qe,t)}static parseConfigurationModel(e,t){return new al(e.contents,e.keys,e.overrides,e.raw,t)}};var tx=class{constructor(e,t,n,o,i){this.change=e;this.previous=t;this.currentConfiguraiton=n;this.currentWorkspace=o;this.logService=i;this._marker=`
`;this._markerCode1=this._marker.charCodeAt(0);this._markerCode2=46;this.affectedKeys=new Set;this._previousConfiguration=void 0;for(let s of e.keys)this.affectedKeys.add(s);for(let[,s]of e.overrides)for(let a of s)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(let s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=op.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){let n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;let i=o+n.length;if(i>=this._affectsConfigStr.length)return!1;let s=this._affectsConfigStr.charCodeAt(i);if(s!==this._markerCode1&&s!==this._markerCode2)return!1;if(t){let a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Wt(a,l)}return!0}};function sl(r,e){let{added:t,removed:n,updated:o}=ZO(e?.rawConfiguration,r?.rawConfiguration),i=[],s=r?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){let l=a.filter(d=>!s.includes(d));for(let d of l)i.push([d,e.getKeysForOverrideIdentifier(d)])}if(r){let l=s.filter(d=>!a.includes(d));for(let d of l)i.push([d,r.getKeysForOverrideIdentifier(d)])}if(e&&r){for(let l of s)if(a.includes(l)){let d=ZO({contents:r.getOverrideValue(void 0,l)||{},keys:r.getKeysForOverrideIdentifier(l)},{contents:e.getOverrideValue(void 0,l)||{},keys:e.getKeysForOverrideIdentifier(l)});i.push([l,[...d.added,...d.removed,...d.updated]])}}return{added:t,removed:n,updated:o,overrides:i}}function ZO(r,e){let t=r?e?r.keys.filter(i=>e.keys.indexOf(i)===-1):[...r.keys]:[],n=e?r?e.keys.filter(i=>r.keys.indexOf(i)===-1):[...e.keys]:[],o=[];if(r&&e){for(let i of e.keys)if(r.keys.indexOf(i)!==-1){let s=Mg(e.contents,i),a=Mg(r.contents,i);Wt(s,a)||o.push(i)}}return{added:t,removed:n,updated:o}}function nx(r,e){if(e){let t=e.split("."),n=r;for(let o=0;n&&o<t.length;o++)n=n[t[o]];return n}}function J5(r){return r instanceof y}function X5(r){return ut(r)&&r.uri instanceof y&&!!r.languageId&&typeof r.languageId=="string"}function Y5(r){return ut(r)&&!r.uri&&!!r.languageId&&typeof r.languageId=="string"}function Z5(r){return ut(r)&&r.uri instanceof y&&(!r.name||typeof r.name=="string")&&(!r.index||typeof r.index=="number")}function eN(r){if(J5(r))return{resource:r};if(X5(r))return{resource:r.uri,overrideIdentifier:r.languageId};if(Y5(r))return{overrideIdentifier:r.languageId};if(Z5(r))return{resource:r.uri};if(r===null)return{resource:null}}var rp=class{constructor(e,t,n){this._proxy=e.getProxy(N.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=n,this._barrier=new yn,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new LP(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(n=>n.$acceptConfigurationChanged(e,t))}};rp=D([C(0,ge),C(1,Wn),C(2,ue)],rp);var LP=class{constructor(e,t,n,o){this._onDidChangeConfiguration=new E;this._proxy=e,this._logService=o,this._extHostWorkspace=t,this._configuration=op.parse(n,o),this._configurationScopes=this._toMap(n.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){let n={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=op.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,n))}getConfiguration(e,t,n){let o=eN(t)||{},i=this._toReadonlyValue(this._configuration.getValue(e,o,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,o,n?.identifier);function s(l){if(l==null)return null;if(typeof l=="boolean")return l?2:5;switch(l){case 1:return 2;case 2:return 5;case 3:return 6}}let a={has(l){return typeof nx(i,l)<"u"},get:(l,d)=>{this._validateConfigurationAccess(e?`${e}.${l}`:l,o,n?.identifier);let c=nx(i,l);if(typeof c>"u")c=d;else{let u,m=(g,v)=>{if(ut(g)){let h,x=()=>{u=u||lt(i),h=h||nx(u,v)};return new Proxy(g,{get:(S,T)=>{if(typeof T=="string"&&T.toLowerCase()==="tojson")return x(),()=>h;if(u)return h=h||nx(u,v),h[T];let P=S[T];return typeof T=="string"?m(P,`${v}.${T}`):P},set:(S,T,P)=>(x(),h&&(h[T]=P),!0),deleteProperty:(S,T)=>(x(),h&&delete h[T],!0),defineProperty:(S,T,P)=>(x(),h&&Object.defineProperty(h,T,P),!0)})}return Array.isArray(g)?lt(g):g};c=m(c,l)}return c},update:(l,d,c,u)=>{l=e?`${e}.${l}`:l;let m=s(c);return d!==void 0?this._proxy.$updateConfigurationOption(m,l,d,o,u):this._proxy.$removeConfigurationOption(m,l,o,u)},inspect:l=>{l=e?`${e}.${l}`:l;let d=this._configuration.inspect(l,o,this._extHostWorkspace.workspace);if(d)return{key:l,defaultValue:lt(d.policy?.value??d.default?.value),globalLocalValue:lt(d.userLocal?.value),globalRemoteValue:lt(d.userRemote?.value),globalValue:lt(d.user?.value??d.application?.value),workspaceValue:lt(d.workspace?.value),workspaceFolderValue:lt(d.workspaceFolder?.value),defaultLanguageValue:lt(d.default?.override),globalLocalLanguageValue:lt(d.userLocal?.override),globalRemoteLanguageValue:lt(d.userRemote?.override),globalLanguageValue:lt(d.user?.override??d.application?.override),workspaceLanguageValue:lt(d.workspace?.override),workspaceFolderLanguageValue:lt(d.workspaceFolder?.override),languageIds:lt(d.overrideIdentifiers)}}};return typeof i=="object"&&ar(a,i,!1),Object.freeze(a)}_toReadonlyValue(e){let t=n=>ut(n)?new Proxy(n,{get:(o,i)=>t(o[i]),set:(o,i,s)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(i)}' of object`)},deleteProperty:(o,i)=>{throw new Error(`TypeError: Cannot delete read only property '${String(i)}' of object`)},defineProperty:(o,i)=>{throw new Error(`TypeError: Cannot define property '${String(i)}' for a readonly object`)},setPrototypeOf:o=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):n;return t(e)}_validateConfigurationAccess(e,t,n){let o=pr.test(e)?5:this._configurationScopes.get(e),i=n?`[${n.value}] `:"";if(5===o){typeof t?.resource>"u"&&this._logService.warn(`${i}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(4===o){t?.resource&&this._logService.warn(`${i}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){let n=new tx(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(o,i)=>n.affectsConfiguration(o,eN(i))})}_toMap(e){return e.reduce((t,n)=>(t.set(n[0],n[1]),t),new Map)}},ao=M("IExtHostConfiguration");var NP=class{constructor(e,t){this.versionId=e;this.removedDueToLooping=t}},Fs=class r extends H{constructor(t,n){super();this._activationEventsReader=t;this._onDidChange=this._register(new E);this.onDidChange=this._onDidChange.event;this._versionId=0;this._extensionDescriptions=n,this._initialize()}static isHostExtension(t,n,o){if(n.getExtensionDescription(t))return!1;let i=o.getExtensionDescription(t);return i?!!((i.main||i.browser)&&i.api==="none"):!1}_initialize(){this._extensionDescriptions.sort(eB),this._extensionsMap=new Un,this._extensionsArr=[],this._activationMap=new Map;for(let t of this._extensionDescriptions){if(this._extensionsMap.has(t.identifier)){console.error("Extension `"+t.identifier.value+"` is already registered");continue}this._extensionsMap.set(t.identifier,t),this._extensionsArr.push(t);let n=this._activationEventsReader.readActivationEvents(t);for(let o of n)this._activationMap.has(o)||this._activationMap.set(o,[]),this._activationMap.get(o).push(t)}}set(t){return this._extensionDescriptions=t,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(t,n){this._extensionDescriptions=tN(this._extensionDescriptions,n),this._extensionDescriptions=this._extensionDescriptions.concat(t);let o=r._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=tN(this._extensionDescriptions,o.map(i=>i.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new NP(this._versionId,o)}static _findLoopingExtensions(t){let n=new class{constructor(){this._arcs=new Map;this._nodesSet=new Set;this._nodesArr=[]}addNode(l){this._nodesSet.has(l)||(this._nodesSet.add(l),this._nodesArr.push(l))}addArc(l,d){this.addNode(l),this.addNode(d),this._arcs.has(l)?this._arcs.get(l).push(d):this._arcs.set(l,[d])}getArcs(l){return this._arcs.has(l)?this._arcs.get(l):[]}hasOnlyGoodArcs(l,d){let c=n.getArcs(l);for(let u=0;u<c.length;u++)if(!d.has(c[u]))return!1;return!0}getNodes(){return this._nodesArr}},o=new Un;for(let l of t)if(o.set(l.identifier,l),l.extensionDependencies)for(let d of l.extensionDependencies)n.addArc(_e.toKey(l.identifier),_e.toKey(d));let i=new Set;n.getNodes().filter(l=>n.getArcs(l).length===0).forEach(l=>i.add(l));let s=n.getNodes().filter(l=>!i.has(l)),a;do{a=!1;for(let l=0;l<s.length;l++){let d=s[l];n.hasOnlyGoodArcs(d,i)&&(s.splice(l,1),l--,i.add(d),a=!0)}}while(a);return s.map(l=>o.get(l))}containsActivationEvent(t){return this._activationMap.has(t)}containsExtension(t){return this._extensionsMap.has(t)}getExtensionDescriptionsForActivationEvent(t){let n=this._activationMap.get(t);return n?n.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new UP(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(t){let n=this._extensionsMap.get(t);return n||void 0}getExtensionDescriptionByUUID(t){for(let n of this._extensionsArr)if(n.uuid===t)return n}getExtensionDescriptionByIdOrUUID(t,n){return this.getExtensionDescription(t)??(n?this.getExtensionDescriptionByUUID(n):void 0)}},UP=class{constructor(e,t){this.versionId=e;this.extensions=t}};function eB(r,e){let t=r.isBuiltin?0:r.isUnderDevelopment?2:1,n=e.isBuiltin?0:e.isUnderDevelopment?2:1;if(t!==n)return t-n;let o=Le.basename(r.extensionLocation.path),i=Le.basename(e.extensionLocation.path);return o<i?-1:o>i?1:0}function tN(r,e){let t=new Yn(e);return r.filter(n=>!t.has(n.identifier))}var Bd=class r{static{this.NONE=new r(!1,-1,-1,-1)}constructor(e,t,n,o){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=n,this.activateResolvedTime=o}},sp=class{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new Bd(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}},Wd=class{constructor(e,t,n,o,i,s){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=n,this.module=o,this.exports=i,this.disposable=s}},ox=class extends Wd{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,H.None)}},rx=class extends Wd{constructor(){super(!1,null,Bd.NONE,{activate:void 0,deactivate:void 0},void 0,H.None)}},ap=class extends Wd{constructor(e){super(!0,e,Bd.NONE,{activate:void 0,deactivate:void 0},void 0,H.None)}},ip=class{constructor(e,t,n,o){this._logService=o;this._registry=e,this._globalRegistry=t,this._host=n,this._operations=new Un,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(let[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){let e=[];for(let[t,n]of this._operations)e.push(n.wait());await Promise.all(e)}isActivated(e){let t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){let t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;let n=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(n.map(o=>({id:o.identifier,reason:{startup:t,extensionId:o.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){let n=this._registry.getExtensionDescription(e);if(!n)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:n.identifier,reason:t}])}async _activateExtensions(e){let t=e.filter(n=>!this.isActivated(n.id)).map(n=>this._handleActivationRequest(n));await Promise.all(t.map(n=>n.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);let t=this._registry.getExtensionDescription(e.id);if(!t){let i=new Error(`Cannot activate unknown extension '${e.id.value}'`),s=this._createAndSaveOperation(e,null,[],new ap(i));return this._host.onExtensionActivationError(e.id,i,new Ug(e.id.value)),s}let n=[],o=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(let i of o){if(this._isResolvedExtension(i))continue;let s=this._operations.get(i);if(s){n.push(s);continue}if(this._isHostExtension(i)){n.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(i).identifier,reason:e.reason}));continue}let a=this._registry.getExtensionDescription(i);if(a){if(!a.main&&!a.browser)continue;n.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}let l=t.displayName||t.identifier.value,d=new Error(`Cannot activate the '${l}' extension because it depends on unknown extension '${i}'`),c=this._createAndSaveOperation(e,t.displayName,[],new ap(d));return this._host.onExtensionActivationError(t.identifier,d,new Ug(i)),c}return this._createAndSaveOperation(e,t.displayName,n,null)}_createAndSaveOperation(e,t,n,o){let i=new Mf(e.id,t,e.reason,n,o,this._host,this._logService);return this._operations.set(e.id,i),i}_isHostExtension(e){return Fs.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){let t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};ip=D([C(3,ue)],ip);var Mf=class{constructor(e,t,n,o,i,s,a){this._id=e;this._displayName=t;this._reason=n;this._deps=o;this._value=i;this._host=s;this._logService=a;this._barrier=new yn;this._isDisposed=!1;this._initialize()}get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.value&&!t.value.activationFailed){this._deps.splice(e,1),e--;continue}if(t.value&&t.value.activationFailed){let n=new Error(`Cannot activate the '${this.friendlyName}' extension because its dependency '${t.friendlyName}' failed to activate`);n.detail=t.value.activationFailedError,this._value=new ap(n),this._host.onExtensionActivationError(this._id,n,null);return}}this._deps.length>0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){let t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new ap(t),this._isDisposed&&Tn(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};Mf=D([C(6,ue)],Mf);var lp=class{constructor(e,t){this._logService=t;this._onDidChangeStorage=new E;this.onDidChangeStorage=this._onDidChangeStorage.event;this._proxy=e.getProxy(N.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,n){let o=await this._proxy.$initializeExtensionStorage(e,t),i;return o&&(i=this.safeParseValue(e,t,o)),i||n}setValue(e,t,n){return this._proxy.$setValue(e,t,n)}$acceptValue(e,t,n){let o=this.safeParseValue(e,t,n);o&&this._onDidChangeStorage.fire({shared:e,key:t,value:o})}safeParseValue(e,t,n){try{return JSON.parse(n)}catch(o){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${o}`)}}},dp=M("IExtHostStorage");var Af=class{constructor(e,t,n){this._deferredPromises=new Map;this._id=e,this._shared=t,this._storage=n,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(o=>(this._value=o,this)),this._storageListener=this._storage.onDidChangeStorage(o=>{o.shared===this._shared&&o.key===this._id&&(this._value=o.value)}),this._scheduler=new Xn(()=>{let o=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(let i of o.values())i.complete()}catch(i){for(let s of o.values())s.error(i)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let n=this._value[e];return typeof n>"u"&&(n=t),n}update(e,t){t!==null&&typeof t=="object"?this._value[e]=JSON.parse(JSON.stringify(t)):this._value[e]=t;let n=this._deferredPromises.get(e);if(n!==void 0)return n.p;let o=new _n;return this._deferredPromises.set(e,o),this._scheduler.isScheduled()||this._scheduler.schedule(),o.p}dispose(){this._storageListener.dispose()}},ix=class extends Af{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}};var vo=class{constructor(e,t){this._fileSystemProvider=new Map;this._writeQueue=new lv;this._proxy=e.getProxy(N.MainThreadFileSystem);let n=this;this.value=Object.freeze({async stat(o){try{let i,s=n._fileSystemProvider.get(o.scheme);return s?(await n._proxy.$ensureActivation(o.scheme),i=await s.impl.stat(o)):i=await n._proxy.$stat(o),{type:i.type,ctime:i.ctime,mtime:i.mtime,size:i.size,permissions:i.permissions===1?1:void 0}}catch(i){vo._handleError(i)}},async readDirectory(o){try{let i=n._fileSystemProvider.get(o.scheme);return i?(await n._proxy.$ensureActivation(o.scheme),(await i.impl.readDirectory(o)).slice()):await n._proxy.$readdir(o)}catch(i){return vo._handleError(i)}},async createDirectory(o){try{let i=n._fileSystemProvider.get(o.scheme);return i&&!i.isReadonly?(await n._proxy.$ensureActivation(o.scheme),await n.mkdirp(i.impl,i.extUri,o)):await n._proxy.$mkdir(o)}catch(i){return vo._handleError(i)}},async readFile(o){try{let i=n._fileSystemProvider.get(o.scheme);return i?(await n._proxy.$ensureActivation(o.scheme),(await i.impl.readFile(o)).slice()):(await n._proxy.$readFile(o)).buffer}catch(i){return vo._handleError(i)}},async writeFile(o,i){try{let s=n._fileSystemProvider.get(o.scheme);return s&&!s.isReadonly?(await n._proxy.$ensureActivation(o.scheme),await n.mkdirp(s.impl,s.extUri,s.extUri.dirname(o)),await n._writeQueue.queueFor(o,()=>Promise.resolve(s.impl.writeFile(o,i,{create:!0,overwrite:!0})))):await n._proxy.$writeFile(o,ee.wrap(i))}catch(s){return vo._handleError(s)}},async delete(o,i){try{let s=n._fileSystemProvider.get(o.scheme);return s&&!s.isReadonly&&!i?.useTrash?(await n._proxy.$ensureActivation(o.scheme),await s.impl.delete(o,{recursive:!1,...i})):await n._proxy.$delete(o,{recursive:!1,useTrash:!1,atomic:!1,...i})}catch(s){return vo._handleError(s)}},async rename(o,i,s){try{return await n._proxy.$rename(o,i,{overwrite:!1,...s})}catch(a){return vo._handleError(a)}},async copy(o,i,s){try{return await n._proxy.$copy(o,i,{overwrite:!1,...s})}catch(a){return vo._handleError(a)}},isWritableFileSystem(o){let i=t.getCapabilities(o);if(typeof i=="number")return!(i&2048)}})}async mkdirp(e,t,n){let o=[];for(;!t.isEqual(n,t.dirname(n));)try{if(((await e.stat(n)).type&2)===0)throw rt.FileExists(`Unable to create folder '${n.scheme===$.file?n.fsPath:n.toString(!0)}' that already exists but is not a directory`);break}catch(i){if(Oc(i)!=="EntryNotFound")throw i;o.push(t.basename(n)),n=t.dirname(n)}for(let i=o.length-1;i>=0;i--){n=t.joinPath(n,o[i]);try{await e.createDirectory(n)}catch(s){if(Oc(s)!=="EntryExists")throw s}}}static _handleError(e){if(e instanceof rt)throw e;if(e instanceof pg)switch(e.code){case"EntryExists":throw rt.FileExists(e.message);case"EntryNotFound":throw rt.FileNotFound(e.message);case"EntryNotADirectory":throw rt.FileNotADirectory(e.message);case"EntryIsADirectory":throw rt.FileIsADirectory(e.message);case"NoPermissions":throw rt.NoPermissions(e.message);case"Unavailable":throw rt.Unavailable(e.message);default:throw new rt(e.message,e.name)}if(!(e instanceof Error))throw new rt(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw rt.Unavailable(e.message);switch(e.name){case"EntryExists":throw rt.FileExists(e.message);case"EntryNotFound":throw rt.FileNotFound(e.message);case"EntryNotADirectory":throw rt.FileNotADirectory(e.message);case"EntryIsADirectory":throw rt.FileIsADirectory(e.message);case"NoPermissions":throw rt.NoPermissions(e.message);case"Unavailable":throw rt.Unavailable(e.message);default:throw new rt(e.message,e.name)}}addFileSystemProvider(e,t,n){return this._fileSystemProvider.set(e,{impl:t,extUri:n?.isCaseSensitive?tt:HT,isReadonly:!!n?.isReadonly}),J(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??tt}};vo=D([C(0,ge),C(1,lr)],vo);var ll=M("IExtHostConsumerFileSystem");var up=M("IExtensionStoragePaths"),cp=class{constructor(e,t,n){this._logService=t;this._extHostFileSystem=n;this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(o=>this._value=o)}async _getWorkspaceStorageURI(e){return y.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);let e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(y.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:y.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(n){this._logService.error("[ExtHostStorage]",n);return}}workspaceValue(e){if(this._value)return y.joinPath(this._value,e.identifier.value)}globalValue(e){return y.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};cp=D([C(0,nt),C(1,ue),C(2,ll)],cp);var pbe=M("tunnelService"),mbe=M("sharedTunnelsService");function tB(r){if(r.scheme!=="http"&&r.scheme!=="https")return;let e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(r.authority);if(e)return{address:e[1],port:+e[2]}}var FP=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function nN(r){return FP.indexOf(r)>=0}var HP=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function oN(r){return HP.indexOf(r)>=0}var ax=class{constructor(e,t,n){this.remoteAddress=e;this.localAddress=t;this._dispose=n;this._onDispose=new E;this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._onDispose.dispose(),this._dispose()}},sx=class extends H{constructor(t,n){super();this.logService=t;this.configurationService=n;this._onTunnelOpened=this._register(new E);this.onTunnelOpened=this._onTunnelOpened.event;this._onTunnelClosed=this._register(new E);this.onTunnelClosed=this._onTunnelClosed.event;this._onAddedTunnelProvider=this._register(new E);this.onAddedTunnelProvider=this._onAddedTunnelProvider.event;this._tunnels=new Map;this._canElevate=!1;this._canChangeProtocol=!0;this._privacyOptions=[];this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){let t=this.configurationService.getValue("remote.localPortHost");return!t||t==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(t){return this._tunnelProvider=t,t?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(t){this._canElevate=t.elevation,this._privacyOptions=t.privacyOptions,this._canChangeProtocol=t.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){let t=[],n=Array.from(this._tunnels.values());for(let o of n){let i=Array.from(o.values());for(let s of i){let a=await s.value;a&&typeof a!="string"&&t.push(a)}}return t}async dispose(){super.dispose();for(let t of this._tunnels.values()){for(let{value:n}of t.values())await n.then(o=>typeof o!="string"?o?.dispose():void 0);t.clear()}this._tunnels.clear()}setEnvironmentTunnel(t,n,o,i,s){this.addTunnelToMap(t,n,Promise.resolve({tunnelRemoteHost:t,tunnelRemotePort:n,localAddress:o,privacy:i,protocol:s,dispose:()=>Promise.resolve()}))}async getExistingTunnel(t,n){(oN(t)||nN(t))&&(t=FP[0]);let o=this.getTunnelFromMap(t,n);if(o)return++o.refcount,o.value}openTunnel(t,n,o,i,s,a=!1,l,d){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${n}:${o} on local port ${s}.`);let c=this._tunnelProvider??t;if(!c)return;if(n||(n="localhost"),i||(i=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(o)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}let u=this.retainOrCreateTunnel(c,n,o,i,s,a,l,d);return u?u.then(m=>{if(m){if(typeof m=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(n,o),m}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(n,o);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");let g=this.makeTunnel(m);return(m.tunnelRemoteHost!==n||m.tunnelRemotePort!==o)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),l&&m.privacy!==l&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(g),g}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),u)}makeTunnel(t){return{tunnelRemotePort:t.tunnelRemotePort,tunnelRemoteHost:t.tunnelRemoteHost,tunnelLocalPort:t.tunnelLocalPort,localAddress:t.localAddress,privacy:t.privacy,protocol:t.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${t.tunnelRemoteHost}:${t.tunnelRemotePort} `);let n=this._tunnels.get(t.tunnelRemoteHost);if(n){let o=n.get(t.tunnelRemotePort);o&&(o.refcount--,await this.tryDisposeTunnel(t.tunnelRemoteHost,t.tunnelRemotePort,o))}}}}async tryDisposeTunnel(t,n,o){if(o.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${t}:${n}.`);let i=o.value.then(async s=>{s&&typeof s!="string"&&(await s.dispose(!0),this._onTunnelClosed.fire({host:s.tunnelRemoteHost,port:s.tunnelRemotePort}))});return this._tunnels.has(t)&&this._tunnels.get(t).delete(n),i}}async closeTunnel(t,n){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${t}:${n} `);let o=this._tunnels.get(t);if(o&&o.has(n)){let i=o.get(n);i.refcount=0,await this.tryDisposeTunnel(t,n,i)}}addTunnelToMap(t,n,o){this._tunnels.has(t)||this._tunnels.set(t,new Map),this._tunnels.get(t).set(n,{refcount:1,value:o})}async removeEmptyOrErrorTunnelFromMap(t,n){let o=this._tunnels.get(t);if(o){let i=o.get(n),s=i?await i.value:void 0;(!s||typeof s=="string")&&o.delete(n),o.size===0&&this._tunnels.delete(t)}}getTunnelFromMap(t,n){let o=[t];nN(t)?(o.push(...FP),o.push(...HP)):oN(t)&&o.push(...HP);let i=o.map(s=>this._tunnels.get(s));for(let s of i){let a=s?.get(n);if(a)return a}}canTunnel(t){return!!tB(t)}createWithProvider(t,n,o,i,s,a,l){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${n}:${o} on local port ${i}.`);let d=o;this._factoryInProgress.add(d);let c=i===void 0?o:i,u={elevationRequired:s?this.isPortPrivileged(c):!1},m={remoteAddress:{host:n,port:o},localAddressPort:i,privacy:a,public:a?a!=="private":void 0,protocol:l},g=t.forwardPort(m,u);return g?(this.addTunnelToMap(n,o,g),g.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(d)})):this._factoryInProgress.delete(d),g}};sx=D([C(0,ue),C(1,oo)],sx);var VP=class extends ax{},rN;(t=>{function r(n){return{remoteAddress:n.remoteAddress,localAddress:n.localAddress,public:!!n.public,privacy:n.privacy??(n.public?"public":"private"),protocol:n.protocol}}t.fromApiTunnel=r;function e(n){return{remoteAddress:{host:n.tunnelRemoteHost,port:n.tunnelRemotePort},localAddress:n.localAddress,public:n.privacy!=="constantPrivate"&&n.privacy!=="constantPrivate",privacy:n.privacy,protocol:n.protocol}}t.fromServiceTunnel=e})(rN||={});var mp=M("IExtHostTunnelService"),pp=class extends H{constructor(t,n,o){super();this.logService=o;this._showCandidatePort=()=>Promise.resolve(!0);this._extensionTunnels=new Map;this._onDidChangeTunnels=this._register(new E);this.onDidChangeTunnels=this._onDidChangeTunnels.event;this._providerHandleCounter=0;this._portAttributesProviders=new Map;this._proxy=t.getProxy(N.MainThreadTunnelService)}async openTunnel(t,n){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${t.identifier.value} called openTunnel API for ${n.remoteAddress.host}:${n.remoteAddress.port}.`);let o=await this._proxy.$openTunnel(n,t.displayName);if(o){let i=new VP(o.remoteAddress,o.localAddress,()=>this._proxy.$closeTunnel(o.remoteAddress));return this._register(i),i}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(t,n){t.portRange===void 0&&t.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");let o=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(o,{selector:t,provider:n}),this._proxy.$registerPortsAttributesProvider(t,o),new fe(()=>{this._portAttributesProviders.delete(o),this._proxy.$unregisterPortsAttributesProvider(o)})}async $providePortAttributes(t,n,o,i,s){let a=[];for(let d of t){let c=this._portAttributesProviders.get(d);if(!c)return[];a.push(...await Promise.all(n.map(async u=>{let m;try{m=await c.provider.providePortAttributes({port:u,pid:o,commandLine:i},s)}catch{m=await c.provider.providePortAttributes(u,o,i,s)}return{providedAttributes:m,port:u}})))}let l=a.filter(d=>!!d.providedAttributes);return l.length>0?l.map(d=>({autoForwardAction:d.providedAttributes.autoForwardAction,port:d.port})):[]}async $registerCandidateFinder(t){}registerTunnelProvider(t,n){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(i,s)=>await t.provideTunnel(i,s,be.None)??void 0;let o=n.tunnelFeatures?{elevation:!!n.tunnelFeatures?.elevation,privacyOptions:n.tunnelFeatures?.privacyOptions,protocol:n.tunnelFeatures.protocol===void 0?!0:n.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(o,!0),Promise.resolve(J(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0,!1)}))}hasTunnelProvider(){return this._proxy.$hasTunnelProvider()}async setTunnelFactory(t,n){if(t){t.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(t.candidatePortSource),t.showCandidatePort&&(this._showCandidatePort=t.showCandidatePort,this._proxy.$setCandidateFilter());let o=t.tunnelFactory??(n?this.makeManagedTunnelFactory(n):void 0);if(o){this._forwardPortProvider=o;let i=t.tunnelFeatures?.privacyOptions??[];t.tunnelFeatures?.public&&i.length===0&&(i=[{id:"private",label:p(3173,null),themeIcon:"lock"},{id:"public",label:p(3174,null),themeIcon:"eye"}]);let s=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,public:!!t.tunnelFeatures?.public,privacyOptions:i,protocol:!0}:void 0;this._proxy.$setTunnelProvider(s,!!t.tunnelFactory)}}else this._forwardPortProvider=void 0;return J(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(t){}async $closeTunnel(t,n){if(this._extensionTunnels.has(t.host)){let o=this._extensionTunnels.get(t.host);o.has(t.port)&&(n&&o.get(t.port).disposeListener.dispose(),await o.get(t.port).tunnel.dispose(),o.delete(t.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(t,n){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");let o=this._forwardPortProvider(t,n);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),o!==void 0){let i=await o;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),i===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(t.remoteAddress.host)||this._extensionTunnels.set(t.remoteAddress.host,new Map);let s=this._register(i.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(i.remoteAddress))));return this._extensionTunnels.get(t.remoteAddress.host).set(t.remoteAddress.port,{tunnel:i,disposeListener:s}),rN.fromApiTunnel(i)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(o){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),o instanceof Error)return o.message}}async $applyCandidateFilter(t){let n=await Promise.all(t.map(i=>this._showCandidatePort(i.host,i.port,i.detail??""))),o=t.filter((i,s)=>n[s]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${t.map(i=>i.port).join(", ")} to ${o.map(i=>i.port).join(", ")}`),o}};pp=D([C(0,ge),C(1,nt),C(2,ue)],pp);function iN(r){return[...r.entries()]}function sN(r){return r?[...r.entries()]:[]}var Bbe=M("ptyService");var nB={Backend:"workbench.contributions.terminal.processBackend"},BP=class{constructor(){this._backends=new Map}get backends(){return this._backends}registerTerminalBackend(e){let t=this._sanitizeRemoteAuthority(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e)}getTerminalBackend(e){return this._backends.get(this._sanitizeRemoteAuthority(e))}_sanitizeRemoteAuthority(e){return e?.toLowerCase()??""}};ot.add(nB.Backend,new BP);var Wbe=M("localPtyService"),$be=M("terminalLogService");var lx=class{constructor(e){this._callback=e;this._terminalBufferMap=new Map}dispose(){for(let e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,n=5){let o=t(i=>{let s=ke(i)?i:i.data,a=this._terminalBufferMap.get(e);if(a){a.data.push(s);return}let l=setTimeout(()=>this.flushBuffer(e),n);a={data:[s],timeoutId:l,dispose:()=>{clearTimeout(l),this.flushBuffer(e),o.dispose()}},this._terminalBufferMap.set(e,a)});return o}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){let t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}};var $d=(r,e,t,n)=>{let o=e;return{enumerable:!0,configurable:!1,get(){return o},set(i){if(!t(o,i)){let s=o;o=i,r.listener?.(n(i,s))}}}},gp=(r,e)=>r===e,dl={range:(r,e)=>r===e?!0:!r||!e?!1:r.isEqual(e),label:gp,description:gp,sortText:gp,busy:gp,error:gp,canResolveChildren:gp,tags:(r,e)=>!(r.length!==e.length||r.some(t=>!e.find(n=>t.id===n.id)))},fp=r=>e=>({op:4,update:r(e)}),oB=(r,e)=>({range:(()=>{let t,n=fp(o=>({range:Oe.lift(V.from(o))}));return{enumerable:!0,configurable:!1,get(){return t},set(o){r.listener?.({op:6}),dl.range(t,o)||(t=o,r.listener?.(n(o)))}}})(),label:$d(r,e,dl.label,fp(t=>({label:t}))),description:$d(r,void 0,dl.description,fp(t=>({description:t}))),sortText:$d(r,void 0,dl.sortText,fp(t=>({sortText:t}))),canResolveChildren:$d(r,!1,dl.canResolveChildren,t=>({op:2,state:t})),busy:$d(r,!1,dl.busy,fp(t=>({busy:t}))),error:$d(r,void 0,dl.error,fp(t=>({error:ce.fromStrict(t)||null}))),tags:$d(r,[],dl.tags,(t,n)=>({op:1,new:t.map(yr.from),old:n.map(yr.from)}))}),rB=r=>{let e=ze.fromString(r.extId),t=new Hs(e.controllerId,e.localId,r.label,y.revive(r.uri)||void 0);return t.range=V.to(r.range||void 0),t.description=r.description||void 0,t.sortText=r.sortText||void 0,t.tags=r.tags.map(n=>yr.to({id:Kb(n).tagId})),t},WP=r=>{let e;for(let t of r.tests){let n=rB(t.item);iu(n).parent=e,e=n}return e},Hs=class r{constructor(e,t,n,o){if(t.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);let i=gO(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:o,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return i.parent instanceof hp?void 0:i.parent}},children:{value:pO(i,iu,r),enumerable:!0,writable:!1},...oB(i,n)})}},hp=class extends Hs{constructor(t,n){super(t,t,n,void 0);this._isRoot=!0}},dx=class extends jb{constructor(e,t,n){super({controllerId:e,getDocumentVersion:o=>o&&n.getDocument(o)?.version,getApiFor:iu,getChildren:o=>o.children,root:new hp(e,t),toITestItem:Oi.from})}};var vp=class extends H{constructor(t,n,o){super();this.initData=n;this._onDidChangeTelemetryEnabled=this._register(new E);this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event;this._onDidChangeTelemetryConfiguration=this._register(new E);this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event;this._productConfig={usage:!0,error:!0};this._level=0;this._inLoggingOnlyMode=!1;this._telemetryLoggers=new Map;this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;let i=n.remote.isRemote?"remoteExtHostTelemetry":t?"workerExtHostTelemetry":"extHostTelemetry";this._outputLogger=this._register(o.createLogger(i,{name:p(3170,null,this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:vL}))}getTelemetryConfiguration(){return this._level===3}getTelemetryDetails(){return{isCrashEnabled:this._level>=1,isErrorsEnabled:this._productConfig.error?this._level>=2:!1,isUsageEnabled:this._productConfig.usage?this._level>=3:!1}}instantiateLogger(t,n,o){let i=this.getTelemetryDetails(),s=new Lf(n,o,t,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(t),{isUsageEnabled:i.isUsageEnabled,isErrorsEnabled:i.isErrorsEnabled}),a=this._telemetryLoggers.get(t.identifier.value)??[];return this._telemetryLoggers.set(t.identifier.value,[...a,s]),s.apiTelemetryLogger}$initializeTelemetryLevel(t,n,o){this._level=t,this._productConfig=o??{usage:!0,error:!0}}getBuiltInCommonProperties(t){let n=Object.create(null);switch(n["common.extname"]=`${t.publisher}.${t.name}`,n["common.extversion"]=t.version,n["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,n["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,n["common.vscodecommithash"]=this.initData.commit,n["common.sqmid"]=this.initData.telemetryInfo.sqmId,n["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId??this.initData.telemetryInfo.machineId,n["common.vscodeversion"]=this.initData.version,n["common.vscodereleasedate"]=this.initData.date,n["common.isnewappinstall"]=$P(this.initData.telemetryInfo.firstSessionDate),n["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case 2:n["common.uikind"]="web";break;case 1:n["common.uikind"]="desktop";break;default:n["common.uikind"]="unknown"}return n["common.remotename"]=bL(this.initData.remote.authority,this.initData),n}$onDidChangeTelemetryLevel(t){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=t;let n=this.getTelemetryDetails();this._telemetryLoggers.forEach((o,i)=>{let s=o.filter(a=>!a.isDisposed);s.length===0?this._telemetryLoggers.delete(i):this._telemetryLoggers.set(i,s)}),this._telemetryLoggers.forEach(o=>{for(let i of o)i.updateTelemetryEnablements(n.isUsageEnabled,n.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(t,n){let i=this._telemetryLoggers.get(t.value)?.filter(a=>!a.isDisposed);if(!i)return this._telemetryLoggers.delete(t.value),!1;let s=!1;for(let a of i)a.ignoreUnhandledExtHostErrors||(a.logError(n),s=!0);return s}};vp=D([C(1,nt),C(2,Ho)],vp);var Lf=class{constructor(e,t,n,o,i,s,a){this._extension=n;this._logger=o;this._inLoggingOnlyMode=i;this._commonProperties=s;this._onDidChangeEnableStates=new E;this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t=e.properties?e.properties??{}:e;return t=uk(t,[]),this._additionalCommonProperties&&(t=ar(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=ar(t,this._commonProperties)),e.properties?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{let n={name:e.name,message:e.message,stack:e.stack,cause:e.cause},o=uk(n,[]),i=new Error(typeof o.message=="string"?o.message:void 0,{cause:o.cause});i.stack=typeof o.stack=="string"?o.stack:void 0,i.name=typeof o.name=="string"?o.name:"unknown",t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(i,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){let e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0;this._onDidChangeEnableStates.dispose()}};function $P(r){let e=Date.now()-new Date(r).getTime();return isNaN(e)?!1:e<1e3*60*60*24}var cl=M("IExtHostTelemetry");var bp=class{constructor(e,t,n){this._commands=new Map;this._apiCommands=new Map;this.#e=e.getProxy(N.MainThreadCommands),this._logService=t,this.#n=n,this.#t=e.getProxy(N.MainThreadTelemetry),this.converter=new zP(this,o=>{let i=this._apiCommands.get(o);return i?.result===xe.Void?i:void 0},t),this._argumentProcessors=[{processArgument(o){return $t(o)}},{processArgument(o){return os(o,function(i){if(Oe.isIRange(i))return V.to(i);if(sn.isIPosition(i))return Xe.to(i);if(Oe.isIRange(i.range)&&y.isUri(i.uri))return Vn.to(i);if(i instanceof ee)return i.buffer.buffer;if(!Array.isArray(i))return i})}}]}#e;#t;#n;registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){let t=this.registerCommand(!1,e.id,async(...n)=>{let o=e.args.map((s,a)=>{if(!s.validate(n[a]))throw new Error(`Invalid argument '${s.name}' when running '${e.id}', received: ${typeof n[a]=="object"?JSON.stringify(n[a],null,"	"):n[a]} `);return s.convert(n[a])}),i=await this.executeCommand(e.internalId,...o);return e.result.convert(i,n,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new fe(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,n,o,i,s){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:n,thisArg:o,metadata:i,extension:s}),e&&this.#e.$registerCommand(t),new fe(()=>{this._commands.delete(t)&&e&&this.#e.$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,n){if(this._commands.has(e))return this.#e.$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let o=!1,i=os(t,function(s){if(s instanceof Ie)return Xe.from(s);if(s instanceof pe)return V.from(s);if(s instanceof At)return Vn.from(s);if(Rn.isNotebookRange(s))return qo.from(s);if(s instanceof ArrayBuffer)return o=!0,ee.wrap(new Uint8Array(s));if(s instanceof Uint8Array)return o=!0,ee.wrap(s);if(s instanceof ee)return o=!0,s;if(!Array.isArray(s))return s});try{let s=await this.#e.$executeCommand(e,o?new Pt(i):i,n);return $t(s)}catch(s){if(s instanceof Error&&s.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw s}}}async _executeContributedCommand(e,t,n){let o=this._commands.get(e);if(!o)throw new Error("Unknown command");let{callback:i,thisArg:s,metadata:a}=o;if(a?.args)for(let d=0;d<a.args.length;d++)try{ZC(t[d],a.args[d].constraint)}catch{throw new Error(`Running the contributed command: '${e}' failed. Illegal argument '${a.args[d].name}' - ${a.args[d].description}`)}let l=uo.create();try{return await i.apply(s,t)}catch(d){if(e===this.converter.delegatingCommandId){let c=this.converter.getActualCommand(...t);c&&(e=c.command)}if(Tn(d)||this._logService.error(d,e,o.extension?.identifier),!n)throw d;if(o.extension?.identifier){let c=this.#n.onExtensionError(o.extension.identifier,d);this._logService.trace("forwarded error to extension?",c,o.extension?.identifier)}throw new class extends Error{constructor(){super(Dr(d));this.id=e;this.source=o.extension?.displayName??o.extension?.name}}}finally{this._reportTelemetry(o,e,l.elapsed())}}_reportTelemetry(e,t,n){e.extension&&(t.startsWith("code.copilot.logStructured")||this.#t.$publicLog2("Extension:ActionExecuted",{extensionId:e.extension.identifier.value,id:new xa(t),duration:n}))}$executeContributedCommand(e,...t){this._logService.trace("ExtHostCommands#$executeContributedCommand",e);let n=this._commands.get(e);return n?(t=t.map(o=>this._argumentProcessors.reduce((i,s)=>s.processArgument(i,n.extension),o)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),this.#e.$getCommands().then(t=>(e&&(t=t.filter(n=>n[0]!=="_")),t))}$getContributedCommandMetadata(){let e=Object.create(null);for(let[t,n]of this._commands){let{metadata:o}=n;o&&(e[t]=o)}return Promise.resolve(e)}};bp=D([C(0,ge),C(1,ue),C(2,cl)],bp);var Ro=M("IExtHostCommands"),zP=class{constructor(e,t,n){this._commands=e;this._lookupApiCommand=t;this._logService=n;this.delegatingCommandId=`__vsc${pt()}`;this._cache=new Map;this._cachIdPool=0;this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;let n={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return n;let o=this._lookupApiCommand(e.command);if(o)n.id=o.internalId,n.arguments=o.args.map((i,s)=>i.convert(e.arguments&&e.arguments[s]));else if(Qs(e.arguments)){let i=`${e.command} /${++this._cachIdPool}`;this._cache.set(i,e),t.add(J(()=>{this._cache.delete(i),this._logService.trace("CommandsConverter#DISPOSE",i)})),n.$ident=i,n.id=this.delegatingCommandId,n.arguments=[i],this._logService.trace("CommandsConverter#CREATE",e.command,i)}return n}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){let t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}},j=class r{constructor(e,t,n,o){this.name=e;this.description=t;this.validate=n;this.convert=o}static{this.Uri=new r("uri","Uri of a text document",e=>y.isUri(e),e=>e)}static{this.Position=new r("position","A position in a text document",e=>Ie.isPosition(e),Xe.from)}static{this.Range=new r("range","A range in a text document",e=>pe.isRange(e),V.from)}static{this.Selection=new r("selection","A selection in a text document",e=>xn.isSelection(e),Qn.from)}static{this.Number=new r("number","",e=>typeof e=="number",e=>e)}static{this.String=new r("string","",e=>typeof e=="string",e=>e)}static Arr(e){return new r(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(n=>e.validate(n)),t=>t.map(n=>e.convert(n)))}static{this.CallHierarchyItem=new r("item","A call hierarchy item",e=>e instanceof Wa,Os.from)}static{this.TypeHierarchyItem=new r("item","A type hierarchy item",e=>e instanceof Ka,Us.from)}static{this.TestItem=new r("testItem","A VS Code TestItem",e=>e instanceof Hs,Oi.from)}static{this.TestProfile=new r("testProfile","A VS Code test profile",e=>e instanceof Su,iP.from)}optional(){return new r(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new r(e??this.name,t??this.description,this.validate,this.convert)}},xe=class r{constructor(e,t){this.description=e;this.convert=t}static{this.Void=new r("no result",e=>e)}},Te=class{constructor(e,t,n,o,i){this.id=e;this.internalId=t;this.description=n;this.args=o;this.result=i}};var Yr=M("IExtHostTerminalService"),cx=class extends H{constructor(t,n,o,i){super();this._proxy=t;this._id=n;this._creationOptions=o;this._name=i;this._disposed=!1;this._state={isInteractedWith:!1,shell:void 0};this.isOpen=!1;this._onWillDispose=this._register(new E);this.onWillDispose=this._onWillDispose.event;this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(a=>this._pidPromiseComplete=a);let s=this;this.value={get name(){return s._name||""},get processId(){return s._pidPromise},get creationOptions(){return s._creationOptions},get exitStatus(){return s._exitStatus},get state(){return s._state},get selection(){return s._selection},get shellIntegration(){return s.shellIntegration},sendText(a,l=!0){s._checkDisposed(),s._proxy.$sendText(s._id,a,l)},show(a){s._checkDisposed(),s._proxy.$show(s._id,a)},hide(){s._checkDisposed(),s._proxy.$hide(s._id)},dispose(){s._disposed||(s._disposed=!0,s._proxy.$dispose(s._id))},get dimensions(){if(!(s._cols===void 0||s._rows===void 0))return{columns:s._cols,rows:s._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(t,n){if(typeof this._id!="string")throw new Error("Terminal has already been created");await this._proxy.$createTerminal(this._id,{name:t.name,shellPath:t.shellPath??void 0,shellArgs:t.shellArgs??void 0,cwd:t.cwd??n?.cwd??void 0,env:t.env??void 0,icon:lN(t.iconPath)??void 0,color:Nc.isThemeColor(t.color)?t.color.id:void 0,initialText:t.message??void 0,strictEnv:t.strictEnv??void 0,hideFromUser:t.hideFromUser??void 0,forceShellIntegration:n?.forceShellIntegration??void 0,isFeatureTerminal:n?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:n?.useShellEnvironment??void 0,location:n?.location||this._serializeParentTerminal(t.location,n?.resolvedExtHostIdentifier),isTransient:t.isTransient??void 0,shellIntegrationNonce:t.shellIntegrationNonce??void 0})}async createExtensionTerminal(t,n,o,i,s,a){if(typeof this._id!="string")throw new Error("Terminal has already been created");if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:i,color:Nc.isThemeColor(s)?s.id:void 0,location:n?.location||this._serializeParentTerminal(t,o),isTransient:!0,shellIntegrationNonce:a??void 0}),typeof this._id=="string")throw new Error("Terminal creation failed");return this._id}_serializeParentTerminal(t,n){return typeof t=="object"?oi(t,{parentTerminal:!0})&&t.parentTerminal&&n?{parentTerminal:n}:oi(t,{viewColumn:!0})?{viewColumn:_t.from(t.viewColumn),preserveFocus:t.preserveFocus}:void 0:t}_checkDisposed(){if(this._disposed)throw new Error("Terminal has already been disposed")}set name(t){this._name=t}setExitStatus(t,n){this._exitStatus=Object.freeze({code:t,reason:n})}setDimensions(t,n){return t===this._cols&&n===this._rows||t===0||n===0?!1:(this._cols=t,this._rows=n,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={...this._state,isInteractedWith:!0},!0)}setShellType(t){return this._state.shell!==t?(this._state={...this._state,shell:t},!0):!1}setSelection(t){this._selection=t}_setProcessId(t){this._pidPromiseComplete?(this._pidPromiseComplete(t),this._pidPromiseComplete=void 0):this._pidPromise.then(n=>{n!==t&&(this._pidPromise=Promise.resolve(t))})}},Nf=class{constructor(e){this._pty=e;this.id=0;this.shouldPersist=!1;this._onProcessData=new E;this.onProcessData=this._onProcessData.event;this._onProcessReady=new E;this._onDidChangeProperty=new E;this.onDidChangeProperty=this._onDidChangeProperty.event;this._onProcessExit=new E;this.onProcessExit=this._onProcessExit.event}get onProcessReady(){return this._onProcessReady.event}refreshProperty(e){throw new Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw new Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}sendSignal(e){}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve("")}getCwd(){return Promise.resolve("")}startSendingEvents(e){this._pty.onDidWrite(t=>this._onProcessData.fire(t)),this._pty.onDidClose?.((t=void 0)=>{this._onProcessExit.fire(t===void 0?void 0:t)}),this._pty.onDidOverrideDimensions?.(t=>{t&&this._onDidChangeProperty.fire({type:"overrideDimensions",value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:"title",value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}},iB=1,Of=class extends H{constructor(t,n,o){super();this._extHostCommands=n;this._terminals=[];this._terminalProcesses=new Map;this._terminalProcessDisposables={};this._extensionTerminalAwaitingStart={};this._getTerminalPromises={};this._environmentVariableCollections=new Map;this._lastQuickFixCommands=this._register(new En);this._linkProviders=new Set;this._completionProviders=new Map;this._profileProviders=new Map;this._quickFixProviders=new Map;this._terminalLinkCache=new Map;this._terminalLinkCancellationSource=new Map;this._onDidCloseTerminal=new E;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this._onDidOpenTerminal=new E;this.onDidOpenTerminal=this._onDidOpenTerminal.event;this._onDidChangeActiveTerminal=new E;this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event;this._onDidChangeTerminalDimensions=new E;this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event;this._onDidChangeTerminalState=new E;this.onDidChangeTerminalState=this._onDidChangeTerminalState.event;this._onDidChangeShell=new E;this.onDidChangeShell=this._onDidChangeShell.event;this._onDidWriteTerminalData=new E({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()});this.onDidWriteTerminalData=this._onDidWriteTerminalData.event;this._onDidExecuteCommand=new E({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()});this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event;this._proxy=o.getProxy(N.MainThreadTerminalService),this._bufferer=new lx(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(t),this._extHostCommands.registerArgumentProcessor({processArgument:i=>{let s=a=>this.getTerminalById(a.instanceId)?.value;switch(i?.$mid){case 15:return s(i);default:{if(Array.isArray(i))for(let a=0;a<i.length&&i[a].$mid===15;a++)i[a]=s(i[a]);return i}}}}),this._register({dispose:()=>{for(let[i,s]of this._terminalProcesses)s.shutdown(!0)}})}get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(t=>t.value)}getDefaultShell(t){return(t?this._defaultAutomationProfile:this._defaultProfile)?.path||""}getDefaultShellArgs(t){return(t?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(t,n){let o=new cx(this._proxy,pt(),t,t.name),i=new Nf(t.pty);return o.createExtensionTerminal(t.location,n,this._serializeParentTerminal(t,n).resolvedExtHostIdentifier,lN(t.iconPath),sB(t.color),t.shellIntegrationNonce).then(s=>{let a=this._setupExtHostProcessListeners(s,i);this._terminalProcessDisposables[s]=a}),this._terminals.push(o),o.value}_serializeParentTerminal(t,n){if(n=n||{},t.location&&typeof t.location=="object"&&oi(t.location,{parentTerminal:!0})){let o=t.location.parentTerminal;if(o){let i=this._terminals.find(s=>s.value===o);i&&(n.resolvedExtHostIdentifier=i._id)}}else t.location&&typeof t.location!="object"?n.location=t.location:n.location&&typeof n.location=="object"&&oi(n.location,{splitActiveTerminal:!0})&&(n.location={splitActiveTerminal:!0});return n}attachPtyToTerminal(t,n){if(!this.getTerminalById(t))throw new Error(`Cannot resolve terminal with id ${t} for virtual process`);let i=new Nf(n),s=this._setupExtHostProcessListeners(t,i);this._terminalProcessDisposables[t]=s}async $acceptActiveTerminalChanged(t){let n=this._activeTerminal;if(t===null){this._activeTerminal=void 0,n!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}let o=this.getTerminalById(t);o&&(this._activeTerminal=o,n!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(t,n){let o=this.getTerminalById(t);o&&this._onDidWriteTerminalData.fire({terminal:o.value,data:n})}async $acceptTerminalDimensions(t,n,o){let i=this.getTerminalById(t);i&&i.setDimensions(n,o)&&this._onDidChangeTerminalDimensions.fire({terminal:i.value,dimensions:i.value.dimensions})}async $acceptDidExecuteCommand(t,n){let o=this.getTerminalById(t);o&&this._onDidExecuteCommand.fire({terminal:o.value,...n})}async $acceptTerminalMaximumDimensions(t,n,o){this._terminalProcesses.get(t)?.resize(n,o)}async $acceptTerminalTitleChange(t,n){let o=this.getTerminalById(t);o&&(o.name=n)}async $acceptTerminalClosed(t,n,o){let i=this._getTerminalObjectIndexById(this._terminals,t);if(i!==null){let s=this._terminals.splice(i,1)[0];s.setExitStatus(n,o),this._onDidCloseTerminal.fire(s.value)}}$acceptTerminalOpened(t,n,o,i){if(n){let l=this._getTerminalObjectIndexById(this._terminals,n);if(l!==null){this._terminals[l]._id=t,this._onDidOpenTerminal.fire(this.terminals[l]),this._terminals[l].isOpen=!0;return}}let s={name:i.name,shellPath:i.executable,shellArgs:i.args,cwd:typeof i.cwd=="string"?i.cwd:y.revive(i.cwd),env:i.env,hideFromUser:i.hideFromUser},a=new cx(this._proxy,t,s,o);this._terminals.push(a),this._onDidOpenTerminal.fire(a.value),a.isOpen=!0}async $acceptTerminalProcessId(t,n){this.getTerminalById(t)?._setProcessId(n)}async $startExtensionTerminal(t,n){let o=this.getTerminalById(t);if(!o)return{message:p(3171,null,t)};o.isOpen||await new Promise(s=>{let a=this.onDidOpenTerminal(async l=>{l===o.value&&(a.dispose(),s())})});let i=this._terminalProcesses.get(t);i?i.startSendingEvents(n):this._extensionTerminalAwaitingStart[t]={initialDimensions:n}}_setupExtHostProcessListeners(t,n){let o=new q;o.add(n.onProcessReady(s=>this._proxy.$sendProcessReady(t,s.pid,s.cwd,s.windowsPty))),o.add(n.onDidChangeProperty(s=>this._proxy.$sendProcessProperty(t,s))),this._bufferer.startBuffering(t,n.onProcessData),o.add(n.onProcessExit(s=>this._onProcessExit(t,s))),this._terminalProcesses.set(t,n);let i=this._extensionTerminalAwaitingStart[t];return i&&n instanceof Nf&&(n.startSendingEvents(i.initialDimensions),delete this._extensionTerminalAwaitingStart[t]),o}$acceptProcessAckDataEvent(t,n){this._terminalProcesses.get(t)?.acknowledgeDataEvent(n)}$acceptProcessInput(t,n){this._terminalProcesses.get(t)?.input(n)}$acceptTerminalInteraction(t){let n=this.getTerminalById(t);n?.setInteractedWith()&&this._onDidChangeTerminalState.fire(n.value)}$acceptTerminalSelection(t,n){this.getTerminalById(t)?.setSelection(n)}$acceptProcessResize(t,n,o){try{this._terminalProcesses.get(t)?.resize(n,o)}catch(i){if(i.code!=="EPIPE"&&i.code!=="ERR_IPC_CHANNEL_CLOSED")throw i}}$acceptProcessShutdown(t,n){this._terminalProcesses.get(t)?.shutdown(n)}$acceptProcessRequestInitialCwd(t){this._terminalProcesses.get(t)?.getInitialCwd().then(n=>this._proxy.$sendProcessProperty(t,{type:"initialCwd",value:n}))}$acceptProcessRequestCwd(t){this._terminalProcesses.get(t)?.getCwd().then(n=>this._proxy.$sendProcessProperty(t,{type:"cwd",value:n}))}$acceptProcessRequestLatency(t){return Promise.resolve(t)}registerProfileProvider(t,n,o){if(this._profileProviders.has(n))throw new Error(`Terminal profile provider "${n}" already registered`);return this._profileProviders.set(n,o),this._proxy.$registerProfileProvider(n,t.identifier.value),new fe(()=>{this._profileProviders.delete(n),this._proxy.$unregisterProfileProvider(n)})}registerTerminalCompletionProvider(t,n,...o){if(this._completionProviders.has(t.identifier.value))throw new Error(`Terminal completion provider "${t.identifier.value}" already registered`);return this._completionProviders.set(t.identifier.value,n),this._proxy.$registerCompletionProvider(t.identifier.value,t.identifier.value,...o),new fe(()=>{this._completionProviders.delete(t.identifier.value),this._proxy.$unregisterCompletionProvider(t.identifier.value)})}async $provideTerminalCompletions(t,n){let o=new Re().token;if(o.isCancellationRequested||!this.activeTerminal)return;let i=this._completionProviders.get(t);if(!i)return;let s=await i.provideTerminalCompletions(this.activeTerminal,n,o);if(s==null)return;let a=!Ct||this.activeTerminal.state?.shell==="gitbash"?"/":"\\";return pP.from(s,a)}$acceptTerminalShellType(t,n){let o=this.getTerminalById(t);o?.setShellType(n)&&this._onDidChangeTerminalState.fire(o.value)}registerTerminalQuickFixProvider(t,n,o){if(this._quickFixProviders.has(t))throw new Error(`Terminal quick fix provider "${t}" is already registered`);return this._quickFixProviders.set(t,o),this._proxy.$registerQuickFixProvider(t,n),new fe(()=>{this._quickFixProviders.delete(t),this._proxy.$unregisterQuickFixProvider(t)})}async $provideTerminalQuickFixes(t,n){let o=new Re().token;if(o.isCancellationRequested)return;let i=this._quickFixProviders.get(t);if(!i)return;let s=await i.provideTerminalQuickFixes(n,o);if(s===null||Array.isArray(s)&&s.length===0)return;let a=new q;if(this._lastQuickFixCommands.value=a,!Array.isArray(s))return s?BI.from(s,this._extHostCommands.converter,a):void 0;let l=[];for(let d of s){let c=BI.from(d,this._extHostCommands.converter,a);c&&l.push(c)}return l}async $createContributedProfileTerminal(t,n){let o=new Re().token,i=await this._profileProviders.get(t)?.provideTerminalProfile(o);if(!o.isCancellationRequested){if(i&&!oi(i,{options:!0})&&(i={options:i}),!i||!oi(i,{options:!0}))throw new Error(`No terminal profile options provided for id "${t}"`);if(oi(i.options,{pty:!0})){this.createExtensionTerminal(i.options,n);return}this.createTerminalFromOptions(i.options,n)}}registerLinkProvider(t){return this._linkProviders.add(t),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new fe(()=>{this._linkProviders.delete(t),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}async $provideLinks(t,n){let o=this.getTerminalById(t);if(!o)return[];this._terminalLinkCache.delete(t),this._terminalLinkCancellationSource.get(t)?.dispose(!0);let s=new Re;this._terminalLinkCancellationSource.set(t,s);let a=[],l={terminal:o.value,line:n},d=[];for(let m of this._linkProviders)d.push(aa.withAsyncBody(async g=>{s.token.onCancellationRequested(()=>g({provider:m,links:[]}));let v=await m.provideTerminalLinks(l,s.token)||[];s.token.isCancellationRequested||g({provider:m,links:v})}));let c=await Promise.all(d);if(s.token.isCancellationRequested)return[];let u=new Map;for(let m of c)m&&m.links.length>0&&a.push(...m.links.map(g=>{let v={id:iB++,startIndex:g.startIndex,length:g.length,label:g.tooltip};return u.set(v.id,{provider:m.provider,link:g}),v}));return this._terminalLinkCache.set(t,u),a}$activateLink(t,n){let o=this._terminalLinkCache.get(t)?.get(n);o&&o.provider.handleTerminalLink(o.link)}_onProcessExit(t,n){this._bufferer.stopBuffering(t),this._terminalProcesses.delete(t),delete this._extensionTerminalAwaitingStart[t];let o=this._terminalProcessDisposables[t];o&&(o.dispose(),delete this._terminalProcessDisposables[t]),this._proxy.$sendProcessExit(t,n)}getTerminalById(t){return this._getTerminalObjectById(this._terminals,t)}getTerminalIdByApiObject(t){let n=this._terminals.findIndex(o=>o.value===t);return n>=0?n:null}_getTerminalObjectById(t,n){let o=this._getTerminalObjectIndexById(t,n);return o!==null?t[o]:null}_getTerminalObjectIndexById(t,n){let o=t.findIndex(i=>i._id===n);return o>=0?o:null}getEnvironmentVariableCollection(t){let n=this._environmentVariableCollections.get(t.identifier.value);return n||(n=this._register(new ux),this._setEnvironmentVariableCollection(t.identifier.value,n)),n.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(t,n){let o=iN(n.map),i=sN(n.descriptionMap);this._proxy.$setEnvironmentVariableCollection(t,n.persistent,o.length===0?void 0:o,i)}$initEnvironmentVariableCollections(t){t.forEach(n=>{let o=n[0],i=this._register(new ux(n[1]));this._setEnvironmentVariableCollection(o,i)})}$acceptDefaultProfile(t,n){let o=this._defaultProfile;this._defaultProfile=t,this._defaultAutomationProfile=n,o?.path!==t.path&&this._onDidChangeShell.fire(t.path)}_setEnvironmentVariableCollection(t,n){this._environmentVariableCollections.set(t,n),this._register(n.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(t,n)}))}};Of=D([C(1,Ro),C(2,ge)],Of);var ux=class extends H{constructor(t){super();this.map=new Map;this.scopedCollections=new Map;this.descriptionMap=new Map;this._persistent=!0;this._onDidChangeCollection=this._register(new E);this.map=new Map(t)}get persistent(){return this._persistent}set persistent(t){this._persistent=t,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}getScopedEnvironmentVariableCollection(t){let n=this.getScopeKey(t),o=this.scopedCollections.get(n);return o||(o=new KP(this,t),this.scopedCollections.set(n,o),this._register(o.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),o}replace(t,n,o,i){this._setIfDiffers(t,{value:n,type:1,options:o??{applyAtProcessCreation:!0},scope:i})}append(t,n,o,i){this._setIfDiffers(t,{value:n,type:2,options:o??{applyAtProcessCreation:!0},scope:i})}prepend(t,n,o,i){this._setIfDiffers(t,{value:n,type:3,options:o??{applyAtProcessCreation:!0},scope:i})}_setIfDiffers(t,n){if(n.options&&n.options.applyAtProcessCreation===!1&&!n.options.applyAtShellIntegration)throw new Error("EnvironmentVariableMutatorOptions must apply at either process creation or shell integration");let o=this.getKey(t,n.scope),i=this.map.get(o),s=n.options?{applyAtProcessCreation:n.options.applyAtProcessCreation??!1,applyAtShellIntegration:n.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!i||i.value!==n.value||i.type!==n.type||i.options?.applyAtProcessCreation!==s.applyAtProcessCreation||i.options?.applyAtShellIntegration!==s.applyAtShellIntegration||i.scope?.workspaceFolder?.index!==n.scope?.workspaceFolder?.index){let a=this.getKey(t,n.scope),l={variable:t,...n,options:s};this.map.set(a,l),this._onDidChangeCollection.fire()}}get(t,n){let o=this.getKey(t,n),i=this.map.get(o);return i?aN(i):void 0}getKey(t,n){let o=this.getScopeKey(n);return o.length?`${t}:::${o}`:t}getScopeKey(t){return this.getWorkspaceKey(t?.workspaceFolder)??""}getWorkspaceKey(t){return t?t.uri.toString():void 0}getVariableMap(t){let n=new Map;for(let[o,i]of this.map)this.getScopeKey(i.scope)===this.getScopeKey(t)&&n.set(i.variable,aN(i));return n}delete(t,n){let o=this.getKey(t,n);this.map.delete(o),this._onDidChangeCollection.fire()}clear(t){if(t?.workspaceFolder){for(let[n,o]of this.map)o.scope?.workspaceFolder?.index===t.workspaceFolder.index&&this.map.delete(n);this.clearDescription(t)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(t,n){let o=this.getScopeKey(n),i=this.descriptionMap.get(o);if(!i||i.description!==t){let s;typeof t=="string"?s=t:s=t?.value.split(`

`)[0];let a={description:s,scope:n};this.descriptionMap.set(o,a),this._onDidChangeCollection.fire()}}getDescription(t){let n=this.getScopeKey(t);return this.descriptionMap.get(n)?.description}clearDescription(t){let n=this.getScopeKey(t);this.descriptionMap.delete(n)}},KP=class{constructor(e,t){this.collection=e;this.scope=t;this._onDidChangeCollection=new E}get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,n){this.collection.replace(e,t,n,this.scope)}append(e,t,n){this.collection.append(e,t,n,this.scope)}prepend(e,t,n){this.collection.prepend(e,t,n,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((n,o)=>e.call(t,o,n,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}},yp=class extends Of{constructor(e,t){super(!1,e,t)}createTerminal(e,t,n){throw new Pl}createTerminalFromOptions(e,t){throw new Pl}};yp=D([C(0,Ro),C(1,ge)],yp);function lN(r){if(!(!r||typeof r=="string"))return oi(r,{id:!0})?{id:r.id,color:r.color}:r}function sB(r){return Nc.isThemeColor(r)?r:void 0}function aN(r){let e={...r};return delete e.scope,e.options=e.options??void 0,e}var dN={label:p(7980,null),order:Number.MAX_SAFE_INTEGER};var GP="/.well-known",aB=`${GP}/oauth-protected-resource`,lB=`${GP}/oauth-authorization-server`,qP=`${GP}/openid-configuration`,px=" ";function dB(r){if(typeof r!="object"||r===null)return!1;let e=r;return!(!e.resource||e.scopes_supported!==void 0&&!Array.isArray(e.scopes_supported))}var cB=["issuer","authorization_endpoint","token_endpoint","registration_endpoint","jwks_uri"];function uB(r){if(typeof r!="object"||r===null)return!1;let e=r;if(!e.issuer)throw new Error("Authorization server metadata must have an issuer");for(let t of cB)if(e[t]){if(typeof e[t]!="string")throw new Error(`Authorization server metadata '${t}' must be a string`);if(!e[t].startsWith("https://")&&!e[t].startsWith("http://"))throw new Error(`Authorization server metadata '${t}' must start with http:// or https://`)}return!0}function pB(r){return typeof r!="object"||r===null?!1:r.client_id!==void 0}function jP(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.access_token!==void 0&&e.token_type!==void 0}function QP(r){return typeof r!="object"||r===null?!1:r.error!==void 0}function mB(r){return typeof r!="object"||r===null?!1:r.error!==void 0}function uN(r){return{issuer:r.toString(),authorization_endpoint:new URL("/authorize",r).toString(),token_endpoint:new URL("/token",r).toString(),registration_endpoint:new URL("/register",r).toString(),response_types_supported:["code","id_token","id_token token"]}}var cN=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code"],gB=33418;async function JP(r,e,t){if(!r.registration_endpoint)throw new Error("Server does not support dynamic registration");let n={client_name:e,client_uri:"https://code.visualstudio.com",grant_types:r.grant_types_supported?r.grant_types_supported.filter(s=>cN.includes(s)):cN,response_types:["code"],redirect_uris:["https://insiders.vscode.dev/redirect","https://vscode.dev/redirect","http://127.0.0.1/",`http://127.0.0.1:${gB}/`],scope:t?.join(px),token_endpoint_auth_method:"none",application_type:"native"},o=await fetch(r.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok){let s=await o.text(),a=s;try{let l=JSON.parse(s);mB(l)&&(a=`${l.error}${l.error_description?`: ${l.error_description}`:""}`)}catch{}throw new Error(`Registration to ${r.registration_endpoint} failed: ${a}`)}let i=await o.json();if(pB(i))return i;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(i)}`)}function XP(r){let e=[],t=[],n="",o=!1;for(let s=0;s<r.length;s++){let a=r[s];a==='"'?(o=!o,n+=a):a===","&&!o?(n.trim()&&t.push(n.trim()),n=""):n+=a}n.trim()&&t.push(n.trim());let i;for(let s of t)if(!s.includes("="))i&&e.push(i),i={scheme:s.trim(),params:{}};else{let l=s.indexOf(" ");if(l>0){let d=s.substring(0,l),c=s.substring(l+1);if(!d.includes("=")&&c.includes("=")){i&&e.push(i),i={scheme:d.trim(),params:{}};let u=c.indexOf("=");if(u>0){let m=c.substring(0,u).trim(),g=c.substring(u+1).trim().replace(/^"|"$/g,"");m&&g!==void 0&&(i.params[m]=g)}continue}}if(i){let d=s.indexOf("=");if(d>0){let c=s.substring(0,d).trim(),u=s.substring(d+1).trim().replace(/^"|"$/g,"");c&&u!==void 0&&(i.params[c]=u)}}}return i&&e.push(i),e}function YP(r){let e=r.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[t,n,o]=e;try{if(typeof JSON.parse(No(t).toString())!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let s=JSON.parse(No(n).toString());if(typeof s!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return s}catch(i){throw i instanceof Error?new Error(`Failed to parse JWT token: ${i.message}`):new Error("Failed to parse JWT token")}}function pN(r,e){if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;let t=[...r].sort(),n=[...e].sort();return t.every((o,i)=>o===n[i])}async function mN(r,e,t={}){let{sameOriginHeaders:n={},fetch:o=fetch}=t,i=new URL(r),s=async(c,u)=>{let m={Accept:"application/json"};new URL(c).origin===i.origin&&(m={...m,...n});let v=await o(c,{method:"GET",headers:m});if(v.status!==200){let x;try{x=await v.text()}catch{x=v.statusText}throw new Error(`Failed to fetch resource metadata from ${c}: ${v.status} ${x}`)}let h=await v.json();if(dB(h)){let x=new URL(h.resource).toString(),S=new URL(u).toString();if(x!==S)throw new Error(`Protected Resource Metadata 'resource' property value "${x}" does not match expected value "${S}" for URL ${c}. Per RFC 9728, these MUST match. See https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return h}else throw new Error(`Invalid resource metadata from ${c}. Expected to follow shape of https://datatracker.ietf.org/doc/html/rfc9728#name-protected-resource-metadata (Hints: is scopes_supported an array? Is resource a string?). Current payload: ${JSON.stringify(h)}`)},a=[];if(e)try{return{metadata:await s(e,r),discoveryUrl:e,errors:a}}catch(c){a.push(c instanceof Error?c:new Error(String(c)))}let l=i.pathname!=="/",d=`${i.origin}${aB}`;if(l){let c=`${d}${i.pathname}`;try{return{metadata:await s(c,r),discoveryUrl:c,errors:a}}catch(u){a.push(u instanceof Error?u:new Error(String(u)))}}try{return{metadata:await s(d,i.origin),discoveryUrl:d,errors:a}}catch(c){a.push(c instanceof Error?c:new Error(String(c)))}throw a.length===1?a[0]:new AggregateError(a,"Failed to fetch resource metadata from all attempted URLs")}async function fB(r){if(r.status===200)try{let e=await r.json();if(uB(e))return e}catch{}}async function hB(r){try{return await r.text()}catch{return r.statusText}}async function gN(r,e={}){let{additionalHeaders:t={},fetch:n=fetch}=e,o=new URL(r),i=o.pathname==="/"?"":o.pathname,s=[],a=async m=>{try{let g=await n(m,{method:"GET",headers:{...t,Accept:"application/json"}}),v=await fB(g);if(v)return v;s.push(new Error(`Failed to fetch authorization server metadata from ${m}: ${g.status} ${await hB(g)}`));return}catch(g){s.push(g instanceof Error?g:new Error(String(g)));return}},l=new URL(lB,r).toString()+i,d=await a(l);if(d)return{metadata:d,discoveryUrl:l,errors:s};let c=new URL(qP,r).toString()+i;if(d=await a(c),d)return{metadata:d,discoveryUrl:c,errors:s};let u=r.endsWith("/")?r+qP.substring(1):r+qP;if(d=await a(u),d)return{metadata:d,discoveryUrl:u,errors:s};throw s.length===1?s[0]:new AggregateError(s,"Failed to fetch authorization server metadata from all attempted URLs")}var ul=class{constructor(e,t){this._onDidChangeWindowState=new E;this.onDidChangeWindowState=this._onDidChangeWindowState.event;this._state=ul.InitialState;e.handle&&(this._nativeHandle=No(e.handle).buffer),this._proxy=t.getProxy(N.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:n,isActive:o})=>{this.onDidChangeWindowProperty("focused",n),this.onDidChangeWindowProperty("active",o)})}static{this.InitialState={focused:!0,active:!0}}getState(){let e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}get nativeHandle(){return this._nativeHandle}$onDidChangeActiveNativeWindowHandle(e){this._nativeHandle=e?No(e).buffer:void 0}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let n;if(typeof e=="string"){n=e;try{e=y.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return di(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===$.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,n,t)}async asExternalUri(e,t){if(di(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");let n=await this._proxy.$asExternalUri(e,t);return y.from(n)}};ul=D([C(0,nt),C(1,ge)],ul);var zd=M("IExtHostWindow");var pl=class{constructor(e){this.handles=new Yn;this.handlers=new Map;this._proxy=e.getProxy(N.MainThreadUrls)}static{this.HandlePool=0}registerUriHandler(e,t){let n=e.identifier;if(this.handles.has(n))throw new Error(`Protocol handler already registered for extension ${n}`);let o=pl.HandlePool++;return this.handles.add(n),this.handlers.set(o,t),this._proxy.$registerUriHandler(o,n,e.displayName||e.name),J(()=>{this.handles.delete(n),this.handlers.delete(o),this._proxy.$unregisterUriHandler(o)})}$handleExternalUri(e,t){let n=this.handlers.get(e);if(!n)return Promise.resolve(void 0);try{n.handleUri(y.revive(t))}catch(o){ct(o)}return Promise.resolve(void 0)}async createAppUri(e){return y.revive(await this._proxy.$createAppUri(e))}};pl=D([C(0,ge)],pl);var Kd=M("IExtHostUrlsService");function fN(r){return(e,t,n)=>{let o=null,i=null;if(typeof n.value=="function"?(o="value",i=n.value):typeof n.get=="function"&&(o="get",i=n.get),!i||typeof t=="symbol")throw new Error("not supported");n[o]=r(i,t)}}function Uf(r,e,t){return fN((n,o)=>{let i=`$debounce$${o}`,s=`$debounce$result$${o}`;return function(...a){this[s]||(this[s]=t?t():void 0),clearTimeout(this[i]),e&&(this[s]=e(this[s],...a),a=[this[s]]),this[i]=setTimeout(()=>{n.apply(this,a),this[s]=t?t():void 0},r)}})}function hN(r,e,t){return fN((n,o)=>{let i=`$throttle$timer$${o}`,s=`$throttle$result$${o}`,a=`$throttle$lastRun$${o}`,l=`$throttle$pending$${o}`;return function(...d){if(this[s]||(this[s]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[s]=e(this[s],...d)),this[l])return;let c=this[a]+r;c<=Date.now()?(this[a]=Date.now(),n.apply(this,[this[s]]),this[s]=t?t():void 0):(this[l]=!0,this[i]=setTimeout(()=>{this[l]=!1,this[a]=Date.now(),n.apply(this,[this[s]]),this[s]=t?t():void 0},c-Date.now()))}})}var qd=M("IExtHostProgress"),Ip=class{constructor(e){this._handles=0;this._mapHandleToCancellationSource=new Map;this._proxy=e.getProxy(N.MainThreadProgress)}async withProgress(e,t,n){let o=this._handles++,{title:i,location:s,cancellable:a}=t,l={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(o,{location:EI.from(s),title:i,source:l,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(_m),this._withProgress(o,n,!!a)}async withProgressFromSource(e,t,n){let o=this._handles++,{title:i,location:s,cancellable:a}=t;return this._proxy.$startProgress(o,{location:EI.from(s),title:i,source:e,cancellable:a},void 0).catch(_m),this._withProgress(o,n,!!a)}_withProgress(e,t,n){let o;n&&(o=new Re,this._mapHandleToCancellationSource.set(e,o));let i=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),o?.dispose()},s;try{s=t(new mx(this._proxy,e),n&&o?o.token:be.None)}catch(a){throw i(e),a}return s.then(a=>i(e),a=>i(e)),s}$acceptProgressCanceled(e){let t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}};Ip=D([C(0,ge)],Ip);function vB(r,e){return r.message=e.message,typeof e.increment=="number"&&(typeof r.increment=="number"?r.increment+=e.increment:r.increment=e.increment),r}var mx=class extends ga{constructor(t,n){super(o=>this.throttledReport(o));this._proxy=t;this._handle=n}throttledReport(t){this._proxy.$progressReport(this._handle,t)}};D([hN(100,(t,n)=>vB(t,n),()=>Object.create(null))],mx.prototype,"throttledReport",1);var Sp=M("IExtHostAuthentication"),xp=class{constructor(e,t,n,o,i,s,a){this._initData=t;this._extHostWindow=n;this._extHostUrls=o;this._extHostProgress=i;this._extHostLoggerService=s;this._logService=a;this._dynamicAuthProviderCtor=Ff;this._authenticationProviders=new Map;this._providerOperations=new sa;this._onDidChangeSessions=new E;this._getSessionTaskSingler=new ZP;this._onDidDynamicAuthProviderTokensChange=new E;this._proxy=e.getProxy(N.MainThreadAuthentication)}getExtensionScopedSessionsEvent(e){let t=e.toLowerCase();return Me.chain(this._onDidChangeSessions.event,n=>n.filter(o=>!o.extensionIdFilter||o.extensionIdFilter.includes(t)).map(o=>({provider:o.provider})))}async getSession(e,t,n,o={}){let i=_e.toKey(e.identifier),a=Object.keys(o).map(d=>{switch(d){case"account":return`${d}:${o.account?.id}`;case"createIfNone":case"forceNewSession":{let c=typeof o[d]=="boolean"?`${o[d]}`:`'${o[d]?.detail}/${o[d]?.learnMore?.toString()}'`;return`${d}:${c}`}case"authorizationServer":return`${d}:${o.authorizationServer?.toString(!0)}`;default:return`${d}:${!!o[d]}`}}).sort().join(", "),l;if(AL(n)){let d=n,c=d.wwwAuthenticate,u=d.fallbackScopes?[...d.fallbackScopes].sort().join(" "):"";l=`${i} ${t} challenge:${c} ${u} ${a}`}else{let d=[...n].sort().join(" ");l=`${i} ${t} ${d} ${a}`}return await this._getSessionTaskSingler.getOrCreate(l,async()=>{await this._proxy.$ensureProvider(t);let d=e.displayName||e.name;return this._proxy.$getSession(t,n,i,d,o)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}registerAuthenticationProvider(e,t,n,o){return this._providerOperations.queue(e,async()=>{if(this._authenticationProviders.get(e)){this._logService.error(`An authentication provider with id '${e}' is already registered. The existing provider will not be replaced.`);return}let i=n.onDidChangeSessions(s=>this._proxy.$sendDidChangeSessions(e,s));this._authenticationProviders.set(e,{label:t,provider:n,disposable:i,options:o??{supportsMultipleAccounts:!1}}),await this._proxy.$registerAuthenticationProvider({id:e,label:t,supportsMultipleAccounts:o?.supportsMultipleAccounts??!1,supportedAuthorizationServers:o?.supportedAuthorizationServers,supportsChallenges:o?.supportsChallenges})}),new fe(()=>{this._providerOperations.queue(e,async()=>{let i=this._authenticationProviders.get(e);i&&(i.disposable?.dispose(),this._authenticationProviders.delete(e),await this._proxy.$unregisterAuthenticationProvider(e))})})}$createSession(e,t,n){return this._providerOperations.queue(e,async()=>{let o=this._authenticationProviders.get(e);if(o)return n.authorizationServer=y.revive(n.authorizationServer),await o.provider.createSession(t,n);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$removeSession(e,t){return this._providerOperations.queue(e,async()=>{let n=this._authenticationProviders.get(e);if(n)return await n.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessions(e,t,n){return this._providerOperations.queue(e,async()=>{let o=this._authenticationProviders.get(e);if(o)return n.authorizationServer=y.revive(n.authorizationServer),await o.provider.getSessions(t,n);throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessionsFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let o=this._authenticationProviders.get(e);if(o){let i=o.provider;if(typeof i.getSessionsFromChallenges=="function")return n.authorizationServer=y.revive(n.authorizationServer),await i.getSessionsFromChallenges(t,n);throw new Error(`Authentication provider with handle: ${e} does not support getSessionsFromChallenges`)}throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$createSessionFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let o=this._authenticationProviders.get(e);if(o){let i=o.provider;if(typeof i.createSessionFromChallenges=="function")return n.authorizationServer=y.revive(n.authorizationServer),await i.createSessionFromChallenges(t,n);throw new Error(`Authentication provider with handle: ${e} does not support createSessionFromChallenges`)}throw new Error(`Unable to find authentication provider with handle: ${e}`)})}$onDidChangeAuthenticationSessions(e,t,n){return e.startsWith(Rb)||this._onDidChangeSessions.fire({provider:{id:e,label:t},extensionIdFilter:n}),Promise.resolve()}$onDidUnregisterAuthenticationProvider(e){return this._providerOperations.queue(e,async()=>{let t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e))})}async $registerDynamicAuthProvider(e,t,n,o,i,s){if(!o){let l=y.revive(e);if(t.registration_endpoint)try{let d=await JP(t,this._initData.environment.appName,n?.scopes_supported);o=d.client_id,i=d.client_secret}catch(d){this._logService.warn(`Dynamic registration failed for ${l.toString()}: ${d.message}. Prompting user for client ID and client secret...`)}if(!o){this._logService.info(`Prompting user for client registration details for ${l.toString()}`);let d=await this._proxy.$promptForClientRegistration(l.toString());if(!d)throw new Error("User did not provide client details");o=d.clientId,i=d.clientSecret,this._logService.info(`User provided client registration for ${l.toString()}`),i?this._logService.trace(`User provided client secret for ${l.toString()}`):this._logService.trace(`User did not provide client secret for ${l.toString()}`)}}let a=new this._dynamicAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,y.revive(e),t,n,o,i,this._onDidDynamicAuthProviderTokensChange,s||[]);return await this._providerOperations.queue(a.id,async()=>{this._authenticationProviders.set(a.id,{label:a.label,provider:a,disposable:fe.from(a,a.onDidChangeSessions(l=>this._proxy.$sendDidChangeSessions(a.id,l)),a.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:a.id,clientId:a.clientId,clientSecret:a.clientSecret}))),options:{supportsMultipleAccounts:!0}}),await this._proxy.$registerDynamicAuthenticationProvider({id:a.id,label:a.label,supportsMultipleAccounts:!0,authorizationServer:e,resourceServer:n?y.parse(n.resource):void 0,clientId:a.clientId,clientSecret:a.clientSecret})}),a.id}async $onDidChangeDynamicAuthProviderTokens(e,t,n){this._onDidDynamicAuthProviderTokensChange.fire({authProviderId:e,clientId:t,tokens:n})}};xp=D([C(0,ge),C(1,nt),C(2,zd),C(3,Kd),C(4,qd),C(5,Ho),C(6,ue)],xp);var ZP=class{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){let n=this._inFlightPromises.get(e);if(n)return n;let o=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,o),o}},Ff=class{constructor(e,t,n,o,i,s,a,l,d,c,u,m,g){this._extHostWindow=e;this._extHostUrls=t;this._initData=n;this._extHostProgress=o;this._proxy=s;this.authorizationServer=a;this._serverMetadata=l;this._resourceMetadata=d;this._clientId=c;this._clientSecret=u;this._onDidChangeSessions=new E;this.onDidChangeSessions=this._onDidChangeSessions.event;this._onDidChangeClientId=new E;this.onDidChangeClientId=this._onDidChangeClientId.event;let v=a.toString(!0);this.id=d?.resource?v+" "+d?.resource:v,this.label=d?.resource_name??this.authorizationServer.authority,this._logger=i.createLogger(this.id,{name:`Auth: ${this.label}`}),this._disposable=new q,this._disposable.add(this._onDidChangeSessions),this._disposable.add(this._onDidChangeClientId);let h=Me.chain(m.event,x=>x.filter(S=>S.authProviderId===this.id&&S.clientId===c).map(S=>S.tokens));this._tokenStore=this._disposable.add(new eD({onDidChange:h,set:x=>s.$setSessionsForDynamicAuthProvider(this.id,this.clientId,x)},g,this._logger)),this._disposable.add(this._tokenStore.onDidChangeSessions(x=>this._onDidChangeSessions.fire(x))),this._createFlows=[],l.authorization_endpoint&&this._createFlows.push({label:p(3155,null),handler:(x,S,T)=>this._createWithUrlHandler(x,S,T)})}get clientId(){return this._clientId}get clientSecret(){return this._clientSecret}async getSessions(e,t){if(this._logger.info(`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),i=this._tokenStore.sessions.filter(s=>Ht([...s.scopes].sort(),n));if(this._logger.info(`Found ${i.length} sessions for scopes: ${o}`),i.length){let s=[],a=[],l=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of i){let c=l.get(d.accessToken);if(c&&c.expires_in){let u=Date.now(),m=c.expires_in*1e3;if(u>c.created_at+m-300*1e3){if(this._logger.info(`Token for session ${d.id} is about to expire, refreshing...`),a.push(c),!c.refresh_token){this._logger.warn(`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(c.refresh_token);g.scope!==o&&(this._logger.warn(`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),this._logger.info(`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),s.push(g)}catch(g){this._logger.error(`Failed to refresh token: ${g}`)}}}}return(s.length||a.length)&&(this._tokenStore.update({added:s,removed:a}),i=this._tokenStore.sessions.filter(d=>Ht([...d.scopes].sort(),n))),this._logger.info(`Found ${i.length} sessions for scopes: ${o}`),i}return[]}async createSession(e,t){this._logger.info(`Creating session for scopes: ${e.join(" ")}`);let n;for(let i=0;i<this._createFlows.length;i++){let{handler:s}=this._createFlows[i];try{if(n=await this._extHostProgress.withProgressFromSource({label:this.label,id:this.id},{location:15,title:p(3152,null,this.label),cancellable:!0},(a,l)=>s(e,a,l)),n)break}catch(a){let l=this._createFlows[i+1]?.label;if(!l)break;let d=Tn(a)?p(3156,null,this.label,l):p(3154,null,this.label,l);if(!await this._proxy.$showContinueNotification(d))throw new xt;this._logger.error(`Failed to create token via flow '${l}': ${a}`)}}if(!n)throw new Error("Failed to create authentication token");n.scope!==e.join(" ")&&(this._logger.warn(`Token scopes '${n.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),n.scope=e.join(" ")),this._tokenStore.update({added:[{...n,created_at:Date.now()}],removed:[]});let o=this._tokenStore.sessions.find(i=>i.accessToken===n.access_token);return this._logger.info(`Created ${n.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${n.scope}${n.expires_in?` that expires in ${n.expires_in} seconds`:""}`),o}async removeSession(e){this._logger.info(`Removing session with id: ${e}`);let t=this._tokenStore.sessions.find(o=>o.id===e);if(!t){this._logger.error(`Session with id ${e} not found`);return}let n=this._tokenStore.tokens.find(o=>o.access_token===t.accessToken);if(!n){this._logger.error(`Failed to retrieve token for removed session: ${t.id}`);return}this._tokenStore.update({added:[],removed:[n]}),this._logger.info(`Removed token for session: ${t.id} with scopes: ${t.scopes.join(" ")}`)}dispose(){this._disposable.dispose()}async _createWithUrlHandler(e,t,n){if(!this._serverMetadata.authorization_endpoint)throw new Error("Authorization Endpoint required");if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let o=this.generateRandomString(64),i=await this.generateCodeChallenge(o),s=this.generateRandomString(32),a=y.parse(`${this._initData.environment.appUriScheme}://dynamicauthprovider/${this.authorizationServer.authority}/authorize?nonce=${s}`),l;try{l=await this._extHostUrls.createAppUri(a)}catch(x){throw new Error(`Failed to create external URI: ${x}`)}let d=new URL(this._serverMetadata.authorization_endpoint);d.searchParams.append("client_id",this._clientId),d.searchParams.append("response_type","code"),d.searchParams.append("state",l.toString()),d.searchParams.append("code_challenge",i),d.searchParams.append("code_challenge_method","S256");let c=e.join(" ");c&&d.searchParams.append("scope",c),this._resourceMetadata?.resource&&d.searchParams.append("resource",this._resourceMetadata.resource);let u="https://vscode.dev/redirect";d.searchParams.append("redirect_uri",u);let m=this.waitForAuthorizationCode(a);if(this._logger.info(`Opening authorization URL for scopes: ${c}`),this._logger.trace(`Authorization URL: ${d.toString()}`),!await this._extHostWindow.openUri(d.toString(),{}))throw new xt;t.report({message:p(3153,null)});let v;try{v=(await kc(m,n)).code}catch(x){throw Tn(x)?(this._logger.info("Authorization code request was cancelled by the user."),x):(this._logger.error(`Failed to receive authorization code: ${x}`),new Error(`Failed to receive authorization code: ${x}`))}return this._logger.info(`Authorization code received for scopes: ${c}`),await this.exchangeCodeForToken(v,o,u)}generateRandomString(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("").substring(0,e)}async generateCodeChallenge(e){let n=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",n);return er(ee.wrap(new Uint8Array(o)),!1,!1).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async waitForAuthorizationCode(e){let t=await this._proxy.$waitForUriHandler(e),n=/[?&]code=([^&]+)/.exec(t.query||"");if(!n||n.length<2)throw new Error("Authentication failed: No authorization code received");return{code:n[1]}}async exchangeCodeForToken(e,t,n){if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let o=new URLSearchParams;o.append("client_id",this._clientId),o.append("grant_type","authorization_code"),o.append("code",e),o.append("redirect_uri",n),o.append("code_verifier",t),this._resourceMetadata?.resource&&o.append("resource",this._resourceMetadata.resource),this._clientSecret&&o.append("client_secret",this._clientSecret),this._logger.info("Exchanging authorization code for token..."),this._logger.trace(`Url: ${this._serverMetadata.token_endpoint}`),this._logger.trace(`Token request body: ${o.toString()}`);let i;try{i=await fetch(this._serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:o.toString()})}catch(a){throw this._logger.error(`Failed to exchange authorization code for token: ${a}`),new Error(`Failed to exchange authorization code for token: ${a}`)}if(!i.ok){let a=await i.text();throw new Error(`Token exchange failed: ${i.status} ${i.statusText} - ${a}`)}let s=await i.json();if(jP(s))return this._logger.info("Successfully exchanged authorization code for token."),s;throw QP(s)&&s.error==="invalid_client"?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),new Error("Client ID was invalid, generated a new one. Please try again.")):new Error(`Invalid authorization token response: ${JSON.stringify(s)}`)}async exchangeRefreshTokenForToken(e){if(!this._serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let t=new URLSearchParams;t.append("client_id",this._clientId),t.append("grant_type","refresh_token"),t.append("refresh_token",e),this._resourceMetadata?.resource&&t.append("resource",this._resourceMetadata.resource),this._clientSecret&&t.append("client_secret",this._clientSecret);let o=await(await fetch(this._serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:t.toString()})).json();if(jP(o))return{...o,created_at:Date.now()};throw QP(o)&&o.error==="invalid_client"?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),new Error("Client ID was invalid, generated a new one. Please try again.")):new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}async _generateNewClientId(){try{let e=await JP(this._serverMetadata,this._initData.environment.appName,this._resourceMetadata?.scopes_supported);this._clientId=e.client_id,this._clientSecret=e.client_secret,this._onDidChangeClientId.fire()}catch(e){this._logger.info(`Dynamic registration failed for ${this.authorizationServer.toString()}: ${e}. Prompting user for client ID and client secret.`);try{let t=await this._proxy.$promptForClientRegistration(this.authorizationServer.toString());if(!t)throw new Error("User did not provide client details");this._clientId=t.clientId,this._clientSecret=t.clientSecret,this._logger.info(`User provided client ID for ${this.authorizationServer.toString()}`),t.clientSecret?this._logger.info(`User provided client secret for ${this.authorizationServer.toString()}`):this._logger.info(`User did not provide client secret for ${this.authorizationServer.toString()} (optional)`),this._onDidChangeClientId.fire()}catch{throw this._logger.error(`Failed to fetch new client ID and user did not provide one: ${e}`),new Error(`Failed to fetch new client ID and user did not provide one: ${e}`)}}}};Ff=D([C(0,zd),C(1,Kd),C(2,nt),C(3,qd),C(4,Ho)],Ff);var eD=class{constructor(e,t,n){this._persistence=e;this._logger=n;this._onDidChangeSessions=new E;this.onDidChangeSessions=this._onDidChangeSessions.event;this._disposable=new q,this._tokensObservable=td("tokens",t),this._sessionsObservable=Pg({equalsFn:(o,i)=>Ht(o,i,(s,a)=>s.accessToken===a.accessToken)},o=>this._tokensObservable.read(o).map(i=>this._getSessionFromToken(i))),this._disposable.add(this._registerChangeEventAutorun()),this._disposable.add(this._persistence.onDidChange(o=>this._tokensObservable.set(o,void 0)))}get tokens(){return this._tokensObservable.get()}get sessions(){return this._sessionsObservable.get()}dispose(){this._disposable.dispose()}update({added:e,removed:t}){this._logger.trace(`Updating tokens: added ${e.length}, removed ${t.length}`);let n=[...this._tokensObservable.get()];for(let o of t){let i=n.findIndex(s=>s.access_token===o.access_token);i!==-1&&n.splice(i,1)}for(let o of e){let i=n.findIndex(s=>s.access_token===o.access_token);i===-1?n.push(o):n[i]=o}(e.length||t.length)&&(this._tokensObservable.set(n,void 0),this._persistence.set(n)),this._logger.trace(`Tokens updated: ${n.length} tokens stored.`)}_registerChangeEventAutorun(){let e=[];return gi(t=>{this._logger.trace("Checking for session changes...");let n=this._sessionsObservable.read(t);if(e===n){this._logger.trace("No session changes detected.");return}if(!n||n.length===0){this._logger.trace("All sessions removed."),e.length>0&&(this._onDidChangeSessions.fire({added:[],removed:e,changed:[]}),e=[]);return}let o=[],i=[];for(let s of n)e.some(l=>l.accessToken===s.accessToken)||o.push(s);for(let s of e)n.some(l=>l.accessToken===s.accessToken)||i.push(s);(o.length>0||i.length>0)&&(this._logger.trace(`Sessions changed: added ${o.length}, removed ${i.length}`),this._onDidChangeSessions.fire({added:o,removed:i,changed:[]})),e=n})}_getSessionFromToken(e){let t;if(e.id_token)try{t=YP(e.id_token)}catch{}if(!t)try{t=YP(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):t?.scope?t.scope.split(" "):[];return{id:hv(e.access_token,0).toString(),accessToken:e.access_token,account:{id:t?.sub||"unknown",label:t?.preferred_username||t?.name||t?.email||"MCP"},scopes:n,idToken:e.id_token}}};var Cp=M("IExtHostLanguageModels"),tD=class{constructor(){this._defaultStream=new uv;this._isDone=!1;let e=this,[t,n]=wc.tee(e._defaultStream.asyncIterable);this.apiObject={get stream(){return t},get text(){return n.map(o=>{if(o instanceof Lt)return o.value}).coalesce()}}}handleResponsePart(e){if(this._isDone)return;let t=[];for(let n of It.wrap(e)){let o;n.type==="text"?o=new Lt(n.value,n.audience):n.type==="thinking"?o=new Qr(n.value,n.id,n.metadata):n.type==="data"?o=new mn(n.data.buffer,n.mimeType,n.audience):o=new hr(n.toolCallId,n.name,n.parameters),t.push(o)}this._defaultStream.emitMany(t)}reject(e){this._isDone=!0,this._defaultStream.reject(e)}resolve(){this._isDone=!0,this._defaultStream.resolve()}},ml=class{constructor(e,t,n){this._logService=t;this._extHostAuthentication=n;this._onDidChangeModelAccess=new E;this._onDidChangeProviders=new E;this.onDidChangeProviders=this._onDidChangeProviders.event;this._onDidChangeModelProxyAvailability=new E;this.onDidChangeModelProxyAvailability=this._onDidChangeModelProxyAvailability.event;this._languageModelProviders=new Map;this._localModels=new Map;this._modelAccessList=new Un;this._pendingRequest=new Map;this._ignoredFileProviders=new Map;this._languageAccessInformationExtensions=new Set;this._proxy=e.getProxy(N.MainThreadLanguageModels)}static{this._idPool=1}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose(),this._onDidChangeModelProxyAvailability.dispose()}registerLanguageModelChatProvider(e,t,n){this._languageModelProviders.set(t,{extension:e,provider:n}),this._proxy.$registerLanguageModelProvider(t);let o;return n.onDidChangeLanguageModelChatInformation&&(o=n.onDidChangeLanguageModelChatInformation(()=>{this._proxy.$onLMProviderChange(t)})),J(()=>{this._languageModelProviders.delete(t),this._localModels.forEach((i,s)=>{i.metadata.vendor===t&&this._localModels.delete(s)}),o?.dispose(),this._proxy.$unregisterProvider(t)})}toModelIdentifier(e,t,n){return t?`${e}/${t}/${n}`:`${e}/${n}`}getVendorFromModelIdentifier(e){let t=e.indexOf("/");return t===-1?void 0:e.substring(0,t)}async $provideLanguageModelChatInfo(e,t,n){let o=this._languageModelProviders.get(e);if(!o)return[];let i=await o.provider.provideLanguageModelChatInformation({silent:t.silent,configuration:t.configuration},n)??[],s=i.map(a=>{let l;a.requiresAuthorization&&Fe(o.extension,"chatProvider")&&(l={providerLabel:o.extension.displayName||o.extension.name,accountLabel:typeof a.requiresAuthorization=="object"?a.requiresAuthorization.label:void 0}),a.capabilities.editTools&&A(o.extension,"chatProvider");let d={};if(Fe(o.extension,"chatProvider")){if(a.isDefault===!0)for(let c of Object.values(mi))typeof c=="string"&&(d[c]=!0);else if(typeof a.isDefault=="object")for(let c of Object.keys(a.isDefault)){let u=parseInt(c);d[Xu.from(u)]=a.isDefault[u]}}return{metadata:{extension:o.extension.identifier,id:a.id,vendor:e,name:a.name??"",family:a.family??"",detail:a.detail,tooltip:a.tooltip,version:a.version,multiplier:a.multiplier,multiplierNumeric:a.multiplierNumeric,maxInputTokens:a.maxInputTokens,maxOutputTokens:a.maxOutputTokens,auth:l,isDefaultForLocation:d,isUserSelectable:a.isUserSelectable,statusIcon:a.statusIcon,targetChatSessionType:a.targetChatSessionType,modelPickerCategory:a.category??dN,capabilities:a.capabilities?{vision:a.capabilities.imageInput,editTools:a.capabilities.editTools,toolCalling:!!a.capabilities.toolCalling,agentMode:!!a.capabilities.toolCalling}:void 0},identifier:this.toModelIdentifier(e,t.group,a.id)}});this._localModels.forEach((a,l)=>{a.metadata.vendor===e&&a.group===t.group&&this._localModels.delete(l)});for(let a=0;a<s.length;a++)this._localModels.set(s[a].identifier,{group:t.group,metadata:s[a].metadata,info:i[a]});return s}async $startChatRequest(e,t,n,o,i,s){let a=this._localModels.get(e);if(!a)throw new Error("Model not found");let l=this._languageModelProviders.get(a.metadata.vendor);if(!l)throw new Error(`Language model provider for '${a.metadata.id}' not found.`);let d=[],c=()=>{d.length>0&&(this._proxy.$reportResponsePart(t,new Pt(d)),d.length=0)},u=new Xn(c,30),m=h=>{d.push(h)>30?(c(),u.cancel()):u.schedule()},g=new ga(async h=>{if(s.isCancellationRequested){this._logService.warn(`[CHAT](${l.extension.identifier.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let x;if(h instanceof hr?x={type:"tool_use",name:h.name,parameters:h.input,toolCallId:h.callId}:h instanceof Lt?x={type:"text",value:h.value,audience:h.audience}:h instanceof mn?x={type:"data",mimeType:h.mimeType,data:ee.wrap(h.data),audience:h.audience}:h instanceof Qr&&(x={type:"thinking",value:h.value,id:h.id,metadata:h.metadata}),!x){this._logService.warn(`[CHAT](${l.extension.identifier.value}) UNKNOWN part ${JSON.stringify(h)}`);return}m(x)}),v;try{v=l.provider.provideLanguageModelChatResponse(a.info,o.value.map(_I.to),{...i,modelOptions:i.modelOptions??{},requestInitiator:_e.toKey(n),toolMode:i.toolMode??1},g,s)}catch(h){throw h}Promise.resolve(v).then(()=>{c(),this._proxy.$reportResponseDone(t,void 0)},h=>{c(),this._proxy.$reportResponseDone(t,ni(h))})}$provideTokenLength(e,t,n){let o=this._localModels.get(e);if(!o)return Promise.resolve(0);let i=this._languageModelProviders.get(o.metadata.vendor);return i?Promise.resolve(i.provider.provideTokenCount(o.info,t,n)):Promise.resolve(0)}async getDefaultLanguageModel(e,t){let n;t&&await this.selectLanguageModels(e,{});for(let[o,i]of this._localModels)if(i.metadata.isDefaultForLocation.panel){n=o;break}return!n&&!t?this.getDefaultLanguageModel(e,!0):this.getLanguageModelByIdentifier(e,n)}async getLanguageModelByIdentifier(e,t){if(!t)return;let n=this._localModels.get(t);if(!n){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache. Trying to resolve model again.`);let i=this.getVendorFromModelIdentifier(t);if(!i){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not extract vendor from model identifier '${t}'.`);return}if(await this.selectLanguageModels(e,{vendor:i}),n=this._localModels.get(t),!n){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache after re-resolving models.`);return}}this._isUsingAuth(e.identifier,n.metadata)&&await this._fakeAuthPopulate(n.metadata);let o;if(!o){let i=this;o={id:n.info.id,vendor:n.metadata.vendor,family:n.info.family,version:n.info.version,name:n.info.name,capabilities:{supportsImageToText:n.metadata.capabilities?.vision??!1,supportsToolCalling:!!n.metadata.capabilities?.toolCalling,editToolsHint:n.metadata.capabilities?.editTools},maxInputTokens:n.metadata.maxInputTokens,countTokens(s,a){if(!i._localModels.has(t))throw Po.NotFound(t);return i._computeTokenLength(t,s,a??be.None)},sendRequest(s,a,l){if(!i._localModels.has(t))throw Po.NotFound(t);return i._sendChatRequest(e,t,s,a??{},l??be.None)}},Object.freeze(o)}return o}async selectLanguageModels(e,t){let n=await this._proxy.$selectChatModels({...t,extension:e.identifier}),o=[],i=n.map(a=>this.getLanguageModelByIdentifier(e,a)),s=await Promise.all(i);for(let a of s)a&&o.push(a);return o}async _sendChatRequest(e,t,n,o,i){let s=this._convertMessages(e,n),a=e.identifier,l=this._localModels.get(t)?.metadata;if(!l||!this._localModels.has(t))throw Po.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,l)&&(!await this._getAuthAccess(e,{identifier:l.extension,displayName:l.auth.providerLabel},o.justification,!1)||!this._modelAccessList.get(a)?.has(l.extension)))throw Po.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);let d=Math.random()*1e6|0,c=new tD;this._pendingRequest.set(d,{languageModelId:t,res:c});try{await this._proxy.$tryStartChatRequest(a,t,d,new Pt(s),o,i)}catch(u){throw this._pendingRequest.delete(d),Po.tryDeserialize(u)??u}return c.apiObject}_convertMessages(e,t){let n=[];for(let o of t)o.role===3&&A(e,"languageModelSystem"),n.push(_I.from(o));return n}async $acceptResponsePart(e,t){let n=this._pendingRequest.get(e);n&&n.res.handleResponsePart(t.value)}async $acceptResponseDone(e,t){let n=this._pendingRequest.get(e);n&&(this._pendingRequest.delete(e),t?n.res.reject(Po.tryDeserialize(t)??$C(t)):n.res.resolve())}async _getAuthAccess(e,t,n,o){let i=Rb+t.identifier.value;if(await this._extHostAuthentication.getSession(e,i,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(o)return!1;try{let a=n?p(3162,null,t.displayName,n):void 0;return await this._extHostAuthentication.getSession(e,i,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!_e.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(let t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(n){this._logService.error("Fake Auth request failed"),this._logService.error(n)}}async _computeTokenLength(e,t,n){let o=this._localModels.get(e);if(!o)throw Po.NotFound(`Language model '${e}' is unknown.`);return this._languageModelProviders.get(o.metadata.vendor)?.provider.provideTokenCount(o.info,t,n)??0}$updateModelAccesslist(e){let t=new Array;for(let{from:n,to:o,enabled:i}of e){let s=this._modelAccessList.get(n)??new Yn;if(s.has(o)!==i){i?s.add(o):s.delete(o),this._modelAccessList.set(n,s);let l={from:n,to:o};t.push(l),this._onDidChangeModelAccess.fire(l)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);let t=Me.signal(Me.filter(this._onDidChangeModelAccess.event,o=>_e.equals(o.from,e.identifier))),n=Me.signal(this._onDidChangeProviders.event);return{get onDidChange(){return Me.any(t,n)},canSendRequest(o){return!0}}}fileIsIgnored(e,t,n=be.None){return A(e,"chatParticipantAdditions"),this._proxy.$fileIsIgnored(t,n)}get isModelProxyAvailable(){return!!this._languageModelProxyProvider}async getModelProxy(e){if(A(e,"languageModelProxy"),!this._languageModelProxyProvider)throw this._logService.trace("[LanguageModelProxy] No LanguageModelProxyProvider registered"),new Error("No language model proxy provider is registered.");let t=_e.toKey(e.identifier);try{let n=await Promise.resolve(this._languageModelProxyProvider.provideModelProxy(t,be.None));if(!n)throw this._logService.warn(`[LanguageModelProxy] Provider returned no proxy for ${t}`),new Error("Language model proxy is not available.");return n}catch(n){throw this._logService.error(`[LanguageModelProxy] Provider failed to return proxy for ${t}`,n),n}}async $isFileIgnored(e,t,n){let o=this._ignoredFileProviders.get(e);if(!o)throw new Error("Unknown LanguageModelIgnoredFileProvider");return await o.provideFileIgnored(y.revive(t),n)??!1}registerIgnoredFileProvider(e,t){A(e,"chatParticipantPrivate");let n=ml._idPool++;return this._proxy.$registerFileIgnoreProvider(n),this._ignoredFileProviders.set(n,t),J(()=>{this._proxy.$unregisterFileIgnoreProvider(n),this._ignoredFileProviders.delete(n)})}registerLanguageModelProxyProvider(e,t){return A(e,"chatParticipantPrivate"),this._languageModelProxyProvider=t,this._onDidChangeModelProxyAvailability.fire(),J(()=>{this._languageModelProxyProvider===t&&(this._languageModelProxyProvider=void 0,this._onDidChangeModelProxyAvailability.fire())})}};ml=D([C(0,ge),C(1,ue),C(2,Sp)],ml);var bB=60,yB=bB*60,nD=yB*24,mCe=nD*7,gCe=nD*30,fCe=nD*365;function vN(r){return r.getFullYear()+"-"+String(r.getMonth()+1).padStart(2,"0")+"-"+String(r.getDate()).padStart(2,"0")+"T"+String(r.getHours()).padStart(2,"0")+":"+String(r.getMinutes()).padStart(2,"0")+":"+String(r.getSeconds()).padStart(2,"0")+"."+(r.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}var Tp={DateTimeFormat(r,e){return new dt(()=>{try{return new Intl.DateTimeFormat(r,e)}catch{return new Intl.DateTimeFormat(void 0,e)}})},Collator(r,e){return new dt(()=>{try{return new Intl.Collator(r,e)}catch{return new Intl.Collator(void 0,e)}})},Segmenter(r,e){return new dt(()=>{try{return new Intl.Segmenter(r,e)}catch{return new Intl.Segmenter(void 0,e)}})},Locale(r,e){return new dt(()=>{try{return new Intl.Locale(r,e)}catch{return new Intl.Locale(ii,e)}})},NumberFormat(r,e){return new dt(()=>{try{return new Intl.NumberFormat(r,e)}catch{return new Intl.NumberFormat(void 0,e)}})}};var Ep=class r{constructor(e){let t=ET(e);this._defaultValue=t,this._asciiMap=r._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let n=ET(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}};var oD=class extends Ep{constructor(t,n){super(0);this._segmenter=null;this._cachedLine=null;this._cachedSegments=[];this.intlSegmenterLocales=n,this.intlSegmenterLocales.length>0?this._segmenter=Tp.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let o=0,i=t.length;o<i;o++)this.set(t.charCodeAt(o),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(t,n){let o=null;for(let i of this._getIntlSegmenterWordsOnLine(t)){if(i.index>n)break;o=i}return o}findNextIntlWordAtOrAfterOffset(t,n){for(let o of this._getIntlSegmenterWordsOnLine(t))if(!(o.index<n))return o;return null}_getIntlSegmenterWordsOnLine(t){return this._segmenter?this._cachedLine===t?this._cachedSegments:(this._cachedLine=t,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(t)),this._cachedSegments):[]}_filterWordSegments(t){let n=[];for(let o of t)this._isWordLike(o)&&n.push(o);return n}_isWordLike(t){return!!t.isWordLike}},bN=new Zo(10);function yN(r,e){let t=`${r}/${e.join(",")}`,n=bN.get(t);return n||(n=new oD(r,e),bN.set(t,n)),n}var Hf=class{constructor(e,t,n,o){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=rD(this.searchString):e=this.searchString.indexOf(`
`)>=0;let t=null;try{t=U0(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new Jv(t,this.wordSeparators?yN(this.wordSeparators,[]):null,n?this.searchString:null)}};function rD(r){if(!r||r.length===0)return!1;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n===10)return!0;if(n===92){if(e++,e>=t)break;let o=r.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function iD(r,e,t){if(!t)return new Xl(r,null);let n=[];for(let o=0,i=e.length;o<i;o++)n[o]=e[o];return new Xl(r,n)}function xB(r,e,t,n,o){if(n===0)return!0;let i=e.charCodeAt(n-1);if(r.get(i)!==0||i===13||i===10)return!0;if(o>0){let s=e.charCodeAt(n);if(r.get(s)!==0)return!0}return!1}function SB(r,e,t,n,o){if(n+o===t)return!0;let i=e.charCodeAt(n+o);if(r.get(i)!==0||i===13||i===10)return!0;if(o>0){let s=e.charCodeAt(n+o-1);if(r.get(s)!==0)return!0}return!1}function sD(r,e,t,n,o){return xB(r,e,t,n,o)&&SB(r,e,t,n,o)}var gx=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t=e.length,n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;let o=n.index,i=n[0].length;if(o===this._prevMatchStartIndex&&i===this._prevMatchLength){if(i===0){RT(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=i,!this._wordSeparators||sD(this._wordSeparators,e,t,o,i))return n}while(n);return null}};function IN(r){return r.scheme!==$.file&&r.scheme!==$.vscodeRemote}function CB(r){if(r.folders.length)return r.folders.every(e=>IN(e.uri))?r.folders[0].uri:void 0;if(r.configuration&&IN(r.configuration))return r.configuration}function xN(r){return CB(r)?.scheme}var fx=M("remoteAgentService"),NCe=new class{constructor(){this.maxSampleCount=5;this.sampleDelay=2e3;this.initial=[];this.maxInitialCount=3;this.average=[];this.maxAverageCount=100;this.highLatencyMultiple=2;this.highLatencyMinThreshold=500;this.highLatencyMaxThreshold=1500;this.lastMeasurement=void 0}get latency(){return this.lastMeasurement}async measure(r){let e=1/0;for(let n=0;n<this.maxSampleCount;n++){let o=await r.getRoundTripTime();if(o===void 0)return;e=Math.min(e,o/2),await cn(this.sampleDelay)}this.average.push(e),this.average.length>this.maxAverageCount&&this.average.shift();let t;return this.initial.length<this.maxInitialCount?this.initial.push(e):t=this.initial.reduce((n,o)=>n+o,0)/this.initial.length,this.lastMeasurement={initial:t,current:e,average:this.average.reduce((n,o)=>n+o,0)/this.average.length,high:typeof t>"u"?!1:e>this.highLatencyMaxThreshold||e>this.highLatencyMinThreshold&&e>t*this.highLatencyMultiple},this.lastMeasurement}};var SN=M("pathService"),wp=class{constructor(e,t,n,o){this.localUserHome=e;this.remoteAgentService=t;this.environmentService=n;this.contextService=o;this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||ai)(),this.resolveUserHome=(async()=>{let i=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=i?.userHome??e})()}hasValidBasename(e,t,n){return typeof t=="string"||typeof t>"u"?this.resolveOS.then(o=>this.doHasValidBasename(e,o,t)):this.doHasValidBasename(e,t,n)}doHasValidBasename(e,t,n){return e.scheme===$.file||e.scheme===$.vscodeRemote?q0(n??Bt(e),t===1):!0}get defaultUriScheme(){return wp.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return $.vscodeRemote;let n=xN(t.getWorkspace());if(n)return n;let o=t.getWorkspace().folders[0];if(o)return o.uri.scheme;let i=t.getWorkspace().configuration;return i?i.scheme:$.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===1?jt:Le)}async fileURI(e){let t="";if(await this.resolveOS===1&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){let o=e.indexOf("/",2);o===-1?(t=e.substring(2),e="/"):(t=e.substring(2,o),e=e.substring(o)||"/")}return y.from({scheme:$.file,authority:t,path:e,query:"",fragment:""})}};wp=D([C(1,fx),C(2,Mb),C(3,pa)],wp);function EB(r){return typeof r=="object"&&"uri"in r&&"pattern"in r}var Vf=class{constructor(e,t,n,o,i,s){this.configurationService=e;this.workspaceContextService=t;this.editorGroupsService=n;this.logService=o;this.pathService=i;this.uriIdentityService=s}aiText(e,t,n={}){return{...this.commonQuery(t?.map(fg),n),type:3,contentPattern:e}}text(e,t,n={}){e=this.getContentPattern(e,n);let o=this.configurationService.getValue(),i=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(fg),n),type:2,contentPattern:e,previewOptions:n.previewOptions,maxFileSize:n.maxFileSize,usePCRE2:o.search.usePCRE2||i||!1,surroundingContext:n.surroundingContext,userDisabledExcludesAndIgnoreFiles:n.disregardExcludeSettings&&n.disregardIgnoreFiles}}getContentPattern(e,t){let n=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,"\\n"));let o={...e,wordSeparators:n.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(o.isCaseSensitive=!0),this.isMultiline(e)&&(o.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(o.notebookInfo||(o.notebookInfo={}),o.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(o.notebookInfo||(o.notebookInfo={}),o.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(o.notebookInfo||(o.notebookInfo={}),o.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(o.notebookInfo||(o.notebookInfo={}),o.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),o}file(e,t={}){return{...this.commonQuery(e,t),type:1,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){if(!e)return{};if(Array.isArray(e)){if(e=e.filter(n=>n.length>0).map(hx),!e.length)return{}}else e=hx(e);return t?this.parseSearchPaths(e):{pattern:aD(...Array.isArray(e)?e:[e])}}commonQuery(e=[],t={}){let n=Array.isArray(t.excludePattern)?t.excludePattern.map(c=>c.pattern).flat():t.excludePattern;n=n?.length===1?n[0]:n;let o=this.handleIncludeExclude(t.includePattern,t.expandPatterns),i=this.handleIncludeExclude(n,t.expandPatterns),s=e.length>1,a=(o.searchPaths&&o.searchPaths.length?o.searchPaths.map(c=>this.getFolderQueryForSearchPath(c,t,i)):e.map(c=>this.getFolderQueryForRoot(c,t,i,s))).filter(c=>!!c),l={_reason:t._reason,folderQueries:a,usingSearchPaths:!!(o.searchPaths&&o.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:i.pattern,includePattern:o.pattern,ignoreGlobCase:t.ignoreGlobCase,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults,onlyFileScheme:t.onlyFileScheme};if(t.onlyOpenEditors){let c=Ze(this.editorGroupsService.groups.flatMap(g=>g.editors.map(v=>v.resource)));this.logService.trace("QueryBuilder#commonQuery - openEditor URIs",JSON.stringify(c));let u=c.filter(g=>SP(l,g.fsPath)),m=this.commonQueryFromFileList(u);return this.logService.trace("QueryBuilder#commonQuery - openEditor Query",JSON.stringify(m)),{...l,...m}}let d=t.extraFileResources&&t.extraFileResources.filter(c=>SP(l,c.fsPath));return l.extraFileResources=d&&d.length?d:void 0,l}commonQueryFromFileList(e){let t=[],n=new qe,o={},i=!1;return e.forEach(s=>{if(s.scheme===$.walkThrough)return;if(tM(s)){let l=this.workspaceContextService.getWorkspaceFolder(s)?.uri??this.uriIdentityService.extUri.dirname(s),d=n.get(l);d||(i=!0,d={folder:l,includePattern:{}},t.push(d),n.set(l,d));let c=Xi(l.fsPath,s.fsPath);Tr(d.includePattern)[CN(c.replace(/\\/g,"/"))]=!0}else s.fsPath&&(i=!0,o[CN(s.fsPath)]=!0)}),{folderQueries:t,includePattern:o,usingSearchPaths:!0,excludePattern:i?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(AT(e.pattern,!0))return!0}else if(AT(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&rD(e.pattern)||e.pattern.indexOf(`
`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){let t=u=>Ji(u)||/^\.\.?([\/\\]|$)/.test(u),o=(Array.isArray(e)?e:kB(e)).map(u=>{let m=this.pathService.resolvedUserHome;return m?Bw(u,m.scheme===$.file?m.fsPath:m.path):u}),i=wh(o,u=>t(u)?"searchPaths":"exprSegments"),s=(i.exprSegments||[]).map(u=>Fl(u,"/")).map(u=>Fl(u,"\\")).map(u=>(u[0]==="."&&(u="*"+u),_B(u))),a={},l=this.expandSearchPathPatterns(i.searchPaths||[]);l&&l.length&&(a.searchPaths=l);let d=s.flat(),c=aD(...d);return c&&(a.pattern=c),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:VO(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];let t=e.flatMap(o=>{let{pathPortion:i,globPortion:s}=wB(o);return s&&(s=lD(s)),this.expandOneSearchPath(i).flatMap(l=>this.resolveOneSearchPathPattern(l,s))}),n=new Map;return t.forEach(o=>{let i=o.searchPath.toString(),s=n.get(i);s?o.pattern&&(s.pattern=s.pattern||{},s.pattern[o.pattern]=!0):n.set(i,{searchPath:o.searchPath,pattern:o.pattern?aD(o.pattern):void 0})}),Array.from(n.values())}expandOneSearchPath(e){if(Ji(e)){let t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==$.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:y.file(tr(e))}]}if(this.workspaceContextService.getWorkbenchState()===2){let t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=hx(e),e.startsWith("../")||e===".."){let o=Le.resolve(t.path,e);return[{searchPath:t.with({path:o})}]}let n=lD(e);return[{searchPath:t,pattern:n}]}else{if(e==="./"||e===".\\")return[];{let t=e.replace(/^\.[\/\\]/,""),o=this.workspaceContextService.getWorkspace().folders.map(i=>{let s=t.match(new RegExp(`^${or(i.name)}(?:/(.*)|$)`));return s?{match:s,folder:i}:null}).filter(Kn);if(o.length)return o.map(i=>{let s=i.match[1];return{searchPath:i.folder.uri,pattern:s&&lD(s)}});{let i=e.match(/\.[\/\\](.+)[\/\\]?/),s=i?i[1]:e,a=p(20417,null,s);throw new Error(a)}}}}resolveOneSearchPathPattern(e,t){let n=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,o=[{searchPath:e.searchPath,pattern:n}];return n&&!n.endsWith("**")&&o.push({searchPath:e.searchPath,pattern:n+"/**"}),o}getFolderQueryForSearchPath(e,t,n){let o=this.getFolderQueryForRoot(fg(e.searchPath),t,n,!1);return o?{...o,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,n,o){let i,s=y.isUri(e)?e:e.uri,a=t.excludePattern?.map(g=>{let v=t.excludePattern&&EB(g)?g.uri:void 0;return!v||!(y.isUri(e)&&this.uriIdentityService.extUri.isEqual(e,v))?v:void 0});if(a?.length||(a=[void 0]),n.searchPaths){let g=n.searchPaths.filter(v=>_r(v.searchPath,s))[0];if(g&&!g.pattern)return null;g&&(i=g.pattern)}let l=this.configurationService.getValue({resource:s}),c={...this.getExcludesForFolder(l,t)||{},...i||{}},u=y.isUri(e)?Bt(e):e.name,m=a.map(g=>Object.keys(c).length>0?{folder:g,pattern:c}:void 0).filter(g=>g);return{folder:s,folderName:o?u:void 0,excludePattern:m,fileEncoding:l.files&&l.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles=="boolean"?t.disregardIgnoreFiles:!l.search.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles=="boolean"?t.disregardGlobalIgnoreFiles:!l.search.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles=="boolean"?t.disregardParentIgnoreFiles:!l.search.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks=="boolean"?t.ignoreSymlinks:!l.search.followSymlinks,ignoreGlobCase:t.ignoreGlobCase}}};Vf=D([C(0,oo),C(1,pa),C(2,wL),C(3,ue),C(4,SN),C(5,xb)],Vf);function wB(r){let e=r.match(/[\*\{\}\(\)\[\]\?]/);if(e){let t=e.index,n=r.substr(0,t).match(/[/|\\][^/\\]*$/);if(n){let o=r.substr(0,n.index);return o.match(/[/\\]/)||(o+="/"),{pathPortion:o,globPortion:r.substr((n.index||0)+1)}}}return{pathPortion:r}}function aD(...r){return r.length?r.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function kB(r){return ou(r,",").map(e=>e.trim()).filter(e=>!!e.length)}function _B(r){return[`**/${r}/**`,`**/${r}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function hx(r){return r.replace(/\\/g,"/")}function lD(r){return hx(r).replace(/^\.\//,"").replace(/\/+$/g,"")}function CN(r){return r.replace(/([?*[\]])/g,"[$1]")}var PB=7e3;function EN(r,e){let t=e.activationEvents;if(!t)return Promise.resolve(void 0);let n=[],o=[];for(let c of t)if(/^workspaceContains:/.test(c)){let u=c.substr(18);u.indexOf("*")>=0||u.indexOf("?")>=0||r.forceUsingSearch?o.push(u):n.push(u)}if(n.length===0&&o.length===0)return Promise.resolve(void 0);let{promise:i,resolve:s}=GT(),a=c=>s({activationEvent:c}),l=Promise.all(n.map(c=>DB(r,c,a))).then(()=>{}),d=RB(r,e.identifier,o,a);return Promise.all([l,d]).then(()=>{s(void 0)}),i}async function DB(r,e,t){for(let n of r.folders)if(await r.exists(Ut(y.revive(n),e))){t(`workspaceContains:${e}`);return}}async function RB(r,e,t,n){if(t.length===0)return Promise.resolve(void 0);let o=new Re,i=r.checkExists(r.folders,t,o.token),s=setTimeout(async()=>{o.cancel(),r.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},PB),a=!1;try{a=await i}catch(l){Tn(l)||ct(l)}o.dispose(),clearTimeout(s),a&&n(`workspaceContains:${t.join(",")}`)}var kp=class{constructor(e){this._onDidChangePassword=new E;this.onDidChangePassword=this._onDidChangePassword.event;this._proxy=e.getProxy(N.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,n){return this._proxy.$setPassword(e,t,n)}delete(e,t){return this._proxy.$deletePassword(e,t)}keys(e){return this._proxy.$getKeys(e)}},_p=M("IExtHostSecretState");var vx=class{constructor(e,t){this.disposables=new q;this._id=_e.toKey(e.identifier),this.#e=t,this.onDidChange=Me.map(Me.filter(this.#e.onDidChangePassword,n=>n.extensionId===this._id),n=>({key:n.key}),this.disposables)}#e;dispose(){this.disposables.dispose()}get(e){return this.#e.get(this._id,e)}store(e,t){return this.#e.store(this._id,e,t)}delete(e){return this.#e.delete(this._id,e)}keys(){return this.#e.keys(this._id)||[]}};var Pp=class{constructor(e,t,n){this.logService=n;this.bundleCache=new Map;this._proxy=t.getProxy(N.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===ii}getMessage(e,t){let{message:n,args:o,comment:i}=t;if(this.isDefaultLanguage)return PT(n,o??{});let s=n;i&&i.length>0&&(s+=`/${Array.isArray(i)?i.join(""):i}`);let a=this.bundleCache.get(e)?.contents[s];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${s}`),PT(a??n,o??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t,n=await this.getBundleLocation(e);if(!n){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{let o=await this._proxy.$fetchBundleContents(n),i=JSON.parse(o);t=e.isBuiltin?i.contents?.bundle:i}catch(o){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${n}: ${o.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:n})}async getBundleLocation(e){if(e.isBuiltin){let t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return y.revive(t)}return e.l10n?y.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};Pp=D([C(0,nt),C(1,ge),C(2,ue)],Pp);var Dp=M("IExtHostLocalizationService");var Mp=M("IExtHostManagedSockets"),Rp=class{constructor(e){this._remoteSocketIdCounter=0;this._factory=null;this._managedRemoteSockets=new Map;this._proxy=e.getProxy(N.MainThreadManagedSockets)}setFactory(e,t){for(let n of this._managedRemoteSockets.values())n.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new dD(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw new Error(`No socket factory with id ${e}`);let t=++this._remoteSocketIdCounter,n=await this._factory.makeConnection(),o=new q;return this._managedRemoteSockets.set(t,new cD(t,n,o)),o.add(J(()=>this._managedRemoteSockets.delete(t))),o.add(n.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),o.dispose()})),o.add(n.onDidClose(i=>{this._proxy.$onDidManagedSocketClose(t,i?.stack??i?.message),o.dispose()})),o.add(n.onDidReceiveMessage(i=>this._proxy.$onDidManagedSocketHaveData(t,ee.wrap(i)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){let t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};Rp=D([C(0,ge)],Rp);var dD=class{constructor(e,t){this.socketFactoryId=e;this.makeConnection=t}},cD=class extends H{constructor(t,n,o){super();this.socketId=t;this.actual=n;this._register(o)}};var mD=M("IHostUtils"),gl=class extends H{constructor(t,n,o,i,s,a,l,d,c,u,m,g,v){super();this._extHostManagedSockets=g;this._extHostLanguageModels=v;this._onDidChangeRemoteConnectionData=this._register(new E);this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event;this._realPathCache=new Map;this._isTerminating=!1;this._hostUtils=n,this._extHostContext=o,this._initData=l,this._extHostWorkspace=i,this._extHostConfiguration=s,this._logService=a,this._extHostTunnelService=c,this._extHostTerminalService=u,this._extHostLocalizationService=m,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(N.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(N.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(N.MainThreadExtensionService),this._almostReadyToRunExtensions=new yn,this._readyToStartExtensionHost=new yn,this._readyToRunExtensions=new yn,this._eagerExtensionsActivated=new yn,this._activationEventsReader=new pD(this._initData.extensions.activationEvents),this._globalRegistry=new Fs(this._activationEventsReader,this._initData.extensions.allExtensions);let h=new Yn(this._initData.extensions.myExtensions);this._myRegistry=new Fs(this._activationEventsReader,_N(this._globalRegistry,h)),ta&&(this._logService.info(`Creating extension host with the following global extensions: ${Ap(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${Ap(this._myRegistry)}`)),this._storage=new lp(this._extHostContext,this._logService),this._secretState=new kp(this._extHostContext),this._storagePath=d,this._instaService=this._store.add(t.createChild(new da([dp,this._storage],[_p,this._secretState]))),this._activator=this._register(new ip(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(x,S,T)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(x,ni(S),T)},actualActivateExtension:async(x,S)=>{if(Fs.isHostExtension(x,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(x,S),new rx;let T=this._myRegistry.getExtensionDescription(x);return this._activateExtension(T,S)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),bn("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(t){ct(t)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let t=[];try{t=this._myRegistry.getAllExtensionDescriptions().map(s=>s.identifier).filter(s=>this.isActivated(s)).map(s=>this._deactivate(s))}catch{}await Promise.all(t)}terminate(t,n=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${t}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),km(i=>{this._logService.error(i)}),this._extHostContext.dispose();let o=this._deactivateAll();Promise.race([cn(5e3),o]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${n}`):this._logService.info(`Extension host exiting with code ${n}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(n)})}isActivated(t){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(t):!1}async getExtension(t){let n=await this._mainThreadExtensionsProxy.$getExtension(t);return n&&{...n,identifier:new _e(n.identifier.value),extensionLocation:y.revive(n.extensionLocation)}}_activateByEvent(t,n){return this._activator.activateByEvent(t,n)}_activateById(t,n){return this._activator.activateById(t,n)}activateByIdWithErrors(t,n){return this._activateById(t,n).then(()=>{let o=this._activator.getActivatedExtension(t);if(o.activationFailed)return Promise.reject(o.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(t=>this._myRegistry)}getExtensionExports(t){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(t).exports;try{return this._activator.getActivatedExtension(t).exports}catch{return null}}async _realPathExtensionUri(t){if(t.scheme===$.file&&this._hostUtils.fsRealpath){let n=t.fsPath;this._realPathCache.has(n)||this._realPathCache.set(n,this._hostUtils.fsRealpath(n));let o=await this._realPathCache.get(n);return y.file(o)}return t}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(t=>new uD(t))),this._extensionPathIndex}async _createExtensionPathIndex(t){let n=go.forUris(o=>FT.ignorePathCasing(o));return await Promise.all(t.map(async o=>{if(this._getEntryPoint(o)){let i=await this._realPathExtensionUri(o.extensionLocation);n.set(i,o)}})),n}_deactivate(t){let n=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(t))return n;let o=this._activator.getActivatedExtension(t);if(!o)return n;try{typeof o.module.deactivate=="function"&&(n=Promise.resolve(o.module.deactivate()).then(void 0,i=>(this._logService.error(i),Promise.resolve(void 0))))}catch(i){this._logService.error(`An error occurred when deactivating the extension '${t.value}':`),this._logService.error(i)}try{o.disposable.dispose()}catch(i){this._logService.error(`An error occurred when disposing the subscriptions for extension '${t.value}':`),this._logService.error(i)}return n}async _activateExtension(t,n){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(t.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(t.identifier),this._doActivateExtension(t,n).then(o=>{let i=o.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(t.identifier,i.codeLoadingTime,i.activateCallTime,i.activateResolvedTime,n),this._logExtensionActivationTimes(t,n,"success",i),o},o=>{throw this._logExtensionActivationTimes(t,n,"failure"),o})}_logExtensionActivationTimes(t,n,o,i){let s=kN(t,n);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...s,...i||{},outcome:o})}_doActivateExtension(t,n){let o=kN(t,n);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",o);let i=this._getEntryPoint(t);if(!i)return Promise.resolve(new ox(Bd.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${t.identifier.value}, startup: ${n.startup}, activationEvent: '${n.activationEvent}'${t.identifier.value!==n.extensionId.value?`, root cause: ${n.extensionId.value}`:""}`),this._logService.flush();let s=this._isESM(t),a=new q,l=new sp(n.startup);return Promise.all([s?this._loadESMModule(t,Ut(t.extensionLocation,i),l):this._loadCommonJSModule(t,Ut(t.extensionLocation,i),l),this._loadExtensionContext(t,a)]).then(d=>(bn(`code/extHost/willActivateExtension/${t.identifier.value}`),gl._callActivate(this._logService,t.identifier,d[0],d[1],a,l))).then(d=>(bn(`code/extHost/didActivateExtension/${t.identifier.value}`),d))}_loadExtensionContext(t,n){let o=this._extHostLanguageModels.createLanguageModelAccessInformation(t),i=n.add(new ix(t,this._storage)),s=n.add(new Af(t.identifier.value,!1,this._storage)),a=n.add(new vx(t,this._secretState)),l=t.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?3:2:1,d=this._initData.remote.isRemote?2:1;return this._logService.trace(`ExtensionService#loadExtensionContext ${t.identifier.value}`),Promise.all([i.whenReady,s.whenReady,this._storagePath.whenReady]).then(()=>{let c=this,u,m,g=Fe(t,"ipc")?this._initData.messagePorts?.get(_e.toKey(t.identifier)):void 0;return Object.freeze({globalState:i,workspaceState:s,secrets:a,subscriptions:[],get languageModelAccessInformation(){return o},get extensionUri(){return t.extensionLocation},get extensionPath(){return t.extensionLocation.fsPath},asAbsolutePath(v){return Sc(t.extensionLocation.fsPath,v)},get storagePath(){return c._storagePath.workspaceValue(t)?.fsPath},get globalStoragePath(){return c._storagePath.globalValue(t).fsPath},get logPath(){return Sc(c._initData.logsLocation.fsPath,t.identifier.value)},get logUri(){return y.joinPath(c._initData.logsLocation,t.identifier.value)},get storageUri(){return c._storagePath.workspaceValue(t)},get globalStorageUri(){return c._storagePath.globalValue(t)},get extensionMode(){return l},get extension(){return u===void 0&&(u=new fl(c,t.identifier,t,d,!1)),u},get extensionRuntime(){return A(t,"extensionRuntime"),c.extensionRuntime},get environmentVariableCollection(){return c._extHostTerminalService.getEnvironmentVariableCollection(t)},get messagePassingProtocol(){if(!m){if(!g)return;let v=Me.buffer(Me.fromDOMEventEmitter(g,"message",h=>h.data));g.start(),m={onDidReceiveMessage:v,postMessage:g.postMessage.bind(g)}}return m}})})}static _callActivate(t,n,o,i,s,a){return o=o||{activate:void 0,deactivate:void 0},this._callActivateOptional(t,n,o,i,a).then(l=>new Wd(!1,null,a.build(),o,l,J(()=>{s.dispose(),wn(i.subscriptions)})))}static _callActivateOptional(t,n,o,i,s){if(typeof o.activate=="function")try{s.activateCallStart(),t.trace(`ExtensionService#_callActivateOptional ${n.value}`);let a=o.activate.apply(globalThis,[i]);return s.activateCallStop(),s.activateResolveStart(),Promise.resolve(a).then(l=>(s.activateResolveStop(),l))}catch(a){return Promise.reject(a)}else return Promise.resolve(o)}_activateOneStartupFinished(t,n){this._activateById(t.identifier,{startup:!1,extensionId:t.identifier,activationEvent:n}).then(void 0,o=>{this._logService.error(o)})}_activateAllStartupFinishedDeferred(t,n=0){let i=Date.now();Vh(()=>{for(let s=n;s<t.length;s+=1){let a=t[s];for(let l of a.activationEvents??[])if(l==="onStartupFinished")if(Date.now()-i>50){this._activateAllStartupFinishedDeferred(t,s);break}else this._activateOneStartupFinished(a,l)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(a0()),this._extHostConfiguration.getConfigProvider().then(t=>{let n=t.getConfiguration("extensions.experimental").get("deferredStartupFinishedActivation"),o=this._myRegistry.getAllExtensionDescriptions();if(n)this._activateAllStartupFinishedDeferred(o);else for(let i of o)if(i.activationEvents)for(let s of i.activationEvents)s==="onStartupFinished"&&this._activateOneStartupFinished(i,s)})}_handleEagerExtensions(){let t=this._activateByEvent("*",!0).then(void 0,a=>{this._logService.error(a)});this._register(this._extHostWorkspace.onDidChangeWorkspace(a=>this._handleWorkspaceContainsEagerExtensions(a.added)));let n=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],o=this._handleWorkspaceContainsEagerExtensions(n),i=this._handleRemoteResolverEagerExtensions(),s=Promise.all([i,t,o]).then(()=>{});return Promise.race([s,cn(1e4)]).then(()=>{this._activateAllStartupFinished()}),s}_handleWorkspaceContainsEagerExtensions(t){return t.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(n=>this._handleWorkspaceContainsEagerExtension(t,n))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(t,n){if(this.isActivated(n.identifier))return;let o=!this._initData.remote.isRemote&&!!this._initData.remote.authority,i={logService:this._logService,folders:t.map(a=>a.uri),forceUsingSearch:o||!this._hostUtils.fsExists,exists:a=>this._hostUtils.fsExists(a.fsPath),checkExists:(a,l,d)=>this._mainThreadWorkspaceProxy.$checkExists(a,l,d)},s=await EN(i,n);if(s)return this._activateById(n.identifier,{startup:!0,extensionId:n.identifier,activationEvent:s.activationEvent}).then(void 0,a=>this._logService.error(a))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(t){throw console.error(t),t}}async _doHandleExtensionTests(){let{extensionDevelopmentLocationURI:t,extensionTestsLocationURI:n}=this._initData.environment;if(!t||!n)throw new Error(p(3159,null));let o=(await this.getExtensionPathIndex()).findSubstr(n),s=await(this._isESM(o,n.path)?this._loadESMModule(null,n,new sp(!1)):this._loadCommonJSModule(null,n,new sp(!1)));if(!s||typeof s.run!="function")throw new Error(p(3158,null,n.toString()));return new Promise((a,l)=>{let d=(m,g)=>{m?(ta&&this._logService.error("Test runner called back with error",m),l(m)):(ta&&(g?this._logService.info(`Test runner called back with ${g} failures.`):this._logService.info("Test runner called back with successful outcome.")),a(typeof g=="number"&&g>0?1:0))},c=rr(n),u=s.run(c,d);u&&u.then&&u.then(()=>{ta&&this._logService.info("Test runner finished successfully."),a(0)}).catch(m=>{ta&&this._logService.error("Test runner finished with error",m),l(m instanceof Error&&m.stack?m.stack:String(m))})})}_startExtensionHost(){if(this._started)throw new Error("Extension host is already started!");return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),cn(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info("Eager extensions activated")})}registerRemoteAuthorityResolver(t,n){return this._resolvers[t]=n,J(()=>{delete this._resolvers[t]})}async getRemoteExecServer(t){let{resolver:n}=await this._activateAndGetResolver(t);return n?.resolveExecServer?.(t,{resolveAttempt:0})}async _activateAndGetResolver(t){let n=t.indexOf("+");if(n===-1)throw new _i("Not an authority that can be resolved!","InvalidAuthority");let o=t.substr(0,n);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${o}`,!1),{authorityPrefix:o,resolver:this._resolvers[o]}}async $resolveAuthority(t,n){let o=uo.create(!1),i=()=>`[resolveAuthority(${jk(t)},${n})][${o.elapsed()}ms] `,s=P=>this._logService.info(`${i()}${P}`),a=P=>this._logService.warn(`${i()}${P}`),l=(P,L=void 0)=>this._logService.error(`${i()}${P}`,L),d=P=>{if(P instanceof _i)return{type:"error",error:{code:P._code,message:P._message,detail:P._detail}};throw P},c=async P=>{s(`activating resolver for ${P}...`);let{resolver:L,authorityPrefix:Y}=await this._activateAndGetResolver(P);if(!L)throw l(`no resolver for ${Y}`),new _i(`No remote extension installed to resolve ${Y}.`,"NoResolverFound");return{resolver:L,authorityPrefix:Y,remoteAuthority:P}},u=t.split(/@|%40/g).reverse();s(`activating remote resolvers ${u.join(" -> ")}`);let m;try{m=await Promise.all(u.map(c)).catch(async P=>{if(!(P instanceof _i)||P._code!=="InvalidAuthority")throw P;return a(`resolving nested authorities failed: ${P.message}`),[await c(t)]})}catch(P){return d(P)}let g=new dv;g.cancelAndSet(()=>s("waiting..."),1e3);let v,h;for(let[P,{authorityPrefix:L,resolver:Y,remoteAuthority:G}]of m.entries())try{if(P===m.length-1)s("invoking final resolve()..."),bn(`code/extHost/willResolveAuthority/${L}`),v=await Y.resolve(G,{resolveAttempt:n,execServer:h}),bn(`code/extHost/didResolveAuthorityOK/${L}`),s("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(Y,Ba.isManagedResolvedAuthority(v)?v:void 0));else{if(s(`invoking resolveExecServer() for ${G}`),bn(`code/extHost/willResolveExecServer/${L}`),h=await Y.resolveExecServer?.(G,{resolveAttempt:n,execServer:h}),!h)throw new _i(`Exec server was not available for ${G}`,"NoResolverFound");bn(`code/extHost/didResolveExecServerOK/${L}`)}}catch(z){return bn(`code/extHost/didResolveAuthorityError/${L}`),l("returned an error",z),g.dispose(),d(z)}g.dispose();let x={environmentTunnels:v.environmentTunnels,features:v.tunnelFeatures?{elevation:v.tunnelFeatures.elevation,privacyOptions:v.tunnelFeatures.privacyOptions,protocol:v.tunnelFeatures.protocol===void 0?!0:v.tunnelFeatures.protocol}:void 0},S={extensionHostEnv:v.extensionHostEnv,isTrusted:v.isTrusted,authenticationSession:v.authenticationSessionForInitializingExtensions?{id:v.authenticationSessionForInitializingExtensions.id,providerId:v.authenticationSessionForInitializingExtensions.providerId}:void 0};s(`returned ${Ba.isManagedResolvedAuthority(v)?"managed authority":`${v.host}:${v.port}`}`);let T;if(Ba.isManagedResolvedAuthority(v)){let P=n;this._extHostManagedSockets.setFactory(P,v.makeConnection),T={authority:t,connectTo:new Qb(P),connectionToken:v.connectionToken}}else T={authority:t,connectTo:new Jb(v.host,v.port),connectionToken:v.connectionToken};return{type:"ok",value:{authority:T,options:S,tunnelInformation:x}}}async $getCanonicalURI(t,n){this._logService.info(`$getCanonicalURI invoked for authority (${jk(t)})`);let{resolver:o}=await this._activateAndGetResolver(t);if(!o)return null;let i=y.revive(n);if(typeof o.getCanonicalURI>"u")return i;let s=await Qt(()=>o.getCanonicalURI(i));return s||i}async $startExtensionHost(t){t.toAdd.forEach(a=>a.extensionLocation=y.revive(a.extensionLocation));let{globalRegistry:n,myExtensions:o}=wN(this._activationEventsReader,this._globalRegistry,this._myRegistry,t),i=await this._createExtensionPathIndex(o);return(await this.getExtensionPathIndex()).setSearchTree(i),this._globalRegistry.set(n.getAllExtensionDescriptions()),this._myRegistry.set(o),ta&&(this._logService.info(`$startExtensionHost: global extensions: ${Ap(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${Ap(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(t,n){return n===1?this._almostReadyToRunExtensions.wait().then(o=>this._activateByEvent(t,!1)):this._readyToRunExtensions.wait().then(o=>this._activateByEvent(t,!1))}async $activate(t,n){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(t)?(await this._activateById(t,n),!0):!1}async $deltaExtensions(t){t.toAdd.forEach(a=>a.extensionLocation=y.revive(a.extensionLocation));let{globalRegistry:n,myExtensions:o}=wN(this._activationEventsReader,this._globalRegistry,this._myRegistry,t),i=await this._createExtensionPathIndex(o);return(await this.getExtensionPathIndex()).setSearchTree(i),this._globalRegistry.set(n.getAllExtensionDescriptions()),this._myRegistry.set(o),ta&&(this._logService.info(`$deltaExtensions: global extensions: ${Ap(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${Ap(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(t){return t}async $test_up(t){return t.byteLength}async $test_down(t){let n=ee.alloc(t),o=Math.random()%256;for(let i=0;i<t;i++)n.writeUInt8(o,i);return n}async $updateRemoteConnectionData(t){this._remoteConnectionData=t,this._onDidChangeRemoteConnectionData.fire()}_isESM(t,n){return n??=t?this._getEntryPoint(t):n,n?.endsWith(".mjs")||t?.type==="module"&&!n?.endsWith(".cjs")}};gl=D([C(0,po),C(1,mD),C(2,ge),C(3,Wn),C(4,ao),C(5,ue),C(6,nt),C(7,up),C(8,mp),C(9,Yr),C(10,Dp),C(11,Mp),C(12,Cp)],gl);function wN(r,e,t,n){r.addActivationEvents(n.addActivationEvents);let o=new Fs(r,e.getAllExtensionDescriptions());o.deltaExtensions(n.toAdd,n.toRemove);let i=new Yn(t.getAllExtensionDescriptions().map(a=>a.identifier));for(let a of n.myToRemove)i.delete(a);for(let a of n.myToAdd)i.add(a);let s=_N(o,i);return{globalRegistry:o,myExtensions:s}}function kN(r,e){return{id:r.identifier.value,name:r.name,extensionVersion:r.version,publisherDisplayName:r.publisher,activationEvents:r.activationEvents?r.activationEvents.join(","):null,isBuiltin:r.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function Ap(r){return r.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}var Mo=M("IExtHostExtensionService"),fl=class{#e;#t;#n;constructor(e,t,n,o,i){this.#e=e,this.#t=t,this.#n=n.identifier,this.id=n.identifier.value,this.extensionUri=n.extensionLocation,this.extensionPath=tr(rr(n.extensionLocation)),this.packageJSON=n,this.extensionKind=o,this.isFromDifferentExtensionHost=i}get isActive(){return this.#e.isActivated(this.#n)}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return this.#e.getExtensionExports(this.#n)}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await this.#e.activateByIdWithErrors(this.#n,{startup:!1,extensionId:this.#t,activationEvent:"api"}),this.exports}};function _N(r,e){return r.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}var uD=class{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}},pD=class{constructor(e){this._map=new Un;this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(let t of Object.keys(e))this._map.set(t,e[t])}};var Vs=M("IExtHostApiDeprecationService"),Lp=class{constructor(e,t){this._extHostLogService=t;this._reportedUsages=new Set;this._telemetryShape=e.getProxy(N.MainThreadTelemetry)}report(e,t,n){let o=this.getUsageKey(e,t);this._reportedUsages.has(o)||(this._reportedUsages.add(o),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${n}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};Lp=D([C(0,ge),C(1,ue)],Lp);var Twe=Object.freeze(new class{report(r,e,t){}});var bx=class{static async installEarlyHandler(e){Error.stackTraceLimit=100;let t=e.get(ue),o=e.get(ge).getProxy(N.MainThreadErrors);km(i=>{t.error(i);let s=ni(i);o.$onUnexpectedError(s)})}static async installFullHandler(e){let t=e.get(ue),n=e.get(ge),o=e.get(Mo),i=e.get(cl),s=e.get(Vs),a=n.getProxy(N.MainThreadExtensionService),l=n.getProxy(N.MainThreadErrors),d=await o.getExtensionRegistry(),c=await o.getExtensionPathIndex(),u=new WeakMap;function m(h,x){if(u.has(h))return u.get(h).stack;let S="",T,P;for(let Y of x)S+=`
	at ${Y.toString()}`,P=Y.getFileName(),!T&&P&&(T=c.findSubstr(y.file(P)));let L=`${h.name||"Error"}: ${h.message||""}${S}`;return u.set(h,{extensionIdentifier:T?.identifier,stack:L}),L}let g=Symbol("prepareStackTrace wrapped"),v=m;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return v},set(h){if(h===m||!h||h[g]){v=h||m;return}v=function(x,S){return m(x,S),h.call(Error,x,S)},Object.assign(v,{[g]:!0})}}),km(h=>{wm.is(h)||t.error(h);let x=ni(h),S;if(h instanceof Pc?S=h.extension:S=u.get(h)?.extensionIdentifier,!!S)if(wm.is(h)){let T=d.getExtensionDescription(S);T&&s.report(h.name,T,`${h.message}
 FROM: ${h.stack}`)}else{a.$onExtensionRuntimeError(S,x);let T=i.onExtensionError(S,h);t.trace("forwarded error to extension?",T,S)}}),uc.addListener(h=>{l.$onUnexpectedError(h)})}},yx=class r{constructor(e,t,n,o,i){this._hostUtils=n,this._rpcProtocol=new gv(e,null,o),t=r._transform(t,this._rpcProtocol);let s=new da(...IM());s.set(nt,{_serviceBrand:void 0,...t,messagePorts:i}),s.set(ge,new _v(this._rpcProtocol)),s.set(ca,new Pv(o)),s.set(mD,n);let a=new kv(s,!0);a.invokeFunction(bx.installEarlyHandler),this._logService=a.invokeFunction(l=>l.get(ue)),bn("code/extHost/didCreateServices"),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info("Extension host started"),this._logService.trace("initData",t),this._extensionService=a.invokeFunction(l=>l.get(Mo)),this._extensionService.initialize(),a.invokeFunction(bx.installFullHandler)}async asBrowserUri(e){let t=this._rpcProtocol.getProxy(N.MainThreadExtensionService);return y.revive(await t.$asBrowserUri(e))}terminate(e){this._extensionService.terminate(e)}static _transform(e,t){e.extensions.allExtensions.forEach(o=>{o.extensionLocation=y.revive(t.transformIncomingURIs(o.extensionLocation))}),e.environment.appRoot=y.revive(t.transformIncomingURIs(e.environment.appRoot));let n=e.environment.extensionDevelopmentLocationURI;return n&&(e.environment.extensionDevelopmentLocationURI=n.map(o=>y.revive(t.transformIncomingURIs(o)))),e.environment.extensionTestsLocationURI=y.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=y.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=y.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.nlsBaseUrl=y.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=y.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}};var MB=(function(e){let t=n=>{globalThis.removeEventListener("message",t);let o=n.data;Object.defineProperties(globalThis,{postMessage:{value(i,s){o.postMessage(i,s)}},onmessage:{get(){return o.onmessage},set(i){o.onmessage=i}}}),o.addEventListener("message",i=>{globalThis.dispatchEvent(new MessageEvent("message",{data:i.data,ports:i.ports?[...i.ports]:void 0}))}),o.start(),globalThis.Worker=class{constructor(){throw new TypeError("Nested workers from within nested worker are NOT supported.")}},importScripts(e)};globalThis.addEventListener("message",t)}).toString(),Ix=class extends EventTarget{constructor(t,n,o){super();this.onmessage=null;this.onmessageerror=null;this.onerror=null;let i=`((${MB})('${n}'))`,s=new Blob([i],{type:"application/javascript"}),a=URL.createObjectURL(s),l=new MessageChannel,d=a,c={type:"_newWorker",id:d,port:l.port2,url:a,options:o};t(c,[l.port2]),this.postMessage=l.port1.postMessage.bind(l.port1),this.terminate=()=>{t({type:"_terminateWorker",id:d}),URL.revokeObjectURL(a),l.port1.close(),l.port2.close()},Object.defineProperties(this,{onmessage:{get(){return l.port1.onmessage},set(u){l.port1.onmessage=u}},onmessageerror:{get(){return l.port1.onmessageerror},set(u){l.port1.onmessageerror=u}}}),l.port1.addEventListener("messageerror",u=>{let m=new MessageEvent("messageerror",{data:u.data});this.dispatchEvent(m)}),l.port1.addEventListener("message",u=>{let m=new MessageEvent("message",{data:u.data});this.dispatchEvent(m)}),l.port1.start()}};var eke=new w("inOutput",!1),tke=new w("activeLogOutput",!1),nke=new w("activeLogOutput.isLog",!1),oke=new w("activeLogOutput.levelSettable",!1),rke=new w("activeLogOutput.level",""),ike=new w("activeLogOutput.levelIsDefault",!1),ske=new w("outputView.scrollLock",!1),ake=new w("activeOutputChannel",""),lke=new w("output.filter.trace",!0),dke=new w("output.filter.debug",!0),cke=new w("output.filter.info",!0),uke=new w("output.filter.warning",!0),pke=new w("output.filter.error",!0),mke=new w("outputFilterFocus",!1),gke=new w("output.filter.categories",""),fke=M("outputService");var AB={OutputChannels:"workbench.contributions.outputChannels"};function LB(r){return Array.isArray(r.source)}var gD=class extends H{constructor(){super(...arguments);this.channels=new Map;this._onDidRegisterChannel=this._register(new E);this.onDidRegisterChannel=this._onDidRegisterChannel.event;this._onDidRemoveChannel=this._register(new E);this.onDidRemoveChannel=this._onDidRemoveChannel.event;this._onDidUpdateChannelFiles=this._register(new E);this.onDidUpdateChannelSources=this._onDidUpdateChannelFiles.event}registerChannel(t){this.channels.has(t.id)||(this.channels.set(t.id,t),this._onDidRegisterChannel.fire(t.id))}getChannels(){let t=[];return this.channels.forEach(n=>t.push(n)),t}getChannel(t){return this.channels.get(t)}updateChannelSources(t,n){let o=this.channels.get(t);o&&LB(o)&&(o.source=n,this._onDidUpdateChannelFiles.fire(o))}removeChannel(t){let n=this.channels.get(t);n&&(this.channels.delete(t),this._onDidRemoveChannel.fire(n))}};ot.add(AB.OutputChannels,new gD);var xx=class extends Mc{constructor(t,n,o,i,s){super();this.id=t;this.name=n;this.logger=o;this.proxy=i;this.extension=s;this.offset=0;this.visible=!1;this.setLevel(o.getLevel()),this._register(o.onDidChangeLogLevel(a=>this.setLevel(a))),this._register(J(()=>this.proxy.$dispose(this.id)))}get logLevel(){return this.getLevel()}appendLine(t){this.append(t+`
`)}append(t){this.info(t)}clear(){let t=this.offset;this.logger.flush(),this.proxy.$update(this.id,3,t)}replace(t){let n=this.offset;this.info(t),this.proxy.$update(this.id,2,n),this.visible&&this.logger.flush()}show(t,n){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof t=="boolean"?t:n))}hide(){this.proxy.$close(this.id)}log(t,n){this.offset+=ee.fromString(n).byteLength,bM(this.logger,t,n),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,1))}},fD=class extends xx{appendLine(e){this.append(e)}},Op=class{constructor(e,t,n,o,i,s){this.initData=t;this.extHostFileSystem=n;this.extHostFileSystemInfo=o;this.loggerService=i;this.logService=s;this.extensionLogDirectoryCreationPromise=new qe;this.logOutputChannels=new qe;this.namePool=1;this.channels=new Map;this.visibleChannelId=null;this.proxy=e.getProxy(N.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${vN(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(let[t,n]of this.channels)n.visible=t===this.visibleChannelId}createOutputChannel(e,t,n){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");let o=typeof t=="object"&&t.log,i=ke(t)?t:void 0;if(ke(i)&&!i.trim())throw new Error("illegal argument `languageId`. must not be empty");let s=new q,a,l=this.initData.environment.extensionLogLevel?.find(([c])=>_e.equals(n.identifier,c))?.[1],d;if(o){let c=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,n.identifier.value);d=this.extHostFileSystemInfo.extUri.joinPath(c,`${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`);let u=this.logOutputChannels.get(d);if(u)return u;let m=this.loggerService.getRegisteredLogger(d);m?.logLevel!==void 0&&(l=m.logLevel),a=this.doCreateLogOutputChannel(e,d,l,n,s)}else a=this.doCreateOutputChannel(e,i,n,s);if(a.then(c=>{this.channels.set(c.id,c),c.visible=c.id===this.visibleChannelId,s.add(J(()=>{this.channels.delete(c.id),d&&this.logOutputChannels.delete(d)}))}),d){let c=this.createExtHostLogOutputChannel(e,l??this.logService.getLevel(),a,s);return this.logOutputChannels.set(d,c),c}return this.createExtHostOutputChannel(e,a,s)}async doCreateOutputChannel(e,t,n,o){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));let i=await this.outputDirectoryPromise,s=this.extHostFileSystemInfo.extUri.joinPath(i,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),a=o.add(this.loggerService.createLogger(s,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0})),l=await this.proxy.$register(e,s,t,n.identifier.value);return o.add(J(()=>this.loggerService.deregisterLogger(s))),new xx(l,e,a,this.proxy,n)}async doCreateLogOutputChannel(e,t,n,o,i){await this.createExtensionLogDirectory(t);let s=`${o.identifier.value}.${this.extHostFileSystemInfo.extUri.basename(t)}`,a=i.add(this.loggerService.createLogger(t,{id:s,name:e,logLevel:n,extensionId:o.identifier.value}));return i.add(J(()=>this.loggerService.deregisterLogger(t))),new fD(s,e,a,this.proxy,o)}createExtensionLogDirectory(e){let t=this.extHostFileSystemInfo.extUri.dirname(e),n=this.extensionLogDirectoryCreationPromise.get(t);return n||this.extensionLogDirectoryCreationPromise.set(t,n=(async()=>{try{await this.extHostFileSystem.value.createDirectory(t)}catch(o){if(Oc(o)!=="EntryExists")throw o}})()),n}createExtHostOutputChannel(e,t,n){let o=()=>{if(n.isDisposed)throw new Error("Channel has been closed")};return t.then(i=>n.add(i)),{get name(){return e},append(i){o(),t.then(s=>s.append(i))},appendLine(i){o(),t.then(s=>s.appendLine(i))},clear(){o(),t.then(i=>i.clear())},replace(i){o(),t.then(s=>s.replace(i))},show(i,s){o(),t.then(a=>a.show(i,s))},hide(){o(),t.then(i=>i.hide())},dispose(){n.dispose()}}}createExtHostLogOutputChannel(e,t,n,o){let i=()=>{if(o.isDisposed)throw new Error("Channel has been closed")},s=o.add(new E);function a(l){t=l,s.fire(l)}return n.then(l=>{l.logLevel!==t&&a(l.logLevel),o.add(l.onDidChangeLogLevel(d=>a(d)))}),{...this.createExtHostOutputChannel(e,n,o),get logLevel(){return t},onDidChangeLogLevel:s.event,trace(l,...d){i(),n.then(c=>c.trace(l,...d))},debug(l,...d){i(),n.then(c=>c.debug(l,...d))},info(l,...d){i(),n.then(c=>c.info(l,...d))},warn(l,...d){i(),n.then(c=>c.warn(l,...d))},error(l,...d){i(),n.then(c=>c.error(l,...d))}}}};Op=D([C(0,ge),C(1,nt),C(2,ll),C(3,lr),C(4,Ho),C(5,ue)],Op);var Sx=M("IExtHostOutputService");var Ni=class{constructor(e,t){this._logService=t;this._provider=new Map;this._proxy=e.getProxy(N.MainThreadDecorations)}static{this._handlePool=0}static{this._maxEventSize=250}registerFileDecorationProvider(e,t){let n=Ni._handlePool++;this._provider.set(n,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(n,t.identifier.value);let o=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(i=>{if(!i){this._proxy.$onDidChange(n,null);return}let s=hn(i);if(s.length<=Ni._maxEventSize){this._proxy.$onDidChange(n,s);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,s.length);let a=s.map(c=>({uri:c,rank:N0(c.path,"/")})),l=k1(a,(c,u)=>c.rank-u.rank||kr(c.uri.path,u.uri.path)),d=[];e:for(let c of l){let u;for(let m of c){let g=li(m.uri.path);if(u!==g&&(u=g,d.push(m.uri)>=Ni._maxEventSize))break e}}this._proxy.$onDidChange(n,d)});return new fe(()=>{o?.dispose(),this._proxy.$unregisterDecorationProvider(n),this._provider.delete(n)})}async $provideDecorations(e,t,n){if(!this._provider.has(e))return Object.create(null);let o=Object.create(null),{provider:i,extensionDescription:s}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{let{uri:l,id:d}=a,c=await Promise.resolve(i.provideFileDecoration(y.revive(l),n));if(!c)return;try{Sd.validate(c),c.badge&&typeof c.badge!="string"&&A(s,"codiconDecoration"),o[d]=[c.propagate,c.tooltip,c.badge,c.color]}catch(u){this._logService.warn(`INVALID decoration from extension '${s.identifier.value}': ${u}`)}}catch(l){this._logService.error(l)}})),o}};Ni=D([C(0,ge),C(1,ue)],Ni);var Cx=M("IExtHostDecorations");var Tx=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,t){e=Ul(e);let n=this.values,o=this.prefixSum,i=t.length;return i===0?!1:(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Ul(e),t=Ul(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Ul(e),t=Ul(t);let n=this.values,o=this.prefixSum;if(e>=n.length)return!1;let i=n.length-e;return t>=i&&(t=i),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Ul(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,o=0,i=0,s=0;for(;t<=n;)if(o=t+(n-t)/2|0,i=this.prefixSum[o],s=i-this.values[o],e<s)n=o-1;else if(e>=i)t=o+1;else break;return new hD(o,e-s)}};var hD=class{constructor(e,t){this.index=e;this.remainder=t;this._prefixSumIndexOfResultBrand=void 0;this.index=e,this.remainder=t}};var Ex=class{constructor(e,t,n,o){this._uri=e,this._lines=t,this._eol=n,this._versionId=o,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);let t=e.changes;for(let n of t)this._acceptDeleteRange(n.range),this._acceptInsertText(new sn(n.range.startLineNumber,n.range.startColumn),n.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){let e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let o=0;o<t;o++)n[o]=this._lines[o].length+e;this._lineStarts=new Tx(n)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(t.length===0)return;let n=Qh(t);if(n.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}n[n.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]);let o=new Uint32Array(n.length-1);for(let i=1;i<n.length;i++)this._lines.splice(e.lineNumber+i-1,0,n[i]),o[i-1]=n[i].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,o)}};var vD=new Map;function PN(r,e){e?vD.set(r,e):vD.delete(r)}function OB(r){return vD.get(r)}var wx=class extends Ex{constructor(t,n,o,i,s,a,l,d,c=!0){super(n,o,i,s);this._proxy=t;this._languageId=a;this._isDirty=l;this._encoding=d;this._strictInstanceofChecks=c;this._isDisposed=!1}dispose(){vn(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(t){return Ht(this._lines,t)}get document(){if(!this._document){let t=this;this._document={get uri(){return t._uri},get fileName(){return t._uri.fsPath},get isUntitled(){return t._uri.scheme===$.untitled},get languageId(){return t._languageId},get version(){return t._versionId},get isClosed(){return t._isDisposed},get isDirty(){return t._isDirty},get encoding(){return t._encoding},save(){return t._save()},getText(n){return n?t._getTextInRange(n):t.getText()},get eol(){return t._eol===`
`?1:2},get lineCount(){return t._lines.length},lineAt(n){return t._lineAt(n)},offsetAt(n){return t._offsetAt(n)},positionAt(n){return t._positionAt(n)},validateRange(n){return t._validateRange(n)},validatePosition(n){return t._validatePosition(n)},getWordRangeAtPosition(n,o){return t._getWordRangeAtPosition(n,o)},[Symbol.for("debug.description")](){return`TextDocument(${t._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(t){vn(!this._isDisposed),this._languageId=t}_acceptIsDirty(t){vn(!this._isDisposed),this._isDirty=t}_acceptEncoding(t){vn(!this._isDisposed),this._encoding=t}_save(){return this._isDisposed?Promise.reject(new Error("Document has been closed")):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(t){let n=this._validateRange(t);if(n.isEmpty)return"";if(n.isSingleLine)return this._lines[n.start.line].substring(n.start.character,n.end.character);let o=this._eol,i=n.start.line,s=n.end.line,a=[];a.push(this._lines[i].substring(n.start.character));for(let l=i+1;l<s;l++)a.push(this._lines[l]);return a.push(this._lines[s].substring(0,n.end.character)),a.join(o)}_lineAt(t){let n;if(t instanceof Ie?n=t.line:typeof t=="number"?n=t:!this._strictInstanceofChecks&&Ie.isPosition(t)&&(n=t.line),typeof n!="number"||n<0||n>=this._lines.length||Math.floor(n)!==n)throw new Error("Illegal value for `line`");return new bD(n,this._lines[n],n===this._lines.length-1)}_offsetAt(t){return t=this._validatePosition(t),this._ensureLineStarts(),this._lineStarts.getPrefixSum(t.line-1)+t.character}_positionAt(t){t=Math.floor(t),t=Math.max(0,t),this._ensureLineStarts();let n=this._lineStarts.getIndexOf(t),o=this._lines[n.index].length;return new Ie(n.index,Math.min(n.remainder,o))}_validateRange(t){if(this._strictInstanceofChecks){if(!(t instanceof pe))throw new Error("Invalid argument")}else if(!pe.isRange(t))throw new Error("Invalid argument");let n=this._validatePosition(t.start),o=this._validatePosition(t.end);return n===t.start&&o===t.end?t:new pe(n.line,n.character,o.line,o.character)}_validatePosition(t){if(this._strictInstanceofChecks){if(!(t instanceof Ie))throw new Error("Invalid argument")}else if(!Ie.isPosition(t))throw new Error("Invalid argument");if(this._lines.length===0)return t.with(0,0);let{line:n,character:o}=t,i=!1;if(n<0)n=0,o=0,i=!0;else if(n>=this._lines.length)n=this._lines.length-1,o=this._lines[n].length,i=!0;else{let s=this._lines[n].length;o<0?(o=0,i=!0):o>s&&(o=s,i=!0)}return i?new Ie(n,o):t}_getWordRangeAtPosition(t,n){let o=this._validatePosition(t);if(!n)n=OB(this._languageId);else if(jh(n))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${n.source}' because it matches the empty string.`);let i=OE(o.character+1,LE(n),this._lines[o.line],0);if(i)return new pe(o.line,i.startColumn-1,o.line,i.endColumn-1)}},bD=class{constructor(e,t,n){this._line=e,this._text=t,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new pe(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new pe(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};var hl=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}},S_e=new hl("id#");var kx=class r{static{this._Keys=new hl("TextEditorDecorationType")}constructor(e,t,n){let o=r._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,o,z_.from(n)),this.value=Object.freeze({key:o,dispose(){e.$removeTextEditorDecorationType(o)}})}},yD=class{constructor(e,t){this._collectedEdits=[];this._setEndOfLine=void 0;this._finalized=!1;this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw new Error("Edit is only valid while callback runs")}replace(e,t){this._throwIfFinalized();let n=null;if(e instanceof Ie)n=new pe(e,e);else if(e instanceof pe)n=e;else throw new Error("Unrecognized location");this._pushEdit(n,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new pe(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof pe)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,n){let o=this._document.validateRange(e);this._collectedEdits.push({range:o,text:t,forceMoveMarkers:n})}setEndOfLine(e){if(this._throwIfFinalized(),e!==1&&e!==2)throw De("endOfLine");this._setEndOfLine=e}},ID=class{constructor(e,t,n,o){this._proxy=e,this._id=t,this._accept(n),this._logService=o;let i=this;this.value={get tabSize(){return i._tabSize},set tabSize(s){i._setTabSize(s)},get indentSize(){return i._indentSize},set indentSize(s){i._setIndentSize(s)},get insertSpaces(){return i._insertSpaces},set insertSpaces(s){i._setInsertSpaces(s)},get cursorStyle(){return i._cursorStyle},set cursorStyle(s){i._setCursorStyle(s)},get lineNumbers(){return i._lineNumbers},set lineNumbers(s){i._setLineNumbers(s)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=Fd.to(e.lineNumbers)}_validateTabSize(e){if(e==="auto")return"auto";if(typeof e=="number"){let t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){let t=this._validateTabSize(e);if(t!==null){if(typeof t=="number"){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError("setTabSize",this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e==="tabSize")return"tabSize";if(typeof e=="number"){let t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){let t=this._validateIndentSize(e);if(t!==null){if(typeof t=="number"){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError("setIndentSize",this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e==="auto"?"auto":e==="false"?!1:!!e}_setInsertSpaces(e){let t=this._validateInsertSpaces(e);if(typeof t=="boolean"){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError("setInsertSpaces",this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError("setCursorStyle",this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError("setLineNumbers",this._proxy.$trySetOptions(this._id,{lineNumbers:Fd.from(e)})))}assign(e){let t={},n=!1;if(typeof e.tabSize<"u"){let o=this._validateTabSize(e.tabSize);o==="auto"?(n=!0,t.tabSize=o):typeof o=="number"&&this._tabSize!==o&&(this._tabSize=o,n=!0,t.tabSize=o)}if(typeof e.indentSize<"u"){let o=this._validateIndentSize(e.indentSize);o==="tabSize"?(n=!0,t.indentSize=o):typeof o=="number"&&this._originalIndentSize!==o&&(this._indentSize=o,this._originalIndentSize=o,n=!0,t.indentSize=o)}if(typeof e.insertSpaces<"u"){let o=this._validateInsertSpaces(e.insertSpaces);o==="auto"?(n=!0,t.insertSpaces=o):this._insertSpaces!==o&&(this._insertSpaces=o,n=!0,t.insertSpaces=o)}typeof e.cursorStyle<"u"&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,n=!0,t.cursorStyle=e.cursorStyle),typeof e.lineNumbers<"u"&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,n=!0,t.lineNumbers=Fd.from(e.lineNumbers)),n&&this._warnOnError("setOptions",this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(n=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(n)})}},_x=class{constructor(e,t,n,o,i,s,a,l){this.id=e;this._proxy=t;this._logService=n;this._disposed=!1;this._hasDecorationsForKey=new Set;this._selections=i,this._options=new ID(this._proxy,this.id,s,n),this._visibleRanges=a,this._viewColumn=l;let d=this;this.value=Object.freeze({get document(){return o.value},set document(c){throw new Cr("document")},get selection(){return d._selections&&d._selections[0]},set selection(c){if(!(c instanceof xn))throw De("selection");d._selections=[c],d._trySetSelection()},get selections(){return d._selections},set selections(c){if(!Array.isArray(c)||c.some(u=>!(u instanceof xn)))throw De("selections");c.length===0&&(c=[new xn(0,0,0,0)]),d._selections=c,d._trySetSelection()},get visibleRanges(){return d._visibleRanges},set visibleRanges(c){throw new Cr("visibleRanges")},get diffInformation(){return d._diffInformation},get options(){return d._options.value},set options(c){d._disposed||d._options.assign(c)},get viewColumn(){return d._viewColumn},set viewColumn(c){throw new Cr("viewColumn")},edit(c,u={undoStopBefore:!0,undoStopAfter:!0}){if(d._disposed)return Promise.reject(new Error("TextEditor#edit not possible on closed editors"));let m=new yD(o.value,u);return c(m),d._applyEdit(m)},insertSnippet(c,u,m={undoStopBefore:!0,undoStopAfter:!0}){if(d._disposed)return Promise.reject(new Error("TextEditor#insertSnippet not possible on closed editors"));let g;if(!u||Array.isArray(u)&&u.length===0)g=d._selections.map(v=>V.from(v));else if(u instanceof Ie){let{lineNumber:v,column:h}=Xe.from(u);g=[{startLineNumber:v,startColumn:h,endLineNumber:v,endColumn:h}]}else if(u instanceof pe)g=[V.from(u)];else{g=[];for(let v of u)if(v instanceof pe)g.push(V.from(v));else{let{lineNumber:h,column:x}=Xe.from(v);g.push({startLineNumber:h,startColumn:x,endLineNumber:h,endColumn:x})}}return m.keepWhitespace===void 0&&(m.keepWhitespace=!1),t.$tryInsertSnippet(e,o.value.version,c.value,g,m)},setDecorations(c,u){let m=u.length===0;m&&!d._hasDecorationsForKey.has(c.key)||(m?d._hasDecorationsForKey.delete(c.key):d._hasDecorationsForKey.add(c.key),d._runOnProxy(()=>{if($_(u))return t.$trySetDecorations(e,c.key,CO(u));{let g=new Array(4*u.length);for(let v=0,h=u.length;v<h;v++){let x=u[v];g[4*v]=x.start.line+1,g[4*v+1]=x.start.character+1,g[4*v+2]=x.end.line+1,g[4*v+3]=x.end.character+1}return t.$trySetDecorationsFast(e,c.key,g)}}))},revealRange(c,u){d._runOnProxy(()=>t.$tryRevealRange(e,V.from(c),u||0))},show(c){t.$tryShowEditor(e,_t.from(c))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){vn(!this._disposed),this._disposed=!0}_acceptOptions(e){vn(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){vn(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){vn(!this._disposed),this._viewColumn=e}_acceptSelections(e){vn(!this._disposed),this._selections=e}_acceptDiffInformation(e){vn(!this._disposed),this._diffInformation=e}async _trySetSelection(){let e=this._selections.map(Qn.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){let t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);let n=t.edits.map(i=>i.range);n.sort((i,s)=>i.end.line===s.end.line?i.end.character===s.end.character?i.start.line===s.start.line?i.start.character-s.start.character:i.start.line-s.start.line:i.end.character-s.end.character:i.end.line-s.end.line);for(let i=0,s=n.length-1;i<s;i++){let a=n[i].end;if(n[i+1].start.isBefore(a))return Promise.reject(new Error("Overlapping ranges are not allowed!"))}let o=t.edits.map(i=>({range:V.from(i.range),text:i.text,forceMoveMarkers:i.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,o,{setEndOfLine:typeof t.setEndOfLine=="number"?Ad.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn("TextEditor is closed/disposed"),Promise.resolve(void 0)):e().then(()=>this,t=>(t instanceof Error&&t.name==="DISPOSED"||this._logService.warn(t),null))}};var xD=class{constructor(e){this.value=e;this._count=0}ref(){this._count++}unref(){return--this._count===0}},Np=class{constructor(e,t){this._extHostRpc=e;this._logService=t;this._activeEditorId=null;this._editors=new Map;this._documents=new qe;this._onDidAddDocuments=new E;this._onDidRemoveDocuments=new E;this._onDidChangeVisibleTextEditors=new E;this._onDidChangeActiveTextEditor=new E;this.onDidAddDocuments=this._onDidAddDocuments.event;this.onDidRemoveDocuments=this._onDidRemoveDocuments.event;this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event;this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){let t=[],n=[],o=[];if(e.removedDocuments)for(let i of e.removedDocuments){let s=y.revive(i),a=this._documents.get(s);a?.unref()&&(this._documents.delete(s),t.push(a.value))}if(e.addedDocuments)for(let i of e.addedDocuments){let s=y.revive(i.uri),a=this._documents.get(s);if(a&&s.scheme!==$.vscodeNotebookCell&&s.scheme!==$.vscodeInteractiveInput)throw new Error(`document '${s} already exists!'`);a||(a=new xD(new wx(this._extHostRpc.getProxy(N.MainThreadDocuments),s,i.lines,i.EOL,i.versionId,i.languageId,i.isDirty,i.encoding)),this._documents.set(s,a),n.push(a.value)),a.ref()}if(e.removedEditors)for(let i of e.removedEditors){let s=this._editors.get(i);this._editors.delete(i),s&&o.push(s)}if(e.addedEditors)for(let i of e.addedEditors){let s=y.revive(i.documentUri);vn(this._documents.has(s),`document '${s}' does not exist`),vn(!this._editors.has(i.id),`editor '${i.id}' already exists!`);let a=this._documents.get(s).value,l=new _x(i.id,this._extHostRpc.getProxy(N.MainThreadTextEditors),this._logService,new dt(()=>a.document),i.selections.map(Qn.to),i.options,i.visibleRanges.map(d=>V.to(d)),typeof i.editorPosition=="number"?_t.to(i.editorPosition):void 0);this._editors.set(i.id,l)}e.newActiveEditor!==void 0&&(vn(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),wn(t),wn(o),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(n),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(i=>i.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return It.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;let t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};Np=D([C(0,ge),C(1,ue)],Np);var Zr=M("IExtHostDocumentsAndEditors");var NB={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:p(17292,null)},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:p(17293,null),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:p(17294,null),default:""}}},DN;(e=>{function r(t,n,o){if(!t)return;let i=ke(t.type)?t.type:void 0;if(!i||i.length===0){o.error(p(17296,null));return}let s=[];if(Array.isArray(t.required))for(let a of t.required)ke(a)&&s.push(a);return{extensionId:n.value,taskType:i,required:s,properties:t.properties?lt(t.properties):{},when:t.when?Tt.deserialize(t.when):void 0}}e.from=r})(DN||={});var UB=kb.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:function*(r){for(let e of r)e.type&&(yield`onTaskType:${e.type}`)},jsonSchema:{description:p(17295,null),type:"array",items:NB}}),SD=class{constructor(){this._onDefinitionsChanged=new E;this.onDefinitionsChanged=this._onDefinitionsChanged.event;this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{UB.setHandler((n,o)=>{this._schema=void 0;try{for(let i of o.removed){let s=i.value;for(let a of s)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(let i of o.added){let s=i.value;for(let a of s){let l=DN.from(a,i.description.identifier,i.collector);l&&(this.taskTypes[l.taskType]=l)}}(o.removed.length>0||o.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){let e=[];for(let t of this.all()){let n={type:"object",additionalProperties:!1};t.required.length>0&&(n.required=t.required.slice(0)),t.properties!==void 0?n.properties=lt(t.properties):n.properties=Object.create(null),n.properties.type={type:"string",enum:[t.taskType]},e.push(n)}this._schema={oneOf:e}}return this._schema}},RN=new SD;var FB={IconContribution:"base.contributions.icons"},HB;(e=>{function r(t,n){let o=t.defaults;for(;vt.isThemeIcon(o);){let i=Up.getIcon(o.id);if(!i)return;o=i.defaults}return o}e.getDefinition=r})(HB||={});var VB;(t=>{function r(n){return{weight:n.weight,style:n.style,src:n.src.map(o=>({format:o.format,location:o.location.toString()}))}}t.toJSONObject=r;function e(n){let o=i=>ke(i)?i:void 0;if(n&&Array.isArray(n.src)&&n.src.every(i=>ke(i.format)&&ke(i.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(i=>({format:i.format,location:y.parse(i.location)}))}}t.fromJSONObject=e})(VB||={});var BB=/^([\w_-]+)$/;var WB=p(2587,null),CD=class extends H{constructor(){super();this._onDidChange=this._register(new E);this.onDidChange=this._onDidChange.event;this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:p(2584,null),pattern:BB.source,patternErrorMessage:WB},fontCharacter:{type:"string",description:p(2583,null)}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}};this.iconReferenceSchema={type:"string",pattern:`^${vt.iconNameExpression}$`,enum:[],enumDescriptions:[]};this.iconsById={},this.iconFontsById={}}registerIcon(t,n,o,i){let s=this.iconsById[t];if(s){if(o&&!s.description){s.description=o,this.iconSchema.properties[t].markdownDescription=`${o} $(${t})`;let d=this.iconReferenceSchema.enum.indexOf(t);d!==-1&&(this.iconReferenceSchema.enumDescriptions[d]=o),this._onDidChange.fire()}return s}let a={id:t,description:o,defaults:n,deprecationMessage:i};this.iconsById[t]=a;let l={$ref:"#/definitions/icons"};return i&&(l.deprecationMessage=i),o&&(l.markdownDescription=`${o}: $(${t})`),this.iconSchema.properties[t]=l,this.iconReferenceSchema.enum.push(t),this.iconReferenceSchema.enumDescriptions.push(o||""),this._onDidChange.fire(),{id:t}}deregisterIcon(t){delete this.iconsById[t],delete this.iconSchema.properties[t];let n=this.iconReferenceSchema.enum.indexOf(t);n!==-1&&(this.iconReferenceSchema.enum.splice(n,1),this.iconReferenceSchema.enumDescriptions.splice(n,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(t=>this.iconsById[t])}getIcon(t){return this.iconsById[t]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(t,n){let o=this.iconFontsById[t];return o||(this.iconFontsById[t]=n,this._onDidChange.fire(),n)}deregisterIconFont(t){delete this.iconFontsById[t]}getIconFont(t){return this.iconFontsById[t]}toString(){let t=(s,a)=>s.id.localeCompare(a.id),n=s=>{for(;vt.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},o=[];o.push("| preview     | identifier                        | default codicon ID                | description"),o.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");let i=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(let s of i.filter(a=>!!a.description).sort(t))o.push(`|<i class="${n(s)}"></i>|${s.id}|${vt.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);o.push("| preview     | identifier                        "),o.push("| ----------- | --------------------------------- |");for(let s of i.filter(a=>!vt.isThemeIcon(a.defaults)).sort(t))o.push(`|<i class="${n(s)}"></i>|${s.id}|`);return o.join(`
`)}},Up=new CD;ot.add(FB.IconContribution,Up);function Gd(r,e,t,n){return Up.registerIcon(r,e,t,n)}function $B(){let r=FM();for(let e in r){let t="\\"+r[e].toString(16);Up.registerIcon(e,{fontCharacter:t})}}$B();var AN="vscode://schemas/icons",LN=ot.as(rd.JSONContribution);LN.registerSchema(AN,Up.getIconSchema());var MN=new Xn(()=>LN.notifySchemaChanged(AN),200);Up.onDidChange(()=>{MN.isScheduled()||MN.schedule()});var gPe=Gd("widget-close",le.close,p(2588,null)),fPe=Gd("goto-previous-location",le.arrowUp,p(2586,null)),hPe=Gd("goto-next-location",le.arrowDown,p(2585,null)),vPe=vt.modify(le.sync,"spin"),bPe=vt.modify(le.loading,"spin");var ON="settings",wPe=new w("taskRunning",!1,p(17299,null)),kPe=new w("taskTerminalActive",!1,p(17301,null)),_Pe=Al(17300,"Tasks"),ED=(n=>(n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak",n))(ED||{});(e=>{function r(t){if(!t)return 2;switch(t.toLowerCase()){case"escape":return 1;case"strong":return 2;case"weak":return 3;default:return 2}}e.from=r})(ED||={});var zB;(e=>e.defaults={cwd:"${workspaceFolder}"})(zB||={});var wD=(n=>(n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never",n))(wD||{});(e=>{function r(t){switch(t.toLowerCase()){case"always":return 1;case"silent":return 2;case"never":return 3;default:return 1}}e.fromString=r})(wD||={});var kD=(n=>(n[n.Never=1]="Never",n[n.OnProblem=2]="OnProblem",n[n.Always=3]="Always",n))(kD||{});(e=>{function r(t){switch(t.toLowerCase()){case"always":return 3;case"never":return 1;case"onproblem":return 2;default:return 2}}e.fromString=r})(kD||={});var _D=(n=>(n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New",n))(_D||{});(e=>{function r(t){switch(t.toLowerCase()){case"shared":return 1;case"dedicated":return 2;case"new":return 3;default:return 1}}e.fromString=r})(_D||={});var KB;(e=>e.defaults={echo:!0,reveal:1,revealProblems:1,focus:!1,panel:1,showReuseMessage:!0,clear:!1,preserveTerminalName:!1})(KB||={});var PD=(n=>(n[n.Shell=1]="Shell",n[n.Process=2]="Process",n[n.CustomExecution=3]="CustomExecution",n))(PD||{});(t=>{function r(n){switch(n.toLowerCase()){case"shell":return 1;case"process":return 2;case"customExecution":return 3;default:return 2}}t.fromString=r;function e(n){switch(n){case 1:return"shell";case 2:return"process";case 3:return"customExecution";default:return"process"}}t.toString=e})(PD||={});var qB;(e=>{function r(t){return ke(t)?t:t.value}e.value=r})(qB||={});var GB;(s=>{s.Clean={_id:"clean",isDefault:!1},s.Build={_id:"build",isDefault:!1},s.Rebuild={_id:"rebuild",isDefault:!1},s.Test={_id:"test",isDefault:!1};function o(a){return a===s.Clean._id||a===s.Build._id||a===s.Rebuild._id||a===s.Test._id}s.is=o;function i(a){if(a!==void 0)return ke(a)?o(a)?{_id:a,isDefault:!1}:void 0:a}s.from=i})(GB||={});var jB;(s=>{s.Workspace="workspace",s.Extension="extension",s.InMemory="inMemory",s.WorkspaceFile="workspaceFile",s.User="user";function i(a){switch(a){case s.User:return 2;case s.WorkspaceFile:return 5;default:return 6}}s.toConfigurationTarget=i})(jB||={});var QB;(e=>e.defaults={reevaluateOnRerun:!0,runOn:1,instanceLimit:1,instancePolicy:"prompt"})(QB||={});var DD=(t=>(t[t.Process=1]="Process",t[t.Terminal=2]="Terminal",t))(DD||{});(e=>e._default=2)(DD||={});var JB;(d=>{function r(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?"background":"singleRun",group:c.configurationProperties.group,__task:c}}function e(c,u,m){return{...r(c),kind:"start",terminalId:u,resolvedVariables:m}}d.start=e;function t(c,u,m){return{...r(c),kind:"processStarted",terminalId:u,processId:m}}d.processStarted=t;function n(c,u,m,g){return{...r(c),kind:"processEnded",terminalId:u,exitCode:m,durationMs:g}}d.processEnded=n;function o(c,u,m){return{...r(c),kind:"inactive",terminalId:u,durationMs:m}}d.inactive=o;function i(c,u,m){return{...r(c),kind:"terminated",exitReason:m,terminalId:u}}d.terminated=i;function s(c,u,m){return{...r(u),kind:c,terminalId:m}}d.general=s;function a(c,u,m){return{...r(c),kind:"problemMatcherEnded",hasErrors:u}}d.problemMatcherEnded=a;function l(){return{kind:"changed"}}d.changed=l})(JB||={});var TD;(t=>{function r(n){let o=Object.keys(n).sort(),i="";for(let s of o){let a=n[s];a instanceof Object?a=r(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),i+=s+","+a+","}return i}function e(n){let i={_key:r(n),type:n.taskType};return Object.assign(i,n),i}t.create=e})(TD||={});var XB;(e=>{function r(t,n){let o=RN.get(t.type);if(o===void 0){let l=lt(t);return delete l._key,TD.create(l)}let i=Object.create(null);i.type=o.taskType;let s=new Set;o.required.forEach(l=>s.add(l));let a=o.properties;for(let l of Object.keys(a)){let d=t[l];if(d!=null)i[l]=d;else if(s.has(l)){let c=a[l];if(c.default!==void 0)i[l]=lt(c.default);else switch(c.type){case"boolean":i[l]=!1;break;case"number":case"integer":i[l]=0;break;case"string":i[l]="";break;default:n.error(p(17298,null,JSON.stringify(t,void 0,0),l));return}}}return TD.create(i)}e.createTaskIdentifier=r})(XB||={});var PPe=Gd("rerun-task",le.refresh,p(17297,null));var RD;(t=>{function r(n){if(n!=null)return n}t.from=r;function e(n){if(n!=null)return n}t.to=e})(RD||={});var MD;(t=>{function r(n){if(n!=null)return n}t.from=r;function e(n){if(n!=null)return n}t.to=e})(MD||={});var NN;(t=>{function r(n){if(n!=null)return n}t.from=r;function e(n){if(n!=null)return n}t.to=e})(NN||={});var Px;(n=>{function r(o){if(o){let i=o;return i&&!!i.process}else return!1}n.is=r;function e(o){if(o==null)return;let i={process:o.process,args:o.args};return o.options&&(i.options=NN.from(o.options)),i}n.from=e;function t(o){if(o!=null)return new Ti(o.process,o.args,o.options)}n.to=t})(Px||={});var UN;(t=>{function r(n){if(n!=null)return n}t.from=r;function e(n){if(n!=null)return n}t.to=e})(UN||={});var Dx;(n=>{function r(o){if(o){let i=o;return i&&(!!i.commandLine||!!i.command)}else return!1}n.is=r;function e(o){if(o==null)return;let i={};return o.commandLine!==void 0?i.commandLine=o.commandLine:(i.command=o.command,i.args=o.args),o.options&&(i.options=UN.from(o.options)),i}n.from=e;function t(o){if(!(o==null||o.command===void 0&&o.commandLine===void 0))return o.commandLine?new zr(o.commandLine,o.options):new zr(o.command,o.args?o.args:[],o.options)}n.to=t})(Dx||={});var vl;(n=>{function r(o){if(o){let i=o;return i&&i.customExecution==="customExecution"}else return!1}n.is=r;function e(o){return{customExecution:"customExecution"}}n.from=e;function t(o,i){return i.get(o)}n.to=t})(vl||={});var YB;(e=>{function r(t,n){let o;return t.scope!==void 0&&typeof t.scope!="number"?o=t.scope.uri:t.scope!==void 0&&typeof t.scope=="number"&&(t.scope===2&&n&&n.workspaceFile?o=n.workspaceFile:o=ON),{id:t._id,workspaceFolder:o}}e.from=r})(YB||={});var FN;(e=>{function r(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}e.from=r})(FN||={});var jd;(n=>{function r(o,i){if(o==null)return[];let s=[];for(let a of o){let l=e(a,i);l&&s.push(l)}return s}n.fromMany=r;function e(o,i){if(o==null)return;let s;o.execution instanceof Ti?s=Px.from(o.execution):o.execution instanceof zr?s=Dx.from(o.execution):o.execution&&o.execution instanceof Id&&(s=vl.from(o.execution));let a=RD.from(o.definition),l;return o.scope?typeof o.scope=="number"?l=o.scope:l=o.scope.uri:l=2,!a||!l?void 0:{_id:o._id,definition:a,name:o.name,source:{extensionId:i.identifier.value,label:o.source,scope:l},execution:s,isBackground:o.isBackground,group:FN.from(o.group),presentationOptions:MD.from(o.presentationOptions),problemMatchers:hn(o.problemMatchers),hasDefinedMatchers:o.hasDefinedMatchers,runOptions:o.runOptions?o.runOptions:{reevaluateOnRerun:!0},detail:o.detail}}n.from=e;async function t(o,i,s){if(o==null)return;let a;Px.is(o.execution)?a=Px.to(o.execution):Dx.is(o.execution)?a=Dx.to(o.execution):vl.is(o.execution)&&(a=vl.to(o._id,s));let l=RD.to(o.definition),d;if(o.source&&(o.source.scope!==void 0?typeof o.source.scope=="number"?d=o.source.scope:d=await i.resolveWorkspaceFolder(y.revive(o.source.scope)):d=2),!l||!d)return;let c=new pn(l,d,o.name,o.source.label,a,o.problemMatchers);return o.isBackground!==void 0&&(c.isBackground=o.isBackground),o.group!==void 0&&(c.group=an.from(o.group._id),c.group&&o.group.isDefault&&(c.group=new an(c.group.id,c.group.label),o.group.isDefault===!0&&(c.group.isDefault=o.group.isDefault))),o.presentationOptions&&(c.presentationOptions=MD.to(o.presentationOptions)),o._id&&(c._id=o._id),o.detail&&(c.detail=o.detail),c}n.to=t})(jd||={});var HN;(t=>{function r(n){return n}t.from=r;function e(n){if(n)return Object.assign(Object.create(null),n)}t.to=e})(HN||={});var Wf=class{constructor(e,t,n){this._id=t;this._task=n;this.#e=e}#e;get task(){return this._task}terminate(){this.#e.terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}get terminal(){return this._terminal}set terminal(e){this._terminal=e}},Bf=class{constructor(e,t,n,o,i,s,a,l){this._onDidExecuteTask=new E;this._onDidTerminateTask=new E;this._onDidTaskProcessStarted=new E;this._onDidTaskProcessEnded=new E;this._onDidStartTaskProblemMatchers=new E;this._onDidEndTaskProblemMatchers=new E;this._proxy=e.getProxy(N.MainThreadTask),this._workspaceProvider=n,this._editorService=o,this._configurationService=i,this._terminalService=s,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=l,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,n){if(!n)return new fe(()=>{});let o=this.nextHandle();return this._handlers.set(o,{type:t,provider:n,extension:e}),this._proxy.$registerTaskProvider(o,t),new fe(()=>{this._handlers.delete(o),this._proxy.$unregisterTaskProvider(o)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(HN.from(e)).then(async t=>{let n=[];for(let o of t){let i=await jd.to(o,this._workspaceProvider,this._providedCustomExecutions2);i&&n.push(i)}return n})}get taskExecutions(){let e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof Wf))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,n){let o=this._providedCustomExecutions2.get(e.id);o&&(this._activeCustomExecutions2.set(e.id,o),this._terminalService.attachPtyToTerminal(t,await o.callback(n))),this._lastStartedTask=e.id;let i=await this.getTaskExecution(e),s=this._terminalService.getTerminalById(t)?.value;i&&(i.terminal=s),this._onDidExecuteTask.fire({execution:i})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;let t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}get onDidStartTaskProblemMatchers(){return this._onDidStartTaskProblemMatchers.event}async $onDidStartTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidStartTaskProblemMatchers.fire({execution:t})}get onDidEndTaskProblemMatchers(){return this._onDidEndTaskProblemMatchers.event}async $onDidEndTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidEndTaskProblemMatchers.fire({execution:t,hasErrors:e.hasErrors})}$provideTasks(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(new Error("no handler found"));let o=[],i=Qt(()=>n.provider.provideTasks(be.None)).then(s=>this.provideTasksInternal(t,o,n,s));return new Promise(s=>{i.then(a=>{Promise.all(o).then(()=>{s(a)})})})}async $resolveTask(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(new Error("no handler found"));if(t.definition.type!==n.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${n.type}].`);let o=await jd.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!o)throw new Error("Unexpected: Task cannot be resolved.");let i=await n.provider.resolveTask(o,be.None);if(!i)return;this.checkDeprecation(i,n);let s=jd.from(i,n.extension);if(!s)throw new Error("Unexpected: Task cannot be resolved.");if(i.definition!==o.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return vl.is(s.execution)&&await this.addCustomExecution(s,i,!0),await this.resolveTaskInternal(s)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,n){let o=await this._proxy.$createTaskId(e);!n&&!this._providedCustomExecutions2.has(o)&&(this._notProvidedCustomExecutions.add(o),this._activeCustomExecutions2.set(o,t.execution)),this._providedCustomExecutions2.set(o,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){let i=this._taskExecutionPromises.get(e);if(!i)throw new Jo("Unexpected: The specified task is missing an execution");return i}let n=this._taskExecutionPromises.get(e.id);if(n)return n;let o;return t?o=Promise.resolve(new Wf(this,e.id,t)):o=jd.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(i=>{if(!i)throw new Jo("Unexpected: Task does not exist.");return new Wf(this,e.id,i)}),this._taskExecutionPromises.set(e.id,o),o.then(i=>(this._taskExecutions.set(e.id,i),i))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));let n=this._notProvidedCustomExecutions.values(),o=n.next();for(;!o.done;)!this._activeCustomExecutions2.has(o.value)&&this._lastStartedTask!==o.value&&(this._providedCustomExecutions2.delete(o.value),this._notProvidedCustomExecutions.delete(o.value)),o=n.next()}};Bf=D([C(0,ge),C(1,nt),C(2,Wn),C(3,Zr),C(4,ao),C(5,Yr),C(6,ue),C(7,Vs)],Bf);var Fp=class extends Bf{constructor(e,t,n,o,i,s,a,l){super(e,t,n,o,i,s,a,l),this.registerTaskSystem($.vscodeRemote,{scheme:$.vscodeRemote,authority:"",platform:bT(0)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");let n=jd.from(t,e);if(n===void 0)throw new Error("Task is not valid");if(vl.is(n.execution))await this.addCustomExecution(n,t,!1);else throw new Pl;let o=await this.getTaskExecution(await this._proxy.$getTaskExecution(n),t);return this._proxy.$executeTask(n).catch(i=>{throw new Error(i)}),o}provideTasksInternal(e,t,n,o){let i=[];if(o)for(let s of o){if(this.checkDeprecation(s,n),!s.definition||!e[s.definition.type]){let l=s.source?s.source:"No task source";this._logService.warn(`The task [${l}, ${s.name}] uses an undefined task type. The task will be ignored in the future.`)}let a=jd.from(s,n.extension);a&&vl.is(a.execution)?(i.push(a),t.push(this.addCustomExecution(a,s,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:i,extension:n.extension}}async resolveTaskInternal(e){if(vl.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,n){}};Fp=D([C(0,ge),C(1,nt),C(2,Wn),C(3,Zr),C(4,ao),C(5,Yr),C(6,ue),C(7,Vs)],Fp);var Rx=M("IExtHostTask");var Mx=class{constructor(){this.pendingRequests=new Map;this.queue=[];this._onError=new E;this._onExit=new E;this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,n,o){let i={command:e};if(t&&Object.keys(t).length>0&&(i.arguments=t),this.internalSend("request",i),typeof o=="number"){let s=setTimeout(()=>{clearTimeout(s);let a=this.pendingRequests.get(i.seq);if(a){this.pendingRequests.delete(i.seq);let l={type:"response",seq:0,request_seq:i.seq,success:!1,command:e,message:p(9074,null,o,e)};a(l)}},o)}return n&&this.pendingRequests.set(i.seq,n),i.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await cn(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{let t=e,n=this.pendingRequests.get(t.request_seq);n&&(this.pendingRequests.delete(t.request_seq),n(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();let e=new Map;this.pendingRequests.forEach((t,n)=>e.set(n,t)),await cn(500),e.forEach((t,n)=>{t({type:"response",seq:0,request_seq:n,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(n)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this._onError.dispose(),this._onExit.dispose(),this.queue=[]}};function VN(r){return r.type&&(r.label||r.program||r.runtime)}var ZB=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function eW(r){return!!(r&&r.match(ZB))}function BN(r){if(typeof r.path=="string"&&!(typeof r.sourceReference=="number"&&r.sourceReference>0)){if(eW(r.path))return y.parse(r.path);if(Ji(r.path))return y.file(r.path)}return r.path}function WN(r){if(typeof r.path=="object"){let e=y.revive(r.path);if(e)return e.scheme===$.file?e.fsPath:e.toString()}return r.path}function $N(r,e){let t=e?BN:WN,n=lt(r);return KN(n,(o,i)=>{o&&i&&(i.path=t(i))}),n}function zN(r,e){let t=e?BN:WN,n=lt(r);return KN(n,(o,i)=>{!o&&i&&(i.path=t(i))}),n}function KN(r,e){switch(r.type){case"event":{let t=r;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break;default:break}break}case"request":{let t=r;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(n=>e(!1,n));break;default:break}break}case"response":{let t=r;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(n=>e(!1,n.source));break;case"loadedSources":t.body.sources.forEach(n=>e(!1,n));break;case"scopes":t.body.scopes.forEach(n=>e(!1,n.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(n=>e(!1,n.source));break;case"setBreakpoints":t.body.breakpoints.forEach(n=>e(!1,n.source));break;case"disassemble":t.body?.instructions.forEach(o=>e(!1,o.location));break;case"locations":e(!1,t.body?.source);break;default:break}break}}}var Bs=M("IExtHostEditorTabs"),Ax=class{constructor(e,t,n){this._activeTabIdGetter=n,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){let e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case 1:return new qa(y.revive(this._dto.input.uri));case 2:return new xs(y.revive(this._dto.input.original),y.revive(this._dto.input.modified));case 3:return new wu(y.revive(this._dto.input.base),y.revive(this._dto.input.input1),y.revive(this._dto.input.input2),y.revive(this._dto.input.result));case 6:return new Ga(y.revive(this._dto.input.uri),this._dto.input.viewType);case 7:return new ku(this._dto.input.viewType);case 4:return new ja(y.revive(this._dto.input.uri),this._dto.input.notebookType);case 5:return new Qa(y.revive(this._dto.input.original),y.revive(this._dto.input.modified),this._dto.input.notebookType);case 8:return new _u;case 9:return new Pu(y.revive(this._dto.input.uri),y.revive(this._dto.input.inputBoxUri));case 10:return new Du;case 11:return new Ru(this._dto.input.diffEditors.map(e=>new xs(y.revive(e.original),y.revive(e.modified))));default:return}}},AD=class{constructor(e,t){this._tabs=[];this._activeTabId="";this._dto=e,this._activeGroupIdGetter=t;for(let n of e.tabs)n.isActive&&(this._activeTabId=n.id),this._tabs.push(new Ax(n,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){let e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return _t.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(n=>n.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(n=>n.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===0){let n=new Ax(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,n),e.tabDto.isActive&&(this._activeTabId=n.tabId),n}else if(e.kind===1){let n=this._tabs.splice(e.index,1)[0];if(!n)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return n.tabId===this._activeTabId&&(this._activeTabId=""),n}else if(e.kind===3){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");let n=this._tabs.splice(e.oldIndex,1)[0];if(!n)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,n),n}let t=this._tabs.find(n=>n.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}},Hp=class{constructor(e){this._onDidChangeTabs=new E;this._onDidChangeTabGroups=new E;this._extHostTabGroups=[];this._proxy=e.getProxy(N.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){let e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(n=>n.apiObject))},get activeTabGroup(){let n=e._activeGroupId;return Tr(e._extHostTabGroups.find(i=>i.groupId===n)?.apiObject)},close:async(n,o)=>{let i=Array.isArray(n)?n:[n];return i.length?tW(i[0])?this._closeGroups(i,o):this._closeTabs(i,o):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){let t=new Set(this._extHostTabGroups.map(d=>d.groupId)),n=new Set(e.map(d=>d.groupId)),o=GC(t,n),i=this._extHostTabGroups.filter(d=>o.removed.includes(d.groupId)).map(d=>d.apiObject),s=[],a=[];this._extHostTabGroups=e.map(d=>{let c=new AD(d,()=>this._activeGroupId);return o.added.includes(c.groupId)?s.push(c.apiObject):a.push(c.apiObject),c});let l=Tr(e.find(d=>d.isActive===!0)?.groupId);l!==void 0&&this._activeGroupId!==l&&(this._activeGroupId=l),this._onDidChangeTabGroups.fire(Object.freeze({opened:s,closed:i,changed:a}))}$acceptTabGroupUpdate(e){let t=this._extHostTabGroups.find(n=>n.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){let t=this._extHostTabGroups.find(o=>o.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");let n=t.acceptTabOperation(e);switch(e.kind){case 0:this._onDidChangeTabs.fire(Object.freeze({opened:[n.apiObject],closed:[],changed:[]}));return;case 1:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[n.apiObject],changed:[]}));return;case 3:case 2:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[n.apiObject]}));return}}_findExtHostTabFromApi(e){for(let t of this._extHostTabGroups)for(let n of t.tabs)if(n.apiObject===e)return n}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){let n=[];for(let o of e){let i=this._findExtHostTabFromApi(o);if(!i)throw new Error("Tab close: Invalid tab not found!");n.push(i.tabId)}return this._proxy.$closeTab(n,t)}async _closeGroups(e,t){let n=[];for(let o of e){let i=this._findExtHostTabGroupFromApi(o);if(!i)throw new Error("Group close: Invalid group not found!");n.push(i.groupId)}return this._proxy.$closeGroup(n,t)}};Hp=D([C(0,ge)],Hp);function tW(r){return r.tabs!==void 0}var $De={6:p(18564,null),4:p(18565,null),3:p(18566,null),1:p(18567,null),2:p(18568,null),5:p(18569,null),0:p(18570,null)};var zDe={4:p(18561,null),2:p(18562,null),8:p(18560,null)};var oW=0,qN=new WeakMap,Qd=M("IExtHostTesting"),Vp=class extends H{constructor(t,n,o,i){super();this.logService=n;this.commands=o;this.editors=i;this.resultsChangedEmitter=this._register(new E);this.controllers=new Map;this.defaultProfilesChangedEmitter=this._register(new E);this.followupProviders=new Set;this.testFollowups=new Map;this.onResultsChanged=this.resultsChangedEmitter.event;this.results=[];this.proxy=t.getProxy(N.MainThreadTesting),this.observer=new FD(this.proxy),this.runTracker=new OD(this.proxy,n),o.registerArgumentProcessor({processArgument:s=>{switch(s?.$mid){case 16:{let a=s,l=a.tests[a.tests.length-1].item.extId;return this.controllers.get(ze.root(l))?.collection.tree.get(l)?.actual??WP(s)}case 18:{let{test:a,message:l}=s,d=a.item.extId;return{test:this.controllers.get(ze.root(d))?.collection.tree.get(d)?.actual??WP({$mid:16,tests:[a]}),message:Gu.to(l)}}default:return s}}}),o.registerCommand(!1,"testing.getExplorerSelection",async()=>{let s=await o.executeCommand("_testing.getExplorerSelection"),a=l=>{let d=this.controllers.get(ze.root(l));if(d)return ze.isRoot(l)?d.controller:d.collection.tree.get(l)?.actual};return{include:s?.include.map(a).filter(Kn)||[],exclude:s?.exclude.map(a).filter(Kn)||[]}})}createTestController(t,n,o,i){if(this.controllers.has(n))throw new Error(`Attempt to insert a duplicate controller with ID "${n}"`);let s=new q,a=s.add(new dx(n,o,this.editors));a.root.label=o;let l=new Map,d=new Set,c=this.proxy,u=()=>{let v=0;i&&(v|=2);let h=g.relatedCodeProvider;return h&&(h?.provideRelatedTests&&(v|=8),h?.provideRelatedCode&&(v|=4)),v},m={items:a.root.children,get label(){return o},set label(v){o=v,a.root.label=v,c.$updateController(n,{label:o})},get refreshHandler(){return i},set refreshHandler(v){i=v,c.$updateController(n,{capabilities:u()})},get id(){return n},get relatedCodeProvider(){return g.relatedCodeProvider},set relatedCodeProvider(v){A(t,"testRelatedCode"),g.relatedCodeProvider=v,c.$updateController(n,{capabilities:u()})},createRunProfile:(v,h,x,S,T,P)=>{let L=Rr(v);for(;l.has(L);)L++;return new Ox(this.proxy,l,d,this.defaultProfilesChangedEmitter.event,n,L,v,h,x,S,T,P)},createTestItem(v,h,x){return new Hs(n,v,h,x)},createTestRun:(v,h,x=!0)=>this.runTracker.createTestRun(t,n,a,v,h,x),invalidateTestResults:v=>{if(v===void 0)this.proxy.$markTestRetired(void 0);else{let h=v instanceof Array?v:[v];this.proxy.$markTestRetired(h.map(x=>ze.fromExtHostTestItem(x,n).toString()))}},set resolveHandler(v){a.resolveHandler=v},get resolveHandler(){return a.resolveHandler},dispose:()=>{s.dispose()}},g={controller:m,collection:a,profiles:l,extension:t,activeProfiles:d};return c.$registerTestController(n,o,u()),s.add(J(()=>c.$unregisterTestController(n))),this.controllers.set(n,g),s.add(J(()=>this.controllers.delete(n))),s.add(a.onDidGenerateDiff(v=>c.$publishDiff(n,v.map(Gb.serialize)))),m}createTestObserver(){return this.observer.checkout()}async runTests(t,n=be.None){let o=GN(t);if(!o)throw new Error("The request passed to `vscode.test.runTests` must include a profile");let i=this.controllers.get(o.controllerId);if(!i)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:t.preserveFocus??!0,group:ju.from(o.kind),targets:[{testIds:t.include?.map(s=>ze.fromExtHostTestItem(s,i.collection.root.id).toString())??[i.collection.root.id],profileId:o.profileId,controllerId:o.controllerId}],exclude:t.exclude?.map(s=>s.id)},n)}registerTestFollowupProvider(t){return this.followupProviders.add(t),{dispose:()=>{this.followupProviders.delete(t)}}}async $getTestsRelatedToCode(t,n,o){let i=this.editors.getDocument(y.revive(t));if(!i)return[];let s=Xe.to(n),a=[];return await Promise.all([...this.controllers.values()].map(async l=>{let d;try{d=await l.relatedCodeProvider?.provideRelatedTests?.(i.document,s,o)}catch(c){o.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${l.controller.label}`,c)}if(d){for(let c of d)a.push(ze.fromExtHostTestItem(c,l.controller.id).toString());l.collection.flushDiff()}})),a}async $getCodeRelatedToTest(t,n){let o=this.controllers.get(ze.root(t));if(!o)return[];let i=o.collection.tree.get(t);return i?(await o.relatedCodeProvider?.provideRelatedCode?.(i.actual,n))?.map(Vn.from)??[]:[]}$syncTests(){for(let{collection:t}of this.controllers.values())t.flushDiff();return Promise.resolve()}async $getCoverageDetails(t,n,o){return(await this.runTracker.getCoverageDetails(t,n,o))?.map(yf.fromDetails)}async $disposeRun(t){this.runTracker.disposeTestRun(t)}$configureRunProfile(t,n){this.controllers.get(t)?.profiles.get(n)?.configureHandler?.()}$setDefaultRunProfiles(t){let n=new Map;for(let[o,i]of Object.entries(t)){let s=this.controllers.get(o);if(!s)continue;let a=new Map,l=i.filter(c=>!s.activeProfiles.has(c)),d=[...s.activeProfiles].filter(c=>!i.includes(c));for(let c of l)a.set(c,!0),s.activeProfiles.add(c);for(let c of d)a.set(c,!1),s.activeProfiles.delete(c);a.size&&n.set(o,a)}this.defaultProfilesChangedEmitter.fire(n)}async $refreshTests(t,n){await this.controllers.get(t)?.controller.refreshHandler?.(n)}$publishTestResults(t){this.results=Object.freeze(t.map(n=>{let o=sP.to(n),i=n.tasks.findIndex(s=>s.hasCoverage);return i!==-1&&(o.getDetailedCoverage=(s,a=be.None)=>this.proxy.$getCoverageDetails(n.id,i,s,a).then(l=>l.map(yf.to))),qN.set(o,n.id),o}).concat(this.results).sort((n,o)=>o.completedAt-n.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(t,n){let o=this.controllers.get(ze.fromString(t).controllerId)?.collection;o&&(await o.expand(t,n<0?1/0:n),o.flushDiff())}$acceptDiff(t){this.observer.applyDiff(t.map(n=>Gb.deserialize({asCanonicalUri:o=>o},n)))}async $runControllerTests(t,n){return Promise.all(t.map(o=>this.runControllerTestRequest(o,!1,n)))}async $startContinuousRun(t,n){let o=new Re(n),i=await Promise.all(t.map(s=>this.runControllerTestRequest(s,!0,o.token)));return!n.isCancellationRequested&&!i.some(s=>s.error)&&await new Promise(s=>n.onCancellationRequested(s)),o.dispose(!0),i}async $provideTestFollowups(t,n){let o=this.results.find(a=>qN.get(a)===t.resultId),i=o&&iW(ze.fromString(t.extId),o?.results);if(!i)return[];let s=[];return await Promise.all([...this.followupProviders].map(async a=>{try{let l=await a.provideFollowup(o,i,t.taskIndex,t.messageIndex,n);l&&(s=s.concat(l))}catch(l){this.logService.error("Error thrown while providing followup for test message",l)}})),n.isCancellationRequested?[]:s.map(a=>{let l=oW++;return this.testFollowups.set(l,a),{title:a.title,id:l}})}$disposeTestFollowups(t){for(let n of t)this.testFollowups.delete(n)}$executeTestFollowup(t){let n=this.testFollowups.get(t);return n?this.commands.executeCommand(n.command,...n.arguments||[]):Promise.resolve()}$cancelExtensionTestRun(t,n){t===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(t,n)}getMetadataForRun(t){for(let n of this.runTracker.trackers){let o=n.getTaskIdForRun(t);if(o)return{taskId:o,runId:n.id}}}async runControllerTestRequest(t,n,o){let i=this.controllers.get(t.controllerId);if(!i)return{};let{collection:s,profiles:a,extension:l}=i,d=a.get(t.profileId);if(!d)return{};let c=t.testIds.map(v=>s.tree.get(v)).filter(Kn),u=t.excludeExtIds.map(v=>i.collection.tree.get(v)).filter(Kn).filter(v=>c.some(h=>h.fullId.compare(v.fullId)===2));if(!c.length)return{};let m=new Va(c.some(v=>v.actual instanceof hp)?void 0:c.map(v=>v.actual),u.map(v=>v.actual),d,n),g=dO(t)&&this.runTracker.prepareForMainThreadTestRun(l,m,Lx.fromInternal(t,i.collection),d,o);try{return await d.runHandler(m,o),{}}catch(v){return{error:String(v)}}finally{g&&g.hasRunningTasks&&!o.isCancellationRequested&&await Me.toPromise(g.onEnd)}}};Vp=D([C(0,ge),C(1,ue),C(2,Ro),C(3,Zr)],Vp);var rW=1e4;var LD=class extends H{constructor(t,n,o,i,s,a){super();this.dto=t;this.proxy=n;this.logService=o;this.profile=i;this.extension=s;this.state=0;this.running=0;this.tasks=new Map;this.sharedTestIds=new Set;this.endEmitter=this._register(new E);this.publishedCoverage=new Map;this.onEnd=this.endEmitter.event;this.cts=this._register(new Re(a));let l=this._register(new Xn(()=>this.forciblyEndTasks(),rW));this._register(this.cts.token.onCancellationRequested(()=>l.schedule()));let d=new E;this.onDidDispose=d.event,this._register(J(()=>{d.fire(),d.dispose()}))}get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}getTaskIdForRun(t){for(let[n,{run:o}]of this.tasks)if(o===t)return n}cancel(t){t?this.tasks.get(t)?.cts.cancel():this.state===0?(this.cts.cancel(),this.state=1):this.state===1&&this.forciblyEndTasks()}async getCoverageDetails(t,n,o){let[,i]=ze.fromString(t).path,s=this.publishedCoverage.get(t);if(!s)return[];let{report:a,extIds:l}=s,d=this.tasks.get(i);if(!d)throw new Error("unreachable: run task was not found");let c;if(n&&a instanceof Is){let m=l.indexOf(n);if(m===-1)return[];c=a.includesTests[m]}return await(c?this.profile?.loadDetailedCoverageForTest?.(d.run,a,c,o):this.profile?.loadDetailedCoverage?.(d.run,a,o))??[]}createRun(t){let n=this.dto.id,o=this.dto.controllerId,i=pt(),s=u=>(m,...g)=>{if(l){this.logService.warn(`Setting the state of test "${m.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(m),u(m,...g)},a=(u,m)=>{let g=m instanceof Array?m.map(Gu.from):[Gu.from(m)];if(u.uri&&u.range){let v={range:V.from(u.range),uri:u.uri};for(let h of g)h.location=h.location||v}this.proxy.$appendTestMessagesInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),g)},l=!1,d=this._register(new Re(this.cts.token)),c={isPersisted:this.dto.isPersisted,token:d.token,name:t,onDidDispose:this.onDidDispose,addCoverage:u=>{if(l)return;let m=u instanceof Is?u.includesTests:[];if(m.length)for(let h of m)this.ensureTestIsKnown(h);let g=u.uri.toString(),v=new ze([n,i,g]).toString();this.publishedCoverage.set(v,{report:u,extIds:m.map(h=>ze.fromExtHostTestItem(h,o).toString())}),this.proxy.$appendCoverage(n,i,yf.fromFile(o,v,u))},enqueued:s(u=>{this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),1)}),skipped:s(u=>{this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),5)}),started:s(u=>{this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),2)}),errored:s((u,m,g)=>{a(u,m),this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),6,g)}),failed:s((u,m,g)=>{a(u,m),this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,o).toString(),4,g)}),passed:s((u,m)=>{this.proxy.$updateTestStateInRun(n,i,ze.fromExtHostTestItem(u,this.dto.controllerId).toString(),3,m)}),appendOutput:(u,m,g)=>{l||(g&&this.ensureTestIsKnown(g),this.proxy.$appendOutputToRun(n,i,ee.fromString(u),m&&Vn.from(m),g&&ze.fromExtHostTestItem(g,o).toString()))},end:()=>{l||(l=!0,this.proxy.$finishedTestRunTask(n,i),--this.running||this.markEnded())}};return this.running++,this.tasks.set(i,{run:c,cts:d}),this.proxy.$startedTestRunTask(n,{id:i,ctrlId:this.dto.controllerId,name:t||this.extension.displayName||this.extension.identifier.value,running:!0}),c}forciblyEndTasks(){for(let{run:t}of this.tasks.values())t.end()}markEnded(){this.state!==2&&(this.state=2,this.endEmitter.fire())}ensureTestIsKnown(t){if(!(t instanceof Hs))throw new Ca(t.id);if(this.sharedTestIds.has(ze.fromExtHostTestItem(t,this.dto.controllerId).toString()))return;let n=[],o=this.dto.colllection.root;for(;;){let i=Oi.from(t);if(n.unshift(i),this.sharedTestIds.has(i.extId)||(this.sharedTestIds.add(i.extId),t===o))break;t=t.parent||o}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,n)}dispose(){this.markEnded(),super.dispose()}},OD=class{constructor(e,t){this.proxy=e;this.logService=t;this.tracked=new Map;this.trackedById=new Map}get trackers(){return this.tracked.values()}getCoverageDetails(e,t,n){let o=ze.root(e);return this.trackedById.get(o)?.getCoverageDetails(e,t,n)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(let[t,{id:n}]of this.tracked)n===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,n,o,i){return this.getTracker(t,n,o,e,i)}cancelRunById(e,t){this.trackedById.get(e)?.cancel(t)}cancelAllRuns(){for(let e of this.tracked.values())e.cancel()}createTestRun(e,t,n,o,i,s){let a=this.tracked.get(o);if(a)return a.createRun(i);let l=Lx.fromPublic(t,n,o,s),d=GN(o);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!o.continuous,profile:d&&{group:ju.from(d.kind),id:d.profileId},exclude:o.exclude?.map(u=>ze.fromExtHostTestItem(u,n.root.id).toString())??[],id:l.id,include:o.include?.map(u=>ze.fromExtHostTestItem(u,n.root.id).toString())??[n.root.id],preserveFocus:o.preserveFocus??!0,persist:s});let c=this.getTracker(o,l,o.profile,e);return Me.once(c.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(l.id)}),c.createRun(i)}getTracker(e,t,n,o,i){let s=new LD(t,this.proxy,this.logService,n,o,i);return this.tracked.set(e,s),this.trackedById.set(s.id,s),s}},GN=r=>{if(r.profile){if(!(r.profile instanceof Ox))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return r.profile}},Lx=class r{constructor(e,t,n,o){this.controllerId=e;this.id=t;this.isPersisted=n;this.colllection=o}static fromPublic(e,t,n,o){return new r(e,pt(),o,t)}static fromInternal(e,t){return new r(e.controllerId,e.runId,!0,t)}},ND=class{constructor(e){this.emitter=e;this.added=new Set;this.updated=new Set;this.removed=new Set;this.alreadyRemoved=new Set}get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}add(e){this.added.add(e)}update(e){Object.assign(e.revived,Oi.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.delete(e))return;this.updated.delete(e);let t=ze.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){let{added:e,updated:t,removed:n}=this;return{get added(){return[...e].map(o=>o.revived)},get updated(){return[...t].map(o=>o.revived)},get removed(){return[...n].map(o=>o.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}},UD=class extends zb{constructor(){super(...arguments);this.changeEmitter=new E;this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(t){return this.items.get(t)}getMirroredTestDataByReference(t){return this.items.get(t.id)}createItem(t,n){return{...t,revived:Oi.toPlain(t.item),depth:n?n.depth+1:0,children:new Set}}createChangeCollector(){return new ND(this.changeEmitter)}},FD=class{constructor(e){this.proxy=e}checkout(){this.current||(this.current=this.createObserverData());let e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(t=>t.revived)},dispose:fc(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){let e=new UD({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}},$f=(r,e,t,n)=>{t?Object.assign(t,n):e.$updateTestRunConfig(r.controllerId,r.profileId,n)},Ox=class extends Su{constructor(t,n,o,i,s,a,l,d,c,u=!1,m=void 0,g=!1){super(s,a,d);this._label=l;this.runHandler=c;this._tag=m;this._supportsContinuousRun=g;this.#e=t,this.#s=n,this.#t=o,this.#n=i,n.set(a,this);let v=ju.from(d);u&&o.add(a),this.#o={profileId:a,controllerId:s,tag:m?yr.namespace(this.controllerId,m.id):null,label:l,group:v,isDefault:u,hasConfigurationHandler:!1,supportsContinuousRun:g},queueMicrotask(()=>{this.#o&&(this.#e.$publishTestRunProfile(this.#o),this.#o=void 0)})}#e;#t;#n;#o;#s;get label(){return this._label}set label(t){t!==this._label&&(this._label=t,$f(this,this.#e,this.#o,{label:t}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(t){t!==this._supportsContinuousRun&&(this._supportsContinuousRun=t,$f(this,this.#e,this.#o,{supportsContinuousRun:t}))}get isDefault(){return this.#t.has(this.profileId)}set isDefault(t){t!==this.isDefault&&(t?this.#t.add(this.profileId):this.#t.delete(this.profileId),$f(this,this.#e,this.#o,{isDefault:t}))}get tag(){return this._tag}set tag(t){t?.id!==this._tag?.id&&(this._tag=t,$f(this,this.#e,this.#o,{tag:t?yr.namespace(this.controllerId,t.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(t){t!==this._configureHandler&&(this._configureHandler=t,$f(this,this.#e,this.#o,{hasConfigurationHandler:!!t}))}get onDidChangeDefault(){return Me.chain(this.#n,t=>t.map(n=>n.get(this.controllerId)?.get(this.profileId)).filter(Kn))}dispose(){this.#s?.delete(this.profileId)&&(this.#s=void 0,this.#e.$removeTestProfile(this.controllerId,this.profileId)),this.#o=void 0}};function iW(r,e){for(let t=0;t<r.path.length;t++){let n=e.find(o=>o.id===r.path[t]);if(!n)return;if(t===r.path.length-1)return n;e=n.children}}var $Re=M("configurationResolverService"),HD=(B=>(B.Unknown="unknown",B.Env="env",B.Config="config",B.Command="command",B.Input="input",B.ExtensionInstallFolder="extensionInstallFolder",B.WorkspaceFolder="workspaceFolder",B.Cwd="cwd",B.WorkspaceFolderBasename="workspaceFolderBasename",B.UserHome="userHome",B.LineNumber="lineNumber",B.ColumnNumber="columnNumber",B.SelectedText="selectedText",B.File="file",B.FileWorkspaceFolder="fileWorkspaceFolder",B.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",B.RelativeFile="relativeFile",B.RelativeFileDirname="relativeFileDirname",B.FileDirname="fileDirname",B.FileExtname="fileExtname",B.FileBasename="fileBasename",B.FileBasenameNoExtension="fileBasenameNoExtension",B.FileDirnameBasename="fileDirnameBasename",B.ExecPath="execPath",B.ExecInstallFolder="execInstallFolder",B.PathSeparator="pathSeparator",B.PathSeparatorAlias="/",B))(HD||{}),jN=Object.values(HD).filter(r=>typeof r=="string"),$n=class extends Jo{constructor(t,n){super(n);this.variable=t}};var zf=class r{constructor(e){this.locations=new Map;this.newReplacementNotifiers=new Set;typeof e=="string"?(this.stringRoot=!0,this.root={value:e}):(this.stringRoot=!1,this.root=structuredClone(e))}static{this.VARIABLE_LHS="${"}static parse(e){if(e instanceof r)return e;let t=new r(e);return t.applyPlatformSpecificKeys(),t.parseObject(t.root),t}applyPlatformSpecificKeys(){let e=this.root,t=Ct?"windows":en?"osx":An?"linux":void 0;t&&e&&typeof e=="object"&&e.hasOwnProperty(t)&&Object.keys(e[t]).forEach(n=>e[n]=e[t][n]),delete e.windows,delete e.osx,delete e.linux}parseVariable(e,t){if(e[t]!=="$"||e[t+1]!=="{")return;let n=t+2,o=1;for(;n<e.length;){if(e[n]==="{")o++;else if(e[n]==="}"&&(o--,o===0))break;n++}if(o!==0)return;let i=e.slice(t,n+1),s=e.substring(t+2,n),a=s.indexOf(":");return a===-1?{replacement:{id:i,name:s,inner:s},end:n}:{replacement:{id:i,inner:s,name:s.slice(0,a),arg:s.slice(a+1)},end:n}}parseObject(e){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){for(let t=0;t<e.length;t++){let n=e[t];typeof n=="string"?this.parseString(e,t,n):this.parseObject(n)}return}for(let[t,n]of Object.entries(e))this.parseString(e,t,t,!0),typeof n=="string"?this.parseString(e,t,n):this.parseObject(n)}}parseString(e,t,n,o,i){let s=0;for(;s<n.length;){let a=n.indexOf("${",s);if(a===-1)break;let l=this.parseVariable(n,a);if(l){if(s=l.end+1,i?.includes(l.replacement.id))continue;let d=this.locations.get(l.replacement.id)||{locations:[],replacement:l.replacement},c={object:e,propertyName:t,replaceKeyName:o};d.locations.push(c),this.locations.set(l.replacement.id,d),d.resolved?this._resolveAtLocation(l.replacement,c,d.resolved,i):this.newReplacementNotifiers.forEach(u=>u(l.replacement))}else s=a+2}}*unresolved(){let e=new Map,t=n=>{e.set(n.id,n)};for(let n of this.locations.values())n.resolved===void 0&&e.set(n.replacement.id,n.replacement);for(this.newReplacementNotifiers.add(t);;){let n=It.first(e);if(!n)break;let[o,i]=n;yield i,e.delete(o)}this.newReplacementNotifiers.delete(t)}resolved(){return It.map(It.filter(this.locations.values(),e=>!!e.resolved),e=>[e.replacement,e.resolved])}resolve(e,t){typeof t!="object"&&(t={value:String(t)});let n=this.locations.get(e.id);if(n&&(n.resolved=t,t.value!==void 0))for(let o of n.locations||It.empty())this._resolveAtLocation(e,o,t)}_resolveAtLocation(e,{replaceKeyName:t,propertyName:n,object:o},i,s=[]){if(i.value!==void 0){if(s.push(e.id),t&&typeof n=="string"){let a=o[n],l=n.replaceAll(e.id,i.value);delete o[n],o[l]=a,this._renameKeyInLocations(o,n,l),this.parseString(o,l,i.value,!0,s)}else o[n]=o[n].replaceAll(e.id,i.value),this.parseString(o,n,i.value,!1,s);s.pop()}}_renameKeyInLocations(e,t,n){for(let o of this.locations.values())for(let i of o.locations)i.object===e&&i.propertyName===t&&(i.propertyName=n)}toObject(){return this.stringRoot?this.root.value:this.root}};var Nx=class{constructor(e,t,n,o){this._contributedVariables=new Map;this.resolvableVariables=new Set(jN);this._context=e,this._labelService=t,this._userHomePromise=n,o&&(this._envVariablesPromise=o.then(i=>this.prepareEnv(i)))}prepareEnv(e){if(Ct){let t=Object.create(null);return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t}return e}async resolveWithEnvironment(e,t,n){let o=zf.parse(n);for(let i of o.unresolved()){let s=await this.evaluateSingleVariable(i,t?.uri,e);s!==void 0&&o.resolve(i,String(s))}return o.toObject()}async resolveAsync(e,t){let n=zf.parse(t);for(let o of n.unresolved()){let i=await this.evaluateSingleVariable(o,e?.uri);i!==void 0&&n.resolve(o,String(i))}return n.toObject()}resolveWithInteractionReplace(e,t){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(e,t){if(this._contributedVariables.has(e))throw new Error("Variable "+e+" is contributed twice.");this.resolvableVariables.add(e),this._contributedVariables.set(e,t)}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,n,o){let i={env:n!==void 0?this.prepareEnv(n):await this._envVariablesPromise,userHome:n!==void 0?void 0:await this._userHomePromise},{name:s,arg:a}=e,l=u=>{let m=this._context.getFilePath();if(m)return Kc(m);throw new $n(u,p(19957,null,e.id))},d=u=>{let m=l(u);if(this._context.getWorkspaceFolderPathForFile){let g=this._context.getWorkspaceFolderPathForFile();if(g)return Kc(g)}throw new $n(u,p(19958,null,e.id,dn(m)))},c=u=>{if(a){let m=this._context.getFolderUri(a);if(m)return m;throw new $n(u,p(19955,null,u,a))}if(t)return t;throw this._context.getWorkspaceFolderCount()>1?new $n(u,p(19963,null,u)):new $n(u,p(19962,null,u))};switch(s){case"env":if(a){if(i.env){let u=i.env[Ct?a.toLowerCase():a];if(ke(u))return u}return""}throw new $n("env",p(19968,null,e.id));case"config":if(a){let u=this._context.getConfigurationValue(t,a);if(wt(u))throw new $n("config",p(19965,null,e.id,a));if(ut(u))throw new $n("config",p(19964,null,e.id,a));return u}throw new $n("config",p(19967,null,e.id));case"command":return this.resolveFromMap("command",e.id,a,o,"command");case"input":return this.resolveFromMap("input",e.id,a,o,"input");case"extensionInstallFolder":if(a){let u=await this._context.getExtension(a);if(!u)throw new $n("extensionInstallFolder",p(19966,null,e.id,a));return this.fsPath(u.extensionLocation)}throw new $n("extensionInstallFolder",p(19969,null,e.id));default:switch(s){case"workspaceRoot":case"workspaceFolder":{let u=c("workspaceFolder");return u?Kc(this.fsPath(u)):void 0}case"cwd":{if(!t&&!a)return Gi();let u=c("cwd");return u?Kc(this.fsPath(u)):void 0}case"workspaceRootFolderName":case"workspaceFolderBasename":{let u=c("workspaceFolderBasename");return u?Kc(dn(this.fsPath(u))):void 0}case"userHome":if(i.userHome)return i.userHome;throw new $n("userHome",p(19961,null,e.id));case"lineNumber":{let u=this._context.getLineNumber();if(u)return u;throw new $n("lineNumber",p(19959,null,e.id))}case"columnNumber":{let u=this._context.getColumnNumber();if(u)return u;throw new Error(p(19956,null,e.id))}case"selectedText":{let u=this._context.getSelectedText();if(u)return u;throw new $n("selectedText",p(19960,null,e.id))}case"file":return l("file");case"fileWorkspaceFolder":return d("fileWorkspaceFolder");case"fileWorkspaceFolderBasename":return dn(d("fileWorkspaceFolderBasename"));case"relativeFile":return t||a?Xi(this.fsPath(c("relativeFile")),l("relativeFile")):l("relativeFile");case"relativeFileDirname":{let u=li(l("relativeFileDirname"));if(t||a){let m=Xi(this.fsPath(c("relativeFileDirname")),u);return m.length===0?".":m}return u}case"fileDirname":return li(l("fileDirname"));case"fileExtname":return Yi(l("fileExtname"));case"fileBasename":return dn(l("fileBasename"));case"fileBasenameNoExtension":{let u=dn(l("fileBasenameNoExtension"));return u.slice(0,u.length-Yi(u).length)}case"fileDirnameBasename":return dn(li(l("fileDirnameBasename")));case"execPath":{let u=this._context.getExecPath();return u||e.id}case"execInstallFolder":{let u=this._context.getAppRoot();return u||e.id}case"pathSeparator":case"/":return kn;default:try{return this.resolveFromMap("unknown",e.id,a,o,void 0)}catch{return e.id}}}}resolveFromMap(e,t,n,o,i){if(n&&o){let s=i===void 0?o[n]:o[i+":"+n];if(typeof s=="string")return s;throw new $n(e,p(19970,null,t))}return t}};var Jd=M("IExtHostVariableResolverProvider"),VD=class extends Nx{constructor(e,t,n,o,i,s,a){function l(){if(n){let d=n.activeEditor();if(d)return d.document.uri;let c=o.tabGroups.all.find(u=>u.isActive)?.activeTab;if(c!==void 0){if(c.input instanceof xs||c.input instanceof Qa)return c.input.modified;if(c.input instanceof qa||c.input instanceof ja||c.input instanceof Ga)return c.input.uri}}}super({getFolderUri:d=>{let c=s.folders.filter(u=>u.name===d);if(c&&c.length>0)return c[0].uri},getWorkspaceFolderCount:()=>s.folders.length,getConfigurationValue:(d,c)=>i.getConfiguration(void 0,d).get(c),getAppRoot:()=>Gi(),getExecPath:()=>Er.VSCODE_EXEC_PATH,getFilePath:()=>{let d=l();if(d)return tr(d.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){let d=l();if(d){let c=t.getWorkspaceFolder(d);if(c)return tr(c.uri.fsPath)}}},getSelectedText:()=>{if(n){let d=n.activeEditor();if(d&&!d.selection.isEmpty)return d.document.getText(d.selection)}},getLineNumber:()=>{if(n){let d=n.activeEditor();if(d)return String(d.selection.end.line+1)}},getColumnNumber:()=>{if(n){let d=n.activeEditor();if(d)return String(d.selection.end.character+1)}},getExtension:d=>e.getExtension(d)},void 0,a?Promise.resolve(a):void 0,Promise.resolve(Er))}},Bp=class extends H{constructor(t,n,o,i,s){super();this.extensionService=t;this.workspaceService=n;this.editorService=o;this.configurationService=i;this.editorTabs=s;this._resolver=new dt(async()=>{let t=await this.configurationService.getConfigProvider(),o={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async i=>{o.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new VD(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,t,o,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};Bp=D([C(0,Mo),C(1,Wn),C(2,Zr),C(3,ao),C(4,Bs)],Bp);var Ux=M("IExtHostDebugService"),Kf=class extends H{constructor(t,n,o,i,s,a,l,d){super();this._workspaceService=n;this._extensionService=o;this._configurationService=i;this._editorTabs=s;this._variableResolver=a;this._commands=l;this._testing=d;this._debugSessions=new Map;this._debugVisualizationTreeItemIdsCounter=0;this._debugVisualizationProviders=new Map;this._debugVisualizationTrees=new Map;this._debugVisualizationTreeItemIds=new WeakMap;this._debugVisualizationElements=new Map;this._visualizers=new Map;this._visualizerIdCounter=0;this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=this._register(new E),this._onDidTerminateDebugSession=this._register(new E),this._onDidChangeActiveDebugSession=this._register(new E),this._onDidReceiveDebugSessionCustomEvent=this._register(new E),this._debugServiceProxy=t.getProxy(N.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new E),this._onDidChangeActiveStackItem=this._register(new E),this._activeDebugConsole=new WD(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(c=>{this._register(c.onDidChange(u=>{this.registerAllDebugTypes(c)})),this.registerAllDebugTypes(c)}),this._telemetryProxy=t.getProxy(N.MainThreadTelemetry)}get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}async $getVisualizerTreeItem(t,n){let o=this.hydrateVisualizationContext(n);if(!o)return;let i=await this._debugVisualizationTrees.get(t)?.getTreeItem?.(o);return i?this.convertVisualizerTreeItem(t,i):void 0}registerDebugVisualizationTree(t,n,o){let i=_e.toKey(t.identifier),s=this.extensionVisKey(i,n);if(this._debugVisualizationProviders.has(s))throw new Error(`A debug visualization provider with id '${n}' is already registered`);return this._debugVisualizationTrees.set(s,o),this._debugServiceProxy.$registerDebugVisualizerTree(s,!!o.editItem),J(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(s),this._debugVisualizationTrees.delete(n)})}async $getVisualizerTreeItemChildren(t,n){let o=this._debugVisualizationElements.get(n)?.item;return o?(await this._debugVisualizationTrees.get(t)?.getChildren?.(o))?.map(s=>this.convertVisualizerTreeItem(t,s))||[]:[]}async $editVisualizerTreeItem(t,n){let o=this._debugVisualizationElements.get(t);if(!o)return;let i=await this._debugVisualizationTrees.get(o.provider)?.editItem?.(o.item,n);return this.convertVisualizerTreeItem(o.provider,i||o.item)}$disposeVisualizedTree(t){let n=this._debugVisualizationElements.get(t);if(!n)return;let o=[n.children];for(let i of o)if(i)for(let s of i)o.push(this._debugVisualizationElements.get(s)?.children),this._debugVisualizationElements.delete(s)}convertVisualizerTreeItem(t,n){let o=this._debugVisualizationTreeItemIds.get(n);return o||(o=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(n,o),this._debugVisualizationElements.set(o,{provider:t,item:n})),hP.from(n,o)}asDebugSourceUri(t,n){let o=t;if(typeof o.sourceReference=="number"&&o.sourceReference>0){let i=`debug:${encodeURIComponent(o.path||"")}`,s="?";return n&&(i+=`${s}session=${encodeURIComponent(n.id)}`,s="&"),i+=`${s}ref=${o.sourceReference}`,y.parse(i)}else{if(o.path)return y.file(o.path);throw new Error("cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.")}}registerAllDebugTypes(t){let n=[];for(let o of t.getAllExtensionDescriptions())if(o.contributes){let i=o.contributes.debuggers;if(i&&i.length>0)for(let s of i)VN(s)&&n.push(s.type)}this._debugServiceProxy.$registerDebugTypes(n)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){let t=[];return this._breakpoints.forEach(n=>t.push(n)),t}async $resolveDebugVisualizer(t,n){let o=this._visualizers.get(t);if(!o)throw new Error(`No debug visualizer found with id '${t}'`);let{v:i,provider:s,extensionId:a}=o;if(i.visualization||(i=await s.resolveDebugVisualization?.(i,n)||i,o.v=i),!i.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${s}'`);return this.serializeVisualization(a,i.visualization)}async $executeDebugVisualizerCommand(t){let n=this._visualizers.get(t);if(!n)throw new Error(`No debug visualizer found with id '${t}'`);let o=n.v.visualization;o&&"command"in o&&this._commands.executeCommand(o.command,...o.arguments||[])}hydrateVisualizationContext(t){let n=this._debugSessions.get(t.sessionId);return n&&{session:n.api,variable:t.variable,containerId:t.containerId,frameId:t.frameId,threadId:t.threadId}}async $provideDebugVisualizers(t,n,o,i){let s=this.hydrateVisualizationContext(o),a=this.extensionVisKey(t,n),l=this._debugVisualizationProviders.get(a);if(!s||!l)return[];let d=await l.provideDebugVisualization(s,i);return d?d.map(c=>{let u=++this._visualizerIdCounter;this._visualizers.set(u,{v:c,provider:l,extensionId:t});let m=c.iconPath?this.getIconPathOrClass(c.iconPath):void 0;return{id:u,name:c.name,iconClass:m?.iconClass,iconPath:m?.iconPath,visualization:this.serializeVisualization(t,c.visualization)}}):[]}$disposeDebugVisualizers(t){for(let n of t)this._visualizers.delete(n)}registerDebugVisualizationProvider(t,n,o){if(!t.contributes?.debugVisualizers?.some(a=>a.id===n))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${n})`);let i=_e.toKey(t.identifier),s=this.extensionVisKey(i,n);if(this._debugVisualizationProviders.has(s))throw new Error(`A debug visualization provider with id '${n}' is already registered`);return this._debugVisualizationProviders.set(s,o),this._debugServiceProxy.$registerDebugVisualizer(i,n),J(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(i,n),this._debugVisualizationProviders.delete(n)})}addBreakpoints(t){let n=t.filter(s=>{let a=s.id;return this._breakpoints.has(a)?!1:(this._breakpoints.set(a,s),!0)});this.fireBreakpointChanges(n,[],[]);let o=[],i=new Map;for(let s of n)if(s instanceof Kr){let a=i.get(s.location.uri.toString());a||(a={type:"sourceMulti",uri:s.location.uri,lines:[]},i.set(s.location.uri.toString(),a),o.push(a)),a.lines.push({id:s.id,enabled:s.enabled,condition:s.condition,hitCondition:s.hitCondition,logMessage:s.logMessage,line:s.location.range.start.line,character:s.location.range.start.character,mode:s.mode})}else s instanceof qr&&o.push({type:"function",id:s.id,enabled:s.enabled,hitCondition:s.hitCondition,logMessage:s.logMessage,condition:s.condition,functionName:s.functionName,mode:s.mode});return this._debugServiceProxy.$registerBreakpoints(o)}removeBreakpoints(t){let n=t.filter(a=>this._breakpoints.delete(a.id));this.fireBreakpointChanges([],n,[]);let o=n.filter(a=>a instanceof Kr).map(a=>a.id),i=n.filter(a=>a instanceof qr).map(a=>a.id),s=n.filter(a=>a instanceof fd).map(a=>a.id);return this._debugServiceProxy.$unregisterBreakpoints(o,i,s)}startDebugging(t,n,o){let i=o.testRun&&this._testing.getMetadataForRun(o.testRun);return this._debugServiceProxy.$startDebugging(t?t.uri:void 0,n,{parentSessionID:o.parentSession?o.parentSession.id:void 0,lifecycleManagedByParent:o.lifecycleManagedByParent,repl:o.consoleMode===1?"mergeWithParent":"separate",noDebug:o.noDebug,compact:o.compact,suppressSaveBeforeStart:o.suppressSaveBeforeStart,testRun:i&&{runId:i.runId,taskId:i.taskId},suppressDebugStatusbar:o.suppressDebugStatusbar??o.debugUI?.simple,suppressDebugToolbar:o.suppressDebugToolbar??o.debugUI?.simple,suppressDebugView:o.suppressDebugView??o.debugUI?.simple})}stopDebugging(t){return this._debugServiceProxy.$stopDebugging(t?t.id:void 0)}registerDebugConfigurationProvider(t,n,o){if(!n)return new fe(()=>{});let i=this._configProviderHandleCounter++;return this._configProviders.push({type:t,handle:i,provider:n}),this._debugServiceProxy.$registerDebugConfigurationProvider(t,o,!!n.provideDebugConfigurations,!!n.resolveDebugConfiguration,!!n.resolveDebugConfigurationWithSubstitutedVariables,i),new fe(()=>{this._configProviders=this._configProviders.filter(s=>s.provider!==n),this._debugServiceProxy.$unregisterDebugConfigurationProvider(i)})}registerDebugAdapterDescriptorFactory(t,n,o){if(!o)return new fe(()=>{});if(!this.definesDebugType(t,n))throw new Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${n}' debugger.`);if(this.getAdapterDescriptorFactoryByType(n))throw new Error("a DebugAdapterDescriptorFactory can only be registered once per a type.");let i=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:n,handle:i,factory:o}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(n,i),new fe(()=>{this._adapterFactories=this._adapterFactories.filter(s=>s.factory!==o),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(i)})}registerDebugAdapterTrackerFactory(t,n){if(!n)return new fe(()=>{});let o=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:t,handle:o,factory:n}),new fe(()=>{this._trackerFactories=this._trackerFactories.filter(i=>i.factory!==n)})}async $runInTerminal(t,n){return Promise.resolve(void 0)}async $substituteVariables(t,n){let o,i=await this.getFolder(t);return i&&(o={uri:i.uri,name:i.name,index:i.index}),(await this._variableResolver.getResolver()).resolveAsync(o,n)}createDebugAdapter(t,n){if(t instanceof bs)return new zD(t.implementation)}createSignService(){}async $startDASession(t,n){let o=this,i=await this.getSession(n);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(i.type),i).then(s=>{if(!s)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${i.type}' (extension might have failed to activate)`);let a=this.createDebugAdapter(s,i);if(!a)throw new Error(`Couldn't create a debug adapter for type '${i.type}'.`);let l=a;return this._debugAdapters.set(t,l),this.getDebugAdapterTrackers(i).then(d=>(d&&this._debugAdaptersTrackers.set(t,d),l.onMessage(async c=>{if(c.type==="request"&&c.command==="handshake"){let u=c,m={type:"response",seq:0,command:u.command,request_seq:u.seq,success:!0};this._signService||(this._signService=this.createSignService());try{if(this._signService){let g=await this._signService.sign(u.arguments.value);m.body={signature:g},l.sendResponse(m)}else throw new Error("no signer")}catch(g){m.success=!1,m.message=g.message,l.sendResponse(m)}}else{d&&d.onDidSendMessage&&d.onDidSendMessage(c);try{c=zN(c,!0)}catch(u){let m=c.type+"_"+(c.command??c.event??"");throw this._telemetryProxy.$publicLog2("debugProtocolMessageError",{type:m,from:i.type}),u}o._debugServiceProxy.$acceptDAMessage(t,c)}}),l.onError(c=>{d&&d.onError&&d.onError(c),this._debugServiceProxy.$acceptDAError(t,c.name,c.message,c.stack)}),l.onExit(c=>{d&&d.onExit&&d.onExit(c??void 0,void 0),this._debugServiceProxy.$acceptDAExit(t,c??void 0,void 0)}),d&&d.onWillStartSession&&d.onWillStartSession(),l.startSession()))})}$sendDAMessage(t,n){n=$N(n,!1);let o=this._debugAdaptersTrackers.get(t);o&&o.onWillReceiveMessage&&o.onWillReceiveMessage(n),this._debugAdapters.get(t)?.sendMessage(n)}$stopDASession(t){let n=this._debugAdaptersTrackers.get(t);this._debugAdaptersTrackers.delete(t),n&&n.onWillStopSession&&n.onWillStopSession();let o=this._debugAdapters.get(t);return this._debugAdapters.delete(t),o?o.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(t){let n=[],o=[],i=[];if(t.added)for(let s of t.added){let a=s.id;if(a&&!this._breakpoints.has(a)){let l;if(s.type==="function")l=new qr(s.functionName,s.enabled,s.condition,s.hitCondition,s.logMessage,s.mode);else if(s.type==="data")l=new fd(s.label,s.dataId,s.canPersist,s.enabled,s.hitCondition,s.condition,s.logMessage,s.mode);else{let d=y.revive(s.uri);l=new Kr(new At(d,new Ie(s.line,s.character)),s.enabled,s.condition,s.hitCondition,s.logMessage,s.mode)}xO(l,a),this._breakpoints.set(a,l),n.push(l)}}if(t.removed)for(let s of t.removed){let a=this._breakpoints.get(s);a&&(this._breakpoints.delete(s),o.push(a))}if(t.changed){for(let s of t.changed)if(s.id){let a=this._breakpoints.get(s.id);if(a){if(a instanceof qr&&s.type==="function"){let l=a;l.enabled=s.enabled,l.condition=s.condition,l.hitCondition=s.hitCondition,l.logMessage=s.logMessage,l.functionName=s.functionName}else if(a instanceof Kr&&s.type==="source"){let l=a;l.enabled=s.enabled,l.condition=s.condition,l.hitCondition=s.hitCondition,l.logMessage=s.logMessage,l.location=new At(y.revive(s.uri),new Ie(s.line,s.character))}i.push(a)}}}this.fireBreakpointChanges(n,o,i)}async $acceptStackFrameFocus(t){let n;if(t){let o=await this.getSession(t.sessionId);t.kind==="thread"?n=new yu(o.api,t.threadId):n=new bu(o.api,t.threadId,t.frameId)}this._activeStackItem=n,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(t,n,o){return Qt(async()=>{let i=this.getConfigProviderByHandle(t);if(!i)throw new Error("no DebugConfigurationProvider found");if(!i.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");let s=await this.getFolder(n);return i.provideDebugConfigurations(s,o)}).then(i=>{if(!i)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return i})}$resolveDebugConfiguration(t,n,o,i){return Qt(async()=>{let s=this.getConfigProviderByHandle(t);if(!s)throw new Error("no DebugConfigurationProvider found");if(!s.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");let a=await this.getFolder(n);return s.resolveDebugConfiguration(a,o,i)})}$resolveDebugConfigurationWithSubstitutedVariables(t,n,o,i){return Qt(async()=>{let s=this.getConfigProviderByHandle(t);if(!s)throw new Error("no DebugConfigurationProvider found");if(!s.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");let a=await this.getFolder(n);return s.resolveDebugConfigurationWithSubstitutedVariables(a,o,i)})}async $provideDebugAdapter(t,n){let o=this.getAdapterDescriptorFactoryByHandle(t);if(!o)return Promise.reject(new Error("no adapter descriptor factory found for handle"));let i=await this.getSession(n);return this.getAdapterDescriptor(o,i).then(s=>{if(!s)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${i.type}'`);return this.convertToDto(s)})}async $acceptDebugSessionStarted(t){let n=await this.getSession(t);this._onDidStartDebugSession.fire(n.api)}async $acceptDebugSessionTerminated(t){let n=await this.getSession(t);n&&(this._onDidTerminateDebugSession.fire(n.api),this._debugSessions.delete(n.id))}async $acceptDebugSessionActiveChanged(t){this._activeDebugSession=t?await this.getSession(t):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(t,n){(await this.getSession(t))?._acceptNameChanged(n)}async $acceptDebugSessionCustomEvent(t,n){let i={session:(await this.getSession(t)).api,event:n.event,body:n.body};this._onDidReceiveDebugSessionCustomEvent.fire(i)}convertToDto(t){if(t instanceof La)return this.convertExecutableToDto(t);if(t instanceof vs)return this.convertServerToDto(t);if(t instanceof Oa)return this.convertPipeServerToDto(t);if(t instanceof bs)return this.convertImplementationToDto(t);throw new Error("convertToDto unexpected type")}convertExecutableToDto(t){return{type:"executable",command:t.command,args:t.args,options:t.options}}convertServerToDto(t){return{type:"server",port:t.port,host:t.host}}convertPipeServerToDto(t){return{type:"pipeServer",path:t.path}}convertImplementationToDto(t){return{type:"implementation"}}getAdapterDescriptorFactoryByType(t){let n=this._adapterFactories.filter(o=>o.type===t);if(n.length>0)return n[0].factory}getAdapterDescriptorFactoryByHandle(t){let n=this._adapterFactories.filter(o=>o.handle===t);if(n.length>0)return n[0].factory}getConfigProviderByHandle(t){let n=this._configProviders.filter(o=>o.handle===t);if(n.length>0)return n[0].provider}definesDebugType(t,n){if(t.contributes){let o=t.contributes.debuggers;if(o&&o.length>0){for(let i of o)if(i.label&&i.type&&i.type===n)return!0}}return!1}getDebugAdapterTrackers(t){let o=t.configuration.type,i=this._trackerFactories.filter(s=>s.type===o||s.type==="*").map(s=>Qt(()=>s.factory.createDebugAdapterTracker(t.api)).then(a=>a,a=>null));return Promise.race([Promise.all(i).then(s=>{let a=Ze(s);if(a.length>0)return new $D(a)}),new Promise(s=>setTimeout(()=>s(void 0),1e3))]).catch(s=>{})}async getAdapterDescriptor(t,n){let o=n.configuration.debugServer;if(typeof o=="number")return Promise.resolve(new vs(o));if(t){let s=await this._extensionService.getExtensionRegistry();return Qt(()=>t.createDebugAdapterDescriptor(n.api,this.daExecutableFromPackage(n,s))).then(a=>{if(a)return a})}let i=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(n,i))}daExecutableFromPackage(t,n){}fireBreakpointChanges(t,n,o){(t.length>0||n.length>0||o.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:t,removed:n,changed:o}))}async getSession(t){if(t)if(typeof t=="string"){let n=this._debugSessions.get(t);if(n)return n}else{let n=this._debugSessions.get(t.id);if(!n){let o=await this.getFolder(t.folderUri),i=t.parent?this._debugSessions.get(t.parent):void 0;n=new BD(this._debugServiceProxy,t.id,t.type,t.name,o,t.configuration,i?.api),this._debugSessions.set(n.id,n),this._debugServiceProxy.$sessionCached(n.id)}return n}throw new Error("cannot find session")}getFolder(t){if(t){let n=y.revive(t);return this._workspaceService.resolveWorkspaceFolder(n)}return Promise.resolve(void 0)}extensionVisKey(t,n){return`${t}\0${n}`}serializeVisualization(t,n){if(n){if("title"in n&&"command"in n)return{type:0};if("treeId"in n)return{type:1,id:`${t}\0${n.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(t){let n=this.getIconUris(t),o,i;return"id"in n?i=vt.asClassName(n):o=n,{iconPath:o,iconClass:i}}getIconUris(t){if(t instanceof ln)return{id:t.id};let n=typeof t=="object"&&"dark"in t?t.dark:t,o=typeof t=="object"&&"light"in t?t.light:t;return{dark:typeof n=="string"?y.file(n):n,light:typeof o=="string"?y.file(o):o}}};Kf=D([C(0,ge),C(1,Wn),C(2,Mo),C(3,ao),C(4,Bs),C(5,Jd),C(6,Ro),C(7,Qd)],Kf);var BD=class{constructor(e,t,n,o,i,s,a){this._debugServiceProxy=e;this._id=t;this._type=n;this._name=o;this._workspaceFolder=i;this._configuration=s;this._parentSession=a}get api(){let e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,n){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,n)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}},WD=class{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+`
`)}})}},$D=class{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(n=>n.onExit?n.onExit(e,t):void 0)}},zD=class extends Mx{constructor(t){super();this.implementation=t;t.onDidSendMessage(n=>{this.acceptMessage(n)})}startSession(){return Promise.resolve(void 0)}sendMessage(t){this.implementation.handleMessage(t)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}},Wp=class extends Kf{constructor(e,t,n,o,i,s,a,l){super(e,t,n,o,i,s,a,l)}};Wp=D([C(0,ge),C(1,Wn),C(2,Mo),C(3,ao),C(4,Bs),C(5,Jd),C(6,Ro),C(7,Qd)],Wp);function sW(r){return"uri"in r&&"ranges"in r&&"preview"in r}function aW(r){return r.folderOptions.map(e=>({folder:e.folder,excludes:e.excludes.map(t=>typeof t=="string"?t:t.pattern),includes:e.includes,useGlobalIgnoreFiles:e.useIgnoreFiles.global,useIgnoreFiles:e.useIgnoreFiles.local,useParentIgnoreFiles:e.useIgnoreFiles.parent,followSymlinks:e.followSymlinks,maxResults:r.maxResults,session:r.session}))}var $p=class{constructor(e){this.provider=e}provideFileSearchResults(e,t,n){return(async()=>{let i=aW(t);return Promise.all(i.map(s=>this.provider.provideFileSearchResults({pattern:e},s,n)))})().then(i=>Ze(i).flat())}};function lW(r){return r.folderOptions.map(e=>({folder:e.folder,excludes:e.excludes.map(t=>typeof t=="string"?t:t.pattern),includes:e.includes,useGlobalIgnoreFiles:e.useIgnoreFiles.global,useIgnoreFiles:e.useIgnoreFiles.local,useParentIgnoreFiles:e.useIgnoreFiles.parent,followSymlinks:e.followSymlinks,maxResults:r.maxResults,previewOptions:dW(r.previewOptions),maxFileSize:r.maxFileSize,encoding:e.encoding,afterContext:r.surroundingContext,beforeContext:r.surroundingContext}))}function dW(r){return{matchLines:r?.matchLines??wf.matchLines,charsPerLine:r?.charsPerLine??wf.charsPerLine}}function cW(r){if(sW(r)){let e=hn(r.ranges).map((t,n)=>{let i=hn(r.preview.matches)[n];return{sourceRange:t,previewRange:i}});return new Do(r.uri,e,r.preview.text)}else return new rl(r.uri,r.text,r.lineNumber)}var Fx=class{constructor(e){this.provider=e}provideTextSearchResults(e,t,n,o){let i=l=>{uW(l)&&n.report(cW(l))};return(async()=>Ze(await Promise.all(lW(t).map(l=>this.provider.provideTextSearchResults(e,l,{report:d=>i(d)},o)))).reduce((l,d)=>({limitHit:l.limitHit||d.limitHit}),{limitHit:!1}))().then(l=>({limitHit:l.limitHit,message:Ze(hn(l.message))}))}};function uW(r){if(pW(r)){if(Array.isArray(r.ranges)){if(!Array.isArray(r.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(r.preview.matches.length!==r.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(r.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}function pW(r){return!!r.preview}var zp=class extends go{constructor(e,t,n=()=>!1){let o=new cg(n,()=>!1);super(o);let i=new qe;e.forEach((s,a)=>{let l=s.folder.with({query:"",fragment:""});i.has(l)?i.get(l).push({fq:s,i:a}):i.set(l,[{fq:s,i:a}])}),i.forEach((s,a)=>{let l=new Map;for(let d of s){let c=t(d.fq,d.i);l.set(this.encodeKey(d.fq.folder),c)}super.set(a,l)})}findQueryFragmentAwareSubstr(e){let t=super.findSubstr(e.with({query:"",fragment:""}));if(!t)return;let n=this.encodeKey(e);return t.get(n)}forEachFolderQueryInfo(e){return this.forEach(t=>t.forEach(n=>e(n)))}encodeKey(e){let t="";return e.query&&(t+=e.query),e.fragment&&(t+="#"+e.fragment),t}};var KD=class{constructor(e,t,n){this.config=e;this.provider=t;this.sessionLifecycle=n;this.isLimitHit=!1;this.resultCount=0;this.isCanceled=!1;this.filePattern=e.filePattern;let o=e.ignoreGlobCase?{ignoreCase:!0}:void 0;this.includePattern=e.includePattern&&Br(e.includePattern,o),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&Br(e.excludePattern,o)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){let t=this.config.folderQueries||[];return new Promise((n,o)=>{let i=s=>{this.resultCount++,e(s)};if(this.isCanceled)return n({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(s=>{let a=s.toString(),l=dn(a);this.globalExcludePattern&&this.globalExcludePattern(a,l)||this.matchFile(i,{base:s,basename:l})}),this.doSearch(t,i).then(s=>{n({limitHit:this.isLimitHit,stats:s||void 0})},s=>{o(new Error(Dr(s)))})})}async doSearch(e,t){let n=new Re,o=e.map(c=>this.getSearchOptionsForFolder(c)),i=this.provider instanceof $p?this.sessionLifecycle?.tokenSource.token:this.sessionLifecycle?.obj,s={folderOptions:o,maxResults:this.config.maxResults??qI,session:i},a=c=>{let u=new ep(this.config,c),m=!u.hasSiblingExcludeClauses();return{queryTester:u,noSiblingsClauses:m,folder:c.folder,tree:this.initDirectoryTree()}},l=new zp(e,a),d;try{this.activeCancellationTokens.add(n),d=uo.create();let c=await this.provider.provideFileSearchResults(this.config.filePattern||"",s,n.token),u=d.elapsed(),m=uo.create();return this.isCanceled&&!this.isLimitHit||(c&&c.forEach(g=>{let v=l.findQueryFragmentAwareSubstr(g),h=Le.relative(v.folder.path,g.path);if(v.noSiblingsClauses){let x=dn(g.path);this.matchFile(t,{base:v.folder,relativePath:h,basename:x});return}this.addDirectoryEntries(v.tree,v.folder,h,t)}),this.isCanceled&&!this.isLimitHit)?null:(l.forEachFolderQueryInfo(g=>{this.matchDirectoryTree(g.tree,g.queryTester,t)}),{providerTime:u,postProcessTime:m.elapsed()})}finally{n.dispose(),this.activeCancellationTokens.delete(n)}}getSearchOptionsForFolder(e){let t=il(this.config.includePattern,e.includePattern),n=e.excludePattern?.map(i=>({folder:i.folder,patterns:il(this.config.excludePattern,i.pattern)}));n?.length||(n=[{folder:void 0,patterns:il(this.config.excludePattern,void 0)}]);let o=GI(n);return{folder:e.folder,excludes:o,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks}}initDirectoryTree(){let e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,n,o){if(this.filePattern&&Yh(n,this.filePattern,this.config.ignoreGlobCase)){let s=dn(this.filePattern);this.matchFile(o,{base:t,relativePath:this.filePattern,basename:s})}function i(s){let a=dn(s),l=li(s),d=e[l];d||(d=e[l]=[],i(l)),d.push({base:t,relativePath:s,basename:a})}i(n)}matchDirectoryTree({rootEntries:e,pathToEntries:t},n,o){let i=this,s=this.filePattern,a=this.config.ignoreGlobCase;function l(d){let c=WO(()=>d.map(u=>u.basename));for(let u=0,m=d.length;u<m;u++){let g=d[u],{relativePath:v,basename:h}=g;if(n.matchesExcludesSync(v,h,Yh(s,h,a)?void 0:c))continue;let x=t[v];if(x)l(x);else{if(Yh(v,s,a))continue;i.matchFile(o,g)}if(i.isLimitHit)break}}l(e)}matchFile(e,t){(!this.includePattern||t.relativePath&&this.includePattern(t.relativePath,t.basename))&&((this.exists||this.maxResults&&this.resultCount>=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}},qD=class{constructor(){this._obj=new Object,this.tokenSource=new Re}get obj(){if(this._obj)return this._obj;throw new Error("Session object has been dereferenced.")}cancel(){this.tokenSource.cancel(),this._obj=void 0}},Hx=class r{constructor(){this.sessions=new Map}static{this.BATCH_SIZE=512}fileSearch(e,t,n,o){let i=this.getSessionTokenSource(e.cacheKey),s=new KD(e,t,i),a=0,l=d=>{a+=d.length,n(d.map(c=>this.rawMatchToSearchItem(c)))};return this.doSearch(s,r.BATCH_SIZE,l,o).then(d=>({limitHit:d.limitHit,stats:d.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:d.stats}:void 0,messages:[]}))}clearCache(e){this.sessions.get(e)?.cancel(),this.sessions.delete(e)}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new qD),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Ut(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,n,o){let i=o.onCancellationRequested(()=>{e.cancel()}),s=l=>{l&&(a.push(l),t>0&&a.length>=t&&(n(a),a=[]))},a=[];return e.search(s).then(l=>(a.length&&n(a),i.dispose(),l),l=>(a.length&&n(a),i.dispose(),Promise.reject(l)))}};var qf=class{constructor(e,t,n){this.queryProviderPair=e;this.fileUtils=t;this.processType=n;this.collector=null;this.isLimitHit=!1;this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t,n){let o=this.query.folderQueries||[],i=new Re(t);return new Promise((s,a)=>{this.collector=new GD(e);let l=!1,d=(c,u)=>{if(!(c instanceof Vd)&&!l&&!this.isLimitHit){let m=this.resultSize(c);c instanceof Do&&typeof this.query.maxResults=="number"&&this.resultCount+m>this.query.maxResults&&(this.isLimitHit=!0,l=!0,i.cancel(),c=this.trimResultToSize(c,this.query.maxResults-this.resultCount));let g=this.resultSize(c);this.resultCount+=g;let v=c instanceof Do;(g>0||!v)&&this.collector.add(c,u)}};this.doSearch(o,d,i.token,n).then(c=>{i.dispose(),this.collector.flush(),s({limitHit:this.isLimitHit||c?.limitHit,messages:this.getMessagesFromResults(c),stats:{type:this.processType}})},c=>{i.dispose();let u=Dr(c);a(new Error(u))})})}getMessagesFromResults(e){return e?.message?Array.isArray(e.message)?e.message:[e.message]:[]}resultSize(e){return e instanceof Do?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){return new Do(e.uri,e.ranges.slice(0,t),e.previewText)}async doSearch(e,t,n,o){let i=new zp(e,(u,m)=>({queryTester:new ep(this.query,u),folder:u.folder,folderIdx:m}),()=>!0),s=[],a={report:u=>{if(u instanceof Vd)o?.(u);else{if(u.uri===void 0)throw Error("Text search result URI is undefined. Please check provider implementation.");let m=i.findQueryFragmentAwareSubstr(u.uri);if(m?.folder?.scheme){let g=m.folder.scheme===$.file?BO(()=>this.fileUtils.readdir(es(u.uri))):void 0,v=Qm(m.folder,u.uri);if(v){let h=m.queryTester.includedInQuery(v,dn(v),g);ir(h)?s.push(h.then(x=>{x&&t(u,m.folderIdx)})):h&&t(u,m.folderIdx)}}}}},d={folderOptions:e.map(u=>this.getSearchOptionsForFolder(u)),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??qI,previewOptions:this.query.previewOptions??wf,surroundingContext:this.query.surroundingContext??0};"usePCRE2"in this.query&&(d.usePCRE2=this.query.usePCRE2);let c;return this.queryProviderPair.query.type===3?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,d,a,n):c=await this.queryProviderPair.provider.provideTextSearchResults(mW(this.queryProviderPair.query.contentPattern),d,a,n),s.length&&await Promise.all(s),c}getSearchOptionsForFolder(e){let t=il(this.query.includePattern,e.includePattern),n=e.excludePattern?.map(s=>({folder:s.folder,patterns:il(this.query.excludePattern,s.pattern)}));(!n||n.length===0)&&(n=[{folder:void 0,patterns:il(this.query.excludePattern,void 0)}]);let o=GI(n);return{folder:y.from(e.folder),excludes:o,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks,encoding:(e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding))??"",ignoreGlobCase:this.query.ignoreGlobCase||e.ignoreGlobCase}}};function mW(r){return{isCaseSensitive:r.isCaseSensitive||!1,isRegExp:r.isRegExp||!1,isWordMatch:r.isWordMatch||!1,isMultiline:r.isMultiline||!1,pattern:r.pattern}}var GD=class{constructor(e){this._onResult=e;this._currentFolderIdx=-1;this._currentFileMatch=null;this._batchedCollector=new jD(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!_r(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentUri=e.uri,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(gW(e))}pushToCollector(){let e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}};function gW(r){return r instanceof Do?{previewText:r.previewText,rangeLocations:r.ranges.map(e=>({preview:{startLineNumber:e.previewRange.start.line,startColumn:e.previewRange.start.character,endLineNumber:e.previewRange.end.line,endColumn:e.previewRange.end.character},source:{startLineNumber:e.sourceRange.start.line,startColumn:e.sourceRange.start.character,endLineNumber:e.sourceRange.end.line,endColumn:e.sourceRange.end.character}}))}:{text:r.text,lineNumber:r.lineNumber}}var jD=class r{constructor(e,t){this.maxBatchSize=e;this.cb=t;this.totalNumberCompleted=0;this.batch=[];this.batchSize=0}static{this.TIMEOUT=4e3}static{this.START_BATCH_AFTER_COUNT=50}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted<r.START_BATCH_AFTER_COUNT?this.flush():this.batchSize>=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},r.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0))}};var Vx=M("IExtHostSearch"),Kp=class{constructor(e,t,n){this.extHostRpc=e;this._uriTransformer=t;this._logService=n;this._proxy=this.extHostRpc.getProxy(N.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new Hx}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProviderOld(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,new Fx(t)),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),J(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,t),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),J(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);let n=this._handlePool++;return this._aiTextSearchProvider.set(n,t),this._proxy.$registerAITextSearchProvider(n,this._transformScheme(e)),J(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProviderOld(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,new $p(t)),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),J(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,t),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),J(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}$provideFileSearchResults(e,t,n,o){let i=QD(n),s=this._fileSearchProvider.get(e);if(s)return this._fileSearchManager.fileSearch(i,s,a=>{this._proxy.$handleFileMatch(e,t,a.map(l=>l.resource))},o);throw new Error("unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,n){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,n,o){let i=this._textSearchProvider.get(e);if(!i||!i.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);let s=QD(n);return this.createTextSearchManager(s,i).search(l=>this._proxy.$handleTextMatch(e,t,l),o)}$provideAITextSearchResults(e,t,n,o){let i=this._aiTextSearchProvider.get(e);if(!i||!i.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);let s=QD(n);return this.createAITextSearchManager(s,i).search(l=>this._proxy.$handleTextMatch(e,t,l),o,l=>this._proxy.$handleKeywordResult(e,t,l))}$enableExtensionHostSearch(){}async $getAIName(e){let t=this._aiTextSearchProvider.get(e);if(!(!t||!t.provideAITextSearchResults))return t.name??"AI"}createTextSearchManager(e,t){return new qf({query:e,provider:t},{readdir:n=>Promise.resolve([]),toCanonicalName:n=>n},"textSearchProvider")}createAITextSearchManager(e,t){return new qf({query:e,provider:t},{readdir:n=>Promise.resolve([]),toCanonicalName:n=>n},"aiTextSearchProvider")}};Kp=D([C(0,ge),C(1,ca),C(2,ue)],Kp);function QD(r){return{...r,folderQueries:r.folderQueries&&r.folderQueries.map(fW),extraFileResources:r.extraFileResources&&r.extraFileResources.map(e=>y.revive(e))}}function fW(r){return $t(r)}var qp=class extends H{constructor(t){super();this._onDidSuspend=this._register(new E);this.onDidSuspend=this._onDidSuspend.event;this._onDidResume=this._register(new E);this.onDidResume=this._onDidResume.event;this._onDidChangeOnBatteryPower=this._register(new E);this.onDidChangeOnBatteryPower=this._onDidChangeOnBatteryPower.event;this._onDidChangeThermalState=this._register(new E);this.onDidChangeThermalState=this._onDidChangeThermalState.event;this._onDidChangeSpeedLimit=this._register(new E);this.onDidChangeSpeedLimit=this._onDidChangeSpeedLimit.event;this._onWillShutdown=this._register(new E);this.onWillShutdown=this._onWillShutdown.event;this._onDidLockScreen=this._register(new E);this.onDidLockScreen=this._onDidLockScreen.event;this._onDidUnlockScreen=this._register(new E);this.onDidUnlockScreen=this._onDidUnlockScreen.event;this._proxy=t.getProxy(N.MainThreadPower)}$onDidSuspend(){this._onDidSuspend.fire()}$onDidResume(){this._onDidResume.fire()}$onDidChangeOnBatteryPower(t){this._onDidChangeOnBatteryPower.fire(t)}$onDidChangeThermalState(t){this._onDidChangeThermalState.fire(t)}$onDidChangeSpeedLimit(t){this._onDidChangeSpeedLimit.fire(t)}$onWillShutdown(){this._onWillShutdown.fire()}$onDidLockScreen(){this._onDidLockScreen.fire()}$onDidUnlockScreen(){this._onDidUnlockScreen.fire()}getSystemIdleState(t){return this._proxy.$getSystemIdleState(t)}getSystemIdleTime(){return this._proxy.$getSystemIdleTime()}getCurrentThermalState(){return this._proxy.$getCurrentThermalState()}isOnBatteryPower(){return this._proxy.$isOnBatteryPower()}async startPowerSaveBlocker(t){let n=await this._proxy.$startPowerSaveBlocker(t),o=this._proxy,i=n>=0,s=!1;return{id:n,get isStarted(){return i&&!s},dispose:()=>{i&&!s&&(s=!0,o.$stopPowerSaveBlocker(n))}}}};qp=D([C(0,ge)],qp);var Bx=M("IExtHostPower");var Gp=class extends Tv{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(n=>$t(n))),this._proxy=e.getProxy(N.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(y.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,n){return new JD(this._proxy,e,t,n)}};Gp=D([C(0,ge),C(1,nt)],Gp);var JD=class extends Mc{constructor(t,n,o,i){super(i?.logLevel==="always");this.proxy=t;this.file=n;this.isLoggerCreated=!1;this.buffer=[];this.setLevel(o),this.proxy.$createLogger(n,i).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(t,n){let o=[[t,n]];this.isLoggerCreated?this.doLog(o):this.buffer.push(...o)}doLog(t){this.proxy.$log(this.file,t)}flush(){this.proxy.$flush(this.file)}};var zx=M("IExtHostTerminalShellIntegration"),jp=class extends H{constructor(t,n){super();this._extHostTerminalService=n;this._activeShellIntegrations=new Map;this._onDidChangeTerminalShellIntegration=this._register(new E);this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event;this._onDidStartTerminalShellExecution=this._register(new E);this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event;this._onDidEndTerminalShellExecution=this._register(new E);this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event;this._proxy=t.getProxy(N.MainThreadTerminalShellIntegration),this._register(J(()=>{for(let[o,i]of this._activeShellIntegrations)i.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(t,n){let o=this._extHostTerminalService.getTerminalById(t);if(!o)return;let i=o.value,s=this._activeShellIntegrations.get(t);s||(s=new XD(o.value,n,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(t,s),s.store.add(o.onWillDispose(()=>this._activeShellIntegrations.get(t)?.dispose())),s.store.add(s.onDidRequestShellExecution(a=>this._proxy.$executeCommand(t,a))),s.store.add(s.onDidRequestEndExecution(a=>this._onDidEndTerminalShellExecution.fire(a))),s.store.add(s.onDidRequestChangeShellIntegration(a=>this._onDidChangeTerminalShellIntegration.fire(a))),o.shellIntegration=s.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:s.value})}$shellExecutionStart(t,n,o,i,s,a){this._activeShellIntegrations.has(t)||this.$shellIntegrationChange(t,n);let l={value:o,confidence:i,isTrusted:s};this._activeShellIntegrations.get(t)?.startShellExecution(l,this._convertCwdToUri(a))}$shellExecutionEnd(t,n,o,i,s){let a={value:n,confidence:o,isTrusted:i};this._activeShellIntegrations.get(t)?.endShellExecution(a,s)}$shellExecutionData(t,n){this._activeShellIntegrations.get(t)?.emitData(n)}$shellEnvChange(t,n,o,i){this._activeShellIntegrations.get(t)?.setEnv(n,o,i)}$cwdChange(t,n){this._activeShellIntegrations.get(t)?.setCwd(this._convertCwdToUri(n))}$closeTerminal(t){this._activeShellIntegrations.get(t)?.dispose(),this._activeShellIntegrations.delete(t)}_convertCwdToUri(t){return t?y.file(t):void 0}};jp=D([C(0,ge),C(1,Yr)],jp);var XD=class extends H{constructor(t,n,o){super();this._terminal=t;this._onDidStartTerminalShellExecution=o;this._pendingExecutions=[];this.store=this._register(new q);this._onDidRequestChangeShellIntegration=this._register(new E);this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event;this._onDidRequestShellExecution=this._register(new E);this.onDidRequestShellExecution=this._onDidRequestShellExecution.event;this._onDidRequestEndExecution=this._register(new E);this.onDidRequestEndExecution=this._onDidRequestEndExecution.event;this._onDidRequestNewExecution=this._register(new E);this.onDidRequestNewExecution=this._onDidRequestNewExecution.event;let i=this;this.value={get cwd(){return i._cwd},get env(){if(i._env)return Object.freeze({isTrusted:i._env.isTrusted,value:Object.freeze({...i._env.value})})},executeCommand(s,a){if(!n)throw new Error("This terminal does not support the executeCommand API.");let l=s;if(a)for(let u of a)!u.match(/["'`]/)&&u.match(/\s/)?l+=` "${u}"`:l+=` ${u}`;i._onDidRequestShellExecution.fire(l);let d={value:l,confidence:2,isTrusted:!0};return i.requestNewShellExecution(d,i._cwd).value}}}get currentExecution(){return this._currentExecution}requestNewShellExecution(t,n){let o=new $x(t,n??this._cwd);return Wx(t.value).length>1&&(this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:Wx(t.value)}),this._pendingExecutions.push(o),this._onDidRequestNewExecution.fire(t.value),o}startShellExecution(t,n){if(this._pendingEndingExecution&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._pendingEndingExecution.value,exitCode:void 0}),this._pendingEndingExecution=void 0),this._currentExecution){if(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines){let i=QN(this._currentExecutionProperties.unresolvedCommandLines,t);if(i){this._currentExecutionProperties.unresolvedCommandLines=i.unresolvedCommandLines;return}}this._currentExecution.endExecution(void 0),this._currentExecution.flush(),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0})}let o;if(t.confidence===2)for(let[i,s]of this._pendingExecutions.entries())if(s.value.commandLine.value===t.value){o=s,this._currentExecutionProperties={isMultiLine:!1,unresolvedCommandLines:void 0},o=s,this._pendingExecutions.splice(i,1);break}else{let a=QN(Wx(s.value.commandLine.value),t);if(a){this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:a.unresolvedCommandLines},o=s,this._pendingExecutions.splice(i,1);break}}else o=this._pendingExecutions.shift();o||(o=new $x(t,n??this._cwd)),this._currentExecution=o,this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}emitData(t){this.currentExecution?.emitData(t)}endShellExecution(t,n){if(!(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines&&this._currentExecutionProperties.unresolvedCommandLines.length>0)&&this._currentExecution){let o=this._currentExecutionProperties?.isMultiLine?this._currentExecution.value.commandLine:t;this._currentExecution.endExecution(o);let i=this._currentExecution;this._pendingEndingExecution=i,this._currentExecution=void 0,i.flush().then(()=>{this._pendingEndingExecution===i&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:i.value,exitCode:n}),this._pendingEndingExecution=void 0)})}}setEnv(t,n,o){let i={};for(let s=0;s<t.length;s++)i[t[s]]=n[s];this._env={value:i,isTrusted:o},this._fireChangeEvent()}setCwd(t){let n=!1;y.isUri(this._cwd)?n=!y.isUri(t)||this._cwd.toString()!==t.toString():this._cwd!==t&&(n=!0),n&&(this._cwd=t,this._fireChangeEvent())}_fireChangeEvent(){this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value})}},$x=class{constructor(e,t){this._commandLine=e;this.cwd=t;this._isEnded=!1;let n=this;this.value={get commandLine(){return n._commandLine},get cwd(){return n.cwd},read(){return n._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._isEnded)return Ec.EMPTY;this._dataStream=new YD}return this._dataStream.createIterable()}emitData(e){this._isEnded||this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._isEnded=!0}async flush(){this._dataStream&&(await this._dataStream.flush(),this._dataStream.dispose(),this._dataStream=void 0)}},YD=class extends H{constructor(){super(...arguments);this._iterables=[];this._emitters=[]}createIterable(){this._barrier||(this._barrier=new yn);let t=this._barrier,n=new Ec(async o=>{this._emitters.push(o),await t.wait()});return this._iterables.push(n),n}emitData(t){for(let n of this._emitters)n.emitOne(t)}endExecution(){this._barrier?.open()}async flush(){await Promise.all(this._iterables.map(t=>t.toPromise()))}};function Wx(r){return r.split(`
`).map(e=>e.trim()).filter(e=>e.length>0)}function QN(r,e){if(r.length===0)return!1;let t=[...r],n=Wx(e.value);if(t&&t.length>0){for(;t.length>0&&t[0]===n[0];)t.shift(),n.shift();if(n.length===0)return{unresolvedCommandLines:t}}return!1}var Qp=class{constructor(e){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let t=0;for(this.endedOnCR&&e[0]===10&&t++,this.endedOnCR=!1;t<e.length;){let n=e.indexOf(13,t),o=e.indexOf(10,t),i=n===-1?o:o===-1?n:Math.min(n,o);if(i===-1)break;let s="";for(let a of this.buffer)s+=this.decoder.decode(a,{stream:!0});s+=this.decoder.decode(e.subarray(t,i)),this.processLine(s),this.buffer.length=0,t=i+(e[i]===13&&e[i+1]===10?2:1)}t<e.length?this.buffer.push(e.subarray(t)):this.endedOnCR=e[e.length-1]===13}processLine(e){if(!e.length){this.dispatchEvent();return}if(e.startsWith(":"))return;let t,n,o=e.indexOf(":");o===-1?(t=e,n=""):(t=e.substring(0,o),n=e.substring(o+1),n.startsWith(" ")&&(n=n.substring(1))),this.processField(t,n)}processField(e,t){switch(e){case"event":this.eventTypeBuffer=t;break;case"data":this.dataBuffer+=t,this.dataBuffer+=`
`;break;case"id":t.includes("\0")?this.currentEventId=void 0:this.currentEventId=this.lastEventIdBuffer=t;break;case"retry":/^\d+$/.test(t)&&(this.reconnectionTime=parseInt(t,10));break}}dispatchEvent(){if(this.dataBuffer===""){this.dataBuffer="",this.eventTypeBuffer="";return}this.dataBuffer.endsWith(`
`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}};var Gf=class{validateOrThrow(e){let t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}},Jp=class extends Gf{constructor(t){super();this.type=t}validate(t){return typeof t!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof t}`}}:{content:t,error:void 0}}getJSONSchema(){return{type:this.type}}},hW=new Jp("string");function Qf(){return hW}var vW=new Jp("number");function JN(){return vW}var CAe=new Jp("boolean");var bW=new Jp("object");function Kx(){return bW}var jf=class{constructor(e){this.validator=e}};function Xd(r){return new jf(r)}var ZD=class extends Gf{constructor(t){super();this.properties=t}validate(t){if(typeof t!="object"||t===null)return{content:void 0,error:{message:"Expected object"}};let n={};for(let o in this.properties){let i=this.properties[o],s=t[o],a=i instanceof jf,l=a?i.validator:i;if(a&&s===void 0)continue;let{content:d,error:c}=l.validate(s);if(c)return{content:void 0,error:{message:`Error in property '${o}': ${c.message}`}};n[o]=d}return{content:n,error:void 0}}getJSONSchema(){let t=[],n={};for(let[i,s]of Object.entries(this.properties)){let a=s instanceof jf,l=a?s.validator:s;n[i]=l.getJSONSchema(),a||t.push(i)}return{type:"object",properties:n,...t.length>0?{required:t}:{}}}};function Jf(r){return new ZD(r)}var eR=class extends Gf{constructor(t){super();this.validator=t}validate(t){if(!Array.isArray(t))return{content:void 0,error:{message:"Expected array"}};let n=[];for(let o=0;o<t.length;o++){let{content:i,error:s}=this.validator.validate(t[o]);if(s)return{content:void 0,error:{message:`Error in element ${o}: ${s.message}`}};n.push(i)}return{content:n,error:void 0}}getJSONSchema(){return{type:"array",items:this.validator.getJSONSchema()}}};function tR(r){return new eR(r)}var Xf=M("IExtHostMpcService"),yW=Jf({label:Qf(),version:Xd(Qf()),metadata:Xd(Jf({capabilities:Xd(Kx()),serverInfo:Xd(Kx()),tools:Xd(tR(Jf({availability:JN(),definition:Kx()})))})),authentication:Xd(Jf({providerId:Qf(),scopes:tR(Qf())}))}),Xp=class extends H{constructor(t,n,o,i,s){super();this._logService=n;this._extHostInitData=o;this._workspaceService=i;this._variableResolver=s;this._initialProviderPromises=new Set;this._sseEventSources=this._register(new Oo);this._unresolvedMcpServers=new Map;this._onDidChangeMcpServerDefinitions=this._register(new E);this.onDidChangeMcpServerDefinitions=this._onDidChangeMcpServerDefinitions.event;this._mcpServerDefinitions=[];this._proxy=t.getProxy(N.MainThreadMcp)}get mcpServerDefinitions(){return this._mcpServerDefinitions}$onDidChangeMcpServerDefinitions(t){this._mcpServerDefinitions=t.map(n=>Zu.to(n)),this._onDidChangeMcpServerDefinitions.fire()}$startMcp(t,n){this._startMcp(t,ad.fromSerialized(n.launch),n.defaultCwd&&y.revive(n.defaultCwd),n.errorOnUserInteraction)}_startMcp(t,n,o,i){if(n.type===2){this._sseEventSources.set(t,new oR(t,n,this._proxy,this._logService,i));return}throw new Error("not implemented")}async $substituteVariables(t,n){let o=y.revive(t),i=o&&await this._workspaceService.resolveWorkspaceFolder(o);return(await this._variableResolver.getResolver()).resolveAsync(i&&{uri:i.uri,name:i.name,index:i.index},n)}$stopMcp(t){this._sseEventSources.get(t)?.close().then(()=>this._didClose(t))}_didClose(t){this._sseEventSources.deleteAndDispose(t)}$sendMessage(t,n){this._sseEventSources.get(t)?.send(n)}async $waitForInitialCollectionProviders(){await Promise.all(this._initialProviderPromises)}async $resolveMcpLaunch(t,n){let o=this._unresolvedMcpServers.get(t);if(!o)return;let i=o.servers.find(a=>a.label===n);if(!i)return;if(!o.provider.resolveMcpServerDefinition)return Zu.from(i);let s=await o.provider.resolveMcpServerDefinition(i,be.None);return s?Zu.from(s):void 0}registerMcpConfigurationProvider(t,n,o){let i=new q,s=t.contributes?.mcpServerDefinitionProviders?.find(c=>c.id===n);if(!s)throw new Error(`MCP configuration providers must be registered in the contributes.mcpServerDefinitionProviders array within your package.json, but "${n}" was not`);let a={id:qL(t.identifier,n),isTrustedByDefault:!0,label:s?.label??t.displayName??t.name,scope:1,canResolveLaunch:typeof o.resolveMcpServerDefinition=="function",extensionId:t.identifier.value,configTarget:this._extHostInitData.remote.isRemote?4:2},l=async()=>{let c=await o.provideMcpServerDefinitions(be.None);this._unresolvedMcpServers.set(a.id,{servers:c??[],provider:o});let u=[];for(let m of c??[]){let g=_e.toKey(t.identifier)+"/"+m.label;if(u.some(x=>x.id===g)){let x=2;for(;u.some(S=>S.id===g+x);)x++;g=g+x}yW.validateOrThrow(m),m.authentication&&A(t,"mcpToolDefinitions");let v,h=m;Fe(t,"mcpToolDefinitions")&&h.metadata&&(v={capabilities:h.metadata.capabilities,instructions:h.metadata.instructions,serverInfo:h.metadata.serverInfo,tools:h.metadata.tools?.map(x=>({availability:x.availability===1?1:0,definition:x.definition}))}),u.push({id:g,label:m.label,cacheNonce:m.version||"$$NONE",staticMetadata:v,launch:Zu.from(m)})}this._proxy.$upsertMcpCollection(a,u)};i.add(J(()=>{this._unresolvedMcpServers.delete(a.id),this._proxy.$deleteMcpCollection(a.id)})),o.onDidChangeMcpServerDefinitions&&i.add(o.onDidChangeMcpServerDefinitions(l)),o.onDidChangeServerDefinitions&&i.add(o.onDidChangeServerDefinitions(l)),o.onDidChange&&i.add(o.onDidChange(l));let d=new Promise(c=>{setTimeout(()=>l().finally(()=>{this._initialProviderPromises.delete(d),c()}),0)});return this._initialProviderPromises.add(d),i}async startMcpGateway(){let t=await this._proxy.$startMcpGateway();if(!t)return;let n=y.revive(t.address),o=t.gatewayId;return{address:n,dispose:()=>{this._proxy.$disposeMcpGateway(o)}}}};Xp=D([C(0,ge),C(1,ue),C(2,nt),C(3,Wn),C(4,Jd)],Xp);var IW=5,xW=[301,302,303,307,308],oR=class extends H{constructor(t,n,o,i,s){super();this._id=t;this._launch=n;this._proxy=o;this._logService=i;this._errorOnUserInteraction=s;this._requestSequencer=new av;this._postEndpoint=new _n;this._mode={value:0};this._cts=new Re;this._abortCtrl=new AbortController;this._didSendClose=!1;this._register(J(()=>{this._abortCtrl.abort(),this._cts.dispose(!0)})),this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Running})}async send(t){try{this._mode.value===0?await this._requestSequencer.queue(()=>this._send(t)):await this._send(t)}catch(n){let o=`Error sending message to ${this._launch.uri}: ${String(n)}`;this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Error,message:o})}}async close(){if(this._mode.value===1&&this._mode.sessionId&&!this._didSendClose){this._didSendClose=!0;try{await this._closeSession(this._mode.sessionId)}catch{}}this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Stopped})}async _closeSession(t){let n={...Object.fromEntries(this._launch.headers),"Mcp-Session-Id":t};try{await this._addAuthHeader(n,{errorOnUserInteraction:!0})}catch{this._log(2,"Skipping session close: authentication no longer available");return}await this._fetch(this._launch.uri.toString(!0),{method:"DELETE",headers:n})}_send(t){return this._mode.value===2?this._sendLegacySSE(this._mode.endpoint,t):this._sendStreamableHttp(t,this._mode.value===1?this._mode.sessionId:void 0)}async _sendStreamableHttp(t,n){let o=new TextEncoder().encode(t),i={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(o.length),Accept:"text/event-stream, application/json"};n&&(i["Mcp-Session-Id"]=n),await this._addAuthHeader(i);let s=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"POST",headers:i,body:o},i),a=this._mode.value===0,l=s.headers.get("Mcp-Session-Id");if(l&&(this._mode={value:1,sessionId:l}),this._mode.value===0&&s.status>=400&&s.status<500&&!nR(s.status)){this._log(3,`${s.status} status sending message to ${this._launch.uri}, will attempt to fall back to legacy SSE`),this._sseFallbackWithMessage(t);return}if(s.status>=300){let d=this._mode.value===1&&!!this._mode.sessionId&&(s.status===400||s.status===404);this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Error,message:`${s.status} status sending message to ${this._launch.uri}: ${await this._getErrText(s)}`+(d?"; will retry with new session ID":""),shouldRetry:d});return}this._mode.value===0&&(this._mode={value:1,sessionId:void 0}),a&&this._attachStreamableBackchannel(),await this._handleSuccessfulStreamableHttp(s,t)}async _sseFallbackWithMessage(t){let n=await this._attachSSE();n&&(this._mode={value:2,endpoint:n},await this._sendLegacySSE(n,t))}async _handleSuccessfulStreamableHttp(t,n){if(t.status===202)return;let o=t.headers.get("Content-Type")?.toLowerCase()||"";if(o.startsWith("text/event-stream")){let i=new Qp(s=>{if(s.type==="message")this._proxy.$onDidReceiveMessage(this._id,s.data);else if(s.type==="endpoint")throw this._log(4,`Received SSE endpoint from a POST to ${this._launch.uri}, will fall back to legacy SSE`),this._sseFallbackWithMessage(n),new xt});try{await this._doSSE(i,t)}catch(s){this._log(4,`Error reading SSE stream: ${String(s)}`)}}else if(o.startsWith("application/json"))this._proxy.$onDidReceiveMessage(this._id,await t.text());else{let i=await t.text();SW(i)?this._proxy.$onDidReceiveMessage(this._id,i):this._log(4,`Unexpected ${t.status} response for request: ${i}`)}}async _attachStreamableBackchannel(){let t,n;for(let o=0;!this._store.isDisposed;o++){n!==void 0?(await cn(Math.max(0,n-Date.now()),this._cts.token),n=void 0):await cn(Math.min(o*1e3,3e4),this._cts.token);let i;try{let a={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(a),this._mode.value===1&&this._mode.sessionId!==void 0&&(a["Mcp-Session-Id"]=this._mode.sessionId),t&&(a["Last-Event-ID"]=t),i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",headers:a},a)}catch{this._log(3,`Error connecting to ${this._launch.uri} for async notifications, will retry`);continue}if(i.status>=400){this._log(2,`${i.status} status connecting to ${this._launch.uri} for async notifications; they will be disabled: ${await this._getErrText(i)}`);return}i.headers.get("content-type")?.toLowerCase().includes("text/event-stream")&&(o=0);let s=new Qp(a=>{a.retry&&(n=Date.now()+a.retry),a.type==="message"&&a.data&&this._proxy.$onDidReceiveMessage(this._id,a.data),a.id&&(t=a.id)});try{await this._doSSE(s,i)}catch(a){this._log(3,`Error reading from async stream, we will reconnect: ${a}`)}}}async _attachSSE(){let t=new _n,n={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(n);let o;try{if(o=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",headers:n},n),o.status>=300){this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Error,message:`${o.status} status connecting to ${this._launch.uri} as SSE: ${await this._getErrText(o)}`});return}}catch(s){this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Error,message:`Error connecting to ${this._launch.uri} as SSE: ${s}`});return}let i=new Qp(s=>{s.type==="message"?this._proxy.$onDidReceiveMessage(this._id,s.data):s.type==="endpoint"&&t.complete(new URL(s.data,this._launch.uri.toString(!0)).toString())});return this._register(J(()=>t.cancel())),this._doSSE(i,o).catch(s=>{this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Error,message:`Error reading SSE stream: ${String(s)}`})}),t.p}async _sendLegacySSE(t,n){let o=new TextEncoder().encode(n),i={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(o.length)};await this._addAuthHeader(i);let s=await this._fetch(t,{method:"POST",headers:i,body:o});s.status>=300&&this._log(4,`${s.status} status sending message to ${this._postEndpoint}: ${await this._getErrText(s)}`)}async _doSSE(t,n){if(!n.body)return;let o=n.body.getReader(),i;do{try{i=await kc(o.read(),this._cts.token)}catch(s){if(o.cancel(),this._store.isDisposed)return;throw s}i.value&&t.feed(i.value)}while(!i.done)}async _addAuthHeader(t,n){let o=n?.errorOnUserInteraction??this._errorOnUserInteraction;if(this._authMetadata)try{let i={authorizationServer:this._authMetadata.authorizationServer.toJSON(),authorizationServerMetadata:this._authMetadata.serverMetadata,resourceMetadata:this._authMetadata.resourceMetadata,scopes:this._authMetadata.scopes},s=await this._proxy.$getTokenFromServerMetadata(this._id,i,{errorOnUserInteraction:o,forceNewRegistration:n?.forceNewRegistration});s&&(t.Authorization=`Bearer ${s}`)}catch(i){if(zg.is(i))throw this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Stopped,reason:"needs-user-interaction"}),new xt;this._log(4,`Error getting token from server metadata: ${String(i)}`)}if(this._launch.authentication)try{this._log(2,`Using provided authentication config: providerId=${this._launch.authentication.providerId}, scopes=${this._launch.authentication.scopes.join(", ")}`);let i=await this._proxy.$getTokenForProviderId(this._id,this._launch.authentication.providerId,this._launch.authentication.scopes,{errorOnUserInteraction:o,forceNewRegistration:n?.forceNewRegistration});i&&(t.Authorization=`Bearer ${i}`,this._log(3,"Successfully obtained token from provided authentication config"))}catch(i){if(zg.is(i))throw this._proxy.$onDidChangeState(this._id,{state:Hr.Kind.Stopped,reason:"needs-user-interaction"}),new xt;this._log(4,`Error getting token from provided authentication config: ${String(i)}`)}return t}_log(t,n){this._store.isDisposed||this._proxy.$onDidPublishLog(this._id,t,n)}async _getErrText(t){try{return await t.text()}catch{return t.statusText}}async _fetchWithAuthRetry(t,n,o){let i=()=>this._fetch(t,n),s=await i();if(nR(s.status)&&(this._authMetadata?this._authMetadata.update(s.headers)&&(await this._addAuthHeader(o),o.Authorization&&(n.headers=o,s=await i())):(this._authMetadata=await CW(t,s.headers,{sameOriginHeaders:{...Object.fromEntries(this._launch.headers),"MCP-Protocol-Version":Ob.LATEST_PROTOCOL_VERSION},fetch:(a,l)=>this._fetch(a,l),log:(a,l)=>this._log(a,l)}),this._proxy.$logMcpAuthSetup(this._authMetadata.telemetry),await this._addAuthHeader(o),o.Authorization&&(n.headers=o,s=await i()))),o.Authorization&&nR(s.status)){let a=await this._getErrText(s);this._log(3,`Received ${s.status} status with Authorization header, retrying with new auth registration. Error details: ${a||"no additional details"}`),await this._addAuthHeader(o,{forceNewRegistration:!0}),s=await i()}return s}async _fetch(t,n){if(n.headers["user-agent"]=`${Wo.nameLong}/${Wo.version}`,Ev(this._logService.getLevel(),1)){let s={...n,headers:{...n.headers}};s.body&&(s.body=new TextDecoder().decode(s.body)),s.headers?.Authorization&&(s.headers.Authorization="***"),this._log(1,`Fetching ${t} with options: ${JSON.stringify(s)}`)}let o=t,i;for(let s=0;s<IW&&(i=await this._fetchInternal(o,{...n,signal:this._abortCtrl.signal,redirect:"manual"}),!!xW.includes(i.status));s++){let a=i.headers.get("location");if(!a)break;let l=new URL(a,o).toString();this._log(1,`Redirect (${i.status}) from ${o} to ${l}`),o=l,(i.status===303||(i.status===301||i.status===302)&&n.method==="POST")&&(n.method="GET",delete n.body)}if(Ev(this._logService.getLevel(),1)){let s={};i.headers.forEach((a,l)=>{s[l]=a}),this._log(1,`Fetched ${o}: ${JSON.stringify({status:i.status,headers:s})}`)}return i}_fetchInternal(t,n){return fetch(t,n)}};function SW(r){try{return JSON.parse(r),!0}catch{return!1}}function nR(r){return r===401||r===403}var qx=class{constructor(e,t,n,o,i,s){this.authorizationServer=e;this.serverMetadata=t;this.resourceMetadata=n;this.telemetry=i;this._log=s;this._scopes=o}get scopes(){return this._scopes}update(e){let t=this._parseScopesFromResponse(e);return pN(t,this._scopes)?!1:(this._log(3,`Scopes changed from ${JSON.stringify(this._scopes)} to ${JSON.stringify(t)}, updating`),this._scopes=t,!0)}_parseScopesFromResponse(e){let t=e.get("WWW-Authenticate");if(!t)return;let n=XP(t);for(let o of n)if(o.scheme==="Bearer"&&o.params.scope){let i=o.params.scope.split(px).filter(s=>s.trim().length);if(i.length)return this._log(3,`Found scope challenge in WWW-Authenticate header: ${o.params.scope}`),i}}};async function CW(r,e,t){let{sameOriginHeaders:n,fetch:o,log:i}=t,s="none",a,{resourceMetadataChallenge:l,scopesChallenge:d}=TW(e.get("WWW-Authenticate")??void 0,i),c,u,m=d;try{let{metadata:x,discoveryUrl:S,errors:T}=await mN(r,l,{sameOriginHeaders:n,fetch:(P,L)=>o(P,L)});for(let P of T)i(4,`Error fetching resource metadata: ${P}`);i(3,`Discovered resource metadata at ${S}`),s=l?"header":"wellKnown",c=x.authorization_servers?.[0],c?(i(3,`Using auth server metadata url: ${c}`),a="resourceMetadata"):i(4,`No authorization_servers found in resource metadata ${S} - Is this resource metadata configured correctly?`),m??=x.scopes_supported,u=x}catch(x){i(4,`Could not fetch resource metadata: ${String(x)}`)}let g=new URL(r).origin,v={};c||(c=g,n&&(v=n));try{i(2,`Fetching auth server metadata for: ${c} ...`);let{metadata:x,discoveryUrl:S,errors:T}=await gN(c,{additionalHeaders:v,fetch:(P,L)=>o(P,L)});for(let P of T)i(4,`Error fetching authorization server metadata: ${P}`);return i(3,`Discovered authorization server metadata at ${S}`),a??="wellKnown",new qx(y.parse(c),x,u,m,{resourceMetadataSource:s,serverMetadataSource:a},i)}catch(x){i(4,`Error populating auth server metadata for ${c}: ${String(x)}`)}let h=uN(new URL(g));return i(3,"Using default auth metadata"),new qx(y.parse(g),h,u,m,{resourceMetadataSource:s,serverMetadataSource:"default"},i)}function TW(r,e){if(!r)return{};let t,n,o=XP(r);for(let i of o)if(i.scheme==="Bearer"){if(!t&&i.params.resource_metadata&&(t=i.params.resource_metadata,e(2,`Found resource_metadata challenge in WWW-Authenticate header: ${t}`)),!n&&i.params.scope){let s=i.params.scope.split(px).filter(a=>a.trim().length);s.length&&(e(2,`Found scope challenge in WWW-Authenticate header: ${i.params.scope}`),n=s)}if(t&&n)break}return{resourceMetadataChallenge:t,scopesChallenge:n}}var jx=M("IExtHostDataChannels"),Gx=class{constructor(){this._channels=new Map}createDataChannel(e,t){A(e,"dataChannels");let n=this._channels.get(t);return n||(n=new rR(t),this._channels.set(t,n)),n}$onDidReceiveData(e,t){let n=this._channels.get(e);n&&n._fireDidReceiveData(t)}},rR=class extends H{constructor(t){super();this.channelId=t;this._onDidReceiveData=new E;this.onDidReceiveData=this._onDidReceiveData.event;this._register(this._onDidReceiveData)}_fireDidReceiveData(t){this._onDidReceiveData.fire({data:t})}toString(){return`DataChannel(${this.channelId})`}};var Jx=M("IExtHostMeteredConnection"),Qx=class extends H{constructor(){super();this._isConnectionMetered=!1;this._onDidChangeIsConnectionMetered=this._register(new E);this.onDidChangeIsConnectionMetered=this._onDidChangeIsConnectionMetered.event}get isConnectionMetered(){return this._isConnectionMetered}$initializeIsConnectionMetered(t){this._isConnectionMetered=t}$onDidChangeIsConnectionMetered(t){this._isConnectionMetered!==t&&(this._isConnectionMetered=t,this._onDidChangeIsConnectionMetered.fire(t))}};Qe(Dp,Pp,1);Qe(Ho,Gp,1);Qe(Vs,Lp,1);Qe(Ro,bp,0);Qe(qd,Ip,0);Qe(Cp,ml,0);Qe(ao,rp,0);Qe(ll,vo,0);Qe(Qd,Vp,0);Qe(Ux,Wp,0);Qe(Cx,Ni,0);Qe(Zr,Np,0);Qe(Mp,Rp,0);Qe(lr,Ov,0);Qe(Sx,Op,1);Qe(Vx,Kp,0);Qe(dp,lp,0);Qe(Rx,Fp,0);Qe(Yr,yp,0);Qe(zx,jp,0);Qe(mp,pp,0);Qe(zd,ul,0);Qe(Bx,qp,0);Qe(Kd,pl,0);Qe(Wn,tp,0);Qe(_p,kp,0);Qe(Bs,Hp,0);Qe(Jd,Bp,0);Qe(Xf,Xp,0);Qe(jx,Gx,0);Qe(Jx,Qx,0);var Xx=class extends H{constructor(e,t=[]){super(),this.logger=new Cv([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}};var Yp=class extends Xx{constructor(e,t,n){let o=n.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",i=n.remote.isRemote?p(3164,null):e?p(3165,null):p(3163,null);super(t.createLogger(o,{name:i}))}};Yp=D([C(1,Ho),C(2,nt)],Yp);function iR(r,e,t,n,o,i){if(Array.isArray(r)){let s=0;for(let a of r){let l=iR(a,e,t,n,o,i);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof r=="string")return n?r==="*"?5:r===t?10:0:0;if(r){let{language:s,pattern:a,scheme:l,hasAccessToAllModels:d,notebookType:c}=r;if(!n&&!d)return 0;c&&o&&(e=o);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(s)if(s===t)u=10;else if(s==="*")u=Math.max(u,5);else return 0;if(c)if(c===i)u=10;else if(c==="*"&&i!==void 0)u=Math.max(u,5);else return 0;if(a){let m;if(typeof a=="string"?m=a:m={...a,base:tr(a.base)},m===e.fsPath||Vr(m,e.fsPath))u=10;else return 0}return u}else return 0}}function sR(r){return typeof r=="string"?!1:Array.isArray(r)?r.some(sR):!!r.notebookType}var aR=(o=>(o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent",o))(aR||{});var wOe=M("editSessionIdentityService"),lR=(n=>(n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None",n))(lR||{});var Yx=class{constructor(e){this._relatedInformationProviders=new Map;this._nextHandle=0;this._proxy=e.getProxy(N.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,n){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");let o=this._relatedInformationProviders.get(e);if(!o)throw new Error("related information provider not found");return await o.provideRelatedInformation(t,n)??[]}getRelatedInformation(e,t,n){return this._proxy.$getAiRelatedInformation(t,n)}registerRelatedInformationProvider(e,t,n){let o=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(o,n),this._proxy.$registerAiRelatedInformationProvider(o,t),new fe(()=>{this._proxy.$unregisterAiRelatedInformationProvider(o),this._relatedInformationProviders.delete(o)})}};var Zx=class{constructor(e){this._settingsSearchProviders=new Map;this._nextHandle=0;this._proxy=e.getProxy(N.MainThreadAiSettingsSearch)}async $startSearch(e,t,n,o){if(this._settingsSearchProviders.size===0)throw new Error("No related information providers registered");let i=this._settingsSearchProviders.get(e);if(!i)throw new Error("Settings search provider not found");let s=new ga(a=>{this._proxy.$handleSearchResult(e,bP.fromSettingsSearchResult(a))});return i.provideSettingsSearchResults(t,n,s,o)}registerSettingsSearchProvider(e,t){let n=this._nextHandle;return this._nextHandle++,this._settingsSearchProviders.set(n,t),this._proxy.$registerAiSettingsSearchProvider(n),new fe(()=>{this._proxy.$unregisterAiSettingsSearchProvider(n),this._settingsSearchProviders.delete(n)})}};function XN(r){for(let e=0,t=r.length;e<t;e+=4){let n=r[e+0],o=r[e+1],i=r[e+2],s=r[e+3];r[e+0]=s,r[e+1]=i,r[e+2]=o,r[e+3]=n}}function wW(r){let e=new Uint8Array(r.buffer,r.byteOffset,r.length*4);return Bh()||XN(e),ee.wrap(e)}function kW(r){let e=r.buffer;if(Bh()||XN(e),e.byteOffset%4===0)return new Uint32Array(e.buffer,e.byteOffset,e.length/4);{let t=new Uint8Array(e.byteLength);return t.set(e),new Uint32Array(t.buffer,t.byteOffset,t.length/4)}}function eS(r){let e=new Uint32Array(_W(r)),t=0;if(e[t++]=r.id,r.type==="full")e[t++]=1,e[t++]=r.data.length,e.set(r.data,t),t+=r.data.length;else{e[t++]=2,e[t++]=r.deltas.length;for(let n of r.deltas)e[t++]=n.start,e[t++]=n.deleteCount,n.data?(e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length):e[t++]=0}return wW(e)}function _W(r){let e=0;if(e+=2,r.type==="full")e+=1+r.data.length;else{e+=1,e+=3*r.deltas.length;for(let t of r.deltas)t.data&&(e+=t.data.length)}return e}function dR(r){let e=kW(r),t=0,n=e[t++];if(e[t++]===1){let a=e[t++],l=e.subarray(t,t+a);return t+=a,{id:n,type:"full",data:l}}let i=e[t++],s=[];for(let a=0;a<i;a++){let l=e[t++],d=e[t++],c=e[t++],u;c>0&&(u=e.subarray(t,t+c),t+=c),s[a]={start:l,deleteCount:d,data:u}}return{id:n,type:"delta",deltas:s}}var PW=[new Te("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[j.Uri,j.Position],new xe("A promise that resolves to an array of DocumentHighlight-instances.",ei(Md.to))),new Te("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[j.Uri],new xe("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(r,e)=>{if(Dm(r))return;class t extends $o{constructor(){super(...arguments);this.containerName=""}static to(i){let s=new t(i.name,Ko.to(i.kind),i.containerName||"",new At(e[0],V.to(i.range)));return s.detail=i.detail,s.range=s.location.range,s.selectionRange=V.to(i.selectionRange),s.children=i.children?i.children.map(t.to):[],s}}return r.map(t.to)})),new Te("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[j.Uri,new j("options","Formatting options",r=>!0,r=>r)],new xe("A promise that resolves to an array of TextEdits.",ei(tn.to))),new Te("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[j.Uri,j.Range,new j("options","Formatting options",r=>!0,r=>r)],new xe("A promise that resolves to an array of TextEdits.",ei(tn.to))),new Te("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[j.Uri,j.Position,new j("ch","Trigger character",r=>typeof r=="string",r=>r),new j("options","Formatting options",r=>!0,r=>r)],new xe("A promise that resolves to an array of TextEdits.",ei(tn.to))),new Te("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location or LocationLink instances.",bl)),new Te("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location-instances.",ei(Vn.to))),new Te("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Location-instances.",ei(Vn.to))),new Te("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Hover-instances.",ei(Ku.to))),new Te("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[j.Uri,j.Position],new xe("A promise that resolves to an array of Hover-instances.",ei(Ku.to))),new Te("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[j.Uri,new j("position","A position in a text document",r=>Array.isArray(r)&&r.every(e=>Ie.isPosition(e)),r=>r.map(Xe.from))],new xe("A promise that resolves to an array of ranges.",r=>r.map(e=>{let t;for(let n of e.reverse())t=new Ci(V.to(n),t);return t}))),new Te("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[j.String.with("query","Search string")],new xe("A promise that resolves to an array of SymbolInformation-instances.",r=>r.map(nl.to))),new Te("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[j.Uri,j.Position],new xe("A promise that resolves to an array of CallHierarchyItem-instances",r=>r.map(Os.to))),new Te("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[j.CallHierarchyItem],new xe("A promise that resolves to an array of CallHierarchyIncomingCall-instances",r=>r.map(q_.to))),new Te("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[j.CallHierarchyItem],new xe("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",r=>r.map(G_.to))),new Te("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[j.Uri,j.Position],new xe("A promise that resolves to a range and placeholder text.",r=>{if(r)return{range:V.to(r.range),placeholder:r.text}})),new Te("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[j.Uri,j.Position,j.String.with("newName","The new symbol name")],new xe("A promise that resolves to a WorkspaceEdit.",r=>{if(r){if(r.rejectReason)throw new Error(r.rejectReason);return Bn.to(r)}})),new Te("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[j.Uri,j.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new xe("A promise that resolves to an array of DocumentLink-instances.",r=>r.map(Ns.to))),new Te("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[j.Uri],new xe("A promise that resolves to SemanticTokensLegend.",r=>{if(r)return new xd(r.tokenTypes,r.tokenModifiers)})),new Te("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[j.Uri],new xe("A promise that resolves to SemanticTokens.",r=>{if(!r)return;let e=dR(r);if(e.type==="full")return new Gr(e.data,void 0)})),new Te("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[j.Uri,j.Range.optional()],new xe("A promise that resolves to SemanticTokensLegend.",r=>{if(r)return new xd(r.tokenTypes,r.tokenModifiers)})),new Te("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[j.Uri,j.Range],new xe("A promise that resolves to SemanticTokens.",r=>{if(!r)return;let e=dR(r);if(e.type==="full")return new Gr(e.data,void 0)})),new Te("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),j.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new xe("A promise that resolves to a CompletionList-instance.",(r,e,t)=>{if(!r)return new Wr([]);let n=r.suggestions.map(o=>Y_.to(o,t));return new Wr(n,r.incomplete)})),new Te("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new xe("A promise that resolves to SignatureHelp.",r=>{if(r)return qu.to(r)})),new Te("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[j.Uri,j.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new xe("A promise that resolves to an array of CodeLens-instances.",(r,e,t)=>ei(n=>new ka(V.to(n.range),n.command&&t.fromInternal(n.command)))(r))),new Te("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[j.Uri,new j("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",r=>pe.isRange(r),r=>xn.isSelection(r)?Qn.from(r):V.from(r)),j.String.with("kind","Code action kind to return code actions for").optional(),j.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new xe("A promise that resolves to an array of Command-instances.",(r,e,t)=>ei(n=>{if(n._isSynthetic){if(!n.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(n.command)}else{let o=new Si(n.title,n.kind?new at(n.kind):void 0);return n.edit&&(o.edit=Bn.to(n.edit)),n.command&&(o.command=t.fromInternal(n.command)),o.isPreferred=n.isPreferred,o}})(r))),new Te("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[j.Uri],new xe("A promise that resolves to an array of ColorInformation objects.",r=>r?r.map(e=>new Ma(V.to(e.range),Ud.to(e.color))):[])),new Te("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new j("color","The color to show and insert",r=>r instanceof $r,Ud.from),new j("context","Context object with uri and range",r=>!0,r=>({uri:r.uri,range:V.from(r.range)}))],new xe("A promise that resolves to an array of ColorPresentation objects.",r=>r?r.map(gf.to):[])),new Te("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[j.Uri,j.Range],new xe("A promise that resolves to an array of Inlay objects",(r,e,t)=>r.map(Z_.to.bind(void 0,t)))),new Te("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[j.Uri],new xe("A promise that resolves to an array of FoldingRange objects",(r,e)=>{if(r)return r.map(hf.to)})),new Te("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new xe("A promise that resolves to an array of NotebookContentProvider static info objects.",ei(r=>({viewType:r.viewType,displayName:r.displayName,options:{transientOutputs:r.options.transientOutputs,transientCellMetadata:r.options.transientCellMetadata,transientDocumentMetadata:r.options.transientDocumentMetadata},filenamePattern:r.filenamePattern.map(e=>bf.to(e))})))),new Te("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[j.Uri,j.Range,new j("context","An InlineValueContext",r=>r&&typeof r.frameId=="number"&&r.stoppedLocation instanceof pe,r=>mf.from(r))],new xe("A promise that resolves to an array of InlineValue objects",r=>r.map(pf.to))),new Te("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new j("uriOrString","Uri-instance or string (only http/https)",r=>y.isUri(r)||typeof r=="string"&&J0(r,$.http,$.https),r=>r),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",r=>r===void 0||typeof r=="number"||typeof r=="object",r=>r&&(typeof r=="number"?[_t.from(r),void 0]:[_t.from(r.viewColumn),vf.from(r)])).optional(),j.String.with("label","").optional()],xe.Void),new Te("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[j.Uri.with("resource","Resource to open"),j.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",r=>r===void 0||typeof r=="number"||typeof r=="object",r=>r&&(typeof r=="number"?[_t.from(r),void 0]:[_t.from(r.viewColumn),vf.from(r)])).optional()],xe.Void),new Te("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[j.Uri.with("left","Left-hand side resource of the diff editor"),j.Uri.with("right","Right-hand side resource of the diff editor"),j.String.with("title","Human readable title for the diff editor").optional(),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",r=>r===void 0||typeof r=="object",r=>r&&[_t.from(r.viewColumn),vf.from(r)]).optional()],xe.Void),new Te("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[j.String.with("title","Human readable title for the changes editor"),new j("resourceList","List of resources to compare",r=>{for(let e of r){if(e.length!==3)return!1;let[t,n,o]=e;if(!y.isUri(t)||!y.isUri(n)&&n!==void 0&&n!==null||!y.isUri(o)&&o!==void 0&&o!==null)return!1}return!0},r=>r)],xe.Void),new Te("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[j.Uri,j.Position],new xe("A promise that resolves to an array of TypeHierarchyItem-instances",r=>r.map(Us.to))),new Te("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[j.TypeHierarchyItem],new xe("A promise that resolves to an array of TypeHierarchyItem-instances",r=>r.map(Us.to))),new Te("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[j.TypeHierarchyItem],new xe("A promise that resolves to an array of TypeHierarchyItem-instances",r=>r.map(Us.to))),new Te("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[j.TestItem],xe.Void),new Te("vscode.startContinuousTestRun","testing.startContinuousRunFromExtension","Starts running the given tests with continuous run mode.",[j.TestProfile,j.Arr(j.TestItem)],xe.Void),new Te("vscode.stopContinuousTestRun","testing.stopContinuousRunFromExtension","Stops running the given tests with continuous run mode.",[j.Arr(j.TestItem)],xe.Void),new Te("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[j.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],xe.Void),new Te("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[j.String.with("name","The context key name"),new j("value","The context key value",()=>!0,r=>r)],xe.Void),new Te("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new j("Run arguments","",r=>!0,r=>{if(r)return{initialRange:r.initialRange?V.from(r.initialRange):void 0,initialSelection:xn.isSelection(r.initialSelection)?Qn.from(r.initialSelection):void 0,message:r.message,attachments:r.attachments,autoSend:r.autoSend,position:r.position?Xe.from(r.position):void 0,resolveOnResponse:r.resolveOnResponse}})],xe.Void),new Te("vscode.extensionPromptFileProvider","_listExtensionPromptFiles","Get all extension-contributed prompt files (custom agents, instructions, and prompt files).",[],new xe("A promise that resolves to an array of objects containing uri and type.",r=>r?r.map(e=>({uri:y.revive(e.uri),type:e.type})):[]))],tS=class{static register(e){PW.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",fM)}};function ei(r){return e=>{if(Array.isArray(e))return e.map(r)}}function bl(r){if(!Array.isArray(r))return;let e=[];for(let t of r)uA(t)?e.push(zu.to(t)):e.push(Vn.to(t));return e}var Zp=class{constructor(e,t){this._proxy=e.getProxy(N.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:n=>t.getDocument(n)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,n){let o=new Pt(Bn.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(o,void 0,n?.isRefactoring??!1)}};Zp=D([C(0,ge)],Zp);function YN(r){return!!r&&y.isUri(r.sessionResource)&&r.$mid===19}var DW;(u=>{let r;(T=>(T[T.Streaming=0]="Streaming",T[T.WaitingForConfirmation=1]="WaitingForConfirmation",T[T.Executing=2]="Executing",T[T.WaitingForPostApproval=3]="WaitingForPostApproval",T[T.Completed=4]="Completed",T[T.Cancelled=5]="Cancelled"))(r=u.StateKind||={});function e(m,g){if(m.kind==="toolInvocationSerialized")return m.isConfirmed===void 0||typeof m.isConfirmed=="boolean"?{type:m.isConfirmed?4:0}:m.isConfirmed;let v=m.state.read(g);if(!(v.type===0||v.type===1))return v.type===5?{type:v.reason}:v.confirmed}u.executionConfirmedOrDenied=e;function t(m,g){let v=e(m);if(v)return Promise.resolve(v);let h=new q;return new Promise(x=>{g&&h.add(g.onCancellationRequested(()=>{x({type:0})})),h.add(gi(S=>{let T=e(m,S);T&&(h.dispose(),x(T))}))}).finally(()=>{h.dispose()})}u.awaitConfirmation=t;function n(m,g){let v=m.state.read(g);if(v.type===4)return v.postConfirmed||{type:1};if(v.type===5)return{type:v.reason}}function o(m,g){let v=m?.state.get();return v?.type===1||v?.type===3?(v.confirm(g),!0):!1}u.confirmWith=o;function i(m,g){let v=n(m);if(v)return Promise.resolve(v);let h=new q;return new Promise(x=>{g&&h.add(g.onCancellationRequested(()=>{x({type:0})})),h.add(gi(S=>{let T=n(m,S);T&&(h.dispose(),x(T))}))}).finally(()=>{h.dispose()})}u.awaitPostConfirmation=i;function s(m,g){if(m.kind==="toolInvocationSerialized")return m.resultDetails;let v=m.state.read(g);if(v.type===4||v.type===3)return v.resultDetails}u.resultDetails=s;function a(m,g){if(m.kind==="toolInvocationSerialized")return!0;let v=m.state.read(g);return v.type===4||v.type===5}u.isComplete=a;function l(m,g){return m.kind==="toolInvocationSerialized"?!1:m.state.read(g).type===0}u.isStreaming=l;function d(m,g){if(m.kind==="toolInvocationSerialized")return;let v=m.state.read(g);if(v.type!==0)return v.parameters}u.getParameters=d;function c(m,g){if(m.kind==="toolInvocationSerialized")return;let v=m.state.read(g);if(v.type!==0)return v.confirmationMessages}u.getConfirmationMessages=c})(DW||={});var RW;(o=>{function r(i){return i.kind==="sent"}o.isSent=r;function e(i){return i.kind==="rejected"}o.isRejected=e;function t(i){return i.kind==="queued"}o.isQueued=t;function n(i){if(i.kind!=="sent")throw new Error(`Expected ChatSendResult to be 'sent', but was '${i.kind}'`)}o.assertSent=n})(RW||={});var nS=M("IChatService");var em=class{constructor(e,t,n,o,i,s,a){this._extension=e;this._request=t;this._proxy=n;this._commandsConverter=o;this._sessionDisposables=i;this._pendingCarouselResolvers=s;this._token=a;this._stopWatch=uo.create(!1);this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let n=function(l){if(e._isClosed){let d=new Error("Response stream has been closed");throw Error.captureStackTrace(d,l),d}},s=function(l,d){if(o.push(d!==void 0?[l,d]:l)===1&&queueMicrotask(()=>{let u=i;i=[],e._proxy.$handleProgressChunk(e._request.requestId,o).finally(()=>{u.forEach(m=>m())}),o.length=0}),d!==void 0)return new Promise(u=>{i.push(u)})},e=this;this._stopWatch.reset();let t=0,o=[],i=[],a=(l,d)=>{if(typeof this._firstProgress>"u"&&(l.kind==="markdownContent"||l.kind==="markdownVuln"||l.kind==="beginToolInvocation")&&(this._firstProgress=this._stopWatch.elapsed()),d){let c=t++,u=s(l,c),m={report:g=>{u.then(()=>{Mt.isMarkdownString(g.value)?s(Cf.from(g),c):s(Od.from(g),c)})}};Promise.all([u,d(m)]).then(([g,v])=>{s(lP.from(v),c)})}else s(l)};this._apiObject=Object.freeze({clearToPreviousToolInvocation(l){return n(this.markdown),s({kind:"clearToPreviousToolInvocation",reason:l}),this},markdown(l){n(this.markdown);let d=new Ss(l),c=lf.from(d);return a(c),this},markdownWithVulnerabilities(l,d){n(this.markdown),d&&A(e._extension,"chatParticipantAdditions");let c=new Pi(l,d),u=DI.from(c);return a(u),this},codeblockUri(l,d){n(this.codeblockUri),A(e._extension,"chatParticipantAdditions");let c=new ks(l,d),u=PI.from(c);return a(u),this},filetree(l,d){n(this.filetree);let c=new Ts(l,d),u=df.from(c);return a(u),this},anchor(l,d){let c=new Di(l,d);return this.push(c)},button(l){n(this.anchor);let d=new ws(l),c=cf.from(d,e._commandsConverter,e._sessionDisposables);return a(c),this},progress(l,d){n(this.progress);let c=new Ja(l,d),u=d?LI.from(c):xf.from(c);return a(u,d),this},thinkingProgress(l){n(this.thinkingProgress),A(e._extension,"chatParticipantAdditions");let d=new jr(l.text??"",l.id,l.metadata),c=Sf.from(d);return a(c),this},hookProgress(l,d,c){n(this.hookProgress),A(e._extension,"chatParticipantAdditions");let u=new Es(l,d,c),m=AI.from(u);return a(m),this},warning(l){n(this.progress),A(e._extension,"chatParticipantAdditions");let d=new Ri(l),c=Cf.from(d);return a(c),this},reference(l,d){return this.reference2(l,d)},reference2(l,d,c){if(n(this.reference),typeof l=="object"&&"variableName"in l&&A(e._extension,"chatParticipantAdditions"),typeof l=="object"&&"variableName"in l&&!l.value){let u=e._request.variables.variables.find(m=>m.name===l.variableName);if(u){let m;if(u.references?.length)m=u.references.map(g=>({kind:"reference",reference:{variableName:l.variableName,value:g.reference}}));else{let g=new fr(l,d,c);m=[Od.from(g)]}return m.forEach(g=>a(g)),this}}else{let u=new fr(l,d,c),m=Od.from(u);a(m)}return this},codeCitation(l,d,c){n(this.codeCitation),A(e._extension,"chatParticipantAdditions");let u=new _s(l,d,c),m=HI.from(u);a(m)},textEdit(l,d){n(this.textEdit),A(e._extension,"chatParticipantAdditions");let c=new Ai(l,d);c.isDone=d===!0?!0:void 0;let u=OI.from(c);return a(u),this},notebookEdit(l,d){n(this.notebookEdit),A(e._extension,"chatParticipantAdditions");let c=new Ds(l,d),u=UI.from(c);return a(u),this},workspaceEdit(l){n(this.workspaceEdit),A(e._extension,"chatParticipantAdditions");let d=new Za(l),c=FI.from(d);return a(c),this},async externalEdit(l,d){n(this.externalEdit);let c=Array.isArray(l)?l:[l],u=t++,m=pt();await s({kind:"externalEdits",start:!0,resources:c,undoStopId:m},u);try{return await d(),m}finally{await s({kind:"externalEdits",start:!1,resources:c,undoStopId:m},u)}},confirmation(l,d,c,u){n(this.confirmation),A(e._extension,"chatParticipantAdditions");let m=new Cs(l,d,c,u),g=RI.from(m);return a(g),this},async questionCarousel(l,d=!0){n(this.questionCarousel),A(e._extension,"chatParticipantAdditions");let c=pt(),u=new Mi(l,d),m=MI.from(u);m.resolveId=c;let g=new _n;return e._pendingCarouselResolvers.has(e._request.requestId)||e._pendingCarouselResolvers.set(e._request.requestId,new Map),e._pendingCarouselResolvers.get(e._request.requestId).set(c,g),a(m),pv(g.p,e._token)},beginToolInvocation(l,d,c){n(this.beginToolInvocation),A(e._extension,"chatParticipantAdditions");let u={kind:"beginToolInvocation",toolCallId:l,toolName:d,streamData:c?{partialInput:c.partialInput}:void 0,subagentInvocationId:c?.subagentInvocationId};return a(u),this},updateToolInvocation(l,d){n(this.updateToolInvocation),A(e._extension,"chatParticipantAdditions");let c={kind:"updateToolInvocation",toolCallId:l,streamData:{partialInput:d.partialInput}};return a(c),this},push(l){if(n(this.push),(l instanceof Ai||l instanceof Ds||l instanceof Pi||l instanceof Ri||l instanceof Cs||l instanceof Mi||l instanceof _s||l instanceof Ps||l instanceof Xa||l instanceof Td||l instanceof jr||l instanceof Ya||l instanceof Ja)&&A(e._extension,"chatParticipantAdditions"),l instanceof fr)this.reference2(l.value,l.iconPath,l.options);else if(l instanceof Ja){let d=l.task?LI.from(l):xf.from(l);a(d,l.task)}else if(l instanceof jr){let d=Sf.from(l);a(d)}else if(l instanceof Di){let d=$u.from(l);if(l.resolve){A(e._extension,"chatParticipantAdditions"),d.resolveId=pt();let c=new Re;l.resolve(c.token).then(()=>{let u=$u.from(l);e._proxy.$handleAnchorResolve(e._request.requestId,d.resolveId,u)}).then(()=>c.dispose(),()=>c.dispose()),e._sessionDisposables.add(J(()=>c.dispose(!0)))}a(d)}else{if(l instanceof Td)return this.externalEdit(l.uris,l.callback).then(c=>l.didGetApplied(c)),this;{let d=Qu.from(l,e._commandsConverter,e._sessionDisposables);a(d)}}return this},usage(l){n(this.usage),A(e._extension,"chatParticipantAdditions");let d={kind:"usage",promptTokens:l.promptTokens,completionTokens:l.completionTokens,promptTokenDetails:l.promptTokenDetails};return a(d),this}})}return this._apiObject}},oS=class r extends H{constructor(t,n,o,i,s,a,l,d){super();this._logService=n;this._commands=o;this._documents=i;this._editorsAndDocuments=s;this._languageModels=a;this._diagnostics=l;this._tools=d;this._agents=new Map;this._participantDetectionProviders=new Map;this._promptFileProviders=new Map;this._sessionDisposables=this._register(new _h);this._completionDisposables=this._register(new Oo);this._inFlightRequests=new Set;this._pendingCarouselResolvers=new Map;this._onDidChangeChatRequestTools=this._register(new E);this.onDidChangeChatRequestTools=this._onDidChangeChatRequestTools.event;this._onDidDisposeChatSession=this._register(new E);this.onDidDisposeChatSession=this._onDidDisposeChatSession.event;this._onDidChangeActiveChatPanelSessionResource=this._register(new E);this.onDidChangeActiveChatPanelSessionResource=this._onDidChangeActiveChatPanelSessionResource.event;this._proxy=t.getProxy(N.MainThreadChatAgents2),o.registerArgumentProcessor({processArgument:c=>YN(c)?null:c})}static{this._idPool=0}static{this._participantDetectionProviderIdPool=0}static{this._contributionsProviderIdPool=0}get activeChatPanelSessionResource(){return this._activeChatPanelSessionResource}async transferActiveChat(t){await this._proxy.$transferActiveChatSession(t)}createChatAgent(t,n,o){let i=r._idPool++,s=new rS(t,n,this._proxy,i,o);return this._agents.set(i,s),this._proxy.$registerAgent(i,t.identifier,n,{},void 0),s.apiAgent}createDynamicChatAgent(t,n,o,i){let s=r._idPool++,a=new rS(t,n,this._proxy,s,i);return this._agents.set(s,a),this._proxy.$registerAgent(s,t.identifier,n,{isSticky:!0},o),a.apiAgent}registerChatParticipantDetectionProvider(t,n){let o=r._participantDetectionProviderIdPool++;return this._participantDetectionProviders.set(o,new cR(t,n)),this._proxy.$registerChatParticipantDetectionProvider(o),J(()=>{this._participantDetectionProviders.delete(o),this._proxy.$unregisterChatParticipantDetectionProvider(o)})}registerPromptFileProvider(t,n,o){let i=r._contributionsProviderIdPool++;this._promptFileProviders.set(i,{extension:t,provider:o}),this._proxy.$registerPromptFileProvider(i,n,t.identifier);let s=new q,a;switch(n){case"agent":a=o.onDidChangeCustomAgents;break;case"instructions":a=o.onDidChangeInstructions;break;case"prompt":a=o.onDidChangePromptFiles;break;case"skill":a=o.onDidChangeSkills;break}return a&&s.add(a(()=>{this._proxy.$onDidChangePromptFiles(i)})),s.add(J(()=>{this._promptFileProviders.delete(i),this._proxy.$unregisterPromptFileProvider(i)})),s}async $providePromptFiles(t,n,o,i){let s=this._promptFileProviders.get(t);if(!s)return;let a=s.provider,l;switch(n){case"agent":l=await a.provideCustomAgents(o,i)??void 0;break;case"instructions":l=await a.provideInstructions(o,i)??void 0;break;case"prompt":l=await a.providePromptFiles(o,i)??void 0;break;case"skill":l=await a.provideSkills(o,i)??void 0;break}return l}async $detectChatParticipant(t,n,o,i,s){let a=this._participantDetectionProviders.get(t);if(!a)return;let{request:l,location:d,history:c}=await this._createRequest(n,o,a.extension),u=await this.getModelForRequest(l,a.extension),m=await this.getToolsForRequest(a.extension,l.userSelectedTools,u.id,s),g=Ju.to(l,d,u,this.getDiagnosticsWhenEnabled(a.extension),m,a.extension,this._logService);return a.provider.provideParticipantDetection(g,{history:c,yieldRequested:!1},{participants:i.participants,location:Xu.to(i.location)},s)}async _createRequest(t,n,o){let i=$t(t),s=await this.prepareHistoryTurns(o,i.agentId,n),a;if(i.locationData?.type==="editor"){let l=this._documents.getDocument(i.locationData.document),d=this._editorsAndDocuments.getEditor(i.locationData.id);a=new Ou(d.value,l,Qn.to(i.locationData.selection),V.to(i.locationData.wholeRange))}else if(i.locationData?.type==="notebook"){let l=this._documents.getDocument(i.locationData.sessionInputUri);a=new Nu(l)}else i.locationData?.type,"terminal";return{request:i,location:a,history:s}}async getModelForRequest(t,n){let o;if(t.userSelectedModelId&&(o=await this._languageModels.getLanguageModelByIdentifier(n,t.userSelectedModelId)),!o&&(o=await this._languageModels.getDefaultLanguageModel(n),!o))throw new Error("Language model unavailable");return o}async $setRequestTools(t,n){let o=[...this._inFlightRequests].find(s=>s.requestId===t);if(!o)return;o.extRequest.tools.clear();let i=await this.getToolsForRequest(o.extension,n,o.extRequest.model.id,be.None);for(let[s,a]of i)o.extRequest.tools.set(s,a);this._onDidChangeChatRequestTools.fire(o.extRequest)}$setYieldRequested(t){let n=[...this._inFlightRequests].find(o=>o.requestId===t);n&&(n.yieldRequested=!0)}async $invokeAgent(t,n,o,i){let s=this._agents.get(t);if(!s)throw new Error(`[CHAT](${t}) CANNOT invoke agent because the agent is not registered`);let a,l;try{let{request:d,location:c,history:u}=await this._createRequest(n,o,s.extension),m=this._sessionDisposables.get(d.sessionResource);m||(m=new q,this._sessionDisposables.set(d.sessionResource,m)),a=new em(s.extension,d,this._proxy,this._commands.converter,m,this._pendingCarouselResolvers,i);let g=await this.getModelForRequest(d,s.extension),v=await this.getToolsForRequest(s.extension,d.userSelectedTools,g.id,i),h=Ju.to(d,c,g,this.getDiagnosticsWhenEnabled(s.extension),v,s.extension,this._logService);l={requestId:n.requestId,extRequest:h,extension:s.extension,hooks:d.hooks,yieldRequested:!1},this._inFlightRequests.add(l);let x;o.chatSessionContext&&(x={chatSessionItem:{resource:y.revive(o.chatSessionContext.chatSessionResource),label:o.chatSessionContext.isUntitled?"Untitled Session":"Session"},isUntitled:o.chatSessionContext.isUntitled,initialSessionOptions:o.chatSessionContext.initialSessionOptions});let S={history:u,chatSessionContext:x,get yieldRequested(){return l?.yieldRequested??!1}},T=s.invoke(h,S,a.apiObject,i);return await MW(1e3,Promise.resolve(T).then(P=>{if(P?.metadata)try{JSON.stringify(P.metadata)}catch(Y){let G=`result.metadata MUST be JSON.stringify-able. Got error: ${Y.message}`;return this._logService.error(`[${s.extension.identifier.value}] [@${s.id}] ${G}`,s.extension),{errorDetails:{message:G},timings:a?.timings,nextQuestion:P.nextQuestion}}let L;return P?.errorDetails&&(L={...P.errorDetails,responseIsIncomplete:!0}),(L?.responseIsRedacted||L?.isQuotaExceeded||L?.isRateLimited||L?.confirmationButtons||L?.code)&&A(s.extension,"chatParticipantPrivate"),{errorDetails:L,timings:a?.timings,metadata:P?.metadata,nextQuestion:P?.nextQuestion,details:P?.details}}),i)}catch(d){this._logService.error(d,s.extension),d instanceof Po&&d.cause&&(d=d.cause);let c=d instanceof Error&&d.name==="ChatQuotaExceeded",u=d instanceof Error&&d.name==="ChatRateLimited";return{errorDetails:{message:Dr(d),responseIsIncomplete:!0,isQuotaExceeded:c,isRateLimited:u}}}finally{l&&this._inFlightRequests.delete(l);let d=this._pendingCarouselResolvers.get(n.requestId);if(d){for(let c of d.values())c.complete(void 0);this._pendingCarouselResolvers.delete(n.requestId)}a?.close()}}getDiagnosticsWhenEnabled(t){return Fe(t,"chatReferenceDiagnostic")?this._diagnostics.getDiagnostics():[]}async getToolsForRequest(t,n,o,i){if(!n)return new Map;let s=new Map;for(let a of this._tools.getTools(t))typeof n[a.name]=="boolean"&&s.set(a,n[a.name]);return s}async prepareHistoryTurns(t,n,o){let i=[];for(let s of o.history){let a=Yu.to(s.result),l=n===s.request.agentId||ZN(s.request.agentId)&&ZN(n)?a:{...a,metadata:void 0},d=[],c=[];for(let v of s.request.variables.variables)if(v.kind==="tool")c.push(Nd.to(v));else if(v.kind==="toolset")c.push(...v.value.map(Nd.to));else{let h=VI.to(v,this.getDiagnosticsWhenEnabled(t),this._logService);h&&d.push(h)}let u=Fe(t,"chatParticipantPrivate")?s.request.editedFileEvents:void 0,m=new Rs(s.request.message,s.request.command,d,s.request.agentId,c,u,s.request.requestId);i.push(m);let g=Ze(s.response.map(v=>Qu.toContent(v,this._commands.converter)));i.push(new Lu(g,l,s.request.agentId,s.request.command))}return i}$releaseSession(t){let n=y.revive(t);this._sessionDisposables.deleteAndDispose(n);let o=va.parseLocalSessionId(n);o&&this._onDidDisposeChatSession.fire(o)}$acceptActiveChatSession(t){let n=t?y.revive(t):void 0;this._activeChatPanelSessionResource?.toString()!==n?.toString()&&(this._activeChatPanelSessionResource=n,this._onDidChangeActiveChatPanelSessionResource.fire(n))}async $provideFollowups(t,n,o,i,s){let a=this._agents.get(n);if(!a)return Promise.resolve([]);let l=$t(t),d=await this.prepareHistoryTurns(a.extension,a.id,i),c=Yu.to(o);return(await a.provideFollowups(c,{history:d,yieldRequested:!1},s)).filter(u=>{let m=!u.participant||It.some(this._agents.values(),g=>g.id===u.participant&&_e.equals(g.extension.identifier,a.extension.identifier));return m||this._logService.warn(`[@${a.id}] ChatFollowup refers to an unknown participant: ${u.participant}`),m}).map(u=>kI.from(u,l))}$acceptFeedback(t,n,o){let i=this._agents.get(t);if(!i)return;let s=Yu.to(n),a;switch(o.direction){case 0:a=0;break;case 1:a=1;break}let l={result:s,kind:a,unhelpfulReason:Fe(i.extension,"chatParticipantAdditions")?o.reason:void 0};i.acceptFeedback(Object.freeze(l))}$handleQuestionCarouselAnswer(t,n,o){let i=this._pendingCarouselResolvers.get(t);if(!i)return;let s=i.get(n);s&&(s.complete(o),i.delete(n)),i.size===0&&this._pendingCarouselResolvers.delete(t)}$acceptAction(t,n,o){let i=this._agents.get(t);if(!i||o.action.kind==="vote")return;let s=uP.to(n,o,this._commands.converter);s&&i.acceptAction(Object.freeze(s))}async $invokeCompletionProvider(t,n,o){let i=this._agents.get(t);if(!i)return[];let s=this._completionDisposables.get(t);return s?s.clear():(s=new q,this._completionDisposables.set(t,s)),(await i.invokeCompletionProvider(n,o)).map(l=>cP.from(l,this._commands.converter,s))}async $provideChatTitle(t,n,o){let i=this._agents.get(t);if(!i)return;let s=await this.prepareHistoryTurns(i.extension,i.id,{history:n});return await i.provideTitle({history:s,yieldRequested:!1},o)}async $provideChatSummary(t,n,o){let i=this._agents.get(t);if(!i)return;let s=await this.prepareHistoryTurns(i.extension,i.id,{history:n});return await i.provideSummary({history:s,yieldRequested:!1},o)}},cR=class{constructor(e,t){this.extension=e;this.provider=t}},rS=class{constructor(e,t,n,o,i){this.extension=e;this.id=t;this._proxy=n;this._handle=o;this._requestHandler=i;this._onDidReceiveFeedback=new E;this._onDidPerformAction=new E;this._pauseStateEmitter=new E}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}setChatRequestPauseState(e){this._pauseStateEmitter.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}async provideFollowups(e,t,n){if(!this._followupProvider)return[];let o=await this._followupProvider.provideFollowups(e,t,n);return o?o.filter(i=>!(i&&"commandId"in i)).filter(i=>!(i&&"message"in i)):[]}async provideTitle(e,t){if(this._titleProvider)return await this._titleProvider.provideChatTitle(e,t)??void 0}async provideSummary(e,t){if(this._summarizer)return await this._summarizer.provideChatSummary(e,t)??void 0}get apiAgent(){let e=!1,t=!1,n=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof y?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof ln?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:ce.from(this._helpTextPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:ce.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,additionalWelcomeMessage:!this._additionalWelcomeMessage||typeof this._additionalWelcomeMessage=="string"?this._additionalWelcomeMessage:ce.from(this._additionalWelcomeMessage)}),t=!1}))},o=this;return{get id(){return o.id},get iconPath(){return o._iconPath},set iconPath(i){o._iconPath=i,n()},get requestHandler(){return o._requestHandler},set requestHandler(i){kh(typeof i=="function","Invalid request handler"),o._requestHandler=i},get followupProvider(){return o._followupProvider},set followupProvider(i){o._followupProvider=i,n()},get helpTextPrefix(){return A(o.extension,"defaultChatParticipant"),o._helpTextPrefix},set helpTextPrefix(i){A(o.extension,"defaultChatParticipant"),o._helpTextPrefix=i,n()},get helpTextPostfix(){return A(o.extension,"defaultChatParticipant"),o._helpTextPostfix},set helpTextPostfix(i){A(o.extension,"defaultChatParticipant"),o._helpTextPostfix=i,n()},get supportIssueReporting(){return A(o.extension,"chatParticipantPrivate"),o._supportIssueReporting},set supportIssueReporting(i){A(o.extension,"chatParticipantPrivate"),o._supportIssueReporting=i,n()},get onDidReceiveFeedback(){return o._onDidReceiveFeedback.event},set participantVariableProvider(i){if(A(o.extension,"chatParticipantAdditions"),o._agentVariableProvider=i,i){if(!i.triggerCharacters.length)throw new Error("triggerCharacters are required");o._proxy.$registerAgentCompletionsProvider(o._handle,o.id,i.triggerCharacters)}else o._proxy.$unregisterAgentCompletionsProvider(o._handle,o.id)},get participantVariableProvider(){return A(o.extension,"chatParticipantAdditions"),o._agentVariableProvider},set additionalWelcomeMessage(i){A(o.extension,"defaultChatParticipant"),o._additionalWelcomeMessage=i,n()},get additionalWelcomeMessage(){return A(o.extension,"defaultChatParticipant"),o._additionalWelcomeMessage},set titleProvider(i){A(o.extension,"defaultChatParticipant"),o._titleProvider=i,n()},get titleProvider(){return A(o.extension,"defaultChatParticipant"),o._titleProvider},set summarizer(i){A(o.extension,"defaultChatParticipant"),o._summarizer=i},get summarizer(){return A(o.extension,"defaultChatParticipant"),o._summarizer},get onDidChangePauseState(){return A(o.extension,"chatParticipantAdditions"),o._pauseStateEmitter.event},onDidPerformAction:Fe(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,dispose(){e=!0,o._followupProvider=void 0,o._onDidReceiveFeedback.dispose(),o._onDidPerformAction.dispose(),o._pauseStateEmitter.dispose(),o._proxy.$unregisterAgent(o._handle)}}}invoke(e,t,n,o){return this._requestHandler(e,t,n,o)}};function MW(r,e,t){return new Promise((n,o)=>{let i=t.onCancellationRequested(async()=>{i.dispose(),await cn(r),n(void 0)});e.then(n,o).finally(()=>i.dispose())})}function ZN(r){return r.startsWith("github.copilot")}var sS=class{constructor(e,t){this.webviews=t;this._renderers=new Map;this._proxy=e.getProxy(N.MainThreadChatOutputRenderer)}registerChatOutputRenderer(e,t,n){if(this._renderers.has(t))throw new Error(`Chat output renderer already registered for: ${t}`);return this._renderers.set(t,{extension:e,renderer:n}),this._proxy.$registerChatOutputRenderer(t,e.identifier,e.extensionLocation),new fe(()=>{this._renderers.delete(t),this._proxy.$unregisterChatOutputRenderer(t)})}async $renderChatOutput(e,t,n,o,i){let s=this._renderers.get(e);if(!s)throw new Error(`No chat output renderer registered for: ${e}`);let a=this.webviews.createNewWebview(o,{},s.extension),l=Object.freeze({webview:a,onDidDispose:a._onDidDispose});return s.renderer.renderChatOutput(Object.freeze({mime:t,value:n.buffer}),l,{},i)}};var uR=class{#e;#t;#n;#o;#s;#i;#l;#a;#d;#c;#r;constructor(e,t,n){this.resource=e,this.#e=t,this.#r=n}get label(){return this.#e}set label(e){this.#e!==e&&(this.#e=e,this.#r())}get iconPath(){return this.#t}set iconPath(e){this.#t!==e&&(this.#t=e,this.#r())}get description(){return this.#n}set description(e){this.#n!==e&&(this.#n=e,this.#r())}get badge(){return this.#o}set badge(e){this.#o!==e&&(this.#o=e,this.#r())}get status(){return this.#s}set status(e){this.#s!==e&&(this.#s=e,this.#r())}get archived(){return this.#i}set archived(e){this.#i!==e&&(this.#i=e,this.#r())}get tooltip(){return this.#l}set tooltip(e){this.#l!==e&&(this.#l=e,this.#r())}get timing(){return this.#a}set timing(e){this.#a!==e&&(this.#a=e,this.#r())}get changes(){return this.#d}set changes(e){this.#d!==e&&(this.#d=e,this.#r())}get metadata(){return this.#c}set metadata(e){if(e!==void 0)try{JSON.stringify(e)}catch{throw new Error("metadata must be JSON-serializable")}Wt(this.#c,e)||(this.#c=e,this.#r())}};function LW(r,e){let t={addedOrUpdated:new qe,removed:new Yo};for(let[n,o]of e)r.get(n)!==o&&t.addedOrUpdated.set(n,o);for(let n of r.keys())e.has(n)||t.removed.add(n);return t}function OW(r){return{addedOrUpdated:r.addedOrUpdated?Array.from(r.addedOrUpdated.values(),Tf.from):[],removed:r.removed?Array.from(r.removed.keys()):[]}}var aS=class{#e=new qe;#t;#n;constructor(e,t){this.#t=t,this.#n=e}get size(){return this.#e.size}replace(e){if(!e.length&&!this.#e.size)return;let t=new qe(e.map(o=>[o.resource,o])),n=LW(this.#e,t);!n.addedOrUpdated?.size&&!n.removed?.size||(this.#e=t,this.#t.$updateChatSessionItems(this.#n,OW(n)))}forEach(e,t){for(let[n,o]of this.#e)e.call(t,o,this)}add(e){let t=this.#e.get(e.resource);t&&t===e||(this.#e.set(e.resource,e),this.#t.$addOrUpdateChatSessionItem(this.#n,Tf.from(e)))}delete(e){this.#e.delete(e)&&this.#t.$updateChatSessionItems(this.#n,{addedOrUpdated:[],removed:[e]})}get(e){return this.#e.get(e)}[Symbol.iterator](){return this.#e.entries()}},pR=class{constructor(e,t,n,o,i,s){this.session=e;this.extension=t;this.proxy=o;this.commandsConverter=i;this.sessionDisposables=s;this._pendingCarouselResolvers=new Map;this._stream=new em(t,n,o,i,s,this._pendingCarouselResolvers,be.None)}get activeResponseStream(){return this._stream}getActiveRequestStream(e){return new em(this.extension,e,this.proxy,this.commandsConverter,this.sessionDisposables,this._pendingCarouselResolvers,be.None)}},yl=class extends H{constructor(t,n,o,i){super();this.commands=t;this._languageModels=n;this._extHostRpc=o;this._logService=i;this._itemControllerHandlePool=0;this._chatSessionItemControllers=new Map;this._contentProviderHandlePool=0;this._chatSessionContentProviders=new Map;this._extHostChatSessions=new qe;this._providerOptionGroups=new Map;this._proxy=this._extHostRpc.getProxy(N.MainThreadChatSessions),t.registerArgumentProcessor({processArgument:s=>{if(s&&s.$mid===25){let a=s.session.resource;for(let{controller:l}of this._chatSessionItemControllers.values()){let d=l.items.get(a);if(d)return d}return this._logService.warn(`No chat session found with uri: ${a}`),s}return s}})}static{this._sessionHandlePool=0}registerChatSessionItemProvider(t,n,o){let i=this._itemControllerHandlePool++,s=new q,a=s.add(new E),l=new aS(i,this._proxy),d={id:n,items:l,createChatSessionItem:(c,u)=>{throw new Error("Not implemented for providers")},onDidChangeChatSessionItemState:a.event,dispose:()=>{s.dispose()},refreshHandler:async c=>{let u=await o.provideChatSessionItems(c)??[];l.replace(u)}};return this._chatSessionItemControllers.set(i,{chatSessionType:n,controller:d,extension:t,disposable:s,onDidChangeChatSessionItemStateEmitter:a}),this._proxy.$registerChatSessionItemController(i,n),o.onDidChangeChatSessionItems&&s.add(o.onDidChangeChatSessionItems(()=>{this._logService.trace(`ExtHostChatSessions. Provider items changed for ${n}`),d.refreshHandler(be.None)})),o.onDidCommitChatSessionItem&&s.add(o.onDidCommitChatSessionItem(c=>{let{original:u,modified:m}=c;this._proxy.$onDidCommitChatSessionItem(i,u.resource,m.resource)})),{dispose:()=>{this._chatSessionItemControllers.delete(i),s.dispose(),this._proxy.$unregisterChatSessionItemController(i)}}}createChatSessionItemController(t,n,o){let i=this._itemControllerHandlePool++,s=new q,a=!1,l=s.add(new E),d=new aS(i,this._proxy),c=Object.freeze({id:n,refreshHandler:async u=>{if(a)throw new Error("ChatSessionItemController has been disposed");this._logService.trace(`ExtHostChatSessions. Controller(${n}).refresh()`),await o(u)},items:d,onDidChangeChatSessionItemState:l.event,createChatSessionItem:(u,m)=>{if(a)throw new Error("ChatSessionItemController has been disposed");let g=new uR(u,m,()=>{d.get(u)===g&&this._proxy.$addOrUpdateChatSessionItem(i,Tf.from(g))});return g},dispose:()=>{a=!0,s.dispose()}});return this._chatSessionItemControllers.set(i,{controller:c,extension:t,disposable:s,chatSessionType:n,onDidChangeChatSessionItemStateEmitter:l}),this._proxy.$registerChatSessionItemController(i,n),s.add(J(()=>{this._chatSessionItemControllers.delete(i),this._proxy.$unregisterChatSessionItemController(i)})),c}registerChatSessionContentProvider(t,n,o,i,s){let a=this._contentProviderHandlePool++,l=new q;return this._chatSessionContentProviders.set(a,{provider:i,extension:t,capabilities:s,disposable:l}),this._proxy.$registerChatSessionContentProvider(a,n),i.onDidChangeChatSessionOptions&&l.add(i.onDidChangeChatSessionOptions(d=>{this._proxy.$onDidChangeChatSessionOptions(a,d.resource,d.updates)})),i.onDidChangeChatSessionProviderOptions&&l.add(i.onDidChangeChatSessionProviderOptions(()=>{this._proxy.$onDidChangeChatSessionProviderOptions(a)})),new fe(()=>{this._chatSessionContentProviders.delete(a),l.dispose(),this._proxy.$unregisterChatSessionContentProvider(a)})}async $provideChatSessionContent(t,n,o){let i=this._chatSessionContentProviders.get(t);if(!i)throw new Error(`No provider for handle ${t}`);let s=y.revive(n),a=await i.provider.provideChatSessionContent(s,o);if(o.isCancellationRequested)throw new xt;let l=new q,d=yl._sessionHandlePool++,c=s.toString(),u=new pR(a,i.extension,{sessionResource:s,requestId:"ongoing",agentId:c,message:"",variables:{variables:[]},location:"panel"},{$handleProgressChunk:(v,h)=>this._proxy.$handleProgressChunk(t,s,v,h),$handleAnchorResolve:(v,h,x)=>{this._proxy.$handleAnchorResolve(t,s,v,h,x)}},this.commands.converter,l),m=l.add(new Re);this._extHostChatSessions.set(s,{sessionObj:u,disposeCts:m}),a.activeResponseCallback&&Promise.resolve(a.activeResponseCallback(u.activeResponseStream.apiObject,m.token)).finally(()=>{this._proxy.$handleProgressComplete(t,s,"ongoing")});let{capabilities:g}=i;return{id:d+"",resource:y.revive(s),hasActiveResponseCallback:!!a.activeResponseCallback,hasRequestHandler:!!a.requestHandler,supportsInterruption:!!g?.supportsInterruptions,options:a.options,history:a.history.map(v=>v instanceof Rs?this.convertRequestTurn(v):this.convertResponseTurn(v,l))}}async $provideHandleOptionsChange(t,n,o,i){let s=y.revive(n),a=this._chatSessionContentProviders.get(t);if(!a){this._logService.warn(`No provider for handle ${t}`);return}if(!a.provider.provideHandleOptionsChange){this._logService.debug(`Provider for handle ${t} does not implement provideHandleOptionsChange`);return}try{let l=o.map(d=>({optionId:d.optionId,value:d.value===void 0?void 0:typeof d.value=="string"?d.value:d.value.id}));await a.provider.provideHandleOptionsChange(s,l,i)}catch(l){this._logService.error(`Error calling provideHandleOptionsChange for handle ${t}, sessionResource ${s}:`,l)}}async $provideChatSessionProviderOptions(t,n){let o=this._chatSessionContentProviders.get(t);if(!o){this._logService.warn(`No provider for handle ${t} when requesting chat session options`);return}let i=o.provider;if(i.provideChatSessionProviderOptions)try{let{optionGroups:s}=await i.provideChatSessionProviderOptions(n);return s?(this._providerOptionGroups.set(t,s),{optionGroups:s}):void 0}catch(s){this._logService.error(`Error calling provideChatSessionProviderOptions for handle ${t}:`,s);return}}async $interruptChatSessionActiveResponse(t,n,o){this._extHostChatSessions.get(y.revive(n))?.disposeCts.cancel()}async $disposeChatSessionContent(t,n){let o=this._extHostChatSessions.get(y.revive(n));if(!o){this._logService.warn(`No chat session found for resource: ${n}`);return}o.disposeCts.cancel(),o.sessionObj.sessionDisposables.dispose(),this._extHostChatSessions.delete(y.revive(n))}async $invokeChatSessionRequestHandler(t,n,o,i,s){let a=this._extHostChatSessions.get(y.revive(n));if(!a||!a.sessionObj.session.requestHandler)return{};let l=Ju.to(o,void 0,await this.getModelForRequest(o,a.sessionObj.extension),[],new Map,a.sessionObj.extension,this._logService),d=a.sessionObj.getActiveRequestStream(o);return await a.sessionObj.session.requestHandler(l,{history:i,yieldRequested:!1},d.apiObject,s),{}}async getModelForRequest(t,n){let o;if(t.userSelectedModelId&&(o=await this._languageModels.getLanguageModelByIdentifier(n,t.userSelectedModelId)),!o&&(o=await this._languageModels.getDefaultLanguageModel(n),!o))throw new Error("Language model unavailable");return o}convertRequestTurn(t){let n=t.references.map(o=>this.convertReferenceToVariable(o));return{type:"request",id:t.id,prompt:t.prompt,participant:t.participant,command:t.command,variableData:n.length>0?{variables:n}:void 0,modelId:t.modelId}}convertReferenceToVariable(t){let n=t.value&&typeof t.value=="object"&&"uri"in t.value&&"range"in t.value?br.from(t.value):t.value,o=t.range?{start:t.range[0],endExclusive:t.range[1]}:void 0;if(n&&n instanceof el&&Array.isArray(n.diagnostics)&&n.diagnostics.length&&n.diagnostics[0][1].length){let a=Ls.from(n.diagnostics[0][1][0]),l={filterRange:{startLineNumber:a.startLineNumber,startColumn:a.startColumn,endLineNumber:a.endLineNumber,endColumn:a.endColumn},filterSeverity:a.severity,filterUri:n.diagnostics[0][0],problemMessage:n.diagnostics[0][1][0].message};return Hw.toEntry(l)}if(At.isLocation(t.value)&&t.name.startsWith("sym:")){let a=br.from(t.value);return{id:t.id,name:t.name,fullName:t.name.substring(4),value:{uri:t.value.uri,range:a.range},symbolKind:6,icon:_w.toIcon(6),kind:"symbol",range:o}}if(y.isUri(n)&&t.name.startsWith("prompt:")&&t.id.startsWith("vscode.prompt.file")&&t.id.endsWith(n.toString()))return{id:t.id,name:`prompt:${Bt(n)}`,value:n,kind:"promptFile",modelDescription:"Prompt instructions file",isRoot:!0,automaticallyAdded:!1,range:o};let i=y.isUri(n)||n&&typeof n=="object"&&"uri"in n,s=i&&y.isUri(n)&&n.path.endsWith("/");return{id:t.id,name:t.name,value:n,modelDescription:t.modelDescription,range:o,kind:s?"directory":i?"file":"generic"}}convertResponseTurn(t,n){return{type:"response",parts:Ze(t.response.map(i=>Qu.from(i,this.commands.converter,n))),participant:t.participant}}async $invokeOptionGroupSearch(t,n,o,i){let s=this._providerOptionGroups.get(t);if(!s)return this._logService.warn(`No option groups found for provider handle ${t}`),[];let a=s.find(l=>l.id===n);if(!a||!a.onSearch)return this._logService.warn(`No onSearch callback found for option group ${n}`),[];try{return await a.onSearch(o,i)??[]}catch(l){return this._logService.error(`Error calling onSearch for option group ${n}:`,l),[]}}async $refreshChatSessionItems(t,n){let o=this._chatSessionItemControllers.get(t);if(!o){this._logService.warn(`No controller found for handle ${t}`);return}await o.controller.refreshHandler(n)}$onDidChangeChatSessionItemState(t,n,o){let i=this._chatSessionItemControllers.get(t);if(!i){this._logService.warn(`No controller found for handle ${t}`);return}let s=y.revive(n),a=i.controller.items.get(s);if(!a){this._logService.warn(`No item found for session resource ${s.toString()}`);return}a.archived=o,i.onDidChangeChatSessionItemStateEmitter.fire(a)}};yl=D([C(2,ge),C(3,ue)],yl);var lS=class{constructor(e){this._items=new Map;this._proxy=e.getProxy(N.MainThreadChatStatus)}createChatStatusItem(e,t){let n=NW(e.identifier,t);if(this._items.has(n))throw new Error(`Chat status item '${t}' already exists`);let o={id:n,title:"",description:"",detail:""},i=!1,s=!1,a=()=>{if(i)throw new Error("Chat status item is disposed");s&&this._proxy.$setEntry(t,o)},l=Object.freeze({id:t,get title(){return o.title},set title(d){o.title=d,a()},get description(){return o.description},set description(d){o.description=d,a()},get detail(){return o.detail},set detail(d){o.detail=d,a()},show:()=>{s=!0,a()},hide:()=>{s=!1,this._proxy.$disposeEntry(t)},dispose:()=>{i=!0,this._proxy.$disposeEntry(t),this._items.delete(n)}});return this._items.set(n,l),l}};function NW(r,e){return`${_e.toKey(r)}.${e}`}var dS=class{constructor(e){let t=e.getProxy(N.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(n){return t.$writeText(n)}})}};var eU="vscode-cdn.net",UW=`vscode-resource.${eU}`,Yf=`'self' https://*.${eU}`;function Il(r,e){return r.scheme===$.http||r.scheme===$.https?r:(e&&e.authority&&e.isRemote&&r.scheme===$.file&&(r=y.from({scheme:$.vscodeRemote,authority:e.authority,path:r.path})),y.from({scheme:$.https,authority:`${r.scheme}+${FW(r.authority)}.${UW}`,path:r.path,fragment:r.fragment,query:r.query}))}function FW(r){return r.replace(/./g,e=>{let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57?e:"-"+t.toString(16).padStart(4,"0")})}var cS=class{constructor(e,t,n){this._proxy=e;this._editors=t;this._remoteInfo=n;this._handlePool=0;this._disposables=new q;this._insets=new Map;this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{let o=t.getVisibleTextEditors();for(let i of this._insets.values())o.indexOf(i.editor)<0&&i.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,n,o,i){let s;for(let g of this._editors.getVisibleTextEditors(!0))if(g.value===e){s=g;break}if(!s)throw new Error("not a visible editor");let a=this,l=this._handlePool++,d=new E,c=new E,u=new class{constructor(){this._html="";this._options=Object.create(null)}asWebviewUri(g){return Il(g,a._remoteInfo)}get cspSource(){return Yf}set options(g){this._options=g,a._proxy.$setOptions(l,g)}get options(){return this._options}set html(g){this._html=g,a._proxy.$setHtml(l,g)}get html(){return this._html}get onDidReceiveMessage(){return d.event}postMessage(g){return a._proxy.$postMessage(l,g)}},m=new class{constructor(){this.editor=e;this.line=t;this.height=n;this.webview=u;this.onDidDispose=c.event}dispose(){a._insets.delete(l)&&(a._proxy.$disposeEditorInset(l),c.fire(),c.dispose(),d.dispose())}};return this._proxy.$createEditorInset(l,s.id,s.value.document.uri,t+1,n,o||{},i.identifier,i.extensionLocation),this._insets.set(l,{editor:e,inset:m,onDidReceiveMessage:d}),m}$onDidDispose(e){let t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}};var uS=class r{constructor(e){this.providers=new Map;this._proxy=e.getProxy(N.MainThreadCodeMapper)}static{this._providerHandlePool=0}async $mapCode(e,t,n){let o=this.providers.get(e);if(!o)throw new Error(`Received request to map code for unknown provider handle ${e}`);let i={textEdit:(l,d)=>{d=hn(d),this._proxy.$handleProgress(t.requestId,{uri:l,edits:d.map(tn.from)})},notebookEdit:(l,d)=>{d=hn(d),this._proxy.$handleProgress(t.requestId,{uri:l,edits:d.map(NI.from)})}},s={location:t.location,chatRequestId:t.chatRequestId,chatRequestModel:t.chatRequestModel,chatSessionId:t.chatSessionResource?va.parseLocalSessionId(y.revive(t.chatSessionResource)):void 0,codeBlocks:t.codeBlocks.map(l=>({code:l.code,resource:y.revive(l.resource),markdownBeforeBlock:l.markdownBeforeBlock}))};return await o.provideMappedEdits(s,i,n)??null}registerMappedEditsProvider(e,t){let n=r._providerHandlePool++;return this._proxy.$registerCodeMapperProvider(n,e.displayName??e.name),this.providers.set(n,t),{dispose:()=>this._proxy.$unregisterCodeMapperProvider(n)}}};function tU(r,e,t){let n=r.getProxy(N.MainThreadComments);class o{constructor(){this._commentControllers=new Map;this._commentControllersByExtension=new Un;e.registerArgumentProcessor({processArgument:h=>{if(h&&h.$mid===6){let x=this._commentControllers.get(h.handle);return x?x.value:h}else if(h&&h.$mid===7){let x=h,S=this._commentControllers.get(x.commentControlHandle);if(!S)return x;let T=S.getCommentThread(x.commentThreadHandle);return T?T.value:x}else if(h&&(h.$mid===9||h.$mid===8)){let x=this._commentControllers.get(h.thread.commentControlHandle);if(!x)return h;let S=x.getCommentThread(h.thread.commentThreadHandle);return S?h.$mid===8?S.value:{thread:S.value,text:h.text}:h}else if(h&&h.$mid===10){let x=this._commentControllers.get(h.thread.commentControlHandle);if(!x)return h;let S=x.getCommentThread(h.thread.commentThreadHandle);if(!S)return h;let T=h.commentUniqueId,P=S.getCommentByUniqueId(T);return P||h}else if(h&&h.$mid===11){let x=this._commentControllers.get(h.thread.commentControlHandle);if(!x)return h;let S=x.getCommentThread(h.thread.commentThreadHandle);if(!S)return h;let T=h.text,P=h.commentUniqueId,L=S.getCommentByUniqueId(P);return L?(typeof L.body=="string"?L.body=T:L.body=new Mt(T),L):h}return h}})}static{this.handlePool=0}createCommentController(h,x,S){let T=o.handlePool++,P=new s(h,T,x,S);this._commentControllers.set(P.handle,P);let L=this._commentControllersByExtension.get(h.identifier)||[];return L.push(P),this._commentControllersByExtension.set(h.identifier,L),P.value}async $createCommentThreadTemplate(h,x,S,T){let P=this._commentControllers.get(h);P&&P.$createCommentThreadTemplate(x,S,T)}async $setActiveComment(h,x){let S=this._commentControllers.get(h);S&&S.$setActiveComment(x??void 0)}async $updateCommentThreadTemplate(h,x,S){let T=this._commentControllers.get(h);T&&T.$updateCommentThreadTemplate(x,S)}$deleteCommentThread(h,x){this._commentControllers.get(h)?.$deleteCommentThread(x)}async $updateCommentThread(h,x,S){this._commentControllers.get(h)?.$updateCommentThread(x,S)}async $provideCommentingRanges(h,x,S){let T=this._commentControllers.get(h);if(!T||!T.commentingRangeProvider)return Promise.resolve(void 0);let P=await t.ensureDocumentData(y.revive(x));return Qt(async()=>{let L=await T.commentingRangeProvider?.provideCommentingRanges(P.document,S),Y;return Array.isArray(L)?Y={ranges:L,fileComments:!1}:L?Y={ranges:L.ranges||[],fileComments:L.enableFileComments||!1}:Y=L??void 0,Y}).then(L=>{let Y;return L&&(Y={ranges:L.ranges.map(G=>V.from(G)),fileComments:L.fileComments}),Y})}$toggleReaction(h,x,S,T,P){let L=this._commentControllers.get(h);return!L||!L.reactionHandler?Promise.resolve(void 0):Qt(()=>{let Y=L.getCommentThread(x);if(Y){let G=Y.getCommentByUniqueId(T.uniqueIdInThread);if(L!==void 0&&G&&L.reactionHandler)return L.reactionHandler(G,d(P))}return Promise.resolve(void 0)})}}let g=class g{constructor(h,x,S,T,P,L,Y,G,z){this._commentControllerHandle=x;this._id=S;this._uri=T;this._range=P;this._comments=L;this.extensionDescription=Y;this._isTemplate=G;this.handle=g._handlePool++;this.commentHandle=0;this.modifications=Object.create(null);this._onDidUpdateCommentThread=new E;this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event;this._canReply=!0;this._commentsMap=new Map;this._acceptInputDisposables=new En;this._acceptInputDisposables.value=new q,this._id===void 0&&(this._id=`${h}.${this.handle}`),n.$createCommentThread(x,this.handle,this._id,this._uri,V.from(this._range),this._comments.map(Q=>a(this,Q,this._commentsMap,this.extensionDescription)),Y.identifier,this._isTemplate,z),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{n.$deleteCommentThread(x,this.handle)}});let K=this;this.value={get uri(){return K.uri},get range(){return K.range},set range(Q){K.range=Q},get comments(){return K.comments},set comments(Q){K.comments=Q},get collapsibleState(){return K.collapsibleState},set collapsibleState(Q){K.collapsibleState=Q},get canReply(){return K.canReply},set canReply(Q){K.canReply=Q},get contextValue(){return K.contextValue},set contextValue(Q){K.contextValue=Q},get label(){return K.label},set label(Q){K.label=Q},get state(){return K.state},set state(Q){K.state=Q},reveal:(Q,X)=>K.reveal(Q,X),hide:()=>K.hide(),dispose:()=>{K.dispose()}}}static{this._handlePool=0}set threadId(h){this._id=h}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(h){(h===void 0!=(this._range===void 0)||!h||!this._range||!h.isEqual(this._range))&&(this._range=h,this.modifications.range=h,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(h){this._canReply!==h&&(this._canReply=h,this.modifications.canReply=h,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(h){this._label=h,this.modifications.label=h,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(h){this._contextValue=h,this.modifications.contextValue=h,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(h){this._comments=h,this.modifications.comments=h,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(h){this._collapseState!==h&&(this._collapseState=h,this.modifications.collapsibleState=h,this._onDidUpdateCommentThread.fire())}get state(){return this._state}set state(h){this._state=h,typeof h=="object"?(A(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=h.resolved,this.modifications.applicability=h.applicability):this.modifications.state=h,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new q);let h=S=>Object.prototype.hasOwnProperty.call(this.modifications,S),x={};h("range")&&(x.range=V.from(this._range)),h("label")&&(x.label=this.label),h("contextValue")&&(x.contextValue=this.contextValue??null),h("comments")&&(x.comments=this._comments.map(S=>a(this,S,this._commentsMap,this.extensionDescription))),h("collapsibleState")&&(x.collapseState=c(this._collapseState)),h("canReply")&&(x.canReply=this.canReply),h("state")&&(x.state=u(this._state)),h("applicability")&&(x.applicability=m(this._state)),h("isTemplate")&&(x.isTemplate=this._isTemplate),this.modifications={},n.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,x)}getCommentByUniqueId(h){for(let x of this._commentsMap){let S=x[0],T=x[1];if(h===T)return S}}async reveal(h,x){A(this.extensionDescription,"commentReveal");let S;h&&h.body!==void 0?S=h:x=x??h;let T=S?this._commentsMap.get(S):void 0;T??=this._commentsMap.get(this._comments[0]);let P=!0,L=!1;return x?.focus===1?(L=!0,P=!1):x?.focus===2&&(P=!1),n.$revealCommentThread(this._commentControllerHandle,this.handle,T,{preserveFocus:P,focusReply:L})}async hide(){return n.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._onDidUpdateCommentThread.dispose(),this._localDisposables.forEach(h=>h.dispose())}};D([Uf(100)],g.prototype,"eventuallyUpdateCommentThread",1);let i=g;class s{constructor(h,x,S,T){this._extension=h;this._handle=x;this._id=S;this._label=T;this._threads=new Map;n.$registerCommentController(this.handle,S,T,this._extension.identifier.value);let P=this;this.value=Object.freeze({id:P.id,label:P.label,get options(){return P.options},set options(L){P.options=L},get commentingRangeProvider(){return P.commentingRangeProvider},set commentingRangeProvider(L){P.commentingRangeProvider=L},get reactionHandler(){return P.reactionHandler},set reactionHandler(L){P.reactionHandler=L},get activeCommentThread(){return P.activeCommentThread},createCommentThread(L,Y,G){return P.createCommentThread(L,Y,G).value},dispose:()=>{P.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{n.$unregisterCommentController(this.handle)}})}get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(h){this._commentingRangeProvider=h,h?.resourceHints&&A(this._extension,"commentingRangeHint"),n.$updateCommentingRanges(this.handle,h?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(h){this._reactionHandler=h,n.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!h})}get options(){return this._options}set options(h){this._options=h,n.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return A(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return A(this._extension,"activeComment"),this._activeThread?.value}createCommentThread(h,x,S){let T=new i(this.id,this.handle,void 0,h,x,S,this._extension,!1);return this._threads.set(T.handle,T),T}$setActiveComment(h){if(!h){this._activeComment=void 0,this._activeThread=void 0;return}let x=this._threads.get(h.commentThreadHandle);x&&(this._activeComment=h.uniqueIdInThread?x.getCommentByUniqueId(h.uniqueIdInThread):void 0,this._activeThread=x)}$createCommentThreadTemplate(h,x,S){let T=new i(this.id,this.handle,void 0,y.revive(h),V.to(x),[],this._extension,!0,S);return T.collapsibleState=1,this._threads.set(T.handle,T),T}$updateCommentThreadTemplate(h,x){let S=this._threads.get(h);S&&(S.range=V.to(x))}$updateCommentThread(h,x){let S=this._threads.get(h);if(!S)return;(P=>Object.prototype.hasOwnProperty.call(x,P))("collapseState")&&(S.collapsibleState=c(x.collapseState))}$deleteCommentThread(h){this._threads.get(h)?.dispose(),this._threads.delete(h)}getCommentThread(h){return this._threads.get(h)}dispose(){this._threads.forEach(h=>{h.dispose()}),this._localDisposables.forEach(h=>h.dispose())}}function a(v,h,x,S){let T=x.get(h);return T||(T=++v.commentHandle,x.set(h,T)),h.state!==void 0&&A(S,"commentsDraftState"),h.reactions?.some(P=>P.reactors!==void 0)&&A(S,"commentReactor"),{mode:h.mode,contextValue:h.contextValue,uniqueIdInThread:T,body:typeof h.body=="string"?h.body:ce.from(h.body),userName:h.author.name,userIconPath:h.author.iconPath,label:h.label,commentReactions:h.reactions?h.reactions.map(P=>l(P)):void 0,state:h.state,timestamp:h.timestamp?.toJSON()}}function l(v){return{label:v.label,iconPath:v.iconPath?uf(v.iconPath):void 0,count:v.count,hasReacted:v.authorHasReacted,reactors:v.reactors&&v.reactors.length>0&&typeof v.reactors[0]!="string"?v.reactors.map(h=>h.name):v.reactors}}function d(v){return{label:v.label||"",count:v.count||0,iconPath:v.iconPath?y.revive(v.iconPath):"",authorHasReacted:v.hasReacted||!1,reactors:v.reactors?.map(h=>({name:h}))}}function c(v){if(v!==void 0)switch(v){case 1:return 1;case 0:return 0}return 0}function u(v){let h;if(typeof v=="object"?h=v.resolved:h=v,h!==void 0)switch(h){case 0:return 0;case 1:return 1}return 0}function m(v){let h;if(typeof v=="object"&&(h=v.applicability),h!==void 0)switch(h){case 0:return 0;case 1:return 1}return 0}return new o}var pS={},it={exports:pS};(function(r,e){if(typeof pS=="object"&&typeof it=="object")it.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t=e();for(var n in t)(typeof pS=="object"?pS:r)[n]=t[n]}})(typeof self<"u"?self:void 0,(function(){return(function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(n,o,i){t.o(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:i})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,o){if(1&o&&(n=t(n)),8&o||4&o&&typeof n=="object"&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&o&&typeof n!="string")for(var s in n)t.d(i,s,function(a){return n[a]}.bind(null,s));return i},t.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(o,"a",o),o},t.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},t.p="",t(t.s=0)})([function(r,e,t){(function(n){var o;e=r.exports=mt,o=typeof n=="object"&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var R=Array.prototype.slice.call(arguments,0);R.unshift("SEMVER"),console.log.apply(console,R)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],l=e.src=[],d=0,c=d++;l[c]="0|[1-9]\\d*";var u=d++;l[u]="[0-9]+";var m=d++;l[m]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var g=d++;l[g]="("+l[c]+")\\.("+l[c]+")\\.("+l[c]+")";var v=d++;l[v]="("+l[u]+")\\.("+l[u]+")\\.("+l[u]+")";var h=d++;l[h]="(?:"+l[c]+"|"+l[m]+")";var x=d++;l[x]="(?:"+l[u]+"|"+l[m]+")";var S=d++;l[S]="(?:-("+l[h]+"(?:\\."+l[h]+")*))";var T=d++;l[T]="(?:-?("+l[x]+"(?:\\."+l[x]+")*))";var P=d++;l[P]="[0-9A-Za-z-]+";var L=d++;l[L]="(?:\\+("+l[P]+"(?:\\."+l[P]+")*))";var Y=d++,G="v?"+l[g]+l[S]+"?"+l[L]+"?";l[Y]="^"+G+"$";var z="[v=\\s]*"+l[v]+l[T]+"?"+l[L]+"?",K=d++;l[K]="^"+z+"$";var Q=d++;l[Q]="((?:<|>)?=?)";var X=d++;l[X]=l[u]+"|x|X|\\*";var B=d++;l[B]=l[c]+"|x|X|\\*";var He=d++;l[He]="[v=\\s]*("+l[B]+")(?:\\.("+l[B]+")(?:\\.("+l[B]+")(?:"+l[S]+")?"+l[L]+"?)?)?";var Ge=d++;l[Ge]="[v=\\s]*("+l[X]+")(?:\\.("+l[X]+")(?:\\.("+l[X]+")(?:"+l[T]+")?"+l[L]+"?)?)?";var Ve=d++;l[Ve]="^"+l[Q]+"\\s*"+l[He]+"$";var ne=d++;l[ne]="^"+l[Q]+"\\s*"+l[Ge]+"$";var te=d++;l[te]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Z=d++;l[Z]="(?:~>?)";var re=d++;l[re]="(\\s*)"+l[Z]+"\\s+",a[re]=new RegExp(l[re],"g");var ie=d++;l[ie]="^"+l[Z]+l[He]+"$";var we=d++;l[we]="^"+l[Z]+l[Ge]+"$";var Ne=d++;l[Ne]="(?:\\^)";var Ae=d++;l[Ae]="(\\s*)"+l[Ne]+"\\s+",a[Ae]=new RegExp(l[Ae],"g");var et=d++;l[et]="^"+l[Ne]+l[He]+"$";var bt=d++;l[bt]="^"+l[Ne]+l[Ge]+"$";var Ke=d++;l[Ke]="^"+l[Q]+"\\s*("+z+")$|^$";var Kt=d++;l[Kt]="^"+l[Q]+"\\s*("+G+")$|^$";var nn=d++;l[nn]="(\\s*)"+l[Q]+"\\s*("+z+"|"+l[He]+")",a[nn]=new RegExp(l[nn],"g");var zn=d++;l[zn]="^\\s*("+l[He]+")\\s+-\\s+("+l[He]+")\\s*$";var Ks=d++;l[Ks]="^\\s*("+l[Ge]+")\\s+-\\s+("+l[Ge]+")\\s*$";var qs=d++;l[qs]="(<|>)?=?\\s*\\*";for(var he=0;he<35;he++)o(he,l[he]),a[he]||(a[he]=new RegExp(l[he]));function Sr(R,F){if(R instanceof mt)return R;if(typeof R!="string"||R.length>i||!(F?a[K]:a[Y]).test(R))return null;try{return new mt(R,F)}catch{return null}}function mt(R,F){if(R instanceof mt){if(R.loose===F)return R;R=R.version}else if(typeof R!="string")throw new TypeError("Invalid Version: "+R);if(R.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof mt))return new mt(R,F);o("SemVer",R,F),this.loose=F;var W=R.trim().match(F?a[K]:a[Y]);if(!W)throw new TypeError("Invalid Version: "+R);if(this.raw=R,this.major=+W[1],this.minor=+W[2],this.patch=+W[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");W[4]?this.prerelease=W[4].split(".").map((function(Se){if(/^[0-9]+$/.test(Se)){var Pe=+Se;if(Pe>=0&&Pe<s)return Pe}return Se})):this.prerelease=[],this.build=W[5]?W[5].split("."):[],this.format()}e.parse=Sr,e.valid=function(R,F){var W=Sr(R,F);return W?W.version:null},e.clean=function(R,F){var W=Sr(R.trim().replace(/^[=v]+/,""),F);return W?W.version:null},e.SemVer=mt,mt.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},mt.prototype.toString=function(){return this.version},mt.prototype.compare=function(R){return o("SemVer.compare",this.version,this.loose,R),R instanceof mt||(R=new mt(R,this.loose)),this.compareMain(R)||this.comparePre(R)},mt.prototype.compareMain=function(R){return R instanceof mt||(R=new mt(R,this.loose)),Go(this.major,R.major)||Go(this.minor,R.minor)||Go(this.patch,R.patch)},mt.prototype.comparePre=function(R){if(R instanceof mt||(R=new mt(R,this.loose)),this.prerelease.length&&!R.prerelease.length)return-1;if(!this.prerelease.length&&R.prerelease.length)return 1;if(!this.prerelease.length&&!R.prerelease.length)return 0;var F=0;do{var W=this.prerelease[F],Se=R.prerelease[F];if(o("prerelease compare",F,W,Se),W===void 0&&Se===void 0)return 0;if(Se===void 0)return 1;if(W===void 0)return-1;if(W!==Se)return Go(W,Se)}while(++F)},mt.prototype.inc=function(R,F){switch(R){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F),this.inc("pre",F);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",F),this.inc("pre",F);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var W=this.prerelease.length;--W>=0;)typeof this.prerelease[W]=="number"&&(this.prerelease[W]++,W=-2);W===-1&&this.prerelease.push(0)}F&&(this.prerelease[0]===F?isNaN(this.prerelease[1])&&(this.prerelease=[F,0]):this.prerelease=[F,0]);break;default:throw new Error("invalid increment argument: "+R)}return this.format(),this.raw=this.version,this},e.inc=function(R,F,W,Se){typeof W=="string"&&(Se=W,W=void 0);try{return new mt(R,W).inc(F,Se).version}catch{return null}},e.diff=function(R,F){if(jo(R,F))return null;var W=Sr(R),Se=Sr(F);if(W.prerelease.length||Se.prerelease.length){for(var Pe in W)if((Pe==="major"||Pe==="minor"||Pe==="patch")&&W[Pe]!==Se[Pe])return"pre"+Pe;return"prerelease"}for(var Pe in W)if((Pe==="major"||Pe==="minor"||Pe==="patch")&&W[Pe]!==Se[Pe])return Pe},e.compareIdentifiers=Go;var Wi=/^[0-9]+$/;function Go(R,F){var W=Wi.test(R),Se=Wi.test(F);return W&&Se&&(R=+R,F=+F),W&&!Se?-1:Se&&!W?1:R<F?-1:R>F?1:0}function Ue(R,F,W){return new mt(R,W).compare(new mt(F,W))}function Cl(R,F,W){return Ue(R,F,W)>0}function Tl(R,F,W){return Ue(R,F,W)<0}function jo(R,F,W){return Ue(R,F,W)===0}function $i(R,F,W){return Ue(R,F,W)!==0}function El(R,F,W){return Ue(R,F,W)>=0}function ac(R,F,W){return Ue(R,F,W)<=0}function wl(R,F,W,Se){var Pe;switch(F){case"===":typeof R=="object"&&(R=R.version),typeof W=="object"&&(W=W.version),Pe=R===W;break;case"!==":typeof R=="object"&&(R=R.version),typeof W=="object"&&(W=W.version),Pe=R!==W;break;case"":case"=":case"==":Pe=jo(R,W,Se);break;case"!=":Pe=$i(R,W,Se);break;case">":Pe=Cl(R,W,Se);break;case">=":Pe=El(R,W,Se);break;case"<":Pe=Tl(R,W,Se);break;case"<=":Pe=ac(R,W,Se);break;default:throw new TypeError("Invalid operator: "+F)}return Pe}function co(R,F){if(R instanceof co){if(R.loose===F)return R;R=R.value}if(!(this instanceof co))return new co(R,F);o("comparator",R,F),this.loose=F,this.parse(R),this.semver===Gs?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}e.rcompareIdentifiers=function(R,F){return Go(F,R)},e.major=function(R,F){return new mt(R,F).major},e.minor=function(R,F){return new mt(R,F).minor},e.patch=function(R,F){return new mt(R,F).patch},e.compare=Ue,e.compareLoose=function(R,F){return Ue(R,F,!0)},e.rcompare=function(R,F,W){return Ue(F,R,W)},e.sort=function(R,F){return R.sort((function(W,Se){return e.compare(W,Se,F)}))},e.rsort=function(R,F){return R.sort((function(W,Se){return e.rcompare(W,Se,F)}))},e.gt=Cl,e.lt=Tl,e.eq=jo,e.neq=$i,e.gte=El,e.lte=ac,e.cmp=wl,e.Comparator=co;var Gs={};function Ft(R,F){if(R instanceof Ft)return R.loose===F?R:new Ft(R.raw,F);if(R instanceof co)return new Ft(R.value,F);if(!(this instanceof Ft))return new Ft(R,F);if(this.loose=F,this.raw=R,this.set=R.split(/\s*\|\|\s*/).map((function(W){return this.parseRange(W.trim())}),this).filter((function(W){return W.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+R);this.format()}function Mn(R){return!R||R.toLowerCase()==="x"||R==="*"}function kl(R,F,W,Se,Pe,Zt,We,gn,qt,oe,Qo,Xt,on){return((F=Mn(W)?"":Mn(Se)?">="+W+".0.0":Mn(Pe)?">="+W+"."+Se+".0":">="+F)+" "+(gn=Mn(qt)?"":Mn(oe)?"<"+(+qt+1)+".0.0":Mn(Qo)?"<"+qt+"."+(+oe+1)+".0":Xt?"<="+qt+"."+oe+"."+Qo+"-"+Xt:"<="+gn)).trim()}function lc(R,F){for(var W=0;W<R.length;W++)if(!R[W].test(F))return!1;if(F.prerelease.length){for(W=0;W<R.length;W++)if(o(R[W].semver),R[W].semver!==Gs&&R[W].semver.prerelease.length>0){var Se=R[W].semver;if(Se.major===F.major&&Se.minor===F.minor&&Se.patch===F.patch)return!0}return!1}return!0}function _l(R,F,W){try{F=new Ft(F,W)}catch{return!1}return F.test(R)}function dc(R,F,W,Se){var Pe,Zt,We,gn,qt;switch(R=new mt(R,Se),F=new Ft(F,Se),W){case">":Pe=Cl,Zt=ac,We=Tl,gn=">",qt=">=";break;case"<":Pe=Tl,Zt=El,We=Cl,gn="<",qt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(_l(R,F,Se))return!1;for(var oe=0;oe<F.set.length;++oe){var Qo=F.set[oe],Xt=null,on=null;if(Qo.forEach((function(fn){fn.semver===Gs&&(fn=new co(">=0.0.0")),Xt=Xt||fn,on=on||fn,Pe(fn.semver,Xt.semver,Se)?Xt=fn:We(fn.semver,on.semver,Se)&&(on=fn)})),Xt.operator===gn||Xt.operator===qt||(!on.operator||on.operator===gn)&&Zt(R,on.semver)||on.operator===qt&&We(R,on.semver))return!1}return!0}co.prototype.parse=function(R){var F=this.loose?a[Ke]:a[Kt],W=R.match(F);if(!W)throw new TypeError("Invalid comparator: "+R);this.operator=W[1],this.operator==="="&&(this.operator=""),W[2]?this.semver=new mt(W[2],this.loose):this.semver=Gs},co.prototype.toString=function(){return this.value},co.prototype.test=function(R){return o("Comparator.test",R,this.loose),this.semver===Gs||(typeof R=="string"&&(R=new mt(R,this.loose)),wl(R,this.operator,this.semver,this.loose))},co.prototype.intersects=function(R,F){if(!(R instanceof co))throw new TypeError("a Comparator is required");var W;if(this.operator==="")return W=new Ft(R.value,F),_l(this.value,W,F);if(R.operator==="")return W=new Ft(this.value,F),_l(R.semver,W,F);var Se=!(this.operator!==">="&&this.operator!==">"||R.operator!==">="&&R.operator!==">"),Pe=!(this.operator!=="<="&&this.operator!=="<"||R.operator!=="<="&&R.operator!=="<"),Zt=this.semver.version===R.semver.version,We=!(this.operator!==">="&&this.operator!=="<="||R.operator!==">="&&R.operator!=="<="),gn=wl(this.semver,"<",R.semver,F)&&(this.operator===">="||this.operator===">")&&(R.operator==="<="||R.operator==="<"),qt=wl(this.semver,">",R.semver,F)&&(this.operator==="<="||this.operator==="<")&&(R.operator===">="||R.operator===">");return Se||Pe||Zt&&We||gn||qt},e.Range=Ft,Ft.prototype.format=function(){return this.range=this.set.map((function(R){return R.join(" ").trim()})).join("||").trim(),this.range},Ft.prototype.toString=function(){return this.range},Ft.prototype.parseRange=function(R){var F=this.loose;R=R.trim(),o("range",R,F);var W=F?a[Ks]:a[zn];R=R.replace(W,kl),o("hyphen replace",R),R=R.replace(a[nn],"$1$2$3"),o("comparator trim",R,a[nn]),R=(R=(R=R.replace(a[re],"$1~")).replace(a[Ae],"$1^")).split(/\s+/).join(" ");var Se=F?a[Ke]:a[Kt],Pe=R.split(" ").map((function(Zt){return(function(We,gn){return o("comp",We),We=(function(qt,oe){return qt.trim().split(/\s+/).map((function(Qo){return(function(Xt,on){o("caret",Xt,on);var fn=on?a[bt]:a[et];return Xt.replace(fn,(function(Ao,Be,Ye,Et,Ot){var Cn;return o("caret",Xt,Ao,Be,Ye,Et,Ot),Mn(Be)?Cn="":Mn(Ye)?Cn=">="+Be+".0.0 <"+(+Be+1)+".0.0":Mn(Et)?Cn=Be==="0"?">="+Be+"."+Ye+".0 <"+Be+"."+(+Ye+1)+".0":">="+Be+"."+Ye+".0 <"+(+Be+1)+".0.0":Ot?(o("replaceCaret pr",Ot),Ot.charAt(0)!=="-"&&(Ot="-"+Ot),Cn=Be==="0"?Ye==="0"?">="+Be+"."+Ye+"."+Et+Ot+" <"+Be+"."+Ye+"."+(+Et+1):">="+Be+"."+Ye+"."+Et+Ot+" <"+Be+"."+(+Ye+1)+".0":">="+Be+"."+Ye+"."+Et+Ot+" <"+(+Be+1)+".0.0"):(o("no pr"),Cn=Be==="0"?Ye==="0"?">="+Be+"."+Ye+"."+Et+" <"+Be+"."+Ye+"."+(+Et+1):">="+Be+"."+Ye+"."+Et+" <"+Be+"."+(+Ye+1)+".0":">="+Be+"."+Ye+"."+Et+" <"+(+Be+1)+".0.0"),o("caret return",Cn),Cn}))})(Qo,oe)})).join(" ")})(We,gn),o("caret",We),We=(function(qt,oe){return qt.trim().split(/\s+/).map((function(Qo){return(function(Xt,on){var fn=on?a[we]:a[ie];return Xt.replace(fn,(function(Ao,Be,Ye,Et,Ot){var Cn;return o("tilde",Xt,Ao,Be,Ye,Et,Ot),Mn(Be)?Cn="":Mn(Ye)?Cn=">="+Be+".0.0 <"+(+Be+1)+".0.0":Mn(Et)?Cn=">="+Be+"."+Ye+".0 <"+Be+"."+(+Ye+1)+".0":Ot?(o("replaceTilde pr",Ot),Ot.charAt(0)!=="-"&&(Ot="-"+Ot),Cn=">="+Be+"."+Ye+"."+Et+Ot+" <"+Be+"."+(+Ye+1)+".0"):Cn=">="+Be+"."+Ye+"."+Et+" <"+Be+"."+(+Ye+1)+".0",o("tilde return",Cn),Cn}))})(Qo,oe)})).join(" ")})(We,gn),o("tildes",We),We=(function(qt,oe){return o("replaceXRanges",qt,oe),qt.split(/\s+/).map((function(Qo){return(function(Xt,on){Xt=Xt.trim();var fn=on?a[ne]:a[Ve];return Xt.replace(fn,(function(Ao,Be,Ye,Et,Ot,Cn){o("xRange",Xt,Ao,Be,Ye,Et,Ot,Cn);var k=Mn(Ye),bo=k||Mn(Et),zi=bo||Mn(Ot);return Be==="="&&zi&&(Be=""),k?Ao=Be===">"||Be==="<"?"<0.0.0":"*":Be&&zi?(bo&&(Et=0),zi&&(Ot=0),Be===">"?(Be=">=",bo?(Ye=+Ye+1,Et=0,Ot=0):zi&&(Et=+Et+1,Ot=0)):Be==="<="&&(Be="<",bo?Ye=+Ye+1:Et=+Et+1),Ao=Be+Ye+"."+Et+"."+Ot):bo?Ao=">="+Ye+".0.0 <"+(+Ye+1)+".0.0":zi&&(Ao=">="+Ye+"."+Et+".0 <"+Ye+"."+(+Et+1)+".0"),o("xRange return",Ao),Ao}))})(Qo,oe)})).join(" ")})(We,gn),o("xrange",We),We=(function(qt,oe){return o("replaceStars",qt,oe),qt.trim().replace(a[qs],"")})(We,gn),o("stars",We),We})(Zt,F)})).join(" ").split(/\s+/);return this.loose&&(Pe=Pe.filter((function(Zt){return!!Zt.match(Se)}))),Pe=Pe.map((function(Zt){return new co(Zt,F)}))},Ft.prototype.intersects=function(R,F){if(!(R instanceof Ft))throw new TypeError("a Range is required");return this.set.some((function(W){return W.every((function(Se){return R.set.some((function(Pe){return Pe.every((function(Zt){return Se.intersects(Zt,F)}))}))}))}))},e.toComparators=function(R,F){return new Ft(R,F).set.map((function(W){return W.map((function(Se){return Se.value})).join(" ").trim().split(" ")}))},Ft.prototype.test=function(R){if(!R)return!1;typeof R=="string"&&(R=new mt(R,this.loose));for(var F=0;F<this.set.length;F++)if(lc(this.set[F],R))return!0;return!1},e.satisfies=_l,e.maxSatisfying=function(R,F,W){var Se=null,Pe=null;try{var Zt=new Ft(F,W)}catch{return null}return R.forEach((function(We){Zt.test(We)&&(Se&&Pe.compare(We)!==-1||(Pe=new mt(Se=We,W)))})),Se},e.minSatisfying=function(R,F,W){var Se=null,Pe=null;try{var Zt=new Ft(F,W)}catch{return null}return R.forEach((function(We){Zt.test(We)&&(Se&&Pe.compare(We)!==1||(Pe=new mt(Se=We,W)))})),Se},e.validRange=function(R,F){try{return new Ft(R,F).range||"*"}catch{return null}},e.ltr=function(R,F,W){return dc(R,F,"<",W)},e.gtr=function(R,F,W){return dc(R,F,">",W)},e.outside=dc,e.prerelease=function(R,F){var W=Sr(R,F);return W&&W.prerelease.length?W.prerelease:null},e.intersects=function(R,F,W){return R=new Ft(R,W),F=new Ft(F,W),R.intersects(F)},e.coerce=function(R){if(R instanceof mt)return R;if(typeof R!="string")return null;var F=R.match(a[te]);return F==null?null:Sr((F[1]||"0")+"."+(F[2]||"0")+"."+(F[3]||"0"))}}).call(this,t(1))},function(r,e){var t,n,o=r.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(x){if(t===setTimeout)return setTimeout(x,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(x,0);try{return t(x,0)}catch{try{return t.call(null,x,0)}catch{return t.call(this,x,0)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:i}catch{t=i}try{n=typeof clearTimeout=="function"?clearTimeout:s}catch{n=s}})();var l,d=[],c=!1,u=-1;function m(){c&&l&&(c=!1,l.length?d=l.concat(d):u=-1,d.length&&g())}function g(){if(!c){var x=a(m);c=!0;for(var S=d.length;S;){for(l=d,d=[];++u<S;)l&&l[u].run();u=-1,S=d.length}l=null,c=!1,(function(T){if(n===clearTimeout)return clearTimeout(T);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{n(T)}catch{try{return n.call(null,T)}catch{return n.call(this,T)}}})(x)}}function v(x,S){this.fun=x,this.array=S}function h(){}o.nextTick=function(x){var S=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)S[T-1]=arguments[T];d.push(new v(x,S)),d.length!==1||c||a(g)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(x){return[]},o.binding=function(x){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(x){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}])}));var _Fe=it.exports.SEMVER_SPEC_VERSION,PFe=it.exports.parse,HW=it.exports.valid,DFe=it.exports.coerce,RFe=it.exports.clean,MFe=it.exports.inc,AFe=it.exports.major,LFe=it.exports.minor,OFe=it.exports.patch,NFe=it.exports.prerelease,UFe=it.exports.gt,FFe=it.exports.gte,HFe=it.exports.lt,VFe=it.exports.lte,BFe=it.exports.eq,WFe=it.exports.neq,$Fe=it.exports.cmp,zFe=it.exports.compare,KFe=it.exports.rcompare,qFe=it.exports.compareIdentifiers,GFe=it.exports.rcompareIdentifiers,jFe=it.exports.compareBuild,QFe=it.exports.sort,JFe=it.exports.rsort,XFe=it.exports.diff,YFe=it.exports.validRange,ZFe=it.exports.satisfies,e2e=it.exports.maxSatisfying,t2e=it.exports.minSatisfying,n2e=it.exports.minVersion,o2e=it.exports.gtr,r2e=it.exports.ltr,i2e=it.exports.outside,s2e=it.exports.intersects,a2e=it.exports.SemVer,l2e=it.exports.Comparator,d2e=it.exports.Range;var nU=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,BW=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/;function WW(r){return r=r.trim(),r==="*"||nU.test(r)}function mR(r){if(!WW(r))return null;if(r=r.trim(),r==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let e=r.match(nU);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function gR(r){if(!r)return null;let e=r.majorBase,t=r.majorMustEqual,n=r.minorBase,o=r.minorMustEqual,i=r.patchBase,s=r.patchMustEqual;r.hasCaret&&(e===0||(o=!1),s=!1);let a=0;if(r.preRelease){let l=BW.exec(r.preRelease);if(l){let[,d,c,u,m,g]=l;a=Date.UTC(Number(d),Number(c)-1,Number(u),Number(m)||0,Number(g)||0)}}return{majorBase:e,majorMustEqual:t,minorBase:n,minorMustEqual:o,patchBase:i,patchMustEqual:s,isMinimum:r.hasGreaterEquals,notBefore:a}}var fR=class{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}};function oU(r,e){if(e.serializeBuffersForPostMessage){let t=new fR,o=JSON.stringify(r,(s,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){let l=$W(a);if(l)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:l,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),i=t.buffers.map(s=>{let a=new Uint8Array(s);return ee.wrap(a)});return{message:o,buffers:i}}else return{message:JSON.stringify(r),buffers:[]}}function $W(r){switch(r.constructor.name){case"Int8Array":return 1;case"Uint8Array":return 2;case"Uint8ClampedArray":return 3;case"Int16Array":return 4;case"Uint16Array":return 5;case"Int32Array":return 6;case"Uint32Array":return 7;case"Float32Array":return 8;case"Float64Array":return 9;case"BigInt64Array":return 10;case"BigUint64Array":return 11}}function rU(r,e){let t=e.map(i=>{let s=new ArrayBuffer(i.byteLength);return new Uint8Array(s).set(i.buffer),s}),n=e.length?(i,s)=>{if(s&&typeof s=="object"&&s.$$vscode_array_buffer_reference$$){let a=s,{index:l}=a,d=t[l];if(a.view)switch(a.view.type){case 1:return new Int8Array(d,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case 2:return new Uint8Array(d,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case 3:return new Uint8ClampedArray(d,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case 4:return new Int16Array(d,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case 5:return new Uint16Array(d,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case 6:return new Int32Array(d,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case 7:return new Uint32Array(d,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case 8:return new Float32Array(d,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case 9:return new Float64Array(d,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case 10:return new BigInt64Array(d,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case 11:return new BigUint64Array(d,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return d}return s}:void 0;return{message:JSON.parse(r,n),arrayBuffers:t}}var hR=class{constructor(e,t,n,o,i,s,a){this.#l="";this.#d=!1;this.#c=!1;this._onMessageEmitter=new E;this.onDidReceiveMessage=this._onMessageEmitter.event;this.#p=new E;this._onDidDispose=this.#p.event;this.#e=e,this.#t=t,this.#a=n,this.#o=o,this.#s=i,this.#i=s,this.#r=Ws(s),this.#u=zW(s),this.#n=a}#e;#t;#n;#o;#s;#i;#l;#a;#d;#c;#r;#u;#p;dispose(){this.#d=!0,this.#p.fire(),this.#p.dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return this.#c=!0,Il(e,this.#o)}get cspSource(){let e=this.#i.extensionLocation;if(e.scheme===$.https||e.scheme===$.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+Yf}return Yf}get html(){return this.assertNotDisposed(),this.#l}set html(e){this.assertNotDisposed(),this.#l!==e&&(this.#l=e,this.#u&&!this.#c&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(this.#c=!0,this.#n.report("Webview vscode-resource: uris",this.#i,"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),this.#t.$setHtml(this.#e,this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),this.#a}set options(e){this.assertNotDisposed(),Wt(this.#a,e)||this.#t.$setOptions(this.#e,vR(this.#i,this.#s,e)),this.#a=e}async postMessage(e){if(this.#d)return!1;let t=oU(e,{serializeBuffersForPostMessage:this.#r});return this.#t.$postMessage(this.#e,t.message,...t.buffers)}assertNotDisposed(){if(this.#d)throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!this.#u)return e;let t=this.#i.extensionLocation?.scheme===$.vscodeRemote,n=this.#i.extensionLocation.scheme===$.vscodeRemote?this.#i.extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(o,i,s,a,l,d)=>{let c=y.from({scheme:a||"file",path:decodeURIComponent(l)}),u=Il(c,{isRemote:t,authority:n}).toString();return`${i}${u}${d}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(o,i,s,a,l,d)=>{let c=y.from({scheme:a||"file",path:decodeURIComponent(l)}),u=Il(c,{isRemote:t,authority:n}).toString();return`${i}${u}${d}`})}};function Ws(r){try{let e=gR(mR(r.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function zW(r){try{let e=gR(mR(r.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}var mS=class extends H{constructor(t,n,o,i,s){super();this.remoteInfo=n;this.workspace=o;this._logService=i;this._deprecationService=s;this._webviews=new Map;this._webviewProxy=t.getProxy(N.MainThreadWebviews)}dispose(){super.dispose();for(let t of this._webviews.values())t.dispose();this._webviews.clear()}$onMessage(t,n,o){let i=this.getWebview(t);if(i){let{message:s}=rU(n,o.value);i._onMessageEmitter.fire(s)}}$onMissingCsp(t,n){this._logService.warn(`${n} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(t,n,o){let i=new hR(t,this._webviewProxy,KW(n),this.remoteInfo,this.workspace,o,this._deprecationService);this._webviews.set(t,i);let s=i._onDidDispose(()=>{s.dispose(),this.deleteWebview(t)});return i}deleteWebview(t){this._webviews.delete(t)}getWebview(t){return this._webviews.get(t)}};function Yd(r){return{id:r.identifier,location:r.extensionLocation}}function vR(r,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||qW(r,e)}}function KW(r){return{enableCommandUris:r.enableCommandUris,enableScripts:r.enableScripts,enableForms:r.enableForms,portMapping:r.portMapping,localResourceRoots:r.localResourceRoots?.map(e=>y.from(e))}}function qW(r,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),r.extensionLocation]}var lo=class r{constructor(e){this.id=e;this._data=new Map;this._idPool=1}static{this.enableDebugLogging=!1}add(e){let t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){r.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};var bR=class{constructor(e,t){this.document=e;this._storagePath=t;this._backupCounter=1;this._edits=new lo("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(let t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");let e=QW(this.document.uri)+this._backupCounter++;return Ut(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){let t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}},yR=class{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,n){let o=this.key(e,t.uri);if(this._documents.has(o))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);let i=new bR(t,n);return this._documents.set(o,i),i}delete(e,t){let n=this.key(e,t);this._documents.delete(n)}key(e,t){return`${e}@@@${t}`}};var IR=class{constructor(){this._providers=new Map}addTextProvider(e,t,n){return this.add(e,{type:0,extension:t,provider:n})}addCustomProvider(e,t,n){return this.add(e,{type:1,extension:t,provider:n})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new fe(()=>this._providers.delete(e))}},fS=class{constructor(e,t,n,o,i){this._extHostDocuments=t;this._extensionStoragePaths=n;this._extHostWebview=o;this._extHostWebviewPanels=i;this._editorProviders=new IR;this._documents=new yR;this._proxy=e.getProxy(N.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,n,o){let i=new q;return GW(n)?(i.add(this._editorProviders.addTextProvider(t,e,n)),this._proxy.$registerTextEditorProvider(Yd(e),t,o.webviewOptions||{},{supportsMove:!!n.moveCustomTextEditor},Ws(e))):(i.add(this._editorProviders.addCustomProvider(t,e,n)),gS(n)&&i.add(n.onDidChangeCustomDocument(s=>{let a=this.getCustomDocumentEntry(t,s.document.uri);if(jW(s)){let l=a.addEdit(s);this._proxy.$onDidEdit(s.document.uri,t,l,s.label)}else this._proxy.$onContentChange(s.document.uri,t)})),this._proxy.$registerCustomEditorProvider(Yd(e),t,o.webviewOptions||{},!!o.supportsMultipleEditorsPerDocument,Ws(e))),fe.from(i,new fe(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,n,o,i){let s=this._editorProviders.get(t);if(!s)throw new Error(`No provider found for '${t}'`);if(s.type!==1)throw new Error(`Invalid provide type for '${t}'`);let a=y.revive(e),l=await s.provider.openCustomDocument(a,{backupId:n,untitledDocumentData:o?.buffer},i),d;return gS(s.provider)&&this._extensionStoragePaths&&(d=this._extensionStoragePaths.workspaceValue(s.extension)??this._extensionStoragePaths.globalValue(s.extension)),this._documents.add(t,l,d),{editable:gS(s.provider)}}async $disposeCustomDocument(e,t){let n=this._editorProviders.get(t);if(!n)throw new Error(`No provider found for '${t}'`);if(n.type!==1)throw new Error(`Invalid provider type for '${t}'`);let o=y.revive(e),{document:i}=this.getCustomDocumentEntry(t,o);this._documents.delete(t,o),i.dispose()}async $resolveCustomEditor(e,t,n,o,i,s){let a=this._editorProviders.get(n);if(!a)throw new Error(`No provider found for '${n}'`);let l=_t.to(i),d=this._extHostWebview.createNewWebview(t,o.contentOptions,a.extension),c=this._extHostWebviewPanels.createNewWebviewPanel(t,n,o.title,l,o.options,d,o.active),u=y.revive(e);switch(a.type){case 1:{let{document:m}=this.getCustomDocumentEntry(n,u);return a.provider.resolveCustomEditor(m,c,s)}case 0:{let m=this._extHostDocuments.getDocument(u);return a.provider.resolveCustomTextEditor(m,c,s)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,n){this.getCustomDocumentEntry(t,e).disposeEdits(n)}async $onMoveCustomEditor(e,t,n){let o=this._editorProviders.get(n);if(!o)throw new Error(`No provider found for '${n}'`);if(!o.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${n}'`);let i=this._extHostWebviewPanels.getWebviewPanel(e);if(!i)throw new Error("No webview found");let s=y.revive(t),a=this._extHostDocuments.getDocument(s);await o.provider.moveCustomTextEditor(a,i,be.None)}async $undo(e,t,n,o){return this.getCustomDocumentEntry(t,e).undo(n,o)}async $redo(e,t,n,o){return this.getCustomDocumentEntry(t,e).redo(n,o)}async $revert(e,t,n){let o=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(o.document,n),o.disposeBackup()}async $onSave(e,t,n){let o=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(o.document,n),o.disposeBackup()}async $onSaveAs(e,t,n,o){let i=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(i.document,y.revive(n),o)}async $backup(e,t,n){let o=this.getCustomDocumentEntry(t,e),s=await this.getCustomEditorProvider(t).backupCustomDocument(o.document,{destination:o.getNewBackupUri()},n);return o.updateBackup(s),s.id}getCustomDocumentEntry(e,t){let n=this._documents.get(e,y.revive(t));if(!n)throw new Error("No custom document found");return n}getCustomEditorProvider(e){let n=this._editorProviders.get(e)?.provider;if(!n||!gS(n))throw new Error("Custom document is not editable");return n}};function gS(r){return!!r.onDidChangeCustomDocument}function GW(r){return typeof r.resolveCustomTextEditor=="function"}function jW(r){return typeof r.undo=="function"&&typeof r.redo=="function"}function QW(r){let e=r.scheme===$.file||r.scheme===$.untitled?r.fsPath:r.toString();return Rr(e)+""}var hS=class r{constructor(e,t,n,o,i,s,a,l){this._name=e;this._owner=t;this._maxDiagnosticsTotal=n;this._maxDiagnosticsPerFile=o;this._modelVersionIdProvider=i;this._isDisposed=!1;this._maxDiagnosticsTotal=Math.max(o,n),this.#n=new qe(d=>s.getComparisonKey(d)),this.#e=a,this.#t=l}#e;#t;#n;dispose(){this._isDisposed||(this.#t.fire([...this.#n.keys()]),this.#e?.$clear(this._owner),this.#n.clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let n=[];if(y.isUri(e)){if(!t){this.delete(e);return}this.#n.set(e,Ze(t)),n=[e]}else if(Array.isArray(e)){n=[];let s;e=[...e].sort(r._compareIndexedTuplesByUri);for(let a of e){let[l,d]=a;if((!s||l.toString()!==s.toString())&&(s&&this.#n.get(s).length===0&&this.#n.delete(s),s=l,n.push(l),this.#n.set(l,[])),d)this.#n.get(l)?.push(...Ze(d));else{let c=this.#n.get(l);c&&(c.length=0)}}}if(this.#t.fire(n),!this.#e)return;let o=[],i=0;for(let s of n){let a=[],l=this.#n.get(s);if(l)if(l.length>this._maxDiagnosticsPerFile){a=[];let d=[0,1,2,3];e:for(let c=0;c<4;c++)for(let u of l)if(u.severity===d[c]&&a.push({...Ls.from(u),modelVersionId:this._modelVersionIdProvider(s)})===this._maxDiagnosticsPerFile)break e;a.push({severity:2,message:p(3157,null,l.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=l.map(d=>({...Ls.from(d),modelVersionId:this._modelVersionIdProvider(s)}));if(o.push([s,a]),i+=a.length,i>this._maxDiagnosticsTotal)break}this.#e.$changeMany(this._owner,o)}delete(e){this._checkDisposed(),this.#t.fire([e]),this.#n.delete(e),this.#e?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),this.#t.fire([...this.#n.keys()]),this.#n.clear(),this.#e?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(let[n,o]of this)e.call(t,n,o,this)}*[Symbol.iterator](){this._checkDisposed();for(let e of this.#n.keys())yield[e,this.get(e)]}get(e){this._checkDisposed();let t=this.#n.get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(this.#n.get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()<t[0].toString()?-1:e[0].toString()>t[0].toString()?1:0}},Ir=class{constructor(e,t,n,o){this._logService=t;this._fileSystemInfoService=n;this._extHostDocumentsAndEditors=o;this._collections=new Map;this._onDidChangeDiagnostics=new Mh({merge:e=>e.flat(),delay:50});this.onDidChangeDiagnostics=Me.map(this._onDidChangeDiagnostics.event,Ir._mapper);this._proxy=e.getProxy(N.MainThreadDiagnostics)}static{this._idPool=0}static{this._maxDiagnosticsPerFile=1e3}static{this._maxDiagnosticsTotal=1.1*this._maxDiagnosticsPerFile}static _mapper(e){let t=new qe;for(let n of e)t.set(n,n);return{uris:Object.freeze(Array.from(t.values()))}}createDiagnosticCollection(e,t){let{_collections:n,_proxy:o,_onDidChangeDiagnostics:i,_logService:s,_fileSystemInfoService:a,_extHostDocumentsAndEditors:l}=this,d=new class{$changeMany(m,g){o.$changeMany(m,g),s.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,m,g.length===0?"CLEARING":g)}$clear(m){o.$clear(m),s.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,m)}dispose(){o.dispose()}},c;if(!t)t="_generated_diagnostic_collection_name_#"+Ir._idPool++,c=t;else if(!n.has(t))c=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do c=t+Ir._idPool++;while(n.has(c))}return new class extends hS{constructor(){super(t,c,Ir._maxDiagnosticsTotal,Ir._maxDiagnosticsPerFile,m=>l.getDocument(m)?.version,a.extUri,d,i),n.set(c,this)}dispose(){super.dispose(),n.delete(c)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{let t=new Map,n=[];for(let o of this._collections.values())o.forEach((i,s)=>{let a=t.get(i.toString());typeof a>"u"&&(a=n.length,t.set(i.toString(),a),n.push([i,[]])),n[a][1]=n[a][1].concat(...s)});return n}}_getDiagnostics(e){let t=[];for(let n of this._collections.values())n.has(e)&&(t=t.concat(n.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){let t="_generated_mirror",n=new hS(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,o=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,n),this._mirrorCollection=n}for(let[t,n]of e)this._mirrorCollection.set(y.revive(t),n.map(Ls.to))}};Ir=D([C(1,ue),C(2,lr)],Ir);var vS=class{constructor(e){this._proxy=e.getProxy(N.MainThreadDialogs)}showOpenDialog(e){return this._proxy.$showOpenDialog(e).then(t=>t?t.map(n=>y.revive(n)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?y.revive(t):void 0)}};var bS=class r{constructor(e,t,n){this._documentsAndEditors=t;this._logService=n;this._documentContentProviders=new Map;this._proxy=e.getProxy(N.MainThreadDocumentContentProviders)}static{this._handlePool=0}registerTextDocumentContentProvider(e,t){if(Object.keys($).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);let n=r._handlePool++;this._documentContentProviders.set(n,t),this._proxy.$registerTextContentProvider(n,e);let o;if(typeof t.onDidChange=="function"){let i;o=t.onDidChange(async s=>{if(s.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${s.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(s))return;i&&await i;let a=this.$provideTextDocumentContent(n,s).then(async l=>{if(!l&&typeof l!="string")return;let d=this._documentsAndEditors.getDocument(s);if(!d)return;let c=Qh(l);if(!d.equalLines(c))return this._proxy.$onVirtualDocumentChange(s,l)}).catch(ct).finally(()=>{i===a&&(i=void 0)});i=a})}return new fe(()=>{this._documentContentProviders.delete(n)&&this._proxy.$unregisterTextContentProvider(n),o&&(o.dispose(),o=void 0)})}$provideTextDocumentContent(e,t){let n=this._documentContentProviders.get(e);return n?Promise.resolve(n.provideTextDocumentContent(y.revive(t),be.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};var yS=class{constructor(e,t,n,o={timeout:1500,errors:3}){this._logService=e;this._documents=t;this._mainThreadBulkEdits=n;this._thresholds=o;this._callbacks=new qn;this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,n,o)=>{let s={dispose:this._callbacks.push([t,n,e])};return Array.isArray(o)&&o.push(s),s}}async $participateInSave(e,t){let n=y.revive(e),o=!1,i=setTimeout(()=>o=!0,this._thresholds.timeout),s=[];try{for(let a of[...this._callbacks]){if(o)break;let l=this._documents.getDocument(n),d=await this._deliverEventAsyncAndBlameBadListeners(a,{document:l,reason:ff.to(t)});s.push(d)}}finally{clearTimeout(i)}return s}_deliverEventAsyncAndBlameBadListeners([e,t,n],o){let i=this._badListeners.get(e);return typeof i=="number"&&i>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(n,e,t,o).then(()=>!0,s=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' threw ERROR`),this._logService.error(s),!(s instanceof Error)||s.message!=="concurrent_edits"){let a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,n,o){let i=[],s=Date.now(),{document:a,reason:l}=o,{version:d}=a,c=Object.freeze({document:a,reason:l,waitUntil(u){if(Object.isFrozen(i))throw pc("waitUntil can not be called async");i.push(Promise.resolve(u))}});try{t.apply(n,[c])}catch(u){return Promise.reject(u)}return Object.freeze(i),new Promise((u,m)=>{let g=setTimeout(()=>m(new Error("timeout")),this._thresholds.timeout);return Promise.all(i).then(v=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-s}ms`),clearTimeout(g),u(v)}).catch(v=>{clearTimeout(g),m(v)})}).then(u=>{let m={edits:[]};for(let g of u)if(Array.isArray(g)&&g.every(v=>v instanceof un))for(let{newText:v,newEol:h,range:x}of g)m.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:x&&V.from(x),text:v,eol:h&&Ad.from(h)}});if(m.edits.length!==0)return d===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Pt(m)):Promise.reject(new Error("concurrent_edits"))})}};var IS=class{constructor(e,t){this._toDispose=new q;this._onDidAddDocument=this._toDispose.add(new E);this._onDidRemoveDocument=this._toDispose.add(new E);this._onDidChangeDocument=this._toDispose.add(new E);this._onDidChangeDocumentWithReason=this._toDispose.add(new E);this._onDidSaveDocument=this._toDispose.add(new E);this.onDidAddDocument=this._onDidAddDocument.event;this.onDidRemoveDocument=this._onDidRemoveDocument.event;this.onDidChangeDocument=this._onDidChangeDocument.event;this.onDidChangeDocumentWithReason=this._onDidChangeDocumentWithReason.event;this.onDidSaveDocument=this._onDidSaveDocument.event;this._documentLoader=new Map;this._proxy=e.getProxy(N.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(n=>{for(let o of n)this._onDidRemoveDocument.fire(o.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(n=>{for(let o of n)this._onDidAddDocument.fire(o.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;let t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){let t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e,t){let n=this._documentsAndEditors.getDocument(e);if(n&&(!t?.encoding||n.document.encoding===t.encoding))return Promise.resolve(n);let o=this._documentLoader.get(e.toString());return o?t?.encoding&&(o=o.then(i=>i.document.encoding!==t.encoding?this.ensureDocumentData(e,t):i)):(o=this._proxy.$tryOpenDocument(e,t).then(i=>{this._documentLoader.delete(e.toString());let s=y.revive(i);return Tr(this._documentsAndEditors.getDocument(s))},i=>(this._documentLoader.delete(e.toString()),Promise.reject(i))),this._documentLoader.set(e.toString(),o)),o}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>y.revive(t))}$acceptModelLanguageChanged(e,t){let n=y.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");this._onDidRemoveDocument.fire(o.document),o._acceptLanguageId(t),this._onDidAddDocument.fire(o.document)}$acceptModelSaved(e){let t=y.revive(e),n=this._documentsAndEditors.getDocument(t);if(!n)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(n.document)}$acceptDirtyStateChanged(e,t){let n=y.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");o._acceptIsDirty(t),this._onDidChangeDocument.fire({document:o.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:o.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptEncodingChanged(e,t){let n=y.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");o._acceptEncoding(t),this._onDidChangeDocument.fire({document:o.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:o.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptModelChanged(e,t,n){let o=y.revive(e),i=this._documentsAndEditors.getDocument(o);if(!i)throw new Error("unknown document");i._acceptIsDirty(n),i.onEvents(t);let s;t.isUndoing?s=1:t.isRedoing&&(s=2),this._onDidChangeDocument.fire(ug({document:i.document,contentChanges:t.changes.map(a=>({range:V.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:s})),this._onDidChangeDocumentWithReason.fire(ug({document:i.document,contentChanges:t.changes.map(a=>({range:V.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:s,detailedReason:t.detailedReason?{source:t.detailedReason.source,metadata:t.detailedReason}:void 0}))}setWordDefinitionFor(e,t){PN(e,t)}};var xS=class{constructor(e){this._provider=new Map;this._onDidChange=new E;this.onDidChange=this._onDidChange.event;this._allKnownModels=new Set;this._handlePool=0;this._proxy=e.getProxy(N.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,n){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");let o=this._handlePool++;return this._proxy.$registerEmbeddingProvider(o,t),this._provider.set(o,{id:t,provider:n}),J(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(o),this._provider.delete(o)})}async computeEmbeddings(e,t,n){n??=be.None;let o=!1;typeof t=="string"&&(t=[t],o=!0);let i=await this._proxy.$computeEmbeddings(e,t,n);if(i.length!==t.length)throw new Error;if(o){if(i.length!==1)throw new Error;return i[0]}return i}async $provideEmbeddings(e,t,n){let o=this._provider.get(e);if(!o)return[];let i=await o.provider.provideEmbeddings(t,n);return i||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}};var SS=class{constructor(e){this._AiEmbeddingVectorProviders=new Map;this._nextHandle=0;this._proxy=e.getProxy(N.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,n){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");let o=this._AiEmbeddingVectorProviders.get(e);if(!o)throw new Error("Embedding vector provider not found");let i=await o.provideEmbeddingVector(t,n);if(!i)throw new Error("Embedding vector provider returned undefined");return i}registerEmbeddingVectorProvider(e,t,n){let o=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(o,n),this._proxy.$registerAiEmbeddingVectorProvider(t,o),new fe(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(o),this._AiEmbeddingVectorProviders.delete(o)})}};var SR=class{constructor(e,t,n){let o=new Uint8Array(e*t);for(let i=0,s=e*t;i<s;i++)o[i]=n;this._data=o,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,n){this._data[e*this.cols+t]=n}},eh=class{constructor(e){let t=0,n=0;for(let i=0,s=e.length;i<s;i++){let[a,l,d]=e[i];l>t&&(t=l),a>n&&(n=a),d>n&&(n=d)}t++,n++;let o=new SR(n,t,0);for(let i=0,s=e.length;i<s;i++){let[a,l,d]=e[i];o.set(a,l,d)}this._states=o,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}},xR=null;function JW(){return xR===null&&(xR=new eh([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),xR}var Zf=null;function XW(){if(Zf===null){Zf=new Ep(0);let r=` 	<>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026|`;for(let t=0;t<r.length;t++)Zf.set(r.charCodeAt(t),1);let e=".,;:";for(let t=0;t<e.length;t++)Zf.set(e.charCodeAt(t),2)}return Zf}var CS=class r{static _createLink(e,t,n,o,i){let s=i-1;do{let a=t.charCodeAt(s);if(e.get(a)!==2)break;s--}while(s>o);if(o>0){let a=t.charCodeAt(o-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:o+1,endLineNumber:n,endColumn:s+2},url:t.substring(o,s+1)}}static computeLinks(e,t=JW()){let n=XW(),o=[];for(let i=1,s=e.getLineCount();i<=s;i++){let a=e.getLineContent(i),l=a.length,d=0,c=0,u=0,m=1,g=!1,v=!1,h=!1,x=!1;for(;d<l;){let S=!1,T=a.charCodeAt(d);if(m===13){let P;switch(T){case 40:g=!0,P=0;break;case 41:P=g?0:1;break;case 91:h=!0,v=!0,P=0;break;case 93:h=!1,P=v?0:1;break;case 123:x=!0,P=0;break;case 125:P=x?0:1;break;case 39:case 34:case 96:u===T?P=1:u===39||u===34||u===96?P=0:P=1;break;case 42:P=u===42?1:0;break;case 32:P=h?0:1;break;default:P=n.get(T)}P===1&&(o.push(r._createLink(n,a,i,c,d)),S=!0)}else if(m===12){let P;T===91?(v=!0,P=0):P=n.get(T),P===1?S=!0:m=13}else m=t.nextState(m,T),m===0&&(S=!0);S&&(m=1,g=!1,v=!1,x=!1,c=d+1,u=T),d++}m===13&&o.push(r._createLink(n,a,i,c,l))}return o}};var CR=class{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){let t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){let e=this._schemes.sort(),t=[],n,o,i=14,s=14;for(let a of e){let l=n?V0(n,a):0;for(l===0?o=1:o=s;l<a.length;l++)l+1===a.length?(i=s,s=9):s+=1,t.push([o,a.toUpperCase().charCodeAt(l),s]),t.push([o,a.toLowerCase().charCodeAt(l),s]),o=s;n=a,s=i}t.push([9,58,10]),t.push([10,47,12]),this._stateMachine=new eh(t)}}provideDocumentLinks(e){this._initStateMachine();let t=[],n=CS.computeLinks({getLineContent(o){return e.lineAt(o-1).text},getLineCount(){return e.lineCount}},this._stateMachine);for(let o of n){let i=Ns.to(o);i.target&&t.push(i)}return t}},TS=class r{constructor(e,t){this._extHostLanguageFeatures=t;this._linkProvider=new CR;this._fsProvider=new Map;this._registeredSchemes=new Set;this._watches=new Map;this._handlePool=0;this._proxy=e.getProxy(N.MainThreadFileSystem)}dispose(){this._linkProviderRegistration?.dispose()}registerFileSystemProvider(e,t,n,o={}){if(r._validateFileSystemProvider(n),this._registeredSchemes.has(t))throw new Error(`a provider for the scheme '${t}' is already registered`);this._linkProviderRegistration||(this._linkProviderRegistration=this._extHostLanguageFeatures.registerDocumentLinkProvider(e,"*",this._linkProvider));let i=this._handlePool++;this._linkProvider.add(t),this._registeredSchemes.add(t),this._fsProvider.set(i,n);let s=2;o.isCaseSensitive&&(s+=1024),o.isReadonly&&(s+=2048),typeof n.copy=="function"&&(s+=8),typeof n.open=="function"&&typeof n.close=="function"&&typeof n.read=="function"&&typeof n.write=="function"&&(A(e,"fsChunks"),s+=4);let a;o.isReadonly&&Mr(o.isReadonly)&&o.isReadonly.value!==""&&(a={value:o.isReadonly.value,isTrusted:o.isReadonly.isTrusted,supportThemeIcons:o.isReadonly.supportThemeIcons,supportHtml:o.isReadonly.supportHtml,baseUri:o.isReadonly.baseUri,uris:o.isReadonly.uris}),this._proxy.$registerFileSystemProvider(i,t,s,a).catch(d=>{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(d)});let l=n.onDidChangeFile(d=>{let c=[];for(let u of d){let{uri:m,type:g}=u;if(m.scheme!==t)continue;let v;switch(g){case 1:v=0;break;case 2:v=1;break;case 3:v=2;break;default:throw new Error("Unknown FileChangeType")}c.push({resource:m,type:v})}this._proxy.$onFileSystemChange(i,c)});return J(()=>{l.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(i),this._proxy.$unregisterProvider(i)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){let{type:t,ctime:n,mtime:o,size:i,permissions:s}=e;return{type:t,ctime:n,mtime:o,size:i,permissions:s}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(y.revive(t))).then(n=>r._asIStat(n))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(y.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(y.revive(t))).then(n=>ee.wrap(n))}$writeFile(e,t,n,o){return Promise.resolve(this._getFsProvider(e).writeFile(y.revive(t),n.buffer,o))}$delete(e,t,n){return Promise.resolve(this._getFsProvider(e).delete(y.revive(t),n))}$rename(e,t,n,o){return Promise.resolve(this._getFsProvider(e).rename(y.revive(t),y.revive(n),o))}$copy(e,t,n,o){let i=this._getFsProvider(e);if(!i.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(i.copy(y.revive(t),y.revive(n),o))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(y.revive(t)))}$watch(e,t,n,o){let i=this._getFsProvider(e).watch(y.revive(n),o);this._watches.set(t,i)}$unwatch(e,t){let n=this._watches.get(t);n&&(n.dispose(),this._watches.delete(t))}$open(e,t,n){let o=this._getFsProvider(e);if(!o.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(o.open(y.revive(t),n))}$close(e,t){let n=this._getFsProvider(e);if(!n.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(n.close(t))}$read(e,t,n,o){let i=this._getFsProvider(e);if(!i.read)throw new Error('FileSystemProvider does not implement "read"');let s=ee.alloc(o);return Promise.resolve(i.read(t,n,s.buffer,0,o)).then(a=>s.slice(0,a))}$write(e,t,n,o){let i=this._getFsProvider(e);if(!i.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(i.write(t,n,o.buffer,0,o.byteLength))}_getFsProvider(e){let t=this._fsProvider.get(e);if(!t){let n=new Error;throw n.name="ENOPRO",n.message="no provider",n}return t}};var iU=class r extends H{constructor(t,n,o,i){super();this.onFileChanges=t;this.onLogMessage=n;this.verboseLogging=o;this.options=i;this.watcherDisposables=this._register(new En);this.requests=void 0;this.restartCounter=0}static{this.MAX_RESTARTS=5}init(){let t=new q;this.watcherDisposables.value=t,this.watcher=this.createWatcher(t),this.watcher.setVerboseLogging(this.verboseLogging),t.add(this.watcher.onDidChangeFile(n=>this.onFileChanges(n))),t.add(this.watcher.onDidLogMessage(n=>this.onLogMessage(n))),t.add(this.watcher.onDidError(n=>this.onError(n.error,n.request)))}onError(t,n){this.canRestart(t,n)?this.restartCounter<r.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${t}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${t}`):this.error(t)}canRestart(t,n){return!(!this.options.restartOnError||n||t.indexOf("No space left on device")!==-1||t.indexOf("EMFILE")!==-1)}restart(t){this.restartCounter++,this.init(),this.watch(t)}async watch(t){this.requests=t,await this.watcher?.watch(t)}async setVerboseLogging(t){this.verboseLogging=t,await this.watcher?.setVerboseLogging(t)}error(t){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${t}`})}trace(t){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${t}`})}dispose(){return this.watcher=void 0,super.dispose()}};function sU(r,e){return typeof e=="string"&&!e.startsWith(us)&&!Ji(e)?{base:r,pattern:e}:e}var TR=class{constructor(e,t,n,o,i,s,a,l){this.session=Math.random();this._onDidCreate=new E;this._onDidChange=new E;this._onDidDelete=new E;this._config=0,l.ignoreCreateEvents&&(this._config+=1),l.ignoreChangeEvents&&(this._config+=2),l.ignoreDeleteEvents&&(this._config+=4);let d=typeof a=="string"?!((n.getCapabilities($.file)??0)&1024):n.extUri.ignorePathCasing(y.revive(a.baseUri)),c=Br(a,{ignoreCase:d}),u=typeof a=="string",m=!1,g=s(v=>{if(!(typeof v.session=="number"&&v.session!==this.session)&&!(m&&typeof v.session>"u")){if(!l.ignoreCreateEvents)for(let h of v.created){let x=y.revive(h);c(x.fsPath)&&(!u||o.getWorkspaceFolder(x))&&this._onDidCreate.fire(x)}if(!l.ignoreChangeEvents)for(let h of v.changed){let x=y.revive(h);c(x.fsPath)&&(!u||o.getWorkspaceFolder(x))&&this._onDidChange.fire(x)}if(!l.ignoreDeleteEvents)for(let h of v.deleted){let x=y.revive(h);c(x.fsPath)&&(!u||o.getWorkspaceFolder(x))&&this._onDidDelete.fire(x)}}});this._disposable=fe.from(this.ensureWatching(e,o,t,i,a,l,!1),this._onDidCreate,this._onDidChange,this._onDidDelete,g)}get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}ensureWatching(e,t,n,o,i,s,a){let l=fe.from();if(typeof i=="string"||s.ignoreChangeEvents&&s.ignoreCreateEvents&&s.ignoreDeleteEvents)return l;let d=e.getProxy(N.MainThreadFileSystemEventService),c=!1;(i.pattern.includes(us)||i.pattern.includes(Hb))&&(c=!0);let u=[],m,g;if(a)(s.ignoreChangeEvents||s.ignoreCreateEvents||s.ignoreDeleteEvents)&&(g=14,s.ignoreChangeEvents&&(g&=-3),s.ignoreCreateEvents&&(g&=-5),s.ignoreDeleteEvents&&(g&=-9));else if(c&&u.length===0){let v=t.getWorkspaceFolder(y.revive(i.baseUri)),h=n.getConfiguration("files",v).get("watcherExclude");if(h)for(let x in h)x&&h[x]===!0&&u.push(x)}else if(!c){let v=t.getWorkspaceFolder(y.revive(i.baseUri));if(v){let h=n.getConfiguration("files",v).get("watcherExclude");if(h){for(let x in h)if(x&&h[x]===!0){let S=`${Fl(x,"/")}/${us}`;m||(m=[]),m.push(sU(v.uri.fsPath,S))}}if(!m||m.length===0)return l}}return d.$watch(o.identifier.value,this.session,i.baseUri,{recursive:c,excludes:u,includes:m,filter:g},!!a),fe.from({dispose:()=>d.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}},ER=class{constructor(e){this._events=e;this._created=new dt(()=>this._events.created.map(y.revive));this._changed=new dt(()=>this._events.changed.map(y.revive));this._deleted=new dt(()=>this._events.deleted.map(y.revive));this.session=this._events.session}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}},ES=class{constructor(e,t,n){this._mainContext=e;this._logService=t;this._extHostDocumentsAndEditors=n;this._onFileSystemEvent=new E;this._onDidRenameFile=new E;this._onDidCreateFile=new E;this._onDidDeleteFile=new E;this._onWillRenameFile=new ri;this._onWillCreateFile=new ri;this._onWillDeleteFile=new ri;this.onDidRenameFile=this._onDidRenameFile.event;this.onDidCreateFile=this._onDidCreateFile.event;this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,n,o,i,s){return new TR(this._mainContext,t,n,e,o,this._onFileSystemEvent.event,so.from(i),s)}$onFileEvent(e){this._onFileSystemEvent.fire(new ER(e))}$onDidRunFileOperation(e,t){switch(e){case 2:this._onDidRenameFile.fire(Object.freeze({files:t.map(n=>({oldUri:y.revive(n.source),newUri:y.revive(n.target)}))}));break;case 1:this._onDidDeleteFile.fire(Object.freeze({files:t.map(n=>y.revive(n.target))}));break;case 0:case 3:this._onDidCreateFile.fire(Object.freeze({files:t.map(n=>y.revive(n.target))}));break;default:}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(n,o,i)=>{let s=function(l){n.call(o,l)};return s.extension=e,t.event(s,void 0,i)}}async $onWillRunFileOperation(e,t,n,o){switch(e){case 2:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(i=>({oldUri:y.revive(i.source),newUri:y.revive(i.target)}))},n,o);case 1:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(i=>y.revive(i.target))},n,o);case 0:case 3:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(i=>y.revive(i.target))},n,o)}}async _fireWillEvent(e,t,n,o){let i=new Set,s=[];if(await e.fireAsync(t,o,async(l,d)=>{let c=Date.now(),u=await Promise.resolve(l);u instanceof _o&&(s.push([d.extension,u]),i.add(d.extension.displayName??d.extension.identifier.value)),Date.now()-c>n&&this._logService.warn("SLOW file-participant",d.extension.identifier)}),o.isCancellationRequested||s.length===0)return;let a={edits:[]};for(let[,l]of s){let{edits:d}=Bn.from(l,{getTextDocumentVersion:c=>this._extHostDocumentsAndEditors.getDocument(c)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(d)}return{edit:a,extensionNames:Array.from(i)}}};var wS=class{constructor(e,t,n,o,i){this._extHostNotebooks=t;this._textDocumentsAndEditors=n;this._commands=o;let s=new Te("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new j("showOptions","Show Options",a=>!0,a=>a),new j("resource","Interactive resource Uri",a=>!0,a=>a),new j("controllerId","Notebook controller Id",a=>!0,a=>a),new j("title","Interactive editor title",a=>!0,a=>a)],new xe("Notebook and input URI",a=>{if(i.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){let l=this._extHostNotebooks.getEditorById(a.notebookEditorId);return i.debug("[ExtHostInteractive] notebook editor found",l.id),{notebookUri:y.revive(a.notebookUri),inputUri:y.revive(a.inputUri),notebookEditor:l.apiEditor}}return i.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:y.revive(a.notebookUri),inputUri:y.revive(a.inputUri)}}));this._commands.registerApiCommand(s)}$willAddInteractiveDocument(e,t,n,o){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:n,uri:e,isDirty:!1,versionId:1,encoding:"utf8"}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}};var kS=class{constructor(e){this._handlePool=0;this._proxy=e.getProxy(N.MainThreadLabelService)}$registerResourceLabelFormatter(e){let t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),J(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}};var _S=class r extends Oe{constructor(e,t,n,o){super(e,t,n,o),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=o}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return r.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new r(this.startLineNumber,this.startColumn,e,t):new r(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new sn(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new sn(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new r(e,t,this.endLineNumber,this.endColumn):new r(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new r(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new r(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new r(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new r(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!this.selectionsEqual(e[n],t[n]))return!1;return!0}static isISelection(e){return!!e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,n,o,i){return i===0?new r(e,t,n,o):new r(n,o,e,t)}};var PS=class r{constructor(e,t){this._documents=e;this._provider=t}async provideDocumentSymbols(e,t){let n=this._documents.getDocument(e),o=await this._provider.provideDocumentSymbols(n,t);if(!Dm(o))return o[0]instanceof zo?o.map(K_.from):r._asDocumentSymbolTree(o)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((o,i)=>{let s=o.location.range.start.compareTo(i.location.range.start);return s===0&&(s=i.location.range.end.compareTo(o.location.range.end)),s});let t=[],n=[];for(let o of e){let i={name:o.name||"!!MISSING: name!!",kind:Ko.from(o.kind),tags:o.tags?.map(Ms.from)||[],detail:"",containerName:o.containerName,range:V.from(o.location.range),selectionRange:V.from(o.location.range),children:[]};for(;;){if(n.length===0){n.push(i),t.push(i);break}let s=n[n.length-1];if(Oe.containsRange(s.range,i.range)&&!Oe.equalsRange(s.range,i.range)){s.children?.push(i),n.push(i);break}n.pop()}}return t}},tm=class{constructor(e,t,n,o,i,s){this._documents=e;this._commands=t;this._provider=n;this._extension=o;this._extTelemetry=i;this._logService=s;this._cache=new lo("CodeLens");this._disposables=new Map}async provideCodeLenses(e,t){let n=this._documents.getDocument(e),o=await this._provider.provideCodeLenses(n,t);if(!o||t.isCancellationRequested)return;let i=this._cache.add(o),s=new q;this._disposables.set(i,s);let a={cacheId:i,lenses:[]};for(let l=0;l<o.length;l++){if(!pe.isRange(o[l].range)){console.warn("INVALID code lens, range is not defined",this._extension.identifier.value);continue}a.lenses.push({cacheId:[i,l],range:V.from(o[l].range),command:this._commands.toInternal(o[l].command,s)})}return a}async resolveCodeLens(e,t){let n=e.cacheId&&this._cache.get(...e.cacheId);if(!n)return;let o;if(typeof this._provider.resolveCodeLens!="function"||n.isResolved?o=n:o=await this._provider.resolveCodeLens(n,t),o||(o=n),t.isCancellationRequested)return;let i=e.cacheId&&this._disposables.get(e.cacheId[0]);if(i){if(!o.command){let s=new Error("INVALID code lens resolved, lacks command: "+this._extension.identifier.value);this._extTelemetry.onExtensionError(this._extension.identifier,s),this._logService.error(s);return}return e.command=this._commands.toInternal(o.command,i),e}}releaseCodeLenses(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}};function qS(r){return Array.isArray(r)?r.map(zu.from):r?[zu.from(r)]:[]}var DS=class{constructor(e,t){this._documents=e;this._provider=t}async provideDefinition(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideDefinition(o,i,n);return qS(s)}},RS=class{constructor(e,t){this._documents=e;this._provider=t}async provideDeclaration(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideDeclaration(o,i,n);return qS(s)}},MS=class{constructor(e,t){this._documents=e;this._provider=t}async provideImplementation(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideImplementation(o,i,n);return qS(s)}},AS=class{constructor(e,t){this._documents=e;this._provider=t}async provideTypeDefinition(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideTypeDefinition(o,i,n);return qS(s)}},th=class r{constructor(e,t){this._documents=e;this._provider=t;this._hoverCounter=0;this._hoverMap=new Map}static{this.HOVER_MAP_MAX_SIZE=10}async provideHover(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t),a;if(n&&n.verbosityRequest){let u=n.verbosityRequest.previousHover.id,m=this._hoverMap.get(u);if(!m)throw new Error(`Hover with id ${u} not found`);let g={verbosityDelta:n.verbosityRequest.verbosityDelta,previousHover:m};a=await this._provider.provideHover(i,s,o,g)}else a=await this._provider.provideHover(i,s,o);if(!a||Dm(a.contents))return;a.range||(a.range=i.getWordRangeAtPosition(s)),a.range||(a.range=new pe(s,s));let l=Ku.from(a),d=this._hoverCounter;if(this._hoverMap.size===r.HOVER_MAP_MAX_SIZE){let u=Math.min(...this._hoverMap.keys());this._hoverMap.delete(u)}return this._hoverMap.set(d,a),this._hoverCounter+=1,{...l,id:d}}releaseHover(e){this._hoverMap.delete(e)}},LS=class{constructor(e,t){this._documents=e;this._provider=t}async provideEvaluatableExpression(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideEvaluatableExpression(o,i,n);if(s)return j_.from(s)}},OS=class{constructor(e,t){this._documents=e;this._provider=t}async provideInlineValues(e,t,n,o){let i=this._documents.getDocument(e),s=await this._provider.provideInlineValues(i,V.to(t),mf.to(n),o);if(Array.isArray(s))return s.map(a=>pf.from(a))}},NS=class{constructor(e,t){this._documents=e;this._provider=t}async provideDocumentHighlights(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideDocumentHighlights(o,i,n);if(Array.isArray(s))return s.map(Md.from)}},US=class{constructor(e,t,n){this._documents=e;this._provider=t;this._logService=n}async provideMultiDocumentHighlights(e,t,n,o){let i=this._documents.getDocument(e),s=n.map(d=>{try{return this._documents.getDocument(d)}catch(c){this._logService.error("Error: Unable to retrieve document from URI: "+d+". Error message: "+c);return}}).filter(d=>d!==void 0),a=Xe.to(t),l=await this._provider.provideMultiDocumentHighlights(i,a,s,o);if(Array.isArray(l))return l.map(Q_.from)}},FS=class{constructor(e,t){this._documents=e;this._provider=t}async provideLinkedEditingRanges(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.provideLinkedEditingRanges(o,i,n);if(s&&Array.isArray(s.ranges))return{ranges:Ze(s.ranges.map(V.from)),wordPattern:s.wordPattern}}},HS=class{constructor(e,t){this._documents=e;this._provider=t}async provideReferences(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t),a=await this._provider.provideReferences(i,s,n,o);if(Array.isArray(a))return a.map(Vn.from)}},nm=class r{constructor(e,t,n,o,i,s,a){this._documents=e;this._commands=t;this._diagnostics=n;this._provider=o;this._logService=i;this._extension=s;this._apiDeprecation=a;this._cache=new lo("CodeAction");this._disposables=new Map}static{this._maxCodeActionsPerFile=1e3}async provideCodeActions(e,t,n,o){let i=this._documents.getDocument(e),s=_S.isISelection(t)?Qn.to(t):V.to(t),a=[];for(let g of this._diagnostics.getDiagnostics(e))if(s.intersection(g.range)&&a.push(g)>r._maxCodeActionsPerFile)break;let l={diagnostics:a,only:n.only?new at(n.only):void 0,triggerKind:aP.to(n.trigger)},d=await this._provider.provideCodeActions(i,s,l,o);if(!Qs(d)||o.isCancellationRequested)return;let c=this._cache.add(d),u=new q;this._disposables.set(c,u);let m=[];for(let g=0;g<d.length;g++){let v=d[g];if(v)if(r._isCommand(v)&&!(v instanceof Si))this._apiDeprecation.report("CodeActionProvider.provideCodeActions - return commands",this._extension,"Return 'CodeAction' instances instead."),m.push({_isSynthetic:!0,title:v.title,command:this._commands.toInternal(v,u)});else{let h=v;l.only&&(h.kind?l.only.contains(h.kind)||this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action is of kind '${h.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.`):this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`));let x=h.ranges??[];m.push({cacheId:[c,g],title:h.title,command:h.command&&this._commands.toInternal(h.command,u),diagnostics:h.diagnostics&&h.diagnostics.map(Ls.from),edit:h.edit&&Bn.from(h.edit,void 0),kind:h.kind&&h.kind.value,isPreferred:h.isPreferred,isAI:Fe(this._extension,"codeActionAI")?h.isAI:!1,ranges:Fe(this._extension,"codeActionRanges")?Ze(x.map(V.from)):void 0,disabled:h.disabled?.reason})}}return{cacheId:c,actions:m}}async resolveCodeAction(e,t){let[n,o]=e,i=this._cache.get(n,o);if(!i||r._isCommand(i))return{};if(!this._provider.resolveCodeAction)return{};let s=await this._provider.resolveCodeAction(i,t)??i,a;s.edit&&(a=Bn.from(s.edit,void 0));let l;if(s.command){let d=this._disposables.get(n);d&&(l=this._commands.toInternal(s.command,d))}return{edit:a,command:l}}releaseCodeActions(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}static _isCommand(e){return typeof e.command=="string"&&typeof e.title=="string"}},Zd=class{constructor(e,t,n,o,i){this._proxy=e;this._documents=t;this._provider=n;this._handle=o;this._extension=i;this._editsCache=new lo("DocumentPasteEdit.edits")}async prepareDocumentPaste(e,t,n,o){if(!this._provider.prepareDocumentPaste)return;this._cachedPrepare=void 0;let i=this._documents.getDocument(e),s=t.map(u=>V.to(u)),a=Hd.toDataTransfer(n,()=>{throw new Eh});if(await this._provider.prepareDocumentPaste(i,s,a,o),o.isCancellationRequested)return;let l=Array.from(a).filter(([,u])=>!(u instanceof $a)),d=new Map,c=await Promise.all(Array.from(l,async([u,m])=>{let g=pt();return d.set(g,m),[u,await Rd.from(u,m,g)]}));return this._cachedPrepare=d,{items:c}}async providePasteEdits(e,t,n,o,i,s){if(!this._provider.provideDocumentPasteEdits)return[];let a=this._documents.getDocument(t),l=n.map(g=>V.to(g)),d=o.items.map(([g,v])=>{let h=this._cachedPrepare?.get(v.id);return h?[g,h]:[g,Rd.to(g,v,async x=>(await this._proxy.$resolvePasteFileData(this._handle,e,x)).buffer)]}),c=new mr(d),u=await this._provider.provideDocumentPasteEdits(a,l,c,{only:i.only?new gr(i.only):void 0,triggerKind:i.triggerKind},s);if(!u||s.isCancellationRequested)return[];let m=this._editsCache.add(u);return u.map((g,v)=>({_cacheId:[m,v],title:g.title??p(3161,null,this._extension.displayName||this._extension.name),kind:g.kind,yieldTo:g.yieldTo?.map(h=>h.value),insertText:typeof g.insertText=="string"?g.insertText:{snippet:g.insertText.value},additionalEdit:g.additionalEdit?Bn.from(g.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){let[n,o]=e,i=this._editsCache.get(n,o);if(!i||!this._provider.resolveDocumentPasteEdit)return{};let s=await this._provider.resolveDocumentPasteEdit(i,t)??i;return{insertText:s.insertText,additionalEdit:s.additionalEdit?Bn.from(s.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._editsCache.delete(e)}},VS=class{constructor(e,t){this._documents=e;this._provider=t}async provideDocumentFormattingEdits(e,t,n){let o=this._documents.getDocument(e),i=await this._provider.provideDocumentFormattingEdits(o,t,n);if(Array.isArray(i))return i.map(tn.from)}},nh=class{constructor(e,t){this._documents=e;this._provider=t}async provideDocumentRangeFormattingEdits(e,t,n,o){let i=this._documents.getDocument(e),s=V.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(i,s,n,o);if(Array.isArray(a))return a.map(tn.from)}async provideDocumentRangesFormattingEdits(e,t,n,o){kh(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");let i=this._documents.getDocument(e),s=t.map(V.to),a=await this._provider.provideDocumentRangesFormattingEdits(i,s,n,o);if(Array.isArray(a))return a.map(tn.from)}},BS=class{constructor(e,t){this._documents=e;this._provider=t;this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,n,o,i){let s=this._documents.getDocument(e),a=Xe.to(t),l=await this._provider.provideOnTypeFormattingEdits(s,a,n,o,i);if(Array.isArray(l))return l.map(tn.from)}},om=class{constructor(e,t){this._provider=e;this._logService=t;this._cache=new lo("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){let n=await this._provider.provideWorkspaceSymbols(e,t);if(!Qs(n))return{symbols:[]};let o=this._cache.add(n),i={cacheId:o,symbols:[]};for(let s=0;s<n.length;s++){let a=n[s];if(!a||!a.name){this._logService.warn("INVALID SymbolInformation",a);continue}i.symbols.push({...nl.from(a),cacheId:[o,s]})}return i}async resolveWorkspaceSymbol(e,t){if(typeof this._provider.resolveWorkspaceSymbol!="function"||!e.cacheId)return e;let n=this._cache.get(...e.cacheId);if(n){let o=await this._provider.resolveWorkspaceSymbol(n,t);return o&&ar(e,nl.from(o),!0)}}releaseWorkspaceSymbols(e){this._cache.delete(e)}},rm=class r{constructor(e,t,n){this._documents=e;this._provider=t;this._logService=n}static supportsResolving(e){return typeof e.prepareRename=="function"}async provideRenameEdits(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t);try{let a=await this._provider.provideRenameEdits(i,s,n,o);return a?Bn.from(a):void 0}catch(a){let l=r._asMessage(a);return l?{rejectReason:l,edits:void 0}:Promise.reject(a)}}async resolveRenameLocation(e,t,n){if(typeof this._provider.prepareRename!="function")return Promise.resolve(void 0);let o=this._documents.getDocument(e),i=Xe.to(t);try{let s=await this._provider.prepareRename(o,i,n),a,l;if(pe.isRange(s)?(a=s,l=o.getText(s)):ut(s)&&(a=s.range,l=s.placeholder),!a||!l)return;if(a.start.line>i.line||a.end.line<i.line){this._logService.warn("INVALID rename location: position line must be within range start/end lines");return}return{range:V.from(a),text:l}}catch(s){let a=r._asMessage(s);return a?{rejectReason:a,range:void 0,text:void 0}:Promise.reject(s)}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}},oh=class r{constructor(e,t,n){this._documents=e;this._provider=t;this._logService=n}static{this.languageTriggerKindToVSCodeTriggerKind={0:0,1:1}}async supportsAutomaticNewSymbolNamesTriggerKind(){return this._provider.supportsAutomaticTriggerKind}async provideNewSymbolNames(e,t,n,o){let i=this._documents.getDocument(e),s=V.to(t);try{let a=r.languageTriggerKindToVSCodeTriggerKind[n],l=await this._provider.provideNewSymbolNames(i,s,a,o);return l?l.map(d=>typeof d=="string"?{newSymbolName:d}:{newSymbolName:d.newSymbolName,tags:d.tags}):void 0}catch(a){this._logService.error(r._asMessage(a)??JSON.stringify(a,null,"	"));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}},rh=class{constructor(e,t){this.resultId=e;this.tokens=t}},ih=class r{constructor(e,t){this._documents=e;this._provider=t;this._nextResultId=1;this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,n){let o=this._documents.getDocument(e),i=t!==0?this._previousResults.get(t):null,s=typeof i?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(o,i.resultId,n):await this._provider.provideDocumentSemanticTokens(o,n);return i&&this._previousResults.delete(t),s?(s=r._fixProvidedSemanticTokens(s),this._send(r._convertToEdits(i,s),s)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return r._isSemanticTokens(e)?r._isCorrectSemanticTokens(e)?e:new Gr(new Uint32Array(e.data),e.resultId):r._isSemanticTokensEdits(e)?r._isCorrectSemanticTokensEdits(e)?e:new za(e.edits.map(t=>new Iu(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(let t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!r._isSemanticTokens(t)||!e||!e.tokens)return t;let n=e.tokens,o=n.length,i=t.data,s=i.length,a=0,l=Math.min(o,s);for(;a<l&&n[a]===i[a];)a++;if(a===o&&a===s)return new za([],t.resultId);let d=0,c=l-a;for(;d<c&&n[o-d-1]===i[s-d-1];)d++;return new za([{start:a,deleteCount:o-a-d,data:i.subarray(a,s-d)}],t.resultId)}_send(e,t){if(r._isSemanticTokens(e)){let n=this._nextResultId++;return this._previousResults.set(n,new rh(e.resultId,e.data)),eS({id:n,type:"full",data:e.data})}if(r._isSemanticTokensEdits(e)){let n=this._nextResultId++;return r._isSemanticTokens(t)?this._previousResults.set(n,new rh(t.resultId,t.data)):this._previousResults.set(n,new rh(e.resultId)),eS({id:n,type:"delta",deltas:(e.edits||[]).map(o=>({start:o.start,deleteCount:o.deleteCount,data:o.data}))})}return null}},WS=class{constructor(e,t){this._documents=e;this._provider=t}async provideDocumentRangeSemanticTokens(e,t,n){let o=this._documents.getDocument(e),i=await this._provider.provideDocumentRangeSemanticTokens(o,V.to(t),n);return i?this._send(i):null}_send(e){return eS({id:0,type:"full",data:e.data})}},ec=class r{constructor(e,t,n,o,i){this._documents=e;this._commands=t;this._provider=n;this._apiDeprecation=o;this._extension=i;this._cache=new lo("CompletionItem");this._disposables=new Map}static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}async provideCompletionItems(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t),a=i.getWordRangeAtPosition(s)||new pe(s,s),l=a.with({end:s}),d=new uo,c=await this._provider.provideCompletionItems(i,s,o,J_.to(n));if(!c||o.isCancellationRequested)return;let u=Array.isArray(c)?new Wr(c):c,m=r.supportsResolving(this._provider)?this._cache.add(u.items):this._cache.add([]),g=new q;this._disposables.set(m,g);let v=[],h={x:m,b:v,a:{replace:V.from(a),insert:V.from(l)},c:u.isIncomplete||void 0,d:d.elapsed()};for(let x=0;x<u.items.length;x++){let S=u.items[x],T=this._convertCompletionItem(S,[m,x],l,a);v.push(T)}return h}async resolveCompletionItem(e,t){if(typeof this._provider.resolveCompletionItem!="function")return;let n=this._cache.get(...e);if(!n)return;let o=this._convertCompletionItem(n,e),i=await this._provider.resolveCompletionItem(n,t);if(!i)return;let s=this._convertCompletionItem(i,e);return(o.h!==s.h||o.i!==s.i)&&this._apiDeprecation.report("CompletionItem.insertText",this._extension,"extension MAY NOT change 'insertText' of a CompletionItem during resolve"),(o.n!==s.n||o.o!==s.o||!Wt(o.p,s.p))&&this._apiDeprecation.report("CompletionItem.command",this._extension,"extension MAY NOT change 'command' of a CompletionItem during resolve"),{...o,d:s.d,c:s.c,l:s.l,h:s.h,i:s.i,n:s.n,o:s.o,p:s.p}}releaseCompletionItems(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_convertCompletionItem(e,t,n,o){let i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");let s=this._commands.toInternal(e.command,i),a={x:t,a:e.label,b:e.kind!==void 0?CI.from(e.kind):void 0,m:e.tags&&e.tags.map(SI.from),c:e.detail,d:typeof e.documentation>"u"?void 0:ce.fromStrict(e.documentation),e:e.sortText!==e.label?e.sortText:void 0,f:e.filterText!==e.label?e.filterText:void 0,g:e.preselect||void 0,i:e.keepWhitespace?1:0,k:e.commitCharacters?.join(""),l:e.additionalTextEdits&&e.additionalTextEdits.map(tn.from),n:s?.$ident,o:s?.id,p:s?.$ident?void 0:s?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a.h=e.textEdit.newText):typeof e.insertText=="string"?a.h=e.insertText:e.insertText instanceof Sn&&(a.h=e.insertText.value,a.i|=4);let l;return e.textEdit?l=e.textEdit.range:e.range&&(l=e.range),pe.isRange(l)?a.j=V.from(l):l&&(!n?.isEqual(l.inserting)||!o?.isEqual(l.replacing))&&(a.j={insert:V.from(l.inserting),replace:V.from(l.replacing)}),a}},Ui=class{constructor(e,t,n,o){this._extension=e;this._documents=t;this._provider=n;this._commands=o;this._references=new wR;this.languageTriggerKindToVSCodeTriggerKind={0:1,1:0};this._isAdditionsProposedApiEnabled=Fe(this._extension,"inlineCompletionsAdditions")}get supportsHandleEvents(){return Fe(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function"||typeof this._provider.handleDidRejectCompletionItem=="function"||typeof this._provider.handleEndOfLifetime=="function")}get supportsSetModelId(){return Fe(this._extension,"inlineCompletionsAdditions")&&typeof this._provider.setCurrentModelId=="function"}get modelInfo(){if(this._isAdditionsProposedApiEnabled)return this._provider.modelInfo?{models:this._provider.modelInfo.models,currentModelId:this._provider.modelInfo.currentModelId}:void 0}setCurrentModelId(e){this._isAdditionsProposedApiEnabled&&this._provider.setCurrentModelId?.(e)}async provideInlineCompletions(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t),a=await this._provider.provideInlineCompletionItems(i,s,{selectedCompletionInfo:n.selectedSuggestionInfo?{range:V.to(n.selectedSuggestionInfo.range),text:n.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[n.triggerKind],requestUuid:n.requestUuid,requestIssuedDateTime:n.requestIssuedDateTime,earliestShownDateTime:n.earliestShownDateTime,changeHint:n.changeHint},o);if(!a)return;let{resultItems:l,list:d}=Array.isArray(a)?{resultItems:a,list:void 0}:{resultItems:a.items,list:a},c=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0,m;return{pid:this._references.createReferenceId({dispose(){m?.dispose()},items:l,list:d}),languageId:i.languageId,items:l.map((h,x)=>{let S;h.command&&(m||(m=new q),S=this._commands.toInternal(h.command,m));let T;h.action&&(m||(m=new q),T=this._commands.toInternal(h.action,m));let P=h.insertText;return{insertText:P===void 0?void 0:typeof P=="string"?P:{snippet:P.value},range:h.range?V.from(h.range):void 0,showRange:this._isAdditionsProposedApiEnabled&&h.showRange?V.from(h.showRange):void 0,command:S,gutterMenuLinkAction:T,idx:x,completeBracketPairs:this._isAdditionsProposedApiEnabled?h.completeBracketPairs:!1,isInlineEdit:this._isAdditionsProposedApiEnabled?h.isInlineEdit:!1,showInlineEditMenu:this._isAdditionsProposedApiEnabled?h.showInlineEditMenu:!1,hint:h.displayLocation&&this._isAdditionsProposedApiEnabled?{range:V.from(h.displayLocation.range),content:h.displayLocation.label,style:h.displayLocation.kind?fP.from(h.displayLocation.kind):1}:void 0,warning:h.warning&&this._isAdditionsProposedApiEnabled?{message:ce.from(h.warning.message),icon:h.warning.icon?Xr.fromThemeIcon(h.warning.icon):void 0}:void 0,correlationId:this._isAdditionsProposedApiEnabled?h.correlationId:void 0,suggestionId:void 0,uri:this._isAdditionsProposedApiEnabled&&h.uri?h.uri:void 0,supportsRename:this._isAdditionsProposedApiEnabled?h.supportsRename:!1,jumpToPosition:this._isAdditionsProposedApiEnabled&&h.jumpToPosition?Xe.from(h.jumpToPosition):void 0}}),commands:c.map(h=>(m||(m=new q),X_.from(h,this._commands,m))),suppressSuggestions:!1,enableForwardStability:u}}disposeCompletions(e,t){let n=this._references.get(e);if(this._provider.handleListEndOfLifetime&&this._isAdditionsProposedApiEnabled&&n?.list){let i=function(s){switch(s.kind){case"lostRace":return{kind:3};case"tokenCancellation":return{kind:2};case"other":return{kind:0};case"empty":return{kind:1};case"notTaken":return{kind:4};default:return{kind:0}}};this._provider.handleListEndOfLifetime(n.list,i(t))}this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,n){let o=this._references.get(e)?.items[t];o&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(o,n)}handlePartialAccept(e,t,n,o){let i=this._references.get(e)?.items[t];i&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(i,n),this._provider.handleDidPartiallyAcceptCompletionItem(i,mP.to(o)))}handleEndOfLifetime(e,t,n){let o=this._references.get(e)?.items[t];if(o&&this._provider.handleEndOfLifetime&&this._isAdditionsProposedApiEnabled){let i=gP.to(n,s=>this._references.get(s.pid)?.items[s.idx]);this._provider.handleEndOfLifetime(o,i)}}handleRejection(e,t){let n=this._references.get(e)?.items[t];n&&this._provider.handleDidRejectCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidRejectCompletionItem(n)}},wR=class{constructor(){this._references=new Map;this._idPool=1}createReferenceId(e){let t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){let t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}},sh=class{constructor(e,t){this._documents=e;this._provider=t;this._cache=new lo("SignatureHelp")}async provideSignatureHelp(e,t,n,o){let i=this._documents.getDocument(e),s=Xe.to(t),a=this.reviveContext(n),l=await this._provider.provideSignatureHelp(i,s,o,a);if(l){let d=this._cache.add([l]);return{...qu.from(l),id:d}}}reviveContext(e){let t;if(e.activeSignatureHelp){let n=qu.to(e.activeSignatureHelp),o=this._cache.get(e.activeSignatureHelp.id,0);o?(t=o,t.activeSignature=n.activeSignature,t.activeParameter=n.activeParameter):t=n}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}},im=class{constructor(e,t,n,o,i){this._documents=e;this._commands=t;this._provider=n;this._logService=o;this._extension=i;this._cache=new lo("InlayHints");this._disposables=new Map}async provideInlayHints(e,t,n){let o=this._documents.getDocument(e),i=V.to(t),s=await this._provider.provideInlayHints(o,i,n);if(!Array.isArray(s)||s.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(n.isCancellationRequested)return;let a=this._cache.add(s);this._disposables.set(a,new q);let l={hints:[],cacheId:a};for(let d=0;d<s.length;d++)this._isValidInlayHint(s[d],i)&&l.hints.push(this._convertInlayHint(s[d],[a,d]));return this._logService.trace(`[InlayHints] ${l.hints.length} inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`),l}async resolveInlayHint(e,t){if(typeof this._provider.resolveInlayHint!="function")return;let n=this._cache.get(...e);if(!n)return;let o=await this._provider.resolveInlayHint(n,t);if(o&&this._isValidInlayHint(o))return this._convertInlayHint(o,e)}releaseHints(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_isValidInlayHint(e,t){return e.label.length===0||Array.isArray(e.label)&&e.label.every(n=>n.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){let n=this._disposables.get(t[0]);if(!n)throw Error("DisposableStore is missing...");let o={label:"",cacheId:t,tooltip:ce.fromStrict(e.tooltip),position:Xe.from(e.position),textEdits:e.textEdits&&e.textEdits.map(tn.from),kind:e.kind&&TI.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")o.label=e.label;else{let i=[];o.label=i;for(let s of e.label){if(!s.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}let a={label:s.value,tooltip:ce.fromStrict(s.tooltip)};At.isLocation(s.location)&&(a.location=Vn.from(s.location)),s.command&&(a.command=this._commands.toInternal(s.command,n)),i.push(a)}}return o}},sm=class r{constructor(e,t){this._documents=e;this._provider=t;this._cache=new lo("DocumentLink")}async provideLinks(e,t){let n=this._documents.getDocument(e),o=await this._provider.provideDocumentLinks(n,t);if(!(!Array.isArray(o)||o.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:o.filter(r._validateLink).map(Ns.from)};{let i=this._cache.add(o),s={links:[],cacheId:i};for(let a=0;a<o.length;a++){if(!r._validateLink(o[a]))continue;let l=Ns.from(o[a]);l.cacheId=[i,a],s.links.push(l)}return s}}}static _validateLink(e){return e.target&&e.target.path.length>5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;let n=this._cache.get(...e);if(!n)return;let o=await this._provider.resolveDocumentLink(n,t);if(!(!o||!r._validateLink(o)))return Ns.from(o)}releaseLinks(e){this._cache.delete(e)}},ah=class{constructor(e,t){this._documents=e;this._provider=t}async provideColors(e,t){let n=this._documents.getDocument(e),o=await this._provider.provideDocumentColors(n,t);return Array.isArray(o)?o.map(s=>({color:Ud.from(s.color),range:V.from(s.range)})):[]}async provideColorPresentations(e,t,n){let o=this._documents.getDocument(e),i=V.to(t.range),s=Ud.to(t.color),a=await this._provider.provideColorPresentations(s,{document:o,range:i},n);if(Array.isArray(a))return a.map(gf.from)}},$S=class{constructor(e,t){this._documents=e;this._provider=t}async provideFoldingRanges(e,t,n){let o=this._documents.getDocument(e),i=await this._provider.provideFoldingRanges(o,t,n);if(Array.isArray(i))return i.map(hf.from)}},zS=class{constructor(e,t,n){this._documents=e;this._provider=t;this._logService=n}async provideSelectionRanges(e,t,n){let o=this._documents.getDocument(e),i=t.map(Xe.to),s=await this._provider.provideSelectionRanges(o,i,n);if(!Qs(s))return[];if(s.length!==i.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];let a=[];for(let l=0;l<i.length;l++){let d=[];a.push(d);let c=i[l],u=s[l];for(;;){if(!u.range.contains(c))throw new Error("INVALID selection range, must contain the previous range");if(d.push(eP.from(u)),!u.parent)break;c=u.range,u=u.parent}}return a}},tc=class{constructor(e,t){this._documents=e;this._provider=t;this._idPool=new hl("");this._cache=new Map}async prepareSession(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.prepareCallHierarchy(o,i,n);if(!s)return;let a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(s)?s.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,s)]}async provideCallsTo(e,t,n){let o=this._itemFromCache(e,t);if(!o)throw new Error("missing call hierarchy item");let i=await this._provider.provideCallHierarchyIncomingCalls(o,n);if(i)return i.map(s=>({from:this._cacheAndConvertItem(e,s.from),fromRanges:s.fromRanges.map(a=>V.from(a))}))}async provideCallsFrom(e,t,n){let o=this._itemFromCache(e,t);if(!o)throw new Error("missing call hierarchy item");let i=await this._provider.provideCallHierarchyOutgoingCalls(o,n);if(i)return i.map(s=>({to:this._cacheAndConvertItem(e,s.to),fromRanges:s.fromRanges.map(a=>V.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),o=Os.from(t,e,n.size.toString(36));return n.set(o._itemId,t),o}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},nc=class{constructor(e,t){this._documents=e;this._provider=t;this._idPool=new hl("");this._cache=new Map}async prepareSession(e,t,n){let o=this._documents.getDocument(e),i=Xe.to(t),s=await this._provider.prepareTypeHierarchy(o,i,n);if(!s)return;let a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(s)?s.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,s)]}async provideSupertypes(e,t,n){let o=this._itemFromCache(e,t);if(!o)throw new Error("missing type hierarchy item");let i=await this._provider.provideTypeHierarchySupertypes(o,n);if(i)return i.map(s=>this._cacheAndConvertItem(e,s))}async provideSubtypes(e,t,n){let o=this._itemFromCache(e,t);if(!o)throw new Error("missing type hierarchy item");let i=await this._provider.provideTypeHierarchySubtypes(o,n);if(i)return i.map(s=>this._cacheAndConvertItem(e,s))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),o=Us.from(t,e,n.size.toString(36));return n.set(o._itemId,t),o}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},am=class{constructor(e,t,n,o,i){this._proxy=e;this._documents=t;this._provider=n;this._handle=o;this._extension=i;this._cache=new lo("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,n,o,i){let s=this._documents.getDocument(t),a=Xe.to(n),l=Hd.toDataTransfer(o,async m=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,m)).buffer),d=await this._provider.provideDocumentDropEdits(s,a,l,i);if(!d)return;let c=hn(d),u=this._cache.add(c);return c.map((m,g)=>({_cacheId:[u,g],title:m.title??p(3160,null,this._extension.displayName||this._extension.name),kind:m.kind?.value,yieldTo:m.yieldTo?.map(v=>v.value),insertText:typeof m.insertText=="string"?m.insertText:{snippet:m.insertText.value},additionalEdit:m.additionalEdit?Bn.from(m.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){let[n,o]=e,i=this._cache.get(n,o);if(!i||!this._provider.resolveDocumentDropEdit)return{};let s=await this._provider.resolveDocumentDropEdit(i,t)??i;return{additionalEdit:s.additionalEdit?Bn.from(s.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}},oc=class{constructor(e,t){this.adapter=e;this.extension=t}},KS=class r extends H{constructor(t,n,o,i,s,a,l,d){super();this._uriTransformer=n;this._documents=o;this._commands=i;this._diagnostics=s;this._logService=a;this._apiDeprecation=l;this._extensionTelemetry=d;this._adapter=new Map;this._onDidChangeInlineCompletionsUnificationState=this._register(new E);this.onDidChangeInlineCompletionsUnificationState=this._onDidChangeInlineCompletionsUnificationState.event;this._proxy=t.getProxy(N.MainThreadLanguageFeatures),this._inlineCompletionsUnificationState={codeUnification:!1,modelUnification:!1,extensionUnification:!1,expAssignments:[]}}static{this._handlePool=0}get inlineCompletionsUnificationState(){return this._inlineCompletionsUnificationState}_transformDocumentSelector(t,n){return Jr.from(t,this._uriTransformer,n)}_createDisposable(t){return new fe(()=>{this._adapter.delete(t),this._proxy.$unregister(t)})}_nextHandle(){return r._handlePool++}async _withAdapter(t,n,o,i,s,a=!1){let l=this._adapter.get(t);if(!l||!(l.adapter instanceof n))return i;let d=Date.now();a||this._logService.trace(`[${l.extension.identifier.value}] INVOKE provider '${o.toString().replace(/[\r\n]/g,"")}'`);let c=o(l.adapter,l.extension);return Promise.resolve(c).catch(u=>{Tn(u)||(this._logService.error(`[${l.extension.identifier.value}] provider FAILED`),this._logService.error(u),this._extensionTelemetry.onExtensionError(l.extension.identifier,u))}).finally(()=>{a||this._logService.trace(`[${l.extension.identifier.value}] provider DONE after ${Date.now()-d}ms`)}),be.isCancellationToken(s)?kc(c,s):c}_addNewAdapter(t,n){let o=this._nextHandle();return this._adapter.set(o,new oc(t,n)),o}static _extLabel(t){return t.displayName||t.name}static _extId(t){return t.identifier.value}registerDocumentSymbolProvider(t,n,o,i){let s=this._addNewAdapter(new PS(this._documents,o),t),a=i&&i.label||r._extLabel(t);return this._proxy.$registerDocumentSymbolProvider(s,this._transformDocumentSelector(n,t),a),this._createDisposable(s)}$provideDocumentSymbols(t,n,o){return this._withAdapter(t,PS,i=>i.provideDocumentSymbols(y.revive(n),o),void 0,o)}registerCodeLensProvider(t,n,o){let i=this._nextHandle(),s=typeof o.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(i,new oc(new tm(this._documents,this._commands.converter,o,t,this._extensionTelemetry,this._logService),t)),this._proxy.$registerCodeLensSupport(i,this._transformDocumentSelector(n,t),s);let a=this._createDisposable(i);if(s!==void 0){let l=o.onDidChangeCodeLenses(d=>this._proxy.$emitCodeLensEvent(s));a=fe.from(a,l)}return a}$provideCodeLenses(t,n,o){return this._withAdapter(t,tm,i=>i.provideCodeLenses(y.revive(n),o),void 0,o,n.scheme==="output")}$resolveCodeLens(t,n,o){return this._withAdapter(t,tm,i=>i.resolveCodeLens(n,o),void 0,void 0,!0)}$releaseCodeLenses(t,n){this._withAdapter(t,tm,o=>Promise.resolve(o.releaseCodeLenses(n)),void 0,void 0,!0)}registerDefinitionProvider(t,n,o){let i=this._addNewAdapter(new DS(this._documents,o),t);return this._proxy.$registerDefinitionSupport(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideDefinition(t,n,o,i){return this._withAdapter(t,DS,s=>s.provideDefinition(y.revive(n),o,i),[],i)}registerDeclarationProvider(t,n,o){let i=this._addNewAdapter(new RS(this._documents,o),t);return this._proxy.$registerDeclarationSupport(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideDeclaration(t,n,o,i){return this._withAdapter(t,RS,s=>s.provideDeclaration(y.revive(n),o,i),[],i)}registerImplementationProvider(t,n,o){let i=this._addNewAdapter(new MS(this._documents,o),t);return this._proxy.$registerImplementationSupport(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideImplementation(t,n,o,i){return this._withAdapter(t,MS,s=>s.provideImplementation(y.revive(n),o,i),[],i)}registerTypeDefinitionProvider(t,n,o){let i=this._addNewAdapter(new AS(this._documents,o),t);return this._proxy.$registerTypeDefinitionSupport(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideTypeDefinition(t,n,o,i){return this._withAdapter(t,AS,s=>s.provideTypeDefinition(y.revive(n),o,i),[],i)}registerHoverProvider(t,n,o,i){let s=this._addNewAdapter(new th(this._documents,o),t);return this._proxy.$registerHoverProvider(s,this._transformDocumentSelector(n,t)),this._createDisposable(s)}$provideHover(t,n,o,i,s){return this._withAdapter(t,th,a=>a.provideHover(y.revive(n),o,i,s),void 0,s)}$releaseHover(t,n){this._withAdapter(t,th,o=>Promise.resolve(o.releaseHover(n)),void 0,void 0)}registerEvaluatableExpressionProvider(t,n,o,i){let s=this._addNewAdapter(new LS(this._documents,o),t);return this._proxy.$registerEvaluatableExpressionProvider(s,this._transformDocumentSelector(n,t)),this._createDisposable(s)}$provideEvaluatableExpression(t,n,o,i){return this._withAdapter(t,LS,s=>s.provideEvaluatableExpression(y.revive(n),o,i),void 0,i)}registerInlineValuesProvider(t,n,o,i){let s=typeof o.onDidChangeInlineValues=="function"?this._nextHandle():void 0,a=this._addNewAdapter(new OS(this._documents,o),t);this._proxy.$registerInlineValuesProvider(a,this._transformDocumentSelector(n,t),s);let l=this._createDisposable(a);if(s!==void 0){let d=o.onDidChangeInlineValues(c=>this._proxy.$emitInlineValuesEvent(s));l=fe.from(l,d)}return l}$provideInlineValues(t,n,o,i,s){return this._withAdapter(t,OS,a=>a.provideInlineValues(y.revive(n),o,i,s),void 0,s)}registerDocumentHighlightProvider(t,n,o){let i=this._addNewAdapter(new NS(this._documents,o),t);return this._proxy.$registerDocumentHighlightProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}registerMultiDocumentHighlightProvider(t,n,o){let i=this._addNewAdapter(new US(this._documents,o,this._logService),t);return this._proxy.$registerMultiDocumentHighlightProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideDocumentHighlights(t,n,o,i){return this._withAdapter(t,NS,s=>s.provideDocumentHighlights(y.revive(n),o,i),void 0,i)}$provideMultiDocumentHighlights(t,n,o,i,s){return this._withAdapter(t,US,a=>a.provideMultiDocumentHighlights(y.revive(n),o,i.map(l=>y.revive(l)),s),void 0,s)}registerLinkedEditingRangeProvider(t,n,o){let i=this._addNewAdapter(new FS(this._documents,o),t);return this._proxy.$registerLinkedEditingRangeProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideLinkedEditingRanges(t,n,o,i){return this._withAdapter(t,FS,async s=>{let a=await s.provideLinkedEditingRanges(y.revive(n),o,i);if(a)return{ranges:a.ranges,wordPattern:a.wordPattern?r._serializeRegExp(a.wordPattern):void 0}},void 0,i)}registerReferenceProvider(t,n,o){let i=this._addNewAdapter(new HS(this._documents,o),t);return this._proxy.$registerReferenceSupport(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideReferences(t,n,o,i,s){return this._withAdapter(t,HS,a=>a.provideReferences(y.revive(n),o,i,s),void 0,s)}registerCodeActionProvider(t,n,o,i){let s=new q,a=this._addNewAdapter(new nm(this._documents,this._commands.converter,this._diagnostics,o,this._logService,t,this._apiDeprecation),t);return this._proxy.$registerCodeActionSupport(a,this._transformDocumentSelector(n,t),{providedKinds:i?.providedCodeActionKinds?.map(l=>l.value),documentation:i?.documentation?.map(l=>({kind:l.kind.value,command:this._commands.converter.toInternal(l.command,s)}))},r._extLabel(t),r._extId(t),!!o.resolveCodeAction),s.add(this._createDisposable(a)),s}$provideCodeActions(t,n,o,i,s){return this._withAdapter(t,nm,a=>a.provideCodeActions(y.revive(n),o,i,s),void 0,s)}$resolveCodeAction(t,n,o){return this._withAdapter(t,nm,i=>i.resolveCodeAction(n,o),{},void 0)}$releaseCodeActions(t,n){this._withAdapter(t,nm,o=>Promise.resolve(o.releaseCodeActions(n)),void 0,void 0)}registerDocumentFormattingEditProvider(t,n,o){let i=this._addNewAdapter(new VS(this._documents,o),t);return this._proxy.$registerDocumentFormattingSupport(i,this._transformDocumentSelector(n,t),t.identifier,t.displayName||t.name),this._createDisposable(i)}$provideDocumentFormattingEdits(t,n,o,i){return this._withAdapter(t,VS,s=>s.provideDocumentFormattingEdits(y.revive(n),o,i),void 0,i)}registerDocumentRangeFormattingEditProvider(t,n,o){let i=typeof o.provideDocumentRangesFormattingEdits=="function",s=this._addNewAdapter(new nh(this._documents,o),t);return this._proxy.$registerRangeFormattingSupport(s,this._transformDocumentSelector(n,t),t.identifier,t.displayName||t.name,i),this._createDisposable(s)}$provideDocumentRangeFormattingEdits(t,n,o,i,s){return this._withAdapter(t,nh,a=>a.provideDocumentRangeFormattingEdits(y.revive(n),o,i,s),void 0,s)}$provideDocumentRangesFormattingEdits(t,n,o,i,s){return this._withAdapter(t,nh,a=>a.provideDocumentRangesFormattingEdits(y.revive(n),o,i,s),void 0,s)}registerOnTypeFormattingEditProvider(t,n,o,i){let s=this._addNewAdapter(new BS(this._documents,o),t);return this._proxy.$registerOnTypeFormattingSupport(s,this._transformDocumentSelector(n,t),i,t.identifier),this._createDisposable(s)}$provideOnTypeFormattingEdits(t,n,o,i,s,a){return this._withAdapter(t,BS,l=>l.provideOnTypeFormattingEdits(y.revive(n),o,i,s,a),void 0,a)}registerWorkspaceSymbolProvider(t,n){let o=this._addNewAdapter(new om(n,this._logService),t);return this._proxy.$registerNavigateTypeSupport(o,typeof n.resolveWorkspaceSymbol=="function"),this._createDisposable(o)}$provideWorkspaceSymbols(t,n,o){return this._withAdapter(t,om,i=>i.provideWorkspaceSymbols(n,o),{symbols:[]},o)}$resolveWorkspaceSymbol(t,n,o){return this._withAdapter(t,om,i=>i.resolveWorkspaceSymbol(n,o),void 0,void 0)}$releaseWorkspaceSymbols(t,n){this._withAdapter(t,om,o=>o.releaseWorkspaceSymbols(n),void 0,void 0)}registerRenameProvider(t,n,o){let i=this._addNewAdapter(new rm(this._documents,o,this._logService),t);return this._proxy.$registerRenameSupport(i,this._transformDocumentSelector(n,t),rm.supportsResolving(o)),this._createDisposable(i)}$provideRenameEdits(t,n,o,i,s){return this._withAdapter(t,rm,a=>a.provideRenameEdits(y.revive(n),o,i,s),void 0,s)}$resolveRenameLocation(t,n,o,i){return this._withAdapter(t,rm,s=>s.resolveRenameLocation(y.revive(n),o,i),void 0,i)}registerNewSymbolNamesProvider(t,n,o){let i=this._addNewAdapter(new oh(this._documents,o,this._logService),t);return this._proxy.$registerNewSymbolNamesProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$supportsAutomaticNewSymbolNamesTriggerKind(t){return this._withAdapter(t,oh,n=>n.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(t,n,o,i,s){return this._withAdapter(t,oh,a=>a.provideNewSymbolNames(y.revive(n),o,i,s),void 0,s)}registerDocumentSemanticTokensProvider(t,n,o,i){let s=this._addNewAdapter(new ih(this._documents,o),t),a=typeof o.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(s,this._transformDocumentSelector(n,t),i,a);let l=this._createDisposable(s);if(a){let d=o.onDidChangeSemanticTokens(c=>this._proxy.$emitDocumentSemanticTokensEvent(a));l=fe.from(l,d)}return l}$provideDocumentSemanticTokens(t,n,o,i){return this._withAdapter(t,ih,s=>s.provideDocumentSemanticTokens(y.revive(n),o,i),null,i)}$releaseDocumentSemanticTokens(t,n){this._withAdapter(t,ih,o=>o.releaseDocumentSemanticColoring(n),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(t,n,o,i){let s=this._addNewAdapter(new WS(this._documents,o),t),a=typeof o.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentRangeSemanticTokensProvider(s,this._transformDocumentSelector(n,t),i,a);let l=this._createDisposable(s);if(a){let d=o.onDidChangeSemanticTokens(c=>this._proxy.$emitDocumentRangeSemanticTokensEvent(a));l=fe.from(l,d)}return l}$provideDocumentRangeSemanticTokens(t,n,o,i){return this._withAdapter(t,WS,s=>s.provideDocumentRangeSemanticTokens(y.revive(n),o,i),null,i)}registerCompletionItemProvider(t,n,o,i){let s=this._addNewAdapter(new ec(this._documents,this._commands.converter,o,this._apiDeprecation,t),t);return this._proxy.$registerCompletionsProvider(s,this._transformDocumentSelector(n,t),i,ec.supportsResolving(o),t.identifier),this._createDisposable(s)}$provideCompletionItems(t,n,o,i,s){return this._withAdapter(t,ec,a=>a.provideCompletionItems(y.revive(n),o,i,s),void 0,s)}$resolveCompletionItem(t,n,o){return this._withAdapter(t,ec,i=>i.resolveCompletionItem(n,o),void 0,o)}$releaseCompletionItems(t,n){this._withAdapter(t,ec,o=>o.releaseCompletionItems(n),void 0,void 0)}registerInlineCompletionsProvider(t,n,o,i){let s=new Ui(t,this._documents,o,this._commands.converter),a=this._addNewAdapter(s,t),l=this._createDisposable(a),d=Fe(t,"inlineCompletionsAdditions")&&typeof o.onDidChange=="function";if(d){let u=o.onDidChange(m=>this._proxy.$emitInlineCompletionsChange(a,m?{data:m.data}:void 0));l=fe.from(l,u)}let c=Fe(t,"inlineCompletionsAdditions")&&typeof o.onDidChangeModelInfo=="function";if(c){let u=o.onDidChangeModelInfo(m=>this._proxy.$emitInlineCompletionModelInfoChange(a,s.modelInfo));l=fe.from(l,u)}return this._proxy.$registerInlineCompletionsSupport(a,this._transformDocumentSelector(n,t),s.supportsHandleEvents,_e.toKey(t.identifier.value),t.version,i?.groupId?_e.toKey(i.groupId):void 0,i?.yieldTo?.map(u=>_e.toKey(u))||[],i?.displayName,i?.debounceDelayMs,i?.excludes?.map(u=>_e.toKey(u))||[],d,s.supportsSetModelId,s.modelInfo,c),l}$provideInlineCompletions(t,n,o,i,s){return this._withAdapter(t,Ui,a=>a.provideInlineCompletions(y.revive(n),o,i,s),void 0,void 0)}$handleInlineCompletionDidShow(t,n,o,i){this._withAdapter(t,Ui,async s=>{s.handleDidShowCompletionItem(n,o,i)},void 0,void 0)}$handleInlineCompletionPartialAccept(t,n,o,i,s){this._withAdapter(t,Ui,async a=>{a.handlePartialAccept(n,o,i,s)},void 0,void 0)}$handleInlineCompletionEndOfLifetime(t,n,o,i){this._withAdapter(t,Ui,async s=>{s.handleEndOfLifetime(n,o,i)},void 0,void 0)}$handleInlineCompletionRejection(t,n,o){this._withAdapter(t,Ui,async i=>{i.handleRejection(n,o)},void 0,void 0)}$freeInlineCompletionsList(t,n,o){this._withAdapter(t,Ui,async i=>{i.disposeCompletions(n,o)},void 0,void 0)}$acceptInlineCompletionsUnificationState(t){this._inlineCompletionsUnificationState=t,this._onDidChangeInlineCompletionsUnificationState.fire()}$handleInlineCompletionSetCurrentModelId(t,n){this._withAdapter(t,Ui,async o=>{o.setCurrentModelId(n)},void 0,void 0)}registerSignatureHelpProvider(t,n,o,i){let s=Array.isArray(i)?{triggerCharacters:i,retriggerCharacters:[]}:i,a=this._addNewAdapter(new sh(this._documents,o),t);return this._proxy.$registerSignatureHelpProvider(a,this._transformDocumentSelector(n,t),s),this._createDisposable(a)}$provideSignatureHelp(t,n,o,i,s){return this._withAdapter(t,sh,a=>a.provideSignatureHelp(y.revive(n),o,i,s),void 0,s)}$releaseSignatureHelp(t,n){this._withAdapter(t,sh,o=>o.releaseSignatureHelp(n),void 0,void 0)}registerInlayHintsProvider(t,n,o){let i=typeof o.onDidChangeInlayHints=="function"?this._nextHandle():void 0,s=this._addNewAdapter(new im(this._documents,this._commands.converter,o,this._logService,t),t);this._proxy.$registerInlayHintsProvider(s,this._transformDocumentSelector(n,t),typeof o.resolveInlayHint=="function",i,r._extLabel(t));let a=this._createDisposable(s);if(i!==void 0){let l=o.onDidChangeInlayHints(d=>this._proxy.$emitInlayHintsEvent(i));a=fe.from(a,l)}return a}$provideInlayHints(t,n,o,i){return this._withAdapter(t,im,s=>s.provideInlayHints(y.revive(n),o,i),void 0,i)}$resolveInlayHint(t,n,o){return this._withAdapter(t,im,i=>i.resolveInlayHint(n,o),void 0,o)}$releaseInlayHints(t,n){this._withAdapter(t,im,o=>o.releaseHints(n),void 0,void 0)}registerDocumentLinkProvider(t,n,o){let i=this._addNewAdapter(new sm(this._documents,o),t);return this._proxy.$registerDocumentLinkProvider(i,this._transformDocumentSelector(n,t),typeof o.resolveDocumentLink=="function"),this._createDisposable(i)}$provideDocumentLinks(t,n,o){return this._withAdapter(t,sm,i=>i.provideLinks(y.revive(n),o),void 0,o,n.scheme==="output")}$resolveDocumentLink(t,n,o){return this._withAdapter(t,sm,i=>i.resolveLink(n,o),void 0,void 0,!0)}$releaseDocumentLinks(t,n){this._withAdapter(t,sm,o=>o.releaseLinks(n),void 0,void 0,!0)}registerColorProvider(t,n,o){let i=this._addNewAdapter(new ah(this._documents,o),t);return this._proxy.$registerDocumentColorProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideDocumentColors(t,n,o){return this._withAdapter(t,ah,i=>i.provideColors(y.revive(n),o),[],o)}$provideColorPresentations(t,n,o,i){return this._withAdapter(t,ah,s=>s.provideColorPresentations(y.revive(n),o,i),void 0,i)}registerFoldingRangeProvider(t,n,o){let i=this._nextHandle(),s=typeof o.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(i,new oc(new $S(this._documents,o),t)),this._proxy.$registerFoldingRangeProvider(i,this._transformDocumentSelector(n,t),t.identifier,s);let a=this._createDisposable(i);if(s!==void 0){let l=o.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(s));a=fe.from(a,l)}return a}$provideFoldingRanges(t,n,o,i){return this._withAdapter(t,$S,s=>s.provideFoldingRanges(y.revive(n),o,i),void 0,i)}registerSelectionRangeProvider(t,n,o){let i=this._addNewAdapter(new zS(this._documents,o,this._logService),t);return this._proxy.$registerSelectionRangeProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$provideSelectionRanges(t,n,o,i){return this._withAdapter(t,zS,s=>s.provideSelectionRanges(y.revive(n),o,i),[],i)}registerCallHierarchyProvider(t,n,o){let i=this._addNewAdapter(new tc(this._documents,o),t);return this._proxy.$registerCallHierarchyProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$prepareCallHierarchy(t,n,o,i){return this._withAdapter(t,tc,s=>Promise.resolve(s.prepareSession(y.revive(n),o,i)),void 0,i)}$provideCallHierarchyIncomingCalls(t,n,o,i){return this._withAdapter(t,tc,s=>s.provideCallsTo(n,o,i),void 0,i)}$provideCallHierarchyOutgoingCalls(t,n,o,i){return this._withAdapter(t,tc,s=>s.provideCallsFrom(n,o,i),void 0,i)}$releaseCallHierarchy(t,n){this._withAdapter(t,tc,o=>Promise.resolve(o.releaseSession(n)),void 0,void 0)}registerTypeHierarchyProvider(t,n,o){let i=this._addNewAdapter(new nc(this._documents,o),t);return this._proxy.$registerTypeHierarchyProvider(i,this._transformDocumentSelector(n,t)),this._createDisposable(i)}$prepareTypeHierarchy(t,n,o,i){return this._withAdapter(t,nc,s=>Promise.resolve(s.prepareSession(y.revive(n),o,i)),void 0,i)}$provideTypeHierarchySupertypes(t,n,o,i){return this._withAdapter(t,nc,s=>s.provideSupertypes(n,o,i),void 0,i)}$provideTypeHierarchySubtypes(t,n,o,i){return this._withAdapter(t,nc,s=>s.provideSubtypes(n,o,i),void 0,i)}$releaseTypeHierarchy(t,n){this._withAdapter(t,nc,o=>Promise.resolve(o.releaseSession(n)),void 0,void 0)}registerDocumentOnDropEditProvider(t,n,o,i){let s=this._nextHandle();return this._adapter.set(s,new oc(new am(this._proxy,this._documents,o,s,t),t)),this._proxy.$registerDocumentOnDropEditProvider(s,this._transformDocumentSelector(n,t),i?{supportsResolve:!!o.resolveDocumentDropEdit,dropMimeTypes:i.dropMimeTypes,providedDropKinds:i.providedDropEditKinds?.map(a=>a.value)}:void 0),this._createDisposable(s)}$provideDocumentOnDropEdits(t,n,o,i,s,a){return this._withAdapter(t,am,l=>Promise.resolve(l.provideDocumentOnDropEdits(n,y.revive(o),i,s,a)),void 0,void 0)}$resolveDropEdit(t,n,o){return this._withAdapter(t,am,i=>i.resolveDropEdit(n,o),{},void 0)}$releaseDocumentOnDropEdits(t,n){this._withAdapter(t,am,o=>Promise.resolve(o.releaseDropEdits(n)),void 0,void 0)}registerDocumentPasteEditProvider(t,n,o,i){let s=this._nextHandle();return this._adapter.set(s,new oc(new Zd(this._proxy,this._documents,o,s,t),t)),this._proxy.$registerPasteEditProvider(s,this._transformDocumentSelector(n,t),{supportsCopy:!!o.prepareDocumentPaste,supportsPaste:!!o.provideDocumentPasteEdits,supportsResolve:!!o.resolveDocumentPasteEdit,providedPasteEditKinds:i.providedPasteEditKinds?.map(a=>a.value),copyMimeTypes:i.copyMimeTypes,pasteMimeTypes:i.pasteMimeTypes}),this._createDisposable(s)}$prepareDocumentPaste(t,n,o,i,s){return this._withAdapter(t,Zd,a=>a.prepareDocumentPaste(y.revive(n),o,i,s),void 0,s)}$providePasteEdits(t,n,o,i,s,a,l){return this._withAdapter(t,Zd,d=>d.providePasteEdits(n,y.revive(o),i,s,a,l),void 0,l)}$resolvePasteEdit(t,n,o){return this._withAdapter(t,Zd,i=>i.resolvePasteEdit(n,o),{},void 0)}$releasePasteEdits(t,n){this._withAdapter(t,Zd,o=>Promise.resolve(o.releasePasteEdits(n)),void 0,void 0)}static _serializeRegExp(t){return{pattern:t.source,flags:t.flags}}static _serializeIndentationRule(t){return{decreaseIndentPattern:r._serializeRegExp(t.decreaseIndentPattern),increaseIndentPattern:r._serializeRegExp(t.increaseIndentPattern),indentNextLinePattern:t.indentNextLinePattern?r._serializeRegExp(t.indentNextLinePattern):void 0,unIndentedLinePattern:t.unIndentedLinePattern?r._serializeRegExp(t.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(t){return{beforeText:r._serializeRegExp(t.beforeText),afterText:t.afterText?r._serializeRegExp(t.afterText):void 0,previousLineText:t.previousLineText?r._serializeRegExp(t.previousLineText):void 0,action:t.action}}static _serializeOnEnterRules(t){return t.map(r._serializeOnEnterRule)}static _serializeAutoClosingPair(t){return{open:t.open,close:t.close,notIn:t.notIn?t.notIn.map(n=>Dd.toString(n)):void 0}}static _serializeAutoClosingPairs(t){return t.map(r._serializeAutoClosingPair)}setLanguageConfiguration(t,n,o){let{wordPattern:i}=o;if(i&&jh(i))throw new Error(`Invalid language configuration: wordPattern '${i}' is not allowed to match the empty string.`);i?this._documents.setWordDefinitionFor(n,i):this._documents.setWordDefinitionFor(n,void 0),o.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",t,"Do not use."),o.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",t,"Do not use.");let s=this._nextHandle(),a={comments:o.comments,brackets:o.brackets,wordPattern:o.wordPattern?r._serializeRegExp(o.wordPattern):void 0,indentationRules:o.indentationRules?r._serializeIndentationRule(o.indentationRules):void 0,onEnterRules:o.onEnterRules?r._serializeOnEnterRules(o.onEnterRules):void 0,__electricCharacterSupport:o.__electricCharacterSupport,__characterPairSupport:o.__characterPairSupport,autoClosingPairs:o.autoClosingPairs?r._serializeAutoClosingPairs(o.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(s,n,a),this._createDisposable(s)}$setWordDefinitions(t){for(let n of t)this._documents.setWordDefinitionFor(n.languageId,new RegExp(n.regexSource,n.regexFlags))}};var aU=M("notebookService");var lU=M("codeMapperService");var kR="vscode_editFile",GS="vscode_editFile_internal",dU={id:GS,displayName:"",modelDescription:"",source:Eo.Internal},lm=class{constructor(e,t,n){this.chatService=e;this.codeMapperService=t;this.notebookService=n}async invoke(e,t,n,o){if(!e.context)throw new Error("toolInvocationToken is required for this tool");let i=e.parameters,s=y.revive(i.uri),a=Ok.parse(s)?.notebook||s,l=this.chatService.getSession(e.context.sessionResource),d=l.getRequests().at(-1);l.acceptResponseProgress(d,{kind:"markdownContent",content:new fo("\n````\n")}),l.acceptResponseProgress(d,{kind:"codeblockUri",uri:a,isEdit:!0}),l.acceptResponseProgress(d,{kind:"markdownContent",content:new fo("\n````\n")}),this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(d,{kind:"notebookEdit",edits:[],uri:a}):l.acceptResponseProgress(d,{kind:"textEdit",edits:[],uri:a});let c=l.editingSession;if(!c)throw new Error("This tool must be called from within an editing session");let u=await this.codeMapperService.mapCode({codeBlocks:[{code:i.code,resource:a,markdownBeforeBlock:i.explanation}],location:"tool",chatRequestId:e.chatRequestId,chatRequestModel:e.modelId,chatSessionResource:e.context.sessionResource},{textEdit:(g,v)=>{l.acceptResponseProgress(d,{kind:"textEdit",uri:g,edits:v})},notebookEdit(g,v){l.acceptResponseProgress(d,{kind:"notebookEdit",uri:g,edits:v})}},o);if(this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(d,{kind:"notebookEdit",uri:a,edits:[],done:!0}):l.acceptResponseProgress(d,{kind:"textEdit",uri:a,edits:[],done:!0}),u?.errorMessage)throw new Error(u.errorMessage);let m;return await new Promise(g=>{let v=!1;m=gi(h=>{let S=c.entries.read(h)?.find(T=>T.modifiedURI.toString()===a.toString());S&&(S.isCurrentlyBeingModifiedBy.read(h)?v=!0:v&&g(!0))})}).finally(()=>{m.dispose()}),{content:[{kind:"text",value:"The file was edited successfully"}]}}async prepareToolInvocation(e,t){return{presentation:"hidden"}}};lm=D([C(0,nS),C(1,lU),C(2,aU)],lm);var e7="vscode_get_confirmation",t7="vscode_get_confirmation_with_options",cU={id:e7,displayName:"Confirmation Tool",modelDescription:"A tool that demonstrates different types of confirmations. Takes a title, message, and confirmation type (basic or terminal).",source:Eo.Internal,inputSchema:{type:"object",properties:{title:{type:"string",description:"Title for the confirmation dialog"},message:{type:"string",description:"Message to show in the confirmation dialog"},confirmationType:{type:"string",enum:["basic","terminal"],description:"Type of confirmation to show - basic for simple confirmation, terminal for terminal command confirmation"},terminalCommand:{type:"string",description:'Terminal command to show (only used when confirmationType is "terminal")'}},required:["title","message","confirmationType"],additionalProperties:!1}},uU={id:t7,displayName:"Confirmation Tool with Options",modelDescription:"A tool that demonstrates different types of confirmations. Takes a title, message, and buttons.",source:Eo.Internal,inputSchema:{type:"object",properties:{title:{type:"string",description:"Title for the confirmation dialog"},message:{type:"string",description:"Message to show in the confirmation dialog"},buttons:{type:"array",items:{type:"string"},description:"Custom button labels to display."}},required:["title","message","buttons"],additionalProperties:!1}},jS=class{async prepareToolInvocation(e,t){let n=e.parameters;if(!n.title||!n.message)throw new Error("Missing required parameters for ConfirmationTool");let o=n.confirmationType??"basic",i;return o==="terminal"?i={kind:"terminal",commandLine:{original:n.terminalCommand??""},language:"bash"}:i=void 0,{confirmationMessages:{title:n.title,message:new fo(n.message),allowAutoConfirm:!(n.buttons||[]).length,customButtons:n.buttons},toolSpecificData:i,presentation:"hiddenAfterComplete"}}async invoke(e,t,n,o){return e.selectedCustomButton?{content:[{kind:"text",value:e.selectedCustomButton}]}:{content:[{kind:"text",value:"yes"}]}}};var QS=class r{constructor(e,t){this.storageService=t;this.id=r.COMMON_PREFIX+e}static{this.applicationMementos=new Map}static{this.profileMementos=new Map}static{this.workspaceMementos=new Map}static{this.COMMON_PREFIX="memento/"}getMemento(e,t){switch(e){case 1:{let n=r.workspaceMementos.get(this.id);return n||(n=new lh(this.id,e,t,this.storageService),r.workspaceMementos.set(this.id,n)),n.getMemento()}case 0:{let n=r.profileMementos.get(this.id);return n||(n=new lh(this.id,e,t,this.storageService),r.profileMementos.set(this.id,n)),n.getMemento()}case-1:{let n=r.applicationMementos.get(this.id);return n||(n=new lh(this.id,e,t,this.storageService),r.applicationMementos.set(this.id,n)),n.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){r.workspaceMementos.get(this.id)?.save(),r.profileMementos.get(this.id)?.save(),r.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case-1:t=r.applicationMementos.get(this.id);break;case 0:t=r.profileMementos.get(this.id);break;case 1:t=r.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case 1:r.workspaceMementos.clear();break;case 0:r.profileMementos.clear();break;case-1:r.applicationMementos.clear();break}}},lh=class{constructor(e,t,n,o){this.id=e;this.scope=t;this.target=n;this.storageService=o;this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){ct(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(let e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){yc(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}};var pU=M("chatTodoListService"),dh=class{constructor(e){this.memento=new QS("chat-todo-list",e)}getSessionData(e){return this.memento.getMemento(1,1)[this.toKey(e)]||[]}setSessionData(e,t){let n=this.memento.getMemento(1,1);n[this.toKey(e)]=t,this.memento.saveMemento()}getTodoList(e){return this.getSessionData(e)}setTodoList(e,t){this.setSessionData(e,t)}migrateTodoList(e,t){let n=this.getSessionData(e);if(n.length>0){this.setSessionData(t,n);let o=this.memento.getMemento(1,1);delete o[this.toKey(e)],this.memento.saveMemento()}}toKey(e){return IA(e)}};dh=D([C(0,ds)],dh);var JS=class extends H{constructor(t){super();this._onDidUpdateTodos=this._register(new E);this.onDidUpdateTodos=this._onDidUpdateTodos.event;this.todoListStorage=new dh(t)}getTodos(t){return this.todoListStorage.getTodoList(t)}setTodos(t,n){this.todoListStorage.setTodoList(t,n),this._onDidUpdateTodos.fire(t)}migrateTodos(t,n){this.todoListStorage.migrateTodoList(t,n),this._onDidUpdateTodos.fire(n)}};JS=D([C(0,ds)],JS);var _R="manage_todo_list";function PR(){let r={type:"object",properties:{todoList:{type:"array",description:"Complete array of all todo items. Must include ALL items - both existing and new.",items:{type:"object",properties:{id:{type:"number",description:"Unique identifier for the todo. Use sequential numbers starting from 1."},title:{type:"string",description:"Concise action-oriented todo label (3-7 words). Displayed in UI."},status:{type:"string",enum:["not-started","in-progress","completed"],description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"}},required:["id","title","status"]}}},required:["todoList"]};return{id:_R,toolReferenceName:"todo",legacyToolReferenceFullNames:["todos"],canBeReferencedInPrompt:!0,icon:vt.fromId(le.checklist.id),displayName:p(7930,null),userDescription:p(7931,null),modelDescription:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning.

When to use this tool:
- Complex multi-step work requiring planning and tracking
- When user provides multiple tasks or requests (numbered/comma-separated)
- After receiving new instructions that require multiple steps
- BEFORE starting work on any todo (mark as in-progress)
- IMMEDIATELY after completing each todo (mark completed individually)
- When breaking down larger tasks into smaller actionable steps
- To give users visibility into your progress and planning

When NOT to use:
- Single, trivial tasks that can be completed in one step
- Purely conversational/informational requests
- When just reading files or performing simple searches

CRITICAL workflow:
1. Plan tasks by writing todo list with specific, actionable items
2. Mark ONE todo as in-progress before starting work
3. Complete the work for that specific todo
4. Mark that todo as completed IMMEDIATELY
5. Move to next todo and repeat

Todo states:
- not-started: Todo not yet begun
- in-progress: Currently working (limit ONE at a time)
- completed: Finished successfully

IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`,source:Eo.Internal,inputSchema:r}}var IBe=PR(),dm=class extends H{constructor(t,n,o){super();this.chatTodoListService=t;this.logService=n;this.telemetryService=o}async invoke(t,n,o,i){let s=t.parameters,a=t.context?.sessionResource;if(!a&&s.operation==="read"&&s.chatSessionResource)try{a=y.parse(s.chatSessionResource)}catch(l){this.logService.error("ManageTodoListTool: Invalid chatSessionResource URI",l)}if(!a)return{content:[{kind:"text",value:"Error: No session resource available"}]};this.logService.debug(`ManageTodoListTool: Invoking with options ${JSON.stringify(s)}`);try{return s.operation==="read"?this.handleReadOperation(a):this.handleWriteOperation(s,a)}catch(l){return{content:[{kind:"text",value:`Error: ${l instanceof Error?l.message:"Unknown error"}`}]}}}async prepareToolInvocation(t,n){let o=t.parameters,i=t.chatSessionResource;if(!i)return;let s=this.chatTodoListService.getTodos(i),a;o.operation==="read"?a=p(7926,null):o.todoList&&(a=this.generatePastTenseMessage(s,o.todoList));let d=(o.todoList??s).map(c=>({id:c.id.toString(),title:c.title,status:c.status}));return{pastTenseMessage:new fo(a??p(7929,null)),toolSpecificData:{kind:"todoList",todoList:d}}}generatePastTenseMessage(t,n){if(t.length===0)return n.length===1?p(7925,null):p(7924,null,n.length);let o=new Map(t.map(l=>[l.id,l])),i=n.filter(l=>{let d=o.get(l.id);return d&&d.status!=="in-progress"&&l.status==="in-progress"});if(i.length>0){let l=i[0],d=n.length,c=n.findIndex(u=>u.id===l.id)+1;return p(7927,null,l.title,c,d)}let s=n.filter(l=>{let d=o.get(l.id);return d&&d.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],d=n.length,c=n.findIndex(u=>u.id===l.id)+1;return p(7923,null,l.title,c,d)}let a=n.filter(l=>!o.has(l.id));return a.length>0?a.length===1?p(7922,null):p(7921,null,a.length):p(7928,null)}handleRead(t,n){return t.length===0?"No todo list found.":`# Todo List

${this.formatTodoListAsMarkdownTaskList(t)}`}handleReadOperation(t){let n=this.chatTodoListService.getTodos(t),o=this.handleRead(n,t),i=this.calculateStatusCounts(n);return this.telemetryService.publicLog2("todoListToolInvoked",{operation:"read",notStartedCount:i.notStartedCount,inProgressCount:i.inProgressCount,completedCount:i.completedCount}),{content:[{kind:"text",value:o}]}}handleWriteOperation(t,n){if(!t.todoList)return{content:[{kind:"text",value:"Error: todoList is required for write operation"}]};let o=t.todoList.map(d=>({id:d.id,title:d.title,status:d.status})),i=this.chatTodoListService.getTodos(n),s=this.calculateTodoChanges(i,o);this.chatTodoListService.setTodos(n,o);let a=this.calculateStatusCounts(o),l=[];return o.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):o.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one."),this.telemetryService.publicLog2("todoListToolInvoked",{operation:"write",notStartedCount:a.notStartedCount,inProgressCount:a.inProgressCount,completedCount:a.completedCount}),{content:[{kind:"text",value:`Successfully wrote todo list${l.length?`

`+l.join(`
`):""}`}],toolMetadata:{warnings:l}}}calculateStatusCounts(t){let n=t.filter(s=>s.status==="not-started").length,o=t.filter(s=>s.status==="in-progress").length,i=t.filter(s=>s.status==="completed").length;return{notStartedCount:n,inProgressCount:o,completedCount:i}}formatTodoListAsMarkdownTaskList(t){return t.length===0?"":t.map(n=>{let o;switch(n.status){case"completed":o="[x]";break;case"in-progress":o="[-]";break;default:o="[ ]";break}return[`- ${o} ${n.title}`].join(`
`)}).join(`
`)}calculateTodoChanges(t,n){let o=0,i=Math.min(t.length,n.length);for(let d=0;d<i;d++){let c=t[d],u=n[d];(c.title!==u.title||c.status!==u.status)&&o++}let s=Math.max(0,n.length-t.length),a=Math.max(0,t.length-n.length);return s+a+o}};dm=D([C(0,pU),C(1,ue),C(2,Ia)],dm);var gU=M("chatAgentService"),XS=class extends H{constructor(t,n){super();this.contextKeyService=t;this.configurationService=n;this._agents=new Map;this._onDidChangeAgents=this._register(new E);this.onDidChangeAgents=this._onDidChangeAgents.event;this._agentsContextKeys=new Set;this._hasToolsAgent=!1;this._chatParticipantDetectionProviders=new Map;this._agentCompletionProviders=new Map;this._hasDefaultAgent=Fr.enabled.bindTo(this.contextKeyService),this._extensionAgentRegistered=Fr.extensionParticipantRegistered.bindTo(this.contextKeyService),this._defaultAgentRegistered=Fr.panelParticipantRegistered.bindTo(this.contextKeyService),this._register(t.onDidChangeContext(o=>{o.affectsSome(this._agentsContextKeys)&&this._updateContextKeys()}))}static{this.AGENT_LEADER="@"}registerAgent(t,n){if(this.getAgent(t))throw new Error(`Agent already registered: ${JSON.stringify(t)}`);let i=this,s=n.slashCommands;n={...n,get slashCommands(){return s.filter(l=>!l.when||i.contextKeyService.contextMatchesRules(Tt.deserialize(l.when)))}};let a={data:n};return this._agents.set(t,a),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0),J(()=>{this._agents.delete(t),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0)})}_updateAgentsContextKeys(){this._agentsContextKeys.clear();for(let t of this._agents.values())if(t.data.when){let n=Tt.deserialize(t.data.when);for(let o of n?.keys()||[])this._agentsContextKeys.add(o)}}_updateContextKeys(){let t=!1,n=!1,o=!1;for(let i of this.getAgents())i.isDefault&&(i.isCore||(t=!0),i.id==="chat.setup"||i.id==="github.copilot.editsAgent"?o=!0:n=!0);this._defaultAgentRegistered.set(n),this._extensionAgentRegistered.set(t),o!==this._hasToolsAgent&&(this._hasToolsAgent=o,this._onDidChangeAgents.fire(this.getDefaultAgent("panel","agent")))}registerAgentImplementation(t,n){let o=this._agents.get(t);if(!o)throw new Error(`Unknown agent: ${JSON.stringify(t)}`);if(o.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(t)}`);return o.data.isDefault&&this._hasDefaultAgent.set(!0),o.impl=n,this._onDidChangeAgents.fire(new cm(o.data,n)),J(()=>{o.impl=void 0,this._onDidChangeAgents.fire(void 0),o.data.isDefault&&this._hasDefaultAgent.set(It.some(this._agents.values(),i=>i.data.isDefault&&!!i.impl))})}registerDynamicAgent(t,n){t.isDynamic=!0;let o={data:t,impl:n};return this._agents.set(t.id,o),this._onDidChangeAgents.fire(new cm(t,n)),J(()=>{this._agents.delete(t.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(t,n){return this._agentCompletionProviders.set(t,n),{dispose:()=>{this._agentCompletionProviders.delete(t)}}}async getAgentCompletionItems(t,n,o){return await this._agentCompletionProviders.get(t)?.(n,o)??[]}updateAgent(t,n){let o=this._agents.get(t);if(!o?.impl)throw new Error(`No activated agent with id ${JSON.stringify(t)} registered`);o.data.metadata={...o.data.metadata,...n},this._onDidChangeAgents.fire(new cm(o.data,o.impl))}getDefaultAgent(t,n="ask"){return this._preferExtensionAgent(this.getActivatedAgents().filter(o=>n&&!o.modes.includes(n)?!1:!!o.isDefault&&o.locations.includes(t)))}get hasToolsAgent(){return!!this.configurationService.getValue("chat.agent.enabled")}getContributedDefaultAgent(t){return this._preferExtensionAgent(this.getAgents().filter(n=>!!n.isDefault&&n.locations.includes(t)))}_preferExtensionAgent(t){return E1(t,n=>!n.isCore)??t.at(-1)}getAgent(t,n=!1){if(!(!this._agentIsEnabled(t)&&!n))return this._agents.get(t)?.data}_agentIsEnabled(t){let n=typeof t=="string"?this._agents.get(t):t;return!n?.data.when||this.contextKeyService.contextMatchesRules(Tt.deserialize(n.data.when))}getAgentByFullyQualifiedId(t){let n=It.find(this._agents.values(),o=>n7(o.data)===t)?.data;if(!(n&&!this._agentIsEnabled(n.id)))return n}getAgents(){return Array.from(this._agents.values()).map(t=>t.data).filter(t=>this._agentIsEnabled(t.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(t=>!!t.impl).filter(t=>this._agentIsEnabled(t.data.id)).map(t=>new cm(t.data,t.impl))}getAgentsByName(t){return this._preferExtensionAgents(this.getAgents().filter(n=>n.name===t))}_preferExtensionAgents(t){let n=t.filter(o=>!o.isCore);return n.length>0?n:t}agentHasDupeName(t){let n=this.getAgent(t);return n?this.getAgentsByName(n.name).filter(o=>o.extensionId.value!==n.extensionId.value).length>0:!1}async invokeAgent(t,n,o,i,s){let a=this._agents.get(t);if(!a?.impl)throw new Error(`No activated agent with id "${t}"`);return await a.impl.invoke(n,o,i,s)}setRequestTools(t,n,o){let i=this._agents.get(t);if(!i?.impl)throw new Error(`No activated agent with id "${t}"`);i.impl.setRequestTools?.(n,o)}setYieldRequested(t,n){let o=this._agents.get(t);o?.impl&&o.impl.setYieldRequested?.(n)}async getFollowups(t,n,o,i,s){let a=this._agents.get(t);return a?.impl?.provideFollowups?a.impl.provideFollowups(n,o,i,s):[]}async getChatTitle(t,n,o){let i=this._agents.get(t);if(i?.impl?.provideChatTitle)return i.impl.provideChatTitle(n,o)}async getChatSummary(t,n,o){let i=this._agents.get(t);if(i?.impl?.provideChatSummary)return i.impl.provideChatSummary(n,o)}registerChatParticipantDetectionProvider(t,n){return this._chatParticipantDetectionProviders.set(t,n),J(()=>{this._chatParticipantDetectionProviders.delete(t)})}hasChatParticipantDetectionProviders(){return this._chatParticipantDetectionProviders.size>0}async detectAgentOrCommand(t,n,o,i){let s=It.first(this._chatParticipantDetectionProviders.values());if(!s)return;let a=this.getAgents().reduce((u,m)=>{if(m.locations.includes(o.location)){u.push({participant:m.id,disambiguation:m.disambiguation??[]});for(let g of m.slashCommands)u.push({participant:m.id,command:g.name,disambiguation:g.disambiguation??[]})}return u},[]),l=await s.provideParticipantDetection(t,n,{...o,participants:a},i);if(!l)return;let d=this.getAgent(l.participant);if(!d)return;if(!l.command)return{agent:d};let c=d?.slashCommands.find(u=>u.name===l.command);if(c)return{agent:d,command:c}}};XS=D([C(0,sr),C(1,oo)],XS);var cm=class{constructor(e,t){this.data=e;this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionVersion(){return this.data.extensionVersion}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get isCore(){return this.data.isCore}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get locations(){return this.data.locations}get modes(){return this.data.modes}get disambiguation(){return this.data.disambiguation}async invoke(e,t,n,o){return this.impl.invoke(e,t,n,o)}setRequestTools(e,t){this.impl.setRequestTools?.(e,t)}setYieldRequested(e){this.impl.setYieldRequested?.(e)}async provideFollowups(e,t,n,o){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,n,o):[]}toJSON(){return this.data}},VBe=M("chatAgentNameService"),YS=class{constructor(e){this.languageModelsService=e}getAgentNameRestriction(e){if(e.isCore)return!0;let t=this.checkAgentNameRestriction(e.name,e).get(),n=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&n}checkAgentNameRestriction(e,t){return this.languageModelsService.restrictedChatParticipants.map(o=>o[e.toLowerCase()]).map(o=>o?o.some(i=>Nn(i,i.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}};YS=D([C(0,Lb)],YS);function n7(r){return`${r.extensionId.value}.${r.id}`}var fU=M("labelService");var ZS=M("IPromptsService");var{basename:r7,dirname:hU}=Le,i7=".prompt.md",s7=".instructions.md",a7=".chatmode.md",l7=".agent.md",d7="SKILL.md";var c7="copilot-instructions.md",u7=".github/prompts",p7=".github/instructions";var vU=".github/agents",RR=".claude/agents",bU=".devseccode/agents",DR=".claude/rules";var m7=[{path:".github/skills",source:"github-workspace",storage:"local"},{path:".agents/skills",source:"agents-workspace",storage:"local"},{path:".claude/skills",source:"claude-workspace",storage:"local"},{path:"~/.copilot/skills",source:"copilot-personal",storage:"user"},{path:"~/.agents/skills",source:"agents-personal",storage:"user"},{path:"~/.claude/skills",source:"claude-personal",storage:"user"}],g7=[{path:p7,source:"github-workspace",storage:"local"},{path:DR,source:"claude-workspace",storage:"local"},{path:"~/"+DR,source:"claude-personal",storage:"user"}],f7=[{path:u7,source:"github-workspace",storage:"local"}],h7=[{path:vU,source:"github-workspace",storage:"local"},{path:RR,source:"claude-workspace",storage:"local"},{path:bU,source:"agents-workspace",storage:"local"}],v7=[{path:".github/hooks",source:"github-workspace",storage:"local"},{path:".claude/settings.local.json",source:"claude-workspace-local",storage:"local"},{path:".claude/settings.json",source:"claude-workspace",storage:"local"},{path:"~/.claude/settings.json",source:"claude-personal",storage:"user"}];function b7(r){let e=hU(r.path);return e.endsWith("/"+vU)||e.endsWith("/"+RR)||e.endsWith("/"+bU)}function yU(r){return hU(r.path).endsWith("/"+RR)}function MR(r){return r.path.includes("/"+DR+"/")}function y7(r){let e=r7(r.path);if(e.endsWith(i7))return"prompt";if(e.endsWith(s7)||e===c7)return"instructions";if(e.endsWith(a7)||e.endsWith(l7))return"agent";if(e.toLowerCase()===d7.toLowerCase())return"skill";if(e.endsWith(".md")&&e!=="README.md"&&b7(r))return"agent";if(e.endsWith(".md")&&e!=="README.md"&&MR(r))return"instructions";if(e.toLowerCase().endsWith(".json"))return"hook"}function AR(r){return y7(r)!==void 0}function IU(r){switch(r){case"instructions":return g7;case"prompt":return f7;case"agent":return h7;case"skill":return m7;case"hook":return v7;default:throw new Error("Unknown prompt type")}}var ti;(L=>{L.PROMPT_LOCATIONS_KEY="chat.promptFilesLocations",L.INSTRUCTIONS_LOCATION_KEY="chat.instructionsFilesLocations",L.MODE_LOCATION_KEY="chat.modeFilesLocations",L.AGENTS_LOCATION_KEY="chat.agentFilesLocations",L.SKILLS_LOCATION_KEY="chat.agentSkillsLocations",L.HOOKS_LOCATION_KEY="chat.hookFilesLocations",L.PROMPT_FILES_SUGGEST_KEY="chat.promptFilesRecommendations",L.USE_COPILOT_INSTRUCTION_FILES="github.copilot.chat.codeGeneration.useInstructionFiles",L.USE_AGENT_MD="chat.useAgentsMdFile",L.USE_NESTED_AGENT_MD="chat.useNestedAgentsMdFiles",L.USE_CLAUDE_MD="chat.useClaudeMdFile",L.USE_AGENT_SKILLS="chat.useAgentSkills",L.USE_CHAT_HOOKS="chat.useHooks",L.USE_CLAUDE_HOOKS="chat.useClaudeHooks",L.USE_SKILL_ADHERENCE_PROMPT="chat.experimental.useSkillAdherencePrompt",L.INCLUDE_APPLYING_INSTRUCTIONS="chat.includeApplyingInstructions",L.INCLUDE_REFERENCED_INSTRUCTIONS="chat.includeReferencedInstructions";function S(Y,G){let z=I7(G),K=Y.getValue(z);if(!(K==null||Array.isArray(K))&&typeof K=="object"){let Q={};for(let[X,B]of Object.entries(K)){let He=X.trim(),Ge=xU(B);Ge!==void 0&&He&&(Q[He]=Ge)}return Q}}L.getLocationsValue=S;function T(Y,G){let z=S(Y,G),K=IU(G);if(z&&typeof z=="object"){let Q=[],X=new Set(K.map(B=>B.path));for(let B of K)z[B.path]!==!1&&Q.push(B);for(let[B,He]of Object.entries(z)){if(He===!1||X.has(B))continue;let Ge=x7(B)?"user":"local";Q.push({path:B,source:Ge==="local"?"config-personal":"config-workspace",storage:Ge})}return Q}return[]}L.promptSourceFolders=T;function P(Y,G){let z=Y.getValue(L.PROMPT_FILES_SUGGEST_KEY,{resource:G});if(!z||typeof z!="object"||Array.isArray(z))return;let K={};for(let[Q,X]of Object.entries(z)){let B=Q.trim();if(!B)continue;if(typeof X=="boolean"){K[B]=X;continue}if(typeof X=="string"){let Ge=X.trim();Ge&&(K[B]=Ge);continue}let He=xU(X);He!==void 0&&(K[B]=He)}return Object.keys(K).length>0?K:void 0}L.getPromptFilesRecommendationsValue=P})(ti||={});function I7(r){switch(r){case"instructions":return ti.INSTRUCTIONS_LOCATION_KEY;case"prompt":return ti.PROMPT_LOCATIONS_KEY;case"agent":return ti.AGENTS_LOCATION_KEY;case"skill":return ti.SKILLS_LOCATION_KEY;case"hook":return ti.HOOKS_LOCATION_KEY;default:throw new Error("Unknown prompt type")}}function xU(r){if(typeof r=="boolean")return r;if(typeof r=="string"){let e=r.trim().toLowerCase();return e==="true"?!0:e==="false"?!1:void 0}}function x7(r){return r.startsWith("~/")}var eC=class r{constructor(e,t){this.start=e;this.endExclusive=t;if(e>t)throw new St(`Invalid range: ${this.toString()}`)}static fromTo(e,t){return new r(e,t)}static equals(e,t){return e.start===t.start&&e.endExclusive===t.endExclusive}static addRange(e,t){let n=0;for(;n<t.length&&t[n].endExclusive<e.start;)n++;let o=n;for(;o<t.length&&t[o].start<=e.endExclusive;)o++;if(n===o)t.splice(n,0,e);else{let i=Math.min(e.start,t[n].start),s=Math.max(e.endExclusive,t[o-1].endExclusive);t.splice(n,o-n,new r(i,s))}}static tryCreate(e,t){if(!(e>t))return new r(e,t)}static ofLength(e){return new r(0,e)}static ofStartAndLength(e,t){return new r(e,e+t)}static emptyAt(e){return new r(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new r(this.start+e,this.endExclusive+e)}deltaStart(e){return new r(this.start+e,this.endExclusive)}deltaEnd(e){return new r(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}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new r(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);if(t<=n)return new r(t,n)}intersectionLength(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)}intersects(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return t<n}intersectsOrTouches(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return t<=n}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=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 St(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new St(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let t=[];for(let n=this.start;n<this.endExclusive;n++)t.push(e(n));return t}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new St(`Invalid join: ${this.toString()} and ${e.toString()}`);return new r(this.start,e.endExclusive)}withMargin(e,t){return t===void 0&&(t=e),new r(this.start-e,this.endExclusive+t)}};function S7(){return{applyingInstructionsCount:0,referencedInstructionsCount:0,agentInstructionsCount:0,listedInstructionsCount:0,totalInstructionsCount:0,claudeRulesCount:0,claudeMdCount:0,claudeAgentsCount:0}}var um=class{constructor(e,t,n,o,i,s,a,l,d,c,u){this._modeKind=e;this._enabledTools=t;this._enabledSubagents=n;this._promptsService=o;this._logService=i;this._labelService=s;this._configurationService=a;this._workspaceService=l;this._fileService=d;this._telemetryService=c;this._languageModelToolsService=u;this._parseResults=new qe}async _parseInstructionsFile(e,t){if(this._parseResults.has(e))return this._parseResults.get(e);try{let n=await this._promptsService.parseNew(e,t);return this._parseResults.set(e,n),n}catch(n){this._logService.error(`[InstructionsContextComputer] Failed to parse instruction file: ${e}`,n);return}}async collect(e,t){let n=await this._promptsService.listPromptFiles("instructions",t);this._logService.trace(`[InstructionsContextComputer] ${n.length} instruction files available.`);let o=S7(),i=this._getContext(e);await this.addApplyingInstructions(n,i,e,o,t),await this._addReferencedInstructions(e,o,t),await this._addAgentInstructions(e,o,t);let s=await this._getInstructionsWithPatternsList(n,e,o,t);s&&(e.add(s),o.listedInstructionsCount++),this.sendTelemetry(o)}sendTelemetry(e){e.totalInstructionsCount=e.agentInstructionsCount+e.referencedInstructionsCount+e.applyingInstructionsCount+e.listedInstructionsCount,this._telemetryService.publicLog2("instructionsCollected",e)}async addApplyingInstructions(e,t,n,o,i){if(!this._configurationService.getValue(ti.INCLUDE_APPLYING_INSTRUCTIONS)&&this._modeKind!=="edit"){this._logService.trace("[InstructionsContextComputer] includeApplyingInstructions is disabled and agent kind is not Edit. No applying instructions will be added.");return}for(let{uri:a}of e){let l=await this._parseInstructionsFile(a,i);if(!l){this._logService.trace(`[InstructionsContextComputer] Unable to read: ${a}`);continue}let d=l.header?.applyTo,c=l.header?.paths,u=MR(a),m=u?c?.join(", ")??"**":d;if(!m){this._logService.trace(`[InstructionsContextComputer] No 'applyTo' found: ${a}`);continue}if(t.instructions.has(a)){this._logService.trace(`[InstructionsContextComputer] Skipping already processed instruction file: ${a}`);continue}let g=this._matches(t.files,m);if(g){this._logService.trace(`[InstructionsContextComputer] Match for ${a} with ${g.pattern}${g.file?` for file ${g.file}`:""}`);let v=g.file?p(7704,null,m,this._labelService.getUriLabel(g.file,{relative:!0})):p(7702,null);n.add(tb(a,"vscode.prompt.instructions.root",v,!0)),o.applyingInstructionsCount++,u&&o.claudeRulesCount++}else this._logService.trace(`[InstructionsContextComputer] No match for ${a} with ${m}`)}}_getContext(e){let t=new Yo,n=new Yo;for(let o of e.asArray())if(Tg(o))n.add(o.value);else{let i=Vw.toUri(o);i&&t.add(i)}return{files:t,instructions:n}}async _addAgentInstructions(e,t,n){let o={logInfo:l=>this._logService.trace(`[InstructionsContextComputer] ${l}`)},i=await this._promptsService.listAgentInstructions(n,o),s=new Yl,a=new Yl;for(let{uri:l,type:d}of i){let c=tb(l,"vscode.prompt.instructions.root",void 0,!0);s.add(c),d==="copilotInstructionsMd"&&a.add(c),t.agentInstructionsCount++,d==="claudeMd"&&t.claudeMdCount++,o.logInfo(`Agent instruction file added: ${l.toString()}`)}if(a.length>0){await this._addReferencedInstructions(a,t,n);for(let l of a.asArray())e.add(l)}for(let l of s.asArray())e.add(l)}_getApplyToPattern(e,t){if(e)return e;if(t&&t.length>0)return t.join(", ")}_matches(e,t){let n=ou(t,","),o=i=>{if(i=i.trim(),i.length!==0){if(i==="**"||i==="**/*"||i==="*")return{pattern:i};!i.startsWith("/")&&!i.startsWith("**/")&&(i="**/"+i);for(let s of e)if(Vr(i,s.path,{ignoreCase:!0}))return{pattern:i,file:s}}};for(let i of n){let s=o(i);if(s)return s}}_getTool(e){if(!this._enabledTools)return;let t=this._languageModelToolsService.getToolByName(e);if(t&&this._enabledTools[t.id])return{tool:t,variable:`#tool:${this._languageModelToolsService.getFullReferenceName(t)}`}}async _getInstructionsWithPatternsList(e,t,n,o){let i=this._getTool("readFile"),s=this._getTool(Rg.runSubagent),a=[];if(i){let m=this._configurationService.getValue(ti.USE_NESTED_AGENT_MD)?this._promptsService.listNestedAgentMDs(o):Promise.resolve([]);a.push("<instructions>"),a.push("Here is a list of instruction files that contain rules for working with this codebase."),a.push("These files are important for understanding the codebase structure, conventions, and best practices."),a.push("Please make sure to follow the rules specified in these files when working with the codebase."),a.push(`If the file is not already available as attachment, use the ${i.variable} tool to acquire it.`),a.push("Make sure to acquire the instructions before working with the codebase.");let g=!1;for(let{uri:S}of e){let T=await this._parseInstructionsFile(S,o);if(T){if(a.push("<instruction>"),T.header){let{description:P,applyTo:L,paths:Y}=T.header;P&&a.push(`<description>${P}</description>`),a.push(`<file>${tC(S)}</file>`);let G=this._getApplyToPattern(L,Y);G&&a.push(`<applyTo>${G}</applyTo>`)}else a.push(`<file>${tC(S)}</file>`);a.push("</instruction>"),g=!0}}let v=await m;for(let{uri:S}of v){let T=this._labelService.getUriLabel(es(S),{relative:!0}),P=T.trim().length===0?p(7701,null):p(7700,null,T);a.push("<instruction>"),a.push(`<description>${P}</description>`),a.push(`<file>${tC(S)}</file>`),a.push("</instruction>"),g=!0}g?a.push("</instructions>","",""):a.length=0;let x=(await this._promptsService.findAgentSkills(o))?.filter(S=>!S.disableModelInvocation);if(x&&x.length>0){let S=this._configurationService.getValue(ti.USE_SKILL_ADHERENCE_PROMPT);a.push("<skills>"),S?(a.push("Skills provide specialized capabilities, domain knowledge, and refined workflows for producing high-quality outputs. Each skill folder contains tested instructions for specific domains like testing strategies, API design, or performance optimization. Multiple skills can be combined when a task spans different domains."),a.push(`BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST load and read the SKILL.md file IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${i.variable} to load the relevant skill(s).`),a.push("NEVER just mention or reference a skill in your response without actually reading it first. If a skill is relevant, load it before proceeding."),a.push("How to determine if a skill applies:"),a.push("1. Review the available skills below and match their descriptions against the user's request"),a.push("2. If any skill's domain overlaps with the task, load that skill immediately"),a.push("3. When multiple skills apply (e.g., a flowchart in documentation), load all relevant skills"),a.push("Examples:"),a.push(`- "Help me write unit tests for this module" -> Load the testing skill via ${i.variable} FIRST, then proceed`),a.push(`- "Optimize this slow function" -> Load the performance-profiling skill via ${i.variable} FIRST, then proceed`),a.push('- "Add a discount code field to checkout" -> Load both the checkout-flow and form-validation skills FIRST'),a.push("Available skills:")):(a.push("Here is a list of skills that contain domain specific knowledge on a variety of topics."),a.push("Each skill comes with a description of the topic and a file path that contains the detailed instructions."),a.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${i.variable} tool to acquire the full instructions from the file URI.`));for(let T of x)a.push("<skill>"),a.push(`<name>${T.name}</name>`),T.description&&a.push(`<description>${T.description}</description>`),a.push(`<file>${tC(T.uri)}</file>`),a.push("</skill>");a.push("</skills>","","")}}if(s&&this._configurationService.getValue("chat.customAgentInSubagent.enabled")){let u=(()=>{if(!this._enabledSubagents||this._enabledSubagents.includes("*"))return g=>g.visibility.agentInvocable;{let g=this._enabledSubagents;return v=>g.includes(v.name)}})(),m=await this._promptsService.getCustomAgents(o);if(m.length>0){a.push("<agents>"),a.push("Here is a list of agents that can be used when running a subagent."),a.push("Each agent has optionally a description with the agent's purpose and expertise. When asked to run a subagent, choose the most appropriate agent from this list."),a.push(`Use the ${s.variable} tool with the agent name to run the subagent.`);for(let g of m)u(g)&&(a.push("<agent>"),a.push(`<name>${g.name}</name>`),g.description&&a.push(`<description>${g.description}</description>`),g.argumentHint&&a.push(`<argumentHint>${g.argumentHint}</argumentHint>`),a.push("</agent>"),yU(g.uri)&&n.claudeAgentsCount++);a.push("</agents>","","")}}if(a.length===0)return;let l=a.join(`
`),d=[],c=u=>{if(u){let m=l.indexOf(u.variable);for(;m>=0;)d.push(TA(u.tool,new eC(m,m+u.variable.length))),m=l.indexOf(u.variable,m+1)}};return c(i),c(s),CA(l,!0,d)}async _addReferencedInstructions(e,t,n){if(!this._configurationService.getValue(ti.INCLUDE_REFERENCED_INSTRUCTIONS)&&this._modeKind!=="edit"){this._logService.trace("[InstructionsContextComputer] includeReferencedInstructions is disabled and agent kind is not Edit. No referenced instructions will be added.");return}let i=new Yo,s=[];for(let l of e.asArray())Tg(l)&&(i.has(l.value)||(s.push(l.value),i.add(l.value)));let a=s.pop();for(;a;){let l=await this._parseInstructionsFile(a,n);if(l&&l.body){let d=[];for(let c of l.body.fileReferences){let u=l.body.resolveFilePath(c.content);u&&!i.has(u)&&(AR(u)||this._workspaceService.getWorkspaceFolder(u)!==void 0)&&(d.push({resource:u}),i.add(u))}if(d.length>0){let c=await this._fileService.resolveAll(d);for(let u=0;u<c.length;u++){let m=c[u],g=d[u].resource;if(m.success&&m.stat?.isFile){AR(g)&&s.push(g);let v=p(7703,null,Bt(a));e.add(tb(g,"vscode.prompt.instructions",v,!0)),t.referencedInstructionsCount++,this._logService.trace(`[InstructionsContextComputer] ${g.toString()} added, referenced by ${a.toString()}`)}}}}a=s.pop()}}};um=D([C(3,ZS),C(4,ue),C(5,fU),C(6,oo),C(7,pa),C(8,ql),C(9,Ia),C(10,od)],um);function tC(r){return r.scheme===$.file||r.scheme===$.vscodeRemote?r.fsPath:r.toString()}function nC(r){return{content:[{kind:"text",value:r}]}}var C7=`Launch a new agent to handle complex, multi-step tasks autonomously. This tool is good at researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use this agent to perform the search for you.

- Agents do not run async or in the background, you will wait for the agent's result.
- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
- Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
- The agent's outputs should generally be trusted
- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent`,$s=class extends H{constructor(t,n,o,i,s,a,l,d,c){super();this.chatAgentService=t;this.chatService=n;this.languageModelToolsService=o;this.languageModelsService=i;this.logService=s;this.toolsService=a;this.configurationService=l;this.promptsService=d;this.instantiationService=c;this._resolvedModels=new Map;this.onDidUpdateToolData=Me.filter(this.configurationService.onDidChangeConfiguration,u=>u.affectsConfiguration("chat.customAgentInSubagent.enabled"))}static{this.Id="runSubagent"}getToolData(){let t=C7,n={type:"object",properties:{prompt:{type:"string",description:"A detailed description of the task for the agent to perform"},description:{type:"string",description:"A short (3-5 word) description of the task"}},required:["prompt","description"]};return this.configurationService.getValue("chat.customAgentInSubagent.enabled")&&(n.properties.agentName={type:"string",description:"Optional name of a specific agent to invoke. If not provided, uses the current agent."},t+=`
- If the user asks for a certain agent, you MUST provide that EXACT agent name (case-sensitive) to invoke that specific agent.`),{id:$s.Id,toolReferenceName:Rg.runSubagent,icon:vt.fromId(le.organization.id),displayName:p(7932,null),userDescription:p(7933,null),modelDescription:t,source:Eo.Internal,inputSchema:n}}async invoke(t,n,o,i){let s=t.parameters;if(this.logService.debug(`RunSubagentTool: Invoking with prompt: ${s.prompt.substring(0,100)}...`),!t.context)throw new Error("toolInvocationToken is required for this tool");let a=this.chatService.getSession(t.context.sessionResource);if(!a)throw new Error("Chat model not found for session");let l=a.getRequests().at(-1),d=new q;try{let c=this.chatAgentService.getDefaultAgent("panel","agent");if(!c)return nC("Error: No default agent available");let u=t.modelId,m=t.userSelectedTools,g,v,h,x=s.agentName;if(x)if(v=await this.getSubAgentByName(x),v){let B=this._resolvedModels.get(t.callId);if(B)this._resolvedModels.delete(t.callId),u=B.modeModelId,h=B.resolvedModelName;else{let Ve=this.resolveSubagentModel(v,t.modelId);u=Ve.modeModelId,h=Ve.resolvedModelName}let He=v.tools;if(He){let Ve=this.languageModelToolsService.toToolAndToolSetEnablementMap(He,void 0);m={};for(let[ne,te]of Ve)QA(ne)||(m[ne.id]=te)}let Ge=v.agentInstructions;g=Ge&&{name:x,content:Ge.content,toolReferences:this.toolsService.toToolReferences(Ge.toolReferences),metadata:Ge.metadata}}else throw new Error(`Requested agent '${x}' not found. Try again with the correct agent name, or omit the agentName to use the current agent.`);else{let B=this._resolvedModels.get(t.callId);B?(this._resolvedModels.delete(t.callId),h=B.resolvedModelName):h=(u?this.languageModelsService.lookupLanguageModel(u):void 0)?.name}let S=[],T=t.callId??`subagent-${pt()}`,P=!1,L=B=>{for(let He of B)He.kind==="textEdit"||He.kind==="notebookEdit"||He.kind==="codeblockUri"?(He.kind==="codeblockUri"&&!P&&(P=!0,a.acceptResponseProgress(l,{kind:"markdownContent",content:new fo("```\n")})),He.kind==="codeblockUri"?a.acceptResponseProgress(l,{...He,subAgentInvocationId:T}):a.acceptResponseProgress(l,He)):He.kind==="hook"?a.acceptResponseProgress(l,{...He,subAgentInvocationId:T}):He.kind==="markdownContent"&&(P&&(a.acceptResponseProgress(l,{kind:"markdownContent",content:new fo("\n```\n\n")}),P=!1),S.push(He.content.value))};m&&(m[$s.Id]=!1,m[_R]=!1,m.copilot_askQuestions=!1);let Y=new Yl;await this.instantiationService.createInstance(um,"agent",m,void 0).collect(Y,i);let z;try{z=(await this.promptsService.getHooks(i))?.hooks}catch(B){this.logService.warn("[ChatService] Failed to collect hooks:",B)}let K={sessionResource:t.context.sessionResource,requestId:t.callId??`subagent-${Date.now()}`,agentId:c.id,message:s.prompt,variables:{variables:Y.asArray()},location:"panel",subAgentInvocationId:t.callId,subAgentName:x,userSelectedModelId:u,userSelectedTools:m,modeInstructions:g,parentRequestId:t.chatRequestId,hooks:z,hasHooksEnabled:!!z&&Object.values(z).some(B=>B.length>0)};d.add(this.languageModelToolsService.onDidInvokeTool(B=>{B.subagentInvocationId===T&&(S.length=0)}));let Q=await this.chatAgentService.invokeAgent(c.id,K,L,[],i);if(Q.errorDetails)return nC(`Agent error: ${Q.errorDetails.message}`);let X=S.join("").replace(/^\n*```\n+```\n*/g,"").trim()||"Agent completed with no output";return t.toolSpecificData?.kind==="subagent"&&(t.toolSpecificData.result=X,t.toolSpecificData.modelName=h),{content:[{kind:"text",value:X}],toolMetadata:{subAgentInvocationId:T,description:s.description,agentName:K.subAgentName,modelName:h}}}catch(c){let u=`Error invoking subagent: ${c instanceof Error?c.message:"Unknown error"}`;return this.logService.error(u,c),nC(u)}finally{d.dispose()}}async getSubAgentByName(t){return(await this.promptsService.getCustomAgents(be.None)).find(o=>o.name===t)}resolveSubagentModel(t,n){let o=n;if(t){let s=t.model;if(s)e:for(let a of s){let l=this.languageModelsService.lookupLanguageModelByQualifiedName(a);if(l?.identifier){o=l.identifier;break e}}if(o&&o!==n){let a=n?this.languageModelsService.lookupLanguageModel(n):void 0,l=this.languageModelsService.lookupLanguageModel(o),d=a?.multiplierNumeric,c=l?.multiplierNumeric;d!==void 0&&c!==void 0&&c>d&&(this.logService.warn(`[RunSubagentTool] Subagent '${t.name}' requested model '${l?.name}' (multiplier: ${c}) which has a larger multiplier than the main agent model '${a?.name}' (multiplier: ${d}). Falling back to the main agent model.`),o=n)}}let i=o?this.languageModelsService.lookupLanguageModel(o):void 0;return{modeModelId:o,resolvedModelName:i?.name}}async prepareToolInvocation(t,n){let o=t.parameters,i=o.agentName?await this.getSubAgentByName(o.agentName):void 0,s=this.resolveSubagentModel(i,t.modelId);return this._resolvedModels.set(t.toolCallId,s),{invocationMessage:o.description,toolSpecificData:{kind:"subagent",description:o.description,agentName:i?.name,prompt:o.prompt,modelName:s.resolvedModelName}}}};$s=D([C(0,gU),C(1,nS),C(2,od),C(3,Lb),C(4,ue),C(5,od),C(6,oo),C(7,ZS),C(8,po)],$s);var oC=class extends H{static{this.ID="chat.builtinTools"}constructor(e,t){super();let n=t.createInstance(lm);this._register(e.registerTool(dU,n));let o=PR(),i=this._register(t.createInstance(dm));this._register(e.registerTool(o,i));let s=t.createInstance(jS);this._register(e.registerTool(cU,s)),this._register(e.registerTool(uU,s));let a=this._register(t.createInstance($s)),l,d,c=()=>{l?.dispose(),d?.dispose(),e.flushToolUpdates();let u=a.getToolData();l=e.registerTool(u,a),d=e.agentToolSet.addTool(u)};c(),this._register(a.onDidUpdateToolData(c)),this._register({dispose:()=>{l?.dispose(),d?.dispose()}})}};oC=D([C(0,od),C(1,po)],oC);var SU="vscode_fetchWebPage_internal";var LR=M("commandService"),ch=new class{constructor(){this._commands=new Map;this._onDidRegisterCommand=new E;this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,e){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:r,handler:e})}if(r.metadata&&Array.isArray(r.metadata.args)){let s=[];for(let l of r.metadata.args)s.push(l.constraint);let a=r.handler;r.handler=function(l,...d){return $1(d,s),a(l,...d)}}let{id:t}=r,n=this._commands.get(t);n||(n=new qn,this._commands.set(t,n));let o=n.unshift(r),i=J(()=>{o(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),Am(i)}registerCommandAlias(r,e){return ch.registerCommand(r,(t,...n)=>t.get(LR).executeCommand(e,...n))}getCommand(r){let e=this._commands.get(r);if(!(!e||e.isEmpty()))return It.first(e)}getCommands(){let r=new Map;for(let e of this._commands.keys()){let t=this.getCommand(e);t&&r.set(e,t)}return r}};ch.registerCommand("noop",()=>{});var uh=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},rC=new uh,OR=new uh,NR=new uh,T7=new Array(230),E7={},w7={},k7=[],_7=Object.create(null),P7=Object.create(null);var CU=[],UR=[];for(let r=0;r<=193;r++)CU[r]=-1;for(let r=0;r<=132;r++)UR[r]=-1;(function(){let e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],n=[];for(let o of e){let[i,s,a,l,d,c,u,m,g]=o;if(n[s]||(n[s]=!0,k7[s]=a,_7[a]=s,P7[a.toLowerCase()]=s,i&&(CU[s]=l,l!==0&&l!==3&&!R7(l)&&(UR[l]=s))),!t[l]){if(t[l]=!0,!d)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);rC.define(l,d),OR.define(l,m||d),NR.define(l,g||m||d)}c&&(T7[c]=l),a&&(w7[a]=c),u&&(E7[u]=l)}UR[3]=46})();var D7;(s=>{function r(a){return rC.keyCodeToStr(a)}s.toString=r;function e(a){return rC.strToKeyCode(a)}s.fromString=e;function t(a){return OR.keyCodeToStr(a)}s.toUserSettingsUS=t;function n(a){return NR.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return OR.strToKeyCode(a)||NR.strToKeyCode(a)}s.fromUserSettings=o;function i(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return rC.keyCodeToStr(a)}s.toElectronAccelerator=i})(D7||={});function R7(r){return r===5||r===4||r===6||r===57}function HR(r,e){if(typeof r=="number"){if(r===0)return null;let t=(r&65535)>>>0,n=(r&4294901760)>>>16;return n!==0?new pm([iC(t,e),iC(n,e)]):new pm([iC(t,e)])}else{let t=[];for(let n=0;n<r.length;n++)t.push(iC(r[n],e));return new pm(t)}}function iC(r,e){let t=!!(r&2048),n=!!(r&256),o=e===2?n:t,i=!!(r&1024),s=!!(r&512),a=e===2?t:n,l=r&255;return new FR(o,i,s,a,l)}var FR=class r{constructor(e,t,n,o,i){this.ctrlKey=e;this.shiftKey=t;this.altKey=n;this.metaKey=o;this.keyCode=i}equals(e){return e instanceof r&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",t=this.shiftKey?"1":"0",n=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${e}${t}${n}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new pm([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}};var pm=class{constructor(e){if(e.length===0)throw De("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};var VR=class r{constructor(){this._coreKeybindings=new qn,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(ai===1){if(e&&e.win)return e.win}else if(ai===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){let t=r.bindToCurrentPlatform(e),n=new q;if(t&&t.primary){let o=HR(t.primary,ai);o&&n.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let o=0,i=t.secondary.length;o<i;o++){let s=t.secondary[o],a=HR(s,ai);a&&n.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-o-1,e.when))}return n}setExtensionKeybindings(e){let t=[],n=0;for(let o of e)o.keybinding&&(t[n++]={keybinding:o.keybinding,command:o.id,commandArgs:o.args,when:o.when,weight1:o.weight,weight2:0,extensionId:o.extensionId||null,isBuiltinExtension:o.isBuiltinExtension||!1});this._extensionKeybindings=t,this._cachedMergedKeybindings=null}registerCommandAndKeybindingRule(e){return Ic(this.registerKeybindingRule(e),ch.registerCommand(e))}_registerDefaultKeybinding(e,t,n,o,i,s){let a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:s,weight1:o,weight2:i,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,J(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(A7)),this._cachedMergedKeybindings.slice(0)}},TU=new VR,M7={EditorModes:"platform.keybindingsRegistry"};ot.add(M7.EditorModes,TU);function A7(r,e){if(r.weight1!==e.weight1)return r.weight1-e.weight1;if(r.command&&e.command){if(r.command<e.command)return-1;if(r.command>e.command)return 1}return r.weight2-e.weight2}function L7(r){return r.command!==void 0}var xl=class r{static{this._instances=new Map}static{this.CommandPalette=new r("CommandPalette")}static{this.DebugBreakpointsContext=new r("DebugBreakpointsContext")}static{this.DebugCallStackContext=new r("DebugCallStackContext")}static{this.DebugConsoleContext=new r("DebugConsoleContext")}static{this.DebugVariablesContext=new r("DebugVariablesContext")}static{this.NotebookVariablesContext=new r("NotebookVariablesContext")}static{this.DebugHoverContext=new r("DebugHoverContext")}static{this.DebugWatchContext=new r("DebugWatchContext")}static{this.DebugToolBar=new r("DebugToolBar")}static{this.DebugToolBarStop=new r("DebugToolBarStop")}static{this.DebugDisassemblyContext=new r("DebugDisassemblyContext")}static{this.DebugCallStackToolbar=new r("DebugCallStackToolbar")}static{this.DebugCreateConfiguration=new r("DebugCreateConfiguration")}static{this.DebugScopesContext=new r("DebugScopesContext")}static{this.EditorContext=new r("EditorContext")}static{this.SimpleEditorContext=new r("SimpleEditorContext")}static{this.EditorContent=new r("EditorContent")}static{this.EditorLineNumberContext=new r("EditorLineNumberContext")}static{this.EditorContextCopy=new r("EditorContextCopy")}static{this.EditorContextPeek=new r("EditorContextPeek")}static{this.EditorContextShare=new r("EditorContextShare")}static{this.EditorTitle=new r("EditorTitle")}static{this.ModalEditorTitle=new r("ModalEditorTitle")}static{this.CompactWindowEditorTitle=new r("CompactWindowEditorTitle")}static{this.EditorTitleRun=new r("EditorTitleRun")}static{this.EditorTitleContext=new r("EditorTitleContext")}static{this.EditorTitleContextShare=new r("EditorTitleContextShare")}static{this.EmptyEditorGroup=new r("EmptyEditorGroup")}static{this.EmptyEditorGroupContext=new r("EmptyEditorGroupContext")}static{this.EditorTabsBarContext=new r("EditorTabsBarContext")}static{this.EditorTabsBarShowTabsSubmenu=new r("EditorTabsBarShowTabsSubmenu")}static{this.EditorTabsBarShowTabsZenModeSubmenu=new r("EditorTabsBarShowTabsZenModeSubmenu")}static{this.EditorActionsPositionSubmenu=new r("EditorActionsPositionSubmenu")}static{this.EditorSplitMoveSubmenu=new r("EditorSplitMoveSubmenu")}static{this.ExplorerContext=new r("ExplorerContext")}static{this.ExplorerContextShare=new r("ExplorerContextShare")}static{this.ExtensionContext=new r("ExtensionContext")}static{this.ExtensionEditorContextMenu=new r("ExtensionEditorContextMenu")}static{this.GlobalActivity=new r("GlobalActivity")}static{this.CommandCenter=new r("CommandCenter")}static{this.CommandCenterCenter=new r("CommandCenterCenter")}static{this.LayoutControlMenuSubmenu=new r("LayoutControlMenuSubmenu")}static{this.LayoutControlMenu=new r("LayoutControlMenu")}static{this.MenubarMainMenu=new r("MenubarMainMenu")}static{this.MenubarAppearanceMenu=new r("MenubarAppearanceMenu")}static{this.MenubarDebugMenu=new r("MenubarDebugMenu")}static{this.MenubarEditMenu=new r("MenubarEditMenu")}static{this.MenubarCopy=new r("MenubarCopy")}static{this.MenubarFileMenu=new r("MenubarFileMenu")}static{this.MenubarGoMenu=new r("MenubarGoMenu")}static{this.MenubarHelpMenu=new r("MenubarHelpMenu")}static{this.MenubarLayoutMenu=new r("MenubarLayoutMenu")}static{this.MenubarNewBreakpointMenu=new r("MenubarNewBreakpointMenu")}static{this.PanelAlignmentMenu=new r("PanelAlignmentMenu")}static{this.PanelPositionMenu=new r("PanelPositionMenu")}static{this.ActivityBarPositionMenu=new r("ActivityBarPositionMenu")}static{this.MenubarPreferencesMenu=new r("MenubarPreferencesMenu")}static{this.MenubarRecentMenu=new r("MenubarRecentMenu")}static{this.MenubarSelectionMenu=new r("MenubarSelectionMenu")}static{this.MenubarShare=new r("MenubarShare")}static{this.MenubarSwitchEditorMenu=new r("MenubarSwitchEditorMenu")}static{this.MenubarSwitchGroupMenu=new r("MenubarSwitchGroupMenu")}static{this.MenubarTerminalMenu=new r("MenubarTerminalMenu")}static{this.MenubarTerminalSuggestStatusMenu=new r("MenubarTerminalSuggestStatusMenu")}static{this.MenubarViewMenu=new r("MenubarViewMenu")}static{this.MenubarHomeMenu=new r("MenubarHomeMenu")}static{this.OpenEditorsContext=new r("OpenEditorsContext")}static{this.OpenEditorsContextShare=new r("OpenEditorsContextShare")}static{this.ProblemsPanelContext=new r("ProblemsPanelContext")}static{this.SCMInputBox=new r("SCMInputBox")}static{this.SCMChangeContext=new r("SCMChangeContext")}static{this.SCMResourceContext=new r("SCMResourceContext")}static{this.SCMResourceContextShare=new r("SCMResourceContextShare")}static{this.SCMResourceFolderContext=new r("SCMResourceFolderContext")}static{this.SCMResourceGroupContext=new r("SCMResourceGroupContext")}static{this.SCMSourceControl=new r("SCMSourceControl")}static{this.SCMSourceControlInline=new r("SCMSourceControlInline")}static{this.SCMSourceControlTitle=new r("SCMSourceControlTitle")}static{this.SCMHistoryTitle=new r("SCMHistoryTitle")}static{this.SCMHistoryItemContext=new r("SCMHistoryItemContext")}static{this.SCMHistoryItemChangeContext=new r("SCMHistoryItemChangeContext")}static{this.SCMHistoryItemRefContext=new r("SCMHistoryItemRefContext")}static{this.SCMArtifactGroupContext=new r("SCMArtifactGroupContext")}static{this.SCMArtifactContext=new r("SCMArtifactContext")}static{this.SCMQuickDiffDecorations=new r("SCMQuickDiffDecorations")}static{this.SCMTitle=new r("SCMTitle")}static{this.SearchContext=new r("SearchContext")}static{this.SearchActionMenu=new r("SearchActionContext")}static{this.StatusBarWindowIndicatorMenu=new r("StatusBarWindowIndicatorMenu")}static{this.StatusBarRemoteIndicatorMenu=new r("StatusBarRemoteIndicatorMenu")}static{this.StickyScrollContext=new r("StickyScrollContext")}static{this.TestItem=new r("TestItem")}static{this.TestItemGutter=new r("TestItemGutter")}static{this.TestProfilesContext=new r("TestProfilesContext")}static{this.TestMessageContext=new r("TestMessageContext")}static{this.TestMessageContent=new r("TestMessageContent")}static{this.TestPeekElement=new r("TestPeekElement")}static{this.TestPeekTitle=new r("TestPeekTitle")}static{this.TestCallStack=new r("TestCallStack")}static{this.TestCoverageFilterItem=new r("TestCoverageFilterItem")}static{this.TouchBarContext=new r("TouchBarContext")}static{this.TitleBar=new r("TitleBar")}static{this.TitleBarContext=new r("TitleBarContext")}static{this.TitleBarTitleContext=new r("TitleBarTitleContext")}static{this.TunnelContext=new r("TunnelContext")}static{this.TunnelPrivacy=new r("TunnelPrivacy")}static{this.TunnelProtocol=new r("TunnelProtocol")}static{this.TunnelPortInline=new r("TunnelInline")}static{this.TunnelTitle=new r("TunnelTitle")}static{this.TunnelLocalAddressInline=new r("TunnelLocalAddressInline")}static{this.TunnelOriginInline=new r("TunnelOriginInline")}static{this.ViewItemContext=new r("ViewItemContext")}static{this.ViewContainerTitle=new r("ViewContainerTitle")}static{this.ViewContainerTitleContext=new r("ViewContainerTitleContext")}static{this.ViewTitle=new r("ViewTitle")}static{this.ViewTitleContext=new r("ViewTitleContext")}static{this.CommentEditorActions=new r("CommentEditorActions")}static{this.CommentThreadTitle=new r("CommentThreadTitle")}static{this.CommentThreadActions=new r("CommentThreadActions")}static{this.CommentThreadAdditionalActions=new r("CommentThreadAdditionalActions")}static{this.CommentThreadTitleContext=new r("CommentThreadTitleContext")}static{this.CommentThreadCommentContext=new r("CommentThreadCommentContext")}static{this.CommentTitle=new r("CommentTitle")}static{this.CommentActions=new r("CommentActions")}static{this.CommentsViewThreadActions=new r("CommentsViewThreadActions")}static{this.InteractiveToolbar=new r("InteractiveToolbar")}static{this.InteractiveCellTitle=new r("InteractiveCellTitle")}static{this.InteractiveCellDelete=new r("InteractiveCellDelete")}static{this.InteractiveCellExecute=new r("InteractiveCellExecute")}static{this.InteractiveInputExecute=new r("InteractiveInputExecute")}static{this.InteractiveInputConfig=new r("InteractiveInputConfig")}static{this.ReplInputExecute=new r("ReplInputExecute")}static{this.IssueReporter=new r("IssueReporter")}static{this.NotebookToolbar=new r("NotebookToolbar")}static{this.NotebookToolbarContext=new r("NotebookToolbarContext")}static{this.NotebookStickyScrollContext=new r("NotebookStickyScrollContext")}static{this.NotebookCellTitle=new r("NotebookCellTitle")}static{this.NotebookCellDelete=new r("NotebookCellDelete")}static{this.NotebookCellInsert=new r("NotebookCellInsert")}static{this.NotebookCellBetween=new r("NotebookCellBetween")}static{this.NotebookCellListTop=new r("NotebookCellTop")}static{this.NotebookCellExecute=new r("NotebookCellExecute")}static{this.NotebookCellExecuteGoTo=new r("NotebookCellExecuteGoTo")}static{this.NotebookCellExecutePrimary=new r("NotebookCellExecutePrimary")}static{this.NotebookDiffCellInputTitle=new r("NotebookDiffCellInputTitle")}static{this.NotebookDiffDocumentMetadata=new r("NotebookDiffDocumentMetadata")}static{this.NotebookDiffCellMetadataTitle=new r("NotebookDiffCellMetadataTitle")}static{this.NotebookDiffCellOutputsTitle=new r("NotebookDiffCellOutputsTitle")}static{this.NotebookOutputToolbar=new r("NotebookOutputToolbar")}static{this.NotebookOutlineFilter=new r("NotebookOutlineFilter")}static{this.NotebookOutlineActionMenu=new r("NotebookOutlineActionMenu")}static{this.NotebookEditorLayoutConfigure=new r("NotebookEditorLayoutConfigure")}static{this.NotebookKernelSource=new r("NotebookKernelSource")}static{this.BulkEditTitle=new r("BulkEditTitle")}static{this.BulkEditContext=new r("BulkEditContext")}static{this.TimelineItemContext=new r("TimelineItemContext")}static{this.TimelineTitle=new r("TimelineTitle")}static{this.TimelineTitleContext=new r("TimelineTitleContext")}static{this.TimelineFilterSubMenu=new r("TimelineFilterSubMenu")}static{this.AccountsContext=new r("AccountsContext")}static{this.SidebarTitle=new r("SidebarTitle")}static{this.PanelTitle=new r("PanelTitle")}static{this.AuxiliaryBarTitle=new r("AuxiliaryBarTitle")}static{this.TerminalInstanceContext=new r("TerminalInstanceContext")}static{this.TerminalEditorInstanceContext=new r("TerminalEditorInstanceContext")}static{this.TerminalNewDropdownContext=new r("TerminalNewDropdownContext")}static{this.TerminalTabContext=new r("TerminalTabContext")}static{this.TerminalTabEmptyAreaContext=new r("TerminalTabEmptyAreaContext")}static{this.TerminalStickyScrollContext=new r("TerminalStickyScrollContext")}static{this.WebviewContext=new r("WebviewContext")}static{this.InlineCompletionsActions=new r("InlineCompletionsActions")}static{this.InlineEditsActions=new r("InlineEditsActions")}static{this.NewFile=new r("NewFile")}static{this.MergeInput1Toolbar=new r("MergeToolbar1Toolbar")}static{this.MergeInput2Toolbar=new r("MergeToolbar2Toolbar")}static{this.MergeBaseToolbar=new r("MergeBaseToolbar")}static{this.MergeInputResultToolbar=new r("MergeToolbarResultToolbar")}static{this.InlineSuggestionToolbar=new r("InlineSuggestionToolbar")}static{this.InlineEditToolbar=new r("InlineEditToolbar")}static{this.AgentFeedbackEditorContent=new r("AgentFeedbackEditorContent")}static{this.ChatContext=new r("ChatContext")}static{this.ChatCodeBlock=new r("ChatCodeblock")}static{this.ChatCompareBlock=new r("ChatCompareBlock")}static{this.ChatMessageTitle=new r("ChatMessageTitle")}static{this.ChatWelcomeContext=new r("ChatWelcomeContext")}static{this.ChatMessageFooter=new r("ChatMessageFooter")}static{this.ChatExecute=new r("ChatExecute")}static{this.ChatExecuteQueue=new r("ChatExecuteQueue")}static{this.ChatInput=new r("ChatInput")}static{this.ChatInputSide=new r("ChatInputSide")}static{this.ChatModePicker=new r("ChatModePicker")}static{this.ChatEditingWidgetToolbar=new r("ChatEditingWidgetToolbar")}static{this.ChatEditingSessionChangesToolbar=new r("ChatEditingSessionChangesToolbar")}static{this.ChatEditingEditorContent=new r("ChatEditingEditorContent")}static{this.ChatEditingEditorHunk=new r("ChatEditingEditorHunk")}static{this.ChatEditingDeletedNotebookCell=new r("ChatEditingDeletedNotebookCell")}static{this.ChatInputAttachmentToolbar=new r("ChatInputAttachmentToolbar")}static{this.ChatEditingWidgetModifiedFilesToolbar=new r("ChatEditingWidgetModifiedFilesToolbar")}static{this.ChatInputResourceAttachmentContext=new r("ChatInputResourceAttachmentContext")}static{this.ChatInputSymbolAttachmentContext=new r("ChatInputSymbolAttachmentContext")}static{this.ChatInlineResourceAnchorContext=new r("ChatInlineResourceAnchorContext")}static{this.ChatInlineSymbolAnchorContext=new r("ChatInlineSymbolAnchorContext")}static{this.ChatMessageCheckpoint=new r("ChatMessageCheckpoint")}static{this.ChatMessageRestoreCheckpoint=new r("ChatMessageRestoreCheckpoint")}static{this.ChatNewMenu=new r("ChatNewMenu")}static{this.ChatEditingCodeBlockContext=new r("ChatEditingCodeBlockContext")}static{this.ChatTitleBarMenu=new r("ChatTitleBarMenu")}static{this.ChatAttachmentsContext=new r("ChatAttachmentsContext")}static{this.ChatTipContext=new r("ChatTipContext")}static{this.ChatTipToolbar=new r("ChatTipToolbar")}static{this.ChatToolOutputResourceToolbar=new r("ChatToolOutputResourceToolbar")}static{this.ChatTextEditorMenu=new r("ChatTextEditorMenu")}static{this.ChatToolOutputResourceContext=new r("ChatToolOutputResourceContext")}static{this.ChatMultiDiffContext=new r("ChatMultiDiffContext")}static{this.ChatConfirmationMenu=new r("ChatConfirmationMenu")}static{this.ChatEditorInlineGutter=new r("ChatEditorInlineGutter")}static{this.ChatEditorInlineExecute=new r("ChatEditorInputExecute")}static{this.ChatEditorInlineInputSide=new r("ChatEditorInputSide")}static{this.InlineChatEditorAffordance=new r("InlineChatEditorAffordance")}static{this.AccessibleView=new r("AccessibleView")}static{this.MultiDiffEditorContent=new r("MultiDiffEditorContent")}static{this.MultiDiffEditorFileToolbar=new r("MultiDiffEditorFileToolbar")}static{this.DiffEditorHunkToolbar=new r("DiffEditorHunkToolbar")}static{this.DiffEditorSelectionToolbar=new r("DiffEditorSelectionToolbar")}static{this.BrowserNavigationToolbar=new r("BrowserNavigationToolbar")}static{this.BrowserActionsToolbar=new r("BrowserActionsToolbar")}static{this.AgentSessionsViewerFilterSubMenu=new r("AgentSessionsViewerFilterSubMenu")}static{this.AgentSessionsContext=new r("AgentSessionsContext")}static{this.AgentSessionSectionContext=new r("AgentSessionSectionContext")}static{this.AgentSessionsCreateSubMenu=new r("AgentSessionsCreateSubMenu")}static{this.AgentSessionsToolbar=new r("AgentSessionsToolbar")}static{this.AgentSessionItemToolbar=new r("AgentSessionItemToolbar")}static{this.AgentSessionSectionToolbar=new r("AgentSessionSectionToolbar")}static{this.AgentsTitleBarControlMenu=new r("AgentsTitleBarControlMenu")}static{this.ChatViewSessionTitleNavigationToolbar=new r("ChatViewSessionTitleNavigationToolbar")}static{this.ChatViewSessionTitleToolbar=new r("ChatViewSessionTitleToolbar")}static{this.ChatContextUsageActions=new r("ChatContextUsageActions")}static for(e){return r._instances.get(e)??new r(e)}constructor(e){if(r._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);r._instances.set(e,this),this.id=e}},h9e=M("menuService"),rc=class r{constructor(e){this.id=e;this.has=t=>t===e}static{this._all=new Map}static for(e){let t=this._all.get(e);return t||(t=new r(e),this._all.set(e,t)),t}static merge(e){let t=new Set;for(let n of e)n instanceof r&&t.add(n.id);return t}},v9e=new class{constructor(){this._commands=new Map;this._menuItems=new Map;this._onDidChangeMenu=new Ah({merge:rc.merge});this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(r){return this._commands.set(r.id,r),this._onDidChangeMenu.fire(rc.for(xl.CommandPalette)),Am(J(()=>{this._commands.delete(r.id)&&this._onDidChangeMenu.fire(rc.for(xl.CommandPalette))}))}getCommand(r){return this._commands.get(r)}getCommands(){let r=new Map;return this._commands.forEach((e,t)=>r.set(t,e)),r}appendMenuItem(r,e){let t=this._menuItems.get(r);t||(t=new qn,this._menuItems.set(r,t));let n=t.push(e);return this._onDidChangeMenu.fire(rc.for(r)),Am(J(()=>{n(),this._onDidChangeMenu.fire(rc.for(r))}))}appendMenuItems(r){let e=new q;for(let{id:t,item:n}of r)e.add(this.appendMenuItem(t,n));return e}getMenuItems(r){let e;return this._menuItems.has(r)?e=[...this._menuItems.get(r)]:e=[],r===xl.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(r){let e=new Set;for(let t of r)L7(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||r.push({command:t})})}};var ic=class{constructor(e,t,n,o,i,s,a){this.hideActions=o;this.menuKeybinding=i;this._commandService=a;this.id=e.id,this.label=ic.label(e,n),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){let d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&vt.isThemeIcon(d.icon)&&(l=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}l||(l=vt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new ic(t,void 0,n,o,void 0,s,a):void 0,this._options=n,this.class=l&&vt.asClassName(l)}static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}run(...e){let t=[];return this._options?.args?t=[...t,...this._options.args]:this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};ic=D([C(5,sr),C(6,LR)],ic);var S9e=M("IExtensionGalleryManifestService");var A9e=Al(13371,"Extensions");var BR=M("extensionsWorkbenchService");var sC=class extends H{constructor(t,n){super();this.containers=t;this._register(n.onChange(this.update,this))}set extension(t){this.containers.forEach(n=>n.extension=t)}update(t){for(let n of this.containers)t&&n.extension?yL(n.extension.identifier,t.identifier)&&(n.extension.server&&t.server&&n.extension.server!==t.server?n.updateWhenCounterExtensionChanges&&n.update():n.extension=t):n.update()}};sC=D([C(1,BR)],sC);var L9e=new w("defaultExtensionViews",!0),O9e=new w("hasOutdatedExtensions",!1),N9e=new w("hasGallery",!1),U9e=new w("extensionsGalleryStatus","unavailable"),F9e=new w("extensionResultListFocused ",!0),H9e=new w("searchMcpServers",!1);var V9e=new xl("extensionsSearchActionsMenu"),B9e=new xl("extensionsFilterSubMenu");var WR="vscode_searchExtensions_internal",s8e={id:WR,toolReferenceName:"extensions",legacyToolReferenceFullNames:["extensions"],icon:vt.fromId(le.extensions.id),displayName:p(13384,null),modelDescription:"This is a tool for browsing Visual Studio Code Extensions Marketplace. It allows the model to search for extensions and retrieve detailed information about them. The model should use this tool whenever it needs to discover extensions or resolve information about known ones. To use the tool, the model has to provide the category of the extensions, relevant search keywords, or known extension IDs. Note that search results may include false positives, so reviewing and filtering is recommended.",userDescription:p(13386,null),source:Eo.Internal,inputSchema:{type:"object",properties:{category:{type:"string",description:"The category of extensions to search for",enum:fv},keywords:{type:"array",items:{type:"string"},description:"The keywords to search for"},ids:{type:"array",items:{type:"string"},description:"The ids of the extensions to search for"}}}},aC=class{constructor(e){this.extensionWorkbenchService=e}async invoke(e,t,n,o){let i=e.parameters;if(!i.keywords?.length&&!i.category&&!i.ids?.length)return{content:[{kind:"text",value:p(13385,null)}]};let s=new Map,a=c=>{for(let u of c)u.deprecationInfo||u.isMalicious||s.set(u.identifier.id.toLowerCase(),{id:u.identifier.id,name:u.displayName,description:u.description,installed:u.state===1,installCount:u.installCount??0,rating:u.rating??0,categories:u.categories??[],tags:u.gallery?.tags??[]})},l=async c=>{let u=await this.extensionWorkbenchService.queryGallery({text:c,pageSize:10,sortBy:"InstallCount"},o);u.firstPage.length&&a(u.firstPage)};if(i.ids?.length){let c=await this.extensionWorkbenchService.getExtensions(i.ids.map(u=>({id:u})),o);a(c)}if(i.keywords?.length)for(let c of i.keywords??[])if(c==="featured")await l("featured");else{let u=i.category?`category:"${i.category}"`:"";u=c?`${u} ${c}`.trim():u,await l(u)}else await l(`category:"${i.category}"`);let d=Array.from(s.values());return{content:[{kind:"text",value:`Here are the list of extensions:
${JSON.stringify(d)}
. Important: Use the following format to display extensions to the user because there is a renderer available to parse these extensions in this format and display them with all details. So, do not describe about the extensions to the user.
\`\`\`vscode-extensions
extensionId1,extensionId2
\`\`\`
.`}],toolResultDetails:{input:JSON.stringify(i),output:[{type:"embed",isText:!0,value:JSON.stringify(d.map(c=>c.id))}]}}}};aC=D([C(0,BR)],aC);var lC=class{constructor(e){this._data=e}update(e){this._data=e,this._apiObject=void 0,this._apiObjectWithChatParticipantAdditions=void 0}get data(){return this._data}get apiObject(){return this._apiObject||(this._apiObject=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:void 0})),this._apiObject}get apiObjectWithChatParticipantAdditions(){return this._apiObjectWithChatParticipantAdditions||(this._apiObjectWithChatParticipantAdditions=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:vP.to(this._data.source)})),this._apiObjectWithChatParticipantAdditions}},dC=class{constructor(e,t){this._languageModels=t;this._registeredTools=new Map;this._tokenCountFuncs=new Map;this._allTools=new Map;this._proxy=e.getProxy(N.MainThreadLanguageModelTools),this._proxy.$getTools().then(n=>{for(let o of n)this._allTools.set(o.id,new lC($t(o)))})}async $countTokensForInvocation(e,t,n){let o=this._tokenCountFuncs.get(e);if(!o)throw new Error(`Tool invocation call ${e} not found`);return await o(t,n)}async invokeTool(e,t,n,o){let i=typeof t=="string"?t:t.name,s=pt();n.tokenizationOptions&&this._tokenCountFuncs.set(s,n.tokenizationOptions.countTokens);try{if(n.toolInvocationToken&&!jA(n.toolInvocationToken))throw new Error("Invalid tool invocation token");if((i===GS||i===kR)&&!Fe(e,"chatParticipantPrivate"))throw new Error(`Invalid tool: ${i}`);let a=await this._proxy.$invokeTool({toolId:i,callId:s,parameters:n.input,tokenBudget:n.tokenizationOptions?.tokenBudget,context:n.toolInvocationToken,chatRequestId:Fe(e,"chatParticipantPrivate")?n.chatRequestId:void 0,chatInteractionId:Fe(e,"chatParticipantPrivate")?n.chatInteractionId:void 0,subAgentInvocationId:Fe(e,"chatParticipantPrivate")?n.subAgentInvocationId:void 0,chatStreamToolCallId:Fe(e,"chatParticipantAdditions")?n.chatStreamToolCallId:void 0,preToolUseResult:Fe(e,"chatParticipantPrivate")?n.preToolUseResult:void 0},o),l=a instanceof Pt?a.value:a;return WI.to($t(l))}finally{this._tokenCountFuncs.delete(s)}}$onDidChangeTools(e){let t=new Set(this._allTools.keys());for(let n of e){t.delete(n.id);let o=this._allTools.get(n.id);o?o.update(n):this._allTools.set(n.id,new lC($t(n)))}for(let n of t)this._allTools.delete(n)}getTools(e){let t=Fe(e,"chatParticipantPrivate");return Array.from(this._allTools.values()).map(n=>t?n.apiObjectWithChatParticipantAdditions:n.apiObject).filter(n=>{switch(n.name){case GS:case kR:case SU:case WR:return Fe(e,"chatParticipantPrivate");default:return!0}})}async $invokeTool(e,t){let n=this._registeredTools.get(e.toolId);if(!n)throw new Error(`Unknown tool ${e.toolId}`);let o={input:e.parameters,toolInvocationToken:$t(e.context)};Fe(n.extension,"chatParticipantPrivate")&&(o.chatRequestId=e.chatRequestId,o.chatInteractionId=e.chatInteractionId,o.chatSessionResource=y.revive(e.context?.sessionResource),o.subAgentInvocationId=e.subAgentInvocationId),Fe(n.extension,"chatParticipantAdditions")&&e.modelId&&(o.model=await this.getModel(e.modelId,n.extension)),Fe(n.extension,"chatParticipantAdditions")&&e.chatStreamToolCallId&&(o.chatStreamToolCallId=e.chatStreamToolCallId),e.tokenBudget!==void 0&&(o.tokenizationOptions={tokenBudget:e.tokenBudget,countTokens:this._tokenCountFuncs.get(e.callId)||((a,l=be.None)=>this._proxy.$countTokensForInvocation(e.callId,a,l))});let i;if(Fe(n.extension,"toolProgress")){let a;i={report:l=>{l.increment!==void 0&&(a=(a??0)+l.increment),this._proxy.$acceptToolProgress(e.callId,{message:ce.fromStrict(l.message),progress:a===void 0?void 0:a/100})}}}let s=await pv(Promise.resolve(n.tool.invoke(o,t,i)),t);if(!s)throw new xt;return WI.from(s,n.extension)}async getModel(e,t){let n;if(e&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw new Error("Language model unavailable");return n}async $handleToolStream(e,t,n){let o=this._registeredTools.get(e);if(!o)throw new Error(`Unknown tool ${e}`);if(!o.tool.handleToolStream)return;A(o.extension,"chatParticipantAdditions");let i={rawInput:t.rawInput,chatRequestId:t.chatRequestId,chatSessionId:t.chatSessionId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId},s=await o.tool.handleToolStream(i,n);if(s)return{invocationMessage:ce.fromStrict(s.invocationMessage)}}async $prepareToolInvocation(e,t,n){let o=this._registeredTools.get(e);if(!o)throw new Error(`Unknown tool ${e}`);let i={input:t.parameters,chatRequestId:t.chatRequestId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId,forceConfirmationReason:t.forceConfirmationReason};if(t.forceConfirmationReason&&A(o.extension,"chatParticipantPrivate"),o.tool.prepareInvocation){let s=await o.tool.prepareInvocation(i,n);return s?((s.pastTenseMessage||s.presentation)&&A(o.extension,"chatParticipantPrivate"),{confirmationMessages:s.confirmationMessages?{title:typeof s.confirmationMessages.title=="string"?s.confirmationMessages.title:ce.from(s.confirmationMessages.title),message:typeof s.confirmationMessages.message=="string"?s.confirmationMessages.message:ce.from(s.confirmationMessages.message)}:void 0,invocationMessage:ce.fromStrict(s.invocationMessage),pastTenseMessage:ce.fromStrict(s.pastTenseMessage),presentation:s.presentation}):void 0}}registerTool(e,t,n){return this._registeredTools.set(t,{extension:e,tool:n}),this._proxy.$registerTool(t,typeof n.handleToolStream=="function"),J(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}registerToolDefinition(e,t,n){A(e,"languageModelToolSupportsModel");let o=t.name,i={id:o,displayName:t.displayName,toolReferenceName:t.toolReferenceName,userDescription:t.userDescription,modelDescription:t.description,inputSchema:t.inputSchema,source:{type:"extension",label:e.displayName??e.name,extensionId:e.identifier},icon:Xr.from(t.icon),models:t.models,toolSet:t.toolSet};return this._registeredTools.set(o,{extension:e,tool:n}),this._proxy.$registerToolWithDefinition(e.identifier,i,typeof n.handleToolStream=="function"),J(()=>{this._registeredTools.delete(o),this._proxy.$unregisterTool(o)})}};var cC=class{constructor(e,t,n,o){this._documents=t;this._commands=n;this._uriTransformer=o;this._languageIds=[];this._handlePool=0;this._ids=new Set;this._proxy=e.getProxy(N.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);let n=this._documents.getDocumentData(e);if(!n)throw new Error(`document '${e.toString()}' NOT found`);return n.document}async tokenAtPosition(e,t){let n=e.version,o=Xe.from(t),i=await this._proxy.$tokensAtPosition(e.uri,o),s={type:0,range:e.getWordRangeAtPosition(t)??new pe(t.line,t.character,t.line,t.character)};if(!i)return s;let a={range:V.to(i.range),type:W_.to(i.type)};return!a.range.contains(t)||n!==e.version?s:a}createLanguageStatusItem(e,t,n){let o=this._handlePool++,i=this._proxy,s=this._ids,a=`${e.identifier.value}/${t}`;if(s.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);s.add(a);let l={selector:n,id:t,name:e.displayName??e.name,severity:0,command:void 0,text:"",detail:"",busy:!1},d,c=new q,u=()=>{if(d?.dispose(),!s.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}d=oM(()=>{c.clear(),this._proxy.$setLanguageStatus(o,{id:a,name:l.name??e.displayName??e.name,source:e.displayName??e.name,selector:Jr.from(l.selector,this._uriTransformer),label:l.text,detail:l.detail??"",severity:l.severity===2?$e.Error:l.severity===1?$e.Warning:$e.Info,command:l.command&&this._commands.toInternal(l.command,c),accessibilityInfo:l.accessibilityInformation,busy:l.busy})},0)},m={dispose(){c.dispose(),d?.dispose(),i.$removeLanguageStatus(o),s.delete(a)},get id(){return l.id},get name(){return l.name},set name(g){l.name=g,u()},get selector(){return l.selector},set selector(g){l.selector=g,u()},get text(){return l.text},set text(g){l.text=g,u()},set text2(g){A(e,"languageStatusText"),l.text=g,u()},get text2(){return A(e,"languageStatusText"),l.text},get detail(){return l.detail},set detail(g){l.detail=g,u()},get severity(){return l.severity},set severity(g){l.severity=g,u()},get accessibilityInformation(){return l.accessibilityInformation},set accessibilityInformation(g){l.accessibilityInformation=g,u()},get command(){return l.command},set command(g){l.command=g,u()},get busy(){return l.busy},set busy(g){l.busy=g,u()}};return u(),m}};function O7(r){return r&&r.title}var mm=class{constructor(e,t){this._logService=t;this._proxy=e.getProxy(N.MainThreadMessageService)}showMessage(e,t,n,o,i){let s={source:{identifier:e.identifier,label:e.displayName||e.name}},a;typeof o=="string"||O7(o)?a=[o,...i]:(s.modal=o?.modal,s.useCustom=o?.useCustom,s.detail=o?.detail,a=i),s.useCustom&&A(e,"resolvers");let l=[],d=!1;for(let c=0;c<a.length;c++){let u=a[c];if(typeof u=="string")l.push({title:u,handle:c,isCloseAffordance:!1});else if(typeof u=="object"){let{title:m,isCloseAffordance:g}=u;l.push({title:m,isCloseAffordance:!!g,handle:c}),g&&(d?this._logService.warn(`[${e.identifier}] Only one message item can have 'isCloseAffordance':`,u):d=!0)}else this._logService.warn(`[${e.identifier}] Invalid message item:`,u)}return this._proxy.$showMessage(t,n,s,l).then(c=>{if(typeof c=="number")return a[c]})}};mm=D([C(1,ue)],mm);var ph=class{constructor(e,t,n,o){this.start=e;this.deletedCount=t;this.deletedItems=n;this.items=o}asApiEvent(){return{range:new Rn(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}},gm=class{constructor(e,t,n){this.notebook=e;this._extHostDocument=t;this._cellData=n;this.handle=n.handle,this.uri=y.revive(n.uri),this.cellKind=n.cellKind,this._outputs=n.outputs.map(As.to),this._internalMetadata=n.internalMetadata??{},this._metadata=Object.freeze(n.metadata??{}),this._previousResult=Object.freeze(Wu.to(n.internalMetadata??{}))}static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1,encoding:"utf8"}}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){let e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw new Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);let n={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:rf.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(o){e._mime=o},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(n)}return this._apiCell}setOutputs(e){this._outputs=e.map(As.to)}setOutputItems(e,t,n){let o=n.map(Ld.to),i=this._outputs.find(s=>s.id===e);if(i&&(t||(i.items.length=0),i.items.push(...o),i.items.length>1&&i.items.every(s=>zv(s.mime)))){let s=new Map,a=[];i.items.forEach(l=>{let d;s.has(l.mime)?d=s.get(l.mime):(d=[],s.set(l.mime,d),a.push(l.mime)),d.push(l.data)}),i.items.length=0,a.forEach(l=>{let d=aO(s.get(l));i.items.push({mime:l,data:d.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(Wu.to(e))}setMime(e){}},uC=class r{constructor(e,t,n,o,i){this._proxy=e;this._textDocumentsAndEditors=t;this._textDocuments=n;this.uri=o;this.handle=r._handlePool++;this._cells=[];this._versionId=0;this._isDirty=!1;this._disposed=!1;this._notebookType=i.viewType,this._metadata=Object.freeze(i.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,i.cells]],!0,void 0),this._versionId=i.versionId}static{this._handlePool=0}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){let e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===$.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(n){return n=e._validateIndex(n),e._cells[n].apiCell},getCells(n){return(n?e._getCells(n):e._cells).map(i=>i.apiCell)},save(){return e._save()},[Symbol.for("debug.description")](){return`NotebookDocument(${this.uri.toString()})`}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,n){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:n});let o={notebook:this.apiNotebook,metadata:n,cellChanges:[],contentChanges:[]},i=[];for(let a of e.rawEvents)a.kind===1?this._spliceNotebookCells(a.changes,!1,o.contentChanges):a.kind===2?this._moveCells(a.index,a.length,a.newIdx,o.contentChanges):a.kind===8?(this._setCellOutputs(a.index,a.outputs),i.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===9?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),i.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===5?(this._changeCellLanguage(a.index,a.language),i.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===10?i.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===13?this._changeCellMime(a.index,a.mime):a.kind===7?(this._changeCellMetadata(a.index,a.metadata),i.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===12&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),i.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));let s=new Map;for(let a=0;a<i.length;a++){let l=i[a],d=s.get(l.cell);if(d===void 0){let c=o.cellChanges.push({document:void 0,executionSummary:void 0,metadata:void 0,outputs:void 0,...l});s.set(l.cell,c-1)}else o.cellChanges[d]={...o.cellChanges[d],...l}}return Object.freeze(o),Object.freeze(o.cellChanges),Object.freeze(o.contentChanges),o}_validateIndex(e){return e=e|0,e<0?0:e>=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,n=e.end|0;return t<0&&(t=0),n>this._cells.length&&(n=this._cells.length),e.with({start:t,end:n})}_getCells(e){e=this._validateRange(e);let t=[];for(let n=e.start;n<e.end;n++)t.push(this._cells[n]);return t}async _save(){return this._disposed?Promise.reject(new Error("Notebook has been closed")):this._proxy.$trySaveNotebook(this.uri)}_spliceNotebookCells(e,t,n){if(this._disposed)return;let o=[],i=[],s=[];if(e.reverse().forEach(a=>{let d=a[2].map(m=>{let g=new gm(this,this._textDocumentsAndEditors,m);return t||i.push(gm.asModelAddData(m)),g}),c=new ph(a[0],a[1],[],d),u=this._cells.splice(a[0],a[1],...d);for(let m of u)s.push(m.uri),c.deletedItems.push(m.apiCell);o.push(c)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:i,removedDocuments:s}),n)for(let a of o)n.push(a.asApiEvent())}_moveCells(e,t,n,o){let i=this._cells.splice(e,t);this._cells.splice(n,0,...i);let s=[new ph(e,t,i.map(a=>a.apiCell),[]),new ph(n,0,[],i)];for(let a of s)o.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,n,o){this._cells[e].setOutputItems(t,n,o)}_changeCellLanguage(e,t){let n=this._cells[e];n.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(n.uri,t)}_changeCellMime(e,t){let n=this._cells[e];n.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}};var sc=class r{constructor(e,t,n,o,i,s,a){this.id=e;this._proxy=t;this.notebookData=n;this._visibleRanges=o;this._selections=i;this._viewColumn=s;this.viewType=a;this._visible=!1}static{this.apiEditorsToExtHost=new WeakMap}get apiEditor(){if(!this._editor){let e=this;this._editor={get notebook(){return e.notebookData.apiNotebook},get selection(){return e._selections[0]},set selection(t){this.selections=[t]},get selections(){return e._selections},set selections(t){if(!Array.isArray(t)||!t.every(Rn.isNotebookRange))throw De("selections");e._selections=t.length===0?[new Rn(0,0)]:t,e._trySetSelections(e._selections)},get visibleRanges(){return e._visibleRanges},revealRange(t,n){e._proxy.$tryRevealRange(e.id,qo.from(t),n??0)},get viewColumn(){return e._viewColumn},get replOptions(){if(e.viewType==="repl")return{appendIndex:this.notebook.cellCount-1}},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},r.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(qo.from))}_acceptViewColumn(e){this._viewColumn=e}};var fm=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==ve)return pC(this.right);let e=this;for(;e.parent!==ve&&e.parent.left!==e;)e=e.parent;return e.parent===ve?ve:e.parent}prev(){if(this.left!==ve)return zR(this.left);let e=this;for(;e.parent!==ve&&e.parent.right!==e;)e=e.parent;return e.parent===ve?ve:e.parent}detach(){this.parent=null,this.left=null,this.right=null}};var ve=new fm(null,0);ve.parent=ve;ve.left=ve;ve.right=ve;ve.color=0;function pC(r){for(;r.left!==ve;)r=r.left;return r}function zR(r){for(;r.right!==ve;)r=r.right;return r}function KR(r){return r===ve?0:r.size_left+r.piece.length+KR(r.right)}function qR(r){return r===ve?0:r.lf_left+r.piece.lineFeedCnt+qR(r.right)}function $R(){ve.parent=ve}function gh(r,e){let t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==ve&&(t.left.parent=e),t.parent=e.parent,e.parent===ve?r.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function fh(r,e){let t=e.left;e.left=t.right,t.right!==ve&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===ve?r.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function hh(r,e){let t,n;if(e.left===ve?(n=e,t=n.right):e.right===ve?(n=e,t=n.left):(n=pC(e.right),t=n.right),n===r.root){r.root=t,t.color=0,e.detach(),$R(),r.root.parent=ve;return}let o=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,mh(r,t)):(n.parent===e?t.parent=n:t.parent=n.parent,mh(r,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===r.root?r.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==ve&&(n.left.parent=n),n.right!==ve&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,mh(r,n)),e.detach(),t.parent.left===t){let s=KR(t),a=qR(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){let l=s-t.parent.size_left,d=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,Fi(r,t.parent,l,d)}}if(mh(r,t.parent),o){$R();return}let i;for(;t!==r.root&&t.color===0;)t===t.parent.left?(i=t.parent.right,i.color===1&&(i.color=0,t.parent.color=1,gh(r,t.parent),i=t.parent.right),i.left.color===0&&i.right.color===0?(i.color=1,t=t.parent):(i.right.color===0&&(i.left.color=0,i.color=1,fh(r,i),i=t.parent.right),i.color=t.parent.color,t.parent.color=0,i.right.color=0,gh(r,t.parent),t=r.root)):(i=t.parent.left,i.color===1&&(i.color=0,t.parent.color=1,fh(r,t.parent),i=t.parent.left),i.left.color===0&&i.right.color===0?(i.color=1,t=t.parent):(i.left.color===0&&(i.right.color=0,i.color=1,gh(r,i),i=t.parent.left),i.color=t.parent.color,t.parent.color=0,i.left.color=0,fh(r,t.parent),t=r.root));t.color=0,$R()}function GR(r,e){for(mh(r,e);e!==r.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){let t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,gh(r,e)),e.parent.color=0,e.parent.parent.color=1,fh(r,e.parent.parent))}else{let t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,fh(r,e)),e.parent.color=0,e.parent.parent.color=1,gh(r,e.parent.parent))}r.root.color=0}function Fi(r,e,t,n){for(;e!==r.root&&e!==ve;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function mh(r,e){let t=0,n=0;if(e!==r.root){for(;e!==r.root&&e===e.parent.right;)e=e.parent;if(e!==r.root)for(e=e.parent,t=KR(e.left)-e.size_left,n=qR(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==r.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}var zs=65535;function EU(r){let e;return r[r.length-1]<65536?e=new Uint16Array(r.length):e=new Uint32Array(r.length),e.set(r,0),e}var jR=class{constructor(e,t,n,o,i){this.lineStarts=e;this.cr=t;this.lf=n;this.crlf=o;this.isBasicASCII=i}};function Hi(r,e=!0){let t=[0],n=1;for(let o=0,i=r.length;o<i;o++){let s=r.charCodeAt(o);s===13?o+1<i&&r.charCodeAt(o+1)===10?(t[n++]=o+2,o++):t[n++]=o+1:s===10&&(t[n++]=o+1)}return e?EU(t):t}function wU(r,e){r.length=0,r[0]=0;let t=1,n=0,o=0,i=0,s=!0;for(let l=0,d=e.length;l<d;l++){let c=e.charCodeAt(l);c===13?l+1<d&&e.charCodeAt(l+1)===10?(i++,r[t++]=l+2,l++):(n++,r[t++]=l+1):c===10?(o++,r[t++]=l+1):s&&c!==9&&(c<32||c>126)&&(s=!1)}let a=new jR(EU(r),n,o,i,s);return r.length=0,a}var Jn=class{constructor(e,t,n,o,i){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=o,this.length=i}},Vi=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},QR=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==ve&&e.iterate(e.root,n=>(n!==ve&&this._pieces.push(n.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},JR=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,n=this._cache;for(let o=0;o<n.length;o++){let i=n[o];if(i.node.parent===null||i.nodeStartOffset>=e){n[o]=null,t=!0;continue}}if(t){let o=[];for(let i of n)i!==null&&o.push(i);this._cache=o}}},mC=class{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new Vi("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=ve,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let o=null;for(let i=0,s=e.length;i<s;i++)if(e[i].buffer.length>0){e[i].lineStarts||(e[i].lineStarts=Hi(e[i].buffer));let a=new Jn(i+1,{line:0,column:0},{line:e[i].lineStarts.length-1,column:e[i].buffer.length-e[i].lineStarts[e[i].lineStarts.length-1]},e[i].lineStarts.length-1,e[i].buffer.length);this._buffers.push(e[i]),o=this.rbInsertRight(o,a)}this._searchCache=new JR(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=zs,n=t-Math.floor(t/3),o=n*2,i="",s=0,a=[];if(this.iterate(this.root,l=>{let d=this.getNodeContent(l),c=d.length;if(s<=n||s+c<o)return i+=d,s+=c,!0;let u=i.replace(/\r\n|\r|\n/g,e);return a.push(new Vi(u,Hi(u))),i=d,s=c,!0}),s>0){let l=i.replace(/\r\n|\r|\n/g,e);a.push(new Vi(l,Hi(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new QR(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,o=>{if(o===ve)return!0;let i=this.getNodeContent(o),s=i.length,a=e.nodeAt(t),l=e.nodeAt(t+s),d=e.getValueInRange2(a,l);return t+=s,i===d})}getOffsetAt(e,t){let n=0,o=this.root;for(;o!==ve;)if(o.left!==ve&&o.lf_left+1>=e)o=o.left;else if(o.lf_left+o.piece.lineFeedCnt+1>=e){n+=o.size_left;let i=this.getAccumulatedValue(o,e-o.lf_left-2);return n+=i+t-1}else e-=o.lf_left+o.piece.lineFeedCnt,n+=o.size_left+o.piece.length,o=o.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0,o=e;for(;t!==ve;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,i.index===0){let s=this.getOffsetAt(n+1,1),a=o-s;return new sn(n+1,a+1)}return new sn(n+1,i.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===ve){let i=this.getOffsetAt(n+1,1),s=o-e-i;return new sn(n+1,s+1)}else t=t.right;return new sn(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let n=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,o);return t?t!==this._EOL||!this._EOLNormalized?i.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i}getValueInRange2(e,t){if(e.node===t.node){let a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,d=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(d+e.remainder,d+t.remainder)}let n=e.node,o=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start),s=o.substring(i+e.remainder,i+n.piece.length);for(n=n.next();n!==ve;){let a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){let e=[],t=0,n="",o=!1;return this.iterate(this.root,i=>{if(i===ve)return!0;let s=i.piece,a=s.length;if(a===0)return!0;let l=this._buffers[s.bufferIndex].buffer,d=this._buffers[s.bufferIndex].lineStarts,c=s.start.line,u=s.end.line,m=d[c]+s.start.column;if(o&&(l.charCodeAt(m)===10&&(m++,a--),e[t++]=n,n="",o=!1,a===0))return!0;if(c===u)return!this._EOLNormalized&&l.charCodeAt(m+a-1)===13?(o=!0,n+=l.substr(m,a-1)):n+=l.substr(m,a),!0;n+=this._EOLNormalized?l.substring(m,Math.max(m,d[c+1]-this._EOLLength)):l.substring(m,d[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let g=c+1;g<u;g++)n=this._EOLNormalized?l.substring(d[g],d[g+1]-this._EOLLength):l.substring(d[g],d[g+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;return!this._EOLNormalized&&l.charCodeAt(d[u]+s.end.column-1)===13?(o=!0,s.end.column===0?t--:n=l.substr(d[u],s.end.column-1)):n=l.substr(d[u],s.end.column),!0}),o&&(e[t++]=n,n=""),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let n=this._buffers[t.piece.bufferIndex],o=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(o)}else{let t=this._buffers[e.node.piece.bufferIndex],o=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(o)}}getLineCharCode(e,t){let n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getCharCode(e){let t=this.nodeAt(e);return this._getCharCode(t)}getNearestChunk(e){let t=this.nodeAt(e);if(t.remainder===t.node.piece.length){let n=t.node.next();if(!n||n===ve)return"";let o=this._buffers[n.piece.bufferIndex],i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o.buffer.substring(i,i+n.piece.length)}else{let n=this._buffers[t.node.piece.bufferIndex],o=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),i=o+t.remainder,s=o+t.node.piece.length;return n.buffer.substring(i,s)}}findMatchesInNode(e,t,n,o,i,s,a,l,d,c,u){let m=this._buffers[e.piece.bufferIndex],g=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),v=this.offsetInBuffer(e.piece.bufferIndex,i),h=this.offsetInBuffer(e.piece.bufferIndex,s),x,S={line:0,column:0},T,P;t._wordSeparators?(T=m.buffer.substring(v,h),P=L=>L+v,t.reset(0)):(T=m.buffer,P=L=>L,t.reset(v));do if(x=t.next(T),x){if(P(x.index)>=h)return c;this.positionInBuffer(e,P(x.index)-g,S);let L=this.getLineFeedCnt(e.piece.bufferIndex,i,S),Y=S.line===i.line?S.column-i.column+o:S.column+1,G=Y+x[0].length;if(u[c++]=iD(new Oe(n+L,Y,n+L,G),x,l),P(x.index)+x[0].length>=h||c>=d)return c}while(x);return c}findMatchesLineByLine(e,t,n,o){let i=[],s=0,a=new gx(t.wordSeparators,t.regex),l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];let d=this.nodeAt2(e.endLineNumber,e.endColumn);if(d===null)return[];let c=this.positionInBuffer(l.node,l.remainder),u=this.positionInBuffer(d.node,d.remainder);if(l.node===d.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,c,u,t,n,o,s,i),i;let m=e.startLineNumber,g=l.node;for(;g!==d.node;){let h=this.getLineFeedCnt(g.piece.bufferIndex,c,g.piece.end);if(h>=1){let S=this._buffers[g.piece.bufferIndex].lineStarts,T=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),P=S[c.line+h],L=m===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(g,a,m,L,c,this.positionInBuffer(g,P-T),t,n,o,s,i),s>=o)return i;m+=h}let x=m===e.startLineNumber?e.startColumn-1:0;if(m===e.endLineNumber){let S=this.getLineContent(m).substring(x,e.endColumn-1);return s=this._findMatchesInLine(t,a,S,e.endLineNumber,x,s,i,n,o),i}if(s=this._findMatchesInLine(t,a,this.getLineContent(m).substr(x),m,x,s,i,n,o),s>=o)return i;m++,l=this.nodeAt2(m,1),g=l.node,c=this.positionInBuffer(l.node,l.remainder)}if(m===e.endLineNumber){let h=m===e.startLineNumber?e.startColumn-1:0,x=this.getLineContent(m).substring(h,e.endColumn-1);return s=this._findMatchesInLine(t,a,x,e.endLineNumber,h,s,i,n,o),i}let v=m===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(d.node,a,m,v,c,u,t,n,o,s,i),i}_findMatchesInLine(e,t,n,o,i,s,a,l,d){let c=e.wordSeparators;if(!l&&e.simpleSearch){let m=e.simpleSearch,g=m.length,v=n.length,h=-g;for(;(h=n.indexOf(m,h+g))!==-1;)if((!c||sD(c,n,v,h,g))&&(a[s++]=new Xl(new Oe(o,h+1+i,o,h+1+g+i),null),s>=d))return s;return s}let u;t.reset(0);do if(u=t.next(n),u&&(a[s++]=iD(new Oe(o,u.index+1+i,o,u.index+1+u[0].length+i),u,l),s>=d))return s;while(u);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==ve){let{node:o,remainder:i,nodeStartOffset:s}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,d=this.positionInBuffer(o,i);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.length<zs){this.appendToNode(o,t),this.computeBufferMetadata();return}if(s===e)this.insertContentToNodeLeft(t,o),this._searchCache.validate(e);else if(s+o.piece.length>e){let c=[],u=new Jn(a.bufferIndex,d,a.end,this.getLineFeedCnt(a.bufferIndex,d,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,d));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(o,i)===10){let h={line:u.start.line+1,column:0};u=new Jn(u.bufferIndex,h,u.end,this.getLineFeedCnt(u.bufferIndex,h,u.end),u.length-1),t+=`
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(o,i-1)===13){let h=this.positionInBuffer(o,i-1);this.deleteNodeTail(o,h),t="\r"+t,o.piece.length===0&&c.push(o)}else this.deleteNodeTail(o,d);else this.deleteNodeTail(o,d);let m=this.createNewPieces(t);u.length>0&&this.rbInsertRight(o,u);let g=o;for(let v=0;v<m.length;v++)g=this.rbInsertRight(g,m[v]);this.deleteNodes(c)}else this.insertContentToNodeRight(t,o)}else{let o=this.createNewPieces(t),i=this.rbInsertLeft(null,o[0]);for(let s=1;s<o.length;s++)i=this.rbInsertRight(i,o[s])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ve)return;let n=this.nodeAt(e),o=this.nodeAt(e+t),i=n.node,s=o.node;if(i===s){let m=this.positionInBuffer(i,n.remainder),g=this.positionInBuffer(i,o.remainder);if(n.nodeStartOffset===e){if(t===i.piece.length){let v=i.next();hh(this,i),this.validateCRLFWithPrevNode(v),this.computeBufferMetadata();return}this.deleteNodeHead(i,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(i),this.computeBufferMetadata();return}if(n.nodeStartOffset+i.piece.length===e+t){this.deleteNodeTail(i,m),this.validateCRLFWithNextNode(i),this.computeBufferMetadata();return}this.shrinkNode(i,m,g),this.computeBufferMetadata();return}let a=[],l=this.positionInBuffer(i,n.remainder);this.deleteNodeTail(i,l),this._searchCache.validate(e),i.piece.length===0&&a.push(i);let d=this.positionInBuffer(s,o.remainder);this.deleteNodeHead(s,d),s.piece.length===0&&a.push(s);let c=i.next();for(let m=c;m!==ve&&m!==s;m=m.next())a.push(m);let u=i.piece.length===0?i.prev():i;this.deleteNodes(a),this.validateCRLFWithNextNode(u),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let s=t.piece,a={line:s.start.line+1,column:0},l=new Jn(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),s.length-1);t.piece=l,e+=`
`,Fi(this,t,-1,-1),t.piece.length===0&&n.push(t)}let o=this.createNewPieces(e),i=this.rbInsertLeft(t,o[o.length-1]);for(let s=o.length-2;s>=0;s--)i=this.rbInsertLeft(i,o[s]);this.validateCRLFWithPrevNode(i),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);let n=this.createNewPieces(e),o=this.rbInsertRight(t,n[0]),i=o;for(let s=1;s<n.length;s++)i=this.rbInsertRight(i,n[s]);this.validateCRLFWithPrevNode(o)}positionInBuffer(e,t,n){let o=e.piece,i=e.piece.bufferIndex,s=this._buffers[i].lineStarts,l=s[o.start.line]+o.start.column+t,d=o.start.line,c=o.end.line,u=0,m=0,g=0;for(;d<=c&&(u=d+(c-d)/2|0,g=s[u],u!==c);)if(m=s[u+1],l<g)c=u-1;else if(l>=m)d=u+1;else break;return n?(n.line=u,n.column=l-g,null):{line:u,column:l-g}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;let o=this._buffers[e].lineStarts;if(n.line===o.length-1)return n.line-t.line;let i=o[n.line+1],s=o[n.line]+n.column;if(i>s+1)return n.line-t.line;let a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)hh(this,e[t])}createNewPieces(e){if(e.length>zs){let c=[];for(;e.length>zs;){let m=e.charCodeAt(zs-1),g;m===13||m>=55296&&m<=56319?(g=e.substring(0,zs-1),e=e.substring(zs-1)):(g=e.substring(0,zs),e=e.substring(zs));let v=Hi(g);c.push(new Jn(this._buffers.length,{line:0,column:0},{line:v.length-1,column:g.length-v[v.length-1]},v.length-1,g.length)),this._buffers.push(new Vi(g,v))}let u=Hi(e);return c.push(new Jn(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new Vi(e,u)),c}let t=this._buffers[0].buffer.length,n=Hi(e,!1),o=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},o=this._lastChangeBufferPos;for(let c=0;c<n.length;c++)n[c]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let c=0;c<n.length;c++)n[c]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}let i=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,a=i-this._buffers[0].lineStarts[s],l={line:s,column:a},d=new Jn(0,o,l,this.getLineFeedCnt(0,o,l),i-t);return this._lastChangeBufferPos=l,[d]}getLinesRawContent(){return this.getContentOfSubTree(this.root)}getLineRawContent(e,t=0){let n=this.root,o="",i=this._searchCache.get2(e);if(i){n=i.node;let s=this.getAccumulatedValue(n,e-i.nodeStartLineNumber-1),a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(i.nodeStartLineNumber+n.piece.lineFeedCnt===e)o=a.substring(l+s,l+n.piece.length);else{let d=this.getAccumulatedValue(n,e-i.nodeStartLineNumber);return a.substring(l+s,l+d-t)}}else{let s=0,a=e;for(;n!==ve;)if(n.left!==ve&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let l=this.getAccumulatedValue(n,e-n.lf_left-2),d=this.getAccumulatedValue(n,e-n.lf_left-1),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),c.substring(u+l,u+d-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let l=this.getAccumulatedValue(n,e-n.lf_left-2),d=this._buffers[n.piece.bufferIndex].buffer,c=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o=d.substring(c+l,c+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==ve;){let s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){let a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o+=s.substring(l,l+a-t),o}else{let a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o+=s.substr(a,n.piece.length)}n=n.next()}return o}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==ve;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){let n=e.piece,o=this.positionInBuffer(e,t),i=o.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){let s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,o);if(s!==i)return{index:s,remainder:0}}return{index:i,remainder:o.column}}getAccumulatedValue(e,t){if(t<0)return 0;let n=e.piece,o=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?o[n.end.line]+n.end.column-o[n.start.line]-n.start.column:o[i]-o[n.start.line]-n.start.column}deleteNodeTail(e,t){let n=e.piece,o=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),d=l-o,c=a-i,u=n.length+c;e.piece=new Jn(n.bufferIndex,n.start,s,l,u),Fi(this,e,c,d)}deleteNodeHead(e,t){let n=e.piece,o=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),d=a-o,c=i-l,u=n.length+c;e.piece=new Jn(n.bufferIndex,s,n.end,a,u),Fi(this,e,c,d)}shrinkNode(e,t,n){let o=e.piece,i=o.start,s=o.end,a=o.length,l=o.lineFeedCnt,d=t,c=this.getLineFeedCnt(o.bufferIndex,o.start,d),u=this.offsetInBuffer(o.bufferIndex,t)-this.offsetInBuffer(o.bufferIndex,i);e.piece=new Jn(o.bufferIndex,o.start,d,c,u),Fi(this,e,u-a,c-l);let m=new Jn(o.bufferIndex,n,s,this.getLineFeedCnt(o.bufferIndex,n,s),this.offsetInBuffer(o.bufferIndex,s)-this.offsetInBuffer(o.bufferIndex,n)),g=this.rbInsertRight(e,m);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
`);let n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),o=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let i=Hi(t,!1);for(let g=0;g<i.length;g++)i[g]+=o;if(n){let g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:o-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1));let s=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[s],l={line:s,column:a},d=e.piece.length+t.length,c=e.piece.lineFeedCnt,u=this.getLineFeedCnt(0,e.piece.start,l),m=u-c;e.piece=new Jn(e.piece.bufferIndex,e.piece.start,l,u,d),this._lastChangeBufferPos=l,Fi(this,e,t.length,m)}nodeAt(e){let t=this.root,n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let o=0;for(;t!==ve;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){o+=t.size_left;let i={node:t,remainder:e-t.size_left,nodeStartOffset:o};return this._searchCache.set(i),i}else e-=t.size_left+t.piece.length,o+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,o=0;for(;n!==ve;)if(n.left!==ve&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return o+=n.size_left,{node:n,remainder:Math.min(i+t-1,s),nodeStartOffset:o}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2);if(i+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:o};t-=n.piece.length-i;break}else e-=n.lf_left+n.piece.lineFeedCnt,o+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==ve;){if(n.piece.lineFeedCnt>0){let i=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,i),nodeStartOffset:s}}else if(n.piece.length>=t-1){let i=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:i}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let n=this._buffers[e.piece.bufferIndex],o=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(o)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===ve||e.piece.lineFeedCnt===0)return!1;let t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,o=t.start.line,i=n[o]+t.start.column;return o===n.length-1||n[o+1]>i+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(i)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===ve||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let n=[],o=this._buffers[e.piece.bufferIndex].lineStarts,i;e.piece.end.column===0?i={line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:i={line:e.piece.end.line,column:e.piece.end.column-1};let s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Jn(e.piece.bufferIndex,e.piece.start,i,a,s),Fi(this,e,-1,-1),e.piece.length===0&&n.push(e);let l={line:t.piece.start.line+1,column:0},d=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Jn(t.piece.bufferIndex,l,t.piece.end,c,d),Fi(this,t,-1,-1),t.piece.length===0&&n.push(t);let u=this.createNewPieces(`\r
`);this.rbInsertRight(e,u[0]);for(let m=0;m<n.length;m++)hh(this,n[m])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let n=t.next();if(this.startWithLF(n)){if(e+=`
`,n.piece.length===1)hh(this,n);else{let o=n.piece,i={line:o.start.line+1,column:0},s=o.length-1,a=this.getLineFeedCnt(o.bufferIndex,i,o.end);n.piece=new Jn(o.bufferIndex,i,o.end,a,s),Fi(this,n,-1,-1)}return!0}}return!1}iterate(e,t){if(e===ve)return t(ve);let n=this.iterate(e.left,t);return n&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===ve)return"";let t=this._buffers[e.piece.bufferIndex],n=e.piece,o=this.offsetInBuffer(n.bufferIndex,n.start),i=this.offsetInBuffer(n.bufferIndex,n.end);return t.buffer.substring(o,i)}getPieceContent(e){let t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),o=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,o)}rbInsertRight(e,t){let n=new fm(t,1);if(n.left=ve,n.right=ve,n.parent=ve,n.size_left=0,n.lf_left=0,this.root===ve)this.root=n,n.color=0;else if(e.right===ve)e.right=n,n.parent=e;else{let i=pC(e.right);i.left=n,n.parent=i}return GR(this,n),n}rbInsertLeft(e,t){let n=new fm(t,1);if(n.left=ve,n.right=ve,n.parent=ve,n.size_left=0,n.lf_left=0,this.root===ve)this.root=n,n.color=0;else if(e.left===ve)e.left=n,n.parent=e;else{let o=zR(e.left);o.right=n,n.parent=o}return GR(this,n),n}getContentOfSubTree(e){let t="";return this.iterate(e,n=>(t+=this.getNodeContent(n),!0)),t}};function gC(r){let e=0,t=0,n=0,o=0;for(let i=0,s=r.length;i<s;i++){let a=r.charCodeAt(i);a===13?(e===0&&(t=i),e++,i+1<s&&r.charCodeAt(i+1)===10?(o|=2,i++):o|=3,n=i+1):a===10&&(o|=1,e===0&&(t=i),e++,n=i+1)}return e===0&&(t=r.length),[e,t,r.length-n,o]}var XR;function N7(){return XR||(XR=new TextDecoder("UTF-16LE")),XR}function kU(r,e,t){let n=new Uint16Array(r.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?U7(r,e,t):N7().decode(n)}function U7(r,e,t){let n=[],o=0;for(let i=0;i<t;i++){let s=Q1(r,e);e+=2,n[o++]=String.fromCharCode(s)}return n.join("")}function fC(r){return r.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var hC=class r{constructor(e,t,n,o){this.oldPosition=e;this.oldText=t;this.newPosition=n;this.newText=o}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${fC(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${fC(this.oldText)}")`:`(replace@${this.oldPosition} "${fC(this.oldText)}" with "${fC(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){let o=t.length;Nm(e,o,n),n+=4;for(let i=0;i<o;i++)J1(e,t.charCodeAt(i),n),n+=2;return n}static _readString(e,t){let n=Om(e,t);return t+=4,kU(e,t,n)}writeSize(){return 8+r._writeStringSize(this.oldText)+r._writeStringSize(this.newText)}write(e,t){return Nm(e,this.oldPosition,t),t+=4,Nm(e,this.newPosition,t),t+=4,t=r._writeString(e,this.oldText,t),t=r._writeString(e,this.newText,t),t}static read(e,t,n){let o=Om(e,t);t+=4;let i=Om(e,t);t+=4;let s=r._readString(e,t);t+=r._writeStringSize(s);let a=r._readString(e,t);return t+=r._writeStringSize(a),n.push(new r(o,s,i,a)),t}};var vC=class r extends H{constructor(t,n,o,i,s,a,l){super();this._onDidChangeContent=this._register(new E);this._BOM=n,this._mightContainNonBasicASCII=!a,this._mightContainRTL=i,this._mightContainUnusualLineTerminators=s,this._pieceTree=new mC(t,o,l)}get onDidChangeContent(){return this._onDidChangeContent.event}equals(t){return!(t instanceof r)||this._BOM!==t._BOM||this.getEOL()!==t.getEOL()?!1:this._pieceTree.equal(t._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(t){return this._pieceTree.createSnapshot(t?this._BOM:"")}getOffsetAt(t,n){return this._pieceTree.getOffsetAt(t,n)}getPositionAt(t){return this._pieceTree.getPositionAt(t)}getRangeAt(t,n){let o=t+n,i=this.getPositionAt(t),s=this.getPositionAt(o);return new Oe(i.lineNumber,i.column,s.lineNumber,s.column)}getValueInRange(t,n=0){if(t.isEmpty())return"";let o=this._getEndOfLine(n);return this._pieceTree.getValueInRange(t,o)}getValueLengthInRange(t,n=0){if(t.isEmpty())return 0;if(t.startLineNumber===t.endLineNumber)return t.endColumn-t.startColumn;let o=this.getOffsetAt(t.startLineNumber,t.startColumn),i=this.getOffsetAt(t.endLineNumber,t.endColumn),s=0,a=this._getEndOfLine(n),l=this.getEOL();if(a.length!==l.length){let d=a.length-l.length,c=t.endLineNumber-t.startLineNumber;s=d*c}return i-o+s}getCharacterCountInRange(t,n=0){if(this._mightContainNonBasicASCII){let o=0,i=t.startLineNumber,s=t.endLineNumber;for(let a=i;a<=s;a++){let l=this.getLineContent(a),d=a===i?t.startColumn-1:0,c=a===s?t.endColumn-1:l.length;for(let u=d;u<c;u++)Vl(l.charCodeAt(u))?(o=o+1,u=u+1):o=o+1}return o+=this._getEndOfLine(n).length*(s-i),o}return this.getValueLengthInRange(t,n)}getNearestChunk(t){return this._pieceTree.getNearestChunk(t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(t){return this._pieceTree.getLineContent(t)}getLineCharCode(t,n){return this._pieceTree.getLineCharCode(t,n)}getCharCode(t){return this._pieceTree.getCharCode(t)}getLineLength(t){return this._pieceTree.getLineLength(t)}getLineMinColumn(t){return 1}getLineMaxColumn(t){return this.getLineLength(t)+1}getLineFirstNonWhitespaceColumn(t){let n=Jh(this.getLineContent(t));return n===-1?0:n+1}getLineLastNonWhitespaceColumn(t){let n=F0(this.getLineContent(t));return n===-1?0:n+2}_getEndOfLine(t){switch(t){case 1:return`
`;case 2:return`\r
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(t){this._pieceTree.setEOL(t)}applyEdits(t,n,o){let i=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,a=this._mightContainNonBasicASCII,l=!0,d=[];for(let x=0;x<t.length;x++){let S=t[x];l&&S._isTracked&&(l=!1);let T=S.range;if(S.text){let z=!0;a||(z=!B0(S.text),a=z),!i&&z&&(i=ev(S.text)),!s&&z&&(s=tv(S.text))}let P="",L=0,Y=0,G=0;if(S.text){let z;[L,Y,G,z]=gC(S.text);let K=this.getEOL(),Q=K===`\r
`?2:1;z===0||z===Q?P=S.text:P=S.text.replace(/\r\n|\r|\n/g,K)}d[x]={sortIndex:x,identifier:S.identifier||null,range:T,rangeOffset:this.getOffsetAt(T.startLineNumber,T.startColumn),rangeLength:this.getValueLengthInRange(T),text:P,eolCount:L,firstLineLength:Y,lastLineLength:G,forceMoveMarkers:!!S.forceMoveMarkers,isAutoWhitespaceEdit:S.isAutoWhitespaceEdit||!1}}d.sort(r._sortOpsAscending);let c=!1;for(let x=0,S=d.length-1;x<S;x++){let T=d[x].range.getEndPosition(),P=d[x+1].range.getStartPosition();if(P.isBeforeOrEqual(T)){if(P.isBefore(T))throw new Error("Overlapping ranges are not allowed!");c=!0}}l&&(d=this._reduceOperations(d));let u=o||n?r._getInverseEditRanges(d):[],m=[];if(n)for(let x=0;x<d.length;x++){let S=d[x],T=u[x];if(S.isAutoWhitespaceEdit&&S.range.isEmpty())for(let P=T.startLineNumber;P<=T.endLineNumber;P++){let L="";P===T.startLineNumber&&(L=this.getLineContent(S.range.startLineNumber),Jh(L)!==-1)||m.push({lineNumber:P,oldContent:L})}}let g=null;if(o){let x=0;g=[];for(let S=0;S<d.length;S++){let T=d[S],P=u[S],L=this.getValueInRange(T.range),Y=T.rangeOffset+x;x+=T.text.length-L.length,g[S]={sortIndex:T.sortIndex,identifier:T.identifier,range:P,text:L,textChange:new hC(T.rangeOffset,L,Y,T.text)}}c||g.sort((S,T)=>S.sortIndex-T.sortIndex)}this._mightContainRTL=i,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=a;let v=this._doApplyEdits(d),h=null;if(n&&m.length>0){m.sort((x,S)=>S.lineNumber-x.lineNumber),h=[];for(let x=0,S=m.length;x<S;x++){let T=m[x].lineNumber;if(x>0&&m[x-1].lineNumber===T)continue;let P=m[x].oldContent,L=this.getLineContent(T);L.length===0||L===P||Jh(L)!==-1||h.push(T)}}return this._onDidChangeContent.fire(),new Xv(g,v,h)}_reduceOperations(t){return t.length<1e3?t:[this._toSingleEditOperation(t)]}_toSingleEditOperation(t){let n=!1,o=t[0].range,i=t[t.length-1].range,s=new Oe(o.startLineNumber,o.startColumn,i.endLineNumber,i.endColumn),a=o.startLineNumber,l=o.startColumn,d=[];for(let v=0,h=t.length;v<h;v++){let x=t[v],S=x.range;n=n||x.forceMoveMarkers,d.push(this.getValueInRange(new Oe(a,l,S.startLineNumber,S.startColumn))),x.text.length>0&&d.push(x.text),a=S.endLineNumber,l=S.endColumn}let c=d.join(""),[u,m,g]=gC(c);return{sortIndex:0,identifier:t[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:u,firstLineLength:m,lastLineLength:g,forceMoveMarkers:n,isAutoWhitespaceEdit:!1}}_doApplyEdits(t){t.sort(r._sortOpsDescending);let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=i.range.startLineNumber,a=i.range.startColumn,l=i.range.endLineNumber,d=i.range.endColumn;if(s===l&&a===d&&i.text.length===0)continue;i.text?(this._pieceTree.delete(i.rangeOffset,i.rangeLength),this._pieceTree.insert(i.rangeOffset,i.text,!0)):this._pieceTree.delete(i.rangeOffset,i.rangeLength);let c=new Oe(s,a,l,d);n.push({range:c,rangeLength:i.rangeLength,text:i.text,rangeOffset:i.rangeOffset,forceMoveMarkers:i.forceMoveMarkers})}return n}findMatchesLineByLine(t,n,o,i){return this._pieceTree.findMatchesLineByLine(t,n,o,i)}getPieceTree(){return this._pieceTree}static _getInverseEditRange(t,n){let o=t.startLineNumber,i=t.startColumn,[s,a,l]=gC(n),d;if(n.length>0){let c=s+1;c===1?d=new Oe(o,i,o,i+a):d=new Oe(o,i,o+c-1,l+1)}else d=new Oe(o,i,o,i);return d}static _getInverseEditRanges(t){let n=[],o=0,i=0,s=null;for(let a=0,l=t.length;a<l;a++){let d=t[a],c,u;s?s.range.endLineNumber===d.range.startLineNumber?(c=o,u=i+(d.range.startColumn-s.range.endColumn)):(c=o+(d.range.startLineNumber-s.range.endLineNumber),u=d.range.startColumn):(c=d.range.startLineNumber,u=d.range.startColumn);let m;if(d.text.length>0){let g=d.eolCount+1;g===1?m=new Oe(c,u,c,u+d.firstLineLength):m=new Oe(c,u,c+g-1,d.lastLineLength+1)}else m=new Oe(c,u,c,u);o=m.endLineNumber,i=m.endColumn,n.push(m),s=d}return n}static _sortOpsAscending(t,n){let o=Oe.compareRangesUsingEnds(t.range,n.range);return o===0?t.sortIndex-n.sortIndex:o}static _sortOpsDescending(t,n){let o=Oe.compareRangesUsingEnds(t.range,n.range);return o===0?n.sortIndex-t.sortIndex:-o}};var YR=class{constructor(e,t,n,o,i,s,a,l,d){this._chunks=e;this._bom=t;this._cr=n;this._lf=o;this._crlf=i;this._containsRTL=s;this._containsUnusualLineTerminators=a;this._isBasicASCII=l;this._normalizeEOL=d}_getEOL(e){let t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?`
`:`\r
`:n>t/2?`\r
`:`
`}create(e){let t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let i=0,s=n.length;i<s;i++){let a=n[i].buffer.replace(/\r\n|\r|\n/g,t),l=Hi(a);n[i]=new Vi(a,l)}let o=new vC(n,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:o,disposable:o}}getFirstLineText(e){return this._chunks[0].buffer.substr(0,e).split(/\r\n|\r|\n/)[0]}},vh=class{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&$0(e)&&(this.BOM=W0,e=e.substr(1));let t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){let t=wU(this._tmpLineStarts,e);this.chunks.push(new Vi(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=ev(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=tv(e)))}finish(e=!0){return this._finish(),new YR(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=Hi(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}};var bC=class extends H{constructor(t,n,o){super();this._source=t;this._inputTextBuffer=n;this._outputs=o;this._outputTextBuffers=void 0}_getFullModelRange(t){let n=t.getLineCount();return new Oe(1,1,n,this._getLineMaxColumn(t,n))}_getLineMaxColumn(t,n){if(n<1||n>t.getLineCount())throw new Error("Illegal value for lineNumber");return t.getLineLength(n)+1}get inputTextBuffer(){if(!this._inputTextBuffer){let t=new vh;t.acceptChunk(this._source);let n=t.finish(!0),{textBuffer:o,disposable:i}=n.create(1);this._inputTextBuffer=o,this._register(i)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(t=>{let n=new vh;n.acceptChunk(t);let o=n.finish(!0),{textBuffer:i,disposable:s}=o.create(1);return this._register(s),i})),this._outputTextBuffers}findInInputs(t){let o=new Hf(t,!1,!1,null).parseSearchRequest();if(!o)return[];let i=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(i,o,!0,5e3)}findInOutputs(t){let o=new Hf(t,!1,!1,null).parseSearchRequest();return o?this.outputTextBuffers.map(i=>{let s=i.findMatchesLineByLine(this._getFullModelRange(i),o,!0,5e3);if(s.length!==0)return{textBuffer:i,matches:s}}).filter(i=>!!i):[]}};function ZR(r,e){let t=-1,n=[],o=[];return r.forEach(s=>{s.range.startLineNumber!==t&&o.length>0&&(n.push([...o]),o=[]),o.push(s),t=s.range.endLineNumber}),o.length>0&&n.push([...o]),n.map(s=>{let a=[],l=s[0].range.startLineNumber,d=s[s.length-1].range.endLineNumber;for(let c=l;c<=d;c++)a.push(e.getLineContent(c));return new zI(a.join(`
`)+`
`,s.map(c=>new Oe(c.range.startLineNumber-1,c.range.startColumn-1,c.range.endLineNumber-1,c.range.endColumn-1)))})}var L6e=Object.freeze({id:"application",order:100,title:p(4476,null),type:"object"}),_U=Object.freeze({id:"workbench",order:7,title:p(4484,null),type:"object"}),H7=Object.freeze({id:"security",scope:1,title:p(4482,null),type:"object",order:7}),O6e=Object.freeze({id:"problems",title:p(4478,null),type:"object",order:101}),V7=Object.freeze({id:"window",order:8,title:p(4483,null),type:"object"}),B7={ConfigurationMigration:"base.contributions.configuration.migration"},e1=class{constructor(){this.migrations=[];this._onDidRegisterConfigurationMigrations=new E;this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}},SC=new e1;ot.add(B7.ConfigurationMigration,SC);var yC=class extends H{constructor(t,n){super();this.configurationService=t;this.workspaceService=n;this._register(this.workspaceService.onDidChangeWorkspaceFolders(async o=>{for(let i of o.added)await this.migrateConfigurationsForFolder(i,SC.migrations)})),this.migrateConfigurations(SC.migrations),this._register(SC.onDidRegisterConfigurationMigration(o=>this.migrateConfigurations(o)))}static{this.ID="workbench.contrib.configurationMigration"}async migrateConfigurations(t){await this.migrateConfigurationsForFolder(void 0,t);for(let n of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(n,t)}async migrateConfigurationsForFolder(t,n){await Promise.all([n.map(o=>this.migrateConfigurationsForFolderAndOverride(o,t?.uri))])}async migrateConfigurationsForFolderAndOverride(t,n){let o=this.configurationService.inspect(t.key,{resource:n}),i=this.workspaceService.getWorkbenchState()===3?[["user",2],["userLocal",3],["userRemote",4],["workspace",5],["workspaceFolder",6]]:[["user",2],["userLocal",3],["userRemote",4],["workspace",5]];for(let[s,a]of i){let l=o[s];if(!l)continue;let d=[];if(l.value!==void 0){let c=await this.runMigration(t,s,l.value,n,void 0);for(let u of c??[])d.push([u,[]])}for(let{identifiers:c,value:u}of l.overrides??[])if(u!==void 0){let m=await this.runMigration(t,s,u,n,c);for(let g of m??[])d.push([g,c])}d.length&&await Promise.allSettled(d.map(async([[c,u],m])=>this.configurationService.updateValue(c,u.value,{resource:n,overrideIdentifiers:m},a)))}}async runMigration(t,n,o,i,s){let a=d=>{let u=this.configurationService.inspect(d,{resource:i})[n];if(u)return s?u.overrides?.find(({identifiers:m})=>Wt(m,s))?.value:u.value},l=await t.migrateFn(o,a);return Array.isArray(l)?l:[[t.key,l]]}};yC=D([C(0,oo),C(1,pa)],yC);var IC=class extends H{constructor(t){super();this.remoteAgentService=t;this._ready=new _n;this.ready=this._ready.p;this.create()}static{this.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration"}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Ct&&(await this.remoteAgentService.getEnvironment())?.os!==1)return;ot.as(ko.Configuration).registerConfiguration({...H7,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:p(4480,null)},default:[],markdownDescription:p(4479,null),scope:3},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:p(4481,null),scope:3}}})}};IC=D([C(0,fx)],IC);var bh="window.newWindowProfile",xC=class extends H{constructor(t,n){super();this.userDataProfilesService=t;this.configurationService=n;this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(o=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(n.onDidChangeConfiguration(o=>{o.source!==7&&o.affectsConfiguration(bh)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}static{this.ID="workbench.contrib.dynamicWindowConfiguration"}registerNewWindowProfileConfiguration(){let t=ot.as(ko.Configuration),n={...V7,properties:{[bh]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(o=>o.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(()=>""),p(4475,null)],description:p(4477,null),scope:1}}};this.configurationNode?t.updateConfigurations({add:[n],remove:[this.configurationNode]}):t.registerConfiguration(n),this.configurationNode=n}setNewWindowProfile(){let t=this.configurationService.getValue(bh);this.newWindowProfile=t?this.userDataProfilesService.profiles.find(n=>n.name===t):void 0}checkAndResetNewWindowProfileConfig(){let t=this.configurationService.getValue(bh);if(!t)return;let n=this.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.id===this.newWindowProfile.id):void 0;t!==n?.name&&this.configurationService.updateValue(bh,n?.name)}};xC=D([C(0,uL),C(1,oo)],xC);var j6e=M("editorResolverService");var W7=ot.as(ko.Configuration),$7={..._U,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:p(20017,null),additionalProperties:{type:"string"}}}};W7.registerConfiguration($7);function PU(r,e){if(new Set([$.extension,$.webviewPanel,$.vscodeWorkspaceTrust,$.vscodeSettings]).has(e.scheme))return!1;let o=typeof r=="string"&&r.indexOf(Le.sep)>=0?`${e.scheme}:${e.path}`:Bt(e);return Vr(r,o,{ignoreCase:!0})}var CC=class r{constructor(e,t,n,o,i,s,a){this._textDocumentsAndEditors=n;this._textDocuments=o;this._extHostFileSystem=i;this._extHostSearch=s;this._logService=a;this._notebookStatusBarItemProviders=new Map;this._documents=new qe;this._editors=new Map;this._onDidChangeActiveNotebookEditor=new E;this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event;this._visibleNotebookEditors=[];this._onDidOpenNotebookDocument=new E;this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event;this._onDidCloseNotebookDocument=new E;this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event;this._onDidChangeVisibleNotebookEditors=new E;this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event;this._statusBarCache=new lo("NotebookCellStatusBarCache");this._handlePool=0;this._notebookSerializer=new Map;this._notebookProxy=e.getProxy(N.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(N.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(N.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:l=>{if(l&&l.$mid===13){let d=l.notebookEditor?.notebookUri,c=l.cell.handle,m=this._documents.get(d)?.getCell(c);if(m)return m.apiCell}if(l&&l.$mid===14){let d=l.uri,c=this._documents.get(d);if(c)return c.apiNotebook}return l}}),r._registerApiCommands(t)}static{this._notebookStatusBarItemProviderHandlePool=0}get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}getEditorById(e){let t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(let[t,n]of this._editors)if(n.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){let n=this._documents.get(e);if(!n&&!t)throw new Error(`NO notebook document for '${e}'`);return n}static _convertNotebookRegistrationData(e,t){if(!t)return;let n=t.filenamePattern.map(o=>bf.from(o)).filter(o=>o!==void 0);if(t.filenamePattern&&!n){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:n,priority:t.exclusive?"exclusive":void 0}}registerNotebookCellStatusBarItemProvider(e,t,n){let o=r._notebookStatusBarItemProviderHandlePool++,i=typeof n.onDidChangeCellStatusBarItems=="function"?r._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(o,n),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(o,i,t);let s;return i!==void 0&&(s=n.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(i))),new fe(()=>{this._notebookStatusBarItemProviders.delete(o),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(o,i),s?.dispose()})}async createNotebookDocument(e){let t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&ol.from(e.content)});return y.revive(t)}async openNotebookDocument(e){let t=this._documents.get(e);if(t)return t.apiNotebook;let n=await this._notebookDocumentsProxy.$tryOpenNotebook(e),o=this._documents.get(y.revive(n));return Tr(o?.apiNotebook)}async showNotebookDocument(e,t){let n;typeof t=="object"?n={position:_t.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(qo.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0,label:typeof t.asRepl=="string"?t.asRepl:typeof t.asRepl=="object"?t.asRepl.label:void 0}:n={preserveFocus:!1,pinned:!0};let o=t?.asRepl?"repl":e.notebookType,i=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,o,n),s=i&&this._editors.get(i)?.apiEditor;if(s)return s;throw i?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,n,o){let i=this._notebookStatusBarItemProviders.get(e),s=y.revive(t),a=this._documents.get(s);if(!a||!i)return;let l=a.getCellFromIndex(n);if(!l)return;let d=await i.provideCellStatusBarItems(l.apiCell,o);if(!d)return;let c=new q,u=this._statusBarCache.add([c]),g=(Array.isArray(d)?d:[d]).map(v=>nP.from(v,this._commandsConverter,c));return{cacheId:u,items:g}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,n,o,i){if(di(t))throw new Error("viewType cannot be empty or just whitespace");let s=this._handlePool++;return this._notebookSerializer.set(s,{viewType:t,serializer:n,options:o}),this._notebookProxy.$registerNotebookSerializer(s,{id:e.identifier,location:e.extensionLocation},t,rP.from(o),r._convertNotebookRegistrationData(e,i)),J(()=>{this._notebookProxy.$unregisterNotebookSerializer(s)})}async $dataToNotebook(e,t,n){let o=this._notebookSerializer.get(e);if(!o)throw new Error("NO serializer found");let i=await o.serializer.deserializeNotebook(t.buffer,n);return new Pt(ol.from(i))}async $notebookToData(e,t,n){let o=this._notebookSerializer.get(e);if(!o)throw new Error("NO serializer found");let i=await o.serializer.serializeNotebook(ol.to(t.value),n);return ee.wrap(i)}async $saveNotebook(e,t,n,o,i){let s=y.revive(t),a=this._notebookSerializer.get(e);this.trace(`enter saveNotebook(versionId: ${n}, ${s.toString()})`);try{if(!a)throw new yh("NO serializer found");let l=this._documents.get(s);if(!l)throw new yh("Document NOT found");if(l.versionId!==n)throw new yh("Document version mismatch, expected: "+n+", actual: "+l.versionId);if(!this._extHostFileSystem.value.isWritableFileSystem(s.scheme))throw new ua(p(3166,null,this._resourceForError(s)),6);let d={metadata:lE(l.apiNotebook.metadata,v=>!(a.options?.transientDocumentMetadata??{})[v]),cells:[]};for(let v of l.apiNotebook.getCells()){let h=new yi(v.kind,v.document.getText(),v.document.languageId,v.mime,a.options?.transientOutputs?[]:[...v.outputs],v.metadata,v.executionSummary);h.metadata=lE(v.metadata,x=>!(a.options?.transientCellMetadata??{})[x]),d.cells.push(h)}if(await this._validateWriteFile(s,o),i.isCancellationRequested)throw new xt;let c=await a.serializer.serializeNotebook(d,i);if(i.isCancellationRequested)throw new xt;this.trace(`serialized versionId: ${n} ${s.toString()}`),await this._extHostFileSystem.value.writeFile(s,c),this.trace(`Finished write versionId: ${n} ${s.toString()}`);let u=this._extHostFileSystem.getFileSystemProviderExtUri(s.scheme),m=await this._extHostFileSystem.value.stat(s),g={name:u.basename(s),isFile:(m.type&1)!==0,isDirectory:(m.type&2)!==0,isSymbolicLink:(m.type&64)!==0,mtime:m.mtime,ctime:m.ctime,size:m.size,readonly:!!((m.permissions??0)&1)||!this._extHostFileSystem.value.isWritableFileSystem(s.scheme),locked:!!((m.permissions??0)&2),executable:!!((m.permissions??0)&4),etag:uE({mtime:m.mtime,size:m.size})};return this.trace(`exit saveNotebook(versionId: ${n}, ${s.toString()})`),g}catch(l){if(l instanceof ua)return{...l,message:l.message};throw l}}async $searchInNotebooks(e,t,n,o,i){let s=this._notebookSerializer.get(e)?.serializer;if(!s)return{limitHit:!1,results:[]};let a=new Yo;await(async(m,g,v)=>{await Promise.all(m.map(async h=>await Promise.all(h.filenamePatterns.map(x=>{let S={_reason:v._reason,folderQueries:v.folderQueries,includePattern:v.includePattern,excludePattern:v.excludePattern,maxResults:v.maxResults,type:1,filePattern:x};return this._extHostSearch.doInternalFileSearchWithCustomCallback(S,g,T=>{T.forEach(P=>{a.has(P)||o.some(Y=>h.isFromSettings&&!Y.isFromSettings?!1:Y.filenamePatterns.some(G=>PU(G,P)))||a.add(P)})}).catch(T=>{if(T.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw T})}))))})(n,i,t);let d=new qe,c=!1,u=Array.from(a).map(async m=>{let g=[];try{if(i.isCancellationRequested)return;if(t.maxResults&&[...d.values()].reduce((S,T)=>S+T.cellResults.length,0)>t.maxResults){c=!0;return}let v=[],h=this._documents.get(m);if(h)h.apiNotebook.getCells().forEach(T=>v.push({input:T.document.getText(),outputs:T.outputs.flatMap(P=>P.items.map(L=>L.data.toString()))}));else{let S=await this._extHostFileSystem.value.readFile(m),T=ee.fromString(S.toString()),P=await s.deserializeNotebook(T.buffer,i);if(i.isCancellationRequested)return;ol.from(P).cells.forEach(Y=>v.push({input:Y.source,outputs:Y.outputs.flatMap(G=>G.items.map(z=>z.valueBytes.toString()))}))}if(i.isCancellationRequested)return;v.forEach((S,T)=>{let P=t.contentPattern.pattern,L=new bC(S.input,void 0,S.outputs),Y=L.findInInputs(P),G=L.findInOutputs(P),z=G.flatMap(K=>ZR(K.matches,K.textBuffer)).map((K,Q)=>(K.webviewIndex=Q,K));if(Y.length>0||G.length>0){let K={index:T,contentResults:ZR(Y,L.inputTextBuffer),webviewResults:z};g.push(K)}});let x={resource:m,cellResults:g};d.set(m,x);return}catch{return}});return await Promise.all(u),{limitHit:c,results:[...d.values()]}}async _validateWriteFile(e,t){let n=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==TM&&typeof n.mtime=="number"&&typeof n.size=="number"&&t.mtime<n.mtime&&t.etag!==uE({mtime:t.mtime,size:n.size}))throw new ua(p(3167,null),3,t)}_resourceForError(e){return e.scheme===$.file?e.fsPath:e.toString()}_createExtHostEditor(e,t,n){if(this._editors.has(t))throw new Error(`editor with id ALREADY EXSIST: ${t}`);let o=new sc(t,this._notebookEditorsProxy,e,n.visibleRanges.map(qo.to),n.selections.map(qo.to),typeof n.viewColumn=="number"?_t.to(n.viewColumn):void 0,n.viewType);this._editors.set(t,o)}$acceptDocumentAndEditorsDelta(e){if(e.value.removedDocuments)for(let n of e.value.removedDocuments){let o=y.revive(n),i=this._documents.get(o);i&&(i.dispose(),this._documents.delete(o),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({removedDocuments:i.apiNotebook.getCells().map(s=>s.document.uri)}),this._onDidCloseNotebookDocument.fire(i.apiNotebook));for(let s of this._editors.values())s.notebookData.uri.toString()===o.toString()&&this._editors.delete(s.id)}if(e.value.addedDocuments){let n=[];for(let o of e.value.addedDocuments){let i=y.revive(o.uri);if(this._documents.has(i))throw new Error(`adding EXISTING notebook ${i} `);let s=new uC(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,i,o);n.push(...o.cells.map(a=>gm.asModelAddData(a))),this._documents.get(i)?.dispose(),this._documents.set(i,s),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:n}),this._onDidOpenNotebookDocument.fire(s.apiNotebook)}}if(e.value.addedEditors)for(let n of e.value.addedEditors){if(this._editors.has(n.id))return;let o=y.revive(n.documentUri),i=this._documents.get(o);i&&this._createExtHostEditor(i,n.id,n)}let t=[];if(e.value.removedEditors)for(let n of e.value.removedEditors){let o=this._editors.get(n);o&&(this._editors.delete(n),this._activeNotebookEditor?.id===o.id&&(this._activeNotebookEditor=void 0),t.push(o))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(o=>this._editors.get(o)).filter(o=>!!o);let n=new Set;this._visibleNotebookEditors.forEach(o=>n.add(o.id));for(let o of this._editors.values()){let i=n.has(o.id);o._acceptVisibility(i)}this._visibleNotebookEditors=[...this._editors.values()].map(o=>o).filter(o=>o.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){let t=j.String.with("notebookType","A notebook type"),n=new Te("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new j("data","Bytes to convert to data",i=>i instanceof Uint8Array,i=>ee.wrap(i))],new xe("Notebook Data",i=>ol.to(i.value))),o=new Te("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new j("NotebookData","Notebook data to convert to bytes",i=>!0,i=>new Pt(ol.from(i)))],new xe("Bytes",i=>i.buffer));e.registerApiCommand(n),e.registerApiCommand(o)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}},yh=class extends Error{constructor(e){super(e),this.name="NotebookSaveError"}};var TC=class{constructor(e,t,n,o={timeout:1500,errors:3}){this._logService=e;this._notebooksAndEditors=t;this._mainThreadBulkEdits=n;this._thresholds=o;this._onWillSaveNotebookDocumentEvent=new ri}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,n,o)=>{let i=function(a){t.call(n,a)};return i.extension=e,this._onWillSaveNotebookDocumentEvent.event(i,void 0,o)}}async $participateInSave(e,t,n){let o=y.revive(e),i=this._notebooksAndEditors.getNotebookDocument(o);if(!i)throw new Error("Unable to resolve notebook document");let s=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:i.apiNotebook,reason:ff.to(t)},n,async(l,d)=>{let c=Date.now(),u=await await Promise.resolve(l);Date.now()-c>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",d.extension.identifier),!n.isCancellationRequested&&u&&(u instanceof _o?s.push(u):this._logService.warn("onWillSaveNotebookDocument-listener from extension",d.extension.identifier,"ignored due to invalid data"))}),n.isCancellationRequested)return!1;if(s.length===0)return!0;let a={edits:[]};for(let l of s){let{edits:d}=Bn.from(l);a.edits=a.edits.concat(d)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Pt(a))}};var EC=class{constructor(e){this._notebooksAndEditors=e;this._onDidSaveNotebookDocument=new E;this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event;this._onDidChangeNotebookDocument=new E;this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,n,o){let s=this._notebooksAndEditors.getNotebookDocument(y.revive(e)).acceptModelChanged(t.value,n,o);this._onDidChangeNotebookDocument.fire(s)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(y.revive(e)).acceptDirty(t)}$acceptModelSaved(e){let t=this._notebooksAndEditors.getNotebookDocument(y.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}};var hm=class{constructor(e,t){this._logService=e;this._notebooksAndEditors=t;this._onDidChangeNotebookEditorSelection=new E;this._onDidChangeNotebookEditorVisibleRanges=new E;this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event;this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);let n=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&n._acceptVisibleRanges(t.visibleRanges.ranges.map(qo.to)),t.selections&&n._acceptSelections(t.selections.selections.map(qo.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:n.apiEditor,visibleRanges:n.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:n.apiEditor,selections:n.apiEditor.selections}))}$acceptEditorViewColumns(e){for(let t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(_t.to(e[t]))}};hm=D([C(0,ue)],hm);var ize=M("INotebookExecutionService");var DU=100;var lze=M("INotebookKernelService"),dze=M("INotebookKernelHistoryService");var vm=class{constructor(e,t,n,o,i){this._initData=t;this._extHostNotebook=n;this._commands=o;this._logService=i;this._activeExecutions=new qe;this._activeNotebookExecutions=new qe;this._kernelDetectionTask=new Map;this._kernelDetectionTaskHandlePool=0;this._kernelSourceActionProviders=new Map;this._kernelSourceActionProviderHandlePool=0;this._kernelData=new Map;this._handlePool=0;this.id=0;this.variableStore={};this._proxy=e.getProxy(N.MainThreadNotebookKernels);let s=new Te("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new j("options","Select kernel options",l=>!0,l=>{if(l&&"notebookEditor"in l&&"id"in l){let d=this._extHostNotebook.getIdByEditor(l.notebookEditor);return{id:l.id,extension:l.extension,notebookEditorId:d}}else if(l&&"notebookEditor"in l){let d=this._extHostNotebook.getIdByEditor(l.notebookEditor);if(d===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${l.notebookEditor.notebook.uri.toString()}`);return"skipIfAlreadySelected"in l?{notebookEditorId:d,skipIfAlreadySelected:l.skipIfAlreadySelected}:{notebookEditorId:d}}return l})],xe.Void),a=new Te("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[j.Uri],new xe("A promise that resolves to an array of variables",(l,d)=>l.map(c=>({variable:{name:c.name,value:c.value,expression:c.expression,type:c.type,language:c.language},hasNamedChildren:c.hasNamedChildren,indexedChildrenCount:c.indexedChildrenCount}))));this._commands.registerApiCommand(s),this._commands.registerApiCommand(a)}createNotebookController(e,t,n,o,i,s){for(let G of this._kernelData.values())if(G.controller.id===t&&_e.equals(e.identifier,G.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);let a=this._handlePool++,l=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);let d=()=>console.warn(`NO execute handler from notebook controller '${g.id}' of extension: '${e.identifier}'`),c=!1,u=new E,m=new E,g={id:wC(e.identifier,t),notebookType:n,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:o||e.identifier.value,preloads:s?s.map(wI.from):[]},v=i??d,h,x,S;this._proxy.$addKernel(a,g).catch(G=>{console.log(G),c=!0});let T=0,P=()=>{if(c)return;let G=++T;Promise.resolve().then(()=>{G===T&&this._proxy.$updateKernel(a,g)})},L=new qe,Y={get id(){return t},get notebookType(){return g.notebookType},onDidChangeSelectedNotebooks:u.event,get label(){return g.label},set label(G){g.label=G??e.displayName??e.name,P()},get detail(){return g.detail??""},set detail(G){g.detail=G,P()},get description(){return g.description??""},set description(G){g.description=G,P()},get supportedLanguages(){return g.supportedLanguages},set supportedLanguages(G){g.supportedLanguages=G,P()},get supportsExecutionOrder(){return g.supportsExecutionOrder??!1},set supportsExecutionOrder(G){g.supportsExecutionOrder=G,P()},get rendererScripts(){return g.preloads?g.preloads.map(wI.to):[]},get executeHandler(){return v},set executeHandler(G){v=G??d},get interruptHandler(){return h},set interruptHandler(G){h=G,g.supportsInterrupt=!!G,P()},set variableProvider(G){A(e,"notebookVariableProvider"),S?.dispose(),x=G,g.hasVariableProvider=!!G,S=G?.onDidChangeVariables(z=>l._proxy.$variablesUpdated(z.uri)),P()},get variableProvider(){return x},createNotebookCellExecution(G){if(c)throw new Error("notebook controller is DISPOSED");if(!L.has(G.notebook.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(L.keys()).map(z=>z.toString())),new Error(`notebook controller is NOT associated to notebook: ${G.notebook.uri.toString()}`);return l._createNotebookCellExecution(G,wC(e.identifier,this.id))},createNotebookExecution(G){if(A(e,"notebookExecution"),c)throw new Error("notebook controller is DISPOSED");if(!L.has(G.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(L.keys()).map(z=>z.toString())),new Error(`notebook controller is NOT associated to notebook: ${G.uri.toString()}`);return l._createNotebookExecution(G,wC(e.identifier,this.id))},dispose:()=>{c||(this._logService.trace(`NotebookController[${a}], DISPOSED`),c=!0,this._kernelData.delete(a),u.dispose(),m.dispose(),S?.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(G,z){z===-1&&A(e,"notebookControllerAffinityHidden"),l._proxy.$updateNotebookPriority(a,G.uri,z)},onDidReceiveMessage:m.event,postMessage(G,z){return A(e,"notebookMessaging"),l._proxy.$postMessage(a,z&&l._extHostNotebook.getIdByEditor(z),G)},asWebviewUri(G){return A(e,"notebookMessaging"),Il(G,l._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:Y,onDidReceiveMessage:m,onDidChangeSelection:u,associatedNotebooks:L}),Y}getIdByController(e){for(let[t,n]of this._kernelData)if(n.controller===e)return wC(n.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){let n=this._kernelDetectionTaskHandlePool++,o=this;this._logService.trace(`NotebookControllerDetectionTask[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(n,t);let i={dispose:()=>{this._kernelDetectionTask.delete(n),o._proxy.$removeKernelDetectionTask(n)}};return this._kernelDetectionTask.set(n,i),i}registerKernelSourceActionProvider(e,t,n){let o=this._kernelSourceActionProviderHandlePool++,i=typeof n.onDidChangeNotebookKernelSourceActions=="function"?o:void 0,s=this;this._kernelSourceActionProviders.set(o,n),this._logService.trace(`NotebookKernelSourceActionProvider[${o}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(o,o,t);let a;return i!==void 0&&(a=n.onDidChangeNotebookKernelSourceActions(l=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(i))),{dispose:()=>{this._kernelSourceActionProviders.delete(o),s._proxy.$removeKernelSourceActionProvider(o,o),a?.dispose()}}}async $provideKernelSourceActions(e,t){let n=this._kernelSourceActionProviders.get(e);if(n){let o=new q;return(await n.provideNotebookKernelSourceActions(t)??[]).map(s=>oP.from(s,this._commands.converter,o))}return[]}$acceptNotebookAssociation(e,t,n){let o=this._kernelData.get(e);if(o){let i=this._extHostNotebook.getNotebookDocument(y.revive(t));n?o.associatedNotebooks.set(i.uri,!0):o.associatedNotebooks.delete(i.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,i.uri.toString(),n),o.onDidChangeSelection.fire({selected:n,notebook:i.apiNotebook})}}async $executeCells(e,t,n){let o=this._kernelData.get(e);if(!o)return;let i=this._extHostNotebook.getNotebookDocument(y.revive(t)),s=[];for(let a of n){let l=i.getCell(a);l&&s.push(l.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,i.uri.toString(),s.length),await o.controller.executeHandler.call(o.controller,s,i.apiNotebook,o.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,n){let o=this._kernelData.get(e);if(!o)return;let i=this._extHostNotebook.getNotebookDocument(y.revive(t));if(o.controller.interruptHandler)await o.controller.interruptHandler.call(o.controller,i.apiNotebook);else for(let s of n){let a=i.getCell(s);a&&this._activeExecutions.get(a.uri)?.cancel()}if(o.controller.interruptHandler){let s=this._activeNotebookExecutions.get(i.uri);this._activeNotebookExecutions.delete(i.uri),n.length&&Array.isArray(s)&&s.length&&s.forEach(a=>a.dispose())}}async $provideVariables(e,t,n,o,i,s,a){let l=this._kernelData.get(e);if(!l)return;let d=this._extHostNotebook.getNotebookDocument(y.revive(n)),c=l.controller.variableProvider;if(!c)return;let u;if(o!==void 0){if(u=this.variableStore[o],!u)return}else this.variableStore={};let m=i==="named"?1:2,g=c.provideVariables(d.apiNotebook,u,m,s,a),v=0;for await(let h of g){if(a.isCancellationRequested)return;let x={id:this.id++,name:h.variable.name,value:h.variable.value,type:h.variable.type,interfaces:h.variable.interfaces,language:h.variable.language,expression:h.variable.expression,hasNamedChildren:h.hasNamedChildren,indexedChildrenCount:h.indexedChildrenCount,extensionId:l.extensionId.value};if(this.variableStore[x.id]=h.variable,this._proxy.$receiveVariable(t,x),v++>=DU)return}}$acceptKernelMessageFromRenderer(e,t,n){let o=this._kernelData.get(e);if(!o)return;let i=this._extHostNotebook.getEditorById(t);o.onDidReceiveMessage.fire(Object.freeze({editor:i.apiEditor,message:n}))}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");let o=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!o)throw new Error("invalid cell");if(this._activeExecutions.has(o.uri))throw new Error(`duplicate execution for ${o.uri}`);let i=new t1(t,o,this._proxy);this._activeExecutions.set(o.uri,i);let s=i.onDidChangeState(()=>{i.state===2&&(i.dispose(),s.dispose(),this._activeExecutions.delete(o.uri))});return i.asApiObject()}_createNotebookExecution(e,t){let n=this._extHostNotebook.getNotebookDocument(e.uri),o=e.getCells().find(a=>{let l=n.getCellFromApiCell(a);return l&&this._activeExecutions.has(l.uri)});if(o)throw new Error(`duplicate cell execution for ${o.document.uri}`);if(this._activeNotebookExecutions.has(n.uri))throw new Error(`duplicate notebook execution for ${n.uri}`);let i=new n1(t,n,this._proxy),s=i.onDidChangeState(()=>{i.state===2&&(i.dispose(),s.dispose(),this._activeNotebookExecutions.delete(n.uri))});return this._activeNotebookExecutions.set(n.uri,[i,s]),i.asApiObject()}};vm=D([C(4,ue)],vm);var t1=class r extends H{constructor(t,n,o){super();this._cell=n;this._proxy=o;this._handle=r.HANDLE++;this._onDidChangeState=this._register(new E);this.onDidChangeState=this._onDidChangeState.event;this._state=0;this._tokenSource=this._register(new Re);this._collector=new o1(10,i=>this.update(i)),this._executionOrder=n.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,t,this._cell.notebook.uri,this._cell.handle)}static{this.HANDLE=0}get state(){return this._state}cancel(){this._tokenSource.cancel()}async updateSoon(t){await this._collector.addItem(t)}async update(t){let n=Array.isArray(t)?t:[t];return this._proxy.$updateExecution(this._handle,new Pt(n))}verifyStateForOutput(){if(this._state===0)throw new Error("Must call start before modifying cell output");if(this._state===2)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(t){let n=this._cell;if(t&&(n=this._cell.notebook.getCellFromApiCell(t)),!n)throw new Error("INVALID cell");return n.handle}validateAndConvertOutputs(t){return t.map(n=>{let o=Ii.ensureUniqueMimeTypes(n.items,!0);return o===n.items?As.from(n):As.from({items:o,id:n.id,metadata:n.metadata})})}async updateOutputs(t,n,o){let i=this.cellIndexToHandle(n),s=this.validateAndConvertOutputs(hn(t));return this.updateSoon({editType:1,cellHandle:i,append:o,outputs:s})}async updateOutputItems(t,n,o){return t=Ii.ensureUniqueMimeTypes(hn(t),!0),this.updateSoon({editType:2,items:t.map(Ld.from),outputId:n.id,append:o})}asApiObject(){let t=this;return Object.freeze({get token(){return t._tokenSource.token},get cell(){return t._cell.apiCell},get executionOrder(){return t._executionOrder},set executionOrder(o){t._executionOrder=o,t.update([{editType:3,executionOrder:t._executionOrder}])},start(o){if(t._state===2||t._state===1)throw new Error("Cannot call start again");t._state=1,t._onDidChangeState.fire(),t.update({editType:3,runStartTime:o})},end(o,i,s){if(t._state===2)throw new Error("Cannot call resolve twice");t._state=2,t._onDidChangeState.fire(),t._collector.flush();let a=z7(s);t._proxy.$completeExecution(t._handle,new Pt({runEndTime:i,lastRunSuccess:o,error:a}))},clearOutput(o){return t.verifyStateForOutput(),t.updateOutputs([],o,!1)},appendOutput(o,i){return t.verifyStateForOutput(),t.updateOutputs(o,i,!0)},replaceOutput(o,i){return t.verifyStateForOutput(),t.updateOutputs(o,i,!1)},appendOutputItems(o,i){return t.verifyStateForOutput(),t.updateOutputItems(o,i,!0)},replaceOutputItems(o,i){return t.verifyStateForOutput(),t.updateOutputItems(o,i,!1)}})}};function z7(r){let e=o=>o?{startLineNumber:o.start.line,startColumn:o.start.character,endLineNumber:o.end.line,endColumn:o.end.character}:void 0,t=o=>({uri:o.uri,position:o.position,label:o.label});return r?{name:r.name,message:r.message,stack:r.stack instanceof Array?r.stack.map(o=>t(o)):r.stack,location:e(r.location),uri:r.uri}:void 0}var n1=class r extends H{constructor(t,n,o){super();this._notebook=n;this._proxy=o;this._handle=r.HANDLE++;this._onDidChangeState=this._register(new E);this.onDidChangeState=this._onDidChangeState.event;this._state=0;this._tokenSource=this._register(new Re);this._proxy.$createNotebookExecution(this._handle,t,this._notebook.uri)}static{this.HANDLE=0}get state(){return this._state}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===2||this._state===1)throw new Error("Cannot call start again");this._state=1,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===2)throw new Error("Cannot call resolve twice");this._state=2,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}},o1=class{constructor(e,t){this.delay=e;this.callback=t;this.batch=[];this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new _n,this.startedTimer=Date.now(),cn(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();let e=this.currentDeferred;this.currentDeferred=void 0;let t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}};function wC(r,e){return`${r.value}/${e}`}var kC=class{constructor(e,t){this._extHostNotebook=t;this._rendererMessageEmitters=new Map;this.proxy=e.getProxy(N.MainThreadNotebookRenderers)}$postRendererMessage(e,t,n){let o=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:o.apiEditor,message:n})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(o=>o.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(o,i,s)=>this.getOrCreateEmitterFor(t).event(o,i,s),postMessage:(o,i)=>{sc.apiEditorsToExtHost.has(o)&&([o,i]=[i,o]);let s=i&&sc.apiEditorsToExtHost.get(i);return this.proxy.$postMessage(s?.id,t,o)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new E({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}};var _C=class{constructor(e){this.handlers=new Map;this.proxy=e.getProxy(N.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,n){if(A(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,n),this.proxy.$registerProfileContentHandler(t,n.name,n.description,e.identifier.value),J(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,n,o){let i=this.handlers.get(e);if(!i)throw new Error(`Unknown handler with id: ${e}`);return i.saveProfile(t,n,o)}async $readProfile(e,t,n){let o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.readProfile(ke(t)?t:y.revive(t),n)}};var PC=class r{constructor(e,t){this.uriTransformer=t;this.providers=new Map;this.proxy=e.getProxy(N.MainThreadQuickDiff)}static{this.handlePool=0}$provideOriginalResource(e,t,n){let o=y.revive(t),i=this.providers.get(e);return i?Qt(()=>i.provideOriginalResource(o,n)).then(s=>s||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,n,o,i,s){let a=r.handlePool++;this.providers.set(a,n);let l=_e.toKey(e.identifier);return this.proxy.$registerQuickDiffProvider(a,Jr.from(t,this.uriTransformer),`${l}.${o}`,i,s),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(a),this.providers.delete(a)}}}};function RU(r,e,t){let n=r.getProxy(N.MainThreadQuickOpen);class o{constructor(d,c){this._sessions=new Map;this._instances=0;this._workspace=d,this._commands=c}showQuickPick(d,c,u,m=be.None){this._onDidSelectItem=void 0;let g=Promise.resolve(c),v=++this._instances,h=n.$show(v,{title:u?.title,placeHolder:u?.placeHolder,prompt:u?.prompt,matchOnDescription:u?.matchOnDescription,matchOnDetail:u?.matchOnDetail,ignoreFocusLost:u?.ignoreFocusOut,canPickMany:u?.canPickMany},m),x={},S=h.then(()=>x);return Promise.race([S,g]).then(T=>{if(T!==x)return g.then(P=>{let L=[];for(let Y=0;Y<P.length;Y++){let G=P[Y];typeof G=="string"?L.push({label:G,handle:Y}):G.kind===-1?L.push({type:"separator",label:G.label}):(G.tooltip&&A(d,"quickPickItemTooltip"),L.push({label:G.label,iconPathDto:Xr.from(G.iconPath),description:G.description,detail:G.detail,picked:G.picked,alwaysShow:G.alwaysShow,tooltip:ce.fromStrict(G.tooltip),resourceUri:G.resourceUri,handle:Y}))}return u&&typeof u.onDidSelectItem=="function"&&(this._onDidSelectItem=Y=>{u.onDidSelectItem(P[Y])}),n.$setItems(v,L),h.then(Y=>{if(typeof Y=="number")return P[Y];if(Array.isArray(Y))return Y.map(G=>P[G])})})}).then(void 0,T=>{if(!Tn(T))return n.$setError(v,T),Promise.reject(T)})}$onItemSelected(d){this._onDidSelectItem?.(d)}showInput(d,c=be.None){return this._validateInput=d?.validateInput,n.$input(d,typeof this._validateInput=="function",c).then(void 0,u=>{if(!Tn(u))return Promise.reject(u)})}async $validateInput(d){if(!this._validateInput)return;let c=await this._validateInput(d);if(!c||typeof c=="string")return c;let u;switch(c.severity){case 1:u=$e.Info;break;case 2:u=$e.Warning;break;case 3:u=$e.Error;break;default:u=c.message?$e.Error:$e.Ignore;break}return{content:c.message,severity:u}}async showWorkspaceFolderPick(d,c=be.None){let u=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[d]);if(!u)return;let m=await this._workspace.getWorkspaceFolders2();if(m)return m.find(g=>g.uri.toString()===u.uri.toString())}createQuickPick(d){let c=new s(d,()=>this._sessions.delete(c._id));return this._sessions.set(c._id,c),c}createInputBox(d){let c=new a(d,()=>this._sessions.delete(c._id));return this._sessions.set(c._id,c),c}$onDidChangeValue(d,c){this._sessions.get(d)?._fireDidChangeValue(c)}$onDidAccept(d){this._sessions.get(d)?._fireDidAccept()}$onDidChangeActive(d,c){let u=this._sessions.get(d);u instanceof s&&u._fireDidChangeActive(c)}$onDidChangeSelection(d,c){let u=this._sessions.get(d);u instanceof s&&u._fireDidChangeSelection(c)}$onDidTriggerButton(d,c,u){this._sessions.get(d)?._fireDidTriggerButton(c,u)}$onDidTriggerItemButton(d,c,u,m){let g=this._sessions.get(d);g instanceof s&&g._fireDidTriggerItemButton(c,u,m)}$onDidHide(d){this._sessions.get(d)?._fireDidHide()}}class i{constructor(d,c){this._extension=d;this._onDidDispose=c;this._id=s._nextId++;this._visible=!1;this._expectingHide=!1;this._enabled=!0;this._busy=!1;this._ignoreFocusOut=!0;this._value="";this._valueSelection=void 0;this._buttons=[];this._handlesToButtons=new Map;this._onDidAcceptEmitter=new E;this._onDidChangeValueEmitter=new E;this._onDidTriggerButtonEmitter=new E;this._onDidHideEmitter=new E;this._pendingUpdate={id:this._id};this._disposed=!1;this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter];this.onDidChangeValue=this._onDidChangeValueEmitter.event;this.onDidAccept=this._onDidAcceptEmitter.event;this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event;this.onDidHide=this._onDidHideEmitter.event}static{this._nextId=1}get title(){return this._title}set title(d){this._title=d,this.update({title:d})}get step(){return this._steps}set step(d){this._steps=d,this.update({step:d})}get totalSteps(){return this._totalSteps}set totalSteps(d){this._totalSteps=d,this.update({totalSteps:d})}get enabled(){return this._enabled}set enabled(d){this._enabled=d,this.update({enabled:d})}get busy(){return this._busy}set busy(d){this._busy=d,this.update({busy:d})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(d){this._ignoreFocusOut=d,this.update({ignoreFocusOut:d})}get value(){return this._value}set value(d){this._value=d,this.update({value:d})}get valueSelection(){return this._valueSelection}set valueSelection(d){this._valueSelection=d,this.update({valueSelection:d})}get placeholder(){return this._placeholder}set placeholder(d){this._placeholder=d,this.update({placeholder:d})}get buttons(){return this._buttons}set buttons(d){this._buttons=d.slice(),this._handlesToButtons.clear(),d.forEach((c,u)=>{let m=c===xi.Back?-1:u;this._handlesToButtons.set(m,c)}),this.update({buttons:d.map((c,u)=>({iconPathDto:Xr.from(c.iconPath),tooltip:c.tooltip,handle:c===xi.Back?-1:u,location:typeof c.location=="number"?c.location:void 0,toggle:typeof c.toggle=="object"&&typeof c.toggle.checked=="boolean"?{checked:c.toggle.checked}:void 0}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(d){this._value=d,this._onDidChangeValueEmitter.fire(d)}_fireDidTriggerButton(d,c){let u=this._handlesToButtons.get(d);u&&(c!==void 0&&u.toggle&&(u.toggle.checked=c),this._onDidTriggerButtonEmitter.fire(u))}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=wn(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),n.$dispose(this._id))}update(d){if(!this._disposed){for(let c of Object.keys(d)){let u=d[c];this._pendingUpdate[c]=u===void 0?null:u}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){n.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}}class s extends i{constructor(c,u){super(c,u);this._items=[];this._handlesToItems=new Map;this._itemsToHandles=new Map;this._canSelectMany=!1;this._matchOnDescription=!0;this._matchOnDetail=!0;this._sortByLabel=!0;this._keepScrollPosition=!1;this._activeItems=[];this._onDidChangeActiveEmitter=new E;this._selectedItems=[];this._onDidChangeSelectionEmitter=new E;this._onDidTriggerItemButtonEmitter=new E;this.onDidChangeActive=this._onDidChangeActiveEmitter.event;this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event;this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event;this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(c){this._items=c.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),c.forEach((m,g)=>{this._handlesToItems.set(g,m),this._itemsToHandles.set(m,g)});let u=[];for(let m=0;m<c.length;m++){let g=c[m];g.kind===-1?u.push({type:"separator",label:g.label}):(g.tooltip&&A(this._extension,"quickPickItemTooltip"),u.push({handle:m,label:g.label,iconPathDto:Xr.from(g.iconPath),description:g.description,detail:g.detail,picked:g.picked,alwaysShow:g.alwaysShow,tooltip:ce.fromStrict(g.tooltip),resourceUri:g.resourceUri,buttons:g.buttons?.map((v,h)=>({iconPathDto:Xr.from(v.iconPath),tooltip:v.tooltip,handle:h,toggle:typeof v.toggle=="object"&&typeof v.toggle.checked=="boolean"?{checked:v.toggle.checked}:void 0}))}))}this.update({items:u})}get canSelectMany(){return this._canSelectMany}set canSelectMany(c){this._canSelectMany=c,this.update({canSelectMany:c})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(c){this._matchOnDescription=c,this.update({matchOnDescription:c})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(c){this._matchOnDetail=c,this.update({matchOnDetail:c})}get sortByLabel(){return this._sortByLabel}set sortByLabel(c){this._sortByLabel=c,this.update({sortByLabel:c})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(c){this._keepScrollPosition=c,this.update({keepScrollPosition:c})}get prompt(){return this._prompt}set prompt(c){this._prompt=c,this.update({prompt:c})}get activeItems(){return this._activeItems}set activeItems(c){this._activeItems=c.filter(u=>this._itemsToHandles.has(u)),this.update({activeItems:this._activeItems.map(u=>this._itemsToHandles.get(u))})}get selectedItems(){return this._selectedItems}set selectedItems(c){this._selectedItems=c.filter(u=>this._itemsToHandles.has(u)),this.update({selectedItems:this._selectedItems.map(u=>this._itemsToHandles.get(u))})}_fireDidChangeActive(c){let u=Ze(c.map(m=>this._handlesToItems.get(m)));this._activeItems=u,this._onDidChangeActiveEmitter.fire(u)}_fireDidChangeSelection(c){let u=Ze(c.map(m=>this._handlesToItems.get(m)));this._selectedItems=u,this._onDidChangeSelectionEmitter.fire(u)}_fireDidTriggerItemButton(c,u,m){let g=this._handlesToItems.get(c);if(!g||!g.buttons||!g.buttons.length)return;let v=g.buttons[u];v&&(m!==void 0&&v.toggle&&(v.toggle.checked=m),this._onDidTriggerItemButtonEmitter.fire({button:v,item:g}))}}class a extends i{constructor(c,u){super(c,u);this._password=!1;this.update({type:"inputBox"})}get password(){return this._password}set password(c){this._password=c,this.update({password:c})}get prompt(){return this._prompt}set prompt(c){this._prompt=c,this.update({prompt:c})}get validationMessage(){return this._validationMessage}set validationMessage(c){this._validationMessage=c,c?typeof c=="string"?this.update({validationMessage:c,severity:$e.Error}):this.update({validationMessage:c.message,severity:c.severity??$e.Error}):this.update({validationMessage:void 0,severity:$e.Ignore})}}return new o(e,t)}var MU=new dt(()=>{let r=Tp.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:r,collatorIsNumeric:r.resolvedOptions().numeric}}),UKe=new dt(()=>({collator:Tp.Collator(void 0,{numeric:!0}).value})),FKe=new dt(()=>({collator:Tp.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function K7(r,e,t=!1){let n=r||"",o=e||"",i=MU.value.collator.compare(n,o);return MU.value.collatorIsNumeric&&i===0&&n!==o?n<o?-1:1:i}function q7(r,e,t=!1){return t||(r=r&&r.toLowerCase(),e=e&&e.toLowerCase()),r===e?0:r<e?-1:1}function Ih(r,e,t=!1){let n=r.split(kn),o=e.split(kn),i=n.length-1,s=o.length-1,a,l;for(let d=0;;d++){if(a=i===d,l=s===d,a&&l)return K7(n[d],o[d],t);if(a)return-1;if(l)return 1;let c=q7(n[d],o[d],t);if(c!==0)return c}}function AU(r){return r instanceof y}function G7(r,e){return r.scheme===$.file&&e.scheme===$.file&&An?r.toString()===e.toString():r.toString().toLowerCase()===e.toString().toLowerCase()}function r1(r){if(r)return typeof r.iconPath=="string"?y.file(r.iconPath):y.isUri(r.iconPath)||vt.isThemeIcon(r.iconPath)?r.iconPath:void 0}function Bi(r){if(r){if(y.isUri(r))return r;if(vt.isThemeIcon(r))return r;{let e=r;return{light:e.light,dark:e.dark}}}else return}function LU(r){let e=Bi(r.authorIcon),t=Array.isArray(r.tooltip)?ce.fromMany(r.tooltip):r.tooltip?ce.from(r.tooltip):void 0,n=r.references?.map(o=>({...o,icon:Bi(o.icon)}));return{...r,authorIcon:e,references:n,tooltip:t}}function i1(r){return r?{...r,icon:Bi(r.icon)}:void 0}function s1(r,e){if(!r.iconPath&&!e.iconPath)return 0;if(r.iconPath){if(!e.iconPath)return 1}else return-1;let t=typeof r.iconPath=="string"?r.iconPath:y.isUri(r.iconPath)?r.iconPath.fsPath:r.iconPath.id,n=typeof e.iconPath=="string"?e.iconPath:y.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return Ih(t,n)}function j7(r,e){let t=0;if(r.strikeThrough!==e.strikeThrough)return r.strikeThrough?1:-1;if(r.faded!==e.faded)return r.faded?1:-1;if(r.tooltip!==e.tooltip)return(r.tooltip||"").localeCompare(e.tooltip||"");if(t=s1(r,e),t!==0)return t;if(r.light&&e.light)t=s1(r.light,e.light);else{if(r.light)return 1;if(e.light)return-1}if(t!==0)return t;if(r.dark&&e.dark)t=s1(r.dark,e.dark);else{if(r.dark)return 1;if(e.dark)return-1}return t}function Q7(r,e){if(r.command!==e.command)return r.command<e.command?-1:1;if(r.title!==e.title)return r.title<e.title?-1:1;if(r.tooltip!==e.tooltip){if(r.tooltip!==void 0&&e.tooltip!==void 0)return r.tooltip<e.tooltip?-1:1;if(r.tooltip!==void 0)return 1;if(e.tooltip!==void 0)return-1}if(r.arguments===e.arguments)return 0;if(r.arguments)if(e.arguments){if(r.arguments.length!==e.arguments.length)return r.arguments.length-e.arguments.length}else return 1;else return-1;for(let t=0;t<r.arguments.length;t++){let n=r.arguments[t],o=e.arguments[t];if(n!==o&&!(AU(n)&&AU(o)&&G7(n,o)))return n<o?-1:1}return 0}function OU(r,e){let t=Ih(r.resourceUri.fsPath,e.resourceUri.fsPath,!0);if(t!==0)return t;if(r.command&&e.command)t=Q7(r.command,e.command);else{if(r.command)return 1;if(e.command)return-1}if(t!==0)return t;if(r.decorations&&e.decorations)t=j7(r.decorations,e.decorations);else{if(r.decorations)return 1;if(e.decorations)return-1}if(t!==0)return t;if(r.multiFileDiffEditorModifiedUri&&e.multiFileDiffEditorModifiedUri)t=Ih(r.multiFileDiffEditorModifiedUri.fsPath,e.multiFileDiffEditorModifiedUri.fsPath,!0);else{if(r.multiFileDiffEditorModifiedUri)return 1;if(e.multiFileDiffEditorModifiedUri)return-1}if(t!==0)return t;if(r.multiDiffEditorOriginalUri&&e.multiDiffEditorOriginalUri)t=Ih(r.multiDiffEditorOriginalUri.fsPath,e.multiDiffEditorOriginalUri.fsPath,!0);else{if(r.multiDiffEditorOriginalUri)return 1;if(e.multiDiffEditorOriginalUri)return-1}return t}function J7(r,e){for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function X7(r,e){return r.command===e.command&&r.title===e.title&&r.tooltip===e.tooltip&&(r.arguments&&e.arguments?J7(r.arguments,e.arguments):r.arguments===e.arguments)}function Y7(r,e){return Ht(r,e,X7)}var a1=class{constructor(e,t,n,o,i){this._extension=e;this._sourceControlHandle=o;this._documentUri=i;this._value="";this._onDidChange=new E;this._placeholder="";this._enabled=!0;this._visible=!0;this.#t=t,this.#e=n}#e;#t;get value(){return this._value}set value(e){e=e??"",this.#e.$setInputBoxValue(this._sourceControlHandle,e),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this.#e.$setInputBoxPlaceholder(this._sourceControlHandle,e),this._placeholder=e}get validateInput(){return A(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if(A(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this.#e.$setValidationProviderIsEnabled(this._sourceControlHandle,!!e)}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this.#e.$setInputBoxEnablement(this._sourceControlHandle,e))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this.#e.$setInputBoxVisibility(this._sourceControlHandle,e))}get document(){return A(this._extension,"scmTextDocument"),this.#t.getDocument(this._documentUri)}showValidationMessage(e,t){A(this._extension,"scmValidation"),this.#e.$showValidationMessage(this._sourceControlHandle,e,yP.from(t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}},l1=class r{constructor(e,t,n,o,i,s,a){this._proxy=e;this._commands=t;this._sourceControlHandle=n;this._id=o;this._label=i;this.multiDiffEditorEnableViewChanges=s;this._extension=a;this._resourceHandlePool=0;this._resourceStates=[];this._resourceStatesMap=new Map;this._resourceStatesCommandsMap=new Map;this._resourceStatesDisposablesMap=new Map;this._onDidUpdateResourceStates=new E;this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event;this._disposed=!1;this._onDidDispose=new E;this.onDidDispose=this._onDidDispose.event;this._handlesSnapshot=[];this._resourceSnapshot=[];this._contextValue=void 0;this._hideWhenEmpty=void 0;this.handle=r._handlePool++}static{this._handlePool=0}get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get features(){return{contextValue:this.contextValue,hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){let n=this._resourceStatesCommandsMap.get(e);return n?Qt(()=>this._commands.executeCommand(n.command,...n.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){let e=[...this._resourceStates].sort(OU),n=KC(this._resourceSnapshot,e,OU).map(s=>{let a=s.toInsert.map(l=>{let d=this._resourceHandlePool++;this._resourceStatesMap.set(d,l);let c=l.resourceUri,u;if(l.command)if(l.command.command==="vscode.open"||l.command.command==="vscode.diff"||l.command.command==="vscode.changes"){let K=new q;u=this._commands.converter.toInternal(l.command,K),this._resourceStatesDisposablesMap.set(d,K)}else this._resourceStatesCommandsMap.set(d,l.command);let m=Fe(this._extension,"scmMultiDiffEditor"),g=m?l.multiDiffEditorOriginalUri:void 0,v=m?l.multiFileDiffEditorModifiedUri:void 0,h=r1(l.decorations),x=l.decorations&&r1(l.decorations.light)||h,S=l.decorations&&r1(l.decorations.dark)||h,T=[x,S],P=l.decorations&&l.decorations.tooltip||"",L=l.decorations&&!!l.decorations.strikeThrough,Y=l.decorations&&!!l.decorations.faded,G=l.contextValue||"";return{rawResource:[d,c,T,P,L,Y,G,u,g,v],handle:d}});return{start:s.start,deleteCount:s.deleteCount,toInsert:a}}),o=n.map(({start:s,deleteCount:a,toInsert:l})=>[s,a,l.map(d=>d.rawResource)]),i=n.reverse();for(let{start:s,deleteCount:a,toInsert:l}of i){let d=l.map(u=>u.handle),c=this._handlesSnapshot.splice(s,a,...d);for(let u of c)this._resourceStatesMap.delete(u),this._resourceStatesCommandsMap.delete(u),this._resourceStatesDisposablesMap.get(u)?.dispose(),this._resourceStatesDisposablesMap.delete(u)}return this._resourceSnapshot=e,o}dispose(){this._disposed=!0,this._onDidDispose.fire(),this._onDidUpdateResourceStates.dispose(),this._onDidDispose.dispose()}},xh=class xh{constructor(e,t,n,o,i,s,a,l,d,c){this._extension=e;this._commands=o;this._id=i;this._label=s;this._rootUri=a;this._onDidDispose=new E;this.onDidDispose=this._onDidDispose.event;this._groups=new Map;this._contextValue=void 0;this._count=void 0;this._quickDiffProvider=void 0;this._secondaryQuickDiffProvider=void 0;this._historyProviderDisposable=new En;this._artifactProviderDisposable=new En;this._commitTemplate=void 0;this._acceptInputDisposables=new En;this._acceptInputCommand=void 0;this._actionButtonDisposables=new q;this._statusBarDisposables=new q;this._statusBarCommands=void 0;this._selected=!1;this._onDidChangeSelection=new E;this.onDidChangeSelection=this._onDidChangeSelection.event;this._artifactCommandsDisposables=new Oo;this.handle=xh._handlePool++;this.createdResourceGroups=new Map;this.updatedResourceGroups=new Set;this.#e=n;let u=y.from({scheme:$.vscodeSourceControl,path:`${i}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new a1(e,t,this.#e,this.handle,u),this.#e.$registerSourceControl(this.handle,c?.handle,i,s,a,Bi(l),d,u),this.onDidDisposeParent=c?c.onDidDispose:Me.None}static{this._handlePool=0}#e;get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get contextValue(){return A(this._extension,"scmProviderOptions"),this._contextValue}set contextValue(e){A(this._extension,"scmProviderOptions"),this._contextValue!==e&&(this._contextValue=e,this.#e.$updateSourceControl(this.handle,{contextValue:e}))}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this.#e.$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Fe(this._extension,"quickDiffProvider")&&(t=e?.label),this.#e.$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get secondaryQuickDiffProvider(){return A(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider}set secondaryQuickDiffProvider(e){A(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider=e;let t=e?.label;this.#e.$updateSourceControl(this.handle,{hasSecondaryQuickDiffProvider:!!e,secondaryQuickDiffLabel:t})}get historyProvider(){return A(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){A(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new q,this.#e.$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&(this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemRefs(()=>{let t=i1(e?.currentHistoryItemRef),n=i1(e?.currentHistoryItemRemoteRef),o=i1(e?.currentHistoryItemBaseRef);this.#e.$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle,t,n,o)})),this._historyProviderDisposable.value.add(e.onDidChangeHistoryItemRefs(t=>{if(t.added.length===0&&t.modified.length===0&&t.removed.length===0)return;let n=t.added.map(s=>({...s,icon:Bi(s.icon)})),o=t.modified.map(s=>({...s,icon:Bi(s.icon)})),i=t.removed.map(s=>({...s,icon:Bi(s.icon)}));this.#e.$onDidChangeHistoryProviderHistoryItemRefs(this.handle,{added:n,modified:o,removed:i,silent:t.silent})})))}get artifactProvider(){return A(this._extension,"scmArtifactProvider"),this._artifactProvider}set artifactProvider(e){A(this._extension,"scmArtifactProvider"),this._artifactProvider=e,this._artifactProviderDisposable.value=new q,this.#e.$updateSourceControl(this.handle,{hasArtifactProvider:!!e}),e&&this._artifactProviderDisposable.value.add(e.onDidChangeArtifacts(t=>{t.length!==0&&this.#e.$onDidChangeArtifacts(this.handle,t)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this.#e.$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new q,this._acceptInputCommand=e;let t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this.#e.$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return A(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){if(A(this._extension,"scmActionButton"),qc(this._actionButton,e))return;let t=this._actionButtonDisposables;this._actionButtonDisposables=new q,this._actionButton=e;let n=e!==void 0?{command:{...this._commands.converter.toInternal(e.command,this._actionButtonDisposables),shortTitle:e.command.shortTitle},secondaryCommands:e.secondaryCommands?.map(o=>o.map(i=>this._commands.converter.toInternal(i,this._actionButtonDisposables))),enabled:e.enabled}:null;this.#e.$updateSourceControl(this.handle,{actionButton:n}).finally(()=>t.dispose())}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&Y7(this._statusBarCommands,e))return;let t=this._statusBarDisposables;this._statusBarDisposables=new q,this._statusBarCommands=e;let n=(e||[]).map(o=>this._commands.converter.toInternal(o,this._statusBarDisposables));this.#e.$updateSourceControl(this.handle,{statusBarCommands:n}).finally(()=>t.dispose())}get selected(){return this._selected}createResourceGroup(e,t,n){let o=Fe(this._extension,"scmMultiDiffEditor")&&n?.multiDiffEditorEnableViewChanges===!0,i=new l1(this.#e,this._commands,this.handle,e,t,o,this._extension),s=Me.once(i.onDidDispose)(()=>this.createdResourceGroups.delete(i));return this.createdResourceGroups.set(i,s),this.eventuallyAddResourceGroups(),i}eventuallyAddResourceGroups(){let e=[],t=[];for(let[n,o]of this.createdResourceGroups){o.dispose();let i=n.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(n),this.eventuallyUpdateResourceStates()});Me.once(n.onDidDispose)(()=>{this.updatedResourceGroups.delete(n),i.dispose(),this._groups.delete(n.handle),this.#e.$unregisterGroup(this.handle,n.handle)}),e.push([n.handle,n.id,n.label,n.features,n.multiDiffEditorEnableViewChanges]);let s=n._takeResourceStateSnapshot();s.length>0&&t.push([n.handle,s]),this._groups.set(n.handle,n)}this.#e.$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){let e=[];this.updatedResourceGroups.forEach(t=>{let n=t._takeResourceStateSnapshot();n.length!==0&&e.push([t.handle,n])}),e.length>0&&this.#e.$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}async provideArtifacts(e,t){let n=new q,i=(await this.artifactProvider?.provideArtifacts(e,t))?.map(s=>({...s,icon:Bi(s.icon),command:s.command?this._commands.converter.toInternal(s.command,n):void 0}));return this._artifactCommandsDisposables.get(e)?.dispose(),this._artifactCommandsDisposables.set(e,n),i}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._historyProviderDisposable.dispose(),this._artifactProviderDisposable.dispose(),this._artifactCommandsDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this.#e.$unregisterSourceControl(this.handle),this._onDidChangeSelection.dispose(),this._onDidDispose.fire(),this._onDidDispose.dispose()}};D([Uf(100)],xh.prototype,"eventuallyAddResourceGroups",1),D([Uf(100)],xh.prototype,"eventuallyUpdateResourceStates",1);var d1=xh,bm=class{constructor(e,t,n,o){this._commands=t;this._extHostDocuments=n;this.logService=o;this._sourceControls=new Map;this._sourceControlsByExtension=new Un;this._onDidChangeActiveProvider=new E;this._proxy=e.getProxy(N.MainThreadSCM),this._telemetry=e.getProxy(N.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:i=>{if(i&&i.$mid===3){let s=this._sourceControls.get(i.sourceControlHandle);if(!s)return i;let a=s.getResourceGroup(i.groupHandle);return a?a.getResourceState(i.handle):i}else if(i&&i.$mid===4){let s=this._sourceControls.get(i.sourceControlHandle);return s?s.getResourceGroup(i.groupHandle):i}else if(i&&i.$mid===5){let s=this._sourceControls.get(i.handle);return s||i}return i}})}get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}createSourceControl(e,t,n,o,i,s,a){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,n,o),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});let l=a?It.find(this._sourceControls.values(),u=>u===a):void 0,d=new d1(e,this._extHostDocuments,this._proxy,this._commands,t,n,o,i,s,l);this._sourceControls.set(d.handle,d);let c=this._sourceControlsByExtension.get(e.identifier)||[];return c.push(d),this._sourceControlsByExtension.set(e.identifier,c),d}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);let t=this._sourceControlsByExtension.get(e.identifier),n=t&&t[t.length-1];return n&&n.inputBox}$provideOriginalResource(e,t,n){let o=y.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,o.toString());let i=this._sourceControls.get(e);return!i||!i.quickDiffProvider||!i.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Qt(()=>i.quickDiffProvider.provideOriginalResource(o,n)).then(s=>s||null)}$provideSecondaryOriginalResource(e,t,n){let o=y.revive(t);this.logService.trace("ExtHostSCM#$provideSecondaryOriginalResource",e,o.toString());let i=this._sourceControls.get(e);return!i||!i.secondaryQuickDiffProvider||!i.secondaryQuickDiffProvider.provideOriginalResource?Promise.resolve(null):Qt(()=>i.secondaryQuickDiffProvider.provideOriginalResource(o,n)).then(s=>s||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);let n=this._sourceControls.get(e);return n&&n.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,n,o){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,n);let i=this._sourceControls.get(e);if(!i)return Promise.resolve(void 0);let s=i.getResourceGroup(t);return s?s.$executeResourceCommand(n,o):Promise.resolve(void 0)}$validateInput(e,t,n){this.logService.trace("ExtHostSCM#$validateInput",e);let o=this._sourceControls.get(e);return!o||!o.inputBox.validateInput?Promise.resolve(void 0):Qt(()=>o.inputBox.validateInput(t,n)).then(i=>{if(!i)return Promise.resolve(void 0);let s=ce.fromStrict(i.message);return s?Promise.resolve([s,i.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),this._selectedSourceControlHandle===e||(e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e),Promise.resolve(void 0)}async $resolveHistoryItem(e,t,n){try{let i=await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItem(t,n);return i?LU(i):void 0}catch(o){this.logService.error("ExtHostSCM#$resolveHistoryItem",o);return}}async $resolveHistoryItemChatContext(e,t,n){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemChatContext(t,n)??void 0}catch(o){this.logService.error("ExtHostSCM#$resolveHistoryItemChatContext",o);return}}async $resolveHistoryItemChangeRangeChatContext(e,t,n,o,i){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemChangeRangeChatContext?.(t,n,o,i)??void 0}catch(s){this.logService.error("ExtHostSCM#$resolveHistoryItemChangeRangeChatContext",s);return}}async $resolveHistoryItemRefsCommonAncestor(e,t,n){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemRefsCommonAncestor(t,n)??void 0}catch(o){this.logService.error("ExtHostSCM#$resolveHistoryItemRefsCommonAncestor",o);return}}async $provideHistoryItemRefs(e,t,n){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemRefs(t,n))?.map(s=>({...s,icon:Bi(s.icon)}))??void 0}catch(o){this.logService.error("ExtHostSCM#$provideHistoryItemRefs",o);return}}async $provideHistoryItems(e,t,n){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,n))?.map(s=>LU(s))??void 0}catch(o){this.logService.error("ExtHostSCM#$provideHistoryItems",o);return}}async $provideHistoryItemChanges(e,t,n,o){try{return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,n,o)??void 0}catch(i){this.logService.error("ExtHostSCM#$provideHistoryItemChanges",i);return}}async $provideArtifactGroups(e,t){try{return(await this._sourceControls.get(e)?.artifactProvider?.provideArtifactGroups(t))?.map(i=>({...i,icon:Bi(i.icon)}))}catch(n){this.logService.error("ExtHostSCM#$provideArtifactGroups",n);return}}async $provideArtifacts(e,t,n){try{return this._sourceControls.get(e)?.provideArtifacts(t,n)}catch(o){this.logService.error("ExtHostSCM#$provideArtifacts",o);return}}};bm=D([C(3,ue)],bm);var DC=class r{constructor(e,t){this.uriTransformer=t;this.providers=new Map;this.proxy=e.getProxy(N.MainThreadShare)}static{this.handlePool=0}async $provideShare(e,t,n){return await this.providers.get(e)?.provideShare({selection:V.to(t.selection),resourceUri:y.revive(t.resourceUri)},n)??void 0}registerShareProvider(e,t){let n=r.handlePool++;return this.providers.set(n,t),this.proxy.$registerShareProvider(n,Jr.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(n),this.providers.delete(n)}}}};var RC=class r{constructor(e){this.providers=new Map;this.sessions=new Map;this.synthesizers=new Map;this.proxy=e.getProxy(N.MainThreadSpeech)}static{this.ID_POOL=1}async $createSpeechToTextSession(e,t,n){let o=this.providers.get(e);if(!o)return;let i=new q,s=new Re;this.sessions.set(t,s);let a=await o.provideSpeechToTextSession(s.token,n?{language:n}:void 0);a&&(i.add(a.onDidChange(l=>{s.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,l)})),i.add(s.token.onCancellationRequested(()=>i.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,n){let o=this.providers.get(e);if(!o)return;let i=new q,s=new Re;this.sessions.set(t,s);let a=await o.provideTextToSpeechSession(s.token,n?{language:n}:void 0);a&&(this.synthesizers.set(t,a),i.add(a.onDidChange(l=>{s.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,l)})),i.add(s.token.onCancellationRequested(()=>i.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){let n=this.providers.get(e);if(!n)return;let o=new q,i=new Re;this.sessions.set(t,i);let s=await n.provideKeywordRecognitionSession(i.token);s&&(o.add(s.onDidChange(a=>{i.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),o.add(i.token.onCancellationRequested(()=>o.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,n){let o=r.ID_POOL++;return this.providers.set(o,n),this.proxy.$registerProvider(o,t,{extension:e,displayName:e.value}),J(()=>{this.proxy.$unregisterProvider(o),this.providers.delete(o)})}};var c1=class r{constructor(e,t,n,o,i,s=1,a,l){this._onDispose=l;this._disposed=!1;this._text="";this._staleCommandRegistrations=new q;if(this.#e=e,this.#t=t,i&&o){this._entryId=bO(o.identifier,i);let d=n.get(this._entryId);d&&(s=d.alignLeft?1:2,a=d.priority,this._visible=!0,this.name=d.name,this.text=d.text,this.tooltip=d.tooltip,this.command=d.command,this.accessibilityInformation=d.accessibilityInformation)}else this._entryId=String(r.ID_GEN++);this._extension=o,this._id=i,this._alignment=s,this._priority=this.validatePriority(a)}static{this.ID_GEN=0}static{this.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new fs("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new fs("statusBarItem.warningForeground")]])}#e;#t;validatePriority(e){if(Lo(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get entryId(){return this._entryId}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get tooltip2(){return this._extension&&A(this._extension,"statusBarItemTooltip"),this._tooltip2}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set tooltip2(e){this._extension&&A(this._extension,"statusBarItemTooltip"),this._tooltip2=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!r.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new q,typeof e=="string"?this._command={fromApi:e,internal:this.#t.toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:this.#t.toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,this.#e.$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=p(3168,null,this._extension.displayName||this._extension.name);let n=this._color;this._backgroundColor&&(n=r.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));let o,i;typeof this._tooltip2=="function"?(o=ce.fromStrict(this._tooltip),i=!0):(o=ce.fromStrict(this._tooltip2??this._tooltip),i=!1),this.#e.$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,o,i,this._command?.internal,n,this._backgroundColor,this._alignment===1,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._staleCommandRegistrations.dispose(),this._latestCommandRegistration?.dispose(),this._onDispose?.(),this._disposed=!0}},u1=class{constructor(e){this._messages=[];this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",1,Number.MIN_VALUE),this._item.name=p(3169,null)}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){let t={message:e};return this._messages.unshift(t),this._update(),new fe(()=>{let n=this._messages.indexOf(t);n>=0&&(this._messages.splice(n,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}},MC=class{constructor(e,t){this._entries=new Map;this._existingItems=new Map;this._proxy=e.getProxy(N.MainThreadStatusBar),this._commands=t,this._statusMessage=new u1(this)}$acceptStaticEntries(e){for(let t of e)this._existingItems.set(t.entryId,t)}async $provideTooltip(e,t){let n=this._entries.get(e);if(!n)return;let o=typeof n.tooltip2=="function"?await n.tooltip2(t):n.tooltip2;return t.isCancellationRequested?void 0:ce.fromStrict(o)}createStatusBarEntry(e,t,n,o){let i=new c1(this._proxy,this._commands,this._existingItems,e,t,n,o,()=>this._entries.delete(i.entryId));return this._entries.set(i.entryId,i),i}setStatusBarMessage(e,t){let n=this._statusMessage.setMessage(e),o;return typeof t=="number"?o=setTimeout(()=>n.dispose(),t):typeof t<"u"&&t.then(()=>n.dispose(),()=>n.dispose()),new fe(()=>{n.dispose(),clearTimeout(o)})}};var AC=class extends H{constructor(t,n){super();this._extHostDocumentsAndEditors=n;this._onDidChangeTextEditorSelection=this._register(new E);this._onDidChangeTextEditorOptions=this._register(new E);this._onDidChangeTextEditorVisibleRanges=this._register(new E);this._onDidChangeTextEditorViewColumn=this._register(new E);this._onDidChangeTextEditorDiffInformation=this._register(new E);this._onDidChangeActiveTextEditor=this._register(new E);this._onDidChangeVisibleTextEditors=this._register(new E);this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event;this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event;this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event;this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event;this.onDidChangeTextEditorDiffInformation=this._onDidChangeTextEditorDiffInformation.event;this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event;this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event;this._proxy=t.getProxy(N.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(o=>this._onDidChangeVisibleTextEditors.fire(o))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(o=>this._onDidChangeActiveTextEditor.fire(o)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(t){let n=this._extHostDocumentsAndEditors.allEditors();return t?n:n.map(o=>o.value)}async showTextDocument(t,n,o){let i;typeof n=="number"?i={position:_t.from(n),preserveFocus:o}:typeof n=="object"?i={position:_t.from(n.viewColumn),preserveFocus:n.preserveFocus,selection:typeof n.selection=="object"?V.from(n.selection):void 0,pinned:typeof n.preview=="boolean"?!n.preview:void 0}:i={preserveFocus:!1};let s=await this._proxy.$tryShowTextDocument(t.uri,i),a=s&&this._extHostDocumentsAndEditors.getEditor(s);if(a)return a.value;throw s?new Error(`Could NOT open editor for "${t.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${t.uri.toString()}".`)}createTextEditorDecorationType(t,n){return new kx(this._proxy,t,n).value}$acceptEditorPropertiesChanged(t,n){let o=this._extHostDocumentsAndEditors.getEditor(t);if(!o)throw new Error("unknown text editor");if(n.options&&o._acceptOptions(n.options),n.selections){let i=n.selections.selections.map(Qn.to);o._acceptSelections(i)}if(n.visibleRanges){let i=Ze(n.visibleRanges.map(V.to));o._acceptVisibleRanges(i)}if(n.options&&this._onDidChangeTextEditorOptions.fire({textEditor:o.value,options:{...n.options,lineNumbers:Fd.to(n.options.lineNumbers)}}),n.selections){let i=Pd.fromValue(n.selections.source),s=n.selections.selections.map(Qn.to);this._onDidChangeTextEditorSelection.fire({textEditor:o.value,selections:s,kind:i})}if(n.visibleRanges){let i=Ze(n.visibleRanges.map(V.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:o.value,visibleRanges:i})}}$acceptEditorPositionData(t){for(let n in t){let o=this._extHostDocumentsAndEditors.getEditor(n);if(!o)throw new Error("Unknown text editor");let i=_t.to(t[n]);o.value.viewColumn!==i&&(o._acceptViewColumn(i),this._onDidChangeTextEditorViewColumn.fire({textEditor:o.value,viewColumn:i}))}}$acceptEditorDiffInformation(t,n){let o=this._extHostDocumentsAndEditors.getEditor(t);if(!o)throw new Error("unknown text editor");if(!n){o._acceptDiffInformation(void 0),this._onDidChangeTextEditorDiffInformation.fire({textEditor:o.value,diffInformation:void 0});return}let i=this,s=n.map(a=>{let l=y.revive(a.original),d=y.revive(a.modified),c=a.changes.map(u=>{let[m,g,v,h]=u,x;return m===g?x=1:v===h?x=2:x=3,{original:{startLineNumber:m,endLineNumberExclusive:g},modified:{startLineNumber:v,endLineNumberExclusive:h},kind:x}});return Object.freeze({documentVersion:a.documentVersion,original:l,modified:d,changes:c,get isStale(){return i._extHostDocumentsAndEditors.getDocument(d)?.version!==a.documentVersion}})});o._acceptDiffInformation(s),this._onDidChangeTextEditorDiffInformation.fire({textEditor:o.value,diffInformation:s})}getDiffInformation(t){return Promise.resolve(this._proxy.$getDiffInformation(t))}};var ym=class{constructor(e){this._actual=new hd(2),this._onDidChangeActiveColorTheme=new E}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=1;break;case"hcDark":t=3;break;case"hcLight":t=4;break;default:t=2}this._actual=new hd(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};ym=D([C(0,ge)],ym);var NGe=M("IExtHostTimeline"),LC=class{constructor(e,t){this._providers=new Map;this._itemsBySourceAndUriMap=new Map;this._proxy=e.getProxy(N.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(n,o)=>{if(n&&n.$mid===12)if(this._providers.get(n.source)&&o&&Fe(o,"timeline")){let i=n.uri===void 0?void 0:y.revive(n.uri);return this._itemsBySourceAndUriMap.get(n.source)?.get(NU(i))?.get(n.handle)}else return;return n}})}async $getTimeline(e,t,n,o){return this._providers.get(e)?.provider.provideTimeline(y.revive(t),n,o)}registerTimelineProvider(e,t,n,o){let i=new q,s=this.convertTimelineItem(t.id,o,i).bind(this),a;t.onDidChange&&(a=t.onDidChange(d=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...d,id:t.id}),this));let l=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(d,c,u){c?.resetCache&&(i.clear(),l.get(t.id)?.clear());let m=await t.provideTimeline(d,c,u);if(m==null)return;let g=s(d,c);return{...m,source:t.id,items:m.items.map(g)}},dispose(){for(let d of l.values())d.get(t.id)?.clear();a?.dispose(),i.dispose()}},n)}convertTimelineItem(e,t,n){return(o,i)=>{let s;if(i?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));let l=NU(o);s=a.get(l),s===void 0&&(s=new Map,a.set(l,s))}return a=>{let{iconPath:l,...d}=a,c=`${e}|${a.id??a.timestamp}`;s?.set(c,a);let u,m,g;a.iconPath&&(l instanceof ln?g={id:l.id,color:l.color}:y.isUri(l)?(u=l,m=l):{light:u,dark:m}=l);let v;return Mt.isMarkdownString(d.tooltip)?v=ce.from(d.tooltip):ke(d.tooltip)?v=d.tooltip:Mt.isMarkdownString(d.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),v=ce.from(d.detail)):ke(d.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),v=d.detail),{...d,id:d.id??void 0,handle:c,source:e,command:a.command?t.toInternal(a.command,n):void 0,icon:u,iconDark:m,themeIcon:g,tooltip:v,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),J(()=>{for(let o of this._itemsBySourceAndUriMap.values())o.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}};function NU(r){return r?.toString()}var QGe=p(4733,null),JGe=Gd("default-view-icon",le.window,p(4730,null)),g1;(t=>(t.ViewContainersRegistry="workbench.registry.view.containers",t.ViewsRegistry="workbench.registry.view"))(g1||={});var p1=class extends H{constructor(){super(...arguments);this._onDidRegister=this._register(new E);this.onDidRegister=this._onDidRegister.event;this._onDidDeregister=this._register(new E);this.onDidDeregister=this._onDidDeregister.event;this.viewContainers=new Map;this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(t,n,o){let i=this.get(t.id);if(i)return i;let s=t;return s.openCommandActionDescriptor=o?.doNotRegisterOpenCommand?void 0:s.openCommandActionDescriptor??{id:s.id},XC(this.viewContainers,n,[]).push(s),o?.isDefault&&this.defaultViewContainers.push(s),this._onDidRegister.fire({viewContainer:s,viewContainerLocation:n}),s}deregisterViewContainer(t){for(let n of this.viewContainers.keys()){let o=this.viewContainers.get(n),i=o?.indexOf(t);if(i!==-1){o?.splice(i,1),o.length===0&&this.viewContainers.delete(n),this._onDidDeregister.fire({viewContainer:t,viewContainerLocation:n});return}}}get(t){return this.all.filter(n=>n.id===t)[0]}getViewContainers(t){return[...this.viewContainers.get(t)||[]]}getViewContainerLocation(t){return[...this.viewContainers.keys()].filter(n=>this.getViewContainers(n).filter(o=>o?.id===t.id).length>0)[0]}getDefaultViewContainers(t){return this.defaultViewContainers.filter(n=>this.getViewContainerLocation(n)===t)}};ot.add(g1.ViewContainersRegistry,new p1);function Z7(r,e){let t=r.group??"9_more",n=e.group??"9_more";return t!==n?t.localeCompare(n):(r.order??5)-(e.order??5)}var m1=class extends H{constructor(){super(...arguments);this._onViewsRegistered=this._register(new E);this.onViewsRegistered=this._onViewsRegistered.event;this._onViewsDeregistered=this._register(new E);this.onViewsDeregistered=this._onViewsDeregistered.event;this._onDidChangeContainer=this._register(new E);this.onDidChangeContainer=this._onDidChangeContainer.event;this._onDidChangeViewWelcomeContent=this._register(new E);this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event;this._viewContainers=[];this._views=new Map;this._viewWelcomeContents=new gc}registerViews(t,n){this.registerViews2([{views:t,viewContainer:n}])}registerViews2(t){t.forEach(({views:n,viewContainer:o})=>this.addViews(n,o)),this._onViewsRegistered.fire(t)}deregisterViews(t,n){let o=this.removeViews(t,n);o.length&&this._onViewsDeregistered.fire({views:o,viewContainer:n})}moveViews(t,n){for(let o of this._views.keys())if(o!==n){let i=this.removeViews(t,o);i.length&&(this.addViews(i,n),this._onDidChangeContainer.fire({views:i,from:o,to:n}))}}getViews(t){return this._views.get(t)||[]}getView(t){for(let n of this._viewContainers){let o=(this._views.get(n)||[]).filter(i=>i.id===t)[0];if(o)return o}return null}getViewContainer(t){for(let n of this._viewContainers)if((this._views.get(n)||[]).filter(i=>i.id===t)[0])return n;return null}registerViewWelcomeContent(t,n){return this._viewWelcomeContents.add(t,n),this._onDidChangeViewWelcomeContent.fire(t),J(()=>{this._viewWelcomeContents.delete(t,n),this._onDidChangeViewWelcomeContent.fire(t)})}registerViewWelcomeContent2(t,n){let o=new Map;for(let[i,s]of n)this._viewWelcomeContents.add(t,s),o.set(i,J(()=>{this._viewWelcomeContents.delete(t,s),this._onDidChangeViewWelcomeContent.fire(t)}));return this._onDidChangeViewWelcomeContent.fire(t),o}getViewWelcomeContent(t){let n=[];return this._viewWelcomeContents.forEach(t,o=>n.push(o)),n.sort(Z7)}addViews(t,n){let o=this._views.get(n);o||(o=[],this._views.set(n,o),this._viewContainers.push(n));for(let i of t){if(this.getView(i.id)!==null)throw new Error(p(4731,null,i.id));o.push(i)}}removeViews(t,n){let o=this._views.get(n);if(!o)return[];let i=[],s=[];for(let a of o)t.includes(a)?i.push(a):s.push(a);return i.length&&(s.length?this._views.set(n,s):(this._views.delete(n),this._viewContainers.splice(this._viewContainers.indexOf(n),1))),i}};ot.add(g1.ViewsRegistry,new m1);var XGe=M("viewDescriptorService");var xr=class extends Error{constructor(t){super(p(4732,null,t));this.name="NoTreeViewError"}static is(t){return!!t&&t.name==="NoTreeViewError"}};var OC=class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){let t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}};function UU(r,e){if(ke(r))return{label:r};if(r&&typeof r=="object"&&r.label){let t;if(Array.isArray(r.highlights)&&(t=r.highlights.filter((n=>n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number")),t=t.length?t:void 0),ke(r.label))return{label:r.label,highlights:t};if(Mt.isMarkdownString(r.label))return A(e,"treeItemMarkdownLabel"),{label:ce.from(r.label),highlights:t}}}var NC=class extends H{constructor(t,n,o){super();this._proxy=t;this._commands=n;this._logService=o;this._treeViews=new Map;this._treeDragAndDropService=new OC;function i(s){return s&&s.$treeViewId&&(s.$treeItemHandle||s.$selectedTreeItems||s.$focusedTreeItem)}n.registerArgumentProcessor({processArgument:s=>i(s)?this._convertArgument(s):Array.isArray(s)&&s.length>0?s.map(a=>i(a)?this._convertArgument(a):a):s})}registerTreeDataProvider(t,n,o){let i=this.createTreeView(t,{treeDataProvider:n},o);return{dispose:()=>i.dispose()}}createTreeView(t,n,o){if(!n||!n.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");let i=n.dragAndDropController?.dropMimeTypes??[],s=n.dragAndDropController?.dragMimeTypes??[],a=!!n.dragAndDropController?.handleDrag,l=!!n.dragAndDropController?.handleDrop,d=this._createExtHostTreeView(t,n,o),c={showCollapseAll:!!n.showCollapseAll,canSelectMany:!!n.canSelectMany,dropMimeTypes:i,dragMimeTypes:s,hasHandleDrag:a,hasHandleDrop:l,manuallyManageCheckboxes:!!n.manageCheckboxStateManually},u=this._proxy.$registerTreeViewDataProvider(t,c),m={get onDidCollapseElement(){return d.onDidCollapseElement},get onDidExpandElement(){return d.onDidExpandElement},get selection(){return d.selectedElements},get onDidChangeSelection(){return d.onDidChangeSelection},get activeItem(){return A(o,"treeViewActiveItem"),d.focusedElement},get onDidChangeActiveItem(){return A(o,"treeViewActiveItem"),d.onDidChangeActiveItem},get visible(){return d.visible},get onDidChangeVisibility(){return d.onDidChangeVisibility},get onDidChangeCheckboxState(){return d.onDidChangeCheckboxState},get message(){return d.message},set message(g){Mr(g)&&A(o,"treeViewMarkdownMessage"),d.message=g},get title(){return d.title},set title(g){d.title=g},get description(){return d.description},set description(g){d.description=g},get badge(){return d.badge},set badge(g){g!==void 0&&l_.isViewBadge(g)?d.badge={value:Math.floor(Math.abs(g.value)),tooltip:g.tooltip}:g===void 0&&(d.badge=void 0)},reveal:(g,v)=>d.reveal(g,v),dispose:async()=>{await u,this._treeViews.delete(t),d.dispose()}};return this._register(m),m}async $getChildren(t,n){let o=this._treeViews.get(t);if(!o)return Promise.reject(new xr(t));if(!n){let s=await o.getChildren();return s?[[0,...s]]:void 0}let i=[];for(let s=0;s<n.length;s++){let a=n[s],l=await o.getChildren(a);l&&i.push([s,...l])}return i}async $handleDrop(t,n,o,i,s,a,l,d){let c=this._treeViews.get(t);if(!c)return Promise.reject(new xr(t));let u=Hd.toDataTransfer(o,async m=>(await this._proxy.$resolveDropFileData(t,n,m)).buffer);return l===t&&d&&await this._addAdditionalTransferItems(u,c,d,s,a),c.onDrop(u,i,s)}async _addAdditionalTransferItems(t,n,o,i,s){let a=this._treeDragAndDropService.removeDragOperationTransfer(s);if(a)(await a)?.forEach((l,d)=>{l&&t.set(d,l)});else if(s&&n.handleDrag){let l=n.handleDrag(o,t,i);this._treeDragAndDropService.addDragOperationTransfer(s,l),await l}return t}async $handleDrag(t,n,o,i){let s=this._treeViews.get(t);if(!s)return Promise.reject(new xr(t));let a=await this._addAdditionalTransferItems(new mr,s,n,i,o);if(!(!a||i.isCancellationRequested))return Hd.from(a)}async $hasResolve(t){let n=this._treeViews.get(t);if(!n)throw new xr(t);return n.hasResolve}$resolve(t,n,o){let i=this._treeViews.get(t);if(!i)throw new xr(t);return i.resolveTreeItem(n,o)}$setExpanded(t,n,o){let i=this._treeViews.get(t);if(!i)throw new xr(t);i.setExpanded(n,o)}$setSelectionAndFocus(t,n,o){let i=this._treeViews.get(t);if(!i)throw new xr(t);i.setSelectionAndFocus(n,o)}$setVisible(t,n){let o=this._treeViews.get(t);if(!o){if(!n)return;throw new xr(t)}o.setVisible(n)}$changeCheckboxState(t,n){let o=this._treeViews.get(t);if(!o)throw new xr(t);o.setCheckboxState(n)}_createExtHostTreeView(t,n,o){let i=this._register(new f1(t,n,this._proxy,this._commands.converter,this._logService,o));return this._treeViews.set(t,i),i}_convertArgument(t){let n=this._treeViews.get(t.$treeViewId),o=t;return n&&o.$treeItemHandle?n.getExtensionElement(o.$treeItemHandle):n&&t.$focusedTreeItem?n.focusedElement:null}},f1=class r extends H{constructor(t,n,o,i,s,a){super();this._viewId=t;this._proxy=o;this._commands=i;this._logService=s;this._extension=a;this._roots=void 0;this._elements=new Map;this._nodes=new Map;this._childrenFetchTokens=new Map;this._globalFetchTokenCounter=0;this._visible=!1;this._selectedHandles=[];this._focusedHandle=void 0;this._onDidExpandElement=this._register(new E);this.onDidExpandElement=this._onDidExpandElement.event;this._onDidCollapseElement=this._register(new E);this.onDidCollapseElement=this._onDidCollapseElement.event;this._onDidChangeSelection=this._register(new E);this.onDidChangeSelection=this._onDidChangeSelection.event;this._onDidChangeActiveItem=this._register(new E);this.onDidChangeActiveItem=this._onDidChangeActiveItem.event;this._onDidChangeVisibility=this._register(new E);this.onDidChangeVisibility=this._onDidChangeVisibility.event;this._onDidChangeCheckboxState=this._register(new E);this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event;this._onDidChangeData=this._register(new E);this._refreshPromise=Promise.resolve();this._refreshQueue=Promise.resolve();this._nodesToClear=new Set;this._message="";this._title="";this._refreshCancellationSource=new Re;if(a.contributes&&a.contributes.views)for(let u in a.contributes.views)for(let m of a.contributes.views[u])m.id===t&&(this._title=m.name);this._dataProvider=n.treeDataProvider,this._dndController=n.dragAndDropController,this._dataProvider.onDidChangeTreeData&&this._register(this._dataProvider.onDidChangeTreeData(u=>{Array.isArray(u)&&u.length===0||this._onDidChangeData.fire({message:!1,element:u})}));let l,d,c=Me.debounce(this._onDidChangeData.event,(u,m)=>(u||(u={message:!1,elements:[]}),m.element!==!1&&(l||(l=new Promise(g=>d=g),this._refreshPromise=this._refreshPromise.then(()=>l)),Array.isArray(m.element)?u.elements.push(...m.element):u.elements.push(m.element)),m.message&&(u.message=!0),u),200,!0);this._register(c(({message:u,elements:m})=>{m.length&&(m=Xo(m),this._refreshQueue=this._refreshQueue.then(()=>{let g=d;l=null;let v=Array.from(this._nodesToClear);return this._nodesToClear.clear(),this._debugLogRefresh("start",m,v),this._refresh(m).then(()=>(this._debugLogRefresh("done",m,v),this._clearNodes(v),g())).catch(h=>{let x=h instanceof Error?h.message:JSON.stringify(h);return this._debugLogRefresh("error",m,v),this._clearNodes(v),this._logService.error(`Unable to refresh tree view ${this._viewId}: ${x}`),g()})})),u&&this._proxy.$setMessage(this._viewId,ce.fromStrict(this._message)??"")}))}static{this.LABEL_HANDLE_PREFIX="0"}static{this.ID_HANDLE_PREFIX="1"}static{this.ROOT_FETCH_KEY=Symbol("extHostTreeViewRoot")}get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(t=>this.getExtensionElement(t)).filter(t=>!wt(t))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}_debugCollectHandles(t){let n=[];for(let i of t){if(!i){n.push("<root>");continue}let s=this._nodes.get(i);s&&n.push(s.item.handle)}let o=this._roots?.map(i=>i.item.handle)??[];return{changed:n,roots:o}}_debugLogRefresh(t,n,o){if(this._isDebugLogging())try{let i=this._debugCollectHandles(n);i.clearing=o.map(l=>l.item.handle);let s=i.changed.length,a=o.length;this._logService.debug(`[TreeView:${this._viewId}] refresh ${t} changed=${s} nodesToClear=${a} elements.size=${this._elements.size} nodes.size=${this._nodes.size} handles=${JSON.stringify(i)}`)}catch{this._logService.debug(`[TreeView:${this._viewId}] refresh ${t} (snapshot failed)`)}}_isDebugLogging(){try{let t=this._logService.getLevel();return t===2||t===1}catch{return!1}}async getChildren(t){let n=t?this.getExtensionElement(t):void 0;if(t&&!n)return this._logService.error(`No tree item with id '${t}' found.`),Promise.resolve([]);let o=this._getChildrenNodes(t);return o||(o=await this._fetchChildrenNodes(n)),o?o.map(i=>i.item):void 0}getExtensionElement(t){return this._elements.get(t)}reveal(t,n){n=n||{select:!0,focus:!1};let o=wt(n.select)?!0:n.select,i=wt(n.focus)?!1:n.focus,s=wt(n.expand)?!1:n.expand;return typeof this._dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):t?this._refreshPromise.then(()=>this._resolveUnknownParentChain(t)).then(a=>this._resolveTreeNode(t,a[a.length-1]).then(l=>this._proxy.$reveal(this._viewId,{item:l.item,parentChain:a.map(d=>d.item)},{select:o,focus:i,expand:s})),a=>this._logService.error(a)):this._proxy.$reveal(this._viewId,void 0,{select:o,focus:i,expand:s})}get message(){return this._message}set message(t){this._message=t,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(t){this._title=t,this._proxy.$setTitle(this._viewId,t,this._description)}get description(){return this._description}set description(t){this._description=t,this._proxy.$setTitle(this._viewId,this._title,t)}get badge(){return this._badge}set badge(t){this._badge?.value===t?.value&&this._badge?.tooltip===t?.tooltip||(this._badge=If.from(t),this._proxy.$setBadge(this._viewId,t))}setExpanded(t,n){let o=this.getExtensionElement(t);o&&(n?this._onDidExpandElement.fire(Object.freeze({element:o})):this._onDidCollapseElement.fire(Object.freeze({element:o})))}setSelectionAndFocus(t,n){let o=!Ht(this._selectedHandles,t);this._selectedHandles=t;let i=this._focusedHandle!==n;this._focusedHandle=n,o&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),i&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(t){t!==this._visible&&(this._visible=t,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(t){let n=(await Promise.all(t.map(async o=>{let i=this.getExtensionElement(o.treeItemHandle);return i?{extensionItem:i,treeItem:await this._dataProvider.getTreeItem(i),newState:o.newState?1:0}:Promise.resolve(void 0)}))).filter(o=>o!==void 0);n.forEach(o=>{o.treeItem.checkboxState=o.newState?1:0}),this._onDidChangeCheckboxState.fire({items:n.map(o=>[o.extensionItem,o.newState])})}async handleDrag(t,n,o){let i=[];for(let s of t){let a=this.getExtensionElement(s);a&&i.push(a)}if(!(!this._dndController?.handleDrag||i.length===0))return await this._dndController.handleDrag(i,n,o),n}get hasHandleDrag(){return!!this._dndController?.handleDrag}async onDrop(t,n,o){let i=n?this.getExtensionElement(n):void 0;if(!(!i&&n||!this._dndController?.handleDrop))return Qt(()=>this._dndController?.handleDrop?this._dndController.handleDrop(i,t,o):void 0)}get hasResolve(){return!!this._dataProvider.resolveTreeItem}async resolveTreeItem(t,n){if(!this._dataProvider.resolveTreeItem)return;let o=this._elements.get(t);if(o){let i=this._nodes.get(o);if(i){let s=await this._dataProvider.resolveTreeItem(i.extensionItem,o,n)??i.extensionItem;return this._validateTreeItem(s),i.item.tooltip=this._getTooltip(s.tooltip),i.item.command=this._getCommand(i.disposableStore,s.command),i.item}}}_resolveUnknownParentChain(t){return this._resolveParent(t).then(n=>n?this._resolveUnknownParentChain(n).then(o=>this._resolveTreeNode(n,o[o.length-1]).then(i=>(o.push(i),o))):Promise.resolve([]))}_resolveParent(t){let n=this._nodes.get(t);return n?Promise.resolve(n.parent?this._elements.get(n.parent.item.handle):void 0):Qt(()=>this._dataProvider.getParent(t))}async _resolveTreeNode(t,n){let o=this._nodes.get(t);if(o)return o;let i=await Qt(()=>this._dataProvider.getTreeItem(t)),s=this._createHandle(t,i,n,!0);await this.getChildren(n?n.item.handle:void 0);let a=this.getExtensionElement(s);if(a){let l=this._nodes.get(a);if(l)return l}throw this._logService.error(`[TreeView:${this._viewId}] Failed to resolve tree node for element ${s}`),this._proxy.$logResolveTreeNodeFailure(this._extension.identifier.value),new Error(`Cannot resolve tree item for element ${s} from extension ${this._extension.identifier.value}`)}_getChildrenNodes(t){if(t){let n;if(typeof t=="string"){let o=this.getExtensionElement(t);n=o?this._nodes.get(o):void 0}else n=t;return n&&n.children||void 0}return this._roots}_getFetchKey(t){return t??r.ROOT_FETCH_KEY}async _fetchChildrenNodes(t){this._addChildrenToClear(t);let n=this._getFetchKey(t),o=++this._globalFetchTokenCounter;this._childrenFetchTokens.set(n,o);let i=new Re(this._refreshCancellationSource.token);try{let s=await this._dataProvider.getChildren(t);if(this._childrenFetchTokens.get(n)!==o)return;let a=t?this._nodes.get(t):void 0;if(i.token.isCancellationRequested)return;let l=Ze(s||[]),d=await Promise.all(Ze(l).map(u=>this._dataProvider.getTreeItem(u)));if(this._childrenFetchTokens.get(n)!==o||i.token.isCancellationRequested)return;let c=d.map((u,m)=>u?this._createAndRegisterTreeNode(l[m],u,a):null);return this._childrenFetchTokens.get(n)!==o?void 0:Ze(c)}finally{i.dispose()}}_refresh(t){if(t.some(o=>!o))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new Re,this._addChildrenToClear(),this._proxy.$refresh(this._viewId);{let o=this._getHandlesToRefresh(t);if(o.length)return this._refreshHandles(o)}return Promise.resolve(void 0)}_getHandlesToRefresh(t){let n=new Set,o=t.map(s=>this._nodes.get(s));for(let s of o)if(s&&!n.has(s.item.handle)){let a=s;for(;a&&a.parent&&o.findIndex(l=>a&&a.parent&&l&&l.item.handle===a.parent.item.handle)===-1;){let l=this._elements.get(a.parent.item.handle);a=l?this._nodes.get(l):void 0}a&&!a.parent&&n.add(s.item.handle)}let i=[];return n.forEach(s=>{let a=this._elements.get(s);if(a){let l=this._nodes.get(a);l&&(!l.parent||!n.has(l.parent.item.handle))&&i.push(s)}}),i}_refreshHandles(t){let n={};return Promise.all(t.map(o=>this._refreshNode(o).then(i=>{i&&(n[o]=i.item)}))).then(()=>Object.keys(n).length?this._proxy.$refresh(this._viewId,n):void 0)}_refreshNode(t){let n=this.getExtensionElement(t);if(n){let o=this._nodes.get(n);if(o)return this._addChildrenToClear(n),Qt(()=>this._dataProvider.getTreeItem(n)).then(i=>{if(i){let s=this._createTreeNode(n,i,o.parent);return this._updateNodeCache(n,s,o,o.parent),o.dispose(),s}return null})}return Promise.resolve(null)}_createAndRegisterTreeNode(t,n,o){let i=n.id?`${r.ID_HANDLE_PREFIX}/${n.id}`:void 0;if(i){let a=this._elements.get(i);if(a){if(a!==t)throw new Error(p(3172,null,n.id));let l=this._nodes.get(a);if(l){let d=this._createTreeNode(t,n,o);return this._updateNodeCache(t,d,l,o),l.dispose(),d}}}let s=this._createTreeNode(t,n,o);return this._addNodeToCache(t,s),this._addNodeToParentCache(s,o),s}_getTooltip(t){return Mt.isMarkdownString(t)?ce.from(t):t}_getCommand(t,n){return n?{...this._commands.toInternal(n,t),originalId:n.command}:void 0}_getCheckbox(t){if(t.checkboxState===void 0)return;let n,o,i;return typeof t.checkboxState=="number"?n=t.checkboxState:(n=t.checkboxState.state,o=t.checkboxState.tooltip,i=t.checkboxState.accessibilityInformation),{isChecked:n===1,tooltip:o,accessibilityInformation:i}}_validateTreeItem(t){if(!Ei.isTreeItem(t,this._extension))throw new Error(`Extension ${this._extension.identifier.value} has provided an invalid tree item.`)}_createTreeNode(t,n,o){this._validateTreeItem(n);let i=this._register(new q),s=this._createHandle(t,n,o),a=this._getLightIconPath(n);return{item:{handle:s,parentHandle:o?o.item.handle:void 0,label:UU(n.label,this._extension),description:n.description,resourceUri:n.resourceUri,tooltip:this._getTooltip(n.tooltip),command:this._getCommand(i,n.command),contextValue:n.contextValue,icon:a,iconDark:this._getDarkIconPath(n)||a,themeIcon:this._getThemeIcon(n),collapsibleState:wt(n.collapsibleState)?0:n.collapsibleState,accessibilityInformation:n.accessibilityInformation,checkbox:this._getCheckbox(n)},extensionItem:n,parent:o,children:void 0,disposableStore:i,dispose(){i.dispose()}}}_getThemeIcon(t){return t.iconPath instanceof ln?t.iconPath:void 0}_createHandle(t,{id:n,label:o,resourceUri:i},s,a){if(n)return`${r.ID_HANDLE_PREFIX}/${n}`;let l=UU(o,this._extension),d=s?s.item.handle:r.LABEL_HANDLE_PREFIX,c="";l&&(Mr(l.label)?c=l.label.value:c=l.label);let u=c||(i?Bt(i):"");u=u.indexOf("/")!==-1?u.replace("/","//"):u;let m=this._nodes.has(t)?this._nodes.get(t).item.handle:void 0,g=this._getChildrenNodes(s)||[],v,h=0;do{if(v=`${d}/${h}:${u}`,a||!this._elements.has(v)||m===v)break;h++}while(h<=g.length);return v}_getLightIconPath(t){if(t.iconPath&&!(t.iconPath instanceof ln))return typeof t.iconPath=="string"||y.isUri(t.iconPath)?this._getIconPath(t.iconPath):this._getIconPath(t.iconPath.light)}_getDarkIconPath(t){if(t.iconPath&&!(t.iconPath instanceof ln)&&t.iconPath.dark)return this._getIconPath(t.iconPath.dark)}_getIconPath(t){return y.isUri(t)?t:y.file(t)}_addNodeToCache(t,n){this._elements.set(n.item.handle,t),this._nodes.set(t,n)}_updateNodeCache(t,n,o,i){this._elements.delete(n.item.handle),this._nodes.delete(t),n.item.handle!==o.item.handle&&this._elements.delete(o.item.handle),this._addNodeToCache(t,n);let s=this._getChildrenNodes(i)||[],a=s.filter(l=>l.item.handle===o.item.handle)[0];a&&s.splice(s.indexOf(a),1,n)}_addNodeToParentCache(t,n){n?(n.children||(n.children=[]),n.children.push(t)):(this._roots||(this._roots=[]),this._roots.push(t))}_addChildrenToClear(t){if(t){let n=this._nodes.get(t);if(n){if(n.children)for(let o of n.children){this._nodesToClear.add(o);let i=this._elements.get(o.item.handle);i&&(this._addChildrenToClear(i),this._nodes.delete(i),this._elements.delete(o.item.handle))}n.children=void 0}}else this._addAllToClear()}_addAllToClear(){this._roots=void 0,this._nodes.forEach(t=>{this._nodesToClear.add(t)}),this._nodes.clear(),this._elements.clear(),this._childrenFetchTokens.clear()}_clearNodes(t){wn(t)}_clearAll(){this._roots=void 0,this._elements.clear(),wn(this._nodes.values()),this._nodes.clear(),wn(this._nodesToClear),this._nodesToClear.clear(),this._childrenFetchTokens.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this._clearAll(),this._proxy.$disposeTree(this._viewId)}};var UC=class r{constructor(e){this._openers=new Map;this._proxy=e.getProxy(N.MainThreadUriOpeners)}static{this.supportedSchemes=new Set([$.http,$.https])}registerExternalUriOpener(e,t,n,o){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);let i=o.schemes.find(s=>!r.supportedSchemes.has(s));if(i)throw new Error(`Scheme '${i}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,n),this._proxy.$registerUriOpener(t,o.schemes,e,o.label),J(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,n){let o=this._openers.get(e);if(!o)throw new Error(`Unknown opener with id: ${e}`);let i=y.revive(t);return o.canOpenExternalUri(i,n)}async $openUri(e,t,n){let o=this._openers.get(e);if(!o)throw new Error(`Unknown opener id: '${e}'`);return o.openExternalUri(y.revive(t.resolvedUri),{sourceUri:y.revive(t.sourceUri)},n)}};var h1=class extends H{constructor(t,n,o,i){super();this.#a=void 0;this.#d=!0;this.#r=!1;this.#u=this._register(new E);this.onDidDispose=this.#u.event;this.#p=this._register(new E);this.onDidChangeViewState=this.#p.event;this.#e=t,this.#t=n,this.#o=o,this.#n=i.viewType,this.#s=i.panelOptions,this.#a=i.viewColumn,this.#i=i.title,this.#c=i.active}#e;#t;#n;#o;#s;#i;#l;#a;#d;#c;#r;#u;#p;dispose(){this.#r||(this.#r=!0,this.#u.fire(),this.#t.$disposeWebview(this.#e),this.#o.dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),this.#o}get viewType(){return this.assertNotDisposed(),this.#n}get title(){return this.assertNotDisposed(),this.#i}set title(t){this.assertNotDisposed(),this.#i!==t&&(this.#i=t,this.#t.$setTitle(this.#e,t))}get iconPath(){return this.assertNotDisposed(),this.#l}set iconPath(t){this.assertNotDisposed(),this.#l!==t&&(this.#l=t,y.isUri(t)?this.#t.$setIconPath(this.#e,{light:t,dark:t}):this.#t.$setIconPath(this.#e,t))}get options(){return this.#s}get viewColumn(){if(this.assertNotDisposed(),!(typeof this.#a=="number"&&this.#a<0))return this.#a}get active(){return this.assertNotDisposed(),this.#c}get visible(){return this.assertNotDisposed(),this.#d}_updateViewState(t){this.#r||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(this.#c=t.active,this.#d=t.visible,this.#a=t.viewColumn,this.#p.fire({webviewPanel:this}))}reveal(t,n){this.assertNotDisposed(),this.#t.$reveal(this.#e,{viewColumn:typeof t>"u"?void 0:_t.from(t),preserveFocus:!!n})}assertNotDisposed(){if(this.#r)throw new Error("Webview is disposed")}},FC=class r extends H{constructor(t,n,o){super();this.webviews=n;this.workspace=o;this._webviewPanels=new Map;this._serializers=new Map;this._proxy=t.getProxy(N.MainThreadWebviewPanels)}static newHandle(){return pt()}dispose(){super.dispose(),this._webviewPanels.forEach(t=>t.dispose()),this._webviewPanels.clear()}createWebviewPanel(t,n,o,i,s={}){let a=typeof i=="object"?i.viewColumn:i,l={viewColumn:_t.from(a),preserveFocus:typeof i=="object"&&!!i.preserveFocus},d=Ws(t),c=r.newHandle();this._proxy.$createWebviewPanel(Yd(t),c,n,{title:o,panelOptions:e9(s),webviewOptions:vR(t,this.workspace,s),serializeBuffersForPostMessage:d},l);let u=this.webviews.createNewWebview(c,s,t);return this.createNewWebviewPanel(c,n,o,a,s,u,!0)}$onDidChangeWebviewPanelViewStates(t){let n=Object.keys(t);n.sort((o,i)=>{let s=t[o],a=t[i];return s.active?1:a.active?-1:+s.visible-+a.visible});for(let o of n){let i=this.getWebviewPanel(o);if(!i)continue;let s=t[o];i._updateViewState({active:s.active,visible:s.visible,viewColumn:_t.to(s.position)})}}async $onDidDisposeWebviewPanel(t){this.getWebviewPanel(t)?.dispose(),this._webviewPanels.delete(t),this.webviews.deleteWebview(t)}registerWebviewPanelSerializer(t,n,o){if(this._serializers.has(n))throw new Error(`Serializer for '${n}' already registered`);return this._serializers.set(n,{serializer:o,extension:t}),this._proxy.$registerSerializer(n,{serializeBuffersForPostMessage:Ws(t)}),new fe(()=>{this._serializers.delete(n),this._proxy.$unregisterSerializer(n)})}async $deserializeWebviewPanel(t,n,o,i){let s=this._serializers.get(n);if(!s)throw new Error(`No serializer found for '${n}'`);let{serializer:a,extension:l}=s,d=this.webviews.createNewWebview(t,o.webviewOptions,l),c=this.createNewWebviewPanel(t,n,o.title,i,o.panelOptions,d,o.active);await a.deserializeWebviewPanel(c,o.state)}createNewWebviewPanel(t,n,o,i,s,a,l){let d=new h1(t,this._proxy,a,{viewType:n,title:o,viewColumn:i,panelOptions:s,active:l});return this._webviewPanels.set(t,d),d}getWebviewPanel(t){return this._webviewPanels.get(t)}};function e9(r){return{enableFindWidget:r.enableFindWidget,retainContextWhenHidden:r.retainContextWhenHidden}}var v1=class extends H{constructor(t,n,o,i,s,a){super();this.#s=!1;this.#c=this._register(new E);this.onDidChangeVisibility=this.#c.event;this.#r=this._register(new E);this.onDidDispose=this.#r.event;this.#n=o,this.#l=i,this.#e=t,this.#t=n,this.#o=s,this.#i=a}#e;#t;#n;#o;#s;#i;#l;#a;#d;dispose(){this.#s||(this.#s=!0,this.#r.fire(),this.#o.dispose(),super.dispose())}#c;#r;get title(){return this.assertNotDisposed(),this.#l}set title(t){this.assertNotDisposed(),this.#l!==t&&(this.#l=t,this.#t.$setWebviewViewTitle(this.#e,t))}get description(){return this.assertNotDisposed(),this.#a}set description(t){this.assertNotDisposed(),this.#a!==t&&(this.#a=t,this.#t.$setWebviewViewDescription(this.#e,t))}get visible(){return this.#i}get webview(){return this.#o}get viewType(){return this.#n}_setVisible(t){t===this.#i||this.#s||(this.#i=t,this.#c.fire())}get badge(){return this.assertNotDisposed(),this.#d}set badge(t){this.assertNotDisposed(),!(t?.value===this.#d?.value&&t?.tooltip===this.#d?.tooltip)&&(this.#d=If.from(t),this.#t.$setWebviewViewBadge(this.#e,t))}show(t){this.assertNotDisposed(),this.#t.$show(this.#e,!!t)}assertNotDisposed(){if(this.#s)throw new Error("Webview is disposed")}},HC=class{constructor(e,t){this._extHostWebview=t;this._viewProviders=new Map;this._webviewViews=new Map;this._proxy=e.getProxy(N.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,n,o){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:n,extension:e}),this._proxy.$registerWebviewViewProvider(Yd(e),t,{retainContextWhenHidden:o?.retainContextWhenHidden,serializeBuffersForPostMessage:Ws(e)}),new fe(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,n,o,i){let s=this._viewProviders.get(t);if(!s)throw new Error(`No view provider found for '${t}'`);let{provider:a,extension:l}=s,d=this._extHostWebview.createNewWebview(e,{},l),c=new v1(e,this._proxy,t,n,d,!0);this._webviewViews.set(e,c),await a.resolveWebviewView(c,{state:o},i)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){let t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){let t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}};var Im=class extends H{constructor(t,n){super();this._commands=n;this._handlePool=0;this._providers=new Map;this._itemPool=0;this._globalItems=new Map;this._providerItems=new Map;this._proxy=t.getProxy(N.MainThreadChatContext)}async $provideWorkspaceChatContext(t,n){this._clearProviderItems(t);let o=this._providers.get(t);if(!o||o.type!=="workspace")throw new Error("Workspace context provider not found");let i=o.provider,s=await i.provideWorkspaceChatContext?.(n)??await i.provideChatContext?.(n)??[];return this._convertItems(t,s)}async $provideExplicitChatContext(t,n){this._clearProviderItems(t);let o=this._providers.get(t);if(!o||o.type!=="explicit")throw new Error("Explicit context provider not found");let i=o.provider,s=await i.provideExplicitChatContext?.(n)??await i.provideChatContext?.(n)??[];return this._convertItems(t,s)}async $resolveExplicitChatContext(t,n,o){let i=this._providers.get(t);if(!i||i.type!=="explicit")throw new Error("Explicit context provider not found");let s=i.provider,a=this._globalItems.get(n.handle);if(!a)throw new Error("Chat context item not found");return this._doResolve((s.resolveExplicitChatContext??s.resolveChatContext)?.bind(s),n,a,o)}async $provideResourceChatContext(t,n,o){let i=this._providers.get(t);if(!i||i.type!=="resource")throw new Error("Resource context provider not found");let s=i.provider,a=await s.provideResourceChatContext?.({resource:y.revive(n.resource)},o)??await s.provideChatContext?.({resource:y.revive(n.resource)},o);if(!a)return;if(a.label===void 0&&a.resourceUri===void 0)throw new Error("ChatContextItem must have either a label or a resourceUri");let d={handle:this._addTrackedItem(t,a),icon:a.icon,label:a.label,resourceUri:a.resourceUri,modelDescription:a.modelDescription,tooltip:a.tooltip?ce.from(a.tooltip):void 0,value:n.withValue?a.value:void 0,command:a.command?{id:a.command.command}:void 0};if(n.withValue&&!d.value){let c=await(s.resolveResourceChatContext??s.resolveChatContext)?.bind(s)(a,o);d.value=c?.value,d.tooltip=c?.tooltip?ce.from(c.tooltip):d.tooltip}return d}async $resolveResourceChatContext(t,n,o){let i=this._providers.get(t);if(!i||i.type!=="resource")throw new Error("Resource context provider not found");let s=i.provider,a=this._globalItems.get(n.handle);if(!a)throw new Error("Chat context item not found");return this._doResolve((s.resolveResourceChatContext??s.resolveChatContext)?.bind(s),n,a,o)}async $executeChatContextItemCommand(t){let n=this._globalItems.get(t);if(!n)throw new Error("Chat context item not found");if(!n.command)throw new Error("Chat context item has no command");let o=n.command.arguments?[n,...n.command.arguments]:[n];await this._commands.executeCommand(n.command.command,...o)}registerChatWorkspaceContextProvider(t,n){let o=this._handlePool++,i=new q;return this._providers.set(o,{type:"workspace",provider:n,disposables:i}),this._listenForWorkspaceContextChanges(o,n,i),this._proxy.$registerChatWorkspaceContextProvider(o,t),{dispose:()=>{this._providers.delete(o),this._clearProviderItems(o),this._providerItems.delete(o),this._proxy.$unregisterChatContextProvider(o),i.dispose()}}}registerChatExplicitContextProvider(t,n){let o=this._handlePool++,i=new q;return this._providers.set(o,{type:"explicit",provider:n,disposables:i}),this._proxy.$registerChatExplicitContextProvider(o,t),{dispose:()=>{this._providers.delete(o),this._clearProviderItems(o),this._providerItems.delete(o),this._proxy.$unregisterChatContextProvider(o),i.dispose()}}}registerChatResourceContextProvider(t,n,o){let i=this._handlePool++,s=new q;return this._providers.set(i,{type:"resource",provider:o,disposables:s}),this._proxy.$registerChatResourceContextProvider(i,n,Jr.from(t)),{dispose:()=>{this._providers.delete(i),this._clearProviderItems(i),this._providerItems.delete(i),this._proxy.$unregisterChatContextProvider(i),s.dispose()}}}registerChatContextProvider(t,n,o){let i=[];if(o.provideWorkspaceChatContext){let s={onDidChangeWorkspaceChatContext:o.onDidChangeWorkspaceChatContext,provideWorkspaceChatContext:a=>o.provideWorkspaceChatContext(a)};i.push(this.registerChatWorkspaceContextProvider(n,s))}if(o.provideChatContextExplicit){let s={provideExplicitChatContext:a=>o.provideChatContextExplicit(a),resolveExplicitChatContext:o.resolveChatContext?(a,l)=>o.resolveChatContext(a,l):a=>a};i.push(this.registerChatExplicitContextProvider(n,s))}if(o.provideChatContextForResource&&t){let s={provideResourceChatContext:(a,l)=>o.provideChatContextForResource(a,l),resolveResourceChatContext:o.resolveChatContext?(a,l)=>o.resolveChatContext(a,l):a=>a};i.push(this.registerChatResourceContextProvider(t,n,s))}return{dispose:()=>{for(let s of i)s.dispose()}}}_clearProviderItems(t){let n=this._providerItems.get(t);if(n){for(let o of n)this._globalItems.delete(o);n.clear()}}_addTrackedItem(t,n){let o=this._itemPool++;return this._globalItems.set(o,n),this._providerItems.has(t)||this._providerItems.set(t,new Set),this._providerItems.get(t).add(o),o}_convertItems(t,n){let o=[];for(let i of n){if(i.label===void 0&&i.resourceUri===void 0)throw new Error("ChatContextItem must have either a label or a resourceUri");let s=this._addTrackedItem(t,i);o.push({handle:s,icon:i.icon,label:i.label,resourceUri:i.resourceUri,modelDescription:i.modelDescription,tooltip:i.tooltip?ce.from(i.tooltip):void 0,value:i.value,command:i.command?{id:i.command.command}:void 0})}return o}async _doResolve(t,n,o,i){let s=await t(o,i);return s?{handle:n.handle,icon:s.icon,label:s.label,resourceUri:s.resourceUri,modelDescription:s.modelDescription,tooltip:s.tooltip?ce.from(s.tooltip):void 0,value:s.value,command:s.command?{id:s.command.command}:void 0}:n}_listenForWorkspaceContextChanges(t,n,o){if(!n.onDidChangeWorkspaceChatContext)return;let i=async()=>{let s=await n.provideWorkspaceChatContext?.(be.None)??await n.provideChatContext?.(be.None),a=this._convertItems(t,s??[]);return this._proxy.$updateWorkspaceContextItems(t,a)};o.add(n.onDidChangeWorkspaceChatContext(async()=>i())),i()}dispose(){super.dispose();for(let{disposables:t}of this._providers.values())t.dispose()}};Im=D([C(0,ge),C(1,Ro)],Im);function FU(r){let e=r.get(nt),t=r.get(lr),n=r.get(ll),o=r.get(Mo),i=r.get(Wn),s=r.get(cl),a=r.get(ao),l=r.get(ca),d=r.get(ge),c=r.get(dp),u=r.get(up),m=r.get(Ho),g=r.get(ue),v=r.get(mp),h=r.get(Vs),x=r.get(zd),S=r.get(Bx),T=r.get(Kd),P=r.get(_p),L=r.get(Bs),Y=r.get(Mp),G=r.get(qd),z=r.get(Sp),K=r.get(Cp),Q=r.get(Xf),X=r.get(jx),B=r.get(Jx);d.set(me.ExtHostFileSystemInfo,t),d.set(me.ExtHostLogLevelServiceShape,m),d.set(me.ExtHostWorkspace,i),d.set(me.ExtHostConfiguration,a),d.set(me.ExtHostExtensionService,o),d.set(me.ExtHostStorage,c),d.set(me.ExtHostTunnelService,v),d.set(me.ExtHostWindow,x),d.set(me.ExtHostPower,S),d.set(me.ExtHostUrls,T),d.set(me.ExtHostSecretState,P),d.set(me.ExtHostTelemetry,s),d.set(me.ExtHostEditorTabs,L),d.set(me.ExtHostManagedSockets,Y),d.set(me.ExtHostProgress,G),d.set(me.ExtHostAuthentication,z),d.set(me.ExtHostChatProvider,K),d.set(me.ExtHostDataChannels,X),d.set(me.ExtHostMeteredConnection,B);let He=d.set(me.ExtHostDecorations,r.get(Cx)),Ge=d.set(me.ExtHostDocumentsAndEditors,r.get(Zr)),Ve=d.set(me.ExtHostCommands,r.get(Ro)),ne=d.set(me.ExtHostTerminalService,r.get(Yr)),te=d.set(me.ExtHostTerminalShellIntegration,r.get(zx)),Z=d.set(me.ExtHostDebugService,r.get(Ux)),re=d.set(me.ExtHostSearch,r.get(Vx)),ie=d.set(me.ExtHostTask,r.get(Rx)),we=d.set(me.ExtHostOutputService,r.get(Sx)),Ne=d.set(me.ExtHostLocalization,r.get(Dp)),Ae=d.set(me.ExtHostDocuments,new IS(d,Ge)),et=d.set(me.ExtHostDocumentContentProviders,new bS(d,Ge,g)),bt=d.set(me.ExtHostDocumentSaveParticipant,new yS(g,Ae,d.getProxy(N.MainThreadBulkEdits))),Ke=d.set(me.ExtHostNotebook,new CC(d,Ve,Ge,Ae,n,re,g)),Kt=d.set(me.ExtHostNotebookDocuments,new EC(Ke)),nn=d.set(me.ExtHostNotebookEditors,new hm(g,Ke)),zn=d.set(me.ExtHostNotebookKernels,new vm(d,e,Ke,Ve,g)),Ks=d.set(me.ExtHostNotebookRenderers,new kC(d,Ke)),qs=d.set(me.ExtHostNotebookDocumentSaveParticipant,new TC(g,Ke,d.getProxy(N.MainThreadBulkEdits))),he=d.set(me.ExtHostEditors,new AC(d,Ge)),Sr=d.set(me.ExtHostTreeViews,new NC(d.getProxy(N.MainThreadTreeViews),Ve,g)),mt=d.set(me.ExtHostEditorInsets,new cS(d.getProxy(N.MainThreadEditorInsets),he,e.remote)),Wi=d.set(me.ExtHostDiagnostics,new Ir(d,g,t,Ge)),Go=d.set(me.ExtHostLanguages,new cC(d,Ae,Ve.converter,l)),Ue=d.set(me.ExtHostLanguageFeatures,new KS(d,l,Ae,Ve,Wi,g,h,s)),Cl=d.set(me.ExtHostCodeMapper,new uS(d)),Tl=d.set(me.ExtHostFileSystem,new TS(d,Ue)),jo=d.set(me.ExtHostFileSystemEventService,new ES(d,g,Ge)),$i=d.set(me.ExtHostQuickOpen,RU(d,i,Ve)),El=d.set(me.ExtHostSCM,new bm(d,Ve,Ae,g)),ac=d.set(me.ExtHostQuickDiff,new PC(d,l)),wl=d.set(me.ExtHostShare,new DC(d,l)),co=d.set(me.ExtHostComments,tU(d,Ve,Ae)),Gs=d.set(me.ExtHostLabelService,new kS(d)),Ft=d.set(me.ExtHostTheming,new ym(d)),Mn=d.set(me.ExtHostTimeline,new LC(d,Ve)),kl=d.set(me.ExtHostWebviews,new mS(d,e.remote,i,g,h)),lc=d.set(me.ExtHostWebviewPanels,new FC(d,kl,i)),_l=d.set(me.ExtHostCustomEditors,new fS(d,Ae,u,kl,lc)),dc=d.set(me.ExtHostWebviewViews,new HC(d,kl)),R=d.set(me.ExtHostTesting,r.get(Qd)),F=d.set(me.ExtHostUriOpeners,new UC(d)),W=d.set(me.ExtHostProfileContentHandlers,new _C(d)),Se=d.set(me.ExtHostChatOutputRenderer,new sS(d,kl));d.set(me.ExtHostInteractive,new wS(d,Ke,Ge,Ve,g));let Pe=d.set(me.ExtHostLanguageModelTools,new dC(d,K)),Zt=d.set(me.ExtHostChatSessions,new yl(Ve,K,d,g)),We=d.set(me.ExtHostChatAgents2,new oS(d,g,Ve,Ae,Ge,K,Wi,Pe)),gn=d.set(me.ExtHostChatContext,new Im(d,Ve)),qt=d.set(me.ExtHostAiRelatedInformation,new Yx(d)),oe=d.set(me.ExtHostAiEmbeddingVector,new SS(d)),Qo=d.set(me.ExtHostAiSettingsSearch,new Zx(d)),Xt=d.set(me.ExtHostStatusBar,new MC(d,Ve.converter)),on=d.set(me.ExtHostSpeech,new RC(d)),fn=d.set(me.ExtHostEmbeddings,new xS(d));d.set(me.ExtHostMcp,r.get(Xf));let Ao=Object.values(me);d.assertRegistered(Ao);let Be=new Zp(d,Ge),Ye=new dS(d),Et=new mm(d,g),Ot=new vS(d),Cn=new lS(d);return tS.register(Ve),function(k,bo,zi){function ae(b){return(I,_,Ee)=>{let st=b(Yt=>{try{I.call(_,Yt)}catch(lF){_m(new Pc(k.identifier,lF,"FAILED to handle event"))}});return Ee?.push(st),st}}let yt=(function(){let b=!k.isUnderDevelopment;function I(){b||(g.info(`Extension '${k.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),b=!0)}return function _(Ee){if(Array.isArray(Ee))Ee.forEach(_);else if(typeof Ee=="string")I();else{let st=Ee;typeof st.scheme>"u"&&I(),typeof st.exclusive=="boolean"&&A(k,"documentFiltersExclusive")}return Ee}})(),KU={getSession(b,I,_){return(typeof _?.forceNewSession=="object"&&_.forceNewSession.learnMore||typeof _?.createIfNone=="object"&&_.createIfNone.learnMore)&&A(k,"authLearnMore"),_?.authorizationServer&&A(k,"authIssuers"),z.getSession(k,b,I,_)},getAccounts(b){return z.getAccounts(b)},async hasSession(b,I){return A(k,"authSession"),!!await z.getSession(k,b,I,{silent:!0})},get onDidChangeSessions(){return ae(z.getExtensionScopedSessionsEvent(k.identifier.value))},registerAuthenticationProvider(b,I,_,Ee){return Ee?.supportedAuthorizationServers&&A(k,"authIssuers"),z.registerAuthenticationProvider(b,I,_,Ee)}},qU={registerCommand(b,I,_){return Ve.registerCommand(!0,b,I,_,void 0,k)},registerTextEditorCommand(b,I,_){return Ve.registerCommand(!0,b,(...Ee)=>{let st=he.getActiveTextEditor();if(!st){g.warn("Cannot execute "+b+" because there is no active text editor.");return}return st.edit(Yt=>{I.apply(_,[st,Yt,...Ee])}).then(Yt=>{Yt||g.warn("Edits from command "+b+" were not applied.")},Yt=>{g.warn("An error occurred while running command "+b,Yt)})},void 0,void 0,k)},registerDiffInformationCommand:(b,I,_)=>(A(k,"diffCommand"),Ve.registerCommand(!0,b,async(...Ee)=>{let st=Ge.activeEditor(!0);if(!st){g.warn("Cannot execute "+b+" because there is no active text editor.");return}let Yt=await he.getDiffInformation(st.id);I.apply(_,[Yt,...Ee])},void 0,void 0,k)),executeCommand(b,...I){return Ve.executeCommand(b,...I)},getCommands(b=!1){return Ve.getCommands(b)}},x1={get machineId(){return e.telemetryInfo.machineId},get devDeviceId(){return A(k,"devDeviceId"),e.telemetryInfo.devDeviceId??e.telemetryInfo.machineId},get isAppPortable(){return A(k,"envIsAppPortable"),e.environment.isPortable??!1},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return Ye.value},get shell(){return ne.getDefaultShell(!1)},get onDidChangeShell(){return ae(ne.onDidChangeShell)},get isTelemetryEnabled(){return s.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return ae(s.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return A(k,"telemetry"),s.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return A(k,"telemetry"),ae(s.onDidChangeTelemetryConfiguration)},get isMeteredConnection(){return A(k,"envIsConnectionMetered"),B.isConnectionMetered},get onDidChangeMeteredConnection(){return A(k,"envIsConnectionMetered"),ae(B.onDidChangeIsConnectionMetered)},get isNewAppInstall(){return $P(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(b,I){return Lf.validateSender(b),s.instantiateLogger(k,b,I)},async openExternal(b,I){return x.openUri(b,{allowTunneling:e.remote.isRemote??(e.remote.authority?await v.hasTunnelProvider():!1),allowContributedOpeners:I?.allowContributedOpeners})},async asExternalUri(b){if(b.scheme===e.environment.appUriScheme)return T.createAppUri(b);try{return await x.asExternalUri(b,{allowTunneling:!!e.remote.authority})}catch(I){if(ov(b,$.http)||ov(b,$.https))return b;throw I}},get remoteName(){return Xm(e.remote.authority)},get remoteAuthority(){return A(k,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return g.getLevel()},get onDidChangeLogLevel(){return ae(g.onDidChangeLogLevel)},get appQuality(){return A(k,"resolvers"),e.quality},get appCommit(){return A(k,"resolvers"),e.commit},getDataChannel(b){return A(k,"dataChannels"),X.createDataChannel(k,b)},get power(){return A(k,"environmentPower"),{get onDidSuspend(){return ae(S.onDidSuspend)},get onDidResume(){return ae(S.onDidResume)},get onDidChangeOnBatteryPower(){return ae(S.onDidChangeOnBatteryPower)},get onDidChangeThermalState(){return ae(S.onDidChangeThermalState)},get onDidChangeSpeedLimit(){return ae(S.onDidChangeSpeedLimit)},get onWillShutdown(){return ae(S.onWillShutdown)},get onDidLockScreen(){return ae(S.onDidLockScreen)},get onDidUnlockScreen(){return ae(S.onDidUnlockScreen)},getSystemIdleState(b){return S.getSystemIdleState(b)},getSystemIdleTime(){return S.getSystemIdleTime()},getCurrentThermalState(){return S.getCurrentThermalState()},isOnBatteryPower(){return S.isOnBatteryPower()},async startPowerSaveBlocker(b){let I=await S.startPowerSaveBlocker(b);return{id:I.id,get isStarted(){return I.isStarted},dispose(){I.dispose()}}}}}};e.environment.extensionTestsLocationURI||Object.freeze(x1);let GU={createTestController(b,I,_){return R.createTestController(k,b,I,_)},createTestObserver(){return A(k,"testObserver"),R.createTestObserver()},runTests(b){return A(k,"testObserver"),R.runTests(b)},registerTestFollowupProvider(b){return A(k,"testObserver"),R.registerTestFollowupProvider(b)},get onDidChangeTestResults(){return A(k,"testObserver"),ae(R.onResultsChanged)},get testResults(){return A(k,"testObserver"),R.results}},Ch=e.remote.isRemote?2:1,jU={getExtension(b,I){Fe(k,"extensionsAny")||(I=!1);let _=bo.mine.getExtensionDescription(b);if(_)return new fl(o,k.identifier,_,Ch,!1);if(I){let Ee=bo.all.getExtensionDescription(b);if(Ee)return new fl(o,k.identifier,Ee,Ch,!0)}},get all(){let b=[];for(let I of bo.mine.getAllExtensionDescriptions())b.push(new fl(o,k.identifier,I,Ch,!1));return b},get allAcrossExtensionHosts(){A(k,"extensionsAny");let b=new Yn(bo.mine.getAllExtensionDescriptions().map(_=>_.identifier)),I=[];for(let _ of bo.all.getAllExtensionDescriptions()){let Ee=!b.has(_.identifier);I.push(new fl(o,k.identifier,_,Ch,Ee))}return I},get onDidChange(){return Fe(k,"extensionsAny")?ae(Me.any(bo.mine.onDidChange,bo.all.onDidChange)):ae(bo.mine.onDidChange)}},QU={createDiagnosticCollection(b){return Wi.createDiagnosticCollection(k.identifier,b)},get onDidChangeDiagnostics(){return ae(Wi.onDidChangeDiagnostics)},getDiagnostics:b=>Wi.getDiagnostics(b),getLanguages(){return Go.getLanguages()},setTextDocumentLanguage(b,I){return Go.changeLanguage(b.uri,I)},match(b,I){let _=tP.from(b),Ee;return sR(_)&&(Ee=Ke.notebookDocuments.find(st=>st.apiNotebook.getCells().find(Yt=>Yt.document===I))?.apiNotebook),iR(_,I.uri,I.languageId,!0,Ee?.uri,Ee?.notebookType)},registerCodeActionsProvider(b,I,_){return Ue.registerCodeActionProvider(k,yt(b),I,_)},registerDocumentPasteEditProvider(b,I,_){return Ue.registerDocumentPasteEditProvider(k,yt(b),I,_)},registerCodeLensProvider(b,I){return Ue.registerCodeLensProvider(k,yt(b),I)},registerDefinitionProvider(b,I){return Ue.registerDefinitionProvider(k,yt(b),I)},registerDeclarationProvider(b,I){return Ue.registerDeclarationProvider(k,yt(b),I)},registerImplementationProvider(b,I){return Ue.registerImplementationProvider(k,yt(b),I)},registerTypeDefinitionProvider(b,I){return Ue.registerTypeDefinitionProvider(k,yt(b),I)},registerHoverProvider(b,I){return Ue.registerHoverProvider(k,yt(b),I,k.identifier)},registerEvaluatableExpressionProvider(b,I){return Ue.registerEvaluatableExpressionProvider(k,yt(b),I,k.identifier)},registerInlineValuesProvider(b,I){return Ue.registerInlineValuesProvider(k,yt(b),I,k.identifier)},registerDocumentHighlightProvider(b,I){return Ue.registerDocumentHighlightProvider(k,yt(b),I)},registerMultiDocumentHighlightProvider(b,I){return Ue.registerMultiDocumentHighlightProvider(k,yt(b),I)},registerLinkedEditingRangeProvider(b,I){return Ue.registerLinkedEditingRangeProvider(k,yt(b),I)},registerReferenceProvider(b,I){return Ue.registerReferenceProvider(k,yt(b),I)},registerRenameProvider(b,I){return Ue.registerRenameProvider(k,yt(b),I)},registerNewSymbolNamesProvider(b,I){return A(k,"newSymbolNamesProvider"),Ue.registerNewSymbolNamesProvider(k,yt(b),I)},registerDocumentSymbolProvider(b,I,_){return Ue.registerDocumentSymbolProvider(k,yt(b),I,_)},registerWorkspaceSymbolProvider(b){return Ue.registerWorkspaceSymbolProvider(k,b)},registerDocumentFormattingEditProvider(b,I){return Ue.registerDocumentFormattingEditProvider(k,yt(b),I)},registerDocumentRangeFormattingEditProvider(b,I){return Ue.registerDocumentRangeFormattingEditProvider(k,yt(b),I)},registerOnTypeFormattingEditProvider(b,I,_,...Ee){return Ue.registerOnTypeFormattingEditProvider(k,yt(b),I,[_].concat(Ee))},registerDocumentSemanticTokensProvider(b,I,_){return Ue.registerDocumentSemanticTokensProvider(k,yt(b),I,_)},registerDocumentRangeSemanticTokensProvider(b,I,_){return Ue.registerDocumentRangeSemanticTokensProvider(k,yt(b),I,_)},registerSignatureHelpProvider(b,I,_,...Ee){return typeof _=="object"?Ue.registerSignatureHelpProvider(k,yt(b),I,_):Ue.registerSignatureHelpProvider(k,yt(b),I,typeof _>"u"?[]:[_,...Ee])},registerCompletionItemProvider(b,I,..._){return Ue.registerCompletionItemProvider(k,yt(b),I,_)},registerInlineCompletionItemProvider(b,I,_){return I.handleDidShowCompletionItem&&A(k,"inlineCompletionsAdditions"),I.handleDidPartiallyAcceptCompletionItem&&A(k,"inlineCompletionsAdditions"),_&&A(k,"inlineCompletionsAdditions"),Ue.registerInlineCompletionsProvider(k,yt(b),I,_)},get inlineCompletionsUnificationState(){return A(k,"inlineCompletionsAdditions"),Ue.inlineCompletionsUnificationState},onDidChangeCompletionsUnificationState(b,I,_){return A(k,"inlineCompletionsAdditions"),ae(Ue.onDidChangeInlineCompletionsUnificationState)(b,I,_)},registerDocumentLinkProvider(b,I){return Ue.registerDocumentLinkProvider(k,yt(b),I)},registerColorProvider(b,I){return Ue.registerColorProvider(k,yt(b),I)},registerFoldingRangeProvider(b,I){return Ue.registerFoldingRangeProvider(k,yt(b),I)},registerSelectionRangeProvider(b,I){return Ue.registerSelectionRangeProvider(k,b,I)},registerCallHierarchyProvider(b,I){return Ue.registerCallHierarchyProvider(k,b,I)},registerTypeHierarchyProvider(b,I){return Ue.registerTypeHierarchyProvider(k,b,I)},setLanguageConfiguration:(b,I)=>Ue.setLanguageConfiguration(k,b,I),getTokenInformationAtPosition(b,I){return A(k,"tokenInformation"),Go.tokenAtPosition(b,I)},registerInlayHintsProvider(b,I){return Ue.registerInlayHintsProvider(k,b,I)},createLanguageStatusItem(b,I){return Go.createLanguageStatusItem(k,b,I)},registerDocumentDropEditProvider(b,I,_){return Ue.registerDocumentOnDropEditProvider(k,b,I,_)}},JU={get activeTextEditor(){return he.getActiveTextEditor()},get visibleTextEditors(){return he.getVisibleTextEditors()},get activeTerminal(){return ne.activeTerminal},get terminals(){return ne.terminals},async showTextDocument(b,I,_){y.isUri(b)&&b.scheme===$.vscodeRemote&&!b.authority&&h.report("workspace.showTextDocument",k,"A URI of 'vscode-remote' scheme requires an authority.");let Ee=await(y.isUri(b)?Promise.resolve(S1.openTextDocument(b)):Promise.resolve(b));return he.showTextDocument(Ee,I,_)},createTextEditorDecorationType(b){return he.createTextEditorDecorationType(k,b)},onDidChangeActiveTextEditor(b,I,_){return ae(he.onDidChangeActiveTextEditor)(b,I,_)},onDidChangeVisibleTextEditors(b,I,_){return ae(he.onDidChangeVisibleTextEditors)(b,I,_)},onDidChangeTextEditorSelection(b,I,_){return ae(he.onDidChangeTextEditorSelection)(b,I,_)},onDidChangeTextEditorOptions(b,I,_){return ae(he.onDidChangeTextEditorOptions)(b,I,_)},onDidChangeTextEditorVisibleRanges(b,I,_){return ae(he.onDidChangeTextEditorVisibleRanges)(b,I,_)},onDidChangeTextEditorViewColumn(b,I,_){return ae(he.onDidChangeTextEditorViewColumn)(b,I,_)},onDidChangeTextEditorDiffInformation(b,I,_){return A(k,"textEditorDiffInformation"),ae(he.onDidChangeTextEditorDiffInformation)(b,I,_)},onDidCloseTerminal(b,I,_){return ae(ne.onDidCloseTerminal)(b,I,_)},onDidOpenTerminal(b,I,_){return ae(ne.onDidOpenTerminal)(b,I,_)},onDidChangeActiveTerminal(b,I,_){return ae(ne.onDidChangeActiveTerminal)(b,I,_)},onDidChangeTerminalDimensions(b,I,_){return A(k,"terminalDimensions"),ae(ne.onDidChangeTerminalDimensions)(b,I,_)},onDidChangeTerminalState(b,I,_){return ae(ne.onDidChangeTerminalState)(b,I,_)},onDidWriteTerminalData(b,I,_){return A(k,"terminalDataWriteEvent"),ae(ne.onDidWriteTerminalData)(b,I,_)},onDidExecuteTerminalCommand(b,I,_){return A(k,"terminalExecuteCommandEvent"),ae(ne.onDidExecuteTerminalCommand)(b,I,_)},onDidChangeTerminalShellIntegration(b,I,_){return ae(te.onDidChangeTerminalShellIntegration)(b,I,_)},onDidStartTerminalShellExecution(b,I,_){return ae(te.onDidStartTerminalShellExecution)(b,I,_)},onDidEndTerminalShellExecution(b,I,_){return ae(te.onDidEndTerminalShellExecution)(b,I,_)},get state(){return x.getState()},onDidChangeWindowState(b,I,_){return ae(x.onDidChangeWindowState)(b,I,_)},showInformationMessage(b,...I){return Et.showMessage(k,$e.Info,b,I[0],I.slice(1))},showWarningMessage(b,...I){return Et.showMessage(k,$e.Warning,b,I[0],I.slice(1))},showErrorMessage(b,...I){return Et.showMessage(k,$e.Error,b,I[0],I.slice(1))},showQuickPick(b,I,_){return $i.showQuickPick(k,b,I,_)},showWorkspaceFolderPick(b){return $i.showWorkspaceFolderPick(b)},showInputBox(b,I){return $i.showInput(b,I)},showOpenDialog(b){return Ot.showOpenDialog(b)},showSaveDialog(b){return Ot.showSaveDialog(b)},createStatusBarItem(b,I,_){let Ee,st,Yt;return typeof b=="string"?(Ee=b,st=I,Yt=_):(st=b,Yt=I),Xt.createStatusBarEntry(k,Ee,st,Yt)},setStatusBarMessage(b,I){return Xt.setStatusBarMessage(b,I)},withScmProgress(b){return h.report("window.withScmProgress",k,"Use 'withProgress' instead."),G.withProgress(k,{location:1},(I,_)=>b({report(Ee){}}))},withProgress(b,I){return G.withProgress(k,b,I)},createOutputChannel(b,I){return we.createOutputChannel(b,I,k)},createWebviewPanel(b,I,_,Ee){return lc.createWebviewPanel(k,b,I,_,Ee)},createWebviewTextEditorInset(b,I,_,Ee){return A(k,"editorInsets"),mt.createWebviewEditorInset(b,I,_,Ee,k)},createTerminal(b,I,_){return typeof b=="object"?"pty"in b?ne.createExtensionTerminal(b):ne.createTerminalFromOptions(b):ne.createTerminal(b,I,_)},registerTerminalLinkProvider(b){return ne.registerLinkProvider(b)},registerTerminalProfileProvider(b,I){return ne.registerProfileProvider(k,b,I)},registerTerminalCompletionProvider(b,...I){return A(k,"terminalCompletionProvider"),ne.registerTerminalCompletionProvider(k,b,...I)},registerTerminalQuickFixProvider(b,I){return A(k,"terminalQuickFixProvider"),ne.registerTerminalQuickFixProvider(b,k.identifier.value,I)},registerTreeDataProvider(b,I){return Sr.registerTreeDataProvider(b,I,k)},createTreeView(b,I){return Sr.createTreeView(b,I,k)},registerWebviewPanelSerializer:(b,I)=>lc.registerWebviewPanelSerializer(k,b,I),registerCustomEditorProvider:(b,I,_={})=>_l.registerCustomEditorProvider(k,b,I,_),registerFileDecorationProvider(b){return He.registerFileDecorationProvider(b,k)},registerUriHandler(b){return T.registerUriHandler(k,b)},createQuickPick(){return $i.createQuickPick(k)},createInputBox(){return $i.createInputBox(k)},get activeColorTheme(){return Ft.activeColorTheme},onDidChangeActiveColorTheme(b,I,_){return ae(Ft.onDidChangeActiveColorTheme)(b,I,_)},registerWebviewViewProvider(b,I,_){return dc.registerWebviewViewProvider(k,b,I,_?.webviewOptions)},get activeNotebookEditor(){return Ke.activeNotebookEditor},onDidChangeActiveNotebookEditor(b,I,_){return ae(Ke.onDidChangeActiveNotebookEditor)(b,I,_)},get visibleNotebookEditors(){return Ke.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return ae(Ke.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(b,I,_){return ae(nn.onDidChangeNotebookEditorSelection)(b,I,_)},onDidChangeNotebookEditorVisibleRanges(b,I,_){return ae(nn.onDidChangeNotebookEditorVisibleRanges)(b,I,_)},showNotebookDocument(b,I){return Ke.showNotebookDocument(b,I)},registerExternalUriOpener(b,I,_){return A(k,"externalUriOpener"),F.registerExternalUriOpener(k.identifier,b,I,_)},registerProfileContentHandler(b,I){return A(k,"profileContentHandlers"),W.registerProfileContentHandler(k,b,I)},registerQuickDiffProvider(b,I,_,Ee,st){return A(k,"quickDiffProvider"),ac.registerQuickDiffProvider(k,yt(b),I,_,Ee,st)},get tabGroups(){return L.tabGroups},registerShareProvider(b,I){return A(k,"shareProvider"),wl.registerShareProvider(yt(b),I)},get nativeHandle(){return A(k,"nativeWindowHandle"),x.nativeHandle},createChatStatusItem:b=>(A(k,"chatStatusItem"),Cn.createChatStatusItem(k,b)),get activeChatPanelSessionResource(){return A(k,"chatParticipantPrivate"),We.activeChatPanelSessionResource},onDidChangeActiveChatPanelSessionResource:(b,I,_)=>(A(k,"chatParticipantPrivate"),ae(We.onDidChangeActiveChatPanelSessionResource)(b,I,_))},S1={get rootPath(){return h.report("workspace.rootPath",k,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),i.getPath()},set rootPath(b){throw new Cr("rootPath")},getWorkspaceFolder(b){return i.getWorkspaceFolder(b)},get workspaceFolders(){return i.getWorkspaceFolders()},get name(){return i.name},set name(b){throw new Cr("name")},get workspaceFile(){return i.workspaceFile},set workspaceFile(b){throw new Cr("workspaceFile")},get isAgentSessionsWorkspace(){return A(k,"agentSessionsWorkspace"),!!e.environment.isSessionsWindow},updateWorkspaceFolders:(b,I,..._)=>i.updateWorkspaceFolders(k,b,I||0,..._),onDidChangeWorkspaceFolders:function(b,I,_){return ae(i.onDidChangeWorkspace)(b,I,_)},asRelativePath:(b,I)=>i.getRelativePath(b,I),findFiles:(b,I,_,Ee)=>i.findFiles(b,I,_,k.identifier,Ee),findFiles2:(b,I,_)=>(A(k,"findFiles2"),i.findFiles2(b,I,k.identifier,_)),findTextInFiles:(b,I,_,Ee)=>{A(k,"findTextInFiles");let st,Yt;return typeof I=="object"?(st=I,Yt=_):(st={},Yt=I,Ee=_),i.findTextInFiles(b,st||{},Yt,k.identifier,Ee)},findTextInFiles2:(b,I,_)=>(A(k,"findTextInFiles2"),A(k,"textSearchProvider2"),i.findTextInFiles2(b,I,k.identifier,_)),save:b=>i.save(b),saveAs:b=>i.saveAs(b),saveAll:b=>i.saveAll(b),applyEdit(b,I){return Be.applyWorkspaceEdit(b,k,I)},createFileSystemWatcher:(b,I,_,Ee)=>{let st={ignoreCreateEvents:!!I,ignoreChangeEvents:!!_,ignoreDeleteEvents:!!Ee};return jo.createFileSystemWatcher(i,zi,t,k,b,st)},get textDocuments(){return Ae.getAllDocumentData().map(b=>b.document)},set textDocuments(b){throw new Cr("textDocuments")},openTextDocument(b,I){let _;if(I=I??b,typeof b=="string")_=Promise.resolve(y.file(b));else if(y.isUri(b))_=Promise.resolve(b);else if(!I||typeof I=="object")_=Ae.createDocumentData(I);else throw new Error("illegal argument - uriOrFileNameOrOptions");return _.then(Ee=>(g.trace(`openTextDocument from ${k.identifier}`),Ee.scheme===$.vscodeRemote&&!Ee.authority&&h.report("workspace.openTextDocument",k,"A URI of 'vscode-remote' scheme requires an authority."),Ae.ensureDocumentData(Ee,I).then(st=>st.document)))},onDidOpenTextDocument:(b,I,_)=>ae(Ae.onDidAddDocument)(b,I,_),onDidCloseTextDocument:(b,I,_)=>ae(Ae.onDidRemoveDocument)(b,I,_),onDidChangeTextDocument:(b,I,_)=>Fe(k,"textDocumentChangeReason")?ae(Ae.onDidChangeDocumentWithReason)(b,I,_):ae(Ae.onDidChangeDocument)(b,I,_),onDidSaveTextDocument:(b,I,_)=>ae(Ae.onDidSaveDocument)(b,I,_),onWillSaveTextDocument:(b,I,_)=>ae(bt.getOnWillSaveTextDocumentEvent(k))(b,I,_),get notebookDocuments(){return Ke.notebookDocuments.map(b=>b.apiNotebook)},async openNotebookDocument(b,I){let _;if(y.isUri(b))_=b,await Ke.openNotebookDocument(b);else if(typeof b=="string")_=y.revive(await Ke.createNotebookDocument({viewType:b,content:I}));else throw new Error("Invalid arguments");return Ke.getNotebookDocument(_).apiNotebook},onDidSaveNotebookDocument(b,I,_){return ae(Kt.onDidSaveNotebookDocument)(b,I,_)},onDidChangeNotebookDocument(b,I,_){return ae(Kt.onDidChangeNotebookDocument)(b,I,_)},onWillSaveNotebookDocument(b,I,_){return ae(qs.getOnWillSaveNotebookDocumentEvent(k))(b,I,_)},get onDidOpenNotebookDocument(){return ae(Ke.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return ae(Ke.onDidCloseNotebookDocument)},registerNotebookSerializer(b,I,_,Ee){return Ke.registerNotebookSerializer(k,b,I,_,Fe(k,"notebookLiveShare")?Ee:void 0)},onDidChangeConfiguration:(b,I,_)=>ae(zi.onDidChangeConfiguration)(b,I,_),getConfiguration(b,I){return I=arguments.length===1?void 0:I,zi.getConfiguration(b,I,k)},registerTextDocumentContentProvider(b,I){return et.registerTextDocumentContentProvider(b,I)},registerTaskProvider:(b,I)=>(h.report("window.registerTaskProvider",k,"Use the corresponding function on the 'tasks' namespace instead"),ie.registerTaskProvider(k,b,I)),registerFileSystemProvider(b,I,_){return Ic(Tl.registerFileSystemProvider(k,b,I,_),n.addFileSystemProvider(b,I,_))},get fs(){return n.value},registerFileSearchProvider:(b,I)=>(A(k,"fileSearchProvider"),re.registerFileSearchProviderOld(b,I)),registerTextSearchProvider:(b,I)=>(A(k,"textSearchProvider"),re.registerTextSearchProviderOld(b,I)),registerAITextSearchProvider:(b,I)=>(A(k,"aiTextSearchProvider"),A(k,"textSearchProvider2"),re.registerAITextSearchProvider(b,I)),registerFileSearchProvider2:(b,I)=>(A(k,"fileSearchProvider2"),re.registerFileSearchProvider(b,I)),registerTextSearchProvider2:(b,I)=>(A(k,"textSearchProvider2"),re.registerTextSearchProvider(b,I)),registerRemoteAuthorityResolver:(b,I)=>(A(k,"resolvers"),o.registerRemoteAuthorityResolver(b,I)),registerResourceLabelFormatter:b=>(A(k,"resolvers"),Gs.$registerResourceLabelFormatter(b)),getRemoteExecServer:b=>(A(k,"resolvers"),o.getRemoteExecServer(b)),onDidCreateFiles:(b,I,_)=>ae(jo.onDidCreateFile)(b,I,_),onDidDeleteFiles:(b,I,_)=>ae(jo.onDidDeleteFile)(b,I,_),onDidRenameFiles:(b,I,_)=>ae(jo.onDidRenameFile)(b,I,_),onWillCreateFiles:(b,I,_)=>ae(jo.getOnWillCreateFileEvent(k))(b,I,_),onWillDeleteFiles:(b,I,_)=>ae(jo.getOnWillDeleteFileEvent(k))(b,I,_),onWillRenameFiles:(b,I,_)=>ae(jo.getOnWillRenameFileEvent(k))(b,I,_),openTunnel:b=>(A(k,"tunnels"),v.openTunnel(k,b).then(I=>{if(!I)throw new Error("cannot open tunnel");return I})),get tunnels(){return A(k,"tunnels"),v.getTunnels()},onDidChangeTunnels:(b,I,_)=>(A(k,"tunnels"),ae(v.onDidChangeTunnels)(b,I,_)),registerPortAttributesProvider:(b,I)=>(A(k,"portsAttributes"),v.registerPortsAttributesProvider(b,I)),registerTunnelProvider:(b,I)=>(A(k,"tunnelFactory"),v.registerTunnelProvider(b,I)),registerTimelineProvider:(b,I)=>(A(k,"timeline"),Mn.registerTimelineProvider(b,I,k.identifier,Ve.converter)),get isTrusted(){return i.trusted},requestResourceTrust:b=>(A(k,"workspaceTrust"),i.requestResourceTrust(b)),requestWorkspaceTrust:b=>(A(k,"workspaceTrust"),i.requestWorkspaceTrust(b)),isResourceTrusted:b=>(A(k,"workspaceTrust"),i.isResourceTrusted(b)),onDidChangeWorkspaceTrustedFolders:(b,I,_)=>(A(k,"workspaceTrust"),ae(i.onDidChangeWorkspaceTrustedFolders)(b,I,_)),onDidGrantWorkspaceTrust:(b,I,_)=>ae(i.onDidGrantWorkspaceTrust)(b,I,_),registerEditSessionIdentityProvider:(b,I)=>(A(k,"editSessionIdentityProvider"),i.registerEditSessionIdentityProvider(b,I)),onWillCreateEditSessionIdentity:(b,I,_)=>(A(k,"editSessionIdentityProvider"),ae(i.getOnWillCreateEditSessionIdentityEvent(k))(b,I,_)),registerCanonicalUriProvider:(b,I)=>(A(k,"canonicalUriProvider"),i.registerCanonicalUriProvider(b,I)),getCanonicalUri:(b,I,_)=>(A(k,"canonicalUriProvider"),i.provideCanonicalUri(b,I,_)),decode(b,I){return i.decode(b,I)},encode(b,I){return i.encode(b,I)}},XU={get inputBox(){return h.report("scm.inputBox",k,"Use 'SourceControl.inputBox' instead"),El.getLastInputBox(k)},createSourceControl(b,I,_,Ee,st,Yt){return(Ee||st||Yt)&&A(k,"scmProviderOptions"),El.createSourceControl(k,b,I,_,Ee,st,Yt)}},YU={createCommentController(b,I){return co.createCommentController(k,b,I)}},ZU={get activeDebugSession(){return Z.activeDebugSession},get activeDebugConsole(){return Z.activeDebugConsole},get breakpoints(){return Z.breakpoints},get activeStackItem(){return Z.activeStackItem},registerDebugVisualizationProvider(b,I){return A(k,"debugVisualization"),Z.registerDebugVisualizationProvider(k,b,I)},registerDebugVisualizationTreeProvider(b,I){return A(k,"debugVisualization"),Z.registerDebugVisualizationTree(k,b,I)},onDidStartDebugSession(b,I,_){return ae(Z.onDidStartDebugSession)(b,I,_)},onDidTerminateDebugSession(b,I,_){return ae(Z.onDidTerminateDebugSession)(b,I,_)},onDidChangeActiveDebugSession(b,I,_){return ae(Z.onDidChangeActiveDebugSession)(b,I,_)},onDidReceiveDebugSessionCustomEvent(b,I,_){return ae(Z.onDidReceiveDebugSessionCustomEvent)(b,I,_)},onDidChangeBreakpoints(b,I,_){return ae(Z.onDidChangeBreakpoints)(b,I,_)},onDidChangeActiveStackItem(b,I,_){return ae(Z.onDidChangeActiveStackItem)(b,I,_)},registerDebugConfigurationProvider(b,I,_){return Z.registerDebugConfigurationProvider(b,I,_||1)},registerDebugAdapterDescriptorFactory(b,I){return Z.registerDebugAdapterDescriptorFactory(k,b,I)},registerDebugAdapterTrackerFactory(b,I){return Z.registerDebugAdapterTrackerFactory(b,I)},startDebugging(b,I,_){return!_||typeof _=="object"&&"configuration"in _?Z.startDebugging(b,I,{parentSession:_}):Z.startDebugging(b,I,_||{})},stopDebugging(b){return Z.stopDebugging(b)},addBreakpoints(b){return Z.addBreakpoints(b)},removeBreakpoints(b){return Z.removeBreakpoints(b)},asDebugSourceUri(b,I){return Z.asDebugSourceUri(b,I)}},eF={registerTaskProvider:(b,I)=>ie.registerTaskProvider(k,b,I),fetchTasks:b=>ie.fetchTasks(b),executeTask:b=>ie.executeTask(k,b),get taskExecutions(){return ie.taskExecutions},onDidStartTask:(b,I,_)=>{let Ee=st=>{Fe(k,"taskExecutionTerminal")||st?.execution?.terminal!==void 0&&(st.execution.terminal=void 0);let Yt={...st,execution:st.execution};return b.call(I,Yt)};return ae(ie.onDidStartTask)(Ee,I,_)},onDidEndTask:(b,I,_)=>ae(ie.onDidEndTask)(b,I,_),onDidStartTaskProcess:(b,I,_)=>ae(ie.onDidStartTaskProcess)(b,I,_),onDidEndTaskProcess:(b,I,_)=>ae(ie.onDidEndTaskProcess)(b,I,_),onDidStartTaskProblemMatchers:(b,I,_)=>(A(k,"taskProblemMatcherStatus"),ae(ie.onDidStartTaskProblemMatchers)(b,I,_)),onDidEndTaskProblemMatchers:(b,I,_)=>(A(k,"taskProblemMatcherStatus"),ae(ie.onDidEndTaskProblemMatchers)(b,I,_))},tF={createNotebookController(b,I,_,Ee,st){return zn.createNotebookController(k,b,I,_,Ee,Fe(k,"notebookMessaging")?st:void 0)},registerNotebookCellStatusBarItemProvider:(b,I)=>Ke.registerNotebookCellStatusBarItemProvider(k,b,I),createRendererMessaging(b){return Ks.createRendererMessaging(k,b)},createNotebookControllerDetectionTask(b){return A(k,"notebookKernelSource"),zn.createNotebookControllerDetectionTask(k,b)},registerKernelSourceActionProvider(b,I){return A(k,"notebookKernelSource"),zn.registerKernelSourceActionProvider(k,b,I)}},nF={t(...b){if(typeof b[0]=="string"){let I=b.shift(),_=!b||typeof b[0]!="object"?b:b[0];return Ne.getMessage(k.identifier.value,{message:I,args:_})}return Ne.getMessage(k.identifier.value,b[0])},get bundle(){return Ne.getBundle(k.identifier.value)},get uri(){return Ne.getBundleUri(k.identifier.value)}},oF={transferActiveChat(b){return A(k,"interactive"),We.transferActiveChat(b)}},rF={getRelatedInformation(b,I){return A(k,"aiRelatedInformation"),qt.getRelatedInformation(k,b,I)},registerRelatedInformationProvider(b,I){return A(k,"aiRelatedInformation"),qt.registerRelatedInformationProvider(k,b,I)},registerEmbeddingVectorProvider(b,I){return A(k,"aiRelatedInformation"),oe.registerEmbeddingVectorProvider(k,b,I)},registerSettingsSearchProvider(b){return A(k,"aiSettingsSearch"),Qo.registerSettingsSearchProvider(k,b)}},iF={registerMappedEditsProvider(b,I){return A(k,"mappedEditsProvider"),{dispose(){}}},registerMappedEditsProvider2(b){return A(k,"mappedEditsProvider"),Cl.registerMappedEditsProvider(k,b)},createChatParticipant(b,I){return We.createChatAgent(k,b,I)},createDynamicChatParticipant(b,I,_){return A(k,"chatParticipantPrivate"),We.createDynamicChatAgent(k,b,I,_)},registerChatParticipantDetectionProvider(b){return A(k,"chatParticipantPrivate"),We.registerChatParticipantDetectionProvider(k,b)},onDidDisposeChatSession:(b,I,_)=>(A(k,"chatParticipantPrivate"),ae(We.onDidDisposeChatSession)(b,I,_)),registerChatSessionItemProvider:(b,I)=>(A(k,"chatSessionsProvider"),Zt.registerChatSessionItemProvider(k,b,I)),createChatSessionItemController:(b,I)=>(A(k,"chatSessionsProvider"),Zt.createChatSessionItemController(k,b,I)),registerChatSessionContentProvider(b,I,_,Ee){return A(k,"chatSessionsProvider"),Zt.registerChatSessionContentProvider(k,b,_,I,Ee)},registerChatOutputRenderer:(b,I)=>(A(k,"chatOutputRenderer"),Se.registerChatOutputRenderer(k,b,I)),registerChatWorkspaceContextProvider(b,I){return A(k,"chatContextProvider"),gn.registerChatWorkspaceContextProvider(`${k.id}-${b}`,I)},registerChatExplicitContextProvider(b,I){return A(k,"chatContextProvider"),gn.registerChatExplicitContextProvider(`${k.id}-${b}`,I)},registerChatResourceContextProvider(b,I,_){return A(k,"chatContextProvider"),gn.registerChatResourceContextProvider(yt(b),`${k.id}-${I}`,_)},registerChatContextProvider(b,I,_){return A(k,"chatContextProvider"),gn.registerChatContextProvider(b?yt(b):void 0,`${k.id}-${I}`,_)},registerCustomAgentProvider(b){return A(k,"chatPromptFiles"),We.registerPromptFileProvider(k,"agent",b)},registerInstructionsProvider(b){return A(k,"chatPromptFiles"),We.registerPromptFileProvider(k,"instructions",b)},registerPromptFileProvider(b){return A(k,"chatPromptFiles"),We.registerPromptFileProvider(k,"prompt",b)},registerSkillProvider(b){return A(k,"chatPromptFiles"),We.registerPromptFileProvider(k,"skill",b)}},sF={selectChatModels:b=>K.selectLanguageModels(k,b??{}),onDidChangeChatModels:(b,I,_)=>K.onDidChangeProviders(b,I,_),registerLanguageModelChatProvider:(b,I)=>K.registerLanguageModelChatProvider(k,b,I),get isModelProxyAvailable(){return A(k,"languageModelProxy"),K.isModelProxyAvailable},onDidChangeModelProxyAvailability:(b,I,_)=>(A(k,"languageModelProxy"),K.onDidChangeModelProxyAvailability(b,I,_)),getModelProxy:()=>(A(k,"languageModelProxy"),K.getModelProxy(k)),registerLanguageModelProxyProvider:b=>(A(k,"chatParticipantPrivate"),K.registerLanguageModelProxyProvider(k,b)),get embeddingModels(){return A(k,"embeddings"),fn.embeddingsModels},onDidChangeEmbeddingModels:(b,I,_)=>(A(k,"embeddings"),fn.onDidChange(b,I,_)),registerEmbeddingsProvider(b,I){return A(k,"embeddings"),fn.registerEmbeddingsProvider(k,b,I)},async computeEmbeddings(b,I,_){return A(k,"embeddings"),fn.computeEmbeddings(b,I,_)},registerTool(b,I){return Pe.registerTool(k,b,I)},registerToolDefinition(b,I){return Pe.registerToolDefinition(k,b,I)},invokeTool(b,I,_){return typeof b!="string"&&A(k,"chatParticipantAdditions"),Pe.invokeTool(k,b,I,_)},get tools(){return Pe.getTools(k)},fileIsIgnored(b,I){return K.fileIsIgnored(k,b,I)},registerIgnoredFileProvider(b){return K.registerIgnoredFileProvider(k,b)},registerMcpServerDefinitionProvider(b,I){return Q.registerMcpConfigurationProvider(k,b,I)},onDidChangeMcpServerDefinitions:(...b)=>(A(k,"mcpServerDefinitions"),ae(Q.onDidChangeMcpServerDefinitions)(...b)),get mcpServerDefinitions(){return A(k,"mcpServerDefinitions"),Q.mcpServerDefinitions},startMcpGateway(){return A(k,"mcpServerDefinitions"),Q.startMcpGateway()},onDidChangeChatRequestTools(...b){return A(k,"chatParticipantAdditions"),ae(We.onDidChangeChatRequestTools)(...b)}},aF={registerSpeechProvider(b,I){return A(k,"speech"),on.registerProvider(k.identifier,b,I)}};return{version:e.version,ai:rF,authentication:KU,commands:qU,comments:YU,chat:iF,debug:ZU,env:x1,extensions:jU,interactive:oF,l10n:nF,languages:QU,lm:sF,notebooks:tF,scm:XU,speech:aF,tasks:eF,tests:GU,window:JU,workspace:S1,Breakpoint:hs,TerminalOutputAnchor:Jk,ChatResultFeedbackKind:gI,ChatVariableLevel:S_,ChatCompletionItem:hy,ChatReferenceDiagnostic:el,CallHierarchyIncomingCall:hu,CallHierarchyItem:Wa,CallHierarchyOutgoingCall:vu,CancellationError:xt,CancellationTokenSource:Re,CandidatePortSource:TT,CodeAction:Si,CodeActionKind:at,CodeActionTriggerKind:Ey,CodeLens:ka,Color:$r,ColorInformation:Ma,ColorPresentation:Aa,ColorThemeKind:iI,CommentMode:u_,CommentState:p_,CommentThreadCollapsibleState:Xy,CommentThreadState:Yy,CommentThreadApplicability:Zy,CommentThreadFocus:eI,CompletionItem:Da,CompletionItemKind:Yg,CompletionItemTag:_y,CompletionList:Wr,CompletionTriggerKind:ky,ConfigurationTarget:Ky,CustomExecution:Id,DebugAdapterExecutable:La,DebugAdapterInlineImplementation:bs,DebugAdapterNamedPipeServer:Oa,DebugAdapterServer:vs,DebugConfigurationProviderTriggerKind:_k,DebugConsoleMode:tI,DebugVisualization:dy,DecorationRangeBehavior:Hy,Diagnostic:ps,DiagnosticRelatedInformation:bi,DiagnosticSeverity:dd,DiagnosticTag:jg,Disposable:fe,DocumentHighlight:Ea,DocumentHighlightKind:Ty,MultiDocumentHighlight:wa,DocumentLink:Ra,DocumentSymbol:zo,EndOfLine:pd,EnvironmentVariableMutatorType:Cy,EvaluatableExpression:Na,InlineValueText:Ua,InlineValueVariableLookup:Fa,InlineValueEvaluatableExpression:Ha,InlineCompletionTriggerKind:qy,InlineCompletionsDisposeReasonKind:Gy,EventEmitter:E,ExtensionKind:rI,ExtensionMode:cI,ExternalUriOpenerPriority:v_,FileChangeType:Qy,FileDecoration:Sd,FileDecoration2:Sd,FileSystemError:rt,FileType:Lc,FilePermission:mg,FoldingRange:gu,FoldingRangeKind:Jy,FunctionBreakpoint:qr,InlineCompletionItem:cu,InlineCompletionList:uu,Hover:md,VerboseHover:Ta,HoverVerbosityAction:Xk,IndentAction:aR,Location:At,MarkdownString:Mt,OverviewRulerLane:Dw,ParameterInformation:au,PortAutoForwardAction:y_,Position:Ie,ProcessExecution:Ti,ProgressLocation:Zg,QuickInputButtonLocation:m_,QuickInputButtons:xi,Range:pe,RelativePattern:wi,Selection:xn,SelectionRange:Ci,SemanticTokens:Gr,SemanticTokensBuilder:ly,SemanticTokensEdit:Iu,SemanticTokensEdits:za,SemanticTokensLegend:xd,ShellExecution:zr,ShellQuoting:a_,SignatureHelp:du,SignatureHelpTriggerKind:Yk,SignatureInformation:lu,SnippetString:Sn,SourceBreakpoint:Kr,StandardTokenType:ef,StatusBarAlignment:Ay,SymbolInformation:$o,SymbolKind:su,SymbolTag:Jg,Task:pn,TaskEventKind:i_,TaskGroup:an,TaskPanelKind:s_,TaskRevealKind:r_,TaskScope:Wy,TerminalLink:Yb,TerminalQuickFixTerminalCommand:ey,TerminalQuickFixOpener:Zb,TerminalLocation:n_,TerminalProfile:ty,TerminalExitReason:e_,TerminalShellExecutionCommandLineConfidence:By,TerminalCompletionItem:ny,TerminalCompletionItemKind:o_,TerminalCompletionList:oy,TerminalShellType:t_,TextDocumentSaveReason:Oy,TextEdit:un,SnippetTextEdit:ms,TextEditorCursorStyle:ww,TextEditorChangeKind:Uy,TextEditorLineNumbersStyle:Ly,TextEditorRevealType:Ny,TextEditorSelectionChangeKind:Pd,SyntaxTokenType:Dd,TextDocumentChangeReason:Fy,ThemeColor:fs,ThemeIcon:ln,TreeItem:Ei,TreeItemCheckboxState:zy,TreeItemCollapsibleState:$y,TypeHierarchyItem:Ka,UIKind:Lh,Uri:y,ViewColumn:My,WorkspaceEdit:_o,DocumentPasteTriggerKind:d_,DocumentDropEdit:pu,DocumentDropOrPasteEditKind:gr,DocumentPasteEdit:sy,InlayHint:Pa,InlayHintLabelPart:_a,InlayHintKind:Zk,RemoteAuthorityResolverError:_i,ResolvedAuthority:Xb,ManagedResolvedAuthority:Ba,SourceControlInputBoxValidationType:Vy,ExtensionRuntime:uI,TimelineItem:fu,NotebookRange:Rn,NotebookCellKind:Qg,NotebookCellExecutionState:g_,NotebookCellData:yi,NotebookData:cd,NotebookRendererScript:xu,NotebookCellStatusBarAlignment:sI,NotebookEditorRevealType:aI,NotebookCellOutput:Ii,NotebookCellOutputItem:ud,CellErrorStackFrame:cy,NotebookCellStatusBarItem:uy,NotebookControllerAffinity:f_,NotebookControllerAffinity2:lI,NotebookEdit:ro,NotebookKernelSourceAction:py,NotebookVariablesRequestKind:dI,PortAttributes:gy,LinkedEditingRanges:my,TestResultState:h_,TestRunRequest:Va,TestMessage:ki,TestMessageStackFrame:fy,TestTag:ys,TestRunProfileKind:pI,TextSearchCompleteMessageType:Ef,DataTransfer:mr,DataTransferItem:gd,TestCoverageCount:yd,FileCoverage:Is,StatementCoverage:Cu,BranchCoverage:Tu,DeclarationCoverage:Eu,WorkspaceTrustState:b_,LanguageStatusSeverity:wy,QuickPickItemKind:nI,InputBoxValidationSeverity:oI,TabInputText:qa,TabInputTextDiff:xs,TabInputTextMerge:wu,TabInputCustom:Ga,TabInputNotebook:ja,TabInputNotebookDiff:Qa,TabInputWebview:ku,TabInputTerminal:_u,TabInputInteractiveWindow:Pu,TabInputChat:Du,TabInputTextMultiDiff:Ru,TelemetryTrustedValue:xa,LogLevel:ag,EditSessionIdentityMatch:lR,InteractiveSessionVoteDirection:I_,ChatCopyKind:x_,ChatSessionChangedFile:yy,ChatSessionChangedFile2:Iy,ChatEditingSessionActionOutcome:mI,InteractiveEditorResponseFeedbackKind:T_,DebugStackFrame:bu,DebugThread:yu,RelatedInformationType:D_,SpeechToTextStatus:M_,TextToSpeechStatus:A_,PartialAcceptTriggerKind:Py,InlineCompletionEndOfLifeReasonKind:Dy,InlineCompletionDisplayLocationKind:Ry,KeywordRecognitionStatus:L_,ChatImageMimeType:P_,ChatResponseMarkdownPart:Ss,ChatResponseFileTreePart:Ts,ChatResponseAnchorPart:Di,ChatResponseProgressPart:Ed,ChatResponseProgressPart2:Ja,ChatResponseThinkingProgressPart:jr,ChatResponseHookPart:Es,ChatResponseReferencePart:fr,ChatResponseReferencePart2:fr,ChatResponseCodeCitationPart:_s,ChatResponseCodeblockUriPart:ks,ChatResponseWarningPart:Ri,ChatResponseTextEditPart:Ai,ChatResponseNotebookEditPart:Ds,ChatResponseWorkspaceEditPart:Za,ChatResponseMarkdownWithVulnerabilitiesPart:Pi,ChatResponseCommandButtonPart:ws,ChatResponseConfirmationPart:Cs,ChatQuestion:Au,ChatQuestionType:fI,ChatResponseQuestionCarouselPart:Mi,ChatResponseMovePart:Ps,ChatResponseExtensionsPart:Xa,ChatResponseExternalEditPart:Td,ChatResponsePullRequestPart:Ya,ChatResponseMultiDiffPart:Cd,ChatResponseReferencePartStatusKind:w_,ChatResponseClearToPreviousToolInvocationReason:k_,ChatRequestTurn:Rs,ChatRequestTurn2:Rs,ChatResponseTurn:Lu,ChatResponseTurn2:by,ChatSubagentToolInvocationData:Mu,ChatToolInvocationPart:wd,ChatLocation:vI,ChatSessionStatus:E_,ChatRequestEditorData:Ou,ChatRequestNotebookData:Nu,ChatReferenceBinaryData:Uu,ChatRequestEditedFileEventKind:C_,LanguageModelChatMessageRole:nf,LanguageModelChatMessage:Fu,LanguageModelChatMessage2:Hu,LanguageModelToolResultPart:Li,LanguageModelToolResultPart2:Li,LanguageModelTextPart:Lt,LanguageModelTextPart2:Lt,LanguageModelPartAudience:bI,ToolResultAudience:bI,LanguageModelToolCallPart:hr,LanguageModelThinkingPart:Qr,LanguageModelError:Po,LanguageModelToolResult:tl,LanguageModelToolResult2:xy,LanguageModelDataPart:mn,LanguageModelDataPart2:mn,LanguageModelToolExtensionSource:Vu,LanguageModelToolMCPSource:Bu,ExtendedLanguageModelToolResult:Sy,LanguageModelChatToolMode:yI,LanguageModelPromptTsxPart:vr,NewSymbolName:ay,NewSymbolNameTag:c_,NewSymbolNameTriggerKind:jy,ExcludeSettingOptions:$I,TextSearchContext2:rl,TextSearchMatch2:Do,AISearchKeyword:Vd,TextSearchCompleteMessageTypeNew:Ef,ChatErrorLevel:__,McpHttpServerDefinition:_d,McpHttpServerDefinition2:_d,McpStdioServerDefinition:kd,McpStdioServerDefinition2:kd,McpToolAvailability:II,McpToolInvocationContentData:vy,SettingsSearchResultKind:R_,ChatTodoStatus:hI}}}var xm=class{constructor(e,t,n,o,i,s,a){this._apiFactory=e;this._extensionRegistry=t;this._instaService=n;this._extHostConfiguration=o;this._extHostExtensionService=i;this._initData=s;this._logService=a;this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),bn("code/extHost/willWaitForConfig");let e=await this._extHostConfiguration.getConfigProvider();bn("code/extHost/didWaitForConfig");let t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new b1(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(Sl)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(Sh,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(let t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};xm=D([C(2,po),C(3,ao),C(4,Mo),C(5,nt),C(6,ue)],xm);var Sl=class{static{this.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]])}constructor(e){if(e.environment.appRoot&&Sl.aliased.size){let t=or(this.forceForwardSlashes(e.environment.appRoot.fsPath)),n="[a-z0-9_.-]",o=`@${n}+\\/${n}+|${n}+`,i="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${i}\\/)(${o})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;let t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;let[,n,o,i]=t,s=Sl.aliased.get(o);if(s!==void 0)return console.warn(`${o} as been renamed to ${s}, please update your imports`),n+s+i}forceForwardSlashes(e){return e.replace(/\\/g,"/")}};Sl=D([C(0,nt)],Sl);var b1=class{constructor(e,t,n,o,i){this._apiFactory=e;this._extensionPaths=t;this._extensionRegistry=n;this._configProvider=o;this._logService=i;this.nodeModuleName="vscode";this._extApiImpl=new Un}load(e,t){let n=this._extensionPaths.findSubstr(t);if(n){let o=this._extApiImpl.get(n.identifier);return o||(o=this._apiFactory(n,this._extensionRegistry,this._configProvider),this._extApiImpl.set(n.identifier,o)),o}if(!this._defaultApiImpl){let o="";this._extensionPaths.forEach((i,s)=>o+=`	${s} -> ${i.identifier.value}
`),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: 
${o}`),this._defaultApiImpl=this._apiFactory(IL,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}},Sh=class{constructor(e,t,n){this._extensionPaths=e;this._appUriScheme=t;this.nodeModuleName=["open","opn"];this._mainThreadTelemetry=n.getProxy(N.MainThreadTelemetry);let o=n.getProxy(N.MainThreadWindow);this._impl=(i,s)=>{let a=y.parse(i);return s?this.callOriginal(i,s):a.scheme==="http"||a.scheme==="https"?o.$openUri(a,i,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?o.$openUri(a,i,{}):this.callOriginal(i,s)}}load(e,t,n){let o=this._extensionPaths.findSubstr(t);return o&&(this._extensionId=o.identifier.value,this.sendShimmingTelemetry()),this._original=n(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};Sh=D([C(2,ge)],Sh);var Sm=class{constructor(e,t){this._mainThreadConsole=e.getProxy(N.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){let n=this,o=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){n._handleConsoleCall(e,t,o,arguments)}})}_handleConsoleCall(e,t,n,o){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:n9(o,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,n,o)}};Sm=D([C(0,ge),C(1,nt)],Sm);var t9=1e5;function n9(r,e){let t=[];if(r.length)for(let n=0;n<r.length;n++){let o=r[n];if(typeof o>"u")o="undefined";else if(o instanceof Error){let i=o;i.stack?o=i.stack:o=i.toString()}t.push(o)}if(e){let n=new Error().stack;n&&t.push({__$stack:n.split(`
`).slice(3).join(`
`)})}try{let n=aE(t);return n.length>t9?"Output omitted for a large object that exceeds the limits":n}catch(n){return`Output omitted for an object that cannot be inspected ('${n.toString()}')`}}var Cm=class extends Sm{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,n){t.apply(console,n)}};Cm=D([C(0,ge),C(1,nt)],Cm);var y1=class extends xm{_installInterceptor(){}getModule(e,t){for(let n of this._alternatives){let o=n(e);if(o){e=o;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}},VC=class extends gl{constructor(){super(...arguments);this.extensionRuntime=2}async _beforeAlmostReadyToRunExtensions(){this._instaService.createInstance(Cm);let t=this._instaService.invokeFunction(FU);this._fakeModules=this._instaService.createInstance(y1,t,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark("code/extHost/didInitAPI"),await this._waitForDebuggerAttachment()}_getEntryPoint(t){return t.browser}async _loadCommonJSModule(t,n,o){n=n.with({path:o9(n.path,".js")});let i=t?.identifier.value;i&&performance.mark(`code/extHost/willFetchExtensionCode/${i}`);let s=y.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(n)),a=await fetch(s.toString(!0));if(i&&performance.mark(`code/extHost/didFetchExtensionCode/${i}`),a.status!==200)throw new Error(a.statusText);let l=await a.text(),d=`${n.toString(!0)}#vscode-extension`,c=`${l}
//# sourceURL=${d}`,u;try{u=new Function("module","exports","require",c)}catch(h){throw console.error(i?`Loading code for extension ${i} failed: ${h.message}`:`Loading code failed: ${h.message}`),console.error(`${n.toString(!0)}${typeof h.line=="number"?` line ${h.line}`:""}${typeof h.column=="number"?` column ${h.column}`:""}`),console.error(h),h}t&&await this._extHostLocalizationService.initializeLocalizedMessages(t);let m={},g={exports:m},v=h=>{let x=this._fakeModules.getModule(h,n);if(x===void 0)throw new Error(`Cannot load module '${h}'`);return x};try{return o.codeLoadingStart(),i&&performance.mark(`code/extHost/willLoadExtensionCode/${i}`),u(g,m,v),g.exports!==m?g.exports:m}finally{i&&performance.mark(`code/extHost/didLoadExtensionCode/${i}`),o.codeLoadingStop()}}_loadESMModule(t,n,o){throw new Error("ESM modules are not supported in the web worker extension host")}async $setRemoteEnvironment(t){}async _waitForDebuggerAttachment(t=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;let n=Date.now()+t;for(;Date.now()<n&&!("__jsDebugIsReady"in globalThis);)await cn(10)}};function o9(r,e){return Yi(r)?r:r+e}Qe(ue,new mo(Yp,[!0],!0));Qe(Sp,xp,0);Qe(Mo,VC,0);Qe(up,cp,0);Qe(cl,new mo(vp,[!0],!0));var BU=self.close.bind(self);self.close=()=>console.trace("'close' has been blocked");var WU=postMessage.bind(self);self.postMessage=()=>console.trace("'postMessage' has been blocked");function HU(r){return/^(file|vscode-remote):/i.test(r)}var VU=fetch.bind(self);function r9(r){self.fetch=async function(e,t){return e instanceof Request||HU(String(e))&&(e=(await r(y.parse(String(e)))).toString(!0)),VU(e,t)},self.XMLHttpRequest=class extends XMLHttpRequest{open(e,t,n,o,i){(async()=>(HU(t.toString())&&(t=(await r(y.parse(t.toString()))).toString(!0)),super.open(e,t,n??!0,o,i)))()}}}self.importScripts=()=>{throw new Error("'importScripts' has been blocked")};self.addEventListener=()=>console.trace("'addEventListener' has been blocked");self.AMDLoader=void 0;self.NLSLoaderPlugin=void 0;self.define=void 0;self.require=void 0;self.webkitRequestFileSystem=void 0;self.webkitRequestFileSystemSync=void 0;self.webkitResolveLocalFileSystemSyncURL=void 0;self.webkitResolveLocalFileSystemURL=void 0;if(self.Worker){let r=self.Worker;Worker=function(e,t){if(/^file:/i.test(e.toString()))e=rv.uriToBrowserUri(y.parse(e.toString())).toString(!0);else if(/^vscode-remote:/i.test(e.toString()))throw new Error("Creating workers from remote extensions is currently not supported.");let o=`(${(function(l){function d(m){return typeof m=="string"||m instanceof URL?String(m).replace(/^file:\/\//i,"vscode-file://vscode-app"):m}let c=fetch.bind(self);self.fetch=function(m,g){return m instanceof Request?c(m,g):c(d(m),g)},self.XMLHttpRequest=class extends XMLHttpRequest{open(m,g,v,h,x){return super.open(m,d(g),v??!0,h,x)}};let u=importScripts.bind(self);self.importScripts=(...m)=>{u(...m.map(d))},u(l)}).toString()}('${e}'))`;t=t||{},t.name=`${name} -> ${t.name||dn(e.toString())}`;let i=new Blob([o],{type:"application/javascript"}),s=URL.createObjectURL(i);return new r(s,t)}}else self.Worker=class extends Ix{constructor(r,e){super(WU,r,{name:dn(r.toString()),...e})}};var i9=new class{constructor(){this.pid=void 0}exit(r){BU()}},I1=class{constructor(){let e=new MessageChannel,t=new E,n=!1;WU(e.port2,[e.port2]),e.port1.onmessage=o=>{let{data:i}=o;if(!(i instanceof ArrayBuffer)){console.warn("UNKNOWN data received",i);return}let s=ee.wrap(new Uint8Array(i,0,i.byteLength));if(i0(s,2)){n=!0,$U("received terminate message from renderer");return}t.fire(s)},this.protocol={onMessage:t.event,send:o=>{if(!n){let i=o.buffer.buffer.slice(o.buffer.byteOffset,o.buffer.byteOffset+o.buffer.byteLength);e.port1.postMessage(i,[i])}}}}};function s9(r){return new Promise(e=>{let t=r.onMessage(n=>{t.dispose();let o=JSON.parse(n.toString());r.send(pT(0)),e({protocol:r,initData:o})});r.send(pT(1))})}var $U=r=>BU();function a9(r){return!!r&&typeof r=="object"&&r.type==="vscode.init"&&r.data instanceof Map}function zU(){bn("code/extHost/willConnectToRenderer");let r=new I1;return{onmessage(e){a9(e)&&s9(r.protocol).then(t=>{bn("code/extHost/didWaitForInitData");let n=new yx(t.protocol,t.initData,i9,null,e.data);r9(o=>n.asBrowserUri(o)),$U=o=>n.terminate(o)})}}}var l9=zU();self.onmessage=r=>l9.onmessage(r.data);
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/071d09d3bfa1c7434837e456163beced5e5e1266/core/vs/workbench/api/worker/extensionHostWorkerMain.js.map
