UNPKG

code-server

Version:

Run VS Code on a remote server.

26 lines (18 loc) • 1.36 MB
"use strict";/*!-------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/var Yp=function(e,t){return Yp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},Yp(e,t)};export function __extends(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yp(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}export var __assign=function(){return __assign=Object.assign||function(t){for(var i,r=1,s=arguments.length;r<s;r++){i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},__assign.apply(this,arguments)};export function __rest(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i}export function __decorate(e,t,i,r){var s=arguments.length,n=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(s<3?o(n):s>3?o(t,i,n):o(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n}export function __param(e,t){return function(i,r){t(i,r,e)}}export function __esDecorate(e,t,i,r,s,n){function o(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h,p=!1,f=i.length-1;f>=0;f--){var m={};for(var w in r)m[w]=w==="access"?{}:r[w];for(var w in r.access)m.access[w]=r.access[w];m.addInitializer=function(E){if(p)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(E||null))};var S=(0,i[f])(a==="accessor"?{get:u.get,set:u.set}:u[c],m);if(a==="accessor"){if(S===void 0)continue;if(S===null||typeof S!="object")throw new TypeError("Object expected");(h=o(S.get))&&(u.get=h),(h=o(S.set))&&(u.set=h),(h=o(S.init))&&s.unshift(h)}else(h=o(S))&&(a==="field"?s.unshift(h):u[c]=h)}l&&Object.defineProperty(l,r.name,u),p=!0}export function __runInitializers(e,t,i){for(var r=arguments.length>2,s=0;s<t.length;s++)i=r?t[s].call(e,i):t[s].call(e);return r?i:void 0}export function __propKey(e){return typeof e=="symbol"?e:"".concat(e)}export function __setFunctionName(e,t,i){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}export function __metadata(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}export function __awaiter(e,t,i,r){function s(n){return n instanceof i?n:new i(function(o){o(n)})}return new(i||(i=Promise))(function(n,o){function a(u){try{l(r.next(u))}catch(h){o(h)}}function c(u){try{l(r.throw(u))}catch(h){o(h)}}function l(u){u.done?n(u.value):s(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}export function __generator(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,s,n,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(r=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,s=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(n=i.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){i.label=l[1];break}if(l[0]===6&&i.label<n[1]){i.label=n[1],n=l;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(l);break}n[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(u){l=[6,u],s=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}export var __createBinding=Object.create?function(e,t,i,r){r===void 0&&(r=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,s)}:function(e,t,i,r){r===void 0&&(r=i),e[r]=t[i]};export function __exportStar(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&__createBinding(t,e,i)}export function __values(e){var t=typeof Symbol=="function"&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}export function __read(e,t){var i=typeof Symbol=="function"&&e[Symbol.iterator];if(!i)return e;var r=i.call(e),s,n=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return n}export function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}export function __spreadArrays(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<i;t++)for(var n=arguments[t],o=0,a=n.length;o<a;o++,s++)r[s]=n[o];return r}export function __spreadArray(e,t,i){if(i||arguments.length===2)for(var r=0,s=t.length,n;r<s;r++)(n||!(r in t))&&(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}export function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}export function __asyncGenerator(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(e,t||[]),s,n=[];return s={},a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(m){return Promise.resolve(m).then(f,h)}}function a(f,m){r[f]&&(s[f]=function(w){return new Promise(function(S,E){n.push([f,w,S,E])>1||c(f,w)})},m&&(s[f]=m(s[f])))}function c(f,m){try{l(r[f](m))}catch(w){p(n[0][3],w)}}function l(f){f.value instanceof __await?Promise.resolve(f.value.v).then(u,h):p(n[0][2],f)}function u(f){c("next",f)}function h(f){c("throw",f)}function p(f,m){f(m),n.shift(),n.length&&c(n[0][0],n[0][1])}}export function __asyncDelegator(e){var t,i;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,n){t[s]=e[s]?function(o){return(i=!i)?{value:__await(e[s](o)),done:!1}:n?n(o):o}:n}}export function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],i;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(n){i[n]=e[n]&&function(o){return new Promise(function(a,c){o=e[n](o),s(a,c,o.done,o.value)})}}function s(n,o,a,c){Promise.resolve(c).then(function(l){n({value:l,done:a})},o)}}export function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var s3=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};export function __importStar(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return s3(t,e),t}export function __importDefault(e){return e&&e.__esModule?e:{default:e}}export function __classPrivateFieldGet(e,t,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(e):r?r.value:t.get(e)}export function __classPrivateFieldSet(e,t,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,i):s?s.value=i:t.set(e,i),i}export function __classPrivateFieldIn(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}export function __addDisposableResource(e,t,i){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],i&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),e.stack.push({value:t,dispose:r,async:i})}else i&&e.stack.push({async:!0});return t}var n3=typeof SuppressedError=="function"?SuppressedError:function(e,t,i){var r=new Error(i);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};export function __disposeResources(e){function t(r){e.error=e.hasError?new n3(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function i(){for(;e.stack.length;){var r=e.stack.pop();try{var s=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(s).then(i,function(n){return t(n),i()})}catch(n){t(n)}}if(e.hasError)throw e.error}return i()}export default{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources};var Ss;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Running=1]="Running",e[e.Completed=2]="Completed"})(Ss||(Ss={}));var At=class{constructor(e){this.d=e,this.a=Ss.Uninitialized}get hasValue(){return this.a===Ss.Completed}get value(){if(this.a===Ss.Uninitialized){this.a=Ss.Running;try{this.b=this.d()}catch(e){this.c=e}finally{this.a=Ss.Completed}}else if(this.a===Ss.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this.c)throw this.c;return this.b}get rawValue(){return this.b}},o3=class{constructor(){this.b=[],this.a=function(e){setTimeout(()=>{throw e.stack?an.isErrorNoTelemetry(e)?new an(e.message+` `+e.stack):new Error(e.message+` `+e.stack):e},0)}}addListener(e){return this.b.push(e),()=>{this.d(e)}}c(e){this.b.forEach(t=>{t(e)})}d(e){this.b.splice(this.b.indexOf(e),1)}setUnexpectedErrorHandler(e){this.a=e}getUnexpectedErrorHandler(){return this.a}onUnexpectedError(e){this.a(e),this.c(e)}onUnexpectedExternalError(e){this.a(e)}},ic=new o3;function Xp(e){ic.setUnexpectedErrorHandler(e)}function Au(e){ic.onUnexpectedError(e)}function Ot(e){xr(e)||ic.onUnexpectedError(e)}function Kp(e){xr(e)||ic.onUnexpectedExternalError(e)}function wo(e){if(e instanceof Error){const{name:t,message:i,cause:r}=e,s=e.stacktrace||e.stack;return{$isError:!0,name:t,message:i,stack:s,noTelemetry:an.isErrorNoTelemetry(e),cause:r?wo(r):void 0,code:e.code}}return e}function ay(e){let t;return e.noTelemetry?t=new an:(t=new Error,t.name=e.name),t.message=e.message,t.stack=e.stack,e.code&&(t.code=e.code),e.cause&&(t.cause=ay(e.cause)),t}var Tu="Canceled";function xr(e){return e instanceof ki?!0:e instanceof Error&&e.name===Tu&&e.message===Tu}var ki=class extends Error{constructor(){super(Tu),this.name=this.message}},cy=class Rp extends Error{static{this.a="PendingMigrationError"}static is(t){return t instanceof Rp||t instanceof Error&&t.name===Rp.a}constructor(t){super(t),this.name=Rp.a}};function ly(){const e=new Error(Tu);return e.name=e.message,e}function Ce(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function Ru(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}var on=class extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}},a3=class extends Error{constructor(e){super("NotImplemented"),e&&(this.message=e)}},eg=class extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}},an=class Rb extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Rb)return t;const i=new Rb;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},di=class PC extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,PC.prototype)}};function c3(e,t,i=0,r=e.length){let s=i,n=r;for(;s<n;){const o=Math.floor((s+n)/2);t(e[o])?s=o+1:n=o}return s-1}var sH=class AC{static{this.assertInvariants=!1}constructor(t){this.e=t,this.c=0}findLastMonotonous(t){if(AC.assertInvariants){if(this.d){for(const r of this.e)if(this.d(r)&&!t(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this.d=t}const i=c3(this.e,t,this.c);return this.c=i+1,i===-1?void 0:this.e[i]}};function Fi(e,t,i=(r,s)=>r===s){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!i(e[r],t[r]))return!1;return!0}function l3(e,t){const i=[];let r;for(const s of e.slice(0).sort(t))!r||t(r[0],s)!==0?(r=[s],i.push(r)):r.push(s);return i}function uy(e,t,i){const r=[];function s(a,c,l){if(c===0&&l.length===0)return;const u=r[r.length-1];u&&u.start+u.deleteCount===a?(u.deleteCount+=c,u.toInsert.push(...l)):r.push({start:a,deleteCount:c,toInsert:l})}let n=0,o=0;for(;;){if(n===e.length){s(n,0,t.slice(o));break}if(o===t.length){s(n,e.length-n,[]);break}const a=e[n],c=t[o],l=i(a,c);l===0?(n+=1,o+=1):l<0?(s(n,1,[]),n+=1):l>0&&(s(n,0,[c]),o+=1)}return r}function u3(e,t,i){const r=uy(e,t,i),s=[],n=[];for(const o of r)s.push(...e.slice(o.start,o.start+o.deleteCount)),n.push(...o.toInsert);return{removed:s,added:n}}function ft(e){return e.filter(t=>!!t)}function h3(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function tg(e){return!Array.isArray(e)||e.length===0}function rc(e){return Array.isArray(e)&&e.length>0}function bo(e,t=i=>i){const i=new Set;return e.filter(r=>{const s=t(r);return i.has(s)?!1:(i.add(s),!0)})}function hy(e,t){let i;if(typeof t=="number"){let r=t;i=()=>{const s=Math.sin(r++)*179426549;return s-Math.floor(s)}}else i=Math.random;for(let r=e.length-1;r>0;r-=1){const s=Math.floor(i()*(r+1)),n=e[r];e[r]=e[s],e[s]=n}}function ig(e,t){return Array.isArray(e)?e.map(t):t(e)}function Vi(e){return Array.isArray(e)?e:[e]}var rg;(function(e){function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function r(n){return n>0}e.isGreaterThan=r;function s(n){return n===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(rg||(rg={}));function d3(e,t){return(i,r)=>t(e(i),e(r))}var f3=(e,t)=>e-t,nH=class Lp{static{this.empty=new Lp(t=>{})}constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){const t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new Lp(i=>this.iterate(r=>t(r)?i(r):!0))}map(t){return new Lp(i=>this.iterate(r=>i(t(r))))}some(t){let i=!1;return this.iterate(r=>(i=t(r),!i)),i}findFirst(t){let i;return this.iterate(r=>t(r)?(i=r,!1):!0),i}findLast(t){let i;return this.iterate(r=>(t(r)&&(i=r),!0)),i}findLastMaxBy(t){let i,r=!0;return this.iterate(s=>((r||rg.isGreaterThan(t(s,i)))&&(r=!1,i=s),!0)),i}},dy;function fy(e,t){const i=Object.create(null);for(const r of e){const s=t(r);let n=i[s];n||(n=i[s]=[]),n.push(r)}return i}function p3(e,t){const i=[],r=[];for(const s of e)t.has(s)||i.push(s);for(const s of t)e.has(s)||r.push(s);return{removed:i,added:r}}var oH=class{static{dy=Symbol.toStringTag}constructor(e,t){this.b=t,this.a=new Map,this[dy]="SetWithKey";for(const i of e)this.add(i)}get size(){return this.a.size}add(e){const t=this.b(e);return this.a.set(t,e),this}delete(e){return this.a.delete(this.b(e))}has(e){return this.a.has(this.b(e))}*entries(){for(const e of this.a.values())yield[e,e]}keys(){return this.values()}*values(){for(const e of this.a.values())yield e}clear(){this.a.clear()}forEach(e,t){this.a.forEach(i=>e.call(t,i,i,this))}[Symbol.iterator](){return this.values()}},py,gy,my;function g3(e,t,i){let r=e.get(t);return r===void 0&&(r=i,e.set(t,r)),r}var m3=class{constructor(e,t){this.uri=e,this.value=t}};function v3(e){return Array.isArray(e)}var Bt=class wu{static{this.c=t=>t.toString()}constructor(t,i){if(this[py]="ResourceMap",t instanceof wu)this.d=new Map(t.d),this.e=i??wu.c;else if(v3(t)){this.d=new Map,this.e=i??wu.c;for(const[r,s]of t)this.set(r,s)}else this.d=new Map,this.e=t??wu.c}set(t,i){return this.d.set(this.e(t),new m3(t,i)),this}get(t){return this.d.get(this.e(t))?.value}has(t){return this.d.has(this.e(t))}get size(){return this.d.size}clear(){this.d.clear()}delete(t){return this.d.delete(this.e(t))}forEach(t,i){typeof i<"u"&&(t=t.bind(i));for(const[r,s]of this.d)t(s.value,s.uri,this)}*values(){for(const t of this.d.values())yield t.value}*keys(){for(const t of this.d.values())yield t.uri}*entries(){for(const t of this.d.values())yield[t.uri,t.value]}*[(py=Symbol.toStringTag,Symbol.iterator)](){for(const[,t]of this.d)yield[t.uri,t.value]}},vy=class{constructor(e,t){this[gy]="ResourceSet",!e||typeof e=="function"?this.c=new Bt(e):(this.c=new Bt(t),e.forEach(this.add,this))}get size(){return this.c.size}add(e){return this.c.set(e,e),this}clear(){this.c.clear()}delete(e){return this.c.delete(e)}forEach(e,t){this.c.forEach((i,r)=>e.call(t,r,r,this))}has(e){return this.c.has(e)}entries(){return this.c.entries()}keys(){return this.c.keys()}values(){return this.c.keys()}[(gy=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},wy;(function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"})(wy||(wy={}));var w3=class{constructor(){this[my]="LinkedMap",this.c=new Map,this.d=void 0,this.e=void 0,this.f=0,this.g=0}clear(){this.c.clear(),this.d=void 0,this.e=void 0,this.f=0,this.g++}isEmpty(){return!this.d&&!this.e}get size(){return this.f}get first(){return this.d?.value}get last(){return this.e?.value}has(e){return this.c.has(e)}get(e,t=0){const i=this.c.get(e);if(i)return t!==0&&this.n(i,t),i.value}set(e,t,i=0){let r=this.c.get(e);if(r)r.value=t,i!==0&&this.n(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.l(r);break;case 1:this.k(r);break;case 2:this.l(r);break;default:this.l(r);break}this.c.set(e,r),this.f++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this.c.get(e);if(t)return this.c.delete(e),this.m(t),this.f--,t.value}shift(){if(!this.d&&!this.e)return;if(!this.d||!this.e)throw new Error("Invalid list");const e=this.d;return this.c.delete(e.key),this.m(e),this.f--,e.value}forEach(e,t){const i=this.g;let r=this.d;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this.g!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this.g;let i=this.d;const r={[Symbol.iterator](){return r},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this.g;let i=this.d;const r={[Symbol.iterator](){return r},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this.g;let i=this.d;const r={[Symbol.iterator](){return r},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}[(my=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}h(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this.d,i=this.size;for(;t&&i>e;)this.c.delete(t.key),t=t.next,i--;this.d=t,this.f=i,t&&(t.previous=void 0),this.g++}j(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this.e,i=this.size;for(;t&&i>e;)this.c.delete(t.key),t=t.previous,i--;this.e=t,this.f=i,t&&(t.next=void 0),this.g++}k(e){if(!this.d&&!this.e)this.e=e;else if(this.d)e.next=this.d,this.d.previous=e;else throw new Error("Invalid list");this.d=e,this.g++}l(e){if(!this.d&&!this.e)this.d=e;else if(this.e)e.previous=this.e,this.e.next=e;else throw new Error("Invalid list");this.e=e,this.g++}m(e){if(e===this.d&&e===this.e)this.d=void 0,this.e=void 0;else if(e===this.d){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this.d=e.next}else if(e===this.e){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this.e=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this.g++}n(e,t){if(!this.d||!this.e)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this.d)return;const i=e.next,r=e.previous;e===this.e?(r.next=void 0,this.e=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this.d,this.d.previous=e,this.d=e,this.g++}else if(t===2){if(e===this.e)return;const i=e.next,r=e.previous;e===this.d?(i.previous=void 0,this.d=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this.e,this.e.next=e,this.e=e,this.g++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}},b3=class extends w3{constructor(e,t=1){super(),this.o=e,this.p=Math.min(Math.max(0,t),1)}get limit(){return this.o}set limit(e){this.o=e,this.q()}get ratio(){return this.p}set ratio(e){this.p=Math.min(Math.max(0,e),1),this.q()}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}q(){this.size>this.o&&this.r(Math.round(this.o*this.p))}},sg=class extends b3{constructor(e,t=1){super(e,t)}r(e){this.h(e)}set(e,t){return super.set(e,t),this.q(),this}},by=class{constructor(){this.c=new Map}add(e,t){let i=this.c.get(e);i||(i=new Set,this.c.set(e,i)),i.add(t)}delete(e,t){const i=this.c.get(e);i&&(i.delete(t),i.size===0&&this.c.delete(e))}forEach(e,t){const i=this.c.get(e);i&&i.forEach(t)}get(e){const t=this.c.get(e);return t||new Set}};function ng(e,t){const i=this;let r=!1,s;return function(){if(r)return s;if(r=!0,t)try{s=e.apply(i,arguments)}finally{t()}else s=e.apply(i,arguments);return s}}function si(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function og(e,t="Unreachable"){throw new Error(t)}function ag(e,t="unexpected state"){if(!e)throw typeof t=="string"?new di(`Assertion Failed: ${t}`):t}function yy(e){if(!e()){debugger;e(),Ot(new di("Assertion Failed"))}}function He(e){return typeof e=="string"}function y3(e){return Array.isArray(e)&&e.every(t=>He(t))}function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function S3(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e=="object"&&e instanceof t}function cn(e){return typeof e=="number"&&!isNaN(e)}function x3(e){return!!e&&typeof e[Symbol.iterator]=="function"}function sc(e){return typeof e>"u"}function Oi(e){return!Et(e)}function Et(e){return sc(e)||e===null}function Sy(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function yo(e){return ag(e!=null,"Argument is `undefined` or `null`."),e}var E3=Object.prototype.hasOwnProperty;function cg(e){if(!xt(e))return!1;for(const t in e)if(E3.call(e,t))return!1;return!0}function xy(e){return typeof e=="function"}function k3(e,t){const i=Math.min(e.length,t.length);for(let r=0;r<i;r++)Ey(e[r],t[r])}function Ey(e,t){if(He(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(xy(t)){try{if(e instanceof t)return}catch{}if(!Et(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var fi;(function(e){function t(O){return!!O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}e.is=t;const i=Object.freeze([]);function r(){return i}e.empty=r;function*s(O){yield O}e.single=s;function n(O){return t(O)?O:s(O)}e.wrap=n;function o(O){return O||i}e.from=o;function*a(O){for(let B=O.length-1;B>=0;B--)yield O[B]}e.reverse=a;function c(O){return!O||O[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(O){return O[Symbol.iterator]().next().value}e.first=l;function u(O,B){let G=0;for(const me of O)if(B(me,G++))return!0;return!1}e.some=u;function h(O,B){let G=0;for(const me of O)if(!B(me,G++))return!1;return!0}e.every=h;function p(O,B){for(const G of O)if(B(G))return G}e.find=p;function*f(O,B){for(const G of O)B(G)&&(yield G)}e.filter=f;function*m(O,B){let G=0;for(const me of O)yield B(me,G++)}e.map=m;function*w(O,B){let G=0;for(const me of O)yield*B(me,G++)}e.flatMap=w;function*S(...O){for(const B of O)x3(B)?yield*B:yield B}e.concat=S;function E(O,B,G){let me=G;for(const xe of O)me=B(me,xe);return me}e.reduce=E;function C(O){let B=0;for(const G of O)B++;return B}e.length=C;function*P(O,B,G=O.length){for(B<-O.length&&(B=0),B<0&&(B+=O.length),G<0?G+=O.length:G>O.length&&(G=O.length);B<G;B++)yield O[B]}e.slice=P;function Z(O,B=Number.POSITIVE_INFINITY){const G=[];if(B===0)return[G,O];const me=O[Symbol.iterator]();for(let xe=0;xe<B;xe++){const ke=me.next();if(ke.done)return[G,e.empty()];G.push(ke.value)}return[G,{[Symbol.iterator](){return me}}]}e.consume=Z;async function z(O){const B=[];for await(const G of O)B.push(G);return B}e.asyncToArray=z;async function oe(O){let B=[];for await(const G of O)B=B.concat(G);return B}e.asyncToArrayFlat=oe})(fi||(fi={}));var C3=!1,ln=null,aH=class TC{constructor(){this.b=new Map}static{this.a=0}c(t){let i=this.b.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:TC.a++},this.b.set(t,i)),i}trackDisposable(t){const i=this.c(t);i.source||(i.source=new Error().stack)}setParent(t,i){const r=this.c(t);r.parent=i}markAsDisposed(t){this.b.delete(t)}markAsSingleton(t){this.c(t).isSingleton=!0}f(t,i){const r=i.get(t);if(r)return r;const s=t.parent?this.f(this.c(t.parent),i):t;return i.set(t,s),s}getTrackedDisposables(){const t=new Map;return[...this.b.entries()].filter(([,r])=>r.source!==null&&!this.f(r,t).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(t=10,i){let r;if(i)r=i;else{const c=new Map,l=[...this.b.values()].filter(h=>h.source!==null&&!this.f(h,c).isSingleton);if(l.length===0)return;const u=new Set(l.map(h=>h.value));if(r=l.filter(h=>!(h.parent&&u.has(h.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function s(c){function l(h,p){for(;h.length>0&&p.some(f=>typeof f=="string"?f===h[0]:h[0].match(f));)h.shift()}const u=c.source.split(` `).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return l(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}const n=new by;for(const c of r){const l=s(c);for(let u=0;u<=l.length;u++)n.add(l.slice(0,u).join(` `),c)}r.sort(d3(c=>c.idx,f3));let o="",a=0;for(const c of r.slice(0,t)){a++;const l=s(c),u=[];for(let h=0;h<l.length;h++){let p=l[h];p=`(shared with ${n.get(l.slice(0,h+1).join(` `)).size}/${r.length} leaks) at ${p}`;const m=n.get(l.slice(0,h).join(` `)),w=fy([...m].map(S=>s(S)[h]),S=>S);delete w[l[h]];for(const[S,E]of Object.entries(w))u.unshift(` - stacktraces of ${E.length} other leaks continue with ${S}`);u.unshift(p)}o+=` ==================== Leaking disposable ${a}/${r.length}: ${c.value.constructor.name} ==================== ${u.join(` `)} ============================================================ `}return r.length>t&&(o+=` ... and ${r.length-t} more leaking disposables `),{leaks:r,details:o}}};function $3(e){ln=e}if(C3){const e="__is_disposable_tracked__";$3(new class{trackDisposable(t){const i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==te.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==te.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function So(e){return ln?.trackDisposable(e),e}function xo(e){ln?.markAsDisposed(e)}function un(e,t){ln?.setParent(e,t)}function I3(e,t){if(ln)for(const i of e)ln.setParent(i,t)}function lg(e){return ln?.markAsSingleton(e),e}function ky(e){return typeof e=="object"&&e!==null&&typeof e.dispose=="function"&&e.dispose.length===0}function qi(e){if(fi.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function ug(...e){const t=ce(()=>qi(e));return I3(e,t),t}function ce(e){const t=So({dispose:ng(()=>{xo(t),e()})});return t}var he=class RC{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this.f=new Set,this.g=!1,So(this)}dispose(){this.g||(xo(this),this.g=!0,this.clear())}get isDisposed(){return this.g}clear(){if(this.f.size!==0)try{qi(this.f)}finally{this.f.clear()}}add(t){if(!t||t===te.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return un(t,this),this.g?RC.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.f.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this.f.delete(t),t.dispose()}}deleteAndLeak(t){t&&this.f.has(t)&&(this.f.delete(t),un(t,null))}assertNotDisposed(){this.g&&Ot(new di("Object disposed"))}},te=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this.q=new he,So(this),un(this.q,this)}dispose(){xo(this),this.q.dispose()}B(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this.q.add(e)}},Eo=class{constructor(){this.b=!1,So(this)}get value(){return this.b?void 0:this.a}set value(e){this.b||e===this.a||(this.a?.dispose(),e&&un(e,this),this.a=e)}clear(){this.value=void 0}dispose(){this.b=!0,xo(this),this.a?.dispose(),this.a=void 0}clearAndLeak(){const e=this.a;return this.a=void 0,e&&un(e,null),e}},Lu=class{constructor(){this.a=new Map,this.b=!1,So(this)}dispose(){xo(this),this.b=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this.a.size)try{qi(this.a.values())}finally{this.a.clear()}}has(e){return this.a.has(e)}get size(){return this.a.size}get(e){return this.a.get(e)}set(e,t,i=!1){this.b&&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),i||this.a.get(e)?.dispose(),this.a.set(e,t),un(t,this)}deleteAndDispose(e){this.a.get(e)?.dispose(),this.a.delete(e)}deleteAndLeak(e){const t=this.a.get(e);return t&&un(t,null),this.a.delete(e),t}keys(){return this.a.keys()}values(){return this.a.values()}[Symbol.iterator](){return this.a[Symbol.iterator]()}};function Cy(e,t){return new D3(e,t)}var D3=class{constructor(e,t){this.e=e,this.f=t,this.a={flowing:!1,ended:!1,destroyed:!1},this.b={data:[],error:[]},this.c={data:[],error:[],end:[]},this.d=[]}pause(){this.a.destroyed||(this.a.flowing=!1)}resume(){this.a.destroyed||this.a.flowing||(this.a.flowing=!0,this.j(),this.k(),this.l())}write(e){if(!this.a.destroyed){if(this.a.flowing)this.g(e);else if(this.b.data.push(e),typeof this.f?.highWaterMark=="number"&&this.b.data.length>this.f.highWaterMark)return new Promise(t=>this.d.push(t))}}error(e){this.a.destroyed||(this.a.flowing?this.h(e):this.b.error.push(e))}end(e){this.a.destroyed||(typeof e<"u"&&this.write(e),this.a.flowing?(this.i(),this.destroy()):this.a.ended=!0)}g(e){this.c.data.slice(0).forEach(t=>t(e))}h(e){this.c.error.length===0?Ot(e):this.c.error.slice(0).forEach(t=>t(e))}i(){this.c.end.slice(0).forEach(e=>e())}on(e,t){if(!this.a.destroyed)switch(e){case"data":this.c.data.push(t),this.resume();break;case"end":this.c.end.push(t),this.a.flowing&&this.l()&&this.destroy();break;case"error":this.c.error.push(t),this.a.flowing&&this.k();break}}removeListener(e,t){if(this.a.destroyed)return;let i;switch(e){case"data":i=this.c.data;break;case"end":i=this.c.end;break;case"error":i=this.c.error;break}if(i){const r=i.indexOf(t);r>=0&&i.splice(r,1)}}j(){if(this.b.data.length===0)return;if(typeof this.e=="function"){const t=this.e(this.b.data);this.g(t)}else for(const t of this.b.data)this.g(t);this.b.data.length=0;const e=[...this.d];this.d.length=0,e.forEach(t=>t())}k(){if(this.c.error.length>0){for(const e of this.b.error)this.h(e);this.b.error.length=0}}l(){return this.a.ended?(this.i(),this.c.end.length>0):!1}destroy(){this.a.destroyed||(this.a.destroyed=!0,this.a.ended=!0,this.b.data.length=0,this.b.error.length=0,this.c.data.length=0,this.c.error.length=0,this.c.end.length=0,this.d.length=0)}};function P3(e,t){const i=[];let r;for(;(r=e.read())!==null;)i.push(r);return t(i)}function A3(e,t){return new Promise((i,r)=>{const s=[];$y(e,{onData:n=>{t&&s.push(n)},onError:n=>{t?r(n):i(void 0)},onEnd:()=>{i(t?t(s):void 0)}})})}function $y(e,t,i){e.on("error",r=>{i?.isCancellationRequested||t.onError(r)}),e.on("end",()=>{i?.isCancellationRequested||t.onEnd()}),e.on("data",r=>{i?.isCancellationRequested||t.onData(r)})}function T3(e,t){const i=Cy(t);return i.end(e),i}var nc=typeof Buffer<"u",R3=new At(()=>new Uint8Array(256)),hg,dg,ne=class Zi{static alloc(t){return nc?new Zi(Buffer.allocUnsafe(t)):new Zi(new Uint8Array(t))}static wrap(t){return nc&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new Zi(t)}static fromString(t,i){return!(i?.dontUseNodeBuffer||!1)&&nc?new Zi(Buffer.from(t)):(hg||(hg=new TextEncoder),new Zi(hg.encode(t)))}static fromByteArray(t){const i=Zi.alloc(t.length);for(let r=0,s=t.length;r<s;r++)i.buffer[r]=t[r];return i}static concat(t,i){if(typeof i>"u"){i=0;for(let n=0,o=t.length;n<o;n++)i+=t[n].byteLength}const r=Zi.alloc(i);let s=0;for(let n=0,o=t.length;n<o;n++){const a=t[n];r.set(a,s),s+=a.byteLength}return r}static isNativeBuffer(t){return nc&&Buffer.isBuffer(t)}constructor(t){this.buffer=t,this.byteLength=this.buffer.byteLength}clone(){const t=Zi.alloc(this.byteLength);return t.set(this),t}toString(){return nc?this.buffer.toString():(dg||(dg=new TextDecoder),dg.decode(this.buffer))}slice(t,i){return new Zi(this.buffer.subarray(t,i))}set(t,i){if(t instanceof Zi)this.buffer.set(t.buffer,i);else if(t instanceof Uint8Array)this.buffer.set(t,i);else if(t instanceof ArrayBuffer)this.buffer.set(new Uint8Array(t),i);else if(ArrayBuffer.isView(t))this.buffer.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i);else throw new Error("Unknown argument 'array'")}readUInt32BE(t){return Nu(this.buffer,t)}writeUInt32BE(t,i){Mu(this.buffer,t,i)}readUInt32LE(t){return F3(this.buffer,t)}writeUInt32LE(t,i){O3(this.buffer,t,i)}readUInt8(t){return U3(this.buffer,t)}writeUInt8(t,i){j3(this.buffer,t,i)}indexOf(t,i=0){return L3(this.buffer,t instanceof Zi?t.buffer:t,i)}equals(t){return this===t?!0:this.byteLength!==t.byteLength?!1:this.buffer.every((i,r)=>i===t.buffer[r])}};function L3(e,t,i=0){const r=t.byteLength,s=e.byteLength;if(r===0)return 0;if(r===1)return e.indexOf(t[0]);if(r>s-i)return-1;const n=R3.value;n.fill(t.length);for(let l=0;l<t.length;l++)n[t[l]]=t.length-l-1;let o=i+t.length-1,a=o,c=-1;for(;o<s;)if(e[o]===t[a]){if(a===0){c=o;break}o--,a--}else o+=Math.max(t.length-a,n[e[o]]),a=t.length-1;return c}function N3(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function M3(e,t,i){e[i+0]=t&255,t=t>>>8,e[i+1]=t&255}function Nu(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function Mu(e,t,i){e[i+3]=t,t=t>>>8,e[i+2]=t,t=t>>>8,e[i+1]=t,t=t>>>8,e[i]=t}function F3(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0|e[t+2]<<16>>>0|e[t+3]<<24>>>0}function O3(e,t,i){e[i+0]=t&255,t=t>>>8,e[i+1]=t&255,t=t>>>8,e[i+2]=t&255,t=t>>>8,e[i+3]=t&255}function U3(e,t){return e[t]}function j3(e,t,i){e[i]=t}function H3(e){return P3(e,t=>ne.concat(t))}function B3(e){return T3(e,t=>ne.concat(t))}function ko(e){let t=0,i=0,r=0;const s=new Uint8Array(Math.floor(e.length/4*3)),n=a=>{switch(i){case 3:s[r++]=t|a,i=0;break;case 2:s[r++]=t|a>>>2,t=a<<6,i=3;break;case 1:s[r++]=t|a>>>4,t=a<<4,i=2;break;default:t=a<<2,i=1}};for(let a=0;a<e.length;a++){const c=e.charCodeAt(a);if(c>=65&&c<=90)n(c-65);else if(c>=97&&c<=122)n(c-97+26);else if(c>=48&&c<=57)n(c-48+52);else if(c===43||c===45)n(62);else if(c===47||c===95)n(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${e[a]}`)}}const o=r;for(;i>0;)n(0);return ne.wrap(s).slice(0,o)}var _3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Fu({buffer:e},t=!0,i=!1){const r=i?W3:_3;let s="";const n=e.byteLength%3;let o=0;for(;o<e.byteLength-n;o+=3){const a=e[o+0],c=e[o+1],l=e[o+2];s+=r[a>>>2],s+=r[(a<<4|c>>>4)&63],s+=r[(c<<2|l>>>6)&63],s+=r[l&63]}if(n===1){const a=e[o+0];s+=r[a>>>2],s+=r[a<<4&63],t&&(s+="==")}else if(n===2){const a=e[o+0],c=e[o+1];s+=r[a>>>2],s+=r[(a<<4|c>>>4)&63],s+=r[c<<2&63],t&&(s+="=")}return s}var Iy="0123456789abcdef";function fg({buffer:e}){let t="";for(let i=0;i<e.length;i++){const r=e[i];t+=Iy[r>>>4],t+=Iy[r&15]}return t}function z3(e){if(e.length%2!==0)throw new SyntaxError("Hex string must have an even length");const t=new Uint8Array(e.length>>1);for(let i=0;i<e.length;)t[i>>1]=Dy(e,i++)<<4|Dy(e,i++);return ne.wrap(t)}function Dy(e,t){const i=e.charCodeAt(t);if(i>=48&&i<=57)return i-48;if(i>=97&&i<=102)return i-87;if(i>=65&&i<=70)return i-55;throw new SyntaxError(`Invalid hex character at position ${t}`)}var vt=class Np{static{this.Undefined=new Np(void 0)}constructor(t){this.element=t,this.next=Np.Undefined,this.prev=Np.Undefined}},xs=class{constructor(){this.a=vt.Undefined,this.b=vt.Undefined,this.c=0}get size(){return this.c}isEmpty(){return this.a===vt.Undefined}clear(){let e=this.a;for(;e!==vt.Undefined;){const t=e.next;e.prev=vt.Undefined,e.next=vt.Undefined,e=t}this.a=vt.Undefined,this.b=vt.Undefined,this.c=0}unshift(e){return this.d(e,!1)}push(e){return this.d(e,!0)}d(e,t){const i=new vt(e);if(this.a===vt.Undefined)this.a=i,this.b=i;else if(t){const s=this.b;this.b=i,i.prev=s,s.next=i}else{const s=this.a;this.a=i,i.next=s,s.prev=i}this.c+=1;let r=!1;return()=>{r||(r=!0,this.e(i))}}shift(){if(this.a!==vt.Undefined){const e=this.a.element;return this.e(this.a),e}}pop(){if(this.b!==vt.Undefined){const e=this.b.element;return this.e(this.b),e}}e(e){if(e.prev!==vt.Undefined&&e.next!==vt.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===vt.Undefined&&e.next===vt.Undefined?(this.a=vt.Undefined,this.b=vt.Undefined):e.next===vt.Undefined?(this.b=this.b.prev,this.b.next=vt.Undefined):e.prev===vt.Undefined&&(this.a=this.a.next,this.a.prev=vt.Undefined);this.c-=1}*[Symbol.iterator](){let e=this.a;for(;e!==vt.Undefined;)yield e.element,e=e.next}},V3=globalThis.performance.now.bind(globalThis.performance),hn=class LC{static create(t){return new LC(t)}constructor(t){this.c=t===!1?Date.now:V3,this.a=this.c(),this.b=-1}stop(){this.b=this.c()}reset(){this.a=this.c(),this.b=-1}elapsed(){return this.b!==-1?this.b-this.a:this.c()-this.a}},Py=!1,q3=!1,ht;(function(e){e.None=()=>te.None;function t(j){if(q3){const{onDidAddListener:_}=j,W=pg.create();let Q=0;j.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),W.print()),_?.()}}}function i(j,_){return f(j,()=>{},0,void 0,!0,void 0,_)}e.defer=i;function r(j){return(_,W=null,Q)=>{let Y=!1,ge;return ge=j(Ee=>{if(!Y)return ge?ge.dispose():Y=!0,_.call(W,Ee)},null,Q),Y&&ge.dispose(),ge}}e.once=r;function s(j,_){return e.once(e.filter(j,_))}e.onceIf=s;function n(j,_,W){return h((Q,Y=null,ge)=>j(Ee=>Q.call(Y,_(Ee)),null,ge),W)}e.map=n;function o(j,_,W){return h((Q,Y=null,ge)=>j(Ee=>{_(Ee),Q.call(Y,Ee)},null,ge),W)}e.forEach=o;function a(j,_,W){return h((Q,Y=null,ge)=>j(Ee=>_(Ee)&&Q.call(Y,Ee),null,ge),W)}e.filter=a;function c(j){return j}e.signal=c;function l(...j){return(_,W=null,Q)=>{const Y=ug(...j.map(ge=>ge(Ee=>_.call(W,Ee))));return p(Y,Q)}}e.any=l;function u(j,_,W,Q){let Y=W;return n(j,ge=>(Y=_(Y,ge),Y),Q)}e.reduce=u;function h(j,_){let W;const Q={onWillAddFirstListener(){W=j(Y.fire,Y)},onDidRemoveLastListener(){W?.dispose()}};_||t(Q);const Y=new D(Q);return _?.add(Y),Y.event}function p(j,_){return _ instanceof Array?_.push(j):_&&_.add(j),j}function f(j,_,W=100,Q=!1,Y=!1,ge,Ee){let De,nt,yt,ze=0,dt;const ii={leakWarningThreshold:ge,onWillAddFirstListener(){De=j(Wi=>{ze++,nt=_(nt,Wi),Q&&!yt&&(Mt.fire(nt),nt=void 0),dt=()=>{const bs=nt;nt=void 0,yt=void 0,(!Q||ze>1)&&Mt.fire(bs),ze=0},typeof W=="number"?(yt&&clearTimeout(yt),yt=setTimeout(dt,W)):yt===void 0&&(yt=null,queueMicrotask(dt))})},onWillRemoveListener(){Y&&ze>0&&dt?.()},onDidRemoveLastListener(){dt=void 0,De.dispose()}};Ee||t(ii);const Mt=new D(ii);return Ee?.add(Mt),Mt.event}e.debounce=f;function m(j,_=0,W){return e.debounce(j,(Q,Y)=>Q?(Q.push(Y),Q):[Y],_,void 0,!0,void 0,W)}e.accumulate=m;function w(j,_=(Q,Y)=>Q===Y,W){let Q=!0,Y;return a(j,ge=>{const Ee=Q||!_(ge,Y);return Q=!1,Y=ge,Ee},W)}e.latch=w;function S(j,_,W){return[e.filter(j,_,W),e.filter(j,Q=>!_(Q),W)]}e.split=S;function E(j,_=!1,W=[],Q){let Y=W.slice(),ge=j(nt=>{Y?Y.push(nt):De.fire(nt)});Q&&Q.add(ge);const Ee=()=>{Y?.forEach(nt=>De.fire(nt)),Y=null},De=new D({onWillAddFirstListener(){ge||(ge=j(nt=>De.fire(nt)),Q&&Q.add(ge))},onDidAddFirstListener(){Y&&(_?setTimeout(Ee):Ee())},onDidRemoveLastListener(){ge&&ge.dispose(),ge=null}});return Q&&Q.add(De),De.event}e.buffer=E;function C(j,_){return(Q,Y,ge)=>{const Ee=_(new Z);return j(function(De){const nt=Ee.evaluate(De);nt!==P&&Q.call(Y,nt)},void 0,ge)}}e.chain=C;const P=Symbol("HaltChainable");class Z{constructor(){this.f=[]}map(_){return this.f.push(_),this}forEach(_){return this.f.push(W=>(_(W),W)),this}filter(_){return this.f.push(W=>_(W)?W:P),this}reduce(_,W){let Q=W;return this.f.push(Y=>(Q=_(Q,Y),Q)),this}latch(_=(W,Q)=>W===Q){let W=!0,Q;return this.f.push(Y=>{const ge=W||!_(Y,Q);return W=!1,Q=Y,ge?Y:P}),this}evaluate(_){for(const W of this.f)if(_=W(_),_===P)break;return _}}function z(j,_,W=Q=>Q){const Q=(...De)=>Ee.fire(W(...De)),Y=()=>j.on(_,Q),ge=()=>j.removeListener(_,Q),Ee=new D({onWillAddFirstListener:Y,onDidRemoveLastListener:ge});return Ee.event}e.fromNodeEventEmitter=z;function oe(j,_,W=Q=>Q){const Q=(...De)=>Ee.fire(W(...De)),Y=()=>j.addEventListener(_,Q),ge=()=>j.removeEventListener(_,Q),Ee=new D({onWillAddFirstListener:Y,onDidRemoveLastListener:ge});return Ee.event}e.fromDOMEventEmitter=oe;function O(j,_){let W;const Q=new Promise((Y,ge)=>{const Ee=r(j)(Y,null,_);W=()=>Ee.dispose()});return Q.cancel=W,Q}e.toPromise=O;function B(j,_){return j(W=>_.fire(W))}e.forward=B;function G(j,_,W){return _(W),j(Q=>_(Q))}e.runAndSubscribe=G;class me{constructor(_,W){this._observable=_,this.f=0,this.g=!1;const Q={onWillAddFirstListener:()=>{_.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{_.removeObserver(this)}};W||t(Q),this.emitter=new D(Q),W&&W.add(this.emitter)}beginUpdate(_){this.f++}handlePossibleChange(_){}handleChange(_,W){this.g=!0}endUpdate(_){this.f--,this.f===0&&(this._observable.reportChanges(),this.g&&(this.g=!1,this.emitter.fire(this._observable.get())))}}function xe(j,_){return new me(j,_).emitter.event}e.fromObservable=xe;function ke(j){return(_,W,Q)=>{let Y=0,ge=!1;const Ee={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(j.reportChanges(),ge&&(ge=!1,_.call(W)))},handlePossibleChange(){},handleChange(){ge=!0}};j.addObserver(Ee),j.reportChanges();const De={dispose(){j.removeObserver(Ee)}};return Q instanceof he?Q.add(De):Array.isArray(Q)&&Q.push(De),De}}e.fromObservableLight=ke})(ht||(ht={}));var G3=class Lb{static{this.all=new Set}static{this.f=0}constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Lb.f++}`,Lb.all.add(this)}start(t){this.g=new hn,this.listenerCount=t}stop(){if(this.g){const t=this.g.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this.g=void 0}}},Ay=-1,Q3=class NC{static{this.f=1}constructor(t,i,r=(NC.f++).toString(16).padStart(3,"0")){this.j=t,this.threshold=i,this.name=r,this.h=0}dispose(){this.g?.clear()}check(t,i){const r=this.threshold;if(r<=0||i<r)return;this.g||(this.g=new Map);const s=this.g.get(t.value)||0;if(this.g.set(t.value,s+1),this.h-=1,this.h<=0){this.h=r*.5;const[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);const c=new J3(a,n);this.j(c)}return()=>{const n=this.g.get(t.value)||0;this.g.set(t.value,n-1)}}getMostFrequentStack(){if(!this.g)return;let t,i=0;for(const[r,s]of this.g)(!t||i<s)&&(t=[r,s],i=s);return t}},pg=class MC{static create(){const t=new Error;return new MC(t.stack??"")}constructor(t){this.value=t}print(){console.warn(this.value.split(` `).slice(2).join(` `))}},J3=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Z3=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Y3=0,Ou=class{constructor(e){this.value=e,this.id=Y3++}},X3=2,Ty=(e,t)=>{if(e instanceof Ou)t(e);else for(let i=0;i<e.length;i++){const r=e[i];r&&t(r)}},D=class{constructor(e){this.A=0,this.g=e,this.j=Ay>0||this.g?.leakWarningThreshold?new Q3(e?.onListenerError??Ot,this.g?.leakWarningThreshold??Ay):void 0,this.m=this.g?._profName?new G3(this.g._profName):void 0,this.z=this.g?.deliveryQueue}dispose(){if(!this.q){if(this.q=!0,this.z?.current===this&&this.z.reset(),this.w){if(Py){const e=this.w;queueMicrotask(()=>{Ty(e,t=>t.stack?.print())})}this.w=void 0,this.A=0}this.g?.onDidRemoveLastListener?.(),this.j?.dispose()}}get event(){return this.u??=(e,t,i)=>{if(this.j&&this.A>this.j.threshold**2){const a=`[${this.j.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this.A} vs ${this.j.threshold})`;console.warn(a);const c=this.j.getMostFrequentStack()??["UNKNOWN stack",-1],l=new Z3(`${a}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this.g?.onListenerError||Ot)(l),te.None}if(this.q)return te.None;t&&(e=e.bind(t));const r=new Ou(e);let s,n;this.j&&this.A>=Math.ceil(this.j.threshold*.2)&&(r.stack=pg.create(),s=this.j.check(r.stack,this.A+1)),Py&&(r.stack=n??pg.create()),this.w?this.w instanceof Ou?(this.z??=new K3,this.w=[this.w,r]):this.w.push(r):(this.g?.onWillAddFirstListener?.(this),this.w=r,this.g?.onDidAddFirstListener?.(this)),this.g?.onDidAddListener?.(this),this.A++;const o=ce(()=>{s?.(),this.B(r)});return i instanceof he?i.add(o):Array.isArray(i)&&i.push(o),o},this.u}B(e){if(this.g?.onWillRemoveListener?.(this),!this.w)return;if(this.A===1){this.w=void 0,this.g?.onDidRemoveLastListener?.(this),this.A=0;return}const t=this.w,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this.q),console.log("size?",this.A),console.log("arr?",JSON.stringify(this.w)),new Error("Attempted to dispose unknown listener");this.A--,t[i]=void 0;const r=this.z.current===this;if(this.A*X3<=t.length){let s=0;for(let n=0;n<t.length;n++)t[n]?t[s++]=t[n]:r&&s<this.z.end&&(this.z.end--,s<this.z.i&&this.z.i--);t.length=s}}C(e,t){if(!e)return;const i=this.g?.onListenerError||Ot;if(!i){e.value(t);return}try{e.value(t)}catch(r){i(r)}}D(e){const t=e.current.w;for(;e.i<e.end;)this.C(t[e.i++],e.value);e.reset()}fire(e){if(this.z?.current&&(this.D(this.z),this.m?.stop()),this.m?.start(this.A),this.w)if(this.w instanceof Ou)this.C(this.w,e);else{const t=this.z;t.enqueue(this,e,this.w.length),this.D(t)}this.m?.stop()}hasListeners(){return this.A>0}},K3=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},oc=class extends D{async fireAsync(e,t,i){if(this.w)for(this.f||(this.f=new xs),Ty(this.w,r=>this.f.push([r.value,e]));this.f.size>0&&!t.isCancellationRequested;){const[r,s]=this.f.shift(),n=[],o={...s,token:t,waitUntil:a=>{if(Object.isFrozen(n))throw new Error("waitUntil can NOT be called asynchronous");i&&(a=i(a,r)),n.push(a)}};try{r(o)}catch(a){Ot(a);continue}Object.freeze(n),await Promise.allSettled(n).then(a=>{for(const c of a)c.status==="rejected"&&Ot(c.reason)})}}},Uu=class extends D{get isPaused(){return this.f!==0}constructor(e){super(e),this.f=0,this.h=new xs,this.s=e?.merge}pause(){this.f++}resume(){if(this.f!==0&&--this.f===0)if(this.s){if(this.h.size>0){const e=Array.from(this.h);this.h.clear(),super.fire(this.s(e))}}else for(;!this.f&&this.h.size!==0;)super.fire(this.h.shift())}fire(e){this.A&&(this.f!==0?this.h.push(e):super.fire(e))}},eI=class extends Uu{constructor(e){super(e),this.k=e.delay??100}fire(e){this.o||(this.pause(),this.o=setTimeout(()=>{this.o=void 0,this.resume()},this.k)),super.fire(e)}},tI=class extends D{constructor(e){super(e),this.f=[],this.h=e?.