@genome-spy/app 0.56.1 → 0.58.0

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,513 +0,0 @@
1
- import { c as v, g as x } from "./_commonjsHelpers-DSebQMb9.js";
2
- var T = {}, m = {}, h = {}, g = {};
3
- Object.defineProperty(g, "__esModule", { value: !0 });
4
- function A(r, e) {
5
- if (!(r instanceof e))
6
- throw new TypeError("Cannot call a class as a function");
7
- }
8
- function D(r, e) {
9
- for (var t = 0; t < e.length; t++) {
10
- var o = e[t];
11
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
12
- }
13
- }
14
- function E(r, e, t) {
15
- return e && D(r.prototype, e), Object.defineProperty(r, "prototype", {
16
- writable: !1
17
- }), r;
18
- }
19
- function B(r, e) {
20
- if (typeof e != "function" && e !== null)
21
- throw new TypeError("Super expression must either be null or a function");
22
- r.prototype = Object.create(e && e.prototype, {
23
- constructor: {
24
- value: r,
25
- writable: !0,
26
- configurable: !0
27
- }
28
- }), Object.defineProperty(r, "prototype", {
29
- writable: !1
30
- }), e && w(r, e);
31
- }
32
- function d(r) {
33
- return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
34
- return t.__proto__ || Object.getPrototypeOf(t);
35
- }, d(r);
36
- }
37
- function w(r, e) {
38
- return w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, n) {
39
- return o.__proto__ = n, o;
40
- }, w(r, e);
41
- }
42
- function $() {
43
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
44
- if (typeof Proxy == "function") return !0;
45
- try {
46
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
47
- })), !0;
48
- } catch {
49
- return !1;
50
- }
51
- }
52
- function p(r) {
53
- if (r === void 0)
54
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
55
- return r;
56
- }
57
- function Y(r, e) {
58
- if (e && (typeof e == "object" || typeof e == "function"))
59
- return e;
60
- if (e !== void 0)
61
- throw new TypeError("Derived constructors may only return object or undefined");
62
- return p(r);
63
- }
64
- function G(r) {
65
- var e = $();
66
- return function() {
67
- var o = d(r), n;
68
- if (e) {
69
- var a = d(this).constructor;
70
- n = Reflect.construct(o, arguments, a);
71
- } else
72
- n = o.apply(this, arguments);
73
- return Y(this, n);
74
- };
75
- }
76
- function U(r, e) {
77
- for (; !Object.prototype.hasOwnProperty.call(r, e) && (r = d(r), r !== null); )
78
- ;
79
- return r;
80
- }
81
- function y() {
82
- return typeof Reflect < "u" && Reflect.get ? y = Reflect.get.bind() : y = function(e, t, o) {
83
- var n = U(e, t);
84
- if (n) {
85
- var a = Object.getOwnPropertyDescriptor(n, t);
86
- return a.get ? a.get.call(arguments.length < 3 ? e : o) : a.value;
87
- }
88
- }, y.apply(this, arguments);
89
- }
90
- var P = /* @__PURE__ */ function() {
91
- function r() {
92
- A(this, r), Object.defineProperty(this, "listeners", {
93
- value: {},
94
- writable: !0,
95
- configurable: !0
96
- });
97
- }
98
- return E(r, [{
99
- key: "addEventListener",
100
- value: function(t, o, n) {
101
- t in this.listeners || (this.listeners[t] = []), this.listeners[t].push({
102
- callback: o,
103
- options: n
104
- });
105
- }
106
- }, {
107
- key: "removeEventListener",
108
- value: function(t, o) {
109
- if (t in this.listeners) {
110
- for (var n = this.listeners[t], a = 0, c = n.length; a < c; a++)
111
- if (n[a].callback === o) {
112
- n.splice(a, 1);
113
- return;
114
- }
115
- }
116
- }
117
- }, {
118
- key: "dispatchEvent",
119
- value: function(t) {
120
- if (t.type in this.listeners) {
121
- for (var o = this.listeners[t.type], n = o.slice(), a = 0, c = n.length; a < c; a++) {
122
- var i = n[a];
123
- try {
124
- i.callback.call(this, t);
125
- } catch (l) {
126
- Promise.resolve().then(function() {
127
- throw l;
128
- });
129
- }
130
- i.options && i.options.once && this.removeEventListener(t.type, i.callback);
131
- }
132
- return !t.defaultPrevented;
133
- }
134
- }
135
- }]), r;
136
- }(), R = /* @__PURE__ */ function(r) {
137
- B(t, r);
138
- var e = G(t);
139
- function t() {
140
- var o;
141
- return A(this, t), o = e.call(this), o.listeners || P.call(p(o)), Object.defineProperty(p(o), "aborted", {
142
- value: !1,
143
- writable: !0,
144
- configurable: !0
145
- }), Object.defineProperty(p(o), "onabort", {
146
- value: null,
147
- writable: !0,
148
- configurable: !0
149
- }), Object.defineProperty(p(o), "reason", {
150
- value: void 0,
151
- writable: !0,
152
- configurable: !0
153
- }), o;
154
- }
155
- return E(t, [{
156
- key: "toString",
157
- value: function() {
158
- return "[object AbortSignal]";
159
- }
160
- }, {
161
- key: "dispatchEvent",
162
- value: function(n) {
163
- n.type === "abort" && (this.aborted = !0, typeof this.onabort == "function" && this.onabort.call(this, n)), y(d(t.prototype), "dispatchEvent", this).call(this, n);
164
- }
165
- }]), t;
166
- }(P), j = /* @__PURE__ */ function() {
167
- function r() {
168
- A(this, r), Object.defineProperty(this, "signal", {
169
- value: new R(),
170
- writable: !0,
171
- configurable: !0
172
- });
173
- }
174
- return E(r, [{
175
- key: "abort",
176
- value: function(t) {
177
- var o;
178
- try {
179
- o = new Event("abort");
180
- } catch {
181
- typeof document < "u" ? document.createEvent ? (o = document.createEvent("Event"), o.initEvent("abort", !1, !1)) : (o = document.createEventObject(), o.type = "abort") : o = {
182
- type: "abort",
183
- bubbles: !1,
184
- cancelable: !1
185
- };
186
- }
187
- var n = t;
188
- if (n === void 0)
189
- if (typeof document > "u")
190
- n = new Error("This operation was aborted"), n.name = "AbortError";
191
- else
192
- try {
193
- n = new DOMException("signal is aborted without reason");
194
- } catch {
195
- n = new Error("This operation was aborted"), n.name = "AbortError";
196
- }
197
- this.signal.reason = n, this.signal.dispatchEvent(o);
198
- }
199
- }, {
200
- key: "toString",
201
- value: function() {
202
- return "[object AbortController]";
203
- }
204
- }]), r;
205
- }();
206
- typeof Symbol < "u" && Symbol.toStringTag && (j.prototype[Symbol.toStringTag] = "AbortController", R.prototype[Symbol.toStringTag] = "AbortSignal");
207
- function Q(r) {
208
- return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL ? (console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"), !0) : typeof r.Request == "function" && !r.Request.prototype.hasOwnProperty("signal") || !r.AbortController;
209
- }
210
- function H(r) {
211
- typeof r == "function" && (r = {
212
- fetch: r
213
- });
214
- var e = r, t = e.fetch, o = e.Request, n = o === void 0 ? t.Request : o, a = e.AbortController, c = e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL, i = c === void 0 ? !1 : c;
215
- if (!Q({
216
- fetch: t,
217
- Request: n,
218
- AbortController: a,
219
- __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL: i
220
- }))
221
- return {
222
- fetch: t,
223
- Request: l
224
- };
225
- var l = n;
226
- (l && !l.prototype.hasOwnProperty("signal") || i) && (l = function(b, s) {
227
- var f;
228
- s && s.signal && (f = s.signal, delete s.signal);
229
- var u = new n(b, s);
230
- return f && Object.defineProperty(u, "signal", {
231
- writable: !1,
232
- enumerable: !1,
233
- configurable: !0,
234
- value: f
235
- }), u;
236
- }, l.prototype = n.prototype);
237
- var L = t, z = function(b, s) {
238
- var f = l && l.prototype.isPrototypeOf(b) ? b.signal : s ? s.signal : void 0;
239
- if (f) {
240
- var u;
241
- try {
242
- u = new DOMException("Aborted", "AbortError");
243
- } catch {
244
- u = new Error("Aborted"), u.name = "AbortError";
245
- }
246
- if (f.aborted)
247
- return Promise.reject(u);
248
- var M = new Promise(function(q, I) {
249
- f.addEventListener("abort", function() {
250
- return I(u);
251
- }, {
252
- once: !0
253
- });
254
- });
255
- return s && s.signal && delete s.signal, Promise.race([M, L(b, s)]);
256
- }
257
- return L(b, s);
258
- };
259
- return {
260
- fetch: z,
261
- Request: l
262
- };
263
- }
264
- g.AbortController = j;
265
- g.AbortSignal = R;
266
- g.abortableFetch = H;
267
- Object.defineProperty(h, "__esModule", { value: !0 });
268
- h.AbortSignal = h.AbortController = void 0;
269
- const k = g;
270
- var _ = function() {
271
- if (typeof self < "u")
272
- return self;
273
- if (typeof window < "u")
274
- return window;
275
- if (typeof globalThis < "u")
276
- return globalThis;
277
- throw new Error("unable to locate global object");
278
- };
279
- let J = typeof _().AbortController > "u" ? k.AbortController : _().AbortController;
280
- h.AbortController = J;
281
- let K = typeof _().AbortController > "u" ? k.AbortSignal : _().AbortSignal;
282
- h.AbortSignal = K;
283
- var S = {};
284
- Object.defineProperty(S, "__esModule", { value: !0 });
285
- const V = h;
286
- class W {
287
- }
288
- class X {
289
- constructor() {
290
- this.signals = /* @__PURE__ */ new Set(), this.abortController = new V.AbortController();
291
- }
292
- /**
293
- * @param {AbortSignal} [signal] optional AbortSignal to add. if falsy,
294
- * will be treated as a null-signal, and this abortcontroller will no
295
- * longer be abortable.
296
- */
297
- //@ts-ignore
298
- addSignal(e = new W()) {
299
- if (this.signal.aborted)
300
- throw new Error("cannot add a signal, already aborted!");
301
- this.signals.add(e), e.aborted ? this.handleAborted(e) : typeof e.addEventListener == "function" && e.addEventListener("abort", () => {
302
- this.handleAborted(e);
303
- });
304
- }
305
- handleAborted(e) {
306
- this.signals.delete(e), this.signals.size === 0 && this.abortController.abort();
307
- }
308
- get signal() {
309
- return this.abortController.signal;
310
- }
311
- abort() {
312
- this.abortController.abort();
313
- }
314
- }
315
- S.default = X;
316
- var C = {};
317
- Object.defineProperty(C, "__esModule", { value: !0 });
318
- class Z {
319
- constructor() {
320
- this.callbacks = /* @__PURE__ */ new Set();
321
- }
322
- addCallback(e = () => {
323
- }) {
324
- this.callbacks.add(e), e(this.currentMessage);
325
- }
326
- callback(e) {
327
- this.currentMessage = e, this.callbacks.forEach((t) => {
328
- t(e);
329
- });
330
- }
331
- }
332
- C.default = Z;
333
- var F = v && v.__importDefault || function(r) {
334
- return r && r.__esModule ? r : { default: r };
335
- };
336
- Object.defineProperty(m, "__esModule", { value: !0 });
337
- const ee = h, te = F(S), re = F(C);
338
- class O {
339
- constructor({ fill: e, cache: t }) {
340
- if (typeof e != "function")
341
- throw new TypeError("must pass a fill function");
342
- if (typeof t != "object")
343
- throw new TypeError("must pass a cache object");
344
- if (typeof t.get != "function" || typeof t.set != "function" || typeof t.delete != "function")
345
- throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");
346
- this.cache = t, this.fillCallback = e;
347
- }
348
- static isAbortException(e) {
349
- return (
350
- // DOMException
351
- e.name === "AbortError" || // standard-ish non-DOM abort exception
352
- //@ts-ignore
353
- e.code === "ERR_ABORTED" || // stringified DOMException
354
- e.message === "AbortError: aborted" || // stringified standard-ish exception
355
- e.message === "Error: aborted"
356
- );
357
- }
358
- evict(e, t) {
359
- this.cache.get(e) === t && this.cache.delete(e);
360
- }
361
- fill(e, t, o, n) {
362
- const a = new te.default(), c = new re.default();
363
- c.addCallback(n);
364
- const i = {
365
- aborter: a,
366
- promise: this.fillCallback(t, a.signal, (l) => {
367
- c.callback(l);
368
- }),
369
- settled: !1,
370
- statusReporter: c,
371
- get aborted() {
372
- return this.aborter.signal.aborted;
373
- }
374
- };
375
- i.aborter.addSignal(o), i.aborter.signal.addEventListener("abort", () => {
376
- i.settled || this.evict(e, i);
377
- }), i.promise.then(() => {
378
- i.settled = !0;
379
- }, () => {
380
- i.settled = !0, this.evict(e, i);
381
- }).catch((l) => {
382
- throw console.error(l), l;
383
- }), this.cache.set(e, i);
384
- }
385
- static checkSinglePromise(e, t) {
386
- function o() {
387
- if (t && t.aborted)
388
- throw Object.assign(new Error("aborted"), { code: "ERR_ABORTED" });
389
- }
390
- return e.then((n) => (o(), n), (n) => {
391
- throw o(), n;
392
- });
393
- }
394
- has(e) {
395
- return this.cache.has(e);
396
- }
397
- /**
398
- * Callback for getting status of the pending async
399
- *
400
- * @callback statusCallback
401
- * @param {any} status, current status string or message object
402
- */
403
- /**
404
- * @param {any} key cache key to use for this request
405
- * @param {any} data data passed as the first argument to the fill callback
406
- * @param {AbortSignal} [signal] optional AbortSignal object that aborts the request
407
- * @param {statusCallback} a callback to get the current status of a pending async operation
408
- */
409
- get(e, t, o, n) {
410
- if (!o && t instanceof ee.AbortSignal)
411
- throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");
412
- const a = this.cache.get(e);
413
- return a ? a.aborted && !a.settled ? (this.evict(e, a), this.get(e, t, o, n)) : a.settled ? a.promise : (a.aborter.addSignal(o), a.statusReporter.addCallback(n), O.checkSinglePromise(a.promise, o)) : (this.fill(e, t, o, n), O.checkSinglePromise(
414
- //see https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#non-null-assertion-operator-postfix-
415
- //eslint-disable-next-line @typescript-eslint/no-non-null-assertion
416
- this.cache.get(e).promise,
417
- o
418
- ));
419
- }
420
- /**
421
- * delete the given entry from the cache. if it exists and its fill request has
422
- * not yet settled, the fill will be signaled to abort.
423
- *
424
- * @param {any} key
425
- */
426
- delete(e) {
427
- const t = this.cache.get(e);
428
- t && (t.settled || t.aborter.abort(), this.cache.delete(e));
429
- }
430
- /**
431
- * Clear all requests from the cache. Aborts any that have not settled.
432
- * @returns {number} count of entries deleted
433
- */
434
- clear() {
435
- const e = this.cache.keys();
436
- let t = 0;
437
- for (let o = e.next(); !o.done; o = e.next())
438
- this.delete(o.value), t += 1;
439
- return t;
440
- }
441
- }
442
- m.default = O;
443
- var oe = v && v.__importDefault || function(r) {
444
- return r && r.__esModule ? r : { default: r };
445
- };
446
- Object.defineProperty(T, "__esModule", { value: !0 });
447
- const ne = oe(m);
448
- var se = T.default = ne.default;
449
- class ae {
450
- constructor(e = {}) {
451
- if (!(e.maxSize && e.maxSize > 0))
452
- throw new TypeError("`maxSize` must be a number greater than 0");
453
- this.maxSize = e.maxSize, this.cache = /* @__PURE__ */ new Map(), this.oldCache = /* @__PURE__ */ new Map(), this._size = 0;
454
- }
455
- _set(e, t) {
456
- this.cache.set(e, t), this._size++, this._size >= this.maxSize && (this._size = 0, this.oldCache = this.cache, this.cache = /* @__PURE__ */ new Map());
457
- }
458
- get(e) {
459
- if (this.cache.has(e))
460
- return this.cache.get(e);
461
- if (this.oldCache.has(e)) {
462
- const t = this.oldCache.get(e);
463
- return this.oldCache.delete(e), this._set(e, t), t;
464
- }
465
- }
466
- set(e, t) {
467
- return this.cache.has(e) ? this.cache.set(e, t) : this._set(e, t), this;
468
- }
469
- has(e) {
470
- return this.cache.has(e) || this.oldCache.has(e);
471
- }
472
- peek(e) {
473
- if (this.cache.has(e))
474
- return this.cache.get(e);
475
- if (this.oldCache.has(e))
476
- return this.oldCache.get(e);
477
- }
478
- delete(e) {
479
- const t = this.cache.delete(e);
480
- return t && this._size--, this.oldCache.delete(e) || t;
481
- }
482
- clear() {
483
- this.cache.clear(), this.oldCache.clear(), this._size = 0;
484
- }
485
- *keys() {
486
- for (const [e] of this)
487
- yield e;
488
- }
489
- *values() {
490
- for (const [, e] of this)
491
- yield e;
492
- }
493
- *[Symbol.iterator]() {
494
- for (const e of this.cache)
495
- yield e;
496
- for (const e of this.oldCache) {
497
- const [t] = e;
498
- this.cache.has(t) || (yield e);
499
- }
500
- }
501
- get size() {
502
- let e = 0;
503
- for (const t of this.oldCache.keys())
504
- this.cache.has(t) || e++;
505
- return this._size + e;
506
- }
507
- }
508
- var ie = ae;
509
- const ce = /* @__PURE__ */ x(ie);
510
- export {
511
- ce as L,
512
- se as _
513
- };