@genome-spy/app 0.57.0 → 0.58.1

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,7 +1,7 @@
1
- import { g as l } from "./_commonjsHelpers-DjF3Plf2.js";
2
- class d {
3
- }
1
+ import { g as u } from "./_commonjsHelpers-DjF3Plf2.js";
4
2
  class f {
3
+ }
4
+ class b {
5
5
  constructor() {
6
6
  this.signals = /* @__PURE__ */ new Set(), this.abortController = new AbortController();
7
7
  }
@@ -11,7 +11,7 @@ class f {
11
11
  * longer be abortable.
12
12
  */
13
13
  //@ts-ignore
14
- addSignal(t = new d()) {
14
+ addSignal(t = new f()) {
15
15
  if (this.signal.aborted)
16
16
  throw new Error("cannot add a signal, already aborted!");
17
17
  this.signals.add(t), t.aborted ? this.handleAborted(t) : typeof t.addEventListener == "function" && t.addEventListener("abort", () => {
@@ -28,7 +28,7 @@ class f {
28
28
  this.abortController.abort();
29
29
  }
30
30
  }
31
- class u {
31
+ class g {
32
32
  constructor() {
33
33
  this.callbacks = /* @__PURE__ */ new Set();
34
34
  }
@@ -42,7 +42,7 @@ class u {
42
42
  e(t);
43
43
  }
44
44
  }
45
- class n {
45
+ class l {
46
46
  constructor({ fill: t, cache: e }) {
47
47
  if (typeof t != "function")
48
48
  throw new TypeError("must pass a fill function");
@@ -65,13 +65,13 @@ class n {
65
65
  evict(t, e) {
66
66
  this.cache.get(t) === e && this.cache.delete(t);
67
67
  }
68
- fill(t, e, r, a) {
69
- const s = new f(), c = new u();
70
- c.addCallback(a);
71
- const i = {
68
+ fill(t, e, r, i) {
69
+ const s = new b(), c = new g();
70
+ c.addCallback(i);
71
+ const a = {
72
72
  aborter: s,
73
- promise: this.fillCallback(e, s.signal, (o) => {
74
- c.callback(o);
73
+ promise: this.fillCallback(e, s.signal, (h) => {
74
+ c.callback(h);
75
75
  }),
76
76
  settled: !1,
77
77
  statusReporter: c,
@@ -79,23 +79,23 @@ class n {
79
79
  return this.aborter.signal.aborted;
80
80
  }
81
81
  };
82
- i.aborter.addSignal(r), i.aborter.signal.addEventListener("abort", () => {
83
- i.settled || this.evict(t, i);
84
- }), i.promise.then(() => {
85
- i.settled = !0;
82
+ a.aborter.addSignal(r), a.aborter.signal.addEventListener("abort", () => {
83
+ a.settled || this.evict(t, a);
84
+ }), a.promise.then(() => {
85
+ a.settled = !0;
86
86
  }, () => {
87
- i.settled = !0, this.evict(t, i);
88
- }).catch((o) => {
89
- throw console.error(o), o;
90
- }), this.cache.set(t, i);
87
+ a.settled = !0, this.evict(t, a);
88
+ }).catch((h) => {
89
+ throw console.error(h), h;
90
+ }), this.cache.set(t, a);
91
91
  }
92
92
  static checkSinglePromise(t, e) {
93
93
  function r() {
94
94
  if (e != null && e.aborted)
95
95
  throw Object.assign(new Error("aborted"), { code: "ERR_ABORTED" });
96
96
  }
97
- return t.then((a) => (r(), a), (a) => {
98
- throw r(), a;
97
+ return t.then((i) => (r(), i), (i) => {
98
+ throw r(), i;
99
99
  });
100
100
  }
101
101
  has(t) {
@@ -113,11 +113,11 @@ class n {
113
113
  * @param {AbortSignal} [signal] optional AbortSignal object that aborts the request
114
114
  * @param {statusCallback} a callback to get the current status of a pending async operation
115
115
  */
116
- get(t, e, r, a) {
116
+ get(t, e, r, i) {
117
117
  if (!r && e instanceof AbortSignal)
118
118
  throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");
119
119
  const s = this.cache.get(t);
120
- return s ? s.aborted && !s.settled ? (this.evict(t, s), this.get(t, e, r, a)) : s.settled ? s.promise : (s.aborter.addSignal(r), s.statusReporter.addCallback(a), n.checkSinglePromise(s.promise, r)) : (this.fill(t, e, r, a), n.checkSinglePromise(
120
+ return s ? s.aborted && !s.settled ? (this.evict(t, s), this.get(t, e, r, i)) : s.settled ? s.promise : (s.aborter.addSignal(r), s.statusReporter.addCallback(i), l.checkSinglePromise(s.promise, r)) : (this.fill(t, e, r, i), l.checkSinglePromise(
121
121
  //see https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#non-null-assertion-operator-postfix-
122
122
  this.cache.get(t).promise,
123
123
  r
@@ -145,68 +145,74 @@ class n {
145
145
  return e;
146
146
  }
147
147
  }
148
- class b {
149
- constructor(t = {}) {
150
- if (!(t.maxSize && t.maxSize > 0))
151
- throw new TypeError("`maxSize` must be a number greater than 0");
152
- this.maxSize = t.maxSize, this.cache = /* @__PURE__ */ new Map(), this.oldCache = /* @__PURE__ */ new Map(), this._size = 0;
153
- }
154
- _set(t, e) {
155
- this.cache.set(t, e), this._size++, this._size >= this.maxSize && (this._size = 0, this.oldCache = this.cache, this.cache = /* @__PURE__ */ new Map());
156
- }
157
- get(t) {
158
- if (this.cache.has(t))
159
- return this.cache.get(t);
160
- if (this.oldCache.has(t)) {
161
- const e = this.oldCache.get(t);
162
- return this.oldCache.delete(t), this._set(t, e), e;
148
+ var n, d;
149
+ function p() {
150
+ if (d) return n;
151
+ d = 1;
152
+ class o {
153
+ constructor(e = {}) {
154
+ if (!(e.maxSize && e.maxSize > 0))
155
+ throw new TypeError("`maxSize` must be a number greater than 0");
156
+ this.maxSize = e.maxSize, this.cache = /* @__PURE__ */ new Map(), this.oldCache = /* @__PURE__ */ new Map(), this._size = 0;
163
157
  }
164
- }
165
- set(t, e) {
166
- return this.cache.has(t) ? this.cache.set(t, e) : this._set(t, e), this;
167
- }
168
- has(t) {
169
- return this.cache.has(t) || this.oldCache.has(t);
170
- }
171
- peek(t) {
172
- if (this.cache.has(t))
173
- return this.cache.get(t);
174
- if (this.oldCache.has(t))
175
- return this.oldCache.get(t);
176
- }
177
- delete(t) {
178
- const e = this.cache.delete(t);
179
- return e && this._size--, this.oldCache.delete(t) || e;
180
- }
181
- clear() {
182
- this.cache.clear(), this.oldCache.clear(), this._size = 0;
183
- }
184
- *keys() {
185
- for (const [t] of this)
186
- yield t;
187
- }
188
- *values() {
189
- for (const [, t] of this)
190
- yield t;
191
- }
192
- *[Symbol.iterator]() {
193
- for (const t of this.cache)
194
- yield t;
195
- for (const t of this.oldCache) {
196
- const [e] = t;
197
- this.cache.has(e) || (yield t);
158
+ _set(e, r) {
159
+ this.cache.set(e, r), this._size++, this._size >= this.maxSize && (this._size = 0, this.oldCache = this.cache, this.cache = /* @__PURE__ */ new Map());
160
+ }
161
+ get(e) {
162
+ if (this.cache.has(e))
163
+ return this.cache.get(e);
164
+ if (this.oldCache.has(e)) {
165
+ const r = this.oldCache.get(e);
166
+ return this.oldCache.delete(e), this._set(e, r), r;
167
+ }
168
+ }
169
+ set(e, r) {
170
+ return this.cache.has(e) ? this.cache.set(e, r) : this._set(e, r), this;
171
+ }
172
+ has(e) {
173
+ return this.cache.has(e) || this.oldCache.has(e);
174
+ }
175
+ peek(e) {
176
+ if (this.cache.has(e))
177
+ return this.cache.get(e);
178
+ if (this.oldCache.has(e))
179
+ return this.oldCache.get(e);
180
+ }
181
+ delete(e) {
182
+ const r = this.cache.delete(e);
183
+ return r && this._size--, this.oldCache.delete(e) || r;
184
+ }
185
+ clear() {
186
+ this.cache.clear(), this.oldCache.clear(), this._size = 0;
187
+ }
188
+ *keys() {
189
+ for (const [e] of this)
190
+ yield e;
191
+ }
192
+ *values() {
193
+ for (const [, e] of this)
194
+ yield e;
195
+ }
196
+ *[Symbol.iterator]() {
197
+ for (const e of this.cache)
198
+ yield e;
199
+ for (const e of this.oldCache) {
200
+ const [r] = e;
201
+ this.cache.has(r) || (yield e);
202
+ }
203
+ }
204
+ get size() {
205
+ let e = 0;
206
+ for (const r of this.oldCache.keys())
207
+ this.cache.has(r) || e++;
208
+ return this._size + e;
198
209
  }
199
210
  }
200
- get size() {
201
- let t = 0;
202
- for (const e of this.oldCache.keys())
203
- this.cache.has(e) || t++;
204
- return this._size + t;
205
- }
211
+ return n = o, n;
206
212
  }
207
- var g = b;
208
- const p = /* @__PURE__ */ l(g);
213
+ var m = p();
214
+ const C = /* @__PURE__ */ u(m);
209
215
  export {
210
- n as A,
211
- p as L
216
+ l as A,
217
+ C as L
212
218
  };