taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
351 lines (350 loc) • 8.15 kB
JavaScript
import { bz as c, co as D, cp as O, cq as x, cr as H, cs as J, ct as K, cu as Q, cv as y, cw as h } from "./JBrowsePanel-BNE3gNW1.js";
import { O as i, o as k, i as W } from "./Observable-bHPg1QB7.js";
var X = new i(function(e) {
return e.complete();
});
function Z(e) {
return e && c(e.schedule);
}
function L(e) {
return e[e.length - 1];
}
function j(e) {
return Z(L(e)) ? e.pop() : void 0;
}
function _(e, n) {
return typeof L(e) == "number" ? e.pop() : n;
}
var E = (function(e) {
return e && typeof e.length == "number" && typeof e != "function";
});
function P(e) {
return c(e == null ? void 0 : e.then);
}
function R(e) {
return c(e[k]);
}
function T(e) {
return Symbol.asyncIterator && c(e == null ? void 0 : e[Symbol.asyncIterator]);
}
function C(e) {
return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
}
function b() {
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
}
var F = b();
function G(e) {
return c(e == null ? void 0 : e[F]);
}
function N(e) {
return D(this, arguments, function() {
var r, t, o, a;
return O(this, function(u) {
switch (u.label) {
case 0:
r = e.getReader(), u.label = 1;
case 1:
u.trys.push([1, , 9, 10]), u.label = 2;
case 2:
return [4, x(r.read())];
case 3:
return t = u.sent(), o = t.value, a = t.done, a ? [4, x(void 0)] : [3, 5];
case 4:
return [2, u.sent()];
case 5:
return [4, x(o)];
case 6:
return [4, u.sent()];
case 7:
return u.sent(), [3, 2];
case 8:
return [3, 10];
case 9:
return r.releaseLock(), [7];
case 10:
return [2];
}
});
});
}
function Y(e) {
return c(e == null ? void 0 : e.getReader);
}
function v(e) {
if (e instanceof i)
return e;
if (e != null) {
if (R(e))
return ee(e);
if (E(e))
return ne(e);
if (P(e))
return re(e);
if (T(e))
return z(e);
if (G(e))
return te(e);
if (Y(e))
return oe(e);
}
throw C(e);
}
function ee(e) {
return new i(function(n) {
var r = e[k]();
if (c(r.subscribe))
return r.subscribe(n);
throw new TypeError("Provided object does not correctly implement Symbol.observable");
});
}
function ne(e) {
return new i(function(n) {
for (var r = 0; r < e.length && !n.closed; r++)
n.next(e[r]);
n.complete();
});
}
function re(e) {
return new i(function(n) {
e.then(function(r) {
n.closed || (n.next(r), n.complete());
}, function(r) {
return n.error(r);
}).then(null, H);
});
}
function te(e) {
return new i(function(n) {
var r, t;
try {
for (var o = J(e), a = o.next(); !a.done; a = o.next()) {
var u = a.value;
if (n.next(u), n.closed)
return;
}
} catch (l) {
r = { error: l };
} finally {
try {
a && !a.done && (t = o.return) && t.call(o);
} finally {
if (r) throw r.error;
}
}
n.complete();
});
}
function z(e) {
return new i(function(n) {
ae(e, n).catch(function(r) {
return n.error(r);
});
});
}
function oe(e) {
return z(N(e));
}
function ae(e, n) {
var r, t, o, a;
return K(this, void 0, void 0, function() {
var u, l;
return O(this, function(f) {
switch (f.label) {
case 0:
f.trys.push([0, 5, 6, 11]), r = Q(e), f.label = 1;
case 1:
return [4, r.next()];
case 2:
if (t = f.sent(), !!t.done) return [3, 4];
if (u = t.value, n.next(u), n.closed)
return [2];
f.label = 3;
case 3:
return [3, 1];
case 4:
return [3, 11];
case 5:
return l = f.sent(), o = { error: l }, [3, 11];
case 6:
return f.trys.push([6, , 9, 10]), t && !t.done && (a = r.return) ? [4, a.call(r)] : [3, 8];
case 7:
f.sent(), f.label = 8;
case 8:
return [3, 10];
case 9:
if (o) throw o.error;
return [7];
case 10:
return [7];
case 11:
return n.complete(), [2];
}
});
});
}
function s(e, n, r, t, o) {
t === void 0 && (t = 0), o === void 0 && (o = !1);
var a = n.schedule(function() {
r(), o ? e.add(this.schedule(null, t)) : this.unsubscribe();
}, t);
if (e.add(a), !o)
return a;
}
function M(e, n) {
return n === void 0 && (n = 0), y(function(r, t) {
r.subscribe(h(t, function(o) {
return s(t, e, function() {
return t.next(o);
}, n);
}, function() {
return s(t, e, function() {
return t.complete();
}, n);
}, function(o) {
return s(t, e, function() {
return t.error(o);
}, n);
}));
});
}
function V(e, n) {
return n === void 0 && (n = 0), y(function(r, t) {
t.add(e.schedule(function() {
return r.subscribe(t);
}, n));
});
}
function ue(e, n) {
return v(e).pipe(V(n), M(n));
}
function fe(e, n) {
return v(e).pipe(V(n), M(n));
}
function ie(e, n) {
return new i(function(r) {
var t = 0;
return n.schedule(function() {
t === e.length ? r.complete() : (r.next(e[t++]), r.closed || this.schedule());
});
});
}
function ce(e, n) {
return new i(function(r) {
var t;
return s(r, n, function() {
t = e[F](), s(r, n, function() {
var o, a, u;
try {
o = t.next(), a = o.value, u = o.done;
} catch (l) {
r.error(l);
return;
}
u ? r.complete() : r.next(a);
}, 0, !0);
}), function() {
return c(t == null ? void 0 : t.return) && t.return();
};
});
}
function q(e, n) {
if (!e)
throw new Error("Iterable cannot be null");
return new i(function(r) {
s(r, n, function() {
var t = e[Symbol.asyncIterator]();
s(r, n, function() {
t.next().then(function(o) {
o.done ? r.complete() : r.next(o.value);
});
}, 0, !0);
});
});
}
function le(e, n) {
return q(N(e), n);
}
function se(e, n) {
if (e != null) {
if (R(e))
return ue(e, n);
if (E(e))
return ie(e, n);
if (P(e))
return fe(e, n);
if (T(e))
return q(e, n);
if (G(e))
return ce(e, n);
if (Y(e))
return le(e, n);
}
throw C(e);
}
function ve(e, n) {
return n ? se(e, n) : v(e);
}
function de(e, n) {
return y(function(r, t) {
var o = 0;
r.subscribe(h(t, function(a) {
t.next(e.call(n, a, o++));
}));
});
}
function me(e, n, r, t, o, a, u, l) {
var f = [], d = 0, U = 0, g = !1, S = function() {
g && !f.length && !d && n.complete();
}, $ = function(m) {
return d < t ? p(m) : f.push(m);
}, p = function(m) {
d++;
var A = !1;
v(r(m, U++)).subscribe(h(n, function(w) {
n.next(w);
}, function() {
A = !0;
}, void 0, function() {
if (A)
try {
d--;
for (var w = function() {
var I = f.shift();
u || p(I);
}; f.length && d < t; )
w();
S();
} catch (I) {
n.error(I);
}
}));
};
return e.subscribe(h(n, $, function() {
g = !0, S();
})), function() {
};
}
function B(e, n, r) {
return r === void 0 && (r = 1 / 0), c(n) ? B(function(t, o) {
return de(function(a, u) {
return n(t, a, o, u);
})(v(e(t, o)));
}, r) : (typeof n == "number" && (r = n), y(function(t, o) {
return me(t, o, e, r);
}));
}
function he(e) {
return e === void 0 && (e = 1 / 0), B(W, e);
}
function Ie() {
for (var e = [], n = 0; n < arguments.length; n++)
e[n] = arguments[n];
var r = j(e), t = _(e, 1 / 0), o = e;
return o.length ? o.length === 1 ? v(o[0]) : he(t)(ve(o, r)) : X;
}
export {
de as a,
Ie as m
};
//# sourceMappingURL=merge-BKxtGK-k.js.map