1 line
231 KiB
JavaScript
1 line
231 KiB
JavaScript
|
(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(o.isErrorNoTelemetry(e))throw new o(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function n(e){var n;(n=e)instanceof s||n instanceof Error&&n.name===r&&n.message===r||t.onUnexpectedError(e)}function i(e){if(e instanceof Error){const{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack,noTelemetry:o.isErrorNoTelemetry(e)}}return e}const r="Canceled";class s extends Error{constructor(){super(r),this.name=this.message}}class o extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof o)return e;const t=new o;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class a extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,a.prototype)}}function l(e){const t=this;let n,i=!1;return function(){return i||(i=!0,n=e.apply(t,arguments)),n}}var u;!function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const n=Object.freeze([]);function*i(e){yield e}e.empty=function(){return n},e.single=i,e.wrap=function(e){return t(e)?e:i(e)},e.from=function(e){return e||n},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.find=function(e,t){for(const n of e)if(t(n))return n},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){let n=0;for(const i of e)yield t(i,n++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,n){let i=n;for(const n of e)i=t(i,n);return i},e.slice=function*(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]},e.consume=function(t,n=Number.POSITIVE_INFINITY){const i=[];if(0===n)return[i,t];const r=t[Symbol.iterator]();for(let t=0;t<n;t++){const t=r.next();if(t.done)return[i,e.empty()];i.push(t.value)}return[i,{[Symbol.iterator]:()=>r}]}}(u||(u={}));let h=null;function c(e){return null==h||h.trackDisposable(e),e}function d(e){null==h||h.markAsDisposed(e)}function g(e,t){null==h||h.setParent(e,t)}function m(e){if(u.is(e)){const t=[];for(const n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function f(e){const t=c({dispose:l((()=>{d(t),e()}))});return t}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,c(this)}dispose(){this._isDisposed||(d(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{m(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return g(e,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}p.DISABLE_DISPOSED_WARNING=!1;class b{constructor(){this._store=new p,c(this),g(this._store,this)}dispose(){d(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}b.None=Object.freeze({dispose(){}}),Symbol.iterator;class _{constructor(e){this.element=e,this.next=_.Undefined,this.prev=_.Undefined}}_.Undefined=new _(void 0);class C{constructor(){t
|