code-server
Version:
Run VS Code on a remote server.
401 lines (354 loc) • 2.05 MB
JavaScript
/*!--------------------------------------------------------
* 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 VN=Object.defineProperty;var pz=Object.getOwnPropertyDescriptor;var BN=i=>{throw TypeError(i)};var mz=(i,t)=>{for(var e in t)VN(i,e,{get:t[e],enumerable:!0})};var _=(i,t,e,n)=>{for(var o=n>1?void 0:n?pz(t,e):t,r=i.length-1,s;r>=0;r--)(s=i[r])&&(o=(n?s(t,e,o):s(o))||o);return n&&o&&VN(t,e,o),o},C=(i,t)=>(e,n)=>t(e,n,i);var UP=(i,t,e)=>t.has(i)||BN("Cannot "+e);var gn=(i,t,e)=>(UP(i,t,"read from private field"),e?e.call(i):t.get(i)),Yu=(i,t,e)=>t.has(i)?BN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),ph=(i,t,e,n)=>(UP(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e),mh=(i,t,e)=>(UP(i,t,"access private method"),e);import*as q$ from"http";import HY from"minimist";import*as K$ from"net";function Xu(i,t){let e=Object.create(null);for(let n of i){let o=t(n),r=e[o];r||(r=e[o]=[]),r.push(n)}return e}function FP(i,t){let e=[],n=[];for(let o of i)t.has(o)||e.push(o);for(let o of t)i.has(o)||n.push(o);return{removed:e,added:n}}var zN,qN,$N=class{constructor(t,e){this.toKey=e;this._map=new Map;this[zN]="SetWithKey";for(let n of t)this.add(n)}get size(){return this._map.size}add(t){let e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(let t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(let t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(n=>t.call(e,n,n,this))}[(qN=Symbol.iterator,zN=Symbol.toStringTag,qN)](){return this.values()}};var HP=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Zn.isErrorNoTelemetry(t)?new Zn(t.message+`
`+t.stack):new Error(t.message+`
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},ol=new HP;function gh(i){ol.setUnexpectedErrorHandler(i)}function KN(i){if(!i||typeof i!="object")return!1;let t=i;return t.code==="EPIPE"&&t.syscall?.toUpperCase()==="WRITE"}function rl(i){ol.onUnexpectedError(i)}function $e(i){Qt(i)||ol.onUnexpectedError(i)}function Yd(i){Qt(i)||ol.onUnexpectedExternalError(i)}function Yi(i){if(i instanceof Error){let{name:t,message:e,cause:n}=i,o=i.stacktrace||i.stack;return{$isError:!0,name:t,message:e,stack:o,noTelemetry:Zn.isErrorNoTelemetry(i),cause:n?Yi(n):void 0,code:i.code}}return i}function WP(i){let t;return i.noTelemetry?t=new Zn:(t=new Error,t.name=i.name),t.message=i.message,t.stack=i.stack,i.code&&(t.code=i.code),i.cause&&(t.cause=WP(i.cause)),t}var Xy="Canceled";function Qt(i){return i instanceof Ue?!0:i instanceof Error&&i.name===Xy&&i.message===Xy}var Ue=class extends Error{constructor(){super(Xy),this.name=this.message}},Js=class i extends Error{static{this._name="PendingMigrationError"}static is(t){return t instanceof i||t instanceof Error&&t.name===i._name}constructor(t){super(t),this.name=i._name}};function Ys(){let i=new Error(Xy);return i.name=i.message,i}function Fe(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Zu(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}var pi=class extends TypeError{constructor(t){super(t?`${t} is read-only and cannot be changed`:"Cannot change read-only property")}};function Xi(i){return i?i.message?i.message:i.stack?i.stack.split(`
`)[0]:String(i):"Error"}var Zy=class extends Error{constructor(t){super("NotImplemented"),t&&(this.message=t)}},Jd=class extends Error{constructor(t){super("NotSupported"),t&&(this.message=t)}};var Zn=class i extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof i)return t;let e=new i;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Dt=class i extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,i.prototype)}};function sl(i,t){let e=this,n=!1,o;return function(){if(n)return o;if(n=!0,t)try{o=i.apply(e,arguments)}finally{t()}else o=i.apply(e,arguments);return o}}function GN(i,t,e=i.length-1){let n=fz(i,t,e);if(n!==-1)return i[n]}function fz(i,t,e=i.length-1){for(let n=e;n>=0;n--){let o=i[n];if(t(o,n))return n}return-1}function hz(i,t,e=0,n=i.length){let o=e,r=n;for(;o<r;){let s=Math.floor((o+r)/2);t(i[s])?o=s+1:r=s}return o-1}function QN(i,t,e=0,n=i.length){let o=e,r=n;for(;o<r;){let s=Math.floor((o+r)/2);t(i[s])?r=s:o=s+1}return o}var jN=class i{constructor(t){this._array=t;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(t){if(i.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let e=hz(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}};function rn(i,t,e=(n,o)=>n===o){if(i===t)return!0;if(!i||!t||i.length!==t.length)return!1;for(let n=0,o=i.length;n<o;n++)if(!e(i[n],t[n]))return!1;return!0}function YN(i,t,e){return vz(i.length,n=>e(i[n],t))}function vz(i,t){let e=0,n=i-1;for(;e<=n;){let o=(e+n)/2|0,r=t(o);if(r<0)e=o+1;else if(r>0)n=o-1;else return o}return-(e+1)}function XN(i,t){let e=[],n;for(let o of i.slice(0).sort(t))!n||t(n[0],o)!==0?(n=[o],e.push(n)):n.push(o);return e}function VP(i,t,e){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 r=0,s=0;for(;;){if(r===i.length){o(r,0,t.slice(s));break}if(s===t.length){o(r,i.length-r,[]);break}let a=i[r],l=t[s],d=e(a,l);d===0?(r+=1,s+=1):d<0?(o(r,1,[]),r+=1):d>0&&(o(r,0,[l]),s+=1)}return n}function ZN(i,t,e){let n=VP(i,t,e),o=[],r=[];for(let s of n)o.push(...i.slice(s.start,s.start+s.deleteCount)),r.push(...s.toInsert);return{removed:o,added:r}}function eU(i,t,e,n,o){return e===0?Promise.resolve([]):new Promise((r,s)=>{(async()=>{let a=i.length,l=i.slice(0,e).sort(t);for(let d=e,c=Math.min(e+n,a);d<a;d=c,c=Math.min(c+n,a)){if(d>e&&await new Promise(u=>setTimeout(u)),o&&o.isCancellationRequested)throw new Ue;bz(i,t,l,d,c)}return l})().then(r,s)})}function bz(i,t,e,n,o){for(let r=e.length;n<o;n++){let s=i[n];if(t(s,e[r-1])<0){e.pop();let a=QN(e,l=>t(s,l)<0);e.splice(a,0,s)}}}function nt(i){return i.filter(t=>!!t)}function tU(i){let t=0;for(let e=0;e<i.length;e++)i[e]&&(i[t]=i[e],t+=1);i.length=t}function fh(i){return!Array.isArray(i)||i.length===0}function al(i){return Array.isArray(i)&&i.length>0}function zr(i,t=e=>e){let e=new Set;return i.filter(n=>{let o=t(n);return e.has(o)?!1:(e.add(o),!0)})}function BP(i,t){return i.push(t),()=>yz(i,t)}function yz(i,t){let e=i.indexOf(t);if(e>-1)return i.splice(e,1),t}function $P(i,t){let e;if(typeof t=="number"){let n=t;e=()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)}}else e=Math.random;for(let n=i.length-1;n>0;n-=1){let o=Math.floor(e()*(n+1)),r=i[n];i[n]=i[o],i[o]=r}}function Xd(i,t){return Array.isArray(i)?i.map(t):t(i)}function Rn(i){return Array.isArray(i)?i:[i]}var nU;(a=>{function i(l){return l<0}a.isLessThan=i;function t(l){return l<=0}a.isLessThanOrEqual=t;function e(l){return l>0}a.isGreaterThan=e;function n(l){return l===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(nU||={});function oU(i,t){return(e,n)=>t(i(e),i(n))}var rU=(i,t)=>i-t;var JN=class i{constructor(t){this.iterate=t}static{this.empty=new i(t=>{})}forEach(t){this.iterate(e=>(t(e),!0))}toArray(){let t=[];return this.iterate(e=>(t.push(e),!0)),t}filter(t){return new i(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new i(e=>this.iterate(n=>e(t(n))))}some(t){let e=!1;return this.iterate(n=>(e=t(n),!e)),e}findFirst(t){let e;return this.iterate(n=>t(n)?(e=n,!1):!0),e}findLast(t){let e;return this.iterate(n=>(t(n)&&(e=n),!0)),e}findLastMaxBy(t){let e,n=!0;return this.iterate(o=>((n||nU.isGreaterThan(t(o,e)))&&(n=!1,e=o),!0)),e}};function jP(i,t,e){let n=i.get(t);return n===void 0&&(n=e,i.set(t,n)),n}var zP=class{constructor(t,e){this.uri=t;this.value=e}};function Iz(i){return Array.isArray(i)}var iU,qe=class i{constructor(t,e){this[iU]="ResourceMap";if(t instanceof i)this.map=new Map(t.map),this.toKey=e??i.defaultToKey;else if(Iz(t)){this.map=new Map,this.toKey=e??i.defaultToKey;for(let[n,o]of t)this.set(n,o)}else this.map=new Map,this.toKey=t??i.defaultToKey}static{this.defaultToKey=t=>t.toString()}set(t,e){return this.map.set(this.toKey(t),new zP(t,e)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,e){typeof e<"u"&&(t=t.bind(e));for(let[n,o]of this.map)t(o.value,o.uri,this)}*values(){for(let t of this.map.values())yield t.value}*keys(){for(let t of this.map.values())yield t.uri}*entries(){for(let t of this.map.values())yield[t.uri,t.value]}*[(iU=Symbol.toStringTag,Symbol.iterator)](){for(let[,t]of this.map)yield[t.uri,t.value]}},sU,_r=class{constructor(t,e){this[sU]="ResourceSet";!t||typeof t=="function"?this._map=new qe(t):(this._map=new qe(e),t.forEach(this.add,this))}get size(){return this._map.size}add(t){return this._map.set(t,t),this}clear(){this._map.clear()}delete(t){return this._map.delete(t)}forEach(t,e){this._map.forEach((n,o)=>t.call(e,o,o,this))}has(t){return this._map.has(t)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(sU=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var aU,qP=class{constructor(){this[aU]="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(t){return this._map.has(t)}get(t,e=0){let n=this._map.get(t);if(n)return e!==0&&this.touch(n,e),n.value}set(t,e,n=0){let o=this._map.get(t);if(o)o.value=e,n!==0&&this.touch(o,n);else{switch(o={key:t,value:e,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(t,o),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,e){let n=this._state,o=this._head;for(;o;){if(e?t.bind(e)(o.value,o.key,this):t(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(aU=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._head,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e&&(e.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._tail,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.previous,n--;this._tail=e,this._size=n,e&&(e.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}t.next=void 0,t.previous=void 0,this._state++}touch(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this._head)return;let n=t.next,o=t.previous;t===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(e===2){if(t===this._tail)return;let n=t.next,o=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((e,n)=>{t.push([n,e])}),t}fromJSON(t){this.clear();for(let[e,n]of t)this.set(e,n)}},KP=class extends qP{constructor(t,e=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},qr=class extends KP{constructor(t,e=1){super(t,e)}trim(t){this.trimOld(t)}set(t,e){return super.set(t,e),this.checkTrim(),this}};var eI=class{constructor(t){this._m1=new Map;this._m2=new Map;if(t)for(let[e,n]of t)this.set(e,n)}clear(){this._m1.clear(),this._m2.clear()}set(t,e){this._m1.set(t,e),this._m2.set(e,t)}get(t){return this._m1.get(t)}getKey(t){return this._m2.get(t)}delete(t){let e=this._m1.get(t);return e===void 0?!1:(this._m1.delete(t),this._m2.delete(e),!0)}forEach(t,e){this._m1.forEach((n,o)=>{t.call(e,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}},ep=class{constructor(){this.map=new Map}add(t,e){let n=this.map.get(t);n||(n=new Set,this.map.set(t,n)),n.add(e)}delete(t,e){let n=this.map.get(t);n&&(n.delete(e),n.size===0&&this.map.delete(t))}forEach(t,e){let n=this.map.get(t);n&&n.forEach(e)}get(t){let e=this.map.get(t);return e||new Set}};function qn(i,t){if(!i)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function tp(i,t="Unreachable"){throw new Error(t)}function np(i,t="unexpected state"){if(!i)throw typeof t=="string"?new Dt(`Assertion Failed: ${t}`):t}function hh(i){if(!i()){debugger;i(),$e(new Dt("Assertion Failed"))}}function Ae(i){return typeof i=="string"}function dU(i){return xz(i,Ae)}function xz(i,t){return Array.isArray(i)&&i.every(t)}function rt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function cU(i){let t=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof t}function Fn(i){return typeof i=="number"&&!isNaN(i)}function uU(i){return!!i&&typeof i[Symbol.iterator]=="function"}function tI(i){return i===!0||i===!1}function op(i){return typeof i>"u"}function bo(i){return!Ut(i)}function Ut(i){return op(i)||i===null}function rp(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function mi(i){return np(i!=null,"Argument is `undefined` or `null`."),i}var Sz=Object.prototype.hasOwnProperty;function ip(i){if(!rt(i))return!1;for(let t in i)if(Sz.call(i,t))return!1;return!0}function nI(i){return typeof i=="function"}function pU(i,t){let e=Math.min(i.length,t.length);for(let n=0;n<e;n++)GP(i[n],t[n])}function GP(i,t){if(Ae(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(nI(t)){try{if(i instanceof t)return}catch{}if(!Ut(i)&&i.constructor===t||t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function ao(i,t){for(let e in t)if(!(e in i))return!1;return!0}var Ft;(U=>{function i(V){return!!V&&typeof V=="object"&&typeof V[Symbol.iterator]=="function"}U.is=i;let t=Object.freeze([]);function e(){return t}U.empty=e;function*n(V){yield V}U.single=n;function o(V){return i(V)?V:n(V)}U.wrap=o;function r(V){return V??t}U.from=r;function*s(V){for(let K=V.length-1;K>=0;K--)yield V[K]}U.reverse=s;function a(V){return!V||V[Symbol.iterator]().next().done===!0}U.isEmpty=a;function l(V){return V[Symbol.iterator]().next().value}U.first=l;function d(V,K){let J=0;for(let Y of V)if(K(Y,J++))return!0;return!1}U.some=d;function c(V,K){let J=0;for(let Y of V)if(!K(Y,J++))return!1;return!0}U.every=c;function u(V,K){for(let J of V)if(K(J))return J}U.find=u;function*m(V,K){for(let J of V)K(J)&&(yield J)}U.filter=m;function*g(V,K){let J=0;for(let Y of V)yield K(Y,J++)}U.map=g;function*h(V,K){let J=0;for(let Y of V)yield*K(Y,J++)}U.flatMap=h;function*f(...V){for(let K of V)uU(K)?yield*K:yield K}U.concat=f;function I(V,K,J){let Y=J;for(let re of V)Y=K(Y,re);return Y}U.reduce=I;function S(V){let K=0;for(let J of V)K++;return K}U.length=S;function*w(V,K,J=V.length){for(K<-V.length&&(K=0),K<0&&(K+=V.length),J<0?J+=V.length:J>V.length&&(J=V.length);K<J;K++)yield V[K]}U.slice=w;function k(V,K=Number.POSITIVE_INFINITY){let J=[];if(K===0)return[J,V];let Y=V[Symbol.iterator]();for(let re=0;re<K;re++){let xe=Y.next();if(xe.done)return[J,U.empty()];J.push(xe.value)}return[J,{[Symbol.iterator](){return Y}}]}U.consume=k;async function M(V){let K=[];for await(let J of V)K.push(J);return K}U.asyncToArray=M;async function H(V){let K=[];for await(let J of V)K=K.concat(J);return K}U.asyncToArrayFlat=H})(Ft||={});var Cz=!1,Zd=null;var mU=class i{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let e=this.livingDisposables.get(t);return e||(e={parent:null,source:null,isSingleton:!1,value:t,idx:i.idx++},this.livingDisposables.set(t,e)),e}trackDisposable(t){let e=this.getDisposableData(t);e.source||(e.source=new Error().stack)}setParent(t,e){let n=this.getDisposableData(t);n.parent=e}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,e){let n=e.get(t);if(n)return n;let o=t.parent?this.getRootParent(this.getDisposableData(t.parent),e):t;return e.set(t,o),o}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,t).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(t=10,e){let n;if(e)n=e;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 r=new ep;for(let l of n){let d=o(l);for(let c=0;c<=d.length;c++)r.add(d.slice(0,c).join(`
`),l)}n.sort(oU(l=>l.idx,rU));let s="",a=0;for(let l of n.slice(0,t)){a++;let d=o(l),c=[];for(let u=0;u<d.length;u++){let m=d[u];m=`(shared with ${r.get(d.slice(0,u+1).join(`
`)).size}/${n.length} leaks) at ${m}`;let h=r.get(d.slice(0,u).join(`
`)),f=Xu([...h].map(I=>o(I)[u]),I=>I);delete f[d[u]];for(let[I,S]of Object.entries(f))S&&c.unshift(` - stacktraces of ${S.length} other leaks continue with ${I}`);c.unshift(m)}s+=`
==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ====================
${c.join(`
`)}
============================================================
`}return n.length>t&&(s+=`
... and ${n.length-t} more leaking disposables
`),{leaks:n,details:s}}};function Tz(i){Zd=i}if(Cz){let i="__is_disposable_tracked__";Tz(new class{trackDisposable(t){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[i]||console.log(e)},3e3)}setParent(t,e){if(t&&t!==O.None)try{t[i]=!0}catch{}}markAsDisposed(t){if(t&&t!==O.None)try{t[i]=!0}catch{}}markAsSingleton(t){}})}function dl(i){return Zd?.trackDisposable(i),i}function cl(i){Zd?.markAsDisposed(i)}function ec(i,t){Zd?.setParent(i,t)}function Ez(i,t){if(Zd)for(let e of i)Zd.setParent(e,t)}function vh(i){return Zd?.markAsSingleton(i),i}function rI(i){return typeof i=="object"&&i!==null&&typeof i.dispose=="function"&&i.dispose.length===0}function En(i){if(Ft.is(i)){let t=[];for(let e of i)if(e)try{e.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function sp(...i){let t=j(()=>En(i));return Ez(i,t),t}var QP=class{constructor(t){this._isDisposed=!1,this._fn=t,dl(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,cl(this),this._fn()}}};function j(i){return new QP(i)}var z=class i{constructor(){this._toDispose=new Set;this._isDisposed=!1;dl(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(cl(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{En(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===O.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return ec(t,this),this._isDisposed?i.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.delete(t)&&ec(t,null)}assertNotDisposed(){this._isDisposed&&$e(new Dt("Object disposed"))}},O=class{constructor(){this._store=new z;dl(this),ec(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){cl(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}},Jt=class{constructor(){this._isDisposed=!1;dl(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&ec(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,cl(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t&&ec(t,null),t}};var Tn=class{constructor(t=new Map){this._isDisposed=!1;this._store=t,dl(this)}dispose(){cl(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{En(this._store.values())}finally{this._store.clear()}}has(t){return this._store.has(t)}get size(){return this._store.size}get(t){return this._store.get(t)}set(t,e,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(t)?.dispose(),this._store.set(t,e),ec(e,this)}deleteAndDispose(t){this._store.get(t)?.dispose(),this._store.delete(t)}deleteAndLeak(t){let e=this._store.get(t);return e&&ec(e,null),this._store.delete(t),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};function gU(i,t){return i.then(e=>(t.isDisposed?e.dispose():t.add(e),e))}var oI=class extends Tn{constructor(){super(new qe)}};var dn=class i{static{this.Undefined=new i(void 0)}constructor(t){this.element=t,this.next=i.Undefined,this.prev=i.Undefined}},lo=class{constructor(){this._first=dn.Undefined;this._last=dn.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===dn.Undefined}clear(){let t=this._first;for(;t!==dn.Undefined;){let e=t.next;t.prev=dn.Undefined,t.next=dn.Undefined,t=e}this._first=dn.Undefined,this._last=dn.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new dn(t);if(this._first===dn.Undefined)this._first=n,this._last=n;else if(e){let r=this._last;this._last=n,n.prev=r,r.next=n}else{let r=this._first;this._first=n,n.next=r,r.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==dn.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==dn.Undefined){let t=this._last.element;return this._remove(this._last),t}}peek(){if(this._last!==dn.Undefined)return this._last.element}_remove(t){if(t.prev!==dn.Undefined&&t.next!==dn.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===dn.Undefined&&t.next===dn.Undefined?(this._first=dn.Undefined,this._last=dn.Undefined):t.next===dn.Undefined?(this._last=this._last.prev,this._last.next=dn.Undefined):t.prev===dn.Undefined&&(this._first=this._first.next,this._first.prev=dn.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==dn.Undefined;)yield t.element,t=t.next}};function wz(){return globalThis._VSCODE_NLS_MESSAGES}function JP(){return globalThis._VSCODE_NLS_LANGUAGE}var kz=JP()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function iI(i,t){let e;return t.length===0?e=i:e=i.replace(/\{(\d+)\}/g,(n,o)=>{let r=o[0],s=t[r],a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),kz&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),e}function p(i,t,...e){return iI(typeof i=="number"?fU(i,t):t,e)}function fU(i,t){let e=wz()?.[i];if(typeof e!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${i} !!!`)}return e}function tc(i,t,...e){let n;typeof i=="number"?n=fU(i,t):n=t;let o=iI(n,e);return{value:o,original:t===n?o:iI(t,e)}}var es="en",yh=!1,Ih=!1,bh=!1,Pz=!1,yU=!1,YP=!1,_z=!1,XP=!1,IU=!1,xU=!1,sI,aI=es,hU=es,Dz,Xs,Zs=globalThis,ar;typeof Zs.vscode<"u"&&typeof Zs.vscode.process<"u"?ar=Zs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ar=process);var SU=typeof ar?.versions?.electron=="string",Rz=SU&&ar?.type==="renderer";if(typeof ar=="object"){yh=ar.platform==="win32",Ih=ar.platform==="darwin",bh=ar.platform==="linux",Pz=bh&&!!ar.env.SNAP&&!!ar.env.SNAP_REVISION,_z=SU,IU=!!ar.env.CI||!!ar.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!ar.env.GITHUB_WORKSPACE,sI=es,aI=es;let i=ar.env.VSCODE_NLS_CONFIG;if(i)try{let t=JSON.parse(i);sI=t.userLocale,hU=t.osLocale,aI=t.resolvedLanguage||es,Dz=t.languagePack?.translationsConfigFile}catch{}yU=!0}else typeof navigator=="object"&&!Rz?(Xs=navigator.userAgent,yh=Xs.indexOf("Windows")>=0,Ih=Xs.indexOf("Macintosh")>=0,XP=(Xs.indexOf("Macintosh")>=0||Xs.indexOf("iPad")>=0||Xs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,bh=Xs.indexOf("Linux")>=0,xU=Xs?.indexOf("Mobi")>=0,YP=!0,aI=JP()||es,sI=navigator.language.toLowerCase(),hU=sI):console.error("Unable to resolve platform.");function ZP(i){switch(i){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}var lI=0;Ih?lI=1:yh?lI=3:bh&&(lI=2);var Ie=yh,gt=Ih,Qe=bh;var dI=yU;var lr=YP,Az=YP&&typeof Zs.importScripts=="function",CU=Az?Zs.origin:void 0,TU=XP,EU=xU,pl=IU,cI=lI,ts=Xs,ul=aI,Mz;(n=>{function i(){return ul}n.value=i;function t(){return ul.length===2?ul==="en":ul.length>=3?ul[0]==="e"&&ul[1]==="n"&&ul[2]==="-":!1}n.isDefaultVariant=t;function e(){return ul==="en"}n.isDefault=e})(Mz||={});var Lz=typeof Zs.postMessage=="function"&&!Zs.importScripts,uI=(()=>{if(Lz){let i=[];Zs.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let n=0,o=i.length;n<o;n++){let r=i[n];if(r.id===e.data.vscodeScheduleAsyncWork){i.splice(n,1),r.callback();return}}});let t=0;return e=>{let n=++t;i.push({id:n,callback:e}),Zs.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})();var dr=Ih||XP?2:yh?1:3,vU=!0,bU=!1;function pI(){if(!bU){bU=!0;let i=new Uint8Array(2);i[0]=1,i[1]=2,vU=new Uint16Array(i.buffer)[0]===513}return vU}var xh=!!(ts&&ts.indexOf("Chrome")>=0),wU=!!(ts&&ts.indexOf("Firefox")>=0),kU=!!(!xh&&ts&&ts.indexOf("Safari")>=0),mI=!!(ts&&ts.indexOf("Edg/")>=0),mX=!!(ts&&ts.indexOf("Android")>=0);var nc,e_=globalThis.vscode;if(typeof e_<"u"&&typeof e_.process<"u"){let i=e_.process;nc={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?nc={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:nc={get platform(){return Ie?"win32":gt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var gi=nc.cwd,eo=nc.env,t_=nc.platform,Oz=nc.arch;var Nz=globalThis.performance.now.bind(globalThis.performance),sn=class i{static create(t){return new i(t)}constructor(t){this._now=t===!1?Date.now:Nz,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 PU=!1,Uz=!1,Fz=100,_U=6e4;function DU(){return!!eo.VSCODE_DEV}var ve;(Ge=>{Ge.None=()=>O.None;function t(ee){if(Uz){let{onDidAddListener:X}=ee,se=lp.create(),te=0;ee.onDidAddListener=()=>{++te===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),se.print()),X?.()}}}function e(ee,X,se){return g(ee,()=>{},0,void 0,X??!0,void 0,se)}Ge.defer=e;function n(ee){return(X,se=null,te)=>{let ce=!1,oe;return oe=ee(me=>{if(!ce)return oe?oe.dispose():ce=!0,X.call(se,me)},null,te),ce&&oe.dispose(),oe}}Ge.once=n;function o(ee,X){return Ge.once(Ge.filter(ee,X))}Ge.onceIf=o;function r(ee,X,se){return u((te,ce=null,oe)=>ee(me=>te.call(ce,X(me)),null,oe),se)}Ge.map=r;function s(ee,X,se){return u((te,ce=null,oe)=>ee(me=>{X(me),te.call(ce,me)},null,oe),se)}Ge.forEach=s;function a(ee,X,se){return u((te,ce=null,oe)=>ee(me=>X(me)&&te.call(ce,me),null,oe),se)}Ge.filter=a;function l(ee){return ee}Ge.signal=l;function d(...ee){return(X,se=null,te)=>{let ce=sp(...ee.map(oe=>oe(me=>X.call(se,me))));return m(ce,te)}}Ge.any=d;function c(ee,X,se,te){let ce=se;return r(ee,oe=>(ce=X(ce,oe),ce),