@vscode/markdown-editor 0.0.2-2 → 0.0.2-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { B as w, T, g as C, b as u, s as c, O as E, c as v, o as V, d as _, t as g, e as k, a as S, C as O, f as z, h as b, i as W, j as D, k as N, l as P, m as R, n as q, p as L } from "./runOnChange-owE1SMC0.js";
2
- import { D as de, q as oe, u as ue, v as he, w as le, x as be, y as fe, z as ce, A as ge, E as ve, F as _e, G as pe, H as me, I as Ce, J as Oe, K as ye, L as we, M as Ve, N as Se, P as De, Q as Ue, R as Fe, S as Te, r as Ee, U as ke, V as ze, W as We, X as Ne, Y as Pe } from "./runOnChange-owE1SMC0.js";
3
- class H extends w {
1
+ import { B as O, T, g as C, b as u, s as c, O as E, e as v, o as V, d as _, t as g, f as k, a as S, C as y, h as z, i as f, j as D, k as W, l as N, m as P, n as R, p as q } from "./runOnChange-C00UIwqQ.js";
2
+ import { D as re, q as ne, u as ie, v as de, w as oe, x as ue, y as he, z as le, c as fe, A as be, E as ce, F as ge, G as ve, H as _e, I as pe, J as me, K as Ce, L as ye, M as we, N as Oe, P as Ve, Q as Se, R as De, S as Ue, r as Fe, U as Te, V as Ee, W as ke, X as ze, Y as We } from "./runOnChange-C00UIwqQ.js";
3
+ class L extends O {
4
4
  get debugName() {
5
5
  return this._debugNameData.getDebugName(this) ?? "LazyObservableValue";
6
6
  }
@@ -75,9 +75,9 @@ class H extends w {
75
75
  }
76
76
  }
77
77
  function U(a, e, t = v.ofCaller()) {
78
- return a.lazy ? new H(new u(a.owner, a.debugName, void 0), e, a.equalsFn ?? c, t) : new E(new u(a.owner, a.debugName, void 0), e, a.equalsFn ?? c, t);
78
+ return a.lazy ? new L(new u(a.owner, a.debugName, void 0), e, a.equalsFn ?? c, t) : new E(new u(a.owner, a.debugName, void 0), e, a.equalsFn ?? c, t);
79
79
  }
80
- class I {
80
+ class H {
81
81
  /**
82
82
  * The cached value.
83
83
  * Does not force a computation of the value.
@@ -107,15 +107,15 @@ class p {
107
107
  if (s)
108
108
  return s.getDataOrThrow();
109
109
  }), this.promise = e.then((t) => (g((s) => {
110
- this._value.set(new y(t, void 0), s);
110
+ this._value.set(new w(t, void 0), s);
111
111
  }), t), (t) => {
112
112
  throw g((s) => {
113
- this._value.set(new y(void 0, t), s);
113
+ this._value.set(new w(void 0, t), s);
114
114
  }), t;
115
115
  });
116
116
  }
117
117
  }
118
- class y {
118
+ class w {
119
119
  constructor(e, t) {
120
120
  this.data = e, this.error = t;
121
121
  }
@@ -128,44 +128,44 @@ class y {
128
128
  return this.data;
129
129
  }
130
130
  }
131
- class G {
131
+ class x {
132
132
  constructor(e) {
133
- this._computePromise = e, this._lazyValue = new I(() => new p(this._computePromise())), this.cachedPromiseResult = _(this, (t) => this._lazyValue.cachedValue.read(t)?.promiseResult.read(t));
133
+ this._computePromise = e, this._lazyValue = new H(() => new p(this._computePromise())), this.cachedPromiseResult = _(this, (t) => this._lazyValue.cachedValue.read(t)?.promiseResult.read(t));
134
134
  }
135
135
  getPromise() {
136
136
  return this._lazyValue.getValue().promise;
137
137
  }
138
138
  }
139
- function J(a, e, t, s) {
139
+ function K(a, e, t, s) {
140
140
  return e || (e = (r) => r != null), new Promise((r, n) => {
141
141
  let i = !0, d = !1;
142
- const f = a.map((o) => ({
142
+ const b = a.map((o) => ({
143
143
  isFinished: e(o),
144
144
  error: t ? t(o) : !1,
145
145
  state: o
146
146
  })), h = S((o) => {
147
- const { isFinished: F, error: l, state: m } = f.read(o);
147
+ const { isFinished: F, error: l, state: m } = b.read(o);
148
148
  (F || l) && (i ? d = !0 : h.dispose(), l ? n(l === !0 ? m : l) : r(m));
149
149
  });
150
150
  if (s) {
151
151
  const o = s.onCancellationRequested(() => {
152
- h.dispose(), o.dispose(), n(new O());
152
+ h.dispose(), o.dispose(), n(new y());
153
153
  });
154
154
  if (s.isCancellationRequested) {
155
- h.dispose(), o.dispose(), n(new O());
155
+ h.dispose(), o.dispose(), n(new y());
156
156
  return;
157
157
  }
158
158
  }
159
159
  i = !1, d && h.dispose();
160
160
  });
161
161
  }
162
- function Q(a, e) {
162
+ function G(a, e) {
163
163
  let t, s;
164
164
  e === void 0 ? (t = a, s = void 0) : (s = a, t = e);
165
165
  let r;
166
166
  return new k(new u(s, void 0, t), (n) => (r && r.dispose(), r = new z(), t(n, r.token)), void 0, () => r?.dispose(), c, v.ofCaller());
167
167
  }
168
- function X(a) {
168
+ function J(a) {
169
169
  return {
170
170
  createChangeSummary: (e) => ({
171
171
  changes: []
@@ -178,13 +178,13 @@ function X(a) {
178
178
  beforeUpdate(e, t) {
179
179
  for (const s in a) {
180
180
  if (s === "changes")
181
- throw new b('property name "changes" is reserved for change tracking');
181
+ throw new f('property name "changes" is reserved for change tracking');
182
182
  t[s] = a[s].read(e);
183
183
  }
184
184
  }
185
185
  };
186
186
  }
187
- function Y(a) {
187
+ function Q(a) {
188
188
  let e;
189
189
  return {
190
190
  createChangeSummary: (t) => ({
@@ -200,40 +200,16 @@ function Y(a) {
200
200
  e || (e = a());
201
201
  for (const r in e) {
202
202
  if (r === "changes")
203
- throw new b('property name "changes" is reserved for change tracking');
203
+ throw new f('property name "changes" is reserved for change tracking');
204
204
  s[r] = e[r].read(t);
205
205
  }
206
206
  }
207
207
  };
208
208
  }
209
- function Z(a) {
210
- return new A(a);
209
+ function I(a, e, t = v.ofCaller()) {
210
+ return new A(typeof a == "string" ? a : new u(a, void 0, void 0), e, t);
211
211
  }
212
- class A extends W {
213
- constructor(e) {
214
- super(), this.value = e;
215
- }
216
- get debugName() {
217
- return this.toString();
218
- }
219
- get() {
220
- return this.value;
221
- }
222
- addObserver(e) {
223
- }
224
- removeObserver(e) {
225
- }
226
- log() {
227
- return this;
228
- }
229
- toString() {
230
- return `Const: ${this.value}`;
231
- }
232
- }
233
- function B(a, e, t = v.ofCaller()) {
234
- return new M(typeof a == "string" ? a : new u(a, void 0, void 0), e, t);
235
- }
236
- class M extends w {
212
+ class A extends O {
237
213
  constructor(e, t, s) {
238
214
  super(s), this.event = t, this.handleEvent = () => {
239
215
  g((r) => {
@@ -251,7 +227,7 @@ class M extends w {
251
227
  get() {
252
228
  }
253
229
  }
254
- function $(a) {
230
+ function B(a) {
255
231
  return (e) => {
256
232
  let t = !0;
257
233
  return S((s) => {
@@ -259,29 +235,29 @@ function $(a) {
259
235
  });
260
236
  };
261
237
  }
262
- class x {
238
+ class M {
263
239
  constructor(e) {
264
240
  this.observable = e;
265
241
  }
266
242
  get onDidChange() {
267
- return $(this.observable);
243
+ return B(this.observable);
268
244
  }
269
245
  get value() {
270
246
  return this.observable.get();
271
247
  }
272
248
  }
273
- function j(a, e) {
274
- return e instanceof x ? e.observable : D(a, e.onDidChange, () => e.value);
249
+ function X(a, e) {
250
+ return e instanceof M ? e.observable : D(a, e.onDidChange, () => e.value);
275
251
  }
276
- function ee(a, e) {
252
+ function Y(a, e) {
277
253
  if (e.length === 0)
278
- throw new b();
254
+ throw new f();
279
255
  let t = !1, s;
280
256
  const r = D(a, (n) => {
281
- const i = new P();
257
+ const i = new N();
282
258
  for (const d of e)
283
- i.add(R({ debugName: () => q(r, new u(a, void 0, void 0)) + ".updateLastChangedValue" }, (f) => {
284
- t = !0, s = d.read(f), n();
259
+ i.add(P({ debugName: () => R(r, new u(a, void 0, void 0)) + ".updateLastChangedValue" }, (b) => {
260
+ t = !0, s = d.read(b), n();
285
261
  }));
286
262
  return i.add({
287
263
  dispose() {
@@ -291,15 +267,15 @@ function ee(a, e) {
291
267
  }, () => t ? s : e[e.length - 1].get());
292
268
  return r;
293
269
  }
294
- function te(a, e) {
295
- return N(a, (t, s) => s ?? e(t));
270
+ function Z(a, e) {
271
+ return W(a, (t, s) => s ?? e(t));
296
272
  }
297
- function se(a, e, t) {
273
+ function j(a, e, t) {
298
274
  let s, r, n = !1;
299
- const i = B("deferUnobserve", (d) => {
275
+ const i = I("deferUnobserve", (d) => {
300
276
  if (n)
301
- throw new b("deferUnobserve: Cannot add observer after disposal");
302
- return r !== void 0 && (clearTimeout(r), r = void 0), s || (s = L(e)), {
277
+ throw new f("deferUnobserve: Cannot add observer after disposal");
278
+ return r !== void 0 && (clearTimeout(r), r = void 0), s || (s = q(e)), {
303
279
  dispose() {
304
280
  r = setTimeout(() => {
305
281
  r = void 0, s?.dispose(), s = void 0;
@@ -313,7 +289,7 @@ function se(a, e, t) {
313
289
  }
314
290
  }), _((d) => (i.read(d), e.read(d)));
315
291
  }
316
- class ae {
292
+ class ee {
317
293
  constructor() {
318
294
  this._data = /* @__PURE__ */ new Set(), this._obs = U({ equalsFn: () => !1 }, this), this.observable = this._obs;
319
295
  }
@@ -355,7 +331,7 @@ class ae {
355
331
  return "ObservableSet";
356
332
  }
357
333
  }
358
- class re {
334
+ class te {
359
335
  constructor() {
360
336
  this._data = /* @__PURE__ */ new Map(), this._obs = U({ equalsFn: () => !1 }, this), this.observable = this._obs;
361
337
  }
@@ -402,62 +378,62 @@ class re {
402
378
  }
403
379
  export {
404
380
  v as DebugLocation,
405
- de as Disposable,
406
- P as DisposableStore,
407
- I as ObservableLazy,
408
- G as ObservableLazyPromise,
409
- re as ObservableMap,
381
+ re as Disposable,
382
+ N as DisposableStore,
383
+ H as ObservableLazy,
384
+ x as ObservableLazyPromise,
385
+ te as ObservableMap,
410
386
  p as ObservablePromise,
411
- ae as ObservableSet,
412
- y as PromiseResult,
387
+ ee as ObservableSet,
388
+ w as PromiseResult,
413
389
  T as TransactionImpl,
414
- x as ValueWithChangeEventFromObservable,
415
- oe as asyncTransaction,
390
+ M as ValueWithChangeEventFromObservable,
391
+ ne as asyncTransaction,
416
392
  S as autorun,
417
- ue as autorunDelta,
418
- he as autorunHandleChanges,
419
- le as autorunIterableDelta,
420
- R as autorunOpts,
421
- be as autorunSelfDisposable,
422
- fe as autorunWithStore,
423
- ce as autorunWithStoreHandleChanges,
424
- Z as constObservable,
425
- ge as debouncedObservable,
426
- ve as debouncedObservableDeprecated,
427
- se as deferUnobserve,
393
+ ie as autorunDelta,
394
+ de as autorunHandleChanges,
395
+ oe as autorunIterableDelta,
396
+ P as autorunOpts,
397
+ ue as autorunSelfDisposable,
398
+ he as autorunWithStore,
399
+ le as autorunWithStoreHandleChanges,
400
+ fe as constObservable,
401
+ be as debouncedObservable,
402
+ ce as debouncedObservableDeprecated,
403
+ j as deferUnobserve,
428
404
  _ as derived,
429
- te as derivedConstOnceDefined,
430
- _e as derivedDisposable,
431
- pe as derivedHandleChanges,
432
- N as derivedObservableWithCache,
433
- me as derivedObservableWithWritableCache,
434
- Ce as derivedOpts,
435
- Q as derivedWithCancellationToken,
436
- Oe as derivedWithSetter,
437
- ye as derivedWithStore,
438
- we as disposableObservableValue,
439
- Ve as globalTransaction,
440
- L as keepObserved,
441
- ee as latestChangedValue,
442
- Se as mapObservableArrayCached,
405
+ Z as derivedConstOnceDefined,
406
+ ge as derivedDisposable,
407
+ ve as derivedHandleChanges,
408
+ W as derivedObservableWithCache,
409
+ _e as derivedObservableWithWritableCache,
410
+ pe as derivedOpts,
411
+ G as derivedWithCancellationToken,
412
+ me as derivedWithSetter,
413
+ Ce as derivedWithStore,
414
+ ye as disposableObservableValue,
415
+ we as globalTransaction,
416
+ q as keepObserved,
417
+ Y as latestChangedValue,
418
+ Oe as mapObservableArrayCached,
443
419
  D as observableFromEvent,
444
- De as observableFromEventOpts,
445
- Ue as observableFromPromise,
446
- j as observableFromValueWithChangeEvent,
447
- Fe as observableSignal,
448
- B as observableSignalFromEvent,
420
+ Ve as observableFromEventOpts,
421
+ Se as observableFromPromise,
422
+ X as observableFromValueWithChangeEvent,
423
+ De as observableSignal,
424
+ I as observableSignalFromEvent,
449
425
  V as observableValue,
450
426
  U as observableValueOpts,
451
- Te as recomputeInitiallyAndOnChange,
452
- X as recordChanges,
453
- Y as recordChangesLazy,
454
- Ee as runOnChange,
455
- ke as runOnChangeWithCancellationToken,
456
- ze as runOnChangeWithStore,
457
- We as signalFromObservable,
458
- Ne as subtransaction,
427
+ Ue as recomputeInitiallyAndOnChange,
428
+ J as recordChanges,
429
+ Q as recordChangesLazy,
430
+ Fe as runOnChange,
431
+ Te as runOnChangeWithCancellationToken,
432
+ Ee as runOnChangeWithStore,
433
+ ke as signalFromObservable,
434
+ ze as subtransaction,
459
435
  g as transaction,
460
- J as waitForState,
461
- Pe as wasEventTriggeredRecently
436
+ K as waitForState,
437
+ We as wasEventTriggeredRecently
462
438
  };
463
439
  //# sourceMappingURL=observables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observables.js","sources":["../../../external/vscode-observables/observables/dist/observableInternal/observables/lazyObservableValue.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableValueOpts.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/promise.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js","../../../external/vscode-observables/observables/dist/observableInternal/changeTracker.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/constObservable.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableSignalFromEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/valueWithChangeEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/utils.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/deferUnobserve.js","../../../external/vscode-observables/observables/dist/observableInternal/set.js","../../../external/vscode-observables/observables/dist/observableInternal/map.js"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { TransactionImpl } from '../transaction.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Holds off updating observers until the value is actually read.\n*/\nclass LazyObservableValue extends BaseObservable {\n get debugName() {\n return this._debugNameData.getDebugName(this) ?? 'LazyObservableValue';\n }\n constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) {\n super(debugLocation);\n this._debugNameData = _debugNameData;\n this._equalityComparator = _equalityComparator;\n this._isUpToDate = true;\n this._deltas = [];\n this._updateCounter = 0;\n this._value = initialValue;\n }\n get() {\n this._update();\n return this._value;\n }\n _update() {\n if (this._isUpToDate) {\n return;\n }\n this._isUpToDate = true;\n if (this._deltas.length > 0) {\n for (const change of this._deltas) {\n getLogger()?.handleObservableUpdated(this, { change, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, change);\n }\n }\n this._deltas.length = 0;\n }\n else {\n getLogger()?.handleObservableUpdated(this, { change: undefined, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, undefined);\n }\n }\n }\n _beginUpdate() {\n this._updateCounter++;\n if (this._updateCounter === 1) {\n for (const observer of this._observers) {\n observer.beginUpdate(this);\n }\n }\n }\n _endUpdate() {\n this._updateCounter--;\n if (this._updateCounter === 0) {\n this._update();\n // End update could change the observer list.\n const observers = [...this._observers];\n for (const r of observers) {\n r.endUpdate(this);\n }\n }\n }\n addObserver(observer) {\n const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCounter > 0;\n super.addObserver(observer);\n if (shouldCallBeginUpdate) {\n observer.beginUpdate(this);\n }\n }\n removeObserver(observer) {\n const shouldCallEndUpdate = this._observers.has(observer) && this._updateCounter > 0;\n super.removeObserver(observer);\n if (shouldCallEndUpdate) {\n // Calling end update after removing the observer makes sure endUpdate cannot be called twice here.\n observer.endUpdate(this);\n }\n }\n set(value, tx, change) {\n if (change === undefined && this._equalityComparator(this._value, value)) {\n return;\n }\n let _tx;\n if (!tx) {\n tx = _tx = new TransactionImpl(() => { }, () => `Setting ${this.debugName}`);\n }\n try {\n this._isUpToDate = false;\n this._setValue(value);\n if (change !== undefined) {\n this._deltas.push(change);\n }\n tx.updateObserver({\n beginUpdate: () => this._beginUpdate(),\n endUpdate: () => this._endUpdate(),\n handleChange: (observable, change) => { },\n handlePossibleChange: (observable) => { },\n }, this);\n if (this._updateCounter > 1) {\n // We already started begin/end update, so we need to manually call handlePossibleChange\n for (const observer of this._observers) {\n observer.handlePossibleChange(this);\n }\n }\n }\n finally {\n if (_tx) {\n _tx.finish();\n }\n }\n }\n toString() {\n return `${this.debugName}: ${this._value}`;\n }\n _setValue(newValue) {\n this._value = newValue;\n }\n}\n\nexport { LazyObservableValue };\n//# sourceMappingURL=lazyObservableValue.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DebugNameData } from '../debugName.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { ObservableValue } from './observableValue.js';\nimport { LazyObservableValue } from './lazyObservableValue.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction observableValueOpts(options, initialValue, debugLocation = DebugLocation.ofCaller()) {\n if (options.lazy) {\n return new LazyObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n }\n return new ObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n}\n\nexport { observableValueOpts };\n//# sourceMappingURL=observableValueOpts.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transaction } from '../transaction.js';\nimport { derived } from '../observables/derived.js';\nimport { observableValue } from '../observables/observableValue.js';\n\nclass ObservableLazy {\n /**\n * The cached value.\n * Does not force a computation of the value.\n */\n get cachedValue() { return this._value; }\n constructor(_computeValue) {\n this._computeValue = _computeValue;\n this._value = observableValue(this, undefined);\n }\n /**\n * Returns the cached value.\n * Computes the value if the value has not been cached yet.\n */\n getValue() {\n let v = this._value.get();\n if (!v) {\n v = this._computeValue();\n this._value.set(v, undefined);\n }\n return v;\n }\n}\n/**\n * A promise whose state is observable.\n */\nclass ObservablePromise {\n static fromFn(fn) {\n return new ObservablePromise(fn());\n }\n constructor(promise) {\n this._value = observableValue(this, undefined);\n /**\n * The current state of the promise.\n * Is `undefined` if the promise didn't resolve yet.\n */\n this.promiseResult = this._value;\n this.resolvedValue = derived(this, reader => {\n const result = this.promiseResult.read(reader);\n if (!result) {\n return undefined;\n }\n return result.getDataOrThrow();\n });\n this.promise = promise.then(value => {\n transaction(tx => {\n /** @description onPromiseResolved */\n this._value.set(new PromiseResult(value, undefined), tx);\n });\n return value;\n }, error => {\n transaction(tx => {\n /** @description onPromiseRejected */\n this._value.set(new PromiseResult(undefined, error), tx);\n });\n throw error;\n });\n }\n}\nclass PromiseResult {\n constructor(\n /**\n * The value of the resolved promise.\n * Undefined if the promise rejected.\n */\n data, \n /**\n * The error in case of a rejected promise.\n * Undefined if the promise resolved.\n */\n error) {\n this.data = data;\n this.error = error;\n }\n /**\n * Returns the value if the promise resolved, otherwise throws the error.\n */\n getDataOrThrow() {\n if (this.error) {\n throw this.error;\n }\n return this.data;\n }\n}\n/**\n * A lazy promise whose state is observable.\n */\nclass ObservableLazyPromise {\n constructor(_computePromise) {\n this._computePromise = _computePromise;\n this._lazyValue = new ObservableLazy(() => new ObservablePromise(this._computePromise()));\n /**\n * Does not enforce evaluation of the promise compute function.\n * Is undefined if the promise has not been computed yet.\n */\n this.cachedPromiseResult = derived(this, reader => this._lazyValue.cachedValue.read(reader)?.promiseResult.read(reader));\n }\n getPromise() {\n return this._lazyValue.getValue().promise;\n }\n}\n\nexport { ObservableLazy, ObservableLazyPromise, ObservablePromise, PromiseResult };\n//# sourceMappingURL=promise.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DebugNameData } from '../debugName.js';\nimport { CancellationError, CancellationTokenSource } from '../commonFacade/cancellation.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { autorun } from '../reactions/autorun.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction waitForState(observable, predicate, isError, cancellationToken) {\n if (!predicate) {\n predicate = state => state !== null && state !== undefined;\n }\n return new Promise((resolve, reject) => {\n let isImmediateRun = true;\n let shouldDispose = false;\n const stateObs = observable.map(state => {\n /** @description waitForState.state */\n return {\n isFinished: predicate(state),\n error: isError ? isError(state) : false,\n state\n };\n });\n const d = autorun(reader => {\n /** @description waitForState */\n const { isFinished, error, state } = stateObs.read(reader);\n if (isFinished || error) {\n if (isImmediateRun) {\n // The variable `d` is not initialized yet\n shouldDispose = true;\n }\n else {\n d.dispose();\n }\n if (error) {\n reject(error === true ? state : error);\n }\n else {\n resolve(state);\n }\n }\n });\n if (cancellationToken) {\n const dc = cancellationToken.onCancellationRequested(() => {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n });\n if (cancellationToken.isCancellationRequested) {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n return;\n }\n }\n isImmediateRun = false;\n if (shouldDispose) {\n d.dispose();\n }\n });\n}\nfunction derivedWithCancellationToken(computeFnOrOwner, computeFnOrUndefined) {\n let computeFn;\n let owner;\n if (computeFnOrUndefined === undefined) {\n computeFn = computeFnOrOwner;\n owner = undefined;\n }\n else {\n owner = computeFnOrOwner;\n computeFn = computeFnOrUndefined;\n }\n let cancellationTokenSource = undefined;\n return new Derived(new DebugNameData(owner, undefined, computeFn), r => {\n if (cancellationTokenSource) {\n cancellationTokenSource.dispose();\n }\n cancellationTokenSource = new CancellationTokenSource();\n return computeFn(r, cancellationTokenSource.token);\n }, undefined, () => cancellationTokenSource?.dispose(), strictEquals, DebugLocation.ofCaller());\n}\n\nexport { derivedWithCancellationToken, waitForState };\n//# sourceMappingURL=utilsCancellation.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from './commonFacade/deps.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChanges(obs) {\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChangesLazy(getObs) {\n let obs = undefined;\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n\nexport { recordChanges, recordChangesLazy };\n//# sourceMappingURL=changeTracker.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { ConvenientObservable } from './baseObservable.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Represents an efficient observable whose value never changes.\n */\nfunction constObservable(value) {\n return new ConstObservable(value);\n}\nclass ConstObservable extends ConvenientObservable {\n constructor(value) {\n super();\n this.value = value;\n }\n get debugName() {\n return this.toString();\n }\n get() {\n return this.value;\n }\n addObserver(observer) {\n // NO OP\n }\n removeObserver(observer) {\n // NO OP\n }\n log() {\n return this;\n }\n toString() {\n return `Const: ${this.value}`;\n }\n}\n\nexport { constObservable };\n//# sourceMappingURL=constObservable.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transaction } from '../transaction.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction observableSignalFromEvent(owner, event, debugLocation = DebugLocation.ofCaller()) {\n return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);\n}\nclass FromEventObservableSignal extends BaseObservable {\n constructor(debugNameDataOrName, event, debugLocation) {\n super(debugLocation);\n this.event = event;\n this.handleEvent = () => {\n transaction((tx) => {\n for (const o of this._observers) {\n tx.updateObserver(o, this);\n o.handleChange(this, undefined);\n }\n }, () => this.debugName);\n };\n this.debugName = typeof debugNameDataOrName === 'string'\n ? debugNameDataOrName\n : debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';\n }\n onFirstObserverAdded() {\n this.subscription = this.event(this.handleEvent);\n }\n onLastObserverRemoved() {\n this.subscription.dispose();\n this.subscription = undefined;\n }\n get() {\n // NO OP\n }\n}\n\nexport { observableSignalFromEvent };\n//# sourceMappingURL=observableSignalFromEvent.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorun } from '../reactions/autorun.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Creates an Event from an observable that fires whenever the observable changes.\n */\nfunction eventFromObservable(observable) {\n return (listener) => {\n let isFirst = true;\n return autorun(reader => {\n observable.read(reader);\n if (isFirst) {\n isFirst = false;\n }\n else {\n listener();\n }\n });\n };\n}\nclass ValueWithChangeEventFromObservable {\n constructor(observable) {\n this.observable = observable;\n }\n get onDidChange() {\n return eventFromObservable(this.observable);\n }\n get value() {\n return this.observable.get();\n }\n}\nfunction observableFromValueWithChangeEvent(owner, value) {\n if (value instanceof ValueWithChangeEventFromObservable) {\n return value.observable;\n }\n return observableFromEvent(owner, value.onDidChange, () => value.value);\n}\n\nexport { ValueWithChangeEventFromObservable, observableFromValueWithChangeEvent };\n//# sourceMappingURL=valueWithChangeEvent.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../commonFacade/deps.js';\nimport { getDebugName, DebugNameData } from '../debugName.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorunOpts } from '../reactions/autorun.js';\nimport { derivedObservableWithCache } from '../utils/utils.js';\nimport { DisposableStore } from '../../disposables.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Creates an observable that has the latest changed value of the given observables.\n * Initially (and when not observed), it has the value of the last observable.\n * When observed and any of the observables change, it has the value of the last changed observable.\n * If multiple observables change in the same transaction, the last observable wins.\n*/\nfunction latestChangedValue(owner, observables) {\n if (observables.length === 0) {\n throw new BugIndicatingError();\n }\n let hasLastChangedValue = false;\n let lastChangedValue = undefined;\n const result = observableFromEvent(owner, cb => {\n const store = new DisposableStore();\n for (const o of observables) {\n store.add(autorunOpts({ debugName: () => getDebugName(result, new DebugNameData(owner, undefined, undefined)) + '.updateLastChangedValue' }, reader => {\n hasLastChangedValue = true;\n lastChangedValue = o.read(reader);\n cb();\n }));\n }\n store.add({\n dispose() {\n hasLastChangedValue = false;\n lastChangedValue = undefined;\n },\n });\n return store;\n }, () => {\n if (hasLastChangedValue) {\n return lastChangedValue;\n }\n else {\n return observables[observables.length - 1].get();\n }\n });\n return result;\n}\n/**\n * Works like a derived.\n * However, if the value is not undefined, it is cached and will not be recomputed anymore.\n * In that case, the derived will unsubscribe from its dependencies.\n*/\nfunction derivedConstOnceDefined(owner, fn) {\n return derivedObservableWithCache(owner, (reader, lastValue) => lastValue ?? fn(reader));\n}\n\nexport { derivedConstOnceDefined, latestChangedValue };\n//# sourceMappingURL=utils.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../commonFacade/deps.js';\nimport { derived } from '../observables/derived.js';\nimport { observableSignalFromEvent } from '../observables/observableSignalFromEvent.js';\nimport { keepObserved } from '../utils/utils.js';\n\n/**\n * Wraps an observable so that its source remains observed for a grace period\n * after the wrapping observable loses all its observers.\n *\n * When the wrapping observable has observers, an autorun keeps `obs` observed\n * and forwards changes. When the last observer is removed, `obs` stays observed\n * via `keepObserved` for `maxIdleTimeMs` before being released. If a new observer\n * arrives during the grace period, the keep-alive is cancelled seamlessly.\n *\n * @param store - Controls the hard lifetime; disposing it cancels any pending grace period.\n * @param obs - The source observable to keep alive longer.\n * @param maxIdleTimeMs - Grace period in milliseconds.\n */\nfunction deferUnobserve(store, obs, maxIdleTimeMs) {\n let keepAliveHandle;\n let timeoutHandle;\n let disposed = false;\n const lifetimeTracker = observableSignalFromEvent('deferUnobserve', _ => {\n if (disposed) {\n throw new BugIndicatingError('deferUnobserve: Cannot add observer after disposal');\n }\n // First observer added to `lifetimeTracker`\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n if (!keepAliveHandle) {\n keepAliveHandle = keepObserved(obs);\n }\n return {\n dispose() {\n // Keep source observed during the grace period\t\n timeoutHandle = setTimeout(() => {\n timeoutHandle = undefined;\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n }, maxIdleTimeMs);\n },\n };\n });\n store.add({\n dispose() {\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n disposed = true;\n },\n });\n return derived(reader => {\n lifetimeTracker.read(reader);\n return obs.read(reader);\n });\n}\n\nexport { deferUnobserve };\n//# sourceMappingURL=deferUnobserve.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableValueOpts } from './observables/observableValueOpts.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass ObservableSet {\n constructor() {\n this._data = new Set();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(value) {\n return this._data.has(value);\n }\n add(value, tx) {\n const hadValue = this._data.has(value);\n if (!hadValue) {\n this._data.add(value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(value, tx) {\n const result = this._data.delete(value);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, value2, _set) => {\n callbackfn.call(thisArg, value, value2, this);\n });\n }\n *entries() {\n for (const value of this._data) {\n yield [value, value];\n }\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.values();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableSet';\n }\n}\n\nexport { ObservableSet };\n//# sourceMappingURL=set.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableValueOpts } from './observables/observableValueOpts.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass ObservableMap {\n constructor() {\n this._data = new Map();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(key) {\n return this._data.has(key);\n }\n get(key) {\n return this._data.get(key);\n }\n set(key, value, tx) {\n const hadKey = this._data.has(key);\n const oldValue = this._data.get(key);\n if (!hadKey || oldValue !== value) {\n this._data.set(key, value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(key, tx) {\n const result = this._data.delete(key);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, key, _map) => {\n callbackfn.call(thisArg, value, key, this);\n });\n }\n *entries() {\n yield* this._data.entries();\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableMap';\n }\n}\n\nexport { ObservableMap };\n//# sourceMappingURL=map.js.map\n"],"names":["LazyObservableValue","BaseObservable","_debugNameData","initialValue","_equalityComparator","debugLocation","change","getLogger","observer","observers","r","shouldCallBeginUpdate","shouldCallEndUpdate","value","tx","_tx","TransactionImpl","observable","newValue","observableValueOpts","options","DebugLocation","DebugNameData","strictEquals","ObservableValue","ObservableLazy","_computeValue","observableValue","v","ObservablePromise","fn","promise","derived","reader","result","transaction","PromiseResult","error","data","ObservableLazyPromise","_computePromise","waitForState","predicate","isError","cancellationToken","state","resolve","reject","isImmediateRun","shouldDispose","stateObs","d","autorun","isFinished","dc","CancellationError","derivedWithCancellationToken","computeFnOrOwner","computeFnOrUndefined","computeFn","owner","cancellationTokenSource","Derived","CancellationTokenSource","recordChanges","obs","_previousChangeSummary","ctx","changeSummary","key","BugIndicatingError","recordChangesLazy","getObs","constObservable","ConstObservable","ConvenientObservable","observableSignalFromEvent","event","FromEventObservableSignal","debugNameDataOrName","o","eventFromObservable","listener","isFirst","ValueWithChangeEventFromObservable","observableFromValueWithChangeEvent","observableFromEvent","latestChangedValue","observables","hasLastChangedValue","lastChangedValue","cb","store","DisposableStore","autorunOpts","getDebugName","derivedConstOnceDefined","derivedObservableWithCache","lastValue","deferUnobserve","maxIdleTimeMs","keepAliveHandle","timeoutHandle","disposed","lifetimeTracker","_","keepObserved","ObservableSet","callbackfn","thisArg","value2","_set","ObservableMap","hadKey","oldValue","_map"],"mappings":";;AAeA,MAAMA,UAA4BC,EAAe;AAAA,EAC7C,IAAI,YAAY;AACZ,WAAO,KAAK,eAAe,aAAa,IAAI,KAAK;AAAA,EACrD;AAAA,EACA,YAAYC,GAAgBC,GAAcC,GAAqBC,GAAe;AAC1E,UAAMA,CAAa,GACnB,KAAK,iBAAiBH,GACtB,KAAK,sBAAsBE,GAC3B,KAAK,cAAc,IACnB,KAAK,UAAU,CAAA,GACf,KAAK,iBAAiB,GACtB,KAAK,SAASD;AAAA,EAClB;AAAA,EACA,MAAM;AACF,gBAAK,QAAO,GACL,KAAK;AAAA,EAChB;AAAA,EACA,UAAU;AACN,QAAI,MAAK;AAIT,UADA,KAAK,cAAc,IACf,KAAK,QAAQ,SAAS,GAAG;AACzB,mBAAWG,KAAU,KAAK,SAAS;AAC/B,UAAAC,EAAS,GAAI,wBAAwB,MAAM,EAAE,QAAAD,GAAQ,WAAW,IAAM,UAAU,aAAa,UAAU,KAAK,QAAQ,UAAU,GAAI,CAAE;AACpI,qBAAWE,KAAY,KAAK;AACxB,YAAAA,EAAS,aAAa,MAAMF,CAAM;AAAA,QAE1C;AACA,aAAK,QAAQ,SAAS;AAAA,MAC1B,OACK;AACD,QAAAC,EAAS,GAAI,wBAAwB,MAAM,EAAE,QAAQ,QAAW,WAAW,IAAM,UAAU,aAAa,UAAU,KAAK,QAAQ,UAAU,IAAM;AAC/I,mBAAWC,KAAY,KAAK;AACxB,UAAAA,EAAS,aAAa,MAAM,MAAS;AAAA,MAE7C;AAAA,EACJ;AAAA,EACA,eAAe;AAEX,QADA,KAAK,kBACD,KAAK,mBAAmB;AACxB,iBAAWA,KAAY,KAAK;AACxB,QAAAA,EAAS,YAAY,IAAI;AAAA,EAGrC;AAAA,EACA,aAAa;AAET,QADA,KAAK,kBACD,KAAK,mBAAmB,GAAG;AAC3B,WAAK,QAAO;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,MAClB,KAAK,MAAM,MAAK,GAChB,KAAK,KAAK,IAAI,MAAMA,CAAE;AAAA,EAE9B;AAAA,EACA,QAAQ8F,GAAYC,GAAS;AACzB,SAAK,MAAM,QAAQ,CAAChG,GAAOwD,GAAK8C,MAAS;AACrC,MAAAP,EAAW,KAAKC,GAAShG,GAAOwD,GAAK,IAAI;AAAA,IAC7C,CAAC;AAAA,EACL;AAAA,EACA,CAAC,UAAU;AACP,WAAO,KAAK,MAAM,QAAO;AAAA,EAC7B;AAAA,EACA,CAAC,OAAO;AACJ,WAAO,KAAK,MAAM,KAAI;AAAA,EAC1B;AAAA,EACA,CAAC,SAAS;AACN,WAAO,KAAK,MAAM,OAAM;AAAA,EAC5B;AAAA,EACA,CAAC,OAAO,QAAQ,IAAI;AAChB,WAAO,KAAK,QAAO;AAAA,EACvB;AAAA,EACA,KAAK,OAAO,WAAW,IAAI;AACvB,WAAO;AAAA,EACX;AACJ;"}
1
+ {"version":3,"file":"observables.js","sources":["../../../external/vscode-observables/observables/dist/observableInternal/observables/lazyObservableValue.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableValueOpts.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/promise.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js","../../../external/vscode-observables/observables/dist/observableInternal/changeTracker.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableSignalFromEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/valueWithChangeEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/utils.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/deferUnobserve.js","../../../external/vscode-observables/observables/dist/observableInternal/set.js","../../../external/vscode-observables/observables/dist/observableInternal/map.js"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { TransactionImpl } from '../transaction.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Holds off updating observers until the value is actually read.\n*/\nclass LazyObservableValue extends BaseObservable {\n get debugName() {\n return this._debugNameData.getDebugName(this) ?? 'LazyObservableValue';\n }\n constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) {\n super(debugLocation);\n this._debugNameData = _debugNameData;\n this._equalityComparator = _equalityComparator;\n this._isUpToDate = true;\n this._deltas = [];\n this._updateCounter = 0;\n this._value = initialValue;\n }\n get() {\n this._update();\n return this._value;\n }\n _update() {\n if (this._isUpToDate) {\n return;\n }\n this._isUpToDate = true;\n if (this._deltas.length > 0) {\n for (const change of this._deltas) {\n getLogger()?.handleObservableUpdated(this, { change, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, change);\n }\n }\n this._deltas.length = 0;\n }\n else {\n getLogger()?.handleObservableUpdated(this, { change: undefined, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, undefined);\n }\n }\n }\n _beginUpdate() {\n this._updateCounter++;\n if (this._updateCounter === 1) {\n for (const observer of this._observers) {\n observer.beginUpdate(this);\n }\n }\n }\n _endUpdate() {\n this._updateCounter--;\n if (this._updateCounter === 0) {\n this._update();\n // End update could change the observer list.\n const observers = [...this._observers];\n for (const r of observers) {\n r.endUpdate(this);\n }\n }\n }\n addObserver(observer) {\n const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCounter > 0;\n super.addObserver(observer);\n if (shouldCallBeginUpdate) {\n observer.beginUpdate(this);\n }\n }\n removeObserver(observer) {\n const shouldCallEndUpdate = this._observers.has(observer) && this._updateCounter > 0;\n super.removeObserver(observer);\n if (shouldCallEndUpdate) {\n // Calling end update after removing the observer makes sure endUpdate cannot be called twice here.\n observer.endUpdate(this);\n }\n }\n set(value, tx, change) {\n if (change === undefined && this._equalityComparator(this._value, value)) {\n return;\n }\n let _tx;\n if (!tx) {\n tx = _tx = new TransactionImpl(() => { }, () => `Setting ${this.debugName}`);\n }\n try {\n this._isUpToDate = false;\n this._setValue(value);\n if (change !== undefined) {\n this._deltas.push(change);\n }\n tx.updateObserver({\n beginUpdate: () => this._beginUpdate(),\n endUpdate: () => this._endUpdate(),\n handleChange: (observable, change) => { },\n handlePossibleChange: (observable) => { },\n }, this);\n if (this._updateCounter > 1) {\n // We already started begin/end update, so we need to manually call handlePossibleChange\n for (const observer of this._observers) {\n observer.handlePossibleChange(this);\n }\n }\n }\n finally {\n if (_tx) {\n _tx.finish();\n }\n }\n }\n toString() {\n return `${this.debugName}: ${this._value}`;\n }\n _setValue(newValue) {\n this._value = newValue;\n }\n}\n\nexport { LazyObservableValue };\n//# sourceMappingURL=lazyObservableValue.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DebugNameData } from '../debugName.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { ObservableValue } from './observableValue.js';\nimport { LazyObservableValue } from './lazyObservableValue.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction observableValueOpts(options, initialValue, debugLocation = DebugLocation.ofCaller()) {\n if (options.lazy) {\n return new LazyObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n }\n return new ObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n}\n\nexport { observableValueOpts };\n//# sourceMappingURL=observableValueOpts.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transaction } from '../transaction.js';\nimport { derived } from '../observables/derived.js';\nimport { observableValue } from '../observables/observableValue.js';\n\nclass ObservableLazy {\n /**\n * The cached value.\n * Does not force a computation of the value.\n */\n get cachedValue() { return this._value; }\n constructor(_computeValue) {\n this._computeValue = _computeValue;\n this._value = observableValue(this, undefined);\n }\n /**\n * Returns the cached value.\n * Computes the value if the value has not been cached yet.\n */\n getValue() {\n let v = this._value.get();\n if (!v) {\n v = this._computeValue();\n this._value.set(v, undefined);\n }\n return v;\n }\n}\n/**\n * A promise whose state is observable.\n */\nclass ObservablePromise {\n static fromFn(fn) {\n return new ObservablePromise(fn());\n }\n constructor(promise) {\n this._value = observableValue(this, undefined);\n /**\n * The current state of the promise.\n * Is `undefined` if the promise didn't resolve yet.\n */\n this.promiseResult = this._value;\n this.resolvedValue = derived(this, reader => {\n const result = this.promiseResult.read(reader);\n if (!result) {\n return undefined;\n }\n return result.getDataOrThrow();\n });\n this.promise = promise.then(value => {\n transaction(tx => {\n /** @description onPromiseResolved */\n this._value.set(new PromiseResult(value, undefined), tx);\n });\n return value;\n }, error => {\n transaction(tx => {\n /** @description onPromiseRejected */\n this._value.set(new PromiseResult(undefined, error), tx);\n });\n throw error;\n });\n }\n}\nclass PromiseResult {\n constructor(\n /**\n * The value of the resolved promise.\n * Undefined if the promise rejected.\n */\n data, \n /**\n * The error in case of a rejected promise.\n * Undefined if the promise resolved.\n */\n error) {\n this.data = data;\n this.error = error;\n }\n /**\n * Returns the value if the promise resolved, otherwise throws the error.\n */\n getDataOrThrow() {\n if (this.error) {\n throw this.error;\n }\n return this.data;\n }\n}\n/**\n * A lazy promise whose state is observable.\n */\nclass ObservableLazyPromise {\n constructor(_computePromise) {\n this._computePromise = _computePromise;\n this._lazyValue = new ObservableLazy(() => new ObservablePromise(this._computePromise()));\n /**\n * Does not enforce evaluation of the promise compute function.\n * Is undefined if the promise has not been computed yet.\n */\n this.cachedPromiseResult = derived(this, reader => this._lazyValue.cachedValue.read(reader)?.promiseResult.read(reader));\n }\n getPromise() {\n return this._lazyValue.getValue().promise;\n }\n}\n\nexport { ObservableLazy, ObservableLazyPromise, ObservablePromise, PromiseResult };\n//# sourceMappingURL=promise.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DebugNameData } from '../debugName.js';\nimport { CancellationError, CancellationTokenSource } from '../commonFacade/cancellation.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { autorun } from '../reactions/autorun.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction waitForState(observable, predicate, isError, cancellationToken) {\n if (!predicate) {\n predicate = state => state !== null && state !== undefined;\n }\n return new Promise((resolve, reject) => {\n let isImmediateRun = true;\n let shouldDispose = false;\n const stateObs = observable.map(state => {\n /** @description waitForState.state */\n return {\n isFinished: predicate(state),\n error: isError ? isError(state) : false,\n state\n };\n });\n const d = autorun(reader => {\n /** @description waitForState */\n const { isFinished, error, state } = stateObs.read(reader);\n if (isFinished || error) {\n if (isImmediateRun) {\n // The variable `d` is not initialized yet\n shouldDispose = true;\n }\n else {\n d.dispose();\n }\n if (error) {\n reject(error === true ? state : error);\n }\n else {\n resolve(state);\n }\n }\n });\n if (cancellationToken) {\n const dc = cancellationToken.onCancellationRequested(() => {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n });\n if (cancellationToken.isCancellationRequested) {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n return;\n }\n }\n isImmediateRun = false;\n if (shouldDispose) {\n d.dispose();\n }\n });\n}\nfunction derivedWithCancellationToken(computeFnOrOwner, computeFnOrUndefined) {\n let computeFn;\n let owner;\n if (computeFnOrUndefined === undefined) {\n computeFn = computeFnOrOwner;\n owner = undefined;\n }\n else {\n owner = computeFnOrOwner;\n computeFn = computeFnOrUndefined;\n }\n let cancellationTokenSource = undefined;\n return new Derived(new DebugNameData(owner, undefined, computeFn), r => {\n if (cancellationTokenSource) {\n cancellationTokenSource.dispose();\n }\n cancellationTokenSource = new CancellationTokenSource();\n return computeFn(r, cancellationTokenSource.token);\n }, undefined, () => cancellationTokenSource?.dispose(), strictEquals, DebugLocation.ofCaller());\n}\n\nexport { derivedWithCancellationToken, waitForState };\n//# sourceMappingURL=utilsCancellation.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from './commonFacade/deps.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChanges(obs) {\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChangesLazy(getObs) {\n let obs = undefined;\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n\nexport { recordChanges, recordChangesLazy };\n//# sourceMappingURL=changeTracker.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transaction } from '../transaction.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction observableSignalFromEvent(owner, event, debugLocation = DebugLocation.ofCaller()) {\n return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);\n}\nclass FromEventObservableSignal extends BaseObservable {\n constructor(debugNameDataOrName, event, debugLocation) {\n super(debugLocation);\n this.event = event;\n this.handleEvent = () => {\n transaction((tx) => {\n for (const o of this._observers) {\n tx.updateObserver(o, this);\n o.handleChange(this, undefined);\n }\n }, () => this.debugName);\n };\n this.debugName = typeof debugNameDataOrName === 'string'\n ? debugNameDataOrName\n : debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';\n }\n onFirstObserverAdded() {\n this.subscription = this.event(this.handleEvent);\n }\n onLastObserverRemoved() {\n this.subscription.dispose();\n this.subscription = undefined;\n }\n get() {\n // NO OP\n }\n}\n\nexport { observableSignalFromEvent };\n//# sourceMappingURL=observableSignalFromEvent.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorun } from '../reactions/autorun.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Creates an Event from an observable that fires whenever the observable changes.\n */\nfunction eventFromObservable(observable) {\n return (listener) => {\n let isFirst = true;\n return autorun(reader => {\n observable.read(reader);\n if (isFirst) {\n isFirst = false;\n }\n else {\n listener();\n }\n });\n };\n}\nclass ValueWithChangeEventFromObservable {\n constructor(observable) {\n this.observable = observable;\n }\n get onDidChange() {\n return eventFromObservable(this.observable);\n }\n get value() {\n return this.observable.get();\n }\n}\nfunction observableFromValueWithChangeEvent(owner, value) {\n if (value instanceof ValueWithChangeEventFromObservable) {\n return value.observable;\n }\n return observableFromEvent(owner, value.onDidChange, () => value.value);\n}\n\nexport { ValueWithChangeEventFromObservable, observableFromValueWithChangeEvent };\n//# sourceMappingURL=valueWithChangeEvent.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../commonFacade/deps.js';\nimport { getDebugName, DebugNameData } from '../debugName.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorunOpts } from '../reactions/autorun.js';\nimport { derivedObservableWithCache } from '../utils/utils.js';\nimport { DisposableStore } from '../../disposables.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Creates an observable that has the latest changed value of the given observables.\n * Initially (and when not observed), it has the value of the last observable.\n * When observed and any of the observables change, it has the value of the last changed observable.\n * If multiple observables change in the same transaction, the last observable wins.\n*/\nfunction latestChangedValue(owner, observables) {\n if (observables.length === 0) {\n throw new BugIndicatingError();\n }\n let hasLastChangedValue = false;\n let lastChangedValue = undefined;\n const result = observableFromEvent(owner, cb => {\n const store = new DisposableStore();\n for (const o of observables) {\n store.add(autorunOpts({ debugName: () => getDebugName(result, new DebugNameData(owner, undefined, undefined)) + '.updateLastChangedValue' }, reader => {\n hasLastChangedValue = true;\n lastChangedValue = o.read(reader);\n cb();\n }));\n }\n store.add({\n dispose() {\n hasLastChangedValue = false;\n lastChangedValue = undefined;\n },\n });\n return store;\n }, () => {\n if (hasLastChangedValue) {\n return lastChangedValue;\n }\n else {\n return observables[observables.length - 1].get();\n }\n });\n return result;\n}\n/**\n * Works like a derived.\n * However, if the value is not undefined, it is cached and will not be recomputed anymore.\n * In that case, the derived will unsubscribe from its dependencies.\n*/\nfunction derivedConstOnceDefined(owner, fn) {\n return derivedObservableWithCache(owner, (reader, lastValue) => lastValue ?? fn(reader));\n}\n\nexport { derivedConstOnceDefined, latestChangedValue };\n//# sourceMappingURL=utils.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../commonFacade/deps.js';\nimport { derived } from '../observables/derived.js';\nimport { observableSignalFromEvent } from '../observables/observableSignalFromEvent.js';\nimport { keepObserved } from '../utils/utils.js';\n\n/**\n * Wraps an observable so that its source remains observed for a grace period\n * after the wrapping observable loses all its observers.\n *\n * When the wrapping observable has observers, an autorun keeps `obs` observed\n * and forwards changes. When the last observer is removed, `obs` stays observed\n * via `keepObserved` for `maxIdleTimeMs` before being released. If a new observer\n * arrives during the grace period, the keep-alive is cancelled seamlessly.\n *\n * @param store - Controls the hard lifetime; disposing it cancels any pending grace period.\n * @param obs - The source observable to keep alive longer.\n * @param maxIdleTimeMs - Grace period in milliseconds.\n */\nfunction deferUnobserve(store, obs, maxIdleTimeMs) {\n let keepAliveHandle;\n let timeoutHandle;\n let disposed = false;\n const lifetimeTracker = observableSignalFromEvent('deferUnobserve', _ => {\n if (disposed) {\n throw new BugIndicatingError('deferUnobserve: Cannot add observer after disposal');\n }\n // First observer added to `lifetimeTracker`\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n if (!keepAliveHandle) {\n keepAliveHandle = keepObserved(obs);\n }\n return {\n dispose() {\n // Keep source observed during the grace period\t\n timeoutHandle = setTimeout(() => {\n timeoutHandle = undefined;\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n }, maxIdleTimeMs);\n },\n };\n });\n store.add({\n dispose() {\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n disposed = true;\n },\n });\n return derived(reader => {\n lifetimeTracker.read(reader);\n return obs.read(reader);\n });\n}\n\nexport { deferUnobserve };\n//# sourceMappingURL=deferUnobserve.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableValueOpts } from './observables/observableValueOpts.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass ObservableSet {\n constructor() {\n this._data = new Set();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(value) {\n return this._data.has(value);\n }\n add(value, tx) {\n const hadValue = this._data.has(value);\n if (!hadValue) {\n this._data.add(value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(value, tx) {\n const result = this._data.delete(value);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, value2, _set) => {\n callbackfn.call(thisArg, value, value2, this);\n });\n }\n *entries() {\n for (const value of this._data) {\n yield [value, value];\n }\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.values();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableSet';\n }\n}\n\nexport { ObservableSet };\n//# sourceMappingURL=set.js.map\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { observableValueOpts } from './observables/observableValueOpts.js';\n\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass ObservableMap {\n constructor() {\n this._data = new Map();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(key) {\n return this._data.has(key);\n }\n get(key) {\n return this._data.get(key);\n }\n set(key, value, tx) {\n const hadKey = this._data.has(key);\n const oldValue = this._data.get(key);\n if (!hadKey || oldValue !== value) {\n this._data.set(key, value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(key, tx) {\n const result = this._data.delete(key);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, key, _map) => {\n callbackfn.call(thisArg, value, key, this);\n });\n }\n *entries() {\n yield* this._data.entries();\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableMap';\n }\n}\n\nexport { ObservableMap };\n//# sourceMappingURL=map.js.map\n"],"names":["LazyObservableValue","BaseObservable","_debugNameData","initialValue","_equalityComparator","debugLocation","change","getLogger","observer","observers","r","shouldCallBeginUpdate","shouldCallEndUpdate","value","tx","_tx","TransactionImpl","observable","newValue","observableValueOpts","options","DebugLocation","DebugNameData","strictEquals","ObservableValue","ObservableLazy","_computeValue","observableValue","v","ObservablePromise","fn","promise","derived","reader","result","transaction","PromiseResult","error","data","ObservableLazyPromise","_computePromise","waitForState","predicate","isError","cancellationToken","state","resolve","reject","isImmediateRun","shouldDispose","stateObs","d","autorun","isFinished","dc","CancellationError","derivedWithCancellationToken","computeFnOrOwner","computeFnOrUndefined","computeFn","owner","cancellationTokenSource","Derived","CancellationTokenSource","recordChanges","obs","_previousChangeSummary","ctx","changeSummary","key","BugIndicatingError","recordChangesLazy","getObs","observableSignalFromEvent","event","FromEventObservableSignal","debugNameDataOrName","o","eventFromObservable","listener","isFirst","ValueWithChangeEventFromObservable","observableFromValueWithChangeEvent","observableFromEvent","latestChangedValue","observables","hasLastChangedValue","lastChangedValue","cb","store","DisposableStore","autorunOpts","getDebugName","derivedConstOnceDefined","derivedObservableWithCache","lastValue","deferUnobserve","maxIdleTimeMs","keepAliveHandle","timeoutHandle","disposed","lifetimeTracker","_","keepObserved","ObservableSet","callbackfn","thisArg","value2","_set","ObservableMap","hadKey","oldValue","_map"],"mappings":";;AAeA,MAAMA,UAA4BC,EAAe;AAAA,EAC7C,IAAI,YAAY;AACZ,WAAO,KAAK,eAAe,aAAa,IAAI,KAAK;AAAA,EACrD;AAAA,EACA,YAAYC,GAAgBC,GAAcC,GAAqBC,GAAe;AAC1E,UAAMA,CAAa,GACnB,KAAK,iBAAiBH,GACtB,KAAK,sBAAsBE,GAC3B,KAAK,cAAc,IACnB,KAAK,UAAU,CAA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