@stlite/browser
Version:
Browser Stlite
1,419 lines • 6.93 MB
JavaScript
import { Cn as e, En as t, Gn as n, Hn as r, Jn as i, Ka as a, Kn as o, Mn as s, Ri as c, Ua as l, Y as u, Yn as d, Zn as f, da as p, k as m, ma as h, oi as g, qn as _, ri as v, ti as y, ui as b, va as x, vi as S, wa as C } from "./index-Dl4ETd_L-D2oMd1k2.js";
import { n as w, t as T } from "./withFullScreenWrapper-tGGSjEWy-DoekoEMQ.js";
import { t as E } from "./resolveDefaultExport-Cy5TTESD-CcwO08HL.js";
//#region ../react/build/PlotlyChart-CvayS3p7.js
var D = /* @__PURE__ */ a(l(), 1);
function O(e, t) {
for (var n = 0; n < t.length; n++) {
let r = t[n];
if (typeof r != "string" && !Array.isArray(r)) {
for (let t in r) if (t !== "default" && !(t in e)) {
let n = Object.getOwnPropertyDescriptor(r, t);
n && Object.defineProperty(e, t, n.get ? n : {
enumerable: !0,
get: () => r[t]
});
}
}
}
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var k = {}, A = {}, j;
function M() {
return j || (j = 1, function(e) {
function t(e) {
"@babel/helpers - typeof";
return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, t(e);
}
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = x;
var n = o(D.default), r = i(/* @__PURE__ */ c());
function i(e) {
return e && e.__esModule ? e : { default: e };
}
function a(e) {
if (typeof WeakMap != "function") return null;
var t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
return (a = function(e) {
return e ? n : t;
})(e);
}
function o(e, n) {
if (e && e.__esModule) return e;
if (e === null || t(e) !== "object" && typeof e != "function") return { default: e };
var r = a(n);
if (r && r.has(e)) return r.get(e);
var i = {}, o = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var s in e) if (s !== "default" && Object.prototype.hasOwnProperty.call(e, s)) {
var c = o ? Object.getOwnPropertyDescriptor(e, s) : null;
c && (c.get || c.set) ? Object.defineProperty(i, s, c) : i[s] = e[s];
}
return i.default = e, r && r.set(e, i), i;
}
function s(e, t) {
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
}
function l(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
}
}
function u(e, t, n) {
return t && l(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function d(e, t) {
if (typeof t != "function" && t !== null) throw TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, { constructor: {
value: e,
writable: !0,
configurable: !0
} }), Object.defineProperty(e, "prototype", { writable: !1 }), t && f(e, t);
}
function f(e, t) {
return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e;
}, f(e, t);
}
function p(e) {
var t = g();
return function() {
var n = _(e), r;
if (t) {
var i = _(this).constructor;
r = Reflect.construct(n, arguments, i);
} else r = n.apply(this, arguments);
return m(this, r);
};
}
function m(e, n) {
if (n && (t(n) === "object" || typeof n == "function")) return n;
if (n !== void 0) throw TypeError("Derived constructors may only return object or undefined");
return h(e);
}
function h(e) {
if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function g() {
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
if (typeof Proxy == "function") return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0;
} catch {
return !1;
}
}
function _(e) {
return _ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
return e.__proto__ || Object.getPrototypeOf(e);
}, _(e);
}
var v = /* @__PURE__ */ "AfterExport.AfterPlot.Animated.AnimatingFrame.AnimationInterrupted.AutoSize.BeforeExport.BeforeHover.ButtonClicked.Click.ClickAnnotation.Deselect.DoubleClick.Framework.Hover.LegendClick.LegendDoubleClick.Relayout.Relayouting.Restyle.Redraw.Selected.Selecting.SliderChange.SliderEnd.SliderStart.SunburstClick.Transitioning.TransitionInterrupted.Unhover.WebGlContextLost".split("."), y = [
"plotly_restyle",
"plotly_redraw",
"plotly_relayout",
"plotly_relayouting",
"plotly_doubleclick",
"plotly_animated",
"plotly_sunburstclick"
], b = typeof window < "u";
function x(e) {
var t = /* @__PURE__ */ function(t) {
d(i, t);
var r = p(i);
function i(e) {
var t;
return s(this, i), t = r.call(this, e), t.p = Promise.resolve(), t.resizeHandler = null, t.handlers = {}, t.syncWindowResize = t.syncWindowResize.bind(h(t)), t.syncEventHandlers = t.syncEventHandlers.bind(h(t)), t.attachUpdateEvents = t.attachUpdateEvents.bind(h(t)), t.getRef = t.getRef.bind(h(t)), t.handleUpdate = t.handleUpdate.bind(h(t)), t.figureCallback = t.figureCallback.bind(h(t)), t.updatePlotly = t.updatePlotly.bind(h(t)), t;
}
return u(i, [
{
key: "updatePlotly",
value: function(t, n, r) {
var i = this;
this.p = this.p.then(function() {
if (!i.unmounting) {
if (!i.el) throw Error("Missing element reference");
return e.react(i.el, {
data: i.props.data,
layout: i.props.layout,
config: i.props.config,
frames: i.props.frames
});
}
}).then(function() {
i.unmounting || (i.syncWindowResize(t), i.syncEventHandlers(), i.figureCallback(n), r && i.attachUpdateEvents());
}).catch(function(e) {
i.props.onError && i.props.onError(e);
});
}
},
{
key: "componentDidMount",
value: function() {
this.unmounting = !1, this.updatePlotly(!0, this.props.onInitialized, !0);
}
},
{
key: "componentDidUpdate",
value: function(e) {
this.unmounting = !1;
var t = e.frames && e.frames.length ? e.frames.length : 0, n = this.props.frames && this.props.frames.length ? this.props.frames.length : 0, r = !(e.layout === this.props.layout && e.data === this.props.data && e.config === this.props.config && n === t), i = e.revision !== void 0, a = e.revision !== this.props.revision;
!r && (!i || i && !a) || this.updatePlotly(!1, this.props.onUpdate, !1);
}
},
{
key: "componentWillUnmount",
value: function() {
this.unmounting = !0, this.figureCallback(this.props.onPurge), this.resizeHandler && b && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = null), this.removeUpdateEvents(), e.purge(this.el);
}
},
{
key: "attachUpdateEvents",
value: function() {
var e = this;
!this.el || !this.el.removeListener || y.forEach(function(t) {
e.el.on(t, e.handleUpdate);
});
}
},
{
key: "removeUpdateEvents",
value: function() {
var e = this;
!this.el || !this.el.removeListener || y.forEach(function(t) {
e.el.removeListener(t, e.handleUpdate);
});
}
},
{
key: "handleUpdate",
value: function() {
this.figureCallback(this.props.onUpdate);
}
},
{
key: "figureCallback",
value: function(e) {
if (typeof e == "function") {
var t = this.el;
e({
data: t.data,
layout: t.layout,
frames: this.el._transitionData ? this.el._transitionData._frames : null
}, this.el);
}
}
},
{
key: "syncWindowResize",
value: function(t) {
var n = this;
b && (this.props.useResizeHandler && !this.resizeHandler ? (this.resizeHandler = function() {
return e.Plots.resize(n.el);
}, window.addEventListener("resize", this.resizeHandler), t && this.resizeHandler()) : !this.props.useResizeHandler && this.resizeHandler && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = null));
}
},
{
key: "getRef",
value: function(e) {
this.el = e, this.props.debug && b && (window.gd = this.el);
}
},
{
key: "syncEventHandlers",
value: function() {
var e = this;
v.forEach(function(t) {
var n = e.props["on" + t], r = e.handlers[t], i = !!r;
n && !i ? e.addEventHandler(t, n) : !n && i ? e.removeEventHandler(t) : n && i && n !== r && (e.removeEventHandler(t), e.addEventHandler(t, n));
});
}
},
{
key: "addEventHandler",
value: function(e, t) {
this.handlers[e] = t, this.el.on(this.getPlotlyEventName(e), this.handlers[e]);
}
},
{
key: "removeEventHandler",
value: function(e) {
this.el.removeListener(this.getPlotlyEventName(e), this.handlers[e]), delete this.handlers[e];
}
},
{
key: "getPlotlyEventName",
value: function(e) {
return "plotly_" + e.toLowerCase();
}
},
{
key: "render",
value: function() {
return /* @__PURE__ */ n.default.createElement("div", {
id: this.props.divId,
style: this.props.style,
ref: this.getRef,
className: this.props.className
});
}
}
]), i;
}(n.Component);
return t.propTypes = {
data: r.default.arrayOf(r.default.object),
config: r.default.object,
layout: r.default.object,
frames: r.default.arrayOf(r.default.object),
revision: r.default.number,
onInitialized: r.default.func,
onPurge: r.default.func,
onError: r.default.func,
onUpdate: r.default.func,
debug: r.default.bool,
style: r.default.object,
className: r.default.string,
useResizeHandler: r.default.bool,
divId: r.default.string
}, v.forEach(function(e) {
t.propTypes["on" + e] = r.default.func;
}), t.defaultProps = {
debug: !1,
useResizeHandler: !1,
data: [],
style: {
position: "relative",
display: "inline-block"
}
}, t;
}
}(A)), A;
}
var N = { exports: {} }, P = N.exports, F;
function I() {
return F || (F = 1, function(e) {
(function(t, n) {
e.exports ? e.exports = n() : t.moduleName = n();
})(typeof self < "u" ? self : P, () => {
var e = (() => {
var e = Object.create, t = Object.defineProperty, n = Object.defineProperties, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyDescriptors, a = Object.getOwnPropertyNames, o = Object.getOwnPropertySymbols, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable, u = (e, n, r) => n in e ? t(e, n, {
enumerable: !0,
configurable: !0,
writable: !0,
value: r
}) : e[n] = r, d = (e, t) => {
for (var n in t ||= {}) c.call(t, n) && u(e, n, t[n]);
if (o) for (var n of o(t)) l.call(t, n) && u(e, n, t[n]);
return e;
}, f = (e, t) => n(e, i(t)), p = (e, t) => {
var n = {};
for (var r in e) c.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && o) for (var r of o(e)) t.indexOf(r) < 0 && l.call(e, r) && (n[r] = e[r]);
return n;
}, m = (e, t) => function() {
return e && (t = (0, e[a(e)[0]])(e = 0)), t;
}, h = (e, t) => function() {
return t || (0, e[a(e)[0]])((t = { exports: {} }).exports, t), t.exports;
}, g = (e, n) => {
for (var r in n) t(e, r, {
get: n[r],
enumerable: !0
});
}, _ = (e, n, i, o) => {
if (n && typeof n == "object" || typeof n == "function") for (let s of a(n)) !c.call(e, s) && s !== i && t(e, s, {
get: () => n[s],
enumerable: !(o = r(n, s)) || o.enumerable
});
return e;
}, v = (n, r, i) => (i = n == null ? {} : e(s(n)), _(t(i, "default", {
value: n,
enumerable: !0
}), n)), y = (e) => _(t({}, "__esModule", { value: !0 }), e), b = h({ "src/version.js"(e) {
e.version = "3.5.1";
} }), x = h({ "node_modules/native-promise-only/lib/npo.src.js"(e, t) {
(function(e, n, r) {
n[e] = n[e] || r(), typeof t < "u" && t.exports && (t.exports = n[e]);
})("Promise", typeof window < "u" ? window : e, function() {
var e, t, n, r = Object.prototype.toString, i = typeof setImmediate < "u" ? function(e) {
return setImmediate(e);
} : setTimeout;
try {
Object.defineProperty({}, "x", {}), e = function(e, t, n, r) {
return Object.defineProperty(e, t, {
value: n,
writable: !0,
configurable: r !== !1
});
};
} catch {
e = function(e, t, n) {
return e[t] = n, e;
};
}
n = /* @__PURE__ */ function() {
var e, n, r;
function i(e, t) {
this.fn = e, this.self = t, this.next = void 0;
}
return {
add: function(t, a) {
r = new i(t, a), n ? n.next = r : e = r, n = r, r = void 0;
},
drain: function() {
var r = e;
for (e = n = t = void 0; r;) r.fn.call(r.self), r = r.next;
}
};
}();
function a(e, r) {
n.add(e, r), t ||= i(n.drain);
}
function o(e) {
var t, n = typeof e;
return e != null && (n == "object" || n == "function") && (t = e.then), typeof t == "function" ? t : !1;
}
function s() {
for (var e = 0; e < this.chain.length; e++) c(this, this.state === 1 ? this.chain[e].success : this.chain[e].failure, this.chain[e]);
this.chain.length = 0;
}
function c(e, t, n) {
var r, i;
try {
t === !1 ? n.reject(e.msg) : (r = t === !0 ? e.msg : t.call(void 0, e.msg), r === n.promise ? n.reject(TypeError("Promise-chain cycle")) : (i = o(r)) ? i.call(r, n.resolve, n.reject) : n.resolve(r));
} catch (e) {
n.reject(e);
}
}
function l(e) {
var t, n = this;
if (!n.triggered) {
n.triggered = !0, n.def && (n = n.def);
try {
(t = o(e)) ? a(function() {
var r = new f(n);
try {
t.call(e, function() {
l.apply(r, arguments);
}, function() {
u.apply(r, arguments);
});
} catch (e) {
u.call(r, e);
}
}) : (n.msg = e, n.state = 1, n.chain.length > 0 && a(s, n));
} catch (e) {
u.call(new f(n), e);
}
}
}
function u(e) {
var t = this;
t.triggered || (t.triggered = !0, t.def && (t = t.def), t.msg = e, t.state = 2, t.chain.length > 0 && a(s, t));
}
function d(e, t, n, r) {
for (var i = 0; i < t.length; i++) (function(i) {
e.resolve(t[i]).then(function(e) {
n(i, e);
}, r);
})(i);
}
function f(e) {
this.def = e, this.triggered = !1;
}
function p(e) {
this.promise = e, this.state = 0, this.triggered = !1, this.chain = [], this.msg = void 0;
}
function m(e) {
if (typeof e != "function") throw TypeError("Not a function");
if (this.__NPO__ !== 0) throw TypeError("Not a promise");
this.__NPO__ = 1;
var t = new p(this);
this.then = function(e, n) {
var r = {
success: typeof e == "function" ? e : !0,
failure: typeof n == "function" ? n : !1
};
return r.promise = new this.constructor(function(e, t) {
if (typeof e != "function" || typeof t != "function") throw TypeError("Not a function");
r.resolve = e, r.reject = t;
}), t.chain.push(r), t.state !== 0 && a(s, t), r.promise;
}, this.catch = function(e) {
return this.then(void 0, e);
};
try {
e.call(void 0, function(e) {
l.call(t, e);
}, function(e) {
u.call(t, e);
});
} catch (e) {
u.call(t, e);
}
}
var h = e({}, "constructor", m, !1);
return m.prototype = h, e(h, "__NPO__", 0, !1), e(m, "resolve", function(e) {
var t = this;
return e && typeof e == "object" && e.__NPO__ === 1 ? e : new t(function(t, n) {
if (typeof t != "function" || typeof n != "function") throw TypeError("Not a function");
t(e);
});
}), e(m, "reject", function(e) {
return new this(function(t, n) {
if (typeof t != "function" || typeof n != "function") throw TypeError("Not a function");
n(e);
});
}), e(m, "all", function(e) {
var t = this;
return r.call(e) == "[object Array]" ? e.length === 0 ? t.resolve([]) : new t(function(n, r) {
if (typeof n != "function" || typeof r != "function") throw TypeError("Not a function");
var i = e.length, a = Array(i), o = 0;
d(t, e, function(e, t) {
a[e] = t, ++o === i && n(a);
}, r);
}) : t.reject(TypeError("Not an array"));
}), e(m, "race", function(e) {
var t = this;
return r.call(e) == "[object Array]" ? new t(function(n, r) {
if (typeof n != "function" || typeof r != "function") throw TypeError("Not a function");
d(t, e, function(e, t) {
n(t);
}, r);
}) : t.reject(TypeError("Not an array"));
}), m;
});
} }), S = h({ "node_modules/@plotly/d3/d3.js"(e, t) {
(function() {
var e = { version: "3.8.2" }, n = [].slice, r = function(e) {
return n.call(e);
}, i = self.document;
function a(e) {
return e && (e.ownerDocument || e.document || e).documentElement;
}
function o(e) {
return e && (e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView);
}
if (i) try {
r(i.documentElement.childNodes)[0].nodeType;
} catch {
r = function(e) {
for (var t = e.length, n = Array(t); t--;) n[t] = e[t];
return n;
};
}
if (Date.now || (Date.now = function() {
return +/* @__PURE__ */ new Date();
}), i) try {
i.createElement("DIV").style.setProperty("opacity", 0, "");
} catch {
var s = this.Element.prototype, c = s.setAttribute, l = s.setAttributeNS, u = this.CSSStyleDeclaration.prototype, d = u.setProperty;
s.setAttribute = function(e, t) {
c.call(this, e, t + "");
}, s.setAttributeNS = function(e, t, n) {
l.call(this, e, t, n + "");
}, u.setProperty = function(e, t, n) {
d.call(this, e, t + "", n);
};
}
e.ascending = f;
function f(e, t) {
return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
e.descending = function(e, t) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}, e.min = function(e, t) {
var n = -1, r = e.length, i, a;
if (arguments.length === 1) {
for (; ++n < r;) if ((a = e[n]) != null && a >= a) {
i = a;
break;
}
for (; ++n < r;) (a = e[n]) != null && i > a && (i = a);
} else {
for (; ++n < r;) if ((a = t.call(e, e[n], n)) != null && a >= a) {
i = a;
break;
}
for (; ++n < r;) (a = t.call(e, e[n], n)) != null && i > a && (i = a);
}
return i;
}, e.max = function(e, t) {
var n = -1, r = e.length, i, a;
if (arguments.length === 1) {
for (; ++n < r;) if ((a = e[n]) != null && a >= a) {
i = a;
break;
}
for (; ++n < r;) (a = e[n]) != null && a > i && (i = a);
} else {
for (; ++n < r;) if ((a = t.call(e, e[n], n)) != null && a >= a) {
i = a;
break;
}
for (; ++n < r;) (a = t.call(e, e[n], n)) != null && a > i && (i = a);
}
return i;
}, e.extent = function(e, t) {
var n = -1, r = e.length, i, a, o;
if (arguments.length === 1) {
for (; ++n < r;) if ((a = e[n]) != null && a >= a) {
i = o = a;
break;
}
for (; ++n < r;) (a = e[n]) != null && (i > a && (i = a), o < a && (o = a));
} else {
for (; ++n < r;) if ((a = t.call(e, e[n], n)) != null && a >= a) {
i = o = a;
break;
}
for (; ++n < r;) (a = t.call(e, e[n], n)) != null && (i > a && (i = a), o < a && (o = a));
}
return [i, o];
};
function p(e) {
return e === null ? NaN : +e;
}
function m(e) {
return !isNaN(e);
}
e.sum = function(e, t) {
var n = 0, r = e.length, i, a = -1;
if (arguments.length === 1) for (; ++a < r;) m(i = +e[a]) && (n += i);
else for (; ++a < r;) m(i = +t.call(e, e[a], a)) && (n += i);
return n;
}, e.mean = function(e, t) {
var n = 0, r = e.length, i, a = -1, o = r;
if (arguments.length === 1) for (; ++a < r;) m(i = p(e[a])) ? n += i : --o;
else for (; ++a < r;) m(i = p(t.call(e, e[a], a))) ? n += i : --o;
if (o) return n / o;
}, e.quantile = function(e, t) {
var n = (e.length - 1) * t + 1, r = Math.floor(n), i = +e[r - 1], a = n - r;
return a ? i + a * (e[r] - i) : i;
}, e.median = function(t, n) {
var r = [], i = t.length, a, o = -1;
if (arguments.length === 1) for (; ++o < i;) m(a = p(t[o])) && r.push(a);
else for (; ++o < i;) m(a = p(n.call(t, t[o], o))) && r.push(a);
if (r.length) return e.quantile(r.sort(f), .5);
}, e.variance = function(e, t) {
var n = e.length, r = 0, i, a, o = 0, s = -1, c = 0;
if (arguments.length === 1) for (; ++s < n;) m(i = p(e[s])) && (a = i - r, r += a / ++c, o += a * (i - r));
else for (; ++s < n;) m(i = p(t.call(e, e[s], s))) && (a = i - r, r += a / ++c, o += a * (i - r));
if (c > 1) return o / (c - 1);
}, e.deviation = function() {
var t = e.variance.apply(this, arguments);
return t && Math.sqrt(t);
};
function h(e) {
return {
left: function(t, n, r, i) {
for (arguments.length < 3 && (r = 0), arguments.length < 4 && (i = t.length); r < i;) {
var a = r + i >>> 1;
e(t[a], n) < 0 ? r = a + 1 : i = a;
}
return r;
},
right: function(t, n, r, i) {
for (arguments.length < 3 && (r = 0), arguments.length < 4 && (i = t.length); r < i;) {
var a = r + i >>> 1;
e(t[a], n) > 0 ? i = a : r = a + 1;
}
return r;
}
};
}
var g = h(f);
e.bisectLeft = g.left, e.bisect = e.bisectRight = g.right, e.bisector = function(e) {
return h(e.length === 1 ? function(t, n) {
return f(e(t), n);
} : e);
}, e.shuffle = function(e, t, n) {
(r = arguments.length) < 3 && (n = e.length, r < 2 && (t = 0));
for (var r = n - t, i, a; r;) a = Math.random() * r-- | 0, i = e[r + t], e[r + t] = e[a + t], e[a + t] = i;
return e;
}, e.permute = function(e, t) {
for (var n = t.length, r = Array(n); n--;) r[n] = e[t[n]];
return r;
}, e.pairs = function(e) {
for (var t = 0, n = e.length - 1, r = e[0], i = Array(n < 0 ? 0 : n); t < n;) i[t] = [r, r = e[++t]];
return i;
}, e.transpose = function(t) {
if (!(o = t.length)) return [];
for (var n = -1, r = e.min(t, _), i = Array(r); ++n < r;) for (var a = -1, o, s = i[n] = Array(o); ++a < o;) s[a] = t[a][n];
return i;
};
function _(e) {
return e.length;
}
e.zip = function() {
return e.transpose(arguments);
}, e.keys = function(e) {
var t = [];
for (var n in e) t.push(n);
return t;
}, e.values = function(e) {
var t = [];
for (var n in e) t.push(e[n]);
return t;
}, e.entries = function(e) {
var t = [];
for (var n in e) t.push({
key: n,
value: e[n]
});
return t;
}, e.merge = function(e) {
for (var t = e.length, n, r = -1, i = 0, a, o; ++r < t;) i += e[r].length;
for (a = Array(i); --t >= 0;) for (o = e[t], n = o.length; --n >= 0;) a[--i] = o[n];
return a;
};
var v = Math.abs;
e.range = function(e, t, n) {
if (arguments.length < 3 && (n = 1, arguments.length < 2 && (t = e, e = 0)), (t - e) / n === Infinity) throw Error("infinite range");
var r = [], i = y(v(n)), a = -1, o;
if (e *= i, t *= i, n *= i, n < 0) for (; (o = e + n * ++a) > t;) r.push(o / i);
else for (; (o = e + n * ++a) < t;) r.push(o / i);
return r;
};
function y(e) {
for (var t = 1; e * t % 1;) t *= 10;
return t;
}
function b(e, t) {
for (var n in t) Object.defineProperty(e.prototype, n, {
value: t[n],
enumerable: !1
});
}
e.map = function(e, t) {
var n = new x();
if (e instanceof x) e.forEach(function(e, t) {
n.set(e, t);
});
else if (Array.isArray(e)) {
var r = -1, i = e.length, a;
if (arguments.length === 1) for (; ++r < i;) n.set(r, e[r]);
else for (; ++r < i;) n.set(t.call(e, a = e[r], r), a);
} else for (var o in e) n.set(o, e[o]);
return n;
};
function x() {
this._ = /* @__PURE__ */ Object.create(null);
}
var S = "__proto__", C = "\0";
b(x, {
has: E,
get: function(e) {
return this._[w(e)];
},
set: function(e, t) {
return this._[w(e)] = t;
},
remove: D,
keys: O,
values: function() {
var e = [];
for (var t in this._) e.push(this._[t]);
return e;
},
entries: function() {
var e = [];
for (var t in this._) e.push({
key: T(t),
value: this._[t]
});
return e;
},
size: k,
empty: A,
forEach: function(e) {
for (var t in this._) e.call(this, T(t), this._[t]);
}
});
function w(e) {
return (e += "") === S || e[0] === C ? C + e : e;
}
function T(e) {
return (e += "")[0] === C ? e.slice(1) : e;
}
function E(e) {
return w(e) in this._;
}
function D(e) {
return (e = w(e)) in this._ && delete this._[e];
}
function O() {
var e = [];
for (var t in this._) e.push(T(t));
return e;
}
function k() {
var e = 0;
for (var t in this._) ++e;
return e;
}
function A() {
for (var e in this._) return !1;
return !0;
}
e.nest = function() {
var t = {}, n = [], r = [], i, a;
function o(e, r, s) {
if (s >= n.length) return a ? a.call(t, r) : i ? r.sort(i) : r;
for (var c = -1, l = r.length, u = n[s++], d, f, p, m = new x(), h; ++c < l;) (h = m.get(d = u(f = r[c]))) ? h.push(f) : m.set(d, [f]);
return e ? (f = e(), p = function(t, n) {
f.set(t, o(e, n, s));
}) : (f = {}, p = function(t, n) {
f[t] = o(e, n, s);
}), m.forEach(p), f;
}
function s(e, t) {
if (t >= n.length) return e;
var i = [], a = r[t++];
return e.forEach(function(e, n) {
i.push({
key: e,
values: s(n, t)
});
}), a ? i.sort(function(e, t) {
return a(e.key, t.key);
}) : i;
}
return t.map = function(e, t) {
return o(t, e, 0);
}, t.entries = function(t) {
return s(o(e.map, t, 0), 0);
}, t.key = function(e) {
return n.push(e), t;
}, t.sortKeys = function(e) {
return r[n.length - 1] = e, t;
}, t.sortValues = function(e) {
return i = e, t;
}, t.rollup = function(e) {
return a = e, t;
}, t;
}, e.set = function(e) {
var t = new j();
if (e) for (var n = 0, r = e.length; n < r; ++n) t.add(e[n]);
return t;
};
function j() {
this._ = /* @__PURE__ */ Object.create(null);
}
b(j, {
has: E,
add: function(e) {
return this._[w(e += "")] = !0, e;
},
remove: D,
values: O,
size: k,
empty: A,
forEach: function(e) {
for (var t in this._) e.call(this, T(t));
}
}), e.behavior = {};
function M(e) {
return e;
}
e.rebind = function(e, t) {
for (var n = 1, r = arguments.length, i; ++n < r;) e[i = arguments[n]] = N(e, t, t[i]);
return e;
};
function N(e, t, n) {
return function() {
var r = n.apply(t, arguments);
return r === t ? e : r;
};
}
function P(e, t) {
if (t in e) return t;
t = t.charAt(0).toUpperCase() + t.slice(1);
for (var n = 0, r = F.length; n < r; ++n) {
var i = F[n] + t;
if (i in e) return i;
}
}
var F = [
"webkit",
"ms",
"moz",
"Moz",
"o",
"O"
];
function I() {}
e.dispatch = function() {
for (var e = new L(), t = -1, n = arguments.length; ++t < n;) e[arguments[t]] = R(e);
return e;
};
function L() {}
L.prototype.on = function(e, t) {
var n = e.indexOf("."), r = "";
if (n >= 0 && (r = e.slice(n + 1), e = e.slice(0, n)), e) return arguments.length < 2 ? this[e].on(r) : this[e].on(r, t);
if (arguments.length === 2) {
if (t == null) for (e in this) this.hasOwnProperty(e) && this[e].on(r, null);
return this;
}
};
function R(e) {
var t = [], n = new x();
function r() {
for (var n = t, r = -1, i = n.length, a; ++r < i;) (a = n[r].on) && a.apply(this, arguments);
return e;
}
return r.on = function(r, i) {
var a = n.get(r), o;
return arguments.length < 2 ? a && a.on : (a && (a.on = null, t = t.slice(0, o = t.indexOf(a)).concat(t.slice(o + 1)), n.remove(r)), i && t.push(n.set(r, { on: i })), e);
}, r;
}
e.event = null;
function z() {
e.event.preventDefault();
}
function B() {
for (var t = e.event, n; n = t.sourceEvent;) t = n;
return t;
}
function V(t) {
for (var n = new L(), r = 0, i = arguments.length; ++r < i;) n[arguments[r]] = R(n);
return n.of = function(r, i) {
return function(a) {
try {
var o = a.sourceEvent = e.event;
a.target = t, e.event = a, n[a.type].apply(r, i);
} finally {
e.event = o;
}
};
}, n;
}
e.requote = function(e) {
return e.replace(H, "\\$&");
};
var H = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, U = {}.__proto__ ? function(e, t) {
e.__proto__ = t;
} : function(e, t) {
for (var n in t) e[n] = t[n];
};
function W(e) {
return U(e, J), e;
}
var G = function(e, t) {
return t.querySelector(e);
}, K = function(e, t) {
return t.querySelectorAll(e);
}, q = function(e, t) {
var n = e.matches || e[P(e, "matchesSelector")];
return q = function(e, t) {
return n.call(e, t);
}, q(e, t);
};
typeof Sizzle == "function" && (G = function(e, t) {
return Sizzle(e, t)[0] || null;
}, K = Sizzle, q = Sizzle.matchesSelector), e.selection = function() {
return e.select(i.documentElement);
};
var J = e.selection.prototype = [];
J.select = function(e) {
var t = [], n, r, i, a;
e = Y(e);
for (var o = -1, s = this.length; ++o < s;) {
t.push(n = []), n.parentNode = (i = this[o]).parentNode;
for (var c = -1, l = i.length; ++c < l;) (a = i[c]) ? (n.push(r = e.call(a, a.__data__, c, o)), r && "__data__" in a && (r.__data__ = a.__data__)) : n.push(null);
}
return W(t);
};
function Y(e) {
return typeof e == "function" ? e : function() {
return G(e, this);
};
}
J.selectAll = function(e) {
var t = [], n, i;
e = X(e);
for (var a = -1, o = this.length; ++a < o;) for (var s = this[a], c = -1, l = s.length; ++c < l;) (i = s[c]) && (t.push(n = r(e.call(i, i.__data__, c, a))), n.parentNode = i);
return W(t);
};
function X(e) {
return typeof e == "function" ? e : function() {
return K(e, this);
};
}
var Z = "http://www.w3.org/1999/xhtml", Q = {
svg: "http://www.w3.org/2000/svg",
xhtml: Z,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
e.ns = {
prefix: Q,
qualify: function(e) {
var t = e.indexOf(":"), n = e;
return t >= 0 && (n = e.slice(0, t)) !== "xmlns" && (e = e.slice(t + 1)), Q.hasOwnProperty(n) ? {
space: Q[n],
local: e
} : e;
}
}, J.attr = function(t, n) {
if (arguments.length < 2) {
if (typeof t == "string") {
var r = this.node();
return t = e.ns.qualify(t), t.local ? r.getAttributeNS(t.space, t.local) : r.getAttribute(t);
}
for (n in t) this.each(ee(n, t[n]));
return this;
}
return this.each(ee(t, n));
};
function ee(t, n) {
t = e.ns.qualify(t);
function r() {
this.removeAttribute(t);
}
function i() {
this.removeAttributeNS(t.space, t.local);
}
function a() {
this.setAttribute(t, n);
}
function o() {
this.setAttributeNS(t.space, t.local, n);
}
function s() {
var e = n.apply(this, arguments);
e == null ? this.removeAttribute(t) : this.setAttribute(t, e);
}
function c() {
var e = n.apply(this, arguments);
e == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, e);
}
return n == null ? t.local ? i : r : typeof n == "function" ? t.local ? c : s : t.local ? o : a;
}
function te(e) {
return e.trim().replace(/\s+/g, " ");
}
J.classed = function(e, t) {
if (arguments.length < 2) {
if (typeof e == "string") {
var n = this.node(), r = (e = re(e)).length, i = -1;
if (t = n.classList) {
for (; ++i < r;) if (!t.contains(e[i])) return !1;
} else for (t = n.getAttribute("class"); ++i < r;) if (!ne(e[i]).test(t)) return !1;
return !0;
}
for (t in e) this.each(ie(t, e[t]));
return this;
}
return this.each(ie(e, t));
};
function ne(t) {
return RegExp("(?:^|\\s+)" + e.requote(t) + "(?:\\s+|$)", "g");
}
function re(e) {
return (e + "").trim().split(/^|\s+/);
}
function ie(e, t) {
e = re(e).map(ae);
var n = e.length;
function r() {
for (var r = -1; ++r < n;) e[r](this, t);
}
function i() {
for (var r = -1, i = t.apply(this, arguments); ++r < n;) e[r](this, i);
}
return typeof t == "function" ? i : r;
}
function ae(e) {
var t = ne(e);
return function(n, r) {
if (i = n.classList) return r ? i.add(e) : i.remove(e);
var i = n.getAttribute("class") || "";
r ? (t.lastIndex = 0, t.test(i) || n.setAttribute("class", te(i + " " + e))) : n.setAttribute("class", te(i.replace(t, " ")));
};
}
J.style = function(e, t, n) {
var r = arguments.length;
if (r < 3) {
if (typeof e != "string") {
for (n in r < 2 && (t = ""), e) this.each(oe(n, e[n], t));
return this;
}
if (r < 2) {
var i = this.node();
return o(i).getComputedStyle(i, null).getPropertyValue(e);
}
n = "";
}
return this.each(oe(e, t, n));
};
function oe(e, t, n) {
function r() {
this.style.removeProperty(e);
}
function i() {
this.style.setProperty(e, t, n);
}
function a() {
var r = t.apply(this, arguments);
r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n);
}
return t == null ? r : typeof t == "function" ? a : i;
}
J.property = function(e, t) {
if (arguments.length < 2) {
if (typeof e == "string") return this.node()[e];
for (t in e) this.each(se(t, e[t]));
return this;
}
return this.each(se(e, t));
};
function se(e, t) {
function n() {
delete this[e];
}
function r() {
this[e] = t;
}
function i() {
var n = t.apply(this, arguments);
n == null ? delete this[e] : this[e] = n;
}
return t == null ? n : typeof t == "function" ? i : r;
}
J.text = function(e) {
return arguments.length ? this.each(typeof e == "function" ? function() {
var t = e.apply(this, arguments);
this.textContent = t ?? "";
} : e == null ? function() {
this.textContent = "";
} : function() {
this.textContent = e;
}) : this.node().textContent;
}, J.html = function(e) {
return arguments.length ? this.each(typeof e == "function" ? function() {
var t = e.apply(this, arguments);
this.innerHTML = t ?? "";
} : e == null ? function() {
this.innerHTML = "";
} : function() {
this.innerHTML = e;
}) : this.node().innerHTML;
}, J.append = function(e) {
return e = ce(e), this.select(function() {
return this.appendChild(e.apply(this, arguments));
});
};
function ce(t) {
function n() {
var e = this.ownerDocument, n = this.namespaceURI;
return n === Z && e.documentElement.namespaceURI === Z ? e.createElement(t) : e.createElementNS(n, t);
}
function r() {
return this.ownerDocument.createElementNS(t.space, t.local);
}
return typeof t == "function" ? t : (t = e.ns.qualify(t)).local ? r : n;
}
J.insert = function(e, t) {
return e = ce(e), t = Y(t), this.select(function() {
return this.insertBefore(e.apply(this, arguments), t.apply(this, arguments) || null);
});
}, J.remove = function() {
return this.each(le);
};
function le() {
var e = this.parentNode;
e && e.removeChild(this);
}
J.data = function(e, t) {
var n = -1, r = this.length, i, a;
if (!arguments.length) {
for (e = Array(r = (i = this[0]).length); ++n < r;) (a = i[n]) && (e[n] = a.__data__);
return e;
}
function o(e, n) {
var r, i = e.length, a = n.length, o = Math.min(i, a), u = Array(a), d = Array(a), f = Array(i), p, m;
if (t) {
var h = new x(), g = Array(i), _;
for (r = -1; ++r < i;) (p = e[r]) && (h.has(_ = t.call(p, p.__data__, r)) ? f[r] = p : h.set(_, p), g[r] = _);
for (r = -1; ++r < a;) (p = h.get(_ = t.call(n, m = n[r], r))) ? p !== !0 && (u[r] = p, p.__data__ = m) : d[r] = ue(m), h.set(_, !0);
for (r = -1; ++r < i;) r in g && h.get(g[r]) !== !0 && (f[r] = e[r]);
} else {
for (r = -1; ++r < o;) p = e[r], m = n[r], p ? (p.__data__ = m, u[r] = p) : d[r] = ue(m);
for (; r < a; ++r) d[r] = ue(n[r]);
for (; r < i; ++r) f[r] = e[r];
}
d.update = u, d.parentNode = u.parentNode = f.parentNode = e.parentNode, s.push(d), c.push(u), l.push(f);
}
var s = me([]), c = W([]), l = W([]);
if (typeof e == "function") for (; ++n < r;) o(i = this[n], e.call(i, i.parentNode.__data__, n));
else for (; ++n < r;) o(i = this[n], e);
return c.enter = function() {
return s;
}, c.exit = function() {
return l;
}, c;
};
function ue(e) {
return { __data__: e };
}
J.datum = function(e) {
return arguments.length ? this.property("__data__", e) : this.property("__data__");
}, J.filter = function(e) {
var t = [], n, r, i;
typeof e != "function" && (e = de(e));
for (var a = 0, o = this.length; a < o; a++) {
t.push(n = []), n.parentNode = (r = this[a]).parentNode;
for (var s = 0, c = r.length; s < c; s++) (i = r[s]) && e.call(i, i.__data__, s, a) && n.push(i);
}
return W(t);
};
function de(e) {
return function() {
return q(this, e);
};
}
J.order = function() {
for (var e = -1, t = this.length; ++e < t;) for (var n = this[e], r = n.length - 1, i = n[r], a; --r >= 0;) (a = n[r]) && (i && i !== a.nextSibling && i.parentNode.insertBefore(a, i), i = a);
return this;
}, J.sort = function(e) {
e = fe.apply(this, arguments);
for (var t = -1, n = this.length; ++t < n;) this[t].sort(e);
return this.order();
};
function fe(e) {
return arguments.length || (e = f), function(t, n) {
return t && n ? e(t.__data__, n.__data__) : !t - !n;
};
}
J.each = function(e) {
return pe(this, function(t, n, r) {
e.call(t, t.__data__, n, r);
});
};
function pe(e, t) {
for (var n = 0, r = e.length; n < r; n++) for (var i = e[n], a = 0, o = i.length, s; a < o; a++) (s = i[a]) && t(s, a, n);
return e;
}
J.call = function(e) {
var t = r(arguments);
return e.apply(t[0] = this, t), this;
}, J.empty = function() {
return !this.node();
}, J.node = function() {
for (var e = 0, t = this.length; e < t; e++) for (var n = this[e], r = 0, i = n.length; r < i; r++) {
var a = n[r];
if (a) return a;
}
return null;
}, J.size = function() {
var e = 0;
return pe(this, function() {
++e;
}), e;
};
function me(e) {
return U(e, he), e;
}
var he = [];
e.selection.enter = me, e.selection.enter.prototype = he, he.append = J.append, he.empty = J.empty, he.node = J.node, he.call = J.call, he.size = J.size, he.select = function(e) {
for (var t = [], n, r, i, a, o, s = -1, c = this.length; ++s < c;) {
i = (a = this[s]).update, t.push(n = []), n.parentNode = a.parentNode;
for (var l = -1, u = a.length; ++l < u;) (o = a[l]) ? (n.push(i[l] = r = e.call(a.parentNode, o.__data__, l, s)), r.__data__ = o.__data__) : n.push(null);
}
return W(t);
}, he.insert = function(e, t) {
return arguments.length < 2 && (t = ge(this)), J.insert.call(this, e, t);
};
function ge(e) {
var t, n;
return function(r, i, a) {
var o = e[a].update, s = o.length, c;
for (a != n && (n = a, t = 0), i >= t && (t = i + 1); !(c = o[t]) && ++t < s;);
return c;
};
}
e.select = function(e) {
var t;
return typeof e == "string" ? (t = [G(e, i)], t.parentNode = i.documentElement) : (t = [e], t.parentNode = a(e)), W([t]);
}, e.selectAll = function(e) {
var t;
return typeof e == "string" ? (t = r(K(e, i)), t.parentNode = i.documentElement) : (t = r(e), t.parentNode = null), W([t]);
}, J.on = function(e, t, n) {
var r = arguments.length;
if (r < 3) {
if (typeof e != "string") {
for (n in r < 2 && (t = !1), e) this.each(_e(n, e[n], t));
return this;
}
if (r < 2) return (r = this.node()["__on" + e]) && r._;
n = !1;
}
return this.each(_e(e, t, n));
};
function _e(t, n, i) {
var a = "__on" + t, o = t.indexOf("."), s = ye;
o > 0 && (t = t.slice(0, o));
var c = ve.get(t);
c && (t = c, s = be);
function l() {
var e = this[a];
e && (this.removeEventListener(t, e, e.$), delete this[a]);
}
function u() {
var e = s(n, r(arguments));
l.call(this), this.addEventListener(t, this[a] = e, e.$ = i), e._ = n;
}
function d() {
var n = RegExp("^__on([^.]+)" + e.requote(t) + "$"), r;
for (var i in this) if (r = i.match(n)) {
var a = this[i];
this.removeEventListener(r[1], a, a.$), delete this[i];
}
}
return o ? n ? u : l : n ? I : d;
}
var ve = e.map({
mouseenter: "mouseover",
mouseleave: "mouseout"
});
i && ve.forEach(function(e) {
"on" + e in i && ve.remove(e);
});
function ye(t, n) {
return function(r) {
var i = e.event;
e.event = r, n[0] = this.__data__;
try {
t.apply(this, n);
} finally {
e.event = i;
}
};
}
function be(e, t) {
var n = ye(e, t);
return function(e) {
var t = this, r = e.relatedTarget;
(!r || r !== t && !(r.compareDocumentPosition(t) & 8)) && n.call(t, e);
};
}
var xe, Se = 0;
function Ce(t) {
var n = ".dragsuppress-" + ++Se, r = "click" + n, i = e.select(o(t)).on("touchmove" + n, z).on("dragstart" + n, z).on("selectstart" + n, z);
if (xe ??= "onselectstart" in t ? !1 : P(t.style, "userSelect"), xe) {
var s = a(t).style, c = s[xe];
s[xe] = "none";
}
return function(e) {
if (i.on(n, null), xe && (s[xe] = c), e) {
var t = function() {
i.on(r, null);
};
i.on(r, function() {
z(), t();
}, !0), setTimeout(t, 0);
}
};
}
e.mouse = function(e) {
return Te(e, B());
};
var we = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
function Te(t, n) {
n.changedTouches && (n = n.changedTouches[0]);
var r = t.ownerSVGElement || t;
if (r.createSVGPoint) {
var i = r.createSVGPoint();
if (we < 0) {
var a = o(t);
if (a.scrollX || a.scrollY) {
r = e.select("body").append("svg").style({
position: "absolute",
top: 0,
left: 0,
margin: 0,
padding: 0,
border: "none"
}, "important");
var s = r[0][0].getScreenCTM();
we = !(s.f || s.e), r.remove();
}
}
return we ? (i.x = n.pageX, i.y = n.pageY) : (i.x = n.clientX, i.y = n.clientY), i = i.matrixTransform(t.getScreenCTM().inverse()), [i.x, i.y];
}
var c = t.getBoundingClientRect();
return [n.clientX - c.left - t.clientLeft, n.clientY - c.top - t.clientTop];
}
e.touch = function(e, t, n) {
if (arguments.length < 3 && (n = t, t = B().changedTouches), t) {
for (var r = 0, i = t.length, a; r < i; ++r) if ((a = t[r]).identifier === n) return Te(e, a);
}
}, e.behavior.drag = function() {
var t = V(a, "drag", "dragstart", "dragend"), n = null, r = s(I, e.mouse, o, "mousemove", "mouseup"), i = s(Ee, e.touch, M, "touchmove", "touchend");
function a() {
this.on("mousedown.drag", r).on("touchstart.drag", i);
}
function s(r, i, a, o, s) {
return function() {
var c = this, l = e.event.target.correspondingElement || e.event.target, u = c.parentNode, d = t.of(c, arguments), f = 0, p = r(), m = ".drag" + (p == null ? "" : "-" + p), h, g = e.select(a(l)).on(o + m, y).on(s + m, b), _ = Ce(l), v = i(u, p);
n ? (h = n.apply(c, arguments), h = [h.x - v[0], h.y - v[1]]) : h = [0, 0], d({ type: "dragstart" });
function y() {
var e = i(u, p), t, n;
e && (t = e[0] - v[0], n = e[1] - v[1], f |= t | n, v = e, d({
type: "drag",
x: e[0] + h[0],
y: e[1] + h[1],
dx: t,
dy: n
}));
}
function b() {
i(u, p) && (g.on(o + m, null).on(s + m, null), _(f), d({ type: "dragend" }));
}
};
}
return a.origin = function(e) {
return arguments.length ? (n = e, a) : n;
}, e.rebind(a, t, "on");
};
function Ee() {
return e.event.changedTouches[0].identifier;
}
e.touches = function(e, t) {
return arguments.length < 2 && (t = B().touches), t ? r(t).map(function(t) {
var n = Te(e, t);
return n.identifier = t.identifier, n;
}) : [];
};
var De = 1e-6, Oe = De * De, ke = Math.PI, Ae = 2 * ke, je = Ae - De, Me = ke / 2, Ne = ke / 180, Pe = 180 / ke;
function Fe(e, t, n) {
return (t[0] - e[0]) * (n[1] - e[1]) - (t[1] - e[1]) * (n[0] - e[0]);
}
function Ie(e) {
return e > 1 ? Me : e < -1 ? -Me : Math.asin(e);
}
function Le(e) {
return ((e = Math.exp(e)) - 1 / e) / 2;
}
function Re(e) {
return ((e = Math.exp(e)) + 1 / e) / 2;
}
function ze(e) {
return ((e = Math.exp(2 * e)) - 1) / (e + 1);
}
var Be = Math.SQRT2, Ve = 2, He = 4;
e.interpolateZoom = function(e, t) {
var n = e[0], r = e[1], i = e[2], a = t[0], o = t[1], s = t[2], c = a - n, l = o - r, u = c * c + l * l, d, f;
if (u < Oe) f = Math.log(s / i) / Be, d = function(e) {
return [
n + e * c,
r + e * l,
i * Math.exp(Be * e * f)
];
};
else {
var p = Math.sqrt(u), m = (s * s - i *