import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, inject, isRef, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, unref, useSlots, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "./chunk-6UGCK2MK.js"; // node_modules/@abi-software/plotvuer/dist/plotvuer.js function ZR(e10) { return e10 && e10.__esModule && Object.prototype.hasOwnProperty.call(e10, "default") ? e10.default : e10; } var v3 = { exports: {} }; var cn = v3.exports = {}; var Ri; var Pi; function N0() { throw new Error("setTimeout has not been defined"); } function O0() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? Ri = setTimeout : Ri = N0; } catch { Ri = N0; } try { typeof clearTimeout == "function" ? Pi = clearTimeout : Pi = O0; } catch { Pi = O0; } })(); function p3(e10) { if (Ri === setTimeout) return setTimeout(e10, 0); if ((Ri === N0 || !Ri) && setTimeout) return Ri = setTimeout, setTimeout(e10, 0); try { return Ri(e10, 0); } catch { try { return Ri.call(null, e10, 0); } catch { return Ri.call(this, e10, 0); } } } function YR(e10) { if (Pi === clearTimeout) return clearTimeout(e10); if ((Pi === O0 || !Pi) && clearTimeout) return Pi = clearTimeout, clearTimeout(e10); try { return Pi(e10); } catch { try { return Pi.call(null, e10); } catch { return Pi.call(this, e10); } } } var po = []; var mu = false; var Ol; var Dh = -1; function XR() { !mu || !Ol || (mu = false, Ol.length ? po = Ol.concat(po) : Dh = -1, po.length && m3()); } function m3() { if (!mu) { var e10 = p3(XR); mu = true; for (var t = po.length; t; ) { for (Ol = po, po = []; ++Dh < t; ) Ol && Ol[Dh].run(); Dh = -1, t = po.length; } Ol = null, mu = false, YR(e10); } } cn.nextTick = function(e10) { var t = new Array(arguments.length - 1); if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) t[r - 1] = arguments[r]; po.push(new g3(e10, t)), po.length === 1 && !mu && p3(m3); }; function g3(e10, t) { this.fun = e10, this.array = t; } g3.prototype.run = function() { this.fun.apply(null, this.array); }; cn.title = "browser"; cn.browser = true; cn.env = {}; cn.argv = []; cn.version = ""; cn.versions = {}; function Mo() { } cn.on = Mo; cn.addListener = Mo; cn.once = Mo; cn.off = Mo; cn.removeListener = Mo; cn.removeAllListeners = Mo; cn.emit = Mo; cn.prependListener = Mo; cn.prependOnceListener = Mo; cn.listeners = function(e10) { return []; }; cn.binding = function(e10) { throw new Error("process.binding is not supported"); }; cn.cwd = function() { return "/"; }; cn.chdir = function(e10) { throw new Error("process.chdir is not supported"); }; cn.umask = function() { return 0; }; var KR = v3.exports; var cs = ZR(KR); var fo = (e10, t, { checkForDefaultPrevented: r = true } = {}) => (a) => { const i = e10 == null ? void 0 : e10(a); if (r === false || !i) return t == null ? void 0 : t(a); }; var lu = globalThis || void 0 || self; var Ox; var qn = typeof window < "u"; var JR = (e10) => typeof e10 == "string"; var y3 = () => { }; var H0 = qn && ((Ox = window == null ? void 0 : window.navigator) == null ? void 0 : Ox.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function b3(e10) { return typeof e10 == "function" ? e10() : unref(e10); } function QR(e10) { return e10; } function Hv(e10) { return getCurrentScope() ? (onScopeDispose(e10), true) : false; } function eP(e10, t = true) { getCurrentInstance() ? onMounted(e10) : t ? e10() : nextTick(e10); } function mo(e10) { var t; const r = b3(e10); return (t = r == null ? void 0 : r.$el) != null ? t : r; } var Bv = qn ? window : void 0; function ui(...e10) { let t, r, n, a; if (JR(e10[0]) || Array.isArray(e10[0]) ? ([r, n, a] = e10, t = Bv) : [t, r, n, a] = e10, !t) return y3; Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); const i = [], o = () => { i.forEach((f) => f()), i.length = 0; }, l = (f, d, h, p) => (f.addEventListener(d, h, p), () => f.removeEventListener(d, h, p)), s = watch(() => [mo(t), b3(a)], ([f, d]) => { o(), f && i.push(...r.flatMap((h) => n.map((p) => l(f, h, p, d)))); }, { immediate: true, flush: "post" }), u = () => { s(), o(); }; return Hv(u), u; } var Hx = false; function tP(e10, t, r = {}) { const { window: n = Bv, ignore: a = [], capture: i = true, detectIframe: o = false } = r; if (!n) return; H0 && !Hx && (Hx = true, Array.from(n.document.body.children).forEach((h) => h.addEventListener("click", y3))); let l = true; const s = (h) => a.some((p) => { if (typeof p == "string") return Array.from(n.document.querySelectorAll(p)).some((v) => v === h.target || h.composedPath().includes(v)); { const v = mo(p); return v && (h.target === v || h.composedPath().includes(v)); } }), f = [ ui(n, "click", (h) => { const p = mo(e10); if (!(!p || p === h.target || h.composedPath().includes(p))) { if (h.detail === 0 && (l = !s(h)), !l) { l = true; return; } t(h); } }, { passive: true, capture: i }), ui(n, "pointerdown", (h) => { const p = mo(e10); p && (l = !h.composedPath().includes(p) && !s(h)); }, { passive: true }), o && ui(n, "blur", (h) => { var p; const v = mo(e10); ((p = n.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(v != null && v.contains(n.document.activeElement)) && t(h); }) ].filter(Boolean); return () => f.forEach((h) => h()); } function _3(e10, t = false) { const r = ref(), n = () => r.value = !!e10(); return n(), eP(n, t), r; } var B0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof lu < "u" ? lu : typeof self < "u" ? self : {}; var j0 = "__vueuse_ssr_handlers__"; B0[j0] = B0[j0] || {}; B0[j0]; var Bx = Object.getOwnPropertySymbols; var rP = Object.prototype.hasOwnProperty; var nP = Object.prototype.propertyIsEnumerable; var aP = (e10, t) => { var r = {}; for (var n in e10) rP.call(e10, n) && t.indexOf(n) < 0 && (r[n] = e10[n]); if (e10 != null && Bx) for (var n of Bx(e10)) t.indexOf(n) < 0 && nP.call(e10, n) && (r[n] = e10[n]); return r; }; function Wo(e10, t, r = {}) { const n = r, { window: a = Bv } = n, i = aP(n, ["window"]); let o; const l = _3(() => a && "ResizeObserver" in a), s = () => { o && (o.disconnect(), o = void 0); }, u = watch(() => mo(e10), (d) => { s(), l.value && a && d && (o = new ResizeObserver(t), o.observe(d, i)); }, { immediate: true, flush: "post" }), f = () => { s(), u(); }; return Hv(f), { isSupported: l, stop: f }; } var jx = Object.getOwnPropertySymbols; var iP = Object.prototype.hasOwnProperty; var oP = Object.prototype.propertyIsEnumerable; var lP = (e10, t) => { var r = {}; for (var n in e10) iP.call(e10, n) && t.indexOf(n) < 0 && (r[n] = e10[n]); if (e10 != null && jx) for (var n of jx(e10)) t.indexOf(n) < 0 && oP.call(e10, n) && (r[n] = e10[n]); return r; }; function sP(e10, t, r = {}) { const n = r, { window: a = Bv } = n, i = lP(n, ["window"]); let o; const l = _3(() => a && "MutationObserver" in a), s = () => { o && (o.disconnect(), o = void 0); }, u = watch(() => mo(e10), (d) => { s(), l.value && a && d && (o = new MutationObserver(t), o.observe(d, i)); }, { immediate: true }), f = () => { s(), u(); }; return Hv(f), { isSupported: l, stop: f }; } var Ux; (function(e10) { e10.UP = "UP", e10.RIGHT = "RIGHT", e10.DOWN = "DOWN", e10.LEFT = "LEFT", e10.NONE = "NONE"; })(Ux || (Ux = {})); var uP = Object.defineProperty; var Gx = Object.getOwnPropertySymbols; var fP = Object.prototype.hasOwnProperty; var cP = Object.prototype.propertyIsEnumerable; var Vx = (e10, t, r) => t in e10 ? uP(e10, t, { enumerable: true, configurable: true, writable: true, value: r }) : e10[t] = r; var dP = (e10, t) => { for (var r in t || (t = {})) fP.call(t, r) && Vx(e10, r, t[r]); if (Gx) for (var r of Gx(t)) cP.call(t, r) && Vx(e10, r, t[r]); return e10; }; var hP = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; dP({ linear: QR }, hP); cs.env.NODE_ENV !== "production" && Object.freeze({}); cs.env.NODE_ENV !== "production" && Object.freeze([]); var Kh = () => { }; var vP = Object.prototype.hasOwnProperty; var qx = (e10, t) => vP.call(e10, t); var Ni = Array.isArray; var ua = (e10) => typeof e10 == "function"; var Uu = (e10) => typeof e10 == "string"; var Oi = (e10) => e10 !== null && typeof e10 == "object"; var pP = Object.prototype.toString; var mP = (e10) => pP.call(e10); var Sm = (e10) => mP(e10).slice(8, -1); var x3 = typeof lu == "object" && lu && lu.Object === Object && lu; var gP = typeof self == "object" && self && self.Object === Object && self; var qi = x3 || gP || Function("return this")(); var Ui = qi.Symbol; var w3 = Object.prototype; var yP = w3.hasOwnProperty; var bP = w3.toString; var pf = Ui ? Ui.toStringTag : void 0; function _P(e10) { var t = yP.call(e10, pf), r = e10[pf]; try { e10[pf] = void 0; var n = true; } catch { } var a = bP.call(e10); return n && (t ? e10[pf] = r : delete e10[pf]), a; } var xP = Object.prototype; var wP = xP.toString; function TP(e10) { return wP.call(e10); } var kP = "[object Null]"; var AP = "[object Undefined]"; var Wx = Ui ? Ui.toStringTag : void 0; function Gu(e10) { return e10 == null ? e10 === void 0 ? AP : kP : Wx && Wx in Object(e10) ? _P(e10) : TP(e10); } function wu(e10) { return e10 != null && typeof e10 == "object"; } var MP = "[object Symbol]"; function jv(e10) { return typeof e10 == "symbol" || wu(e10) && Gu(e10) == MP; } function SP(e10, t) { for (var r = -1, n = e10 == null ? 0 : e10.length, a = Array(n); ++r < n; ) a[r] = t(e10[r], r, e10); return a; } var pi = Array.isArray; var CP = 1 / 0; var Zx = Ui ? Ui.prototype : void 0; var Yx = Zx ? Zx.toString : void 0; function T3(e10) { if (typeof e10 == "string") return e10; if (pi(e10)) return SP(e10, T3) + ""; if (jv(e10)) return Yx ? Yx.call(e10) : ""; var t = e10 + ""; return t == "0" && 1 / e10 == -CP ? "-0" : t; } var LP = /\s/; function DP(e10) { for (var t = e10.length; t-- && LP.test(e10.charAt(t)); ) ; return t; } var EP = /^\s+/; function FP(e10) { return e10 && e10.slice(0, DP(e10) + 1).replace(EP, ""); } function ll(e10) { var t = typeof e10; return e10 != null && (t == "object" || t == "function"); } var Xx = NaN; var RP = /^[-+]0x[0-9a-f]+$/i; var PP = /^0b[01]+$/i; var $P = /^0o[0-7]+$/i; var zP = parseInt; function Kx(e10) { if (typeof e10 == "number") return e10; if (jv(e10)) return Xx; if (ll(e10)) { var t = typeof e10.valueOf == "function" ? e10.valueOf() : e10; e10 = ll(t) ? t + "" : t; } if (typeof e10 != "string") return e10 === 0 ? e10 : +e10; e10 = FP(e10); var r = PP.test(e10); return r || $P.test(e10) ? zP(e10.slice(2), r ? 2 : 8) : RP.test(e10) ? Xx : +e10; } function k3(e10) { return e10; } var IP = "[object AsyncFunction]"; var NP = "[object Function]"; var OP = "[object GeneratorFunction]"; var HP = "[object Proxy]"; function A3(e10) { if (!ll(e10)) return false; var t = Gu(e10); return t == NP || t == OP || t == IP || t == HP; } var Cm = qi["__core-js_shared__"]; var Jx = function() { var e10 = /[^.]+$/.exec(Cm && Cm.keys && Cm.keys.IE_PROTO || ""); return e10 ? "Symbol(src)_1." + e10 : ""; }(); function BP(e10) { return !!Jx && Jx in e10; } var jP = Function.prototype; var UP = jP.toString; function ds(e10) { if (e10 != null) { try { return UP.call(e10); } catch { } try { return e10 + ""; } catch { } } return ""; } var GP = /[\\^$.*+?()[\]{}|]/g; var VP = /^\[object .+?Constructor\]$/; var qP = Function.prototype; var WP = Object.prototype; var ZP = qP.toString; var YP = WP.hasOwnProperty; var XP = RegExp( "^" + ZP.call(YP).replace(GP, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function KP(e10) { if (!ll(e10) || BP(e10)) return false; var t = A3(e10) ? XP : VP; return t.test(ds(e10)); } function JP(e10, t) { return e10 == null ? void 0 : e10[t]; } function hs(e10, t) { var r = JP(e10, t); return KP(r) ? r : void 0; } var U0 = hs(qi, "WeakMap"); function QP(e10, t, r) { switch (r.length) { case 0: return e10.call(t); case 1: return e10.call(t, r[0]); case 2: return e10.call(t, r[0], r[1]); case 3: return e10.call(t, r[0], r[1], r[2]); } return e10.apply(t, r); } var e$ = 800; var t$ = 16; var r$ = Date.now; function n$(e10) { var t = 0, r = 0; return function() { var n = r$(), a = t$ - (n - r); if (r = n, a > 0) { if (++t >= e$) return arguments[0]; } else t = 0; return e10.apply(void 0, arguments); }; } function a$(e10) { return function() { return e10; }; } var Jh = function() { try { var e10 = hs(Object, "defineProperty"); return e10({}, "", {}), e10; } catch { } }(); var i$ = Jh ? function(e10, t) { return Jh(e10, "toString", { configurable: true, enumerable: false, value: a$(t), writable: true }); } : k3; var o$ = n$(i$); function l$(e10, t, r, n) { e10.length; for (var a = r + 1; a--; ) if (t(e10[a], a, e10)) return a; return -1; } var s$ = 9007199254740991; var u$ = /^(?:0|[1-9]\d*)$/; function u1(e10, t) { var r = typeof e10; return t = t ?? s$, !!t && (r == "number" || r != "symbol" && u$.test(e10)) && e10 > -1 && e10 % 1 == 0 && e10 < t; } function f$(e10, t, r) { t == "__proto__" && Jh ? Jh(e10, t, { configurable: true, enumerable: true, value: r, writable: true }) : e10[t] = r; } function f1(e10, t) { return e10 === t || e10 !== e10 && t !== t; } var c$ = Object.prototype; var d$ = c$.hasOwnProperty; function h$(e10, t, r) { var n = e10[t]; (!(d$.call(e10, t) && f1(n, r)) || r === void 0 && !(t in e10)) && f$(e10, t, r); } var Qx = Math.max; function v$(e10, t, r) { return t = Qx(t === void 0 ? e10.length - 1 : t, 0), function() { for (var n = arguments, a = -1, i = Qx(n.length - t, 0), o = Array(i); ++a < i; ) o[a] = n[t + a]; a = -1; for (var l = Array(t + 1); ++a < t; ) l[a] = n[a]; return l[t] = r(o), QP(e10, this, l); }; } var p$ = 9007199254740991; function c1(e10) { return typeof e10 == "number" && e10 > -1 && e10 % 1 == 0 && e10 <= p$; } function m$(e10) { return e10 != null && c1(e10.length) && !A3(e10); } var g$ = Object.prototype; function y$(e10) { var t = e10 && e10.constructor, r = typeof t == "function" && t.prototype || g$; return e10 === r; } function b$(e10, t) { for (var r = -1, n = Array(e10); ++r < e10; ) n[r] = t(r); return n; } var _$ = "[object Arguments]"; function ew(e10) { return wu(e10) && Gu(e10) == _$; } var M3 = Object.prototype; var x$ = M3.hasOwnProperty; var w$ = M3.propertyIsEnumerable; var d1 = ew(/* @__PURE__ */ function() { return arguments; }()) ? ew : function(e10) { return wu(e10) && x$.call(e10, "callee") && !w$.call(e10, "callee"); }; function T$() { return false; } var S3 = typeof exports == "object" && exports && !exports.nodeType && exports; var tw = S3 && typeof module == "object" && module && !module.nodeType && module; var k$ = tw && tw.exports === S3; var rw = k$ ? qi.Buffer : void 0; var A$ = rw ? rw.isBuffer : void 0; var G0 = A$ || T$; var M$ = "[object Arguments]"; var S$ = "[object Array]"; var C$ = "[object Boolean]"; var L$ = "[object Date]"; var D$ = "[object Error]"; var E$ = "[object Function]"; var F$ = "[object Map]"; var R$ = "[object Number]"; var P$ = "[object Object]"; var $$ = "[object RegExp]"; var z$ = "[object Set]"; var I$ = "[object String]"; var N$ = "[object WeakMap]"; var O$ = "[object ArrayBuffer]"; var H$ = "[object DataView]"; var B$ = "[object Float32Array]"; var j$ = "[object Float64Array]"; var U$ = "[object Int8Array]"; var G$ = "[object Int16Array]"; var V$ = "[object Int32Array]"; var q$ = "[object Uint8Array]"; var W$ = "[object Uint8ClampedArray]"; var Z$ = "[object Uint16Array]"; var Y$ = "[object Uint32Array]"; var Vr = {}; Vr[B$] = Vr[j$] = Vr[U$] = Vr[G$] = Vr[V$] = Vr[q$] = Vr[W$] = Vr[Z$] = Vr[Y$] = true; Vr[M$] = Vr[S$] = Vr[O$] = Vr[C$] = Vr[H$] = Vr[L$] = Vr[D$] = Vr[E$] = Vr[F$] = Vr[R$] = Vr[P$] = Vr[$$] = Vr[z$] = Vr[I$] = Vr[N$] = false; function X$(e10) { return wu(e10) && c1(e10.length) && !!Vr[Gu(e10)]; } function K$(e10) { return function(t) { return e10(t); }; } var C3 = typeof exports == "object" && exports && !exports.nodeType && exports; var Jf = C3 && typeof module == "object" && module && !module.nodeType && module; var J$ = Jf && Jf.exports === C3; var Lm = J$ && x3.process; var nw = function() { try { var e10 = Jf && Jf.require && Jf.require("util").types; return e10 || Lm && Lm.binding && Lm.binding("util"); } catch { } }(); var aw = nw && nw.isTypedArray; var L3 = aw ? K$(aw) : X$; var Q$ = Object.prototype; var ez = Q$.hasOwnProperty; function tz(e10, t) { var r = pi(e10), n = !r && d1(e10), a = !r && !n && G0(e10), i = !r && !n && !a && L3(e10), o = r || n || a || i, l = o ? b$(e10.length, String) : [], s = l.length; for (var u in e10) ez.call(e10, u) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. a && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. i && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties. u1(u, s))) && l.push(u); return l; } function rz(e10, t) { return function(r) { return e10(t(r)); }; } var nz = rz(Object.keys, Object); var az = Object.prototype; var iz = az.hasOwnProperty; function oz(e10) { if (!y$(e10)) return nz(e10); var t = []; for (var r in Object(e10)) iz.call(e10, r) && r != "constructor" && t.push(r); return t; } function D3(e10) { return m$(e10) ? tz(e10) : oz(e10); } var lz = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var sz = /^\w*$/; function h1(e10, t) { if (pi(e10)) return false; var r = typeof e10; return r == "number" || r == "symbol" || r == "boolean" || e10 == null || jv(e10) ? true : sz.test(e10) || !lz.test(e10) || t != null && e10 in Object(t); } var cc = hs(Object, "create"); function uz() { this.__data__ = cc ? cc(null) : {}, this.size = 0; } function fz(e10) { var t = this.has(e10) && delete this.__data__[e10]; return this.size -= t ? 1 : 0, t; } var cz = "__lodash_hash_undefined__"; var dz = Object.prototype; var hz = dz.hasOwnProperty; function vz(e10) { var t = this.__data__; if (cc) { var r = t[e10]; return r === cz ? void 0 : r; } return hz.call(t, e10) ? t[e10] : void 0; } var pz = Object.prototype; var mz = pz.hasOwnProperty; function gz(e10) { var t = this.__data__; return cc ? t[e10] !== void 0 : mz.call(t, e10); } var yz = "__lodash_hash_undefined__"; function bz(e10, t) { var r = this.__data__; return this.size += this.has(e10) ? 0 : 1, r[e10] = cc && t === void 0 ? yz : t, this; } function ns(e10) { var t = -1, r = e10 == null ? 0 : e10.length; for (this.clear(); ++t < r; ) { var n = e10[t]; this.set(n[0], n[1]); } } ns.prototype.clear = uz; ns.prototype.delete = fz; ns.prototype.get = vz; ns.prototype.has = gz; ns.prototype.set = bz; function _z() { this.__data__ = [], this.size = 0; } function Uv(e10, t) { for (var r = e10.length; r--; ) if (f1(e10[r][0], t)) return r; return -1; } var xz = Array.prototype; var wz = xz.splice; function Tz(e10) { var t = this.__data__, r = Uv(t, e10); if (r < 0) return false; var n = t.length - 1; return r == n ? t.pop() : wz.call(t, r, 1), --this.size, true; } function kz(e10) { var t = this.__data__, r = Uv(t, e10); return r < 0 ? void 0 : t[r][1]; } function Az(e10) { return Uv(this.__data__, e10) > -1; } function Mz(e10, t) { var r = this.__data__, n = Uv(r, e10); return n < 0 ? (++this.size, r.push([e10, t])) : r[n][1] = t, this; } function So(e10) { var t = -1, r = e10 == null ? 0 : e10.length; for (this.clear(); ++t < r; ) { var n = e10[t]; this.set(n[0], n[1]); } } So.prototype.clear = _z; So.prototype.delete = Tz; So.prototype.get = kz; So.prototype.has = Az; So.prototype.set = Mz; var dc = hs(qi, "Map"); function Sz() { this.size = 0, this.__data__ = { hash: new ns(), map: new (dc || So)(), string: new ns() }; } function Cz(e10) { var t = typeof e10; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e10 !== "__proto__" : e10 === null; } function Gv(e10, t) { var r = e10.__data__; return Cz(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map; } function Lz(e10) { var t = Gv(this, e10).delete(e10); return this.size -= t ? 1 : 0, t; } function Dz(e10) { return Gv(this, e10).get(e10); } function Ez(e10) { return Gv(this, e10).has(e10); } function Fz(e10, t) { var r = Gv(this, e10), n = r.size; return r.set(e10, t), this.size += r.size == n ? 0 : 1, this; } function Co(e10) { var t = -1, r = e10 == null ? 0 : e10.length; for (this.clear(); ++t < r; ) { var n = e10[t]; this.set(n[0], n[1]); } } Co.prototype.clear = Sz; Co.prototype.delete = Lz; Co.prototype.get = Dz; Co.prototype.has = Ez; Co.prototype.set = Fz; var Rz = "Expected a function"; function v1(e10, t) { if (typeof e10 != "function" || t != null && typeof t != "function") throw new TypeError(Rz); var r = function() { var n = arguments, a = t ? t.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = e10.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (v1.Cache || Co)(), r; } v1.Cache = Co; var Pz = 500; function $z(e10) { var t = v1(e10, function(n) { return r.size === Pz && r.clear(), n; }), r = t.cache; return t; } var zz = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var Iz = /\\(\\)?/g; var Nz = $z(function(e10) { var t = []; return e10.charCodeAt(0) === 46 && t.push(""), e10.replace(zz, function(r, n, a, i) { t.push(a ? i.replace(Iz, "$1") : n || r); }), t; }); function Oz(e10) { return e10 == null ? "" : T3(e10); } function Vv(e10, t) { return pi(e10) ? e10 : h1(e10, t) ? [e10] : Nz(Oz(e10)); } var Hz = 1 / 0; function Bc(e10) { if (typeof e10 == "string" || jv(e10)) return e10; var t = e10 + ""; return t == "0" && 1 / e10 == -Hz ? "-0" : t; } function p1(e10, t) { t = Vv(t, e10); for (var r = 0, n = t.length; e10 != null && r < n; ) e10 = e10[Bc(t[r++])]; return r && r == n ? e10 : void 0; } function ho(e10, t, r) { var n = e10 == null ? void 0 : p1(e10, t); return n === void 0 ? r : n; } function E3(e10, t) { for (var r = -1, n = t.length, a = e10.length; ++r < n; ) e10[a + r] = t[r]; return e10; } var iw = Ui ? Ui.isConcatSpreadable : void 0; function Bz(e10) { return pi(e10) || d1(e10) || !!(iw && e10 && e10[iw]); } function jz(e10, t, r, n, a) { var i = -1, o = e10.length; for (r || (r = Bz), a || (a = []); ++i < o; ) { var l = e10[i]; r(l) ? E3(a, l) : a[a.length] = l; } return a; } function Uz(e10) { var t = e10 == null ? 0 : e10.length; return t ? jz(e10) : []; } function Gz(e10) { return o$(v$(e10, void 0, Uz), e10 + ""); } function zi() { if (!arguments.length) return []; var e10 = arguments[0]; return pi(e10) ? e10 : [e10]; } function Vz() { this.__data__ = new So(), this.size = 0; } function qz(e10) { var t = this.__data__, r = t.delete(e10); return this.size = t.size, r; } function Wz(e10) { return this.__data__.get(e10); } function Zz(e10) { return this.__data__.has(e10); } var Yz = 200; function Xz(e10, t) { var r = this.__data__; if (r instanceof So) { var n = r.__data__; if (!dc || n.length < Yz - 1) return n.push([e10, t]), this.size = ++r.size, this; r = this.__data__ = new Co(n); } return r.set(e10, t), this.size = r.size, this; } function _o(e10) { var t = this.__data__ = new So(e10); this.size = t.size; } _o.prototype.clear = Vz; _o.prototype.delete = qz; _o.prototype.get = Wz; _o.prototype.has = Zz; _o.prototype.set = Xz; function Kz(e10, t) { for (var r = -1, n = e10 == null ? 0 : e10.length, a = 0, i = []; ++r < n; ) { var o = e10[r]; t(o, r, e10) && (i[a++] = o); } return i; } function Jz() { return []; } var Qz = Object.prototype; var eI = Qz.propertyIsEnumerable; var ow = Object.getOwnPropertySymbols; var tI = ow ? function(e10) { return e10 == null ? [] : (e10 = Object(e10), Kz(ow(e10), function(t) { return eI.call(e10, t); })); } : Jz; function rI(e10, t, r) { var n = t(e10); return pi(e10) ? n : E3(n, r(e10)); } function lw(e10) { return rI(e10, D3, tI); } var V0 = hs(qi, "DataView"); var q0 = hs(qi, "Promise"); var W0 = hs(qi, "Set"); var sw = "[object Map]"; var nI = "[object Object]"; var uw = "[object Promise]"; var fw = "[object Set]"; var cw = "[object WeakMap]"; var dw = "[object DataView]"; var aI = ds(V0); var iI = ds(dc); var oI = ds(q0); var lI = ds(W0); var sI = ds(U0); var Zo = Gu; (V0 && Zo(new V0(new ArrayBuffer(1))) != dw || dc && Zo(new dc()) != sw || q0 && Zo(q0.resolve()) != uw || W0 && Zo(new W0()) != fw || U0 && Zo(new U0()) != cw) && (Zo = function(e10) { var t = Gu(e10), r = t == nI ? e10.constructor : void 0, n = r ? ds(r) : ""; if (n) switch (n) { case aI: return dw; case iI: return sw; case oI: return uw; case lI: return fw; case sI: return cw; } return t; }); var hw = qi.Uint8Array; var uI = "__lodash_hash_undefined__"; function fI(e10) { return this.__data__.set(e10, uI), this; } function cI(e10) { return this.__data__.has(e10); } function Qh(e10) { var t = -1, r = e10 == null ? 0 : e10.length; for (this.__data__ = new Co(); ++t < r; ) this.add(e10[t]); } Qh.prototype.add = Qh.prototype.push = fI; Qh.prototype.has = cI; function dI(e10, t) { for (var r = -1, n = e10 == null ? 0 : e10.length; ++r < n; ) if (t(e10[r], r, e10)) return true; return false; } function hI(e10, t) { return e10.has(t); } var vI = 1; var pI = 2; function F3(e10, t, r, n, a, i) { var o = r & vI, l = e10.length, s = t.length; if (l != s && !(o && s > l)) return false; var u = i.get(e10), f = i.get(t); if (u && f) return u == t && f == e10; var d = -1, h = true, p = r & pI ? new Qh() : void 0; for (i.set(e10, t), i.set(t, e10); ++d < l; ) { var v = e10[d], m = t[d]; if (n) var g = o ? n(m, v, d, t, e10, i) : n(v, m, d, e10, t, i); if (g !== void 0) { if (g) continue; h = false; break; } if (p) { if (!dI(t, function(y, w) { if (!hI(p, w) && (v === y || a(v, y, r, n, i))) return p.push(w); })) { h = false; break; } } else if (!(v === m || a(v, m, r, n, i))) { h = false; break; } } return i.delete(e10), i.delete(t), h; } function mI(e10) { var t = -1, r = Array(e10.size); return e10.forEach(function(n, a) { r[++t] = [a, n]; }), r; } function gI(e10) { var t = -1, r = Array(e10.size); return e10.forEach(function(n) { r[++t] = n; }), r; } var yI = 1; var bI = 2; var _I = "[object Boolean]"; var xI = "[object Date]"; var wI = "[object Error]"; var TI = "[object Map]"; var kI = "[object Number]"; var AI = "[object RegExp]"; var MI = "[object Set]"; var SI = "[object String]"; var CI = "[object Symbol]"; var LI = "[object ArrayBuffer]"; var DI = "[object DataView]"; var vw = Ui ? Ui.prototype : void 0; var Dm = vw ? vw.valueOf : void 0; function EI(e10, t, r, n, a, i, o) { switch (r) { case DI: if (e10.byteLength != t.byteLength || e10.byteOffset != t.byteOffset) return false; e10 = e10.buffer, t = t.buffer; case LI: return !(e10.byteLength != t.byteLength || !i(new hw(e10), new hw(t))); case _I: case xI: case kI: return f1(+e10, +t); case wI: return e10.name == t.name && e10.message == t.message; case AI: case SI: return e10 == t + ""; case TI: var l = mI; case MI: var s = n & yI; if (l || (l = gI), e10.size != t.size && !s) return false; var u = o.get(e10); if (u) return u == t; n |= bI, o.set(e10, t); var f = F3(l(e10), l(t), n, a, i, o); return o.delete(e10), f; case CI: if (Dm) return Dm.call(e10) == Dm.call(t); } return false; } var FI = 1; var RI = Object.prototype; var PI = RI.hasOwnProperty; function $I(e10, t, r, n, a, i) { var o = r & FI, l = lw(e10), s = l.length, u = lw(t), f = u.length; if (s != f && !o) return false; for (var d = s; d--; ) { var h = l[d]; if (!(o ? h in t : PI.call(t, h))) return false; } var p = i.get(e10), v = i.get(t); if (p && v) return p == t && v == e10; var m = true; i.set(e10, t), i.set(t, e10); for (var g = o; ++d < s; ) { h = l[d]; var y = e10[h], w = t[h]; if (n) var k = o ? n(w, y, h, t, e10, i) : n(y, w, h, e10, t, i); if (!(k === void 0 ? y === w || a(y, w, r, n, i) : k)) { m = false; break; } g || (g = h == "constructor"); } if (m && !g) { var x = e10.constructor, _ = t.constructor; x != _ && "constructor" in e10 && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof _ == "function" && _ instanceof _) && (m = false); } return i.delete(e10), i.delete(t), m; } var zI = 1; var pw = "[object Arguments]"; var mw = "[object Array]"; var Ad = "[object Object]"; var II = Object.prototype; var gw = II.hasOwnProperty; function NI(e10, t, r, n, a, i) { var o = pi(e10), l = pi(t), s = o ? mw : Zo(e10), u = l ? mw : Zo(t); s = s == pw ? Ad : s, u = u == pw ? Ad : u; var f = s == Ad, d = u == Ad, h = s == u; if (h && G0(e10)) { if (!G0(t)) return false; o = true, f = false; } if (h && !f) return i || (i = new _o()), o || L3(e10) ? F3(e10, t, r, n, a, i) : EI(e10, t, s, r, n, a, i); if (!(r & zI)) { var p = f && gw.call(e10, "__wrapped__"), v = d && gw.call(t, "__wrapped__"); if (p || v) { var m = p ? e10.value() : e10, g = v ? t.value() : t; return i || (i = new _o()), a(m, g, r, n, i); } } return h ? (i || (i = new _o()), $I(e10, t, r, n, a, i)) : false; } function qv(e10, t, r, n, a) { return e10 === t ? true : e10 == null || t == null || !wu(e10) && !wu(t) ? e10 !== e10 && t !== t : NI(e10, t, r, n, qv, a); } var OI = 1; var HI = 2; function BI(e10, t, r, n) { var a = r.length, i = a; if (e10 == null) return !i; for (e10 = Object(e10); a--; ) { var o = r[a]; if (o[2] ? o[1] !== e10[o[0]] : !(o[0] in e10)) return false; } for (; ++a < i; ) { o = r[a]; var l = o[0], s = e10[l], u = o[1]; if (o[2]) { if (s === void 0 && !(l in e10)) return false; } else { var f = new _o(), d; if (!(d === void 0 ? qv(u, s, OI | HI, n, f) : d)) return false; } } return true; } function R3(e10) { return e10 === e10 && !ll(e10); } function jI(e10) { for (var t = D3(e10), r = t.length; r--; ) { var n = t[r], a = e10[n]; t[r] = [n, a, R3(a)]; } return t; } function P3(e10, t) { return function(r) { return r == null ? false : r[e10] === t && (t !== void 0 || e10 in Object(r)); }; } function UI(e10) { var t = jI(e10); return t.length == 1 && t[0][2] ? P3(t[0][0], t[0][1]) : function(r) { return r === e10 || BI(r, e10, t); }; } function GI(e10, t) { return e10 != null && t in Object(e10); } function VI(e10, t, r) { t = Vv(t, e10); for (var n = -1, a = t.length, i = false; ++n < a; ) { var o = Bc(t[n]); if (!(i = e10 != null && r(e10, o))) break; e10 = e10[o]; } return i || ++n != a ? i : (a = e10 == null ? 0 : e10.length, !!a && c1(a) && u1(o, a) && (pi(e10) || d1(e10))); } function $3(e10, t) { return e10 != null && VI(e10, t, GI); } var qI = 1; var WI = 2; function ZI(e10, t) { return h1(e10) && R3(t) ? P3(Bc(e10), t) : function(r) { var n = ho(r, e10); return n === void 0 && n === t ? $3(r, e10) : qv(t, n, qI | WI); }; } function YI(e10) { return function(t) { return t == null ? void 0 : t[e10]; }; } function XI(e10) { return function(t) { return p1(t, e10); }; } function KI(e10) { return h1(e10) ? YI(Bc(e10)) : XI(e10); } function JI(e10) { return typeof e10 == "function" ? e10 : e10 == null ? k3 : typeof e10 == "object" ? pi(e10) ? ZI(e10[0], e10[1]) : UI(e10) : KI(e10); } var Em = function() { return qi.Date.now(); }; var QI = "Expected a function"; var e7 = Math.max; var t7 = Math.min; function r7(e10, t, r) { var n, a, i, o, l, s, u = 0, f = false, d = false, h = true; if (typeof e10 != "function") throw new TypeError(QI); t = Kx(t) || 0, ll(r) && (f = !!r.leading, d = "maxWait" in r, i = d ? e7(Kx(r.maxWait) || 0, t) : i, h = "trailing" in r ? !!r.trailing : h); function p(T) { var S = n, M = a; return n = a = void 0, u = T, o = e10.apply(M, S), o; } function v(T) { return u = T, l = setTimeout(y, t), f ? p(T) : o; } function m(T) { var S = T - s, M = T - u, L = t - S; return d ? t7(L, i - M) : L; } function g(T) { var S = T - s, M = T - u; return s === void 0 || S >= t || S < 0 || d && M >= i; } function y() { var T = Em(); if (g(T)) return w(T); l = setTimeout(y, m(T)); } function w(T) { return l = void 0, h && n ? p(T) : (n = a = void 0, o); } function k() { l !== void 0 && clearTimeout(l), u = 0, n = s = a = l = void 0; } function x() { return l === void 0 ? o : w(Em()); } function _() { var T = Em(), S = g(T); if (n = arguments, a = this, s = T, S) { if (l === void 0) return v(s); if (d) return clearTimeout(l), l = setTimeout(y, t), p(s); } return l === void 0 && (l = setTimeout(y, t)), o; } return _.cancel = k, _.flush = x, _; } function n7(e10, t, r) { var n = e10 == null ? 0 : e10.length; if (!n) return -1; var a = n - 1; return l$(e10, JI(t), a); } function Z0(e10) { for (var t = -1, r = e10 == null ? 0 : e10.length, n = {}; ++t < r; ) { var a = e10[t]; n[a[0]] = a[1]; } return n; } function Y0(e10, t) { return qv(e10, t); } function m1(e10) { return e10 == null; } function a7(e10) { return e10 === void 0; } function i7(e10, t, r, n) { if (!ll(e10)) return e10; t = Vv(t, e10); for (var a = -1, i = t.length, o = i - 1, l = e10; l != null && ++a < i; ) { var s = Bc(t[a]), u = r; if (s === "__proto__" || s === "constructor" || s === "prototype") return e10; if (a != o) { var f = l[s]; u = void 0, u === void 0 && (u = ll(f) ? f : u1(t[a + 1]) ? [] : {}); } h$(l, s, u), l = l[s]; } return e10; } function o7(e10, t, r) { for (var n = -1, a = t.length, i = {}; ++n < a; ) { var o = t[n], l = p1(e10, o); r(l, o) && i7(i, Vv(o, e10), l); } return i; } function l7(e10, t) { return o7(e10, t, function(r, n) { return $3(e10, n); }); } var s7 = Gz(function(e10, t) { return e10 == null ? {} : l7(e10, t); }); var qf = (e10) => e10 === void 0; var g1 = (e10) => typeof e10 == "boolean"; var Ga = (e10) => typeof e10 == "number"; var Vl = (e10) => typeof Element > "u" ? false : e10 instanceof Element; var u7 = (e10) => Uu(e10) ? !Number.isNaN(Number(e10)) : false; var f7 = (e10 = "") => e10.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var z3 = class extends Error { constructor(t) { super(t), this.name = "ElementPlusError"; } }; function c7(e10, t) { throw new z3(`[${e10}] ${t}`); } function Gi(e10, t) { if (cs.env.NODE_ENV !== "production") { const r = Uu(e10) ? new z3(`[${e10}] ${t}`) : e10; console.warn(r); } } var d7 = "utils/dom/style"; function ev(e10, t = "px") { if (!e10) return ""; if (Ga(e10) || u7(e10)) return `${e10}${t}`; if (Uu(e10)) return e10; Gi(d7, "binding value must be a string or number"); } function h7(e10, t) { if (!qn) return; if (!t) { e10.scrollTop = 0; return; } const r = []; let n = t.offsetParent; for (; n !== null && e10 !== n && e10.contains(n); ) r.push(n), n = n.offsetParent; const a = t.offsetTop + r.reduce((s, u) => s + u.offsetTop, 0), i = a + t.offsetHeight, o = e10.scrollTop, l = o + e10.clientHeight; a < o ? e10.scrollTop = a : i > l && (e10.scrollTop = i - e10.clientHeight); } var v7 = defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }); var p7 = v7; var m7 = defineComponent({ name: "ArrowRight", __name: "arrow-right", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }); var g7 = m7; var y7 = defineComponent({ name: "CircleCheck", __name: "circle-check", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }); var b7 = y7; var _7 = defineComponent({ name: "CircleClose", __name: "circle-close", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }); var I3 = _7; var x7 = defineComponent({ name: "Close", __name: "close", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }); var yw = x7; var w7 = defineComponent({ name: "Loading", __name: "loading", setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }); var N3 = w7; var O3 = "__epPropKey"; var dr = (e10) => e10; var T7 = (e10) => Oi(e10) && !!e10[O3]; var Wv = (e10, t) => { if (!Oi(e10) || T7(e10)) return e10; const { values: r, required: n, default: a, type: i, validator: o } = e10, s = { type: i, required: !!n, validator: r || o ? (u) => { let f = false, d = []; if (r && (d = Array.from(r), qx(e10, "default") && d.push(a), f || (f = d.includes(u))), o && (f || (f = o(u))), !f && d.length > 0) { const h = [...new Set(d)].map((p) => JSON.stringify(p)).join(", "); warn(`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`); } return f; } : void 0, [O3]: true }; return qx(e10, "default") && (s.default = a), s; }; var qr = (e10) => Z0(Object.entries(e10).map(([t, r]) => [ t, Wv(r, t) ])); var Tu = dr([ String, Object, Function ]); var k7 = { validating: N3, success: b7, error: I3 }; var gi = (e10, t) => { if (e10.install = (r) => { for (const n of [e10, ...Object.values(t ?? {})]) r.component(n.name, n); }, t) for (const [r, n] of Object.entries(t)) e10[r] = n; return e10; }; var A7 = (e10, t) => (e10.install = (r) => { r.directive(t, e10); }, e10); var Zv = (e10) => (e10.install = Kh, e10); var hc = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var Ko = "update:modelValue"; var Yv = "change"; var H3 = ["", "default", "small", "large"]; var M7 = (e10) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e10); var S7 = (e10) => e10; var C7 = ({ from: e10, replacement: t, scope: r, version: n, ref: a, type: i = "API" }, o) => { watch(() => unref(o), (l) => { l && Gi(r, `[${i}] ${e10} is about to be deprecated in version ${n}, please use ${t} instead. For more detail, please visit: ${a} `); }, { immediate: true }); }; var L7 = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var D7 = (e10) => (t, r) => E7(t, r, unref(e10)); var E7 = (e10, t, r) => ho(r, e10, e10).replace(/\{(\w+)\}/g, (n, a) => { var i; return `${(i = t == null ? void 0 : t[a]) != null ? i : `{${a}}`}`; }); var F7 = (e10) => { const t = computed(() => unref(e10).name), r = isRef(e10) ? e10 : ref(e10); return { lang: t, locale: r, t: D7(e10) }; }; var R7 = Symbol("localeContextKey"); var P7 = (e10) => { const t = inject(R7, ref()); return F7(computed(() => t.value || L7)); }; var Fm = "el"; var $7 = "is-"; var Cl = (e10, t, r, n, a) => { let i = `${e10}-${t}`; return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i; }; var z7 = Symbol("namespaceContextKey"); var y1 = (e10) => { const t = getCurrentInstance() ? inject(z7, ref(Fm)) : ref(Fm); return computed(() => unref(t) || Fm); }; var on = (e10, t) => { const r = y1(); return { namespace: r, b: (m = "") => Cl(r.value, e10, m, "", ""), e: (m) => m ? Cl(r.value, e10, "", m, "") : "", m: (m) => m ? Cl(r.value, e10, "", "", m) : "", be: (m, g) => m && g ? Cl(r.value, e10, m, g, "") : "", em: (m, g) => m && g ? Cl(r.value, e10, "", m, g) : "", bm: (m, g) => m && g ? Cl(r.value, e10, m, "", g) : "", bem: (m, g, y) => m && g && y ? Cl(r.value, e10, m, g, y) : "", is: (m, ...g) => { const y = g.length >= 1 ? g[0] : true; return m && y ? `${$7}${m}` : ""; }, cssVar: (m) => { const g = {}; for (const y in m) m[y] && (g[`--${r.value}-${y}`] = m[y]); return g; }, cssVarName: (m) => `--${r.value}-${m}`, cssVarBlock: (m) => { const g = {}; for (const y in m) m[y] && (g[`--${r.value}-${e10}-${y}`] = m[y]); return g; }, cssVarBlockName: (m) => `--${r.value}-${e10}-${m}` }; }; var I7 = Wv({ type: dr(Boolean), default: null }); var N7 = Wv({ type: dr(Function) }); var O7 = (e10) => { const t = `update:${e10}`, r = `onUpdate:${e10}`, n = [t], a = { [e10]: I7, [r]: N7 }; return { useModelToggle: ({ indicator: o, toggleReason: l, shouldHideWhenRouteChanges: s, shouldProceed: u, onShow: f, onHide: d }) => { const h = getCurrentInstance(), { emit: p } = h, v = h.props, m = computed(() => ua(v[r])), g = computed(() => v[e10] === null), y = (S) => { o.value !== true && (o.value = true, l && (l.value = S), ua(f) && f(S)); }, w = (S) => { o.value !== false && (o.value = false, l && (l.value = S), ua(d) && d(S)); }, k = (S) => { if (v.disabled === true || ua(u) && !u()) return; const M = m.value && qn; M && p(t, true), (g.value || !M) && y(S); }, x = (S) => { if (v.disabled === true || !qn) return; const M = m.value && qn; M && p(t, false), (g.value || !M) && w(S); }, _ = (S) => { g1(S) && (v.disabled && S ? m.value && p(t, false) : o.value !== S && (S ? y() : w())); }, T = () => { o.value ? x() : k(); }; return watch(() => v[e10], _), s && h.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...h.proxy.$route }), () => { s.value && o.value && x(); }), onMounted(() => { _(v[e10]); }), { hide: x, show: k, toggle: T, hasUpdateHandler: m }; }, useModelToggleProps: a, useModelToggleEmits: n }; }; var B3 = (e10) => { const t = getCurrentInstance(); return computed(() => { var r, n; return (n = (r = t == null ? void 0 : t.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[e10]; }); }; var fa = "top"; var Wa = "bottom"; var Za = "right"; var ca = "left"; var b1 = "auto"; var jc = [fa, Wa, Za, ca]; var ku = "start"; var vc = "end"; var H7 = "clippingParents"; var j3 = "viewport"; var mf = "popper"; var B7 = "reference"; var bw = jc.reduce(function(e10, t) { return e10.concat([t + "-" + ku, t + "-" + vc]); }, []); var Xv = [].concat(jc, [b1]).reduce(function(e10, t) { return e10.concat([t, t + "-" + ku, t + "-" + vc]); }, []); var j7 = "beforeRead"; var U7 = "read"; var G7 = "afterRead"; var V7 = "beforeMain"; var q7 = "main"; var W7 = "afterMain"; var Z7 = "beforeWrite"; var Y7 = "write"; var X7 = "afterWrite"; var K7 = [j7, U7, G7, V7, q7, W7, Z7, Y7, X7]; function Vi(e10) { return e10 ? (e10.nodeName || "").toLowerCase() : null; } function yi(e10) { if (e10 == null) return window; if (e10.toString() !== "[object Window]") { var t = e10.ownerDocument; return t && t.defaultView || window; } return e10; } function Au(e10) { var t = yi(e10).Element; return e10 instanceof t || e10 instanceof Element; } function Va(e10) { var t = yi(e10).HTMLElement; return e10 instanceof t || e10 instanceof HTMLElement; } function _1(e10) { if (typeof ShadowRoot > "u") return false; var t = yi(e10).ShadowRoot; return e10 instanceof t || e10 instanceof ShadowRoot; } function J7(e10) { var t = e10.state; Object.keys(t.elements).forEach(function(r) { var n = t.styles[r] || {}, a = t.attributes[r] || {}, i = t.elements[r]; !Va(i) || !Vi(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) { var l = a[o]; l === false ? i.removeAttribute(o) : i.setAttribute(o, l === true ? "" : l); })); }); } function Q7(e10) { var t = e10.state, r = { popper: { position: t.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() { Object.keys(t.elements).forEach(function(n) { var a = t.elements[n], i = t.attributes[n] || {}, o = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : r[n]), l = o.reduce(function(s, u) { return s[u] = "", s; }, {}); !Va(a) || !Vi(a) || (Object.assign(a.style, l), Object.keys(i).forEach(function(s) { a.removeAttribute(s); })); }); }; } var U3 = { name: "applyStyles", enabled: true, phase: "write", fn: J7, effect: Q7, requires: ["computeStyles"] }; function Bi(e10) { return e10.split("-")[0]; } var ql = Math.max; var tv = Math.min; var Mu = Math.round; function Su(e10, t) { t === void 0 && (t = false); var r = e10.getBoundingClientRect(), n = 1, a = 1; if (Va(e10) && t) { var i = e10.offsetHeight, o = e10.offsetWidth; o > 0 && (n = Mu(r.width) / o || 1), i > 0 && (a = Mu(r.height) / i || 1); } return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a }; } function x1(e10) { var t = Su(e10), r = e10.offsetWidth, n = e10.offsetHeight; return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), { x: e10.offsetLeft, y: e10.offsetTop, width: r, height: n }; } function G3(e10, t) { var r = t.getRootNode && t.getRootNode(); if (e10.contains(t)) return true; if (r && _1(r)) { var n = t; do { if (n && e10.isSameNode(n)) return true; n = n.parentNode || n.host; } while (n); } return false; } function To(e10) { return yi(e10).getComputedStyle(e10); } function e9(e10) { return ["table", "td", "th"].indexOf(Vi(e10)) >= 0; } function vl(e10) { return ((Au(e10) ? e10.ownerDocument : e10.document) || window.document).documentElement; } function Kv(e10) { return Vi(e10) === "html" ? e10 : e10.assignedSlot || e10.parentNode || (_1(e10) ? e10.host : null) || vl(e10); } function _w(e10) { return !Va(e10) || To(e10).position === "fixed" ? null : e10.offsetParent; } function t9(e10) { var t = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Va(e10)) { var n = To(e10); if (n.position === "fixed") return null; } var a = Kv(e10); for (_1(a) && (a = a.host); Va(a) && ["html", "body"].indexOf(Vi(a)) < 0; ) { var i = To(a); if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || t && i.willChange === "filter" || t && i.filter && i.filter !== "none") return a; a = a.parentNode; } return null; } function Uc(e10) { for (var t = yi(e10), r = _w(e10); r && e9(r) && To(r).position === "static"; ) r = _w(r); return r && (Vi(r) === "html" || Vi(r) === "body" && To(r).position === "static") ? t : r || t9(e10) || t; } function w1(e10) { return ["top", "bottom"].indexOf(e10) >= 0 ? "x" : "y"; } function Qf(e10, t, r) { return ql(e10, tv(t, r)); } function r9(e10, t, r) { var n = Qf(e10, t, r); return n > r ? r : n; } function V3() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function q3(e10) { return Object.assign({}, V3(), e10); } function W3(e10, t) { return t.reduce(function(r, n) { return r[n] = e10, r; }, {}); } var n9 = function(e10, t) { return e10 = typeof e10 == "function" ? e10(Object.assign({}, t.rects, { placement: t.placement })) : e10, q3(typeof e10 != "number" ? e10 : W3(e10, jc)); }; function a9(e10) { var t, r = e10.state, n = e10.name, a = e10.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, l = Bi(r.placement), s = w1(l), u = [ca, Za].indexOf(l) >= 0, f = u ? "height" : "width"; if (!(!i || !o)) { var d = n9(a.padding, r), h = x1(i), p = s === "y" ? fa : ca, v = s === "y" ? Wa : Za, m = r.rects.reference[f] + r.rects.reference[s] - o[s] - r.rects.popper[f], g = o[s] - r.rects.reference[s], y = Uc(i), w = y ? s === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, k = m / 2 - g / 2, x = d[p], _ = w - h[f] - d[v], T = w / 2 - h[f] / 2 + k, S = Qf(x, T, _), M = s; r.modifiersData[n] = (t = {}, t[M] = S, t.centerOffset = S - T, t); } } function i9(e10) { var t = e10.state, r = e10.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n; a != null && (typeof a == "string" && (a = t.elements.popper.querySelector(a), !a) || !G3(t.elements.popper, a) || (t.elements.arrow = a)); } var o9 = { name: "arrow", enabled: true, phase: "main", fn: a9, effect: i9, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function Cu(e10) { return e10.split("-")[1]; } var l9 = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function s9(e10) { var t = e10.x, r = e10.y, n = window, a = n.devicePixelRatio || 1; return { x: Mu(t * a) / a || 0, y: Mu(r * a) / a || 0 }; } function xw(e10) { var t, r = e10.popper, n = e10.popperRect, a = e10.placement, i = e10.variation, o = e10.offsets, l = e10.position, s = e10.gpuAcceleration, u = e10.adaptive, f = e10.roundOffsets, d = e10.isFixed, h = o.x, p = h === void 0 ? 0 : h, v = o.y, m = v === void 0 ? 0 : v, g = typeof f == "function" ? f({ x: p, y: m }) : { x: p, y: m }; p = g.x, m = g.y; var y = o.hasOwnProperty("x"), w = o.hasOwnProperty("y"), k = ca, x = fa, _ = window; if (u) { var T = Uc(r), S = "clientHeight", M = "clientWidth"; if (T === yi(r) && (T = vl(r), To(T).position !== "static" && l === "absolute" && (S = "scrollHeight", M = "scrollWidth")), T = T, a === fa || (a === ca || a === Za) && i === vc) { x = Wa; var L = d && T === _ && _.visualViewport ? _.visualViewport.height : T[S]; m -= L - n.height, m *= s ? 1 : -1; } if (a === ca || (a === fa || a === Wa) && i === vc) { k = Za; var F = d && T === _ && _.visualViewport ? _.visualViewport.width : T[M]; p -= F - n.width, p *= s ? 1 : -1; } } var $ = Object.assign({ position: l }, u && l9), I = f === true ? s9({ x: p, y: m }) : { x: p, y: m }; if (p = I.x, m = I.y, s) { var O; return Object.assign({}, $, (O = {}, O[x] = w ? "0" : "", O[k] = y ? "0" : "", O.transform = (_.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + m + "px)" : "translate3d(" + p + "px, " + m + "px, 0)", O)); } return Object.assign({}, $, (t = {}, t[x] = w ? m + "px" : "", t[k] = y ? p + "px" : "", t.transform = "", t)); } function u9(e10) { var t = e10.state, r = e10.options, n = r.gpuAcceleration, a = n === void 0 ? true : n, i = r.adaptive, o = i === void 0 ? true : i, l = r.roundOffsets, s = l === void 0 ? true : l, u = { placement: Bi(t.placement), variation: Cu(t.placement), popper: t.elements.popper, popperRect: t.rects.popper, gpuAcceleration: a, isFixed: t.options.strategy === "fixed" }; t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, xw(Object.assign({}, u, { offsets: t.modifiersData.popperOffsets, position: t.options.strategy, adaptive: o, roundOffsets: s })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, xw(Object.assign({}, u, { offsets: t.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: s })))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement }); } var Z3 = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: u9, data: {} }; var Md = { passive: true }; function f9(e10) { var t = e10.state, r = e10.instance, n = e10.options, a = n.scroll, i = a === void 0 ? true : a, o = n.resize, l = o === void 0 ? true : o, s = yi(t.elements.popper), u = [].concat(t.scrollParents.reference, t.scrollParents.popper); return i && u.forEach(function(f) { f.addEventListener("scroll", r.update, Md); }), l && s.addEventListener("resize", r.update, Md), function() { i && u.forEach(function(f) { f.removeEventListener("scroll", r.update, Md); }), l && s.removeEventListener("resize", r.update, Md); }; } var Y3 = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: f9, data: {} }; var c9 = { left: "right", right: "left", bottom: "top", top: "bottom" }; function Eh(e10) { return e10.replace(/left|right|bottom|top/g, function(t) { return c9[t]; }); } var d9 = { start: "end", end: "start" }; function ww(e10) { return e10.replace(/start|end/g, function(t) { return d9[t]; }); } function T1(e10) { var t = yi(e10), r = t.pageXOffset, n = t.pageYOffset; return { scrollLeft: r, scrollTop: n }; } function k1(e10) { return Su(vl(e10)).left + T1(e10).scrollLeft; } function h9(e10) { var t = yi(e10), r = vl(e10), n = t.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, l = 0; return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, l = n.offsetTop)), { width: a, height: i, x: o + k1(e10), y: l }; } function v9(e10) { var t, r = vl(e10), n = T1(e10), a = (t = e10.ownerDocument) == null ? void 0 : t.body, i = ql(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = ql(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), l = -n.scrollLeft + k1(e10), s = -n.scrollTop; return To(a || r).direction === "rtl" && (l += ql(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: l, y: s }; } function A1(e10) { var t = To(e10), r = t.overflow, n = t.overflowX, a = t.overflowY; return /auto|scroll|overlay|hidden/.test(r + a + n); } function X3(e10) { return ["html", "body", "#document"].indexOf(Vi(e10)) >= 0 ? e10.ownerDocument.body : Va(e10) && A1(e10) ? e10 : X3(Kv(e10)); } function ec(e10, t) { var r; t === void 0 && (t = []); var n = X3(e10), a = n === ((r = e10.ownerDocument) == null ? void 0 : r.body), i = yi(n), o = a ? [i].concat(i.visualViewport || [], A1(n) ? n : []) : n, l = t.concat(o); return a ? l : l.concat(ec(Kv(o))); } function X0(e10) { return Object.assign({}, e10, { left: e10.x, top: e10.y, right: e10.x + e10.width, bottom: e10.y + e10.height }); } function p9(e10) { var t = Su(e10); return t.top = t.top + e10.clientTop, t.left = t.left + e10.clientLeft, t.bottom = t.top + e10.clientHeight, t.right = t.left + e10.clientWidth, t.width = e10.clientWidth, t.height = e10.clientHeight, t.x = t.left, t.y = t.top, t; } function Tw(e10, t) { return t === j3 ? X0(h9(e10)) : Au(t) ? p9(t) : X0(v9(vl(e10))); } function m9(e10) { var t = ec(Kv(e10)), r = ["absolute", "fixed"].indexOf(To(e10).position) >= 0, n = r && Va(e10) ? Uc(e10) : e10; return Au(n) ? t.filter(function(a) { return Au(a) && G3(a, n) && Vi(a) !== "body"; }) : []; } function g9(e10, t, r) { var n = t === "clippingParents" ? m9(e10) : [].concat(t), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(l, s) { var u = Tw(e10, s); return l.top = ql(u.top, l.top), l.right = tv(u.right, l.right), l.bottom = tv(u.bottom, l.bottom), l.left = ql(u.left, l.left), l; }, Tw(e10, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function K3(e10) { var t = e10.reference, r = e10.element, n = e10.placement, a = n ? Bi(n) : null, i = n ? Cu(n) : null, o = t.x + t.width / 2 - r.width / 2, l = t.y + t.height / 2 - r.height / 2, s; switch (a) { case fa: s = { x: o, y: t.y - r.height }; break; case Wa: s = { x: o, y: t.y + t.height }; break; case Za: s = { x: t.x + t.width, y: l }; break; case ca: s = { x: t.x - r.width, y: l }; break; default: s = { x: t.x, y: t.y }; } var u = a ? w1(a) : null; if (u != null) { var f = u === "y" ? "height" : "width"; switch (i) { case ku: s[u] = s[u] - (t[f] / 2 - r[f] / 2); break; case vc: s[u] = s[u] + (t[f] / 2 - r[f] / 2); break; } } return s; } function pc(e10, t) { t === void 0 && (t = {}); var r = t, n = r.placement, a = n === void 0 ? e10.placement : n, i = r.boundary, o = i === void 0 ? H7 : i, l = r.rootBoundary, s = l === void 0 ? j3 : l, u = r.elementContext, f = u === void 0 ? mf : u, d = r.altBoundary, h = d === void 0 ? false : d, p = r.padding, v = p === void 0 ? 0 : p, m = q3(typeof v != "number" ? v : W3(v, jc)), g = f === mf ? B7 : mf, y = e10.rects.popper, w = e10.elements[h ? g : f], k = g9(Au(w) ? w : w.contextElement || vl(e10.elements.popper), o, s), x = Su(e10.elements.reference), _ = K3({ reference: x, element: y, strategy: "absolute", placement: a }), T = X0(Object.assign({}, y, _)), S = f === mf ? T : x, M = { top: k.top - S.top + m.top, bottom: S.bottom - k.bottom + m.bottom, left: k.left - S.left + m.left, right: S.right - k.right + m.right }, L = e10.modifiersData.offset; if (f === mf && L) { var F = L[a]; Object.keys(M).forEach(function($) { var I = [Za, Wa].indexOf($) >= 0 ? 1 : -1, O = [fa, Wa].indexOf($) >= 0 ? "y" : "x"; M[$] += F[O] * I; }); } return M; } function y9(e10, t) { t === void 0 && (t = {}); var r = t, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, l = r.flipVariations, s = r.allowedAutoPlacements, u = s === void 0 ? Xv : s, f = Cu(n), d = f ? l ? bw : bw.filter(function(v) { return Cu(v) === f; }) : jc, h = d.filter(function(v) { return u.indexOf(v) >= 0; }); h.length === 0 && (h = d); var p = h.reduce(function(v, m) { return v[m] = pc(e10, { placement: m, boundary: a, rootBoundary: i, padding: o })[Bi(m)], v; }, {}); return Object.keys(p).sort(function(v, m) { return p[v] - p[m]; }); } function b9(e10) { if (Bi(e10) === b1) return []; var t = Eh(e10); return [ww(e10), t, ww(t)]; } function _9(e10) { var t = e10.state, r = e10.options, n = e10.name; if (!t.modifiersData[n]._skip) { for (var a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, l = o === void 0 ? true : o, s = r.fallbackPlacements, u = r.padding, f = r.boundary, d = r.rootBoundary, h = r.altBoundary, p = r.flipVariations, v = p === void 0 ? true : p, m = r.allowedAutoPlacements, g = t.options.placement, y = Bi(g), w = y === g, k = s || (w || !v ? [Eh(g)] : b9(g)), x = [g].concat(k).reduce(function(re, ae) { return re.concat(Bi(ae) === b1 ? y9(t, { placement: ae, boundary: f, rootBoundary: d, padding: u, flipVariations: v, allowedAutoPlacements: m }) : ae); }, []), _ = t.rects.reference, T = t.rects.popper, S = /* @__PURE__ */ new Map(), M = true, L = x[0], F = 0; F < x.length; F++) { var $ = x[F], I = Bi($), O = Cu($) === ku, G = [fa, Wa].indexOf(I) >= 0, K = G ? "width" : "height", V = pc(t, { placement: $, boundary: f, rootBoundary: d, altBoundary: h, padding: u }), z = G ? O ? Za : ca : O ? Wa : fa; _[K] > T[K] && (z = Eh(z)); var P = Eh(z), R = []; if (i && R.push(V[I] <= 0), l && R.push(V[z] <= 0, V[P] <= 0), R.every(function(re) { return re; })) { L = $, M = false; break; } S.set($, R); } if (M) for (var H = v ? 3 : 1, B = function(re) { var ae = x.find(function(Q) { var ue = S.get(Q); if (ue) return ue.slice(0, re).every(function(j) { return j; }); }); if (ae) return L = ae, "break"; }, W = H; W > 0; W--) { var ee = B(W); if (ee === "break") break; } t.placement !== L && (t.modifiersData[n]._skip = true, t.placement = L, t.reset = true); } } var x9 = { name: "flip", enabled: true, phase: "main", fn: _9, requiresIfExists: ["offset"], data: { _skip: false } }; function kw(e10, t, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: e10.top - t.height - r.y, right: e10.right - t.width + r.x, bottom: e10.bottom - t.height + r.y, left: e10.left - t.width - r.x }; } function Aw(e10) { return [fa, Za, Wa, ca].some(function(t) { return e10[t] >= 0; }); } function w9(e10) { var t = e10.state, r = e10.name, n = t.rects.reference, a = t.rects.popper, i = t.modifiersData.preventOverflow, o = pc(t, { elementContext: "reference" }), l = pc(t, { altBoundary: true }), s = kw(o, n), u = kw(l, a, i), f = Aw(s), d = Aw(u); t.modifiersData[r] = { referenceClippingOffsets: s, popperEscapeOffsets: u, isReferenceHidden: f, hasPopperEscaped: d }, t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-reference-hidden": f, "data-popper-escaped": d }); } var T9 = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: w9 }; function k9(e10, t, r) { var n = Bi(e10), a = [ca, fa].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, t, { placement: e10 })) : r, o = i[0], l = i[1]; return o = o || 0, l = (l || 0) * a, [ca, Za].indexOf(n) >= 0 ? { x: l, y: o } : { x: o, y: l }; } function A9(e10) { var t = e10.state, r = e10.options, n = e10.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Xv.reduce(function(f, d) { return f[d] = k9(d, t.rects, i), f; }, {}), l = o[t.placement], s = l.x, u = l.y; t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += s, t.modifiersData.popperOffsets.y += u), t.modifiersData[n] = o; } var M9 = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: A9 }; function S9(e10) { var t = e10.state, r = e10.name; t.modifiersData[r] = K3({ reference: t.rects.reference, element: t.rects.popper, strategy: "absolute", placement: t.placement }); } var J3 = { name: "popperOffsets", enabled: true, phase: "read", fn: S9, data: {} }; function C9(e10) { return e10 === "x" ? "y" : "x"; } function L9(e10) { var t = e10.state, r = e10.options, n = e10.name, a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, l = o === void 0 ? false : o, s = r.boundary, u = r.rootBoundary, f = r.altBoundary, d = r.padding, h = r.tether, p = h === void 0 ? true : h, v = r.tetherOffset, m = v === void 0 ? 0 : v, g = pc(t, { boundary: s, rootBoundary: u, padding: d, altBoundary: f }), y = Bi(t.placement), w = Cu(t.placement), k = !w, x = w1(y), _ = C9(x), T = t.modifiersData.popperOffsets, S = t.rects.reference, M = t.rects.popper, L = typeof m == "function" ? m(Object.assign({}, t.rects, { placement: t.placement })) : m, F = typeof L == "number" ? { mainAxis: L, altAxis: L } : Object.assign({ mainAxis: 0, altAxis: 0 }, L), $ = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, I = { x: 0, y: 0 }; if (T) { if (i) { var O, G = x === "y" ? fa : ca, K = x === "y" ? Wa : Za, V = x === "y" ? "height" : "width", z = T[x], P = z + g[G], R = z - g[K], H = p ? -M[V] / 2 : 0, B = w === ku ? S[V] : M[V], W = w === ku ? -M[V] : -S[V], ee = t.elements.arrow, re = p && ee ? x1(ee) : { width: 0, height: 0 }, ae = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : V3(), Q = ae[G], ue = ae[K], j = Qf(0, S[V], re[V]), U = k ? S[V] / 2 - H - j - Q - F.mainAxis : B - j - Q - F.mainAxis, Z = k ? -S[V] / 2 + H + j + ue + F.mainAxis : W + j + ue + F.mainAxis, le = t.elements.arrow && Uc(t.elements.arrow), J = le ? x === "y" ? le.clientTop || 0 : le.clientLeft || 0 : 0, pe = (O = $ == null ? void 0 : $[x]) != null ? O : 0, ge = z + U - pe - J, ve = z + Z - pe, me = Qf(p ? tv(P, ge) : P, z, p ? ql(R, ve) : R); T[x] = me, I[x] = me - z; } if (l) { var Le, ze = x === "x" ? fa : ca, Fe = x === "x" ? Wa : Za, Oe = T[_], Re = _ === "y" ? "height" : "width", We = Oe + g[ze], Me = Oe - g[Fe], Ve = [fa, ca].indexOf(y) !== -1, qe = (Le = $ == null ? void 0 : $[_]) != null ? Le : 0, Qe = Ve ? We : Oe - S[Re] - M[Re] - qe + F.altAxis, ot = Ve ? Oe + S[Re] + M[Re] - qe - F.altAxis : Me, ht = p && Ve ? r9(Qe, Oe, ot) : Qf(p ? Qe : We, Oe, p ? ot : Me); T[_] = ht, I[_] = ht - Oe; } t.modifiersData[n] = I; } } var D9 = { name: "preventOverflow", enabled: true, phase: "main", fn: L9, requiresIfExists: ["offset"] }; function E9(e10) { return { scrollLeft: e10.scrollLeft, scrollTop: e10.scrollTop }; } function F9(e10) { return e10 === yi(e10) || !Va(e10) ? T1(e10) : E9(e10); } function R9(e10) { var t = e10.getBoundingClientRect(), r = Mu(t.width) / e10.offsetWidth || 1, n = Mu(t.height) / e10.offsetHeight || 1; return r !== 1 || n !== 1; } function P9(e10, t, r) { r === void 0 && (r = false); var n = Va(t), a = Va(t) && R9(t), i = vl(t), o = Su(e10, a), l = { scrollLeft: 0, scrollTop: 0 }, s = { x: 0, y: 0 }; return (n || !n && !r) && ((Vi(t) !== "body" || A1(i)) && (l = F9(t)), Va(t) ? (s = Su(t, true), s.x += t.clientLeft, s.y += t.clientTop) : i && (s.x = k1(i))), { x: o.left + l.scrollLeft - s.x, y: o.top + l.scrollTop - s.y, width: o.width, height: o.height }; } function $9(e10) { var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = []; e10.forEach(function(i) { t.set(i.name, i); }); function a(i) { r.add(i.name); var o = [].concat(i.requires || [], i.requiresIfExists || []); o.forEach(function(l) { if (!r.has(l)) { var s = t.get(l); s && a(s); } }), n.push(i); } return e10.forEach(function(i) { r.has(i.name) || a(i); }), n; } function z9(e10) { var t = $9(e10); return K7.reduce(function(r, n) { return r.concat(t.filter(function(a) { return a.phase === n; })); }, []); } function I9(e10) { var t; return function() { return t || (t = new Promise(function(r) { Promise.resolve().then(function() { t = void 0, r(e10()); }); })), t; }; } function N9(e10) { var t = e10.reduce(function(r, n) { var a = r[n.name]; return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r; }, {}); return Object.keys(t).map(function(r) { return t[r]; }); } var Mw = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Sw() { for (var e10 = arguments.length, t = new Array(e10), r = 0; r < e10; r++) t[r] = arguments[r]; return !t.some(function(n) { return !(n && typeof n.getBoundingClientRect == "function"); }); } function M1(e10) { e10 === void 0 && (e10 = {}); var t = e10, r = t.defaultModifiers, n = r === void 0 ? [] : r, a = t.defaultOptions, i = a === void 0 ? Mw : a; return function(o, l, s) { s === void 0 && (s = i); var u = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Mw, i), modifiersData: {}, elements: { reference: o, popper: l }, attributes: {}, styles: {} }, f = [], d = false, h = { state: u, setOptions: function(m) { var g = typeof m == "function" ? m(u.options) : m; v(), u.options = Object.assign({}, i, u.options, g), u.scrollParents = { reference: Au(o) ? ec(o) : o.contextElement ? ec(o.contextElement) : [], popper: ec(l) }; var y = z9(N9([].concat(n, u.options.modifiers))); return u.orderedModifiers = y.filter(function(w) { return w.enabled; }), p(), h.update(); }, forceUpdate: function() { if (!d) { var m = u.elements, g = m.reference, y = m.popper; if (Sw(g, y)) { u.rects = { reference: P9(g, Uc(y), u.options.strategy === "fixed"), popper: x1(y) }, u.reset = false, u.placement = u.options.placement, u.orderedModifiers.forEach(function(M) { return u.modifiersData[M.name] = Object.assign({}, M.data); }); for (var w = 0; w < u.orderedModifiers.length; w++) { if (u.reset === true) { u.reset = false, w = -1; continue; } var k = u.orderedModifiers[w], x = k.fn, _ = k.options, T = _ === void 0 ? {} : _, S = k.name; typeof x == "function" && (u = x({ state: u, options: T, name: S, instance: h }) || u); } } } }, update: I9(function() { return new Promise(function(m) { h.forceUpdate(), m(u); }); }), destroy: function() { v(), d = true; } }; if (!Sw(o, l)) return h; h.setOptions(s).then(function(m) { !d && s.onFirstUpdate && s.onFirstUpdate(m); }); function p() { u.orderedModifiers.forEach(function(m) { var g = m.name, y = m.options, w = y === void 0 ? {} : y, k = m.effect; if (typeof k == "function") { var x = k({ state: u, name: g, instance: h, options: w }), _ = function() { }; f.push(x || _); } }); } function v() { f.forEach(function(m) { return m(); }), f = []; } return h; }; } M1(); var O9 = [Y3, J3, Z3, U3]; M1({ defaultModifiers: O9 }); var H9 = [Y3, J3, Z3, U3, M9, x9, D9, o9, T9]; var B9 = M1({ defaultModifiers: H9 }); var j9 = (e10, t, r = {}) => { const n = { name: "updateState", enabled: true, phase: "write", fn: ({ state: s }) => { const u = U9(s); Object.assign(o.value, u); }, requires: ["computeStyles"] }, a = computed(() => { const { onFirstUpdate: s, placement: u, strategy: f, modifiers: d } = unref(r); return { onFirstUpdate: s, placement: u || "bottom", strategy: f || "absolute", modifiers: [ ...d || [], n, { name: "applyStyles", enabled: false } ] }; }), i = shallowRef(), o = ref({ styles: { popper: { position: unref(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), l = () => { i.value && (i.value.destroy(), i.value = void 0); }; return watch(a, (s) => { const u = unref(i); u && u.setOptions(s); }, { deep: true }), watch([e10, t], ([s, u]) => { l(), !(!s || !u) && (i.value = B9(s, u, unref(a))); }), onBeforeUnmount(() => { l(); }), { state: computed(() => { var s; return { ...((s = unref(i)) == null ? void 0 : s.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var s; return (s = unref(i)) == null ? void 0 : s.update(); }, forceUpdate: () => { var s; return (s = unref(i)) == null ? void 0 : s.forceUpdate(); }, instanceRef: computed(() => unref(i)) }; }; function U9(e10) { const t = Object.keys(e10.elements), r = Z0(t.map((a) => [a, e10.styles[a] || {}])), n = Z0(t.map((a) => [a, e10.attributes[a]])); return { styles: r, attributes: n }; } function Cw() { let e10; const t = (n, a) => { r(), e10 = window.setTimeout(n, a); }, r = () => window.clearTimeout(e10); return Hv(() => r()), { registerTimeout: t, cancelTimeout: r }; } var K0 = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var G9 = Symbol("elIdInjection"); var S1 = () => getCurrentInstance() ? inject(G9, K0) : K0; var Jv = (e10) => { const t = S1(); !qn && t === K0 && Gi("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const r = y1(); return computed(() => unref(e10) || `${r.value}-id-${t.prefix}-${t.current++}`); }; var tu = []; var Lw = (e10) => { const t = e10; t.key === hc.esc && tu.forEach((r) => r(t)); }; var V9 = (e10) => { onMounted(() => { tu.length === 0 && document.addEventListener("keydown", Lw), qn && tu.push(e10); }), onBeforeUnmount(() => { tu = tu.filter((t) => t !== e10), tu.length === 0 && qn && document.removeEventListener("keydown", Lw); }); }; var Dw; var Q3 = () => { const e10 = y1(), t = S1(), r = computed(() => `${e10.value}-popper-container-${t.prefix}`), n = computed(() => `#${r.value}`); return { id: r, selector: n }; }; var q9 = (e10) => { const t = document.createElement("div"); return t.id = e10, document.body.appendChild(t), t; }; var W9 = () => { const { id: e10, selector: t } = Q3(); return onBeforeMount(() => { qn && (cs.env.NODE_ENV === "test" || !Dw || !document.body.querySelector(t.value)) && (Dw = q9(e10.value)); }), { id: e10, selector: t }; }; var Z9 = qr({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var Y9 = ({ showAfter: e10, hideAfter: t, autoClose: r, open: n, close: a }) => { const { registerTimeout: i } = Cw(), { registerTimeout: o, cancelTimeout: l } = Cw(); return { onOpen: (f) => { i(() => { n(f); const d = unref(r); Ga(d) && d > 0 && o(() => { a(f); }, d); }, unref(e10)); }, onClose: (f) => { l(), i(() => { a(f); }, unref(t)); } }; }; var e5 = Symbol("elForwardRef"); var X9 = (e10) => { provide(e5, { setForwardRef: (r) => { e10.value = r; } }); }; var K9 = (e10) => ({ mounted(t) { e10(t); }, updated(t) { e10(t); }, unmounted() { e10(null); } }); var Ew = { current: 0 }; var Fw = ref(0); var J9 = 2e3; var Rw = Symbol("elZIndexContextKey"); var Q9 = Symbol("zIndexContextKey"); var eN = (e10) => { const t = getCurrentInstance() ? inject(Rw, Ew) : Ew, r = getCurrentInstance() ? inject(Q9, void 0) : void 0, n = computed(() => { const o = unref(r); return Ga(o) ? o : J9; }), a = computed(() => n.value + Fw.value), i = () => (t.current++, Fw.value = t.current, a.value); return !qn && !inject(Rw) && Gi("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: n, currentZIndex: a, nextZIndex: i }; }; var t5 = Wv({ type: String, values: H3, required: false }); var tN = Symbol("size"); var rN = () => { const e10 = inject(tN, {}); return computed(() => unref(e10.size) || ""); }; function nN(e10, { beforeFocus: t, afterFocus: r, beforeBlur: n, afterBlur: a } = {}) { const i = getCurrentInstance(), { emit: o } = i, l = shallowRef(), s = ref(false), u = (h) => { ua(t) && t(h) || s.value || (s.value = true, o("focus", h), r == null || r()); }, f = (h) => { var p; ua(n) && n(h) || h.relatedTarget && ((p = l.value) != null && p.contains(h.relatedTarget)) || (s.value = false, o("blur", h), a == null || a()); }, d = () => { var h, p; (h = l.value) != null && h.contains(document.activeElement) && l.value !== document.activeElement || (p = e10.value) == null || p.focus(); }; return watch(l, (h) => { h && h.setAttribute("tabindex", "-1"); }), ui(l, "focus", u, true), ui(l, "blur", f, true), ui(l, "click", d, true), cs.env.NODE_ENV === "test" && onMounted(() => { const h = Vl(e10.value) ? e10.value : document.querySelector("input,textarea"); h && (ui(h, "focus", u, true), ui(h, "blur", f, true)); }), { isFocused: s, wrapperRef: l, handleFocus: u, handleBlur: f }; } function aN({ afterComposition: e10, emit: t }) { const r = ref(false), n = (l) => { t == null || t("compositionstart", l), r.value = true; }, a = (l) => { var s; t == null || t("compositionupdate", l); const u = (s = l.target) == null ? void 0 : s.value, f = u[u.length - 1] || ""; r.value = !M7(f); }, i = (l) => { t == null || t("compositionend", l), r.value && (r.value = false, nextTick(() => e10(l))); }; return { isComposing: r, handleComposition: (l) => { l.type === "compositionend" ? i(l) : a(l); }, handleCompositionStart: n, handleCompositionUpdate: a, handleCompositionEnd: i }; } var iN = Symbol("emptyValuesContextKey"); var oN = "use-empty-values"; var lN = ["", void 0, null]; var sN = void 0; var uN = qr({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (e10) => ua(e10) ? !e10() : !e10 } }); var fN = (e10, t) => { const r = getCurrentInstance() ? inject(iN, ref({})) : ref({}), n = computed(() => e10.emptyValues || r.value.emptyValues || lN), a = computed(() => ua(e10.valueOnClear) ? e10.valueOnClear() : e10.valueOnClear !== void 0 ? e10.valueOnClear : ua(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : sN), i = (o) => n.value.includes(o); return n.value.includes(a.value) || Gi(oN, "value-on-clear should be a value of empty-values"), { emptyValues: n, valueOnClear: a, isEmptyValue: i }; }; var cN = qr({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var Qv = (e10) => s7(cN, e10); var dN = Symbol(); var Pw = ref(); function hN(e10, t = void 0) { const r = getCurrentInstance() ? inject(dN, Pw) : Pw; return computed(() => { var n, a; return (a = (n = r.value) == null ? void 0 : n[e10]) != null ? a : t; }); } var jr = (e10, t) => { const r = e10.__vccOpts || e10; for (const [n, a] of t) r[n] = a; return r; }; var vN = qr({ size: { type: dr([Number, String]) }, color: { type: String } }); var pN = defineComponent({ name: "ElIcon", inheritAttrs: false }); var mN = defineComponent({ ...pN, props: vN, setup(e10) { const t = e10, r = on("icon"), n = computed(() => { const { size: a, color: i } = t; return !a && !i ? {} : { fontSize: qf(a) ? void 0 : ev(a), "--color": i }; }); return (a, i) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(r).b(), style: unref(n) }, a.$attrs), [ renderSlot(a.$slots, "default") ], 16)); } }); var gN = jr(mN, [["__file", "icon.vue"]]); var Lu = gi(gN); var C1 = Symbol("formContextKey"); var rv = Symbol("formItemContextKey"); var L1 = (e10, t = {}) => { const r = ref(void 0), n = t.prop ? r : B3("size"), a = t.global ? r : rN(), i = t.form ? { size: void 0 } : inject(C1, void 0), o = t.formItem ? { size: void 0 } : inject(rv, void 0); return computed(() => n.value || unref(e10) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }; var r5 = (e10) => { const t = B3("disabled"), r = inject(C1, void 0); return computed(() => t.value || unref(e10) || (r == null ? void 0 : r.disabled) || false); }; var n5 = () => { const e10 = inject(C1, void 0), t = inject(rv, void 0); return { form: e10, formItem: t }; }; var yN = (e10, { formItemContext: t, disableIdGeneration: r, disableIdManagement: n }) => { r || (r = ref(false)), n || (n = ref(false)); const a = ref(); let i; const o = computed(() => { var l; return !!(!(e10.label || e10.ariaLabel) && t && t.inputIds && ((l = t.inputIds) == null ? void 0 : l.length) <= 1); }); return onMounted(() => { i = watch([toRef(e10, "id"), r], ([l, s]) => { const u = l ?? (s ? void 0 : Jv().value); u !== a.value && (t != null && t.removeInputId && (a.value && t.removeInputId(a.value), !(n != null && n.value) && !s && u && t.addInputId(u)), a.value = u); }, { immediate: true }); }), onUnmounted(() => { i && i(), t != null && t.removeInputId && a.value && t.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }; var Es = 4; var bN = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var _N = ({ move: e10, size: t, bar: r }) => ({ [r.size]: t, transform: `translate${r.axis}(${e10}%)` }); var D1 = Symbol("scrollbarContextKey"); var xN = qr({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var wN = "Thumb"; var TN = defineComponent({ __name: "thumb", props: xN, setup(e10) { const t = e10, r = inject(D1), n = on("scrollbar"); r || c7(wN, "can not inject scrollbar context"); const a = ref(), i = ref(), o = ref({}), l = ref(false); let s = false, u = false, f = qn ? document.onselectstart : null; const d = computed(() => bN[t.vertical ? "vertical" : "horizontal"]), h = computed(() => _N({ size: t.size, move: t.move, bar: d.value })), p = computed(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / t.ratio / i.value[d.value.offset]), v = (T) => { var S; if (T.stopPropagation(), T.ctrlKey || [1, 2].includes(T.button)) return; (S = window.getSelection()) == null || S.removeAllRanges(), g(T); const M = T.currentTarget; M && (o.value[d.value.axis] = M[d.value.offset] - (T[d.value.client] - M.getBoundingClientRect()[d.value.direction])); }, m = (T) => { if (!i.value || !a.value || !r.wrapElement) return; const S = Math.abs(T.target.getBoundingClientRect()[d.value.direction] - T[d.value.client]), M = i.value[d.value.offset] / 2, L = (S - M) * 100 * p.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = L * r.wrapElement[d.value.scrollSize] / 100; }, g = (T) => { T.stopImmediatePropagation(), s = true, document.addEventListener("mousemove", y), document.addEventListener("mouseup", w), f = document.onselectstart, document.onselectstart = () => false; }, y = (T) => { if (!a.value || !i.value || s === false) return; const S = o.value[d.value.axis]; if (!S) return; const M = (a.value.getBoundingClientRect()[d.value.direction] - T[d.value.client]) * -1, L = i.value[d.value.offset] - S, F = (M - L) * 100 * p.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = F * r.wrapElement[d.value.scrollSize] / 100; }, w = () => { s = false, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", w), _(), u && (l.value = false); }, k = () => { u = false, l.value = !!t.size; }, x = () => { u = true, l.value = s; }; onBeforeUnmount(() => { _(), document.removeEventListener("mouseup", w); }); const _ = () => { document.onselectstart !== f && (document.onselectstart = f); }; return ui(toRef(r, "scrollbarElement"), "mousemove", k), ui(toRef(r, "scrollbarElement"), "mouseleave", x), (T, S) => (openBlock(), createBlock(Transition, { name: unref(n).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: a, class: normalizeClass([unref(n).e("bar"), unref(n).is(unref(d).key)]), onMousedown: m }, [ createBaseVNode("div", { ref_key: "thumb", ref: i, class: normalizeClass(unref(n).e("thumb")), style: normalizeStyle(unref(h)), onMousedown: v }, null, 38) ], 34), [ [vShow, T.always || l.value] ]) ]), _: 1 }, 8, ["name"])); } }); var $w = jr(TN, [["__file", "thumb.vue"]]); var kN = qr({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var AN = defineComponent({ __name: "bar", props: kN, setup(e10, { expose: t }) { const r = e10, n = inject(D1), a = ref(0), i = ref(0), o = ref(""), l = ref(""), s = ref(1), u = ref(1); return t({ handleScroll: (h) => { if (h) { const p = h.offsetHeight - Es, v = h.offsetWidth - Es; i.value = h.scrollTop * 100 / p * s.value, a.value = h.scrollLeft * 100 / v * u.value; } }, update: () => { const h = n == null ? void 0 : n.wrapElement; if (!h) return; const p = h.offsetHeight - Es, v = h.offsetWidth - Es, m = p ** 2 / h.scrollHeight, g = v ** 2 / h.scrollWidth, y = Math.max(m, r.minSize), w = Math.max(g, r.minSize); s.value = m / (p - m) / (y / (p - y)), u.value = g / (v - g) / (w / (v - w)), l.value = y + Es < p ? `${y}px` : "", o.value = w + Es < v ? `${w}px` : ""; } }), (h, p) => (openBlock(), createElementBlock(Fragment, null, [ createVNode($w, { move: a.value, ratio: u.value, size: o.value, always: h.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode($w, { move: i.value, ratio: s.value, size: l.value, vertical: "", always: h.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var MN = jr(AN, [["__file", "bar.vue"]]); var SN = qr({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: dr([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Qv(["ariaLabel", "ariaOrientation"]) }); var CN = { scroll: ({ scrollTop: e10, scrollLeft: t }) => [e10, t].every(Ga) }; var J0 = "ElScrollbar"; var LN = defineComponent({ name: J0 }); var DN = defineComponent({ ...LN, props: SN, emits: CN, setup(e10, { expose: t, emit: r }) { const n = e10, a = on("scrollbar"); let i, o, l = 0, s = 0; const u = ref(), f = ref(), d = ref(), h = ref(), p = computed(() => { const _ = {}; return n.height && (_.height = ev(n.height)), n.maxHeight && (_.maxHeight = ev(n.maxHeight)), [n.wrapStyle, _]; }), v = computed(() => [ n.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !n.native } ]), m = computed(() => [a.e("view"), n.viewClass]), g = () => { var _; f.value && ((_ = h.value) == null || _.handleScroll(f.value), l = f.value.scrollTop, s = f.value.scrollLeft, r("scroll", { scrollTop: f.value.scrollTop, scrollLeft: f.value.scrollLeft })); }; function y(_, T) { Oi(_) ? f.value.scrollTo(_) : Ga(_) && Ga(T) && f.value.scrollTo(_, T); } const w = (_) => { if (!Ga(_)) { Gi(J0, "value must be a number"); return; } f.value.scrollTop = _; }, k = (_) => { if (!Ga(_)) { Gi(J0, "value must be a number"); return; } f.value.scrollLeft = _; }, x = () => { var _; (_ = h.value) == null || _.update(); }; return watch(() => n.noresize, (_) => { _ ? (i == null || i(), o == null || o()) : ({ stop: i } = Wo(d, x), o = ui("resize", x)); }, { immediate: true }), watch(() => [n.maxHeight, n.height], () => { n.native || nextTick(() => { var _; x(), f.value && ((_ = h.value) == null || _.handleScroll(f.value)); }); }), provide(D1, reactive({ scrollbarElement: u, wrapElement: f })), onActivated(() => { f.value && (f.value.scrollTop = l, f.value.scrollLeft = s); }), onMounted(() => { n.native || nextTick(() => { x(); }); }), onUpdated(() => x()), t({ wrapRef: f, update: x, scrollTo: y, setScrollTop: w, setScrollLeft: k, handleScroll: g }), (_, T) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: u, class: normalizeClass(unref(a).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: f, class: normalizeClass(unref(v)), style: normalizeStyle(unref(p)), tabindex: _.tabindex, onScroll: g }, [ (openBlock(), createBlock(resolveDynamicComponent(_.tag), { id: _.id, ref_key: "resizeRef", ref: d, class: normalizeClass(unref(m)), style: normalizeStyle(_.viewStyle), role: _.role, "aria-label": _.ariaLabel, "aria-orientation": _.ariaOrientation }, { default: withCtx(() => [ renderSlot(_.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), _.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(MN, { key: 0, ref_key: "barRef", ref: h, always: _.always, "min-size": _.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var EN = jr(DN, [["__file", "scrollbar.vue"]]); var FN = gi(EN); var E1 = Symbol("popper"); var a5 = Symbol("popperContent"); var RN = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var i5 = qr({ role: { type: String, values: RN, default: "tooltip" } }); var PN = defineComponent({ name: "ElPopper", inheritAttrs: false }); var $N = defineComponent({ ...PN, props: i5, setup(e10, { expose: t }) { const r = e10, n = ref(), a = ref(), i = ref(), o = ref(), l = computed(() => r.role), s = { triggerRef: n, popperInstanceRef: a, contentRef: i, referenceRef: o, role: l }; return t(s), provide(E1, s), (u, f) => renderSlot(u.$slots, "default"); } }); var zN = jr($N, [["__file", "popper.vue"]]); var o5 = qr({ arrowOffset: { type: Number, default: 5 } }); var IN = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var NN = defineComponent({ ...IN, props: o5, setup(e10, { expose: t }) { const r = e10, n = on("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = inject(a5, void 0); return watch(() => r.arrowOffset, (l) => { a.value = l; }), onBeforeUnmount(() => { i.value = void 0; }), t({ arrowRef: i }), (l, s) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: i, class: normalizeClass(unref(n).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var ON = jr(NN, [["__file", "arrow.vue"]]); var Rm = "ElOnlyChild"; var HN = defineComponent({ name: Rm, setup(e10, { slots: t, attrs: r }) { var n; const a = inject(e5), i = K9((n = a == null ? void 0 : a.setForwardRef) != null ? n : Kh); return () => { var o; const l = (o = t.default) == null ? void 0 : o.call(t, r); if (!l) return null; if (l.length > 1) return Gi(Rm, "requires exact only one valid child."), null; const s = l5(l); return s ? withDirectives(cloneVNode(s, r), [[i]]) : (Gi(Rm, "no valid child node found"), null); }; } }); function l5(e10) { if (!e10) return null; const t = e10; for (const r of t) { if (Oi(r)) switch (r.type) { case Comment: continue; case Text: case "svg": return zw(r); case Fragment: return l5(r.children); default: return r; } return zw(r); } return null; } function zw(e10) { const t = on("only-child"); return createVNode("span", { class: t.e("content") }, [e10]); } var s5 = qr({ virtualRef: { type: dr(Object) }, virtualTriggering: Boolean, onMouseenter: { type: dr(Function) }, onMouseleave: { type: dr(Function) }, onClick: { type: dr(Function) }, onKeydown: { type: dr(Function) }, onFocus: { type: dr(Function) }, onBlur: { type: dr(Function) }, onContextmenu: { type: dr(Function) }, id: String, open: Boolean }); var BN = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var jN = defineComponent({ ...BN, props: s5, setup(e10, { expose: t }) { const r = e10, { role: n, triggerRef: a } = inject(E1, void 0); X9(a); const i = computed(() => l.value ? r.id : void 0), o = computed(() => { if (n && n.value === "tooltip") return r.open && r.id ? r.id : void 0; }), l = computed(() => { if (n && n.value !== "tooltip") return n.value; }), s = computed(() => l.value ? `${r.open}` : void 0); let u; const f = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => r.virtualRef, (d) => { d && (a.value = mo(d)); }, { immediate: true }), watch(a, (d, h) => { u == null || u(), u = void 0, Vl(d) && (f.forEach((p) => { var v; const m = r[p]; m && (d.addEventListener(p.slice(2).toLowerCase(), m), (v = h == null ? void 0 : h.removeEventListener) == null || v.call(h, p.slice(2).toLowerCase(), m)); }), u = watch([i, o, l, s], (p) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((v, m) => { m1(p[m]) ? d.removeAttribute(v) : d.setAttribute(v, p[m]); }); }, { immediate: true })), Vl(h) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((p) => h.removeAttribute(p)); }, { immediate: true }); }), onBeforeUnmount(() => { if (u == null || u(), u = void 0, a.value && Vl(a.value)) { const d = a.value; f.forEach((h) => { const p = r[h]; p && d.removeEventListener(h.slice(2).toLowerCase(), p); }), a.value = void 0; } }), t({ triggerRef: a }), (d, h) => d.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(HN), mergeProps({ key: 0 }, d.$attrs, { "aria-controls": unref(i), "aria-describedby": unref(o), "aria-expanded": unref(s), "aria-haspopup": unref(l) }), { default: withCtx(() => [ renderSlot(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var UN = jr(jN, [["__file", "trigger.vue"]]); var Pm = "focus-trap.focus-after-trapped"; var $m = "focus-trap.focus-after-released"; var GN = "focus-trap.focusout-prevented"; var Iw = { cancelable: true, bubbles: false }; var VN = { cancelable: true, bubbles: false }; var Nw = "focusAfterTrapped"; var Ow = "focusAfterReleased"; var qN = Symbol("elFocusTrap"); var F1 = ref(); var ep = ref(0); var R1 = ref(0); var Sd = 0; var u5 = (e10) => { const t = [], r = document.createTreeWalker(e10, NodeFilter.SHOW_ELEMENT, { acceptNode: (n) => { const a = n.tagName === "INPUT" && n.type === "hidden"; return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) t.push(r.currentNode); return t; }; var Hw = (e10, t) => { for (const r of e10) if (!WN(r, t)) return r; }; var WN = (e10, t) => { if (cs.env.NODE_ENV === "test") return false; if (getComputedStyle(e10).visibility === "hidden") return true; for (; e10; ) { if (t && e10 === t) return false; if (getComputedStyle(e10).display === "none") return true; e10 = e10.parentElement; } return false; }; var ZN = (e10) => { const t = u5(e10), r = Hw(t, e10), n = Hw(t.reverse(), e10); return [r, n]; }; var YN = (e10) => e10 instanceof HTMLInputElement && "select" in e10; var jo = (e10, t) => { if (e10 && e10.focus) { const r = document.activeElement; e10.focus({ preventScroll: true }), R1.value = window.performance.now(), e10 !== r && YN(e10) && t && e10.select(); } }; function Bw(e10, t) { const r = [...e10], n = e10.indexOf(t); return n !== -1 && r.splice(n, 1), r; } var XN = () => { let e10 = []; return { push: (n) => { const a = e10[0]; a && n !== a && a.pause(), e10 = Bw(e10, n), e10.unshift(n); }, remove: (n) => { var a, i; e10 = Bw(e10, n), (i = (a = e10[0]) == null ? void 0 : a.resume) == null || i.call(a); } }; }; var KN = (e10, t = false) => { const r = document.activeElement; for (const n of e10) if (jo(n, t), document.activeElement !== r) return; }; var jw = XN(); var JN = () => ep.value > R1.value; var Cd = () => { F1.value = "pointer", ep.value = window.performance.now(); }; var Uw = () => { F1.value = "keyboard", ep.value = window.performance.now(); }; var QN = () => (onMounted(() => { Sd === 0 && (document.addEventListener("mousedown", Cd), document.addEventListener("touchstart", Cd), document.addEventListener("keydown", Uw)), Sd++; }), onBeforeUnmount(() => { Sd--, Sd <= 0 && (document.removeEventListener("mousedown", Cd), document.removeEventListener("touchstart", Cd), document.removeEventListener("keydown", Uw)); }), { focusReason: F1, lastUserFocusTimestamp: ep, lastAutomatedFocusTimestamp: R1 }); var Ld = (e10) => new CustomEvent(GN, { ...VN, detail: e10 }); var eO = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ Nw, Ow, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(e10, { emit: t }) { const r = ref(); let n, a; const { focusReason: i } = QN(); V9((v) => { e10.trapped && !o.paused && t("release-requested", v); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, l = (v) => { if (!e10.loop && !e10.trapped || o.paused) return; const { key: m, altKey: g, ctrlKey: y, metaKey: w, currentTarget: k, shiftKey: x } = v, { loop: _ } = e10, T = m === hc.tab && !g && !y && !w, S = document.activeElement; if (T && S) { const M = k, [L, F] = ZN(M); if (L && F) { if (!x && S === F) { const I = Ld({ focusReason: i.value }); t("focusout-prevented", I), I.defaultPrevented || (v.preventDefault(), _ && jo(L, true)); } else if (x && [L, M].includes(S)) { const I = Ld({ focusReason: i.value }); t("focusout-prevented", I), I.defaultPrevented || (v.preventDefault(), _ && jo(F, true)); } } else if (S === M) { const I = Ld({ focusReason: i.value }); t("focusout-prevented", I), I.defaultPrevented || v.preventDefault(); } } }; provide(qN, { focusTrapRef: r, onKeydown: l }), watch(() => e10.focusTrapEl, (v) => { v && (r.value = v); }, { immediate: true }), watch([r], ([v], [m]) => { v && (v.addEventListener("keydown", l), v.addEventListener("focusin", f), v.addEventListener("focusout", d)), m && (m.removeEventListener("keydown", l), m.removeEventListener("focusin", f), m.removeEventListener("focusout", d)); }); const s = (v) => { t(Nw, v); }, u = (v) => t(Ow, v), f = (v) => { const m = unref(r); if (!m) return; const g = v.target, y = v.relatedTarget, w = g && m.contains(g); e10.trapped || y && m.contains(y) || (n = y), w && t("focusin", v), !o.paused && e10.trapped && (w ? a = g : jo(a, true)); }, d = (v) => { const m = unref(r); if (!(o.paused || !m)) if (e10.trapped) { const g = v.relatedTarget; !m1(g) && !m.contains(g) && setTimeout(() => { if (!o.paused && e10.trapped) { const y = Ld({ focusReason: i.value }); t("focusout-prevented", y), y.defaultPrevented || jo(a, true); } }, 0); } else { const g = v.target; g && m.contains(g) || t("focusout", v); } }; async function h() { await nextTick(); const v = unref(r); if (v) { jw.push(o); const m = v.contains(document.activeElement) ? n : document.activeElement; if (n = m, !v.contains(m)) { const y = new Event(Pm, Iw); v.addEventListener(Pm, s), v.dispatchEvent(y), y.defaultPrevented || nextTick(() => { let w = e10.focusStartEl; Uu(w) || (jo(w), document.activeElement !== w && (w = "first")), w === "first" && KN(u5(v), true), (document.activeElement === m || w === "container") && jo(v); }); } } } function p() { const v = unref(r); if (v) { v.removeEventListener(Pm, s); const m = new CustomEvent($m, { ...Iw, detail: { focusReason: i.value } }); v.addEventListener($m, u), v.dispatchEvent(m), !m.defaultPrevented && (i.value == "keyboard" || !JN() || v.contains(document.activeElement)) && jo(n ?? document.body), v.removeEventListener($m, u), jw.remove(o); } } return onMounted(() => { e10.trapped && h(), watch(() => e10.trapped, (v) => { v ? h() : p(); }); }), onBeforeUnmount(() => { e10.trapped && p(), r.value && (r.value.removeEventListener("keydown", l), r.value.removeEventListener("focusin", f), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: l }; } }); function tO(e10, t, r, n, a, i) { return renderSlot(e10.$slots, "default", { handleKeydown: e10.onKeydown }); } var rO = jr(eO, [["render", tO], ["__file", "focus-trap.vue"]]); var nO = ["fixed", "absolute"]; var aO = qr({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: dr(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Xv, default: "bottom" }, popperOptions: { type: dr(Object), default: () => ({}) }, strategy: { type: String, values: nO, default: "absolute" } }); var f5 = qr({ ...aO, id: String, style: { type: dr([String, Array, Object]) }, className: { type: dr([String, Array, Object]) }, effect: { type: dr(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: dr([String, Array, Object]) }, popperStyle: { type: dr([String, Array, Object]) }, referenceEl: { type: dr(Object) }, triggerTargetEl: { type: dr(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...Qv(["ariaLabel"]) }); var iO = { mouseenter: (e10) => e10 instanceof MouseEvent, mouseleave: (e10) => e10 instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var oO = (e10, t = []) => { const { placement: r, strategy: n, popperOptions: a } = e10, i = { placement: r, strategy: n, ...a, modifiers: [...sO(e10), ...t] }; return uO(i, a == null ? void 0 : a.modifiers), i; }; var lO = (e10) => { if (qn) return mo(e10); }; function sO(e10) { const { offset: t, gpuAcceleration: r, fallbackPlacements: n } = e10; return [ { name: "offset", options: { offset: [0, t ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: n } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function uO(e10, t) { t && (e10.modifiers = [...e10.modifiers, ...t ?? []]); } var fO = 0; var cO = (e10) => { const { popperInstanceRef: t, contentRef: r, triggerRef: n, role: a } = inject(E1, void 0), i = ref(), o = ref(), l = computed(() => ({ name: "eventListeners", enabled: !!e10.visible })), s = computed(() => { var y; const w = unref(i), k = (y = unref(o)) != null ? y : fO; return { name: "arrow", enabled: !a7(w), options: { element: w, padding: k } }; }), u = computed(() => ({ onFirstUpdate: () => { v(); }, ...oO(e10, [ unref(s), unref(l) ]) })), f = computed(() => lO(e10.referenceEl) || unref(n)), { attributes: d, state: h, styles: p, update: v, forceUpdate: m, instanceRef: g } = j9(f, r, u); return watch(g, (y) => t.value = y), onMounted(() => { watch(() => { var y; return (y = unref(f)) == null ? void 0 : y.getBoundingClientRect(); }, () => { v(); }); }), { attributes: d, arrowRef: i, contentRef: r, instanceRef: g, state: h, styles: p, role: a, forceUpdate: m, update: v }; }; var dO = (e10, { attributes: t, styles: r, role: n }) => { const { nextZIndex: a } = eN(), i = on("popper"), o = computed(() => unref(t).popper), l = ref(Ga(e10.zIndex) ? e10.zIndex : a()), s = computed(() => [ i.b(), i.is("pure", e10.pure), i.is(e10.effect), e10.popperClass ]), u = computed(() => [ { zIndex: unref(l) }, unref(r).popper, e10.popperStyle || {} ]), f = computed(() => n.value === "dialog" ? "false" : void 0), d = computed(() => unref(r).arrow || {}); return { ariaModal: f, arrowStyle: d, contentAttrs: o, contentClass: s, contentStyle: u, contentZIndex: l, updateZIndex: () => { l.value = Ga(e10.zIndex) ? e10.zIndex : a(); } }; }; var hO = (e10, t) => { const r = ref(false), n = ref(); return { focusStartRef: n, trapped: r, onFocusAfterReleased: (u) => { var f; ((f = u.detail) == null ? void 0 : f.focusReason) !== "pointer" && (n.value = "first", t("blur")); }, onFocusAfterTrapped: () => { t("focus"); }, onFocusInTrap: (u) => { e10.visible && !r.value && (u.target && (n.value = u.target), r.value = true); }, onFocusoutPrevented: (u) => { e10.trapping || (u.detail.focusReason === "pointer" && u.preventDefault(), r.value = false); }, onReleaseRequested: () => { r.value = false, t("close"); } }; }; var vO = defineComponent({ name: "ElPopperContent" }); var pO = defineComponent({ ...vO, props: f5, emits: iO, setup(e10, { expose: t, emit: r }) { const n = e10, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: l, onFocusInTrap: s, onFocusoutPrevented: u, onReleaseRequested: f } = hO(n, r), { attributes: d, arrowRef: h, contentRef: p, styles: v, instanceRef: m, role: g, update: y } = cO(n), { ariaModal: w, arrowStyle: k, contentAttrs: x, contentClass: _, contentStyle: T, updateZIndex: S } = dO(n, { styles: v, attributes: d, role: g }), M = inject(rv, void 0), L = ref(); provide(a5, { arrowStyle: k, arrowRef: h, arrowOffset: L }), M && provide(rv, { ...M, addInputId: Kh, removeInputId: Kh }); let F; const $ = (O = true) => { y(), O && S(); }, I = () => { $(false), n.visible && n.focusOnShow ? i.value = true : n.visible === false && (i.value = false); }; return onMounted(() => { watch(() => n.triggerTargetEl, (O, G) => { F == null || F(), F = void 0; const K = unref(O || p.value), V = unref(G || p.value); Vl(K) && (F = watch([g, () => n.ariaLabel, w, () => n.id], (z) => { ["role", "aria-label", "aria-modal", "id"].forEach((P, R) => { m1(z[R]) ? K.removeAttribute(P) : K.setAttribute(P, z[R]); }); }, { immediate: true })), V !== K && Vl(V) && ["role", "aria-label", "aria-modal", "id"].forEach((z) => { V.removeAttribute(z); }); }, { immediate: true }), watch(() => n.visible, I, { immediate: true }); }), onBeforeUnmount(() => { F == null || F(), F = void 0; }), t({ popperContentRef: p, popperInstanceRef: m, updatePopper: $, contentStyle: T }), (O, G) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: p }, unref(x), { style: unref(T), class: unref(_), tabindex: "-1", onMouseenter: (K) => O.$emit("mouseenter", K), onMouseleave: (K) => O.$emit("mouseleave", K) }), [ createVNode(unref(rO), { trapped: unref(i), "trap-on-focus-in": true, "focus-trap-el": unref(p), "focus-start-el": unref(a), onFocusAfterTrapped: unref(l), onFocusAfterReleased: unref(o), onFocusin: unref(s), onFocusoutPrevented: unref(u), onReleaseRequested: unref(f) }, { default: withCtx(() => [ renderSlot(O.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var mO = jr(pO, [["__file", "content.vue"]]); var gO = gi(zN); var P1 = Symbol("elTooltip"); var ma = qr({ ...Z9, ...f5, appendTo: { type: dr([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: dr(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...Qv(["ariaLabel"]) }); var mc = qr({ ...s5, disabled: Boolean, trigger: { type: dr([String, Array]), default: "hover" }, triggerKeys: { type: dr(Array), default: () => [hc.enter, hc.space] } }); var { useModelToggleProps: yO, useModelToggleEmits: bO, useModelToggle: _O } = O7("visible"); var xO = qr({ ...i5, ...yO, ...ma, ...mc, ...o5, showArrow: { type: Boolean, default: true } }); var wO = [ ...bO, "before-show", "before-hide", "show", "hide", "open", "close" ]; var TO = (e10, t) => Ni(e10) ? e10.includes(t) : e10 === t; var Fs = (e10, t, r) => (n) => { TO(unref(e10), t) && r(n); }; var kO = defineComponent({ name: "ElTooltipTrigger" }); var AO = defineComponent({ ...kO, props: mc, setup(e10, { expose: t }) { const r = e10, n = on("tooltip"), { controlled: a, id: i, open: o, onOpen: l, onClose: s, onToggle: u } = inject(P1, void 0), f = ref(null), d = () => { if (unref(a) || r.disabled) return true; }, h = toRef(r, "trigger"), p = fo(d, Fs(h, "hover", l)), v = fo(d, Fs(h, "hover", s)), m = fo(d, Fs(h, "click", (x) => { x.button === 0 && u(x); })), g = fo(d, Fs(h, "focus", l)), y = fo(d, Fs(h, "focus", s)), w = fo(d, Fs(h, "contextmenu", (x) => { x.preventDefault(), u(x); })), k = fo(d, (x) => { const { code: _ } = x; r.triggerKeys.includes(_) && (x.preventDefault(), u(x)); }); return t({ triggerRef: f }), (x, _) => (openBlock(), createBlock(unref(UN), { id: unref(i), "virtual-ref": x.virtualRef, open: unref(o), "virtual-triggering": x.virtualTriggering, class: normalizeClass(unref(n).e("trigger")), onBlur: unref(y), onClick: unref(m), onContextmenu: unref(w), onFocus: unref(g), onMouseenter: unref(p), onMouseleave: unref(v), onKeydown: unref(k) }, { default: withCtx(() => [ renderSlot(x.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var MO = jr(AO, [["__file", "trigger.vue"]]); var SO = qr({ to: { type: dr([String, Object]), required: true }, disabled: Boolean }); var CO = defineComponent({ __name: "teleport", props: SO, setup(e10) { return (t, r) => t.disabled ? renderSlot(t.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: t.to }, [ renderSlot(t.$slots, "default") ], 8, ["to"])); } }); var LO = jr(CO, [["__file", "teleport.vue"]]); var DO = gi(LO); var EO = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var FO = defineComponent({ ...EO, props: ma, setup(e10, { expose: t }) { const r = e10, { selector: n } = Q3(), a = on("tooltip"), i = ref(null); let o; const { controlled: l, id: s, open: u, trigger: f, onClose: d, onOpen: h, onShow: p, onHide: v, onBeforeShow: m, onBeforeHide: g } = inject(P1, void 0), y = computed(() => r.transition || `${a.namespace.value}-fade-in-linear`), w = computed(() => cs.env.NODE_ENV === "test" ? true : r.persistent); onBeforeUnmount(() => { o == null || o(); }); const k = computed(() => unref(w) ? true : unref(u)), x = computed(() => r.disabled ? false : unref(u)), _ = computed(() => r.appendTo || n.value), T = computed(() => { var V; return (V = r.style) != null ? V : {}; }), S = ref(true), M = () => { v(), S.value = true; }, L = () => { if (unref(l)) return true; }, F = fo(L, () => { r.enterable && unref(f) === "hover" && h(); }), $ = fo(L, () => { unref(f) === "hover" && d(); }), I = () => { var V, z; (z = (V = i.value) == null ? void 0 : V.updatePopper) == null || z.call(V), m == null || m(); }, O = () => { g == null || g(); }, G = () => { p(), o = tP(computed(() => { var V; return (V = i.value) == null ? void 0 : V.popperContentRef; }), () => { if (unref(l)) return; unref(f) !== "hover" && d(); }); }, K = () => { r.virtualTriggering || d(); }; return watch(() => unref(u), (V) => { V ? S.value = false : o == null || o(); }, { flush: "post" }), watch(() => r.content, () => { var V, z; (z = (V = i.value) == null ? void 0 : V.updatePopper) == null || z.call(V); }), t({ contentRef: i }), (V, z) => (openBlock(), createBlock(unref(DO), { disabled: !V.teleported, to: unref(_) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(y), onAfterLeave: M, onBeforeEnter: I, onAfterEnter: G, onBeforeLeave: O }, { default: withCtx(() => [ unref(k) ? withDirectives((openBlock(), createBlock(unref(mO), mergeProps({ key: 0, id: unref(s), ref_key: "contentRef", ref: i }, V.$attrs, { "aria-label": V.ariaLabel, "aria-hidden": S.value, "boundaries-padding": V.boundariesPadding, "fallback-placements": V.fallbackPlacements, "gpu-acceleration": V.gpuAcceleration, offset: V.offset, placement: V.placement, "popper-options": V.popperOptions, strategy: V.strategy, effect: V.effect, enterable: V.enterable, pure: V.pure, "popper-class": V.popperClass, "popper-style": [V.popperStyle, unref(T)], "reference-el": V.referenceEl, "trigger-target-el": V.triggerTargetEl, visible: unref(x), "z-index": V.zIndex, onMouseenter: unref(F), onMouseleave: unref($), onBlur: K, onClose: unref(d) }), { default: withCtx(() => [ renderSlot(V.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(x)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var RO = jr(FO, [["__file", "content.vue"]]); var PO = defineComponent({ name: "ElTooltip" }); var $O = defineComponent({ ...PO, props: xO, emits: wO, setup(e10, { expose: t, emit: r }) { const n = e10; W9(); const a = Jv(), i = ref(), o = ref(), l = () => { var y; const w = unref(i); w && ((y = w.popperInstanceRef) == null || y.update()); }, s = ref(false), u = ref(), { show: f, hide: d, hasUpdateHandler: h } = _O({ indicator: s, toggleReason: u }), { onOpen: p, onClose: v } = Y9({ showAfter: toRef(n, "showAfter"), hideAfter: toRef(n, "hideAfter"), autoClose: toRef(n, "autoClose"), open: f, close: d }), m = computed(() => g1(n.visible) && !h.value); provide(P1, { controlled: m, id: a, open: readonly(s), trigger: toRef(n, "trigger"), onOpen: (y) => { p(y); }, onClose: (y) => { v(y); }, onToggle: (y) => { unref(s) ? v(y) : p(y); }, onShow: () => { r("show", u.value); }, onHide: () => { r("hide", u.value); }, onBeforeShow: () => { r("before-show", u.value); }, onBeforeHide: () => { r("before-hide", u.value); }, updatePopper: l }), watch(() => n.disabled, (y) => { y && s.value && (s.value = false); }); const g = (y) => { var w, k; const x = (k = (w = o.value) == null ? void 0 : w.contentRef) == null ? void 0 : k.popperContentRef, _ = (y == null ? void 0 : y.relatedTarget) || document.activeElement; return x && x.contains(_); }; return onDeactivated(() => s.value && d()), t({ popperRef: i, contentRef: o, isFocusInsideContent: g, updatePopper: l, onOpen: p, onClose: v, hide: d }), (y, w) => (openBlock(), createBlock(unref(gO), { ref_key: "popperRef", ref: i, role: y.role }, { default: withCtx(() => [ createVNode(MO, { disabled: y.disabled, trigger: y.trigger, "trigger-keys": y.triggerKeys, "virtual-ref": y.virtualRef, "virtual-triggering": y.virtualTriggering }, { default: withCtx(() => [ y.$slots.default ? renderSlot(y.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(RO, { ref_key: "contentRef", ref: o, "aria-label": y.ariaLabel, "boundaries-padding": y.boundariesPadding, content: y.content, disabled: y.disabled, effect: y.effect, enterable: y.enterable, "fallback-placements": y.fallbackPlacements, "hide-after": y.hideAfter, "gpu-acceleration": y.gpuAcceleration, offset: y.offset, persistent: y.persistent, "popper-class": y.popperClass, "popper-style": y.popperStyle, placement: y.placement, "popper-options": y.popperOptions, pure: y.pure, "raw-content": y.rawContent, "reference-el": y.referenceEl, "trigger-target-el": y.triggerTargetEl, "show-after": y.showAfter, strategy: y.strategy, teleported: y.teleported, transition: y.transition, "virtual-triggering": y.virtualTriggering, "z-index": y.zIndex, "append-to": y.appendTo }, { default: withCtx(() => [ renderSlot(y.$slots, "content", {}, () => [ y.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: y.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(y.content), 1)) ]), y.showArrow ? (openBlock(), createBlock(unref(ON), { key: 0, "arrow-offset": y.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var zO = jr($O, [["__file", "tooltip.vue"]]); var c5 = gi(zO); var d5 = Symbol("buttonGroupContextKey"); var IO = (e10, t) => { C7({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => e10.type === "text")); const r = inject(d5, void 0), n = hN("button"), { form: a } = n5(), i = L1(computed(() => r == null ? void 0 : r.size)), o = r5(), l = ref(), s = useSlots(), u = computed(() => e10.type || (r == null ? void 0 : r.type) || ""), f = computed(() => { var v, m, g; return (g = (m = e10.autoInsertSpace) != null ? m : (v = n.value) == null ? void 0 : v.autoInsertSpace) != null ? g : false; }), d = computed(() => e10.tag === "button" ? { ariaDisabled: o.value || e10.loading, disabled: o.value || e10.loading, autofocus: e10.autofocus, type: e10.nativeType } : {}), h = computed(() => { var v; const m = (v = s.default) == null ? void 0 : v.call(s); if (f.value && (m == null ? void 0 : m.length) === 1) { const g = m[0]; if ((g == null ? void 0 : g.type) === Text) { const y = g.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return false; }); return { _disabled: o, _size: i, _type: u, _ref: l, _props: d, shouldAddSpace: h, handleClick: (v) => { if (o.value || e10.loading) { v.stopPropagation(); return; } e10.nativeType === "reset" && (a == null || a.resetFields()), t("click", v); } }; }; var NO = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var OO = ["button", "submit", "reset"]; var Q0 = qr({ size: t5, disabled: Boolean, type: { type: String, values: NO, default: "" }, icon: { type: Tu }, nativeType: { type: String, values: OO, default: "button" }, loading: Boolean, loadingIcon: { type: Tu, default: () => N3 }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: dr([String, Object]), default: "button" } }); var HO = { click: (e10) => e10 instanceof MouseEvent }; function En(e10, t) { BO(e10) && (e10 = "100%"); var r = jO(e10); return e10 = t === 360 ? e10 : Math.min(t, Math.max(0, parseFloat(e10))), r && (e10 = parseInt(String(e10 * t), 10) / 100), Math.abs(e10 - t) < 1e-6 ? 1 : (t === 360 ? e10 = (e10 < 0 ? e10 % t + t : e10 % t) / parseFloat(String(t)) : e10 = e10 % t / parseFloat(String(t)), e10); } function Dd(e10) { return Math.min(1, Math.max(0, e10)); } function BO(e10) { return typeof e10 == "string" && e10.indexOf(".") !== -1 && parseFloat(e10) === 1; } function jO(e10) { return typeof e10 == "string" && e10.indexOf("%") !== -1; } function h5(e10) { return e10 = parseFloat(e10), (isNaN(e10) || e10 < 0 || e10 > 1) && (e10 = 1), e10; } function Ed(e10) { return e10 <= 1 ? "".concat(Number(e10) * 100, "%") : e10; } function Hl(e10) { return e10.length === 1 ? "0" + e10 : String(e10); } function UO(e10, t, r) { return { r: En(e10, 255) * 255, g: En(t, 255) * 255, b: En(r, 255) * 255 }; } function Gw(e10, t, r) { e10 = En(e10, 255), t = En(t, 255), r = En(r, 255); var n = Math.max(e10, t, r), a = Math.min(e10, t, r), i = 0, o = 0, l = (n + a) / 2; if (n === a) o = 0, i = 0; else { var s = n - a; switch (o = l > 0.5 ? s / (2 - n - a) : s / (n + a), n) { case e10: i = (t - r) / s + (t < r ? 6 : 0); break; case t: i = (r - e10) / s + 2; break; case r: i = (e10 - t) / s + 4; break; } i /= 6; } return { h: i, s: o, l }; } function zm(e10, t, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e10 + (t - e10) * (6 * r) : r < 1 / 2 ? t : r < 2 / 3 ? e10 + (t - e10) * (2 / 3 - r) * 6 : e10; } function GO(e10, t, r) { var n, a, i; if (e10 = En(e10, 360), t = En(t, 100), r = En(r, 100), t === 0) a = r, i = r, n = r; else { var o = r < 0.5 ? r * (1 + t) : r + t - r * t, l = 2 * r - o; n = zm(l, o, e10 + 1 / 3), a = zm(l, o, e10), i = zm(l, o, e10 - 1 / 3); } return { r: n * 255, g: a * 255, b: i * 255 }; } function Vw(e10, t, r) { e10 = En(e10, 255), t = En(t, 255), r = En(r, 255); var n = Math.max(e10, t, r), a = Math.min(e10, t, r), i = 0, o = n, l = n - a, s = n === 0 ? 0 : l / n; if (n === a) i = 0; else { switch (n) { case e10: i = (t - r) / l + (t < r ? 6 : 0); break; case t: i = (r - e10) / l + 2; break; case r: i = (e10 - t) / l + 4; break; } i /= 6; } return { h: i, s, v: o }; } function VO(e10, t, r) { e10 = En(e10, 360) * 6, t = En(t, 100), r = En(r, 100); var n = Math.floor(e10), a = e10 - n, i = r * (1 - t), o = r * (1 - a * t), l = r * (1 - (1 - a) * t), s = n % 6, u = [r, o, i, i, l, r][s], f = [l, r, r, o, i, i][s], d = [i, i, l, r, r, o][s]; return { r: u * 255, g: f * 255, b: d * 255 }; } function qw(e10, t, r, n) { var a = [ Hl(Math.round(e10).toString(16)), Hl(Math.round(t).toString(16)), Hl(Math.round(r).toString(16)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join(""); } function qO(e10, t, r, n, a) { var i = [ Hl(Math.round(e10).toString(16)), Hl(Math.round(t).toString(16)), Hl(Math.round(r).toString(16)), Hl(WO(n)) ]; return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join(""); } function WO(e10) { return Math.round(parseFloat(e10) * 255).toString(16); } function Ww(e10) { return va(e10) / 255; } function va(e10) { return parseInt(e10, 16); } function ZO(e10) { return { r: e10 >> 16, g: (e10 & 65280) >> 8, b: e10 & 255 }; } var ey = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function YO(e10) { var t = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = false, l = false; return typeof e10 == "string" && (e10 = JO(e10)), typeof e10 == "object" && (io(e10.r) && io(e10.g) && io(e10.b) ? (t = UO(e10.r, e10.g, e10.b), o = true, l = String(e10.r).substr(-1) === "%" ? "prgb" : "rgb") : io(e10.h) && io(e10.s) && io(e10.v) ? (n = Ed(e10.s), a = Ed(e10.v), t = VO(e10.h, n, a), o = true, l = "hsv") : io(e10.h) && io(e10.s) && io(e10.l) && (n = Ed(e10.s), i = Ed(e10.l), t = GO(e10.h, n, i), o = true, l = "hsl"), Object.prototype.hasOwnProperty.call(e10, "a") && (r = e10.a)), r = h5(r), { ok: o, format: e10.format || l, r: Math.min(255, Math.max(t.r, 0)), g: Math.min(255, Math.max(t.g, 0)), b: Math.min(255, Math.max(t.b, 0)), a: r }; } var XO = "[-\\+]?\\d+%?"; var KO = "[-\\+]?\\d*\\.\\d+%?"; var tl = "(?:".concat(KO, ")|(?:").concat(XO, ")"); var Im = "[\\s|\\(]+(".concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")\\s*\\)?"); var Nm = "[\\s|\\(]+(".concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")\\s*\\)?"); var ai = { CSS_UNIT: new RegExp(tl), rgb: new RegExp("rgb" + Im), rgba: new RegExp("rgba" + Nm), hsl: new RegExp("hsl" + Im), hsla: new RegExp("hsla" + Nm), hsv: new RegExp("hsv" + Im), hsva: new RegExp("hsva" + Nm), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function JO(e10) { if (e10 = e10.trim().toLowerCase(), e10.length === 0) return false; var t = false; if (ey[e10]) e10 = ey[e10], t = true; else if (e10 === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = ai.rgb.exec(e10); return r ? { r: r[1], g: r[2], b: r[3] } : (r = ai.rgba.exec(e10), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = ai.hsl.exec(e10), r ? { h: r[1], s: r[2], l: r[3] } : (r = ai.hsla.exec(e10), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = ai.hsv.exec(e10), r ? { h: r[1], s: r[2], v: r[3] } : (r = ai.hsva.exec(e10), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = ai.hex8.exec(e10), r ? { r: va(r[1]), g: va(r[2]), b: va(r[3]), a: Ww(r[4]), format: t ? "name" : "hex8" } : (r = ai.hex6.exec(e10), r ? { r: va(r[1]), g: va(r[2]), b: va(r[3]), format: t ? "name" : "hex" } : (r = ai.hex4.exec(e10), r ? { r: va(r[1] + r[1]), g: va(r[2] + r[2]), b: va(r[3] + r[3]), a: Ww(r[4] + r[4]), format: t ? "name" : "hex8" } : (r = ai.hex3.exec(e10), r ? { r: va(r[1] + r[1]), g: va(r[2] + r[2]), b: va(r[3] + r[3]), format: t ? "name" : "hex" } : false))))))))); } function io(e10) { return !!ai.CSS_UNIT.exec(String(e10)); } var QO = ( /** @class */ function() { function e10(t, r) { t === void 0 && (t = ""), r === void 0 && (r = {}); var n; if (t instanceof e10) return t; typeof t == "number" && (t = ZO(t)), this.originalInput = t; var a = YO(t); this.originalInput = t, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok; } return e10.prototype.isDark = function() { return this.getBrightness() < 128; }, e10.prototype.isLight = function() { return !this.isDark(); }, e10.prototype.getBrightness = function() { var t = this.toRgb(); return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3; }, e10.prototype.getLuminance = function() { var t = this.toRgb(), r, n, a, i = t.r / 255, o = t.g / 255, l = t.b / 255; return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? a = l / 12.92 : a = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a; }, e10.prototype.getAlpha = function() { return this.a; }, e10.prototype.setAlpha = function(t) { return this.a = h5(t), this.roundA = Math.round(100 * this.a) / 100, this; }, e10.prototype.isMonochrome = function() { var t = this.toHsl().s; return t === 0; }, e10.prototype.toHsv = function() { var t = Vw(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, v: t.v, a: this.a }; }, e10.prototype.toHsvString = function() { var t = Vw(this.r, this.g, this.b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), a = Math.round(t.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, e10.prototype.toHsl = function() { var t = Gw(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, l: t.l, a: this.a }; }, e10.prototype.toHslString = function() { var t = Gw(this.r, this.g, this.b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), a = Math.round(t.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, e10.prototype.toHex = function(t) { return t === void 0 && (t = false), qw(this.r, this.g, this.b, t); }, e10.prototype.toHexString = function(t) { return t === void 0 && (t = false), "#" + this.toHex(t); }, e10.prototype.toHex8 = function(t) { return t === void 0 && (t = false), qO(this.r, this.g, this.b, this.a, t); }, e10.prototype.toHex8String = function(t) { return t === void 0 && (t = false), "#" + this.toHex8(t); }, e10.prototype.toHexShortString = function(t) { return t === void 0 && (t = false), this.a === 1 ? this.toHexString(t) : this.toHex8String(t); }, e10.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, e10.prototype.toRgbString = function() { var t = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b); return this.a === 1 ? "rgb(".concat(t, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(t, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")"); }, e10.prototype.toPercentageRgb = function() { var t = function(r) { return "".concat(Math.round(En(r, 255) * 100), "%"); }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a }; }, e10.prototype.toPercentageRgbString = function() { var t = function(r) { return Math.round(En(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")"); }, e10.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var t = "#" + qw(this.r, this.g, this.b, false), r = 0, n = Object.entries(ey); r < n.length; r++) { var a = n[r], i = a[0], o = a[1]; if (t === o) return i; } return false; }, e10.prototype.toString = function(t) { var r = !!t; t = t ?? this.format; var n = false, a = this.a < 1 && this.a >= 0, i = !r && a && (t.startsWith("hex") || t === "name"); return i ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (n = this.toRgbString()), t === "prgb" && (n = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (n = this.toHexString()), t === "hex3" && (n = this.toHexString(true)), t === "hex4" && (n = this.toHex8String(true)), t === "hex8" && (n = this.toHex8String()), t === "name" && (n = this.toName()), t === "hsl" && (n = this.toHslString()), t === "hsv" && (n = this.toHsvString()), n || this.toHexString()); }, e10.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, e10.prototype.clone = function() { return new e10(this.toString()); }, e10.prototype.lighten = function(t) { t === void 0 && (t = 10); var r = this.toHsl(); return r.l += t / 100, r.l = Dd(r.l), new e10(r); }, e10.prototype.brighten = function(t) { t === void 0 && (t = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(t / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(t / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(t / 100)))), new e10(r); }, e10.prototype.darken = function(t) { t === void 0 && (t = 10); var r = this.toHsl(); return r.l -= t / 100, r.l = Dd(r.l), new e10(r); }, e10.prototype.tint = function(t) { return t === void 0 && (t = 10), this.mix("white", t); }, e10.prototype.shade = function(t) { return t === void 0 && (t = 10), this.mix("black", t); }, e10.prototype.desaturate = function(t) { t === void 0 && (t = 10); var r = this.toHsl(); return r.s -= t / 100, r.s = Dd(r.s), new e10(r); }, e10.prototype.saturate = function(t) { t === void 0 && (t = 10); var r = this.toHsl(); return r.s += t / 100, r.s = Dd(r.s), new e10(r); }, e10.prototype.greyscale = function() { return this.desaturate(100); }, e10.prototype.spin = function(t) { var r = this.toHsl(), n = (r.h + t) % 360; return r.h = n < 0 ? 360 + n : n, new e10(r); }, e10.prototype.mix = function(t, r) { r === void 0 && (r = 50); var n = this.toRgb(), a = new e10(t).toRgb(), i = r / 100, o = { r: (a.r - n.r) * i + n.r, g: (a.g - n.g) * i + n.g, b: (a.b - n.b) * i + n.b, a: (a.a - n.a) * i + n.a }; return new e10(o); }, e10.prototype.analogous = function(t, r) { t === void 0 && (t = 6), r === void 0 && (r = 30); var n = this.toHsl(), a = 360 / r, i = [this]; for (n.h = (n.h - (a * t >> 1) + 720) % 360; --t; ) n.h = (n.h + a) % 360, i.push(new e10(n)); return i; }, e10.prototype.complement = function() { var t = this.toHsl(); return t.h = (t.h + 180) % 360, new e10(t); }, e10.prototype.monochromatic = function(t) { t === void 0 && (t = 6); for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], l = 1 / t; t--; ) o.push(new e10({ h: n, s: a, v: i })), i = (i + l) % 1; return o; }, e10.prototype.splitcomplement = function() { var t = this.toHsl(), r = t.h; return [ this, new e10({ h: (r + 72) % 360, s: t.s, l: t.l }), new e10({ h: (r + 216) % 360, s: t.s, l: t.l }) ]; }, e10.prototype.onBackground = function(t) { var r = this.toRgb(), n = new e10(t).toRgb(), a = r.a + n.a * (1 - r.a); return new e10({ r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a, g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a, b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a, a }); }, e10.prototype.triad = function() { return this.polyad(3); }, e10.prototype.tetrad = function() { return this.polyad(4); }, e10.prototype.polyad = function(t) { for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / t, o = 1; o < t; o++) a.push(new e10({ h: (n + o * i) % 360, s: r.s, l: r.l })); return a; }, e10.prototype.equals = function(t) { return this.toRgbString() === new e10(t).toRgbString(); }, e10; }() ); function $o(e10, t = 20) { return e10.mix("#141414", t).toString(); } function eH(e10) { const t = r5(), r = on("button"); return computed(() => { let n = {}, a = e10.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new QO(a), l = e10.dark ? o.tint(20).toString() : $o(o, 20); if (e10.plain) n = r.cssVarBlock({ "bg-color": e10.dark ? $o(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": e10.dark ? $o(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": a, "hover-border-color": a, "active-bg-color": l, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": l }), t.value && (n[r.cssVarBlockName("disabled-bg-color")] = e10.dark ? $o(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = e10.dark ? $o(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = e10.dark ? $o(o, 80) : o.tint(80).toString()); else { const s = e10.dark ? $o(o, 30) : o.tint(30).toString(), u = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (n = r.cssVarBlock({ "bg-color": a, "text-color": u, "border-color": a, "hover-bg-color": s, "hover-text-color": u, "hover-border-color": s, "active-bg-color": l, "active-border-color": l }), t.value) { const f = e10.dark ? $o(o, 50) : o.tint(50).toString(); n[r.cssVarBlockName("disabled-bg-color")] = f, n[r.cssVarBlockName("disabled-text-color")] = e10.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = f; } } } return n; }); } var tH = defineComponent({ name: "ElButton" }); var rH = defineComponent({ ...tH, props: Q0, emits: HO, setup(e10, { expose: t, emit: r }) { const n = e10, a = eH(n), i = on("button"), { _ref: o, _size: l, _type: s, _disabled: u, _props: f, shouldAddSpace: d, handleClick: h } = IO(n, r), p = computed(() => [ i.b(), i.m(s.value), i.m(l.value), i.is("disabled", u.value), i.is("loading", n.loading), i.is("plain", n.plain), i.is("round", n.round), i.is("circle", n.circle), i.is("text", n.text), i.is("link", n.link), i.is("has-bg", n.bg) ]); return t({ ref: o, size: l, type: s, disabled: u, shouldAddSpace: d }), (v, m) => (openBlock(), createBlock(resolveDynamicComponent(v.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(f), { class: unref(p), style: unref(a), onClick: unref(h) }), { default: withCtx(() => [ v.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ v.$slots.loading ? renderSlot(v.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Lu), { key: 1, class: normalizeClass(unref(i).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(v.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : v.icon || v.$slots.icon ? (openBlock(), createBlock(unref(Lu), { key: 1 }, { default: withCtx(() => [ v.icon ? (openBlock(), createBlock(resolveDynamicComponent(v.icon), { key: 0 })) : renderSlot(v.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), v.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(i).em("text", "expand")]: unref(d) }) }, [ renderSlot(v.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var nH = jr(rH, [["__file", "button.vue"]]); var aH = { size: Q0.size, type: Q0.type }; var iH = defineComponent({ name: "ElButtonGroup" }); var oH = defineComponent({ ...iH, props: aH, setup(e10) { const t = e10; provide(d5, reactive({ size: toRef(t, "size"), type: toRef(t, "type") })); const r = on("button"); return (n, a) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(r).b("group")) }, [ renderSlot(n.$slots, "default") ], 2)); } }); var v5 = jr(oH, [["__file", "button-group.vue"]]); var Gc = gi(nH, { ButtonGroup: v5 }); Zv(v5); var Wl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Vc(e10) { return e10 && e10.__esModule && Object.prototype.hasOwnProperty.call(e10, "default") ? e10.default : e10; } function tp(e10) { if (e10.__esModule) return e10; var t = e10.default; if (typeof t == "function") { var r = function n() { return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments); }; r.prototype = t.prototype; } else r = {}; return Object.defineProperty(r, "__esModule", { value: true }), Object.keys(e10).forEach(function(n) { var a = Object.getOwnPropertyDescriptor(e10, n); Object.defineProperty(r, n, a.get ? a : { enumerable: true, get: function() { return e10[n]; } }); }), r; } var Uo = /* @__PURE__ */ new Map(); if (qn) { let e10; document.addEventListener("mousedown", (t) => e10 = t), document.addEventListener("mouseup", (t) => { if (e10) { for (const r of Uo.values()) for (const { documentHandler: n } of r) n(t, e10); e10 = void 0; } }); } function Zw(e10, t) { let r = []; return Array.isArray(t.arg) ? r = t.arg : Vl(t.arg) && r.push(t.arg), function(n, a) { const i = t.instance.popperRef, o = n.target, l = a == null ? void 0 : a.target, s = !t || !t.instance, u = !o || !l, f = e10.contains(o) || e10.contains(l), d = e10 === o, h = r.length && r.some((v) => v == null ? void 0 : v.contains(o)) || r.length && r.includes(l), p = i && (i.contains(o) || i.contains(l)); s || u || f || d || h || p || t.value(n, a); }; } var lH = { beforeMount(e10, t) { Uo.has(e10) || Uo.set(e10, []), Uo.get(e10).push({ documentHandler: Zw(e10, t), bindingFn: t.value }); }, updated(e10, t) { Uo.has(e10) || Uo.set(e10, []); const r = Uo.get(e10), n = r.findIndex((i) => i.bindingFn === t.oldValue), a = { documentHandler: Zw(e10, t), bindingFn: t.value }; n >= 0 ? r.splice(n, 1, a) : r.push(a); }, unmounted(e10) { Uo.delete(e10); } }; var ty = qr({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: H3 }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var sH = { close: (e10) => e10 instanceof MouseEvent, click: (e10) => e10 instanceof MouseEvent }; var uH = defineComponent({ name: "ElTag" }); var fH = defineComponent({ ...uH, props: ty, emits: sH, setup(e10, { emit: t }) { const r = e10, n = L1(), a = on("tag"), i = computed(() => { const { type: u, hit: f, effect: d, closable: h, round: p } = r; return [ a.b(), a.is("closable", h), a.m(u || "primary"), a.m(n.value), a.m(d), a.is("hit", f), a.is("round", p) ]; }), o = (u) => { t("close", u); }, l = (u) => { t("click", u); }, s = (u) => { u.component.subTree.component.bum = null; }; return (u, f) => u.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: u.color }), onClick: l }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(u.$slots, "default") ], 2), u.closable ? (openBlock(), createBlock(unref(Lu), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(yw)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: s }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: u.color }), onClick: l }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(u.$slots, "default") ], 2), u.closable ? (openBlock(), createBlock(unref(Lu), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(yw)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var cH = jr(fH, [["__file", "tag.vue"]]); var dH = gi(cH); var Yw = (e10) => Ga(e10) || Uu(e10) || Ni(e10); var hH = qr({ accordion: Boolean, modelValue: { type: dr([Array, String, Number]), default: () => S7([]) } }); var vH = { [Ko]: Yw, [Yv]: Yw }; var p5 = Symbol("collapseContextKey"); var pH = (e10, t) => { const r = ref(zi(e10.modelValue)), n = (i) => { r.value = i; const o = e10.accordion ? r.value[0] : r.value; t(Ko, o), t(Yv, o); }, a = (i) => { if (e10.accordion) n([r.value[0] === i ? "" : i]); else { const o = [...r.value], l = o.indexOf(i); l > -1 ? o.splice(l, 1) : o.push(i), n(o); } }; return watch(() => e10.modelValue, () => r.value = zi(e10.modelValue), { deep: true }), provide(p5, { activeNames: r, handleItemClick: a }), { activeNames: r, setActiveNames: n }; }; var mH = () => { const e10 = on("collapse"); return { rootKls: computed(() => e10.b()) }; }; var gH = defineComponent({ name: "ElCollapse" }); var yH = defineComponent({ ...gH, props: hH, emits: vH, setup(e10, { expose: t, emit: r }) { const n = e10, { activeNames: a, setActiveNames: i } = pH(n, r), { rootKls: o } = mH(); return t({ activeNames: a, setActiveNames: i }), (l, s) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(o)) }, [ renderSlot(l.$slots, "default") ], 2)); } }); var bH = jr(yH, [["__file", "collapse.vue"]]); var _H = defineComponent({ name: "ElCollapseTransition" }); var xH = defineComponent({ ..._H, setup(e10) { const t = on("collapse-transition"), r = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, n = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { r(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { r(a); }, leaveCancelled(a) { r(a); } }; return (a, i) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(t).b() }, toHandlers(n)), { default: withCtx(() => [ renderSlot(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var wH = jr(xH, [["__file", "collapse-transition.vue"]]); var TH = gi(wH); var kH = qr({ title: { type: String, default: "" }, name: { type: dr([String, Number]), default: void 0 }, icon: { type: Tu, default: g7 }, disabled: Boolean }); var AH = (e10) => { const t = inject(p5), { namespace: r } = on("collapse"), n = ref(false), a = ref(false), i = S1(), o = computed(() => i.current++), l = computed(() => { var h; return (h = e10.name) != null ? h : `${r.value}-id-${i.prefix}-${unref(o)}`; }), s = computed(() => t == null ? void 0 : t.activeNames.value.includes(unref(l))); return { focusing: n, id: o, isActive: s, handleFocus: () => { setTimeout(() => { a.value ? a.value = false : n.value = true; }, 50); }, handleHeaderClick: () => { e10.disabled || (t == null || t.handleItemClick(unref(l)), n.value = false, a.value = true); }, handleEnterClick: () => { t == null || t.handleItemClick(unref(l)); } }; }; var MH = (e10, { focusing: t, isActive: r, id: n }) => { const a = on("collapse"), i = computed(() => [ a.b("item"), a.is("active", unref(r)), a.is("disabled", e10.disabled) ]), o = computed(() => [ a.be("item", "header"), a.is("active", unref(r)), { focusing: unref(t) && !e10.disabled } ]), l = computed(() => [ a.be("item", "arrow"), a.is("active", unref(r)) ]), s = computed(() => a.be("item", "wrap")), u = computed(() => a.be("item", "content")), f = computed(() => a.b(`content-${unref(n)}`)), d = computed(() => a.b(`head-${unref(n)}`)); return { arrowKls: l, headKls: o, rootKls: i, itemWrapperKls: s, itemContentKls: u, scopedContentId: f, scopedHeadId: d }; }; var SH = defineComponent({ name: "ElCollapseItem" }); var CH = defineComponent({ ...SH, props: kH, setup(e10, { expose: t }) { const r = e10, { focusing: n, id: a, isActive: i, handleFocus: o, handleHeaderClick: l, handleEnterClick: s } = AH(r), { arrowKls: u, headKls: f, rootKls: d, itemWrapperKls: h, itemContentKls: p, scopedContentId: v, scopedHeadId: m } = MH(r, { focusing: n, isActive: i, id: a }); return t({ isActive: i }), (g, y) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(d)) }, [ createBaseVNode("button", { id: unref(m), class: normalizeClass(unref(f)), "aria-expanded": unref(i), "aria-controls": unref(v), "aria-describedby": unref(v), tabindex: g.disabled ? -1 : 0, type: "button", onClick: unref(l), onKeydown: withKeys(withModifiers(unref(s), ["stop", "prevent"]), ["space", "enter"]), onFocus: unref(o), onBlur: (w) => n.value = false }, [ renderSlot(g.$slots, "title", {}, () => [ createTextVNode(toDisplayString(g.title), 1) ]), renderSlot(g.$slots, "icon", { isActive: unref(i) }, () => [ createVNode(unref(Lu), { class: normalizeClass(unref(u)) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(g.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), createVNode(unref(TH), null, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { id: unref(v), role: "region", class: normalizeClass(unref(h)), "aria-hidden": !unref(i), "aria-labelledby": unref(m) }, [ createBaseVNode("div", { class: normalizeClass(unref(p)) }, [ renderSlot(g.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [vShow, unref(i)] ]) ]), _: 3 }) ], 2)); } }); var m5 = jr(CH, [["__file", "collapse-item.vue"]]); var g5 = gi(bH, { CollapseItem: m5 }); var y5 = Zv(m5); var LH = defineComponent({ inheritAttrs: false }); function DH(e10, t, r, n, a, i) { return renderSlot(e10.$slots, "default"); } var EH = jr(LH, [["render", DH], ["__file", "collection.vue"]]); var FH = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function RH(e10, t, r, n, a, i) { return renderSlot(e10.$slots, "default"); } var PH = jr(FH, [["render", RH], ["__file", "collection-item.vue"]]); var $H = "data-el-collection-item"; var zH = (e10) => { const t = `El${e10}Collection`, r = `${t}Item`, n = Symbol(t), a = Symbol(r), i = { ...EH, name: t, setup() { const l = ref(null), s = /* @__PURE__ */ new Map(); provide(n, { itemMap: s, getItems: () => { const f = unref(l); if (!f) return []; const d = Array.from(f.querySelectorAll(`[${$H}]`)); return [...s.values()].sort((p, v) => d.indexOf(p.ref) - d.indexOf(v.ref)); }, collectionRef: l }); } }, o = { ...PH, name: r, setup(l, { attrs: s }) { const u = ref(null), f = inject(n, void 0); provide(a, { collectionItemRef: u }), onMounted(() => { const d = unref(u); d && f.itemMap.set(d, { ref: d, ...s }); }), onBeforeUnmount(() => { const d = unref(u); f.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: n, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }; var Om = qr({ trigger: mc.trigger, effect: { ...ma.effect, default: "light" }, type: { type: dr(String) }, placement: { type: dr(String), default: "bottom" }, popperOptions: { type: dr(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: dr([Number, String]), default: 0 }, maxHeight: { type: dr([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: dr(Object) }, teleported: ma.teleported }); qr({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Tu } }); qr({ onKeydown: { type: dr(Function) } }); zH("Dropdown"); var b5 = Symbol("ElSelectGroup"); var rp = Symbol("ElSelect"); function IH(e10, t) { const r = inject(rp), n = inject(b5, { disabled: false }), a = computed(() => f(zi(r.props.modelValue), e10.value)), i = computed(() => { var p; if (r.props.multiple) { const v = zi((p = r.props.modelValue) != null ? p : []); return !a.value && v.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return false; }), o = computed(() => e10.label || (Oi(e10.value) ? "" : e10.value)), l = computed(() => e10.value || e10.label || ""), s = computed(() => e10.disabled || t.groupDisabled || i.value), u = getCurrentInstance(), f = (p = [], v) => { if (Oi(e10.value)) { const m = r.props.valueKey; return p && p.some((g) => toRaw(ho(g, m)) === ho(v, m)); } else return p && p.includes(v); }, d = () => { !e10.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(u.proxy)); }, h = (p) => { const v = new RegExp(f7(p), "i"); t.visible = v.test(o.value) || e10.created; }; return watch(() => o.value, () => { !e10.created && !r.props.remote && r.setSelected(); }), watch(() => e10.value, (p, v) => { const { remote: m, valueKey: g } = r.props; if (p !== v && (r.onOptionDestroy(v, u.proxy), r.onOptionCreate(u.proxy)), !e10.created && !m) { if (g && Oi(p) && Oi(v) && p[g] === v[g]) return; r.setSelected(); } }), watch(() => n.disabled, () => { t.groupDisabled = n.disabled; }, { immediate: true }), { select: r, currentLabel: o, currentValue: l, itemSelected: a, isDisabled: s, hoverItem: d, updateOption: h }; } var NH = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(e10) { const t = on("select"), r = Jv(), n = computed(() => [ t.be("dropdown", "item"), t.is("disabled", unref(l)), t.is("selected", unref(o)), t.is("hovering", unref(h)) ]), a = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: i, itemSelected: o, isDisabled: l, select: s, hoverItem: u, updateOption: f } = IH(e10, a), { visible: d, hover: h } = toRefs(a), p = getCurrentInstance().proxy; s.onOptionCreate(p), onBeforeUnmount(() => { const m = p.value, { selected: g } = s.states, w = (s.props.multiple ? g : [g]).some((k) => k.value === p.value); nextTick(() => { s.states.cachedOptions.get(m) === p && !w && s.states.cachedOptions.delete(m); }), s.onOptionDestroy(m, p); }); function v() { l.value || s.handleOptionSelect(p); } return { ns: t, id: r, containerKls: n, currentLabel: i, itemSelected: o, isDisabled: l, select: s, hoverItem: u, updateOption: f, visible: d, hover: h, selectOptionClick: v, states: a }; } }); function OH(e10, t, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("li", { id: e10.id, class: normalizeClass(e10.containerKls), role: "option", "aria-disabled": e10.isDisabled || void 0, "aria-selected": e10.itemSelected, onMouseenter: e10.hoverItem, onClick: withModifiers(e10.selectOptionClick, ["stop"]) }, [ renderSlot(e10.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(e10.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, e10.visible] ]); } var $1 = jr(NH, [["render", OH], ["__file", "option.vue"]]); var HH = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const e10 = inject(rp), t = on("select"), r = computed(() => e10.props.popperClass), n = computed(() => e10.props.multiple), a = computed(() => e10.props.fitInputWidth), i = ref(""); function o() { var l; i.value = `${(l = e10.selectRef) == null ? void 0 : l.offsetWidth}px`; } return onMounted(() => { o(), Wo(e10.selectRef, o); }), { ns: t, minWidth: i, popperClass: r, isMultiple: n, isFitInputWidth: a }; } }); function BH(e10, t, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([e10.ns.b("dropdown"), e10.ns.is("multiple", e10.isMultiple), e10.popperClass]), style: normalizeStyle({ [e10.isFitInputWidth ? "width" : "minWidth"]: e10.minWidth }) }, [ e10.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(e10.ns.be("dropdown", "header")) }, [ renderSlot(e10.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(e10.$slots, "default"), e10.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(e10.ns.be("dropdown", "footer")) }, [ renderSlot(e10.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var jH = jr(HH, [["render", BH], ["__file", "select-dropdown.vue"]]); var UH = 11; var GH = (e10, t) => { const { t: r } = P7(), n = Jv(), a = on("select"), i = on("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), l = ref(null), s = ref(null), u = ref(null), f = ref(null), d = ref(null), h = ref(null), p = ref(null), v = ref(null), m = ref(null), g = ref(null), y = ref(null), w = ref(null), { isComposing: k, handleCompositionStart: x, handleCompositionUpdate: _, handleCompositionEnd: T } = aN({ afterComposition: (oe) => ot(oe) }), { wrapperRef: S, isFocused: M } = nN(d, { beforeFocus() { return V.value; }, afterFocus() { e10.automaticDropdown && !L.value && (L.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(oe) { var Ce, Be; return ((Ce = u.value) == null ? void 0 : Ce.isFocusInsideContent(oe)) || ((Be = f.value) == null ? void 0 : Be.isFocusInsideContent(oe)); }, afterBlur() { L.value = false, o.menuVisibleOnFocus = false; } }), L = ref(false), F = ref(), { form: $, formItem: I } = n5(), { inputId: O } = yN(e10, { formItemContext: I }), { valueOnClear: G, isEmptyValue: K } = fN(e10), V = computed(() => e10.disabled || ($ == null ? void 0 : $.disabled)), z = computed(() => Ni(e10.modelValue) ? e10.modelValue.length > 0 : !K(e10.modelValue)), P = computed(() => e10.clearable && !V.value && o.inputHovering && z.value), R = computed(() => e10.remote && e10.filterable && !e10.remoteShowSuffix ? "" : e10.suffixIcon), H = computed(() => a.is("reverse", R.value && L.value)), B = computed(() => (I == null ? void 0 : I.validateState) || ""), W = computed(() => k7[B.value]), ee = computed(() => e10.remote ? 300 : 0), re = computed(() => e10.loading ? e10.loadingText || r("el.select.loading") : e10.remote && !o.inputValue && o.options.size === 0 ? false : e10.filterable && o.inputValue && o.options.size > 0 && ae.value === 0 ? e10.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? e10.noDataText || r("el.select.noData") : null), ae = computed(() => Q.value.filter((oe) => oe.visible).length), Q = computed(() => { const oe = Array.from(o.options.values()), Ce = []; return o.optionValues.forEach((Be) => { const Xe = oe.findIndex((Et) => Et.value === Be); Xe > -1 && Ce.push(oe[Xe]); }), Ce.length >= oe.length ? Ce : oe; }), ue = computed(() => Array.from(o.cachedOptions.values())), j = computed(() => { const oe = Q.value.filter((Ce) => !Ce.created).some((Ce) => Ce.currentLabel === o.inputValue); return e10.filterable && e10.allowCreate && o.inputValue !== "" && !oe; }), U = () => { e10.filterable && ua(e10.filterMethod) || e10.filterable && e10.remote && ua(e10.remoteMethod) || Q.value.forEach((oe) => { var Ce; (Ce = oe.updateOption) == null || Ce.call(oe, o.inputValue); }); }, Z = L1(), le = computed(() => ["small"].includes(Z.value) ? "small" : "default"), J = computed({ get() { return L.value && re.value !== false; }, set(oe) { L.value = oe; } }), pe = computed(() => { if (e10.multiple && !qf(e10.modelValue)) return zi(e10.modelValue).length === 0 && !o.inputValue; const oe = Ni(e10.modelValue) ? e10.modelValue[0] : e10.modelValue; return e10.filterable || qf(oe) ? !o.inputValue : true; }), ge = computed(() => { var oe; const Ce = (oe = e10.placeholder) != null ? oe : r("el.select.placeholder"); return e10.multiple || !z.value ? Ce : o.selectedLabel; }), ve = computed(() => H0 ? null : "mouseenter"); watch(() => e10.modelValue, (oe, Ce) => { e10.multiple && e10.filterable && !e10.reserveKeyword && (o.inputValue = "", me("")), ze(), !Y0(oe, Ce) && e10.validateEvent && (I == null || I.validate("change").catch((Be) => Gi(Be))); }, { flush: "post", deep: true }), watch(() => L.value, (oe) => { oe ? me(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), t("visible-change", oe); }), watch(() => o.options.entries(), () => { var oe; if (!qn) return; const Ce = ((oe = l.value) == null ? void 0 : oe.querySelectorAll("input")) || []; (!e10.filterable && !e10.defaultFirstOption && !qf(e10.modelValue) || !Array.from(Ce).includes(document.activeElement)) && ze(), e10.defaultFirstOption && (e10.filterable || e10.remote) && ae.value && Le(); }, { flush: "post" }), watch(() => o.hoveringIndex, (oe) => { Ga(oe) && oe > -1 ? F.value = Q.value[oe] || {} : F.value = {}, Q.value.forEach((Ce) => { Ce.hover = F.value === Ce; }); }), watchEffect(() => { o.isBeforeHide || U(); }); const me = (oe) => { o.previousQuery === oe || k.value || (o.previousQuery = oe, e10.filterable && ua(e10.filterMethod) ? e10.filterMethod(oe) : e10.filterable && e10.remote && ua(e10.remoteMethod) && e10.remoteMethod(oe), e10.defaultFirstOption && (e10.filterable || e10.remote) && ae.value ? nextTick(Le) : nextTick(Oe)); }, Le = () => { const oe = Q.value.filter((Xe) => Xe.visible && !Xe.disabled && !Xe.states.groupDisabled), Ce = oe.find((Xe) => Xe.created), Be = oe[0]; o.hoveringIndex = tt(Q.value, Ce || Be); }, ze = () => { if (e10.multiple) o.selectedLabel = ""; else { const Ce = Ni(e10.modelValue) ? e10.modelValue[0] : e10.modelValue, Be = Fe(Ce); o.selectedLabel = Be.currentLabel, o.selected = [Be]; return; } const oe = []; qf(e10.modelValue) || zi(e10.modelValue).forEach((Ce) => { oe.push(Fe(Ce)); }), o.selected = oe; }, Fe = (oe) => { let Ce; const Be = Sm(oe).toLowerCase() === "object", Xe = Sm(oe).toLowerCase() === "null", Et = Sm(oe).toLowerCase() === "undefined"; for (let kt = o.cachedOptions.size - 1; kt >= 0; kt--) { const qt = ue.value[kt]; if (Be ? ho(qt.value, e10.valueKey) === ho(oe, e10.valueKey) : qt.value === oe) { Ce = { value: oe, currentLabel: qt.currentLabel, get isDisabled() { return qt.isDisabled; } }; break; } } if (Ce) return Ce; const Pt = Be ? oe.label : !Xe && !Et ? oe : ""; return { value: oe, currentLabel: Pt }; }, Oe = () => { o.hoveringIndex = Q.value.findIndex((oe) => o.selected.some((Ce) => X(Ce) === X(oe))); }, Re = () => { o.selectionWidth = s.value.getBoundingClientRect().width; }, We = () => { o.calculatorWidth = h.value.getBoundingClientRect().width; }, Me = () => { o.collapseItemWidth = y.value.getBoundingClientRect().width; }, Ve = () => { var oe, Ce; (Ce = (oe = u.value) == null ? void 0 : oe.updatePopper) == null || Ce.call(oe); }, qe = () => { var oe, Ce; (Ce = (oe = f.value) == null ? void 0 : oe.updatePopper) == null || Ce.call(oe); }, Qe = () => { o.inputValue.length > 0 && !L.value && (L.value = true), me(o.inputValue); }, ot = (oe) => { if (o.inputValue = oe.target.value, e10.remote) ht(); else return Qe(); }, ht = r7(() => { Qe(); }, ee.value), vt = (oe) => { Y0(e10.modelValue, oe) || t(Yv, oe); }, nt = (oe) => n7(oe, (Ce) => !o.disabledOptions.has(Ce)), ft = (oe) => { if (e10.multiple && oe.code !== hc.delete && oe.target.value.length <= 0) { const Ce = zi(e10.modelValue).slice(), Be = nt(Ce); if (Be < 0) return; const Xe = Ce[Be]; Ce.splice(Be, 1), t(Ko, Ce), vt(Ce), t("remove-tag", Xe); } }, Pe = (oe, Ce) => { const Be = o.selected.indexOf(Ce); if (Be > -1 && !V.value) { const Xe = zi(e10.modelValue).slice(); Xe.splice(Be, 1), t(Ko, Xe), vt(Xe), t("remove-tag", Ce.value); } oe.stopPropagation(), He(); }, Ie = (oe) => { oe.stopPropagation(); const Ce = e10.multiple ? [] : G.value; if (e10.multiple) for (const Be of o.selected) Be.isDisabled && Ce.push(Be.value); t(Ko, Ce), vt(Ce), o.hoveringIndex = -1, L.value = false, t("clear"), He(); }, Ne = (oe) => { var Ce; if (e10.multiple) { const Be = zi((Ce = e10.modelValue) != null ? Ce : []).slice(), Xe = tt(Be, oe.value); Xe > -1 ? Be.splice(Xe, 1) : (e10.multipleLimit <= 0 || Be.length < e10.multipleLimit) && Be.push(oe.value), t(Ko, Be), vt(Be), oe.created && me(""), e10.filterable && !e10.reserveKeyword && (o.inputValue = ""); } else t(Ko, oe.value), vt(oe.value), L.value = false; He(), !L.value && nextTick(() => { Je(oe); }); }, tt = (oe = [], Ce) => { if (!Oi(Ce)) return oe.indexOf(Ce); const Be = e10.valueKey; let Xe = -1; return oe.some((Et, Pt) => toRaw(ho(Et, Be)) === ho(Ce, Be) ? (Xe = Pt, true) : false), Xe; }, Je = (oe) => { var Ce, Be, Xe, Et, Pt; const It = Ni(oe) ? oe[0] : oe; let kt = null; if (It != null && It.value) { const qt = Q.value.filter((Ot) => Ot.value === It.value); qt.length > 0 && (kt = qt[0].$el); } if (u.value && kt) { const qt = (Et = (Xe = (Be = (Ce = u.value) == null ? void 0 : Ce.popperRef) == null ? void 0 : Be.contentRef) == null ? void 0 : Xe.querySelector) == null ? void 0 : Et.call(Xe, `.${a.be("dropdown", "wrap")}`); qt && h7(qt, kt); } (Pt = w.value) == null || Pt.handleScroll(); }, it = (oe) => { o.options.set(oe.value, oe), o.cachedOptions.set(oe.value, oe), oe.disabled && o.disabledOptions.set(oe.value, oe); }, at = (oe, Ce) => { o.options.get(oe) === Ce && o.options.delete(oe); }, Tt = computed(() => { var oe, Ce; return (Ce = (oe = u.value) == null ? void 0 : oe.popperRef) == null ? void 0 : Ce.contentRef; }), gt = () => { o.isBeforeHide = false, nextTick(() => Je(o.selected)); }, He = () => { var oe; (oe = d.value) == null || oe.focus(); }, pt = () => { var oe; (oe = d.value) == null || oe.blur(); }, bt = (oe) => { Ie(oe); }, Ke = () => { L.value = false, M.value && pt(); }, st = () => { o.inputValue.length > 0 ? o.inputValue = "" : L.value = false; }, rt = () => { V.value || (H0 && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : L.value = !L.value); }, ct = () => { L.value ? Q.value[o.hoveringIndex] && Ne(Q.value[o.hoveringIndex]) : rt(); }, X = (oe) => Oi(oe.value) ? ho(oe.value, e10.valueKey) : oe.value, se = computed(() => Q.value.filter((oe) => oe.visible).every((oe) => oe.disabled)), ie = computed(() => e10.multiple ? e10.collapseTags ? o.selected.slice(0, e10.maxCollapseTags) : o.selected : []), fe = computed(() => e10.multiple ? e10.collapseTags ? o.selected.slice(e10.maxCollapseTags) : [] : []), ke = (oe) => { if (!L.value) { L.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || k.value) && !se.value) { oe === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : oe === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Ce = Q.value[o.hoveringIndex]; (Ce.disabled === true || Ce.states.groupDisabled === true || !Ce.visible) && ke(oe), nextTick(() => Je(F.value)); } }, _e = () => { if (!s.value) return 0; const oe = window.getComputedStyle(s.value); return Number.parseFloat(oe.gap || "6px"); }, Ge = computed(() => { const oe = _e(); return { maxWidth: `${y.value && e10.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - oe : o.selectionWidth}px` }; }), je = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), Ee = computed(() => ({ width: `${Math.max(o.calculatorWidth, UH)}px` })); return Wo(s, Re), Wo(h, We), Wo(m, Ve), Wo(S, Ve), Wo(g, qe), Wo(y, Me), onMounted(() => { ze(); }), { inputId: O, contentId: n, nsSelect: a, nsInput: i, states: o, isFocused: M, expanded: L, optionsArray: Q, hoverOption: F, selectSize: Z, filteredOptionsCount: ae, resetCalculatorWidth: We, updateTooltip: Ve, updateTagTooltip: qe, debouncedOnInputChange: ht, onInput: ot, deletePrevTag: ft, deleteTag: Pe, deleteSelected: Ie, handleOptionSelect: Ne, scrollToOption: Je, hasModelValue: z, shouldShowPlaceholder: pe, currentPlaceholder: ge, mouseEnterEventName: ve, showClose: P, iconComponent: R, iconReverse: H, validateState: B, validateIcon: W, showNewOption: j, updateOptions: U, collapseTagSize: le, setSelected: ze, selectDisabled: V, emptyText: re, handleCompositionStart: x, handleCompositionUpdate: _, handleCompositionEnd: T, onOptionCreate: it, onOptionDestroy: at, handleMenuEnter: gt, focus: He, blur: pt, handleClearClick: bt, handleClickOutside: Ke, handleEsc: st, toggleMenu: rt, selectOption: ct, getValueKey: X, navigateOptions: ke, dropdownMenuVisible: J, showTagList: ie, collapseTagList: fe, tagStyle: Ge, collapseTagStyle: je, inputStyle: Ee, popperRef: Tt, inputRef: d, tooltipRef: u, tagTooltipRef: f, calculatorRef: h, prefixRef: p, suffixRef: v, selectRef: l, wrapperRef: S, selectionRef: s, scrollbarRef: w, menuRef: m, tagMenuRef: g, collapseItemRef: y }; }; var VH = defineComponent({ name: "ElOptions", setup(e10, { slots: t }) { const r = inject(rp); let n = []; return () => { var a, i; const o = (a = t.default) == null ? void 0 : a.call(t), l = []; function s(u) { Ni(u) && u.forEach((f) => { var d, h, p, v; const m = (d = (f == null ? void 0 : f.type) || {}) == null ? void 0 : d.name; m === "ElOptionGroup" ? s(!Uu(f.children) && !Ni(f.children) && ua((h = f.children) == null ? void 0 : h.default) ? (p = f.children) == null ? void 0 : p.default() : f.children) : m === "ElOption" ? l.push((v = f.props) == null ? void 0 : v.value) : Ni(f.children) && s(f.children); }); } return o.length && s((i = o[0]) == null ? void 0 : i.children), Y0(l, n) || (n = l, r && (r.states.optionValues = l)), o; }; } }); var qH = qr({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: t5, effect: { type: dr(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: dr(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: ma.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Tu, default: I3 }, fitInputWidth: Boolean, suffixIcon: { type: Tu, default: p7 }, tagType: { ...ty.type, default: "info" }, tagEffect: { ...ty.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: dr(String), values: Xv, default: "bottom-start" }, fallbackPlacements: { type: dr(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...uN, ...Qv(["ariaLabel"]) }); var Xw = "ElSelect"; var WH = defineComponent({ name: Xw, componentName: Xw, components: { ElSelectMenu: jH, ElOption: $1, ElOptions: VH, ElTag: dH, ElScrollbar: FN, ElTooltip: c5, ElIcon: Lu }, directives: { ClickOutside: lH }, props: qH, emits: [ Ko, Yv, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(e10, { emit: t }) { const r = computed(() => { const { modelValue: i, multiple: o } = e10, l = o ? [] : void 0; return Ni(i) ? o ? i : l : o ? l : i; }), n = reactive({ ...toRefs(e10), modelValue: r }), a = GH(n, t); return provide(rp, reactive({ props: n, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: r }; } }); function ZH(e10, t, r, n, a, i) { const o = resolveComponent("el-tag"), l = resolveComponent("el-tooltip"), s = resolveComponent("el-icon"), u = resolveComponent("el-option"), f = resolveComponent("el-options"), d = resolveComponent("el-scrollbar"), h = resolveComponent("el-select-menu"), p = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([e10.nsSelect.b(), e10.nsSelect.m(e10.selectSize)]), [toHandlerKey(e10.mouseEnterEventName)]: (v) => e10.states.inputHovering = true, onMouseleave: (v) => e10.states.inputHovering = false }, [ createVNode(l, { ref: "tooltipRef", visible: e10.dropdownMenuVisible, placement: e10.placement, teleported: e10.teleported, "popper-class": [e10.nsSelect.e("popper"), e10.popperClass], "popper-options": e10.popperOptions, "fallback-placements": e10.fallbackPlacements, effect: e10.effect, pure: "", trigger: "click", transition: `${e10.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: e10.persistent, "append-to": e10.appendTo, onBeforeShow: e10.handleMenuEnter, onHide: (v) => e10.states.isBeforeHide = false }, { default: withCtx(() => { var v; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ e10.nsSelect.e("wrapper"), e10.nsSelect.is("focused", e10.isFocused), e10.nsSelect.is("hovering", e10.states.inputHovering), e10.nsSelect.is("filterable", e10.filterable), e10.nsSelect.is("disabled", e10.selectDisabled) ]), onClick: withModifiers(e10.toggleMenu, ["prevent"]) }, [ e10.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(e10.nsSelect.e("prefix")) }, [ renderSlot(e10.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ e10.nsSelect.e("selection"), e10.nsSelect.is("near", e10.multiple && !e10.$slots.prefix && !!e10.states.selected.length) ]) }, [ e10.multiple ? renderSlot(e10.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.showTagList, (m) => (openBlock(), createElementBlock("div", { key: e10.getValueKey(m), class: normalizeClass(e10.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !e10.selectDisabled && !m.isDisabled, size: e10.collapseTagSize, type: e10.tagType, effect: e10.tagEffect, "disable-transitions": "", style: normalizeStyle(e10.tagStyle), onClose: (g) => e10.deleteTag(g, m) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(e10.nsSelect.e("tags-text")) }, [ renderSlot(e10.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ createTextVNode(toDisplayString(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), e10.collapseTags && e10.states.selected.length > e10.maxCollapseTags ? (openBlock(), createBlock(l, { key: 0, ref: "tagTooltipRef", disabled: e10.dropdownMenuVisible || !e10.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: e10.effect, placement: "bottom", teleported: e10.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(e10.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: e10.collapseTagSize, type: e10.tagType, effect: e10.tagEffect, "disable-transitions": "", style: normalizeStyle(e10.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(e10.nsSelect.e("tags-text")) }, " + " + toDisplayString(e10.states.selected.length - e10.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(e10.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.collapseTagList, (m) => (openBlock(), createElementBlock("div", { key: e10.getValueKey(m), class: normalizeClass(e10.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !e10.selectDisabled && !m.isDisabled, size: e10.collapseTagSize, type: e10.tagType, effect: e10.tagEffect, "disable-transitions": "", onClose: (g) => e10.deleteTag(g, m) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(e10.nsSelect.e("tags-text")) }, [ renderSlot(e10.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ createTextVNode(toDisplayString(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), e10.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ e10.nsSelect.e("selected-item"), e10.nsSelect.e("input-wrapper"), e10.nsSelect.is("hidden", !e10.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: e10.inputId, ref: "inputRef", "onUpdate:modelValue": (m) => e10.states.inputValue = m, type: "text", name: e10.name, class: normalizeClass([e10.nsSelect.e("input"), e10.nsSelect.is(e10.selectSize)]), disabled: e10.selectDisabled, autocomplete: e10.autocomplete, style: normalizeStyle(e10.inputStyle), role: "combobox", readonly: !e10.filterable, spellcheck: "false", "aria-activedescendant": ((v = e10.hoverOption) == null ? void 0 : v.id) || "", "aria-controls": e10.contentId, "aria-expanded": e10.dropdownMenuVisible, "aria-label": e10.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((m) => e10.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((m) => e10.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(e10.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(e10.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(e10.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: e10.handleCompositionStart, onCompositionupdate: e10.handleCompositionUpdate, onCompositionend: e10.handleCompositionEnd, onInput: e10.onInput, onClick: withModifiers(e10.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, e10.states.inputValue] ]), e10.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(e10.nsSelect.e("input-calculator")), textContent: toDisplayString(e10.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), e10.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ e10.nsSelect.e("selected-item"), e10.nsSelect.e("placeholder"), e10.nsSelect.is("transparent", !e10.hasModelValue || e10.expanded && !e10.states.inputValue) ]) }, [ e10.hasModelValue ? renderSlot(e10.$slots, "label", { key: 0, label: e10.currentPlaceholder, value: e10.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(e10.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(e10.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(e10.nsSelect.e("suffix")) }, [ e10.iconComponent && !e10.showClose ? (openBlock(), createBlock(s, { key: 0, class: normalizeClass([e10.nsSelect.e("caret"), e10.nsSelect.e("icon"), e10.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(e10.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), e10.showClose && e10.clearIcon ? (openBlock(), createBlock(s, { key: 1, class: normalizeClass([ e10.nsSelect.e("caret"), e10.nsSelect.e("icon"), e10.nsSelect.e("clear") ]), onClick: e10.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(e10.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), e10.validateState && e10.validateIcon ? (openBlock(), createBlock(s, { key: 2, class: normalizeClass([e10.nsInput.e("icon"), e10.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(e10.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(h, { ref: "menuRef" }, { default: withCtx(() => [ e10.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(e10.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(e10.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(d, { id: e10.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": e10.nsSelect.be("dropdown", "wrap"), "view-class": e10.nsSelect.be("dropdown", "list"), class: normalizeClass([e10.nsSelect.is("empty", e10.filteredOptionsCount === 0)]), role: "listbox", "aria-label": e10.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ e10.showNewOption ? (openBlock(), createBlock(u, { key: 0, value: e10.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(f, null, { default: withCtx(() => [ renderSlot(e10.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, e10.states.options.size > 0 && !e10.loading] ]), e10.$slots.loading && e10.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(e10.nsSelect.be("dropdown", "loading")) }, [ renderSlot(e10.$slots, "loading") ], 2)) : e10.loading || e10.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(e10.nsSelect.be("dropdown", "empty")) }, [ renderSlot(e10.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(e10.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), e10.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(e10.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(e10.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [p, e10.handleClickOutside, e10.popperRef] ]); } var YH = jr(WH, [["render", ZH], ["__file", "select.vue"]]); var XH = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(e10) { const t = on("select"), r = ref(null), n = getCurrentInstance(), a = ref([]); provide(b5, reactive({ ...toRefs(e10) })); const i = computed(() => a.value.some((u) => u.visible === true)), o = (u) => { var f, d; return ((f = u.type) == null ? void 0 : f.name) === "ElOption" && !!((d = u.component) != null && d.proxy); }, l = (u) => { const f = zi(u), d = []; return f.forEach((h) => { var p, v; o(h) ? d.push(h.component.proxy) : (p = h.children) != null && p.length ? d.push(...l(h.children)) : (v = h.component) != null && v.subTree && d.push(...l(h.component.subTree)); }), d; }, s = () => { a.value = l(n.subTree); }; return onMounted(() => { s(); }), sP(r, s, { attributes: true, subtree: true, childList: true }), { groupRef: r, visible: i, ns: t }; } }); function KH(e10, t, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(e10.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(e10.ns.be("group", "title")) }, toDisplayString(e10.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(e10.ns.b("group")) }, [ renderSlot(e10.$slots, "default") ], 2) ]) ], 2)), [ [vShow, e10.visible] ]); } var _5 = jr(XH, [["render", KH], ["__file", "option-group.vue"]]); var Vu = gi(YH, { Option: $1, OptionGroup: _5 }); var qu = Zv($1); Zv(_5); var JH = qr({ trigger: mc.trigger, placement: Om.placement, disabled: mc.disabled, visible: ma.visible, transition: ma.transition, popperOptions: Om.popperOptions, tabindex: Om.tabindex, content: ma.content, popperStyle: ma.popperStyle, popperClass: ma.popperClass, enterable: { ...ma.enterable, default: true }, effect: { ...ma.effect, default: "light" }, teleported: ma.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var QH = { "update:visible": (e10) => g1(e10), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var eB = "onUpdate:visible"; var tB = defineComponent({ name: "ElPopover" }); var rB = defineComponent({ ...tB, props: JH, emits: QH, setup(e10, { expose: t, emit: r }) { const n = e10, a = computed(() => n[eB]), i = on("popover"), o = ref(), l = computed(() => { var g; return (g = unref(o)) == null ? void 0 : g.popperRef; }), s = computed(() => [ { width: ev(n.width) }, n.popperStyle ]), u = computed(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), f = computed(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => { var g; (g = o.value) == null || g.hide(); }, h = () => { r("before-enter"); }, p = () => { r("before-leave"); }, v = () => { r("after-enter"); }, m = () => { r("update:visible", false), r("after-leave"); }; return t({ popperRef: l, hide: d }), (g, y) => (openBlock(), createBlock(unref(c5), mergeProps({ ref_key: "tooltipRef", ref: o }, g.$attrs, { trigger: g.trigger, placement: g.placement, disabled: g.disabled, visible: g.visible, transition: g.transition, "popper-options": g.popperOptions, tabindex: g.tabindex, content: g.content, offset: g.offset, "show-after": g.showAfter, "hide-after": g.hideAfter, "auto-close": g.autoClose, "show-arrow": g.showArrow, "aria-label": g.title, effect: g.effect, enterable: g.enterable, "popper-class": unref(u), "popper-style": unref(s), teleported: g.teleported, persistent: g.persistent, "gpu-acceleration": unref(f), "onUpdate:visible": unref(a), onBeforeShow: h, onBeforeHide: p, onShow: v, onHide: m }), { content: withCtx(() => [ g.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).e("title")), role: "title" }, toDisplayString(g.title), 3)) : createCommentVNode("v-if", true), renderSlot(g.$slots, "default", {}, () => [ createTextVNode(toDisplayString(g.content), 1) ]) ]), default: withCtx(() => [ g.$slots.reference ? renderSlot(g.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var nB = jr(rB, [["__file", "popover.vue"]]); var Kw = (e10, t) => { const r = t.arg || t.value, n = r == null ? void 0 : r.popperRef; n && (n.triggerRef = e10); }; var aB = { mounted(e10, t) { Kw(e10, t); }, updated(e10, t) { Kw(e10, t); } }; var iB = "popover"; var oB = A7(aB, iB); var z1 = gi(nB, { directive: oB }); var x5 = (e10, t) => { const r = e10.__vccOpts || e10; for (const [n, a] of t) r[n] = a; return r; }; var lB = ["xlink:href"]; var sB = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: true }, /** * The option to spin the icon. */ spin: { type: Boolean, default: false } }, setup(e10) { return (t, r) => (openBlock(), createElementBlock("svg", { class: normalizeClass(["map-icon", { "map-icon-spin": e10.spin }]) }, [ createBaseVNode("use", { "xlink:href": `#${e10.icon}` }, null, 8, lB) ], 2)); } }; var uB = x5(sB, [["__scopeId", "data-v-e172d5ff"]]); var w5 = ` 2horpanel ? `; var T5 = ` 2vertpanel ? `; var k5 = ` 3panel ? `; var A5 = ` 4panel ? `; var M5 = ` 2horpanel ? `; var S5 = ` 2horpanel ? `; var C5 = ` 4panel ? `; var L5 = ` changeBckgd `; var D5 = ` close no bk `; var E5 = ` close `; var F5 = ` closeFullScreen `; var R5 = ` Comment `; var P5 = ` Connection `; var $5 = ` dock `; var z5 = ` drawLine `; var I5 = ` drawPoint `; var N5 = ` drawPolygon `; var O5 = ` drawTrash `; var H5 = ` fitWindow `; var B5 = ` fullScreen `; var j5 = 'DataPortal-Icons'; var U5 = ` magnifyingGlass `; var G5 = `Created by Wahyu Prihantorofrom the Noun Project`; var V5 = ` openMap `; var q5 = ` Artboard Copy 6 `; var W5 = ` permalink `; var Z5 = ` play `; var Y5 = ` resetZoom `; var X5 = ` singlepanel ? `; var K5 = ` tooltips ? `; var J5 = ` undock `; var Q5 = ` zoomIn `; var eC = ` zoomOut `; var tC = (e10, t, r, n) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || []; let l = document.createElement("div"); l.innerHTML = e10, a.map((u) => { const f = l.querySelector(u); f && f.remove(); }), i.map((u) => { l.querySelector("svg").removeAttribute(u); }), n && o.map((u) => { Object.values(l.querySelectorAll(`[${u}]`)).map((f) => { f.removeAttribute(u); }); }); const s = l.innerHTML; return l = null, s; }; var rC = (e10) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((t, r) => "".replace.apply(t, r), e10).trim(); var fB = true; var cB = true; var dB = ["fill"]; var ry = Object.assign({ "/assets/icons/2horpanel.svg": w5, "/assets/icons/2vertpanel.svg": T5, "/assets/icons/3panel.svg": k5, "/assets/icons/4panel.svg": A5, "/assets/icons/5panel.svg": M5, "/assets/icons/6panel.svg": S5, "/assets/icons/6panelVertical.svg": C5, "/assets/icons/changeBckgd.svg": L5, "/assets/icons/close-no-bk.svg": D5, "/assets/icons/close.svg": E5, "/assets/icons/closeFullScreen.svg": F5, "/assets/icons/comment.svg": R5, "/assets/icons/connection.svg": P5, "/assets/icons/dock.svg": $5, "/assets/icons/drawLine.svg": z5, "/assets/icons/drawPoint.svg": I5, "/assets/icons/drawPolygon.svg": N5, "/assets/icons/drawTrash.svg": O5, "/assets/icons/fitWindow.svg": H5, "/assets/icons/fullScreen.svg": B5, "/assets/icons/help.svg": j5, "/assets/icons/magnifyingGlass.svg": U5, "/assets/icons/noun-filter.svg": G5, "/assets/icons/openMap.svg": V5, "/assets/icons/pause.svg": q5, "/assets/icons/permalink.svg": W5, "/assets/icons/play.svg": Z5, "/assets/icons/resetZoom.svg": Y5, "/assets/icons/singlepanel.svg": X5, "/assets/icons/tooltips.svg": K5, "/assets/icons/undock.svg": J5, "/assets/icons/zoomIn.svg": Q5, "/assets/icons/zoomOut.svg": eC }); var hB = Object.keys(ry).map((e10) => { const t = tC(ry[e10], fB, cB, dB), r = e10.replace(/^.+\/(\w+).svg$/, "$1"); return rC(t).replace("", "symbol>"); }); hB.join(` `); var ny = Object.assign({ "/assets/icons/2horpanel.svg": w5, "/assets/icons/2vertpanel.svg": T5, "/assets/icons/3panel.svg": k5, "/assets/icons/4panel.svg": A5, "/assets/icons/5panel.svg": M5, "/assets/icons/6panel.svg": S5, "/assets/icons/6panelVertical.svg": C5, "/assets/icons/changeBckgd.svg": L5, "/assets/icons/close-no-bk.svg": D5, "/assets/icons/close.svg": E5, "/assets/icons/closeFullScreen.svg": F5, "/assets/icons/comment.svg": R5, "/assets/icons/connection.svg": P5, "/assets/icons/dock.svg": $5, "/assets/icons/drawLine.svg": z5, "/assets/icons/drawPoint.svg": I5, "/assets/icons/drawPolygon.svg": N5, "/assets/icons/drawTrash.svg": O5, "/assets/icons/fitWindow.svg": H5, "/assets/icons/fullScreen.svg": B5, "/assets/icons/help.svg": j5, "/assets/icons/magnifyingGlass.svg": U5, "/assets/icons/noun-filter.svg": G5, "/assets/icons/openMap.svg": V5, "/assets/icons/pause.svg": q5, "/assets/icons/permalink.svg": W5, "/assets/icons/play.svg": Z5, "/assets/icons/resetZoom.svg": Y5, "/assets/icons/singlepanel.svg": X5, "/assets/icons/tooltips.svg": K5, "/assets/icons/undock.svg": J5, "/assets/icons/zoomIn.svg": Q5, "/assets/icons/zoomOut.svg": eC }); var vB = Object.keys(ny).map((e10) => { const t = tC(ny[e10]), r = e10.replace(/^.+\/(\w+).svg$/, "$1"); return rC(t).replace("", "symbol>"); }); var pB = { name: "MapSvgSpriteColor", svgContext: ny, svgSprite: vB.join(` `) // concatenate all symbols into $options.svgSprite }; var mB = ["innerHTML"]; function gB(e10, t, r, n, a, i) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: e10.$options.svgSprite }, null, 8, mB); } var yB = x5(pB, [["render", gB]]); var np = (e10, t) => { const r = e10.__vccOpts || e10; for (const [n, a] of t) r[n] = a; return r; }; var bB = { name: "PlotControls", components: { MapSvgSpriteColor: yB, MapSvgIcon: uB, ElSelect: Vu, ElOption: qu, ElCollapse: g5, ElCollapseItem: y5, ElButton: Gc, ElPopover: z1 }, props: { parentElement: { type: Object, required: true }, controlsEnabled: { type: Boolean, required: true } }, data: function() { return { hoverVisibilities: [{ value: false }, { value: false }, { value: false }, { value: false }, { value: false }], zoomSelect: [ { value: "1", label: "100%" } ], selectZoom: "100%", zoom: 100, maxZoom: 800, zoomInDisabled: false, zoomOutDisabled: true }; }, methods: { // zoomIn: Find and click the plotly modebar 'zoom in' zoomIn: function() { this.zoom += 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="in"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, // zoomOut: Find and click the plotly modebar 'zoom out' zoomOut: function() { this.zoom -= 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="out"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, // setDisabledButtons(zoomLevel): Disable buttons once they hit max zoom setDisabledButtons(e10) { e10 >= this.maxZoom ? this.zoomInDisabled = true : this.zoomInDisabled = false, e10 <= 0 ? this.zoomOutDisabled = true : this.zoomOutDisabled = false; }, resetView: function() { this.zoom = 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="reset"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, percentToNum(e10) { return Number(e10.slice(0, -1)); }, selectZoomChange: function(e10) { if (e10 === "100%") { this.resetView(); return; } let t = this.percentToNum(e10), r = Math.round((t - this.zoom) / 100); for (let n = 0; n < Math.abs(r); n++) r > 0 ? this.zoomIn() : this.zoomOut(); this.updateZoomSelect(t); }, updateZoomSelect(e10) { this.selectZoom = String(e10) + "%"; }, createZoomPercentages: function() { this.zoomSelect = []; for (let e10 = 0; e10 <= this.maxZoom / 100; e10++) this.zoomSelect.push({ value: e10, label: (e10 + 1) * 100 + "%" }); }, setHelpMode: function(e10) { e10 ? (this.inHelp = true, this.hoverVisibilities.forEach((t) => { t.value = true; })) : (this.inHelp = false, this.hoverVisibilities.forEach((t) => { t.value = false; })); }, showToolitip: function(e10) { this.inHelp || (this.hoverVisibilities[e10].value = true, this.tooltipWait = setTimeout(() => { this.hoverVisibilities[e10].value = true; }, 1e3)); }, hideToolitip: function(e10) { this.inHelp || (this.hoverVisibilities[e10].value = false, clearInterval(this.tooltipWait)); }, handleWheel: function(e10) { let t = Math.round(e10.deltaY / 7); this.zoom = this.zoom - t, this.updateZoomSelect(this.zoom); } }, mounted: function() { this.createZoomPercentages(), setTimeout(() => { this.parentElement.element.addEventListener("wheel", this.handleWheel); }, 1e3); }, beforeUnmount: function() { this.parentElement.element.removeEventListener("wheel", this.handleWheel); } }; var _B = { class: "container" }; function xB(e10, t, r, n, a, i) { const o = resolveComponent("map-svg-sprite-color"), l = resolveComponent("map-svg-icon"), s = z1, u = qu, f = Vu; return openBlock(), createElementBlock("div", _B, [ createVNode(o), createBaseVNode("div", { ref: "zoomControls", class: normalizeClass([{ inactive: !r.controlsEnabled }, "bottom-right-control"]) }, [ createVNode(s, { modelValue: e10.hoverVisibilities[0].value, "onUpdate:modelValue": t[3] || (t[3] = (d) => e10.hoverVisibilities[0].value = d), content: "Zoom in", placement: "left", teleported: false, trigger: "manual", "popper-class": "plot-popper" }, { reference: withCtx(() => [ createVNode(l, { icon: "zoomIn", class: "icon-button zoomIn", onClick: t[0] || (t[0] = (d) => i.zoomIn()), onMouseover: t[1] || (t[1] = (d) => i.showToolitip(0)), onMouseout: t[2] || (t[2] = (d) => i.hideToolitip(0)) }) ]), _: 1 }, 8, ["modelValue"]), createVNode(s, { modelValue: e10.hoverVisibilities[1].value, "onUpdate:modelValue": t[7] || (t[7] = (d) => e10.hoverVisibilities[1].value = d), content: "Zoom out", placement: "top-end", teleported: false, trigger: "manual", "popper-class": "plot-popper popper-zoomout" }, { reference: withCtx(() => [ createVNode(l, { icon: "zoomOut", class: "icon-button zoomOut", onClick: t[4] || (t[4] = (d) => i.zoomOut()), onMouseover: t[5] || (t[5] = (d) => i.showToolitip(1)), onMouseout: t[6] || (t[6] = (d) => i.hideToolitip(1)) }) ]), _: 1 }, 8, ["modelValue"]), createVNode(f, { size: "small", modelValue: e10.selectZoom, "onUpdate:modelValue": t[8] || (t[8] = (d) => e10.selectZoom = d), placeholder: "100%", class: "zoomSelect", onChange: i.selectZoomChange }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.zoomSelect, (d) => (openBlock(), createBlock(u, { key: d.value, label: d.label, value: d.label }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue", "onChange"]), createVNode(s, { modelValue: e10.hoverVisibilities[2].value, "onUpdate:modelValue": t[12] || (t[12] = (d) => e10.hoverVisibilities[2].value = d), content: "Reset", placement: "top", teleported: false, trigger: "manual", "popper-class": "plot-popper" }, { reference: withCtx(() => [ createVNode(l, { icon: "resetZoom", class: "icon-button resetView", onClick: t[9] || (t[9] = (d) => i.resetView()), onMouseover: t[10] || (t[10] = (d) => i.showToolitip(2)), onMouseout: t[11] || (t[11] = (d) => i.hideToolitip(2)) }) ]), _: 1 }, 8, ["modelValue"]) ], 2) ]); } var qc = np(bB, [["render", xB], ["__scopeId", "data-v-2ec1d0d2"]]); var nC = {}; var ap = {}; ap.version = "2.28.0"; var wB = { exports: {} }; (function(e10) { (function(r, n, a) { n[r] = n[r] || a(), e10.exports && (e10.exports = n[r]); })("Promise", Wl, function() { var r, n, a, i = Object.prototype.toString, o = typeof setImmediate < "u" ? function(k) { return setImmediate(k); } : setTimeout; try { Object.defineProperty({}, "x", {}), r = function(k, x, _, T) { return Object.defineProperty(k, x, { value: _, writable: true, configurable: T !== false }); }; } catch { r = function(x, _, T) { return x[_] = T, x; }; } a = /* @__PURE__ */ function() { var k, x, _; function T(S, M) { this.fn = S, this.self = M, this.next = void 0; } return { add: function(M, L) { _ = new T(M, L), x ? x.next = _ : k = _, x = _, _ = void 0; }, drain: function() { var M = k; for (k = x = n = void 0; M; ) M.fn.call(M.self), M = M.next; } }; }(); function l(w, k) { a.add(w, k), n || (n = o(a.drain)); } function s(w) { var k, x = typeof w; return w != null && (x == "object" || x == "function") && (k = w.then), typeof k == "function" ? k : false; } function u() { for (var w = 0; w < this.chain.length; w++) f( this, this.state === 1 ? this.chain[w].success : this.chain[w].failure, this.chain[w] ); this.chain.length = 0; } function f(w, k, x) { var _, T; try { k === false ? x.reject(w.msg) : (k === true ? _ = w.msg : _ = k.call(void 0, w.msg), _ === x.promise ? x.reject(TypeError("Promise-chain cycle")) : (T = s(_)) ? T.call(_, x.resolve, x.reject) : x.resolve(_)); } catch (S) { x.reject(S); } } function d(w) { var k, x = this; if (!x.triggered) { x.triggered = true, x.def && (x = x.def); try { (k = s(w)) ? l(function() { var _ = new v(x); try { k.call( w, function() { d.apply(_, arguments); }, function() { h.apply(_, arguments); } ); } catch (T) { h.call(_, T); } }) : (x.msg = w, x.state = 1, x.chain.length > 0 && l(u, x)); } catch (_) { h.call(new v(x), _); } } } function h(w) { var k = this; k.triggered || (k.triggered = true, k.def && (k = k.def), k.msg = w, k.state = 2, k.chain.length > 0 && l(u, k)); } function p(w, k, x, _) { for (var T = 0; T < k.length; T++) (function(M) { w.resolve(k[M]).then( function(F) { x(M, F); }, _ ); })(T); } function v(w) { this.def = w, this.triggered = false; } function m(w) { this.promise = w, this.state = 0, this.triggered = false, this.chain = [], this.msg = void 0; } function g(w) { if (typeof w != "function") throw TypeError("Not a function"); if (this.__NPO__ !== 0) throw TypeError("Not a promise"); this.__NPO__ = 1; var k = new m(this); this.then = function(_, T) { var S = { success: typeof _ == "function" ? _ : true, failure: typeof T == "function" ? T : false }; return S.promise = new this.constructor(function(L, F) { if (typeof L != "function" || typeof F != "function") throw TypeError("Not a function"); S.resolve = L, S.reject = F; }), k.chain.push(S), k.state !== 0 && l(u, k), S.promise; }, this.catch = function(_) { return this.then(void 0, _); }; try { w.call( void 0, function(_) { d.call(k, _); }, function(_) { h.call(k, _); } ); } catch (x) { h.call(k, x); } } var y = r( {}, "constructor", g, /*configurable=*/ false ); return g.prototype = y, r( y, "__NPO__", 0, /*configurable=*/ false ), r(g, "resolve", function(k) { var x = this; return k && typeof k == "object" && k.__NPO__ === 1 ? k : new x(function(T, S) { if (typeof T != "function" || typeof S != "function") throw TypeError("Not a function"); T(k); }); }), r(g, "reject", function(k) { return new this(function(_, T) { if (typeof _ != "function" || typeof T != "function") throw TypeError("Not a function"); T(k); }); }), r(g, "all", function(k) { var x = this; return i.call(k) != "[object Array]" ? x.reject(TypeError("Not an array")) : k.length === 0 ? x.resolve([]) : new x(function(T, S) { if (typeof T != "function" || typeof S != "function") throw TypeError("Not a function"); var M = k.length, L = Array(M), F = 0; p(x, k, function(I, O) { L[I] = O, ++F === M && T(L); }, S); }); }), r(g, "race", function(k) { var x = this; return i.call(k) != "[object Array]" ? x.reject(TypeError("Not an array")) : new x(function(T, S) { if (typeof T != "function" || typeof S != "function") throw TypeError("Not a function"); p(x, k, function(L, F) { T(F); }, S); }); }), g; }); })(wB); var aC = { exports: {} }; var iC = { exports: {} }; (function(e10) { (function() { var t = { version: "3.8.0" }, r = [].slice, n = function(c) { return r.call(c); }, a = self.document; function i(c) { return c && (c.ownerDocument || c.document || c).documentElement; } function o(c) { return c && (c.ownerDocument && c.ownerDocument.defaultView || c.document && c || c.defaultView); } if (a) try { n(a.documentElement.childNodes)[0].nodeType; } catch { n = function(b) { for (var A = b.length, C = new Array(A); A--; ) C[A] = b[A]; return C; }; } if (Date.now || (Date.now = function() { return +/* @__PURE__ */ new Date(); }), a) try { a.createElement("DIV").style.setProperty("opacity", 0, ""); } catch { var l = this.Element.prototype, s = l.setAttribute, u = l.setAttributeNS, f = this.CSSStyleDeclaration.prototype, d = f.setProperty; l.setAttribute = function(b, A) { s.call(this, b, A + ""); }, l.setAttributeNS = function(b, A, C) { u.call(this, b, A, C + ""); }, f.setProperty = function(b, A, C) { d.call(this, b, A + "", C); }; } t.ascending = h; function h(c, b) { return c < b ? -1 : c > b ? 1 : c >= b ? 0 : NaN; } t.descending = function(c, b) { return b < c ? -1 : b > c ? 1 : b >= c ? 0 : NaN; }, t.min = function(c, b) { var A = -1, C = c.length, D, E; if (arguments.length === 1) { for (; ++A < C; ) if ((E = c[A]) != null && E >= E) { D = E; break; } for (; ++A < C; ) (E = c[A]) != null && D > E && (D = E); } else { for (; ++A < C; ) if ((E = b.call(c, c[A], A)) != null && E >= E) { D = E; break; } for (; ++A < C; ) (E = b.call(c, c[A], A)) != null && D > E && (D = E); } return D; }, t.max = function(c, b) { var A = -1, C = c.length, D, E; if (arguments.length === 1) { for (; ++A < C; ) if ((E = c[A]) != null && E >= E) { D = E; break; } for (; ++A < C; ) (E = c[A]) != null && E > D && (D = E); } else { for (; ++A < C; ) if ((E = b.call(c, c[A], A)) != null && E >= E) { D = E; break; } for (; ++A < C; ) (E = b.call(c, c[A], A)) != null && E > D && (D = E); } return D; }, t.extent = function(c, b) { var A = -1, C = c.length, D, E, q; if (arguments.length === 1) { for (; ++A < C; ) if ((E = c[A]) != null && E >= E) { D = q = E; break; } for (; ++A < C; ) (E = c[A]) != null && (D > E && (D = E), q < E && (q = E)); } else { for (; ++A < C; ) if ((E = b.call(c, c[A], A)) != null && E >= E) { D = q = E; break; } for (; ++A < C; ) (E = b.call(c, c[A], A)) != null && (D > E && (D = E), q < E && (q = E)); } return [D, q]; }; function p(c) { return c === null ? NaN : +c; } function v(c) { return !isNaN(c); } t.sum = function(c, b) { var A = 0, C = c.length, D, E = -1; if (arguments.length === 1) for (; ++E < C; ) v(D = +c[E]) && (A += D); else for (; ++E < C; ) v(D = +b.call(c, c[E], E)) && (A += D); return A; }, t.mean = function(c, b) { var A = 0, C = c.length, D, E = -1, q = C; if (arguments.length === 1) for (; ++E < C; ) v(D = p(c[E])) ? A += D : --q; else for (; ++E < C; ) v(D = p(b.call(c, c[E], E))) ? A += D : --q; if (q) return A / q; }, t.quantile = function(c, b) { var A = (c.length - 1) * b + 1, C = Math.floor(A), D = +c[C - 1], E = A - C; return E ? D + E * (c[C] - D) : D; }, t.median = function(c, b) { var A = [], C = c.length, D, E = -1; if (arguments.length === 1) for (; ++E < C; ) v(D = p(c[E])) && A.push(D); else for (; ++E < C; ) v(D = p(b.call(c, c[E], E))) && A.push(D); if (A.length) return t.quantile(A.sort(h), 0.5); }, t.variance = function(c, b) { var A = c.length, C = 0, D, E, q = 0, N = -1, Y = 0; if (arguments.length === 1) for (; ++N < A; ) v(D = p(c[N])) && (E = D - C, C += E / ++Y, q += E * (D - C)); else for (; ++N < A; ) v(D = p(b.call(c, c[N], N))) && (E = D - C, C += E / ++Y, q += E * (D - C)); if (Y > 1) return q / (Y - 1); }, t.deviation = function() { var c = t.variance.apply(this, arguments); return c && Math.sqrt(c); }; function m(c) { return { left: function(b, A, C, D) { for (arguments.length < 3 && (C = 0), arguments.length < 4 && (D = b.length); C < D; ) { var E = C + D >>> 1; c(b[E], A) < 0 ? C = E + 1 : D = E; } return C; }, right: function(b, A, C, D) { for (arguments.length < 3 && (C = 0), arguments.length < 4 && (D = b.length); C < D; ) { var E = C + D >>> 1; c(b[E], A) > 0 ? D = E : C = E + 1; } return C; } }; } var g = m(h); t.bisectLeft = g.left, t.bisect = t.bisectRight = g.right, t.bisector = function(c) { return m(c.length === 1 ? function(b, A) { return h(c(b), A); } : c); }, t.shuffle = function(c, b, A) { (C = arguments.length) < 3 && (A = c.length, C < 2 && (b = 0)); for (var C = A - b, D, E; C; ) E = Math.random() * C-- | 0, D = c[C + b], c[C + b] = c[E + b], c[E + b] = D; return c; }, t.permute = function(c, b) { for (var A = b.length, C = new Array(A); A--; ) C[A] = c[b[A]]; return C; }, t.pairs = function(c) { for (var b = 0, A = c.length - 1, C = c[0], D = new Array(A < 0 ? 0 : A); b < A; ) D[b] = [C, C = c[++b]]; return D; }, t.transpose = function(c) { if (!(E = c.length)) return []; for (var b = -1, A = t.min(c, y), C = new Array(A); ++b < A; ) for (var D = -1, E, q = C[b] = new Array(E); ++D < E; ) q[D] = c[D][b]; return C; }; function y(c) { return c.length; } t.zip = function() { return t.transpose(arguments); }, t.keys = function(c) { var b = []; for (var A in c) b.push(A); return b; }, t.values = function(c) { var b = []; for (var A in c) b.push(c[A]); return b; }, t.entries = function(c) { var b = []; for (var A in c) b.push({ key: A, value: c[A] }); return b; }, t.merge = function(c) { for (var b = c.length, A, C = -1, D = 0, E, q; ++C < b; ) D += c[C].length; for (E = new Array(D); --b >= 0; ) for (q = c[b], A = q.length; --A >= 0; ) E[--D] = q[A]; return E; }; var w = Math.abs; t.range = function(c, b, A) { if (arguments.length < 3 && (A = 1, arguments.length < 2 && (b = c, c = 0)), (b - c) / A === 1 / 0) throw new Error("infinite range"); var C = [], D = k(w(A)), E = -1, q; if (c *= D, b *= D, A *= D, A < 0) for (; (q = c + A * ++E) > b; ) C.push(q / D); else for (; (q = c + A * ++E) < b; ) C.push(q / D); return C; }; function k(c) { for (var b = 1; c * b % 1; ) b *= 10; return b; } function x(c, b) { for (var A in b) Object.defineProperty(c.prototype, A, { value: b[A], enumerable: false }); } t.map = function(c, b) { var A = new _(); if (c instanceof _) c.forEach(function(N, Y) { A.set(N, Y); }); else if (Array.isArray(c)) { var C = -1, D = c.length, E; if (arguments.length === 1) for (; ++C < D; ) A.set(C, c[C]); else for (; ++C < D; ) A.set(b.call(c, E = c[C], C), E); } else for (var q in c) A.set(q, c[q]); return A; }; function _() { this._ = /* @__PURE__ */ Object.create(null); } var T = "__proto__", S = "\0"; x(_, { has: F, get: function(c) { return this._[M(c)]; }, set: function(c, b) { return this._[M(c)] = b; }, remove: $, keys: I, values: function() { var c = []; for (var b in this._) c.push(this._[b]); return c; }, entries: function() { var c = []; for (var b in this._) c.push({ key: L(b), value: this._[b] }); return c; }, size: O, empty: G, forEach: function(c) { for (var b in this._) c.call(this, L(b), this._[b]); } }); function M(c) { return (c += "") === T || c[0] === S ? S + c : c; } function L(c) { return (c += "")[0] === S ? c.slice(1) : c; } function F(c) { return M(c) in this._; } function $(c) { return (c = M(c)) in this._ && delete this._[c]; } function I() { var c = []; for (var b in this._) c.push(L(b)); return c; } function O() { var c = 0; for (var b in this._) ++c; return c; } function G() { for (var c in this._) return false; return true; } t.nest = function() { var c = {}, b = [], A = [], C, D; function E(N, Y, te) { if (te >= b.length) return D ? D.call(c, Y) : C ? Y.sort(C) : Y; for (var ne = -1, ce = Y.length, de = b[te++], Te, Ae, he, ye = new _(), be; ++ne < ce; ) (be = ye.get(Te = de(Ae = Y[ne]))) ? be.push(Ae) : ye.set(Te, [Ae]); return N ? (Ae = N(), he = function(Se, De) { Ae.set(Se, E(N, De, te)); }) : (Ae = {}, he = function(Se, De) { Ae[Se] = E(N, De, te); }), ye.forEach(he), Ae; } function q(N, Y) { if (Y >= b.length) return N; var te = [], ne = A[Y++]; return N.forEach(function(ce, de) { te.push({ key: ce, values: q(de, Y) }); }), ne ? te.sort(function(ce, de) { return ne(ce.key, de.key); }) : te; } return c.map = function(N, Y) { return E(Y, N, 0); }, c.entries = function(N) { return q(E(t.map, N, 0), 0); }, c.key = function(N) { return b.push(N), c; }, c.sortKeys = function(N) { return A[b.length - 1] = N, c; }, c.sortValues = function(N) { return C = N, c; }, c.rollup = function(N) { return D = N, c; }, c; }, t.set = function(c) { var b = new K(); if (c) for (var A = 0, C = c.length; A < C; ++A) b.add(c[A]); return b; }; function K() { this._ = /* @__PURE__ */ Object.create(null); } x(K, { has: F, add: function(c) { return this._[M(c += "")] = true, c; }, remove: $, values: I, size: O, empty: G, forEach: function(c) { for (var b in this._) c.call(this, L(b)); } }), t.behavior = {}; function V(c) { return c; } t.rebind = function(c, b) { for (var A = 1, C = arguments.length, D; ++A < C; ) c[D = arguments[A]] = z(c, b, b[D]); return c; }; function z(c, b, A) { return function() { var C = A.apply(b, arguments); return C === b ? c : C; }; } function P(c, b) { if (b in c) return b; b = b.charAt(0).toUpperCase() + b.slice(1); for (var A = 0, C = R.length; A < C; ++A) { var D = R[A] + b; if (D in c) return D; } } var R = ["webkit", "ms", "moz", "Moz", "o", "O"]; function H() { } t.dispatch = function() { for (var c = new B(), b = -1, A = arguments.length; ++b < A; ) c[arguments[b]] = W(c); return c; }; function B() { } B.prototype.on = function(c, b) { var A = c.indexOf("."), C = ""; if (A >= 0 && (C = c.slice(A + 1), c = c.slice(0, A)), c) return arguments.length < 2 ? this[c].on(C) : this[c].on(C, b); if (arguments.length === 2) { if (b == null) for (c in this) this.hasOwnProperty(c) && this[c].on(C, null); return this; } }; function W(c) { var b = [], A = new _(); function C() { for (var D = b, E = -1, q = D.length, N; ++E < q; ) (N = D[E].on) && N.apply(this, arguments); return c; } return C.on = function(D, E) { var q = A.get(D), N; return arguments.length < 2 ? q && q.on : (q && (q.on = null, b = b.slice(0, N = b.indexOf(q)).concat(b.slice(N + 1)), A.remove(D)), E && b.push(A.set(D, { on: E })), c); }, C; } t.event = null; function ee() { t.event.preventDefault(); } function re() { for (var c = t.event, b; b = c.sourceEvent; ) c = b; return c; } function ae(c) { for (var b = new B(), A = 0, C = arguments.length; ++A < C; ) b[arguments[A]] = W(b); return b.of = function(D, E) { return function(q) { try { var N = q.sourceEvent = t.event; q.target = c, t.event = q, b[q.type].apply(D, E); } finally { t.event = N; } }; }, b; } t.requote = function(c) { return c.replace(Q, "\\$&"); }; var Q = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, ue = {}.__proto__ ? function(c, b) { c.__proto__ = b; } : function(c, b) { for (var A in b) c[A] = b[A]; }; function j(c) { return ue(c, J), c; } var U = function(c, b) { return b.querySelector(c); }, Z = function(c, b) { return b.querySelectorAll(c); }, le = function(c, b) { var A = c.matches || c[P(c, "matchesSelector")]; return le = function(C, D) { return A.call(C, D); }, le(c, b); }; typeof Sizzle == "function" && (U = function(c, b) { return Sizzle(c, b)[0] || null; }, Z = Sizzle, le = Sizzle.matchesSelector), t.selection = function() { return t.select(a.documentElement); }; var J = t.selection.prototype = []; J.select = function(c) { var b = [], A, C, D, E; c = pe(c); for (var q = -1, N = this.length; ++q < N; ) { b.push(A = []), A.parentNode = (D = this[q]).parentNode; for (var Y = -1, te = D.length; ++Y < te; ) (E = D[Y]) ? (A.push(C = c.call(E, E.__data__, Y, q)), C && "__data__" in E && (C.__data__ = E.__data__)) : A.push(null); } return j(b); }; function pe(c) { return typeof c == "function" ? c : function() { return U(c, this); }; } J.selectAll = function(c) { var b = [], A, C; c = ge(c); for (var D = -1, E = this.length; ++D < E; ) for (var q = this[D], N = -1, Y = q.length; ++N < Y; ) (C = q[N]) && (b.push(A = n(c.call(C, C.__data__, N, D))), A.parentNode = C); return j(b); }; function ge(c) { return typeof c == "function" ? c : function() { return Z(c, this); }; } var ve = "http://www.w3.org/1999/xhtml", me = { svg: "http://www.w3.org/2000/svg", xhtml: ve, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; t.ns = { prefix: me, qualify: function(c) { var b = c.indexOf(":"), A = c; return b >= 0 && (A = c.slice(0, b)) !== "xmlns" && (c = c.slice(b + 1)), me.hasOwnProperty(A) ? { space: me[A], local: c } : c; } }, J.attr = function(c, b) { if (arguments.length < 2) { if (typeof c == "string") { var A = this.node(); return c = t.ns.qualify(c), c.local ? A.getAttributeNS(c.space, c.local) : A.getAttribute(c); } for (b in c) this.each(Le(b, c[b])); return this; } return this.each(Le(c, b)); }; function Le(c, b) { c = t.ns.qualify(c); function A() { this.removeAttribute(c); } function C() { this.removeAttributeNS(c.space, c.local); } function D() { this.setAttribute(c, b); } function E() { this.setAttributeNS(c.space, c.local, b); } function q() { var Y = b.apply(this, arguments); Y == null ? this.removeAttribute(c) : this.setAttribute(c, Y); } function N() { var Y = b.apply(this, arguments); Y == null ? this.removeAttributeNS(c.space, c.local) : this.setAttributeNS(c.space, c.local, Y); } return b == null ? c.local ? C : A : typeof b == "function" ? c.local ? N : q : c.local ? E : D; } function ze(c) { return c.trim().replace(/\s+/g, " "); } J.classed = function(c, b) { if (arguments.length < 2) { if (typeof c == "string") { var A = this.node(), C = (c = Oe(c)).length, D = -1; if (b = A.classList) { for (; ++D < C; ) if (!b.contains(c[D])) return false; } else for (b = A.getAttribute("class"); ++D < C; ) if (!Fe(c[D]).test(b)) return false; return true; } for (b in c) this.each(Re(b, c[b])); return this; } return this.each(Re(c, b)); }; function Fe(c) { return new RegExp("(?:^|\\s+)" + t.requote(c) + "(?:\\s+|$)", "g"); } function Oe(c) { return (c + "").trim().split(/^|\s+/); } function Re(c, b) { c = Oe(c).map(We); var A = c.length; function C() { for (var E = -1; ++E < A; ) c[E](this, b); } function D() { for (var E = -1, q = b.apply(this, arguments); ++E < A; ) c[E](this, q); } return typeof b == "function" ? D : C; } function We(c) { var b = Fe(c); return function(A, C) { if (D = A.classList) return C ? D.add(c) : D.remove(c); var D = A.getAttribute("class") || ""; C ? (b.lastIndex = 0, b.test(D) || A.setAttribute("class", ze(D + " " + c))) : A.setAttribute("class", ze(D.replace(b, " "))); }; } J.style = function(c, b, A) { var C = arguments.length; if (C < 3) { if (typeof c != "string") { C < 2 && (b = ""); for (A in c) this.each(Me(A, c[A], b)); return this; } if (C < 2) { var D = this.node(); return o(D).getComputedStyle(D, null).getPropertyValue(c); } A = ""; } return this.each(Me(c, b, A)); }; function Me(c, b, A) { function C() { this.style.removeProperty(c); } function D() { this.style.setProperty(c, b, A); } function E() { var q = b.apply(this, arguments); q == null ? this.style.removeProperty(c) : this.style.setProperty(c, q, A); } return b == null ? C : typeof b == "function" ? E : D; } J.property = function(c, b) { if (arguments.length < 2) { if (typeof c == "string") return this.node()[c]; for (b in c) this.each(Ve(b, c[b])); return this; } return this.each(Ve(c, b)); }; function Ve(c, b) { function A() { delete this[c]; } function C() { this[c] = b; } function D() { var E = b.apply(this, arguments); E == null ? delete this[c] : this[c] = E; } return b == null ? A : typeof b == "function" ? D : C; } J.text = function(c) { return arguments.length ? this.each(typeof c == "function" ? function() { var b = c.apply(this, arguments); this.textContent = b ?? ""; } : c == null ? function() { this.textContent = ""; } : function() { this.textContent = c; }) : this.node().textContent; }, J.html = function(c) { return arguments.length ? this.each(typeof c == "function" ? function() { var b = c.apply(this, arguments); this.innerHTML = b ?? ""; } : c == null ? function() { this.innerHTML = ""; } : function() { this.innerHTML = c; }) : this.node().innerHTML; }, J.append = function(c) { return c = qe(c), this.select(function() { return this.appendChild(c.apply(this, arguments)); }); }; function qe(c) { function b() { var C = this.ownerDocument, D = this.namespaceURI; return D === ve && C.documentElement.namespaceURI === ve ? C.createElement(c) : C.createElementNS(D, c); } function A() { return this.ownerDocument.createElementNS(c.space, c.local); } return typeof c == "function" ? c : (c = t.ns.qualify(c)).local ? A : b; } J.insert = function(c, b) { return c = qe(c), b = pe(b), this.select(function() { return this.insertBefore(c.apply(this, arguments), b.apply(this, arguments) || null); }); }, J.remove = function() { return this.each(Qe); }; function Qe() { var c = this.parentNode; c && c.removeChild(this); } J.data = function(c, b) { var A = -1, C = this.length, D, E; if (!arguments.length) { for (c = new Array(C = (D = this[0]).length); ++A < C; ) (E = D[A]) && (c[A] = E.__data__); return c; } function q(ne, ce) { var de, Te = ne.length, Ae = ce.length, he = Math.min(Te, Ae), ye = new Array(Ae), be = new Array(Ae), Se = new Array(Te), De, we; if (b) { var Ze = new _(), mt = new Array(Te), xt; for (de = -1; ++de < Te; ) (De = ne[de]) && (Ze.has(xt = b.call(De, De.__data__, de)) ? Se[de] = De : Ze.set(xt, De), mt[de] = xt); for (de = -1; ++de < Ae; ) (De = Ze.get(xt = b.call(ce, we = ce[de], de))) ? De !== true && (ye[de] = De, De.__data__ = we) : be[de] = ot(we), Ze.set(xt, true); for (de = -1; ++de < Te; ) de in mt && Ze.get(mt[de]) !== true && (Se[de] = ne[de]); } else { for (de = -1; ++de < he; ) De = ne[de], we = ce[de], De ? (De.__data__ = we, ye[de] = De) : be[de] = ot(we); for (; de < Ae; ++de) be[de] = ot(ce[de]); for (; de < Te; ++de) Se[de] = ne[de]; } be.update = ye, be.parentNode = ye.parentNode = Se.parentNode = ne.parentNode, N.push(be), Y.push(ye), te.push(Se); } var N = ft([]), Y = j([]), te = j([]); if (typeof c == "function") for (; ++A < C; ) q(D = this[A], c.call(D, D.parentNode.__data__, A)); else for (; ++A < C; ) q(D = this[A], c); return Y.enter = function() { return N; }, Y.exit = function() { return te; }, Y; }; function ot(c) { return { __data__: c }; } J.datum = function(c) { return arguments.length ? this.property("__data__", c) : this.property("__data__"); }, J.filter = function(c) { var b = [], A, C, D; typeof c != "function" && (c = ht(c)); for (var E = 0, q = this.length; E < q; E++) { b.push(A = []), A.parentNode = (C = this[E]).parentNode; for (var N = 0, Y = C.length; N < Y; N++) (D = C[N]) && c.call(D, D.__data__, N, E) && A.push(D); } return j(b); }; function ht(c) { return function() { return le(this, c); }; } J.order = function() { for (var c = -1, b = this.length; ++c < b; ) for (var A = this[c], C = A.length - 1, D = A[C], E; --C >= 0; ) (E = A[C]) && (D && D !== E.nextSibling && D.parentNode.insertBefore(E, D), D = E); return this; }, J.sort = function(c) { c = vt.apply(this, arguments); for (var b = -1, A = this.length; ++b < A; ) this[b].sort(c); return this.order(); }; function vt(c) { return arguments.length || (c = h), function(b, A) { return b && A ? c(b.__data__, A.__data__) : !b - !A; }; } J.each = function(c) { return nt(this, function(b, A, C) { c.call(b, b.__data__, A, C); }); }; function nt(c, b) { for (var A = 0, C = c.length; A < C; A++) for (var D = c[A], E = 0, q = D.length, N; E < q; E++) (N = D[E]) && b(N, E, A); return c; } J.call = function(c) { var b = n(arguments); return c.apply(b[0] = this, b), this; }, J.empty = function() { return !this.node(); }, J.node = function() { for (var c = 0, b = this.length; c < b; c++) for (var A = this[c], C = 0, D = A.length; C < D; C++) { var E = A[C]; if (E) return E; } return null; }, J.size = function() { var c = 0; return nt(this, function() { ++c; }), c; }; function ft(c) { return ue(c, Pe), c; } var Pe = []; t.selection.enter = ft, t.selection.enter.prototype = Pe, Pe.append = J.append, Pe.empty = J.empty, Pe.node = J.node, Pe.call = J.call, Pe.size = J.size, Pe.select = function(c) { for (var b = [], A, C, D, E, q, N = -1, Y = this.length; ++N < Y; ) { D = (E = this[N]).update, b.push(A = []), A.parentNode = E.parentNode; for (var te = -1, ne = E.length; ++te < ne; ) (q = E[te]) ? (A.push(D[te] = C = c.call(E.parentNode, q.__data__, te, N)), C.__data__ = q.__data__) : A.push(null); } return j(b); }, Pe.insert = function(c, b) { return arguments.length < 2 && (b = Ie(this)), J.insert.call(this, c, b); }; function Ie(c) { var b, A; return function(C, D, E) { var q = c[E].update, N = q.length, Y; for (E != A && (A = E, b = 0), D >= b && (b = D + 1); !(Y = q[b]) && ++b < N; ) ; return Y; }; } t.select = function(c) { var b; return typeof c == "string" ? (b = [U(c, a)], b.parentNode = a.documentElement) : (b = [c], b.parentNode = i(c)), j([b]); }, t.selectAll = function(c) { var b; return typeof c == "string" ? (b = n(Z(c, a)), b.parentNode = a.documentElement) : (b = n(c), b.parentNode = null), j([b]); }, J.on = function(c, b, A) { var C = arguments.length; if (C < 3) { if (typeof c != "string") { C < 2 && (b = false); for (A in c) this.each(Ne(A, c[A], b)); return this; } if (C < 2) return (C = this.node()["__on" + c]) && C._; A = false; } return this.each(Ne(c, b, A)); }; function Ne(c, b, A) { var C = "__on" + c, D = c.indexOf("."), E = Je; D > 0 && (c = c.slice(0, D)); var q = tt.get(c); q && (c = q, E = it); function N() { var ne = this[C]; ne && (this.removeEventListener(c, ne, ne.$), delete this[C]); } function Y() { var ne = E(b, n(arguments)); N.call(this), this.addEventListener(c, this[C] = ne, ne.$ = A), ne._ = b; } function te() { var ne = new RegExp("^__on([^.]+)" + t.requote(c) + "$"), ce; for (var de in this) if (ce = de.match(ne)) { var Te = this[de]; this.removeEventListener(ce[1], Te, Te.$), delete this[de]; } } return D ? b ? Y : N : b ? H : te; } var tt = t.map({ mouseenter: "mouseover", mouseleave: "mouseout" }); a && tt.forEach(function(c) { "on" + c in a && tt.remove(c); }); function Je(c, b) { return function(A) { var C = t.event; t.event = A, b[0] = this.__data__; try { c.apply(this, b); } finally { t.event = C; } }; } function it(c, b) { var A = Je(c, b); return function(C) { var D = this, E = C.relatedTarget; (!E || E !== D && !(E.compareDocumentPosition(D) & 8)) && A.call(D, C); }; } var at, Tt = 0; function gt(c) { var b = ".dragsuppress-" + ++Tt, A = "click" + b, C = t.select(o(c)).on("touchmove" + b, ee).on("dragstart" + b, ee).on("selectstart" + b, ee); if (at == null && (at = "onselectstart" in c ? false : P(c.style, "userSelect")), at) { var D = i(c).style, E = D[at]; D[at] = "none"; } return function(q) { if (C.on(b, null), at && (D[at] = E), q) { var N = function() { C.on(A, null); }; C.on(A, function() { ee(), N(); }, true), setTimeout(N, 0); } }; } t.mouse = function(c) { return pt(c, re()); }; var He = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; function pt(c, b) { b.changedTouches && (b = b.changedTouches[0]); var A = c.ownerSVGElement || c; if (A.createSVGPoint) { var C = A.createSVGPoint(); if (He < 0) { var D = o(c); if (D.scrollX || D.scrollY) { A = t.select("body").append("svg").style({ position: "absolute", top: 0, left: 0, margin: 0, padding: 0, border: "none" }, "important"); var E = A[0][0].getScreenCTM(); He = !(E.f || E.e), A.remove(); } } return He ? (C.x = b.pageX, C.y = b.pageY) : (C.x = b.clientX, C.y = b.clientY), C = C.matrixTransform(c.getScreenCTM().inverse()), [C.x, C.y]; } var q = c.getBoundingClientRect(); return [b.clientX - q.left - c.clientLeft, b.clientY - q.top - c.clientTop]; } t.touch = function(c, b, A) { if (arguments.length < 3 && (A = b, b = re().changedTouches), b) { for (var C = 0, D = b.length, E; C < D; ++C) if ((E = b[C]).identifier === A) return pt(c, E); } }, t.behavior.drag = function() { var c = ae(D, "drag", "dragstart", "dragend"), b = null, A = E(H, t.mouse, o, "mousemove", "mouseup"), C = E(bt, t.touch, V, "touchmove", "touchend"); function D() { this.on("mousedown.drag", A).on("touchstart.drag", C); } function E(q, N, Y, te, ne) { return function() { var ce = this, de = t.event.target.correspondingElement || t.event.target, Te = ce.parentNode, Ae = c.of(ce, arguments), he = 0, ye = q(), be = ".drag" + (ye == null ? "" : "-" + ye), Se, De = t.select(Y(de)).on(te + be, mt).on(ne + be, xt), we = gt(de), Ze = N(Te, ye); b ? (Se = b.apply(ce, arguments), Se = [Se.x - Ze[0], Se.y - Ze[1]]) : Se = [0, 0], Ae({ type: "dragstart" }); function mt() { var yt = N(Te, ye), Lt, Dt; yt && (Lt = yt[0] - Ze[0], Dt = yt[1] - Ze[1], he |= Lt | Dt, Ze = yt, Ae({ type: "drag", x: yt[0] + Se[0], y: yt[1] + Se[1], dx: Lt, dy: Dt })); } function xt() { N(Te, ye) && (De.on(te + be, null).on(ne + be, null), we(he), Ae({ type: "dragend" })); } }; } return D.origin = function(q) { return arguments.length ? (b = q, D) : b; }, t.rebind(D, c, "on"); }; function bt() { return t.event.changedTouches[0].identifier; } t.touches = function(c, b) { return arguments.length < 2 && (b = re().touches), b ? n(b).map(function(A) { var C = pt(c, A); return C.identifier = A.identifier, C; }) : []; }; var Ke = 1e-6, st = Ke * Ke, rt = Math.PI, ct = 2 * rt, X = ct - Ke, se = rt / 2, ie = rt / 180, fe = 180 / rt; function ke(c, b, A) { return (b[0] - c[0]) * (A[1] - c[1]) - (b[1] - c[1]) * (A[0] - c[0]); } function _e(c) { return c > 1 ? se : c < -1 ? -se : Math.asin(c); } function Ge(c) { return ((c = Math.exp(c)) - 1 / c) / 2; } function je(c) { return ((c = Math.exp(c)) + 1 / c) / 2; } function Ee(c) { return ((c = Math.exp(2 * c)) - 1) / (c + 1); } var oe = Math.SQRT2, Ce = 2, Be = 4; t.interpolateZoom = function(c, b) { var A = c[0], C = c[1], D = c[2], E = b[0], q = b[1], N = b[2], Y = E - A, te = q - C, ne = Y * Y + te * te, ce, de; if (ne < st) de = Math.log(N / D) / oe, ce = function(Se) { return [A + Se * Y, C + Se * te, D * Math.exp(oe * Se * de)]; }; else { var Te = Math.sqrt(ne), Ae = (N * N - D * D + Be * ne) / (2 * D * Ce * Te), he = (N * N - D * D - Be * ne) / (2 * N * Ce * Te), ye = Math.log(Math.sqrt(Ae * Ae + 1) - Ae), be = Math.log(Math.sqrt(he * he + 1) - he); de = (be - ye) / oe, ce = function(Se) { var De = Se * de, we = je(ye), Ze = D / (Ce * Te) * (we * Ee(oe * De + ye) - Ge(ye)); return [A + Ze * Y, C + Ze * te, D * we / je(oe * De + ye)]; }; } return ce.duration = de * 1e3, ce; }, t.behavior.zoom = function() { var c = { x: 0, y: 0, k: 1 }, b, A, C, D = [960, 500], E = Xe, q = 250, N = 0, Y = "mousedown.zoom", te = "mousemove.zoom", ne = "mouseup.zoom", ce, de = "touchstart.zoom", Te, Ae = ae(De, "zoomstart", "zoom", "zoomend"), he, ye, be, Se; Pt || (Pt = "onwheel" in a ? (Et = function() { return -t.event.deltaY * (t.event.deltaMode ? 120 : 1); }, "wheel") : "onmousewheel" in a ? (Et = function() { return t.event.wheelDelta; }, "mousewheel") : (Et = function() { return -t.event.detail; }, "MozMousePixelScroll")); function De(dt) { dt.on(Y, Gt).on(Pt + ".zoom", Yr).on("dblclick.zoom", xr).on(de, gr); } De.event = function(dt) { dt.each(function() { var Zt = Ae.of(this, arguments), Jt = c; Al ? t.select(this).transition().each("start.zoom", function() { c = this.__chart__ || { x: 0, y: 0, k: 1 }, Dt(Zt); }).tween("zoom:zoom", function() { var yr = D[0], Gr = D[1], un = A ? A[0] : yr / 2, kn = A ? A[1] : Gr / 2, $n = t.interpolateZoom([(un - c.x) / c.k, (kn - c.y) / c.k, yr / c.k], [(un - Jt.x) / Jt.k, (kn - Jt.y) / Jt.k, yr / Jt.k]); return function(Un) { var zn = $n(Un), Qn = yr / zn[2]; this.__chart__ = c = { x: un - zn[0] * Qn, y: kn - zn[1] * Qn, k: Qn }, Wt(Zt); }; }).each("interrupt.zoom", function() { Ft(Zt); }).each("end.zoom", function() { Ft(Zt); }) : (this.__chart__ = c, Dt(Zt), Wt(Zt), Ft(Zt)); }); }, De.translate = function(dt) { return arguments.length ? (c = { x: +dt[0], y: +dt[1], k: c.k }, Lt(), De) : [c.x, c.y]; }, De.scale = function(dt) { return arguments.length ? (c = { x: c.x, y: c.y, k: null }, mt(+dt), Lt(), De) : c.k; }, De.scaleExtent = function(dt) { return arguments.length ? (E = dt == null ? Xe : [+dt[0], +dt[1]], De) : E; }, De.center = function(dt) { return arguments.length ? (C = dt && [+dt[0], +dt[1]], De) : C; }, De.size = function(dt) { return arguments.length ? (D = dt && [+dt[0], +dt[1]], De) : D; }, De.duration = function(dt) { return arguments.length ? (q = +dt, De) : q; }, De.x = function(dt) { return arguments.length ? (ye = dt, he = dt.copy(), c = { x: 0, y: 0, k: 1 }, De) : ye; }, De.y = function(dt) { return arguments.length ? (Se = dt, be = dt.copy(), c = { x: 0, y: 0, k: 1 }, De) : Se; }; function we(dt) { return [(dt[0] - c.x) / c.k, (dt[1] - c.y) / c.k]; } function Ze(dt) { return [dt[0] * c.k + c.x, dt[1] * c.k + c.y]; } function mt(dt) { c.k = Math.max(E[0], Math.min(E[1], dt)); } function xt(dt, Zt) { Zt = Ze(Zt), c.x += dt[0] - Zt[0], c.y += dt[1] - Zt[1]; } function yt(dt, Zt, Jt, yr) { dt.__chart__ = { x: c.x, y: c.y, k: c.k }, mt(Math.pow(2, yr)), xt(A = Zt, Jt), dt = t.select(dt), q > 0 && (dt = dt.transition().duration(q)), dt.call(De.event); } function Lt() { ye && ye.domain(he.range().map(function(dt) { return (dt - c.x) / c.k; }).map(he.invert)), Se && Se.domain(be.range().map(function(dt) { return (dt - c.y) / c.k; }).map(be.invert)); } function Dt(dt) { N++ || dt({ type: "zoomstart" }); } function Wt(dt) { Lt(), dt({ type: "zoom", scale: c.k, translate: [c.x, c.y] }); } function Ft(dt) { --N || (dt({ type: "zoomend" }), A = null); } function Gt() { var dt = this, Zt = Ae.of(dt, arguments), Jt = 0, yr = t.select(o(dt)).on(te, kn).on(ne, $n), Gr = we(t.mouse(dt)), un = gt(dt); xd.call(dt), Dt(Zt); function kn() { Jt = 1, xt(t.mouse(dt), Gr), Wt(Zt); } function $n() { yr.on(te, null).on(ne, null), un(Jt), Ft(Zt); } } function gr() { var dt = this, Zt = Ae.of(dt, arguments), Jt = {}, yr = 0, Gr, un = ".zoom-" + t.event.changedTouches[0].identifier, kn = "touchmove" + un, $n = "touchend" + un, Un = [], zn = t.select(dt), Qn = gt(dt); ea(), Dt(Zt), zn.on(Y, null).on(de, ea); function Cn() { var ei = t.touches(dt); return Gr = c.k, ei.forEach(function(An) { An.identifier in Jt && (Jt[An.identifier] = we(An)); }), ei; } function ea() { var ei = t.event.target; t.select(ei).on(kn, Ml).on($n, CR), Un.push(ei); for (var An = t.event.changedTouches, Ca = 0, Ai = An.length; Ca < Ai; ++Ca) Jt[An[Ca].identifier] = null; var La = Cn(), Ds = Date.now(); if (La.length === 1) { if (Ds - Te < 500) { var Sl = La[0]; yt(dt, Sl, Jt[Sl.identifier], Math.floor(Math.log(c.k) / Math.LN2) + 1), ee(); } Te = Ds; } else if (La.length > 1) { var Sl = La[0], Po = La[1], kd = Sl[0] - Po[0], Nx = Sl[1] - Po[1]; yr = kd * kd + Nx * Nx; } } function Ml() { var ei = t.touches(dt), An, Ca, Ai, La; xd.call(dt); for (var Ds = 0, Sl = ei.length; Ds < Sl; ++Ds, La = null) if (Ai = ei[Ds], La = Jt[Ai.identifier]) { if (Ca) break; An = Ai, Ca = La; } if (La) { var Po = (Po = Ai[0] - An[0]) * Po + (Po = Ai[1] - An[1]) * Po, kd = yr && Math.sqrt(Po / yr); An = [(An[0] + Ai[0]) / 2, (An[1] + Ai[1]) / 2], Ca = [(Ca[0] + La[0]) / 2, (Ca[1] + La[1]) / 2], mt(kd * Gr); } Te = null, xt(An, Ca), Wt(Zt); } function CR() { if (t.event.touches.length) { for (var ei = t.event.changedTouches, An = 0, Ca = ei.length; An < Ca; ++An) delete Jt[ei[An].identifier]; for (var Ai in Jt) return void Cn(); } t.selectAll(Un).on(un, null), zn.on(Y, Gt).on(de, gr), Qn(), Ft(Zt); } } function Yr() { var dt = Ae.of(this, arguments); ce ? clearTimeout(ce) : (xd.call(this), b = we(A = C || t.mouse(this)), Dt(dt)), ce = setTimeout(function() { ce = null, Ft(dt); }, 50), ee(), mt(Math.pow(2, Et() * 2e-3) * c.k), xt(A, b), Wt(dt); } function xr() { var dt = t.mouse(this), Zt = Math.log(c.k) / Math.LN2; yt(this, dt, we(dt), t.event.shiftKey ? Math.ceil(Zt) - 1 : Math.floor(Zt) + 1); } return t.rebind(De, Ae, "on"); }; var Xe = [0, 1 / 0], Et, Pt; t.color = It; function It() { } It.prototype.toString = function() { return this.rgb() + ""; }, t.hsl = kt; function kt(c, b, A) { return this instanceof kt ? (this.h = +c, this.s = +b, void (this.l = +A)) : arguments.length < 2 ? c instanceof kt ? new kt(c.h, c.s, c.l) : Ka("" + c, to, kt) : new kt(c, b, A); } var qt = kt.prototype = new It(); qt.brighter = function(c) { return c = Math.pow(0.7, arguments.length ? c : 1), new kt(this.h, this.s, this.l / c); }, qt.darker = function(c) { return c = Math.pow(0.7, arguments.length ? c : 1), new kt(this.h, this.s, c * this.l); }, qt.rgb = function() { return Ot(this.h, this.s, this.l); }; function Ot(c, b, A) { var C, D; c = isNaN(c) ? 0 : (c %= 360) < 0 ? c + 360 : c, b = isNaN(b) || b < 0 ? 0 : b > 1 ? 1 : b, A = A < 0 ? 0 : A > 1 ? 1 : A, D = A <= 0.5 ? A * (1 + b) : A + b - A * b, C = 2 * A - D; function E(N) { return N > 360 ? N -= 360 : N < 0 && (N += 360), N < 60 ? C + (D - C) * N / 60 : N < 180 ? D : N < 240 ? C + (D - C) * (240 - N) / 60 : C; } function q(N) { return Math.round(E(N) * 255); } return new Pr(q(c + 120), q(c), q(c - 120)); } t.hcl = wt; function wt(c, b, A) { return this instanceof wt ? (this.h = +c, this.c = +b, void (this.l = +A)) : arguments.length < 2 ? c instanceof wt ? new wt(c.h, c.c, c.l) : c instanceof $t ? tr(c.l, c.a, c.b) : tr((c = ln((c = t.rgb(c)).r, c.g, c.b)).l, c.a, c.b) : new wt(c, b, A); } var Yt = wt.prototype = new It(); Yt.brighter = function(c) { return new wt(this.h, this.c, Math.min(100, this.l + zt * (arguments.length ? c : 1))); }, Yt.darker = function(c) { return new wt(this.h, this.c, Math.max(0, this.l - zt * (arguments.length ? c : 1))); }, Yt.rgb = function() { return Kt(this.h, this.c, this.l).rgb(); }; function Kt(c, b, A) { return isNaN(c) && (c = 0), isNaN(b) && (b = 0), new $t(A, Math.cos(c *= ie) * b, Math.sin(c) * b); } t.lab = $t; function $t(c, b, A) { return this instanceof $t ? (this.l = +c, this.a = +b, void (this.b = +A)) : arguments.length < 2 ? c instanceof $t ? new $t(c.l, c.a, c.b) : c instanceof wt ? Kt(c.h, c.c, c.l) : ln((c = Pr(c)).r, c.g, c.b) : new $t(c, b, A); } var zt = 18, Mt = 0.95047, St = 1, Ut = 1.08883, fr = $t.prototype = new It(); fr.brighter = function(c) { return new $t(Math.min(100, this.l + zt * (arguments.length ? c : 1)), this.a, this.b); }, fr.darker = function(c) { return new $t(Math.max(0, this.l - zt * (arguments.length ? c : 1)), this.a, this.b); }, fr.rgb = function() { return Ct(this.l, this.a, this.b); }; function Ct(c, b, A) { var C = (c + 16) / 116, D = C + b / 500, E = C - A / 200; return D = Ht(D) * Mt, C = Ht(C) * St, E = Ht(E) * Ut, new Pr(ar(3.2404542 * D - 1.5371385 * C - 0.4985314 * E), ar(-0.969266 * D + 1.8760108 * C + 0.041556 * E), ar(0.0556434 * D - 0.2040259 * C + 1.0572252 * E)); } function tr(c, b, A) { return c > 0 ? new wt(Math.atan2(A, b) * fe, Math.sqrt(b * b + A * A), c) : new wt(NaN, NaN, c); } function Ht(c) { return c > 0.206893034 ? c * c * c : (c - 4 / 29) / 7.787037; } function $r(c) { return c > 8856e-6 ? Math.pow(c, 1 / 3) : 7.787037 * c + 4 / 29; } function ar(c) { return Math.round(255 * (c <= 304e-5 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055)); } t.rgb = Pr; function Pr(c, b, A) { return this instanceof Pr ? (this.r = ~~c, this.g = ~~b, void (this.b = ~~A)) : arguments.length < 2 ? c instanceof Pr ? new Pr(c.r, c.g, c.b) : Ka("" + c, Pr, Ot) : new Pr(c, b, A); } function Ur(c) { return new Pr(c >> 16, c >> 8 & 255, c & 255); } function Pn(c) { return Ur(c) + ""; } var hn = Pr.prototype = new It(); hn.brighter = function(c) { c = Math.pow(0.7, arguments.length ? c : 1); var b = this.r, A = this.g, C = this.b, D = 30; return !b && !A && !C ? new Pr(D, D, D) : (b && b < D && (b = D), A && A < D && (A = D), C && C < D && (C = D), new Pr(Math.min(255, b / c), Math.min(255, A / c), Math.min(255, C / c))); }, hn.darker = function(c) { return c = Math.pow(0.7, arguments.length ? c : 1), new Pr(c * this.r, c * this.g, c * this.b); }, hn.hsl = function() { return to(this.r, this.g, this.b); }, hn.toString = function() { return "#" + vn(this.r) + vn(this.g) + vn(this.b); }; function vn(c) { return c < 16 ? "0" + Math.max(0, c).toString(16) : Math.min(255, c).toString(16); } function Ka(c, b, A) { var C = 0, D = 0, E = 0, q, N, Y; if (q = /([a-z]+)\((.*)\)/.exec(c = c.toLowerCase()), q) switch (N = q[2].split(","), q[1]) { case "hsl": return A(parseFloat(N[0]), parseFloat(N[1]) / 100, parseFloat(N[2]) / 100); case "rgb": return b(ro(N[0]), ro(N[1]), ro(N[2])); } return (Y = ka.get(c)) ? b(Y.r, Y.g, Y.b) : (c != null && c.charAt(0) === "#" && !isNaN(Y = parseInt(c.slice(1), 16)) && (c.length === 4 ? (C = (Y & 3840) >> 4, C = C >> 4 | C, D = Y & 240, D = D >> 4 | D, E = Y & 15, E = E << 4 | E) : c.length === 7 && (C = (Y & 16711680) >> 16, D = (Y & 65280) >> 8, E = Y & 255)), b(C, D, E)); } function to(c, b, A) { var C = Math.min(c /= 255, b /= 255, A /= 255), D = Math.max(c, b, A), E = D - C, q, N, Y = (D + C) / 2; return E ? (N = Y < 0.5 ? E / (D + C) : E / (2 - D - C), c == D ? q = (b - A) / E + (b < A ? 6 : 0) : b == D ? q = (A - c) / E + 2 : q = (c - b) / E + 4, q *= 60) : (q = NaN, N = Y > 0 && Y < 1 ? 0 : q), new kt(q, N, Y); } function ln(c, b, A) { c = Xn(c), b = Xn(b), A = Xn(A); var C = $r((0.4124564 * c + 0.3575761 * b + 0.1804375 * A) / Mt), D = $r((0.2126729 * c + 0.7151522 * b + 0.072175 * A) / St), E = $r((0.0193339 * c + 0.119192 * b + 0.9503041 * A) / Ut); return $t(116 * D - 16, 500 * (C - D), 200 * (D - E)); } function Xn(c) { return (c /= 255) <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); } function ro(c) { var b = parseFloat(c); return c.charAt(c.length - 1) === "%" ? Math.round(b * 2.55) : b; } var ka = t.map({ aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }); ka.forEach(function(c, b) { ka.set(c, Ur(b)); }); function mr(c) { return typeof c == "function" ? c : function() { return c; }; } t.functor = mr, t.xhr = Aa(V); function Aa(c) { return function(b, A, C) { return arguments.length === 2 && typeof A == "function" && (C = A, A = null), Ja(b, A, c, C); }; } function Ja(c, b, A, C) { var D = {}, E = t.dispatch("beforesend", "progress", "load", "error"), q = {}, N = new XMLHttpRequest(), Y = null; self.XDomainRequest && !("withCredentials" in N) && /^(http(s)?:)?\/\//.test(c) && (N = new XDomainRequest()), "onload" in N ? N.onload = N.onerror = te : N.onreadystatechange = function() { N.readyState > 3 && te(); }; function te() { var ne = N.status, ce; if (!ne && zr(N) || ne >= 200 && ne < 300 || ne === 304) { try { ce = A.call(D, N); } catch (de) { E.error.call(D, de); return; } E.load.call(D, ce); } else E.error.call(D, N); } return N.onprogress = function(ne) { var ce = t.event; t.event = ne; try { E.progress.call(D, N); } finally { t.event = ce; } }, D.header = function(ne, ce) { return ne = (ne + "").toLowerCase(), arguments.length < 2 ? q[ne] : (ce == null ? delete q[ne] : q[ne] = ce + "", D); }, D.mimeType = function(ne) { return arguments.length ? (b = ne == null ? null : ne + "", D) : b; }, D.responseType = function(ne) { return arguments.length ? (Y = ne, D) : Y; }, D.response = function(ne) { return A = ne, D; }, ["get", "post"].forEach(function(ne) { D[ne] = function() { return D.send.apply(D, [ne].concat(n(arguments))); }; }), D.send = function(ne, ce, de) { if (arguments.length === 2 && typeof ce == "function" && (de = ce, ce = null), N.open(ne, c, true), b != null && !("accept" in q) && (q.accept = b + ",*/*"), N.setRequestHeader) for (var Te in q) N.setRequestHeader(Te, q[Te]); return b != null && N.overrideMimeType && N.overrideMimeType(b), Y != null && (N.responseType = Y), de != null && D.on("error", de).on("load", function(Ae) { de(null, Ae); }), E.beforesend.call(D, N), N.send(ce ?? null), D; }, D.abort = function() { return N.abort(), D; }, t.rebind(D, E, "on"), C == null ? D : D.get(no(C)); } function no(c) { return c.length === 1 ? function(b, A) { c(b == null ? A : null); } : c; } function zr(c) { var b = c.responseType; return b && b !== "text" ? c.response : c.responseText; } t.dsv = function(c, b) { var A = new RegExp('["' + c + ` ]`), C = c.charCodeAt(0); function D(te, ne, ce) { arguments.length < 3 && (ce = ne, ne = null); var de = Ja(te, b, ne == null ? E : q(ne), ce); return de.row = function(Te) { return arguments.length ? de.response((ne = Te) == null ? E : q(Te)) : ne; }, de; } function E(te) { return D.parse(te.responseText); } function q(te) { return function(ne) { return D.parse(ne.responseText, te); }; } D.parse = function(te, ne) { var ce; return D.parseRows(te, function(de, Te) { if (ce) return ce(de, Te - 1); var Ae = function(he) { for (var ye = {}, be = de.length, Se = 0; Se < be; ++Se) ye[de[Se]] = he[Se]; return ye; }; ce = ne ? function(he, ye) { return ne(Ae(he), ye); } : Ae; }); }, D.parseRows = function(te, ne) { var ce = {}, de = {}, Te = [], Ae = te.length, he = 0, ye = 0, be, Se; function De() { if (he >= Ae) return de; if (Se) return Se = false, ce; var Ze = he; if (te.charCodeAt(Ze) === 34) { for (var mt = Ze; mt++ < Ae; ) if (te.charCodeAt(mt) === 34) { if (te.charCodeAt(mt + 1) !== 34) break; ++mt; } he = mt + 2; var xt = te.charCodeAt(mt + 1); return xt === 13 ? (Se = true, te.charCodeAt(mt + 2) === 10 && ++he) : xt === 10 && (Se = true), te.slice(Ze + 1, mt).replace(/""/g, '"'); } for (; he < Ae; ) { var xt = te.charCodeAt(he++), yt = 1; if (xt === 10) Se = true; else if (xt === 13) Se = true, te.charCodeAt(he) === 10 && (++he, ++yt); else if (xt !== C) continue; return te.slice(Ze, he - yt); } return te.slice(Ze); } for (; (be = De()) !== de; ) { for (var we = []; be !== ce && be !== de; ) we.push(be), be = De(); ne && (we = ne(we, ye++)) == null || Te.push(we); } return Te; }, D.format = function(te) { if (Array.isArray(te[0])) return D.formatRows(te); var ne = new K(), ce = []; return te.forEach(function(de) { for (var Te in de) ne.has(Te) || ce.push(ne.add(Te)); }), [ce.map(Y).join(c)].concat(te.map(function(de) { return ce.map(function(Te) { return Y(de[Te]); }).join(c); })).join(` `); }, D.formatRows = function(te) { return te.map(N).join(` `); }; function N(te) { return te.map(Y).join(c); } function Y(te) { return A.test(te) ? '"' + te.replace(/\"/g, '""') + '"' : te; } return D; }, t.csv = t.dsv(",", "text/csv"), t.tsv = t.dsv(" ", "text/tab-separated-values"); var tn, Kn, Ma, Ti, Jn = this[P(this, "requestAnimationFrame")] || function(c) { setTimeout(c, 17); }; t.timer = function() { ha.apply(this, arguments); }; function ha(c, b, A) { var C = arguments.length; C < 2 && (b = 0), C < 3 && (A = Date.now()); var D = A + b, E = { c, t: D, n: null }; return Kn ? Kn.n = E : tn = E, Kn = E, Ma || (Ti = clearTimeout(Ti), Ma = 1, Jn(Ts)), E; } function Ts() { var c = od(), b = S_() - c; b > 24 ? (isFinite(b) && (clearTimeout(Ti), Ti = setTimeout(Ts, b)), Ma = 0) : (Ma = 1, Jn(Ts)); } t.timer.flush = function() { od(), S_(); }; function od() { for (var c = Date.now(), b = tn; b; ) c >= b.t && b.c(c - b.t) && (b.c = null), b = b.n; return c; } function S_() { for (var c, b = tn, A = 1 / 0; b; ) b.c ? (b.t < A && (A = b.t), b = (c = b).n) : b = c ? c.n = b.n : tn = b.n; return Kn = c, A; } t.round = function(c, b) { return b ? Math.round(c * (b = Math.pow(10, b))) / b : Math.round(c); }, t.geom = {}; function ks(c) { return c[0]; } function of(c) { return c[1]; } t.geom.hull = function(c) { var b = ks, A = of; if (arguments.length) return C(c); function C(D) { if (D.length < 3) return []; var E = mr(b), q = mr(A), N, Y = D.length, te = [], ne = []; for (N = 0; N < Y; N++) te.push([+E.call(this, D[N], N), +q.call(this, D[N], N), N]); for (te.sort(F8), N = 0; N < Y; N++) ne.push([te[N][0], -te[N][1]]); var ce = C_(te), de = C_(ne), Te = de[0] === ce[0], Ae = de[de.length - 1] === ce[ce.length - 1], he = []; for (N = ce.length - 1; N >= 0; --N) he.push(D[te[ce[N]][2]]); for (N = +Te; N < de.length - Ae; ++N) he.push(D[te[de[N]][2]]); return he; } return C.x = function(D) { return arguments.length ? (b = D, C) : b; }, C.y = function(D) { return arguments.length ? (A = D, C) : A; }, C; }; function C_(c) { for (var b = c.length, A = [0, 1], C = 2, D = 2; D < b; D++) { for (; C > 1 && ke(c[A[C - 2]], c[A[C - 1]], c[D]) <= 0; ) --C; A[C++] = D; } return A.slice(0, C); } function F8(c, b) { return c[0] - b[0] || c[1] - b[1]; } t.geom.polygon = function(c) { return ue(c, ld), c; }; var ld = t.geom.polygon.prototype = []; ld.area = function() { for (var c = -1, b = this.length, A, C = this[b - 1], D = 0; ++c < b; ) A = C, C = this[c], D += A[1] * C[0] - A[0] * C[1]; return D * 0.5; }, ld.centroid = function(c) { var b = -1, A = this.length, C = 0, D = 0, E, q = this[A - 1], N; for (arguments.length || (c = -1 / (6 * this.area())); ++b < A; ) E = q, q = this[b], N = E[0] * q[1] - q[0] * E[1], C += (E[0] + q[0]) * N, D += (E[1] + q[1]) * N; return [C * c, D * c]; }, ld.clip = function(c) { for (var b, A = L_(c), C = -1, D = this.length - L_(this), E, q, N = this[D - 1], Y, te, ne; ++C < D; ) { for (b = c.slice(), c.length = 0, Y = this[C], te = b[(q = b.length - A) - 1], E = -1; ++E < q; ) ne = b[E], em(ne, N, Y) ? (em(te, N, Y) || c.push(tm(te, ne, N, Y)), c.push(ne)) : em(te, N, Y) && c.push(tm(te, ne, N, Y)), te = ne; A && c.push(c[0]), N = Y; } return c; }; function em(c, b, A) { return (A[0] - b[0]) * (c[1] - b[1]) < (A[1] - b[1]) * (c[0] - b[0]); } function tm(c, b, A, C) { var D = c[0], E = A[0], q = b[0] - D, N = C[0] - E, Y = c[1], te = A[1], ne = b[1] - Y, ce = C[1] - te, de = (N * (Y - te) - ce * (D - E)) / (ce * q - N * ne); return [D + de * q, Y + de * ne]; } function L_(c) { var b = c[0], A = c[c.length - 1]; return !(b[0] - A[0] || b[1] - A[1]); } var As, Tl, Ms, D_ = [], rm, lf, E_ = []; function R8() { fd(this), this.edge = this.site = this.circle = null; } function F_(c) { var b = D_.pop() || new R8(); return b.site = c, b; } function nm(c) { Cs(c), Ms.remove(c), D_.push(c), fd(c); } function P8(c) { var b = c.circle, A = b.x, C = b.cy, D = { x: A, y: C }, E = c.P, q = c.N, N = [c]; nm(c); for (var Y = E; Y.circle && w(A - Y.circle.x) < Ke && w(C - Y.circle.cy) < Ke; ) E = Y.P, N.unshift(Y), nm(Y), Y = E; N.unshift(Y), Cs(Y); for (var te = q; te.circle && w(A - te.circle.x) < Ke && w(C - te.circle.cy) < Ke; ) q = te.N, N.push(te), nm(te), te = q; N.push(te), Cs(te); var ne = N.length, ce; for (ce = 1; ce < ne; ++ce) te = N[ce], Y = N[ce - 1], sd(te.edge, Y.site, te.site, D); Y = N[0], te = N[ne - 1], te.edge = sf(Y.site, te.site, null, D), Ss(Y), Ss(te); } function $8(c) { for (var b = c.x, A = c.y, C, D, E, q, N = Ms._; N; ) if (E = R_(N, A) - b, E > Ke) N = N.L; else if (q = b - z8(N, A), q > Ke) { if (!N.R) { C = N; break; } N = N.R; } else { E > -Ke ? (C = N.P, D = N) : q > -Ke ? (C = N, D = N.N) : C = D = N; break; } var Y = F_(c); if (Ms.insert(C, Y), !(!C && !D)) { if (C === D) { Cs(C), D = F_(C.site), Ms.insert(Y, D), Y.edge = D.edge = sf(C.site, Y.site), Ss(C), Ss(D); return; } if (!D) { Y.edge = sf(C.site, Y.site); return; } Cs(C), Cs(D); var te = C.site, ne = te.x, ce = te.y, de = c.x - ne, Te = c.y - ce, Ae = D.site, he = Ae.x - ne, ye = Ae.y - ce, be = 2 * (de * ye - Te * he), Se = de * de + Te * Te, De = he * he + ye * ye, we = { x: (ye * Se - Te * De) / be + ne, y: (de * De - he * Se) / be + ce }; sd(D.edge, te, Ae, we), Y.edge = sf(te, c, null, we), D.edge = sf(c, Ae, null, we), Ss(C), Ss(D); } } function R_(c, b) { var A = c.site, C = A.x, D = A.y, E = D - b; if (!E) return C; var q = c.P; if (!q) return -1 / 0; A = q.site; var N = A.x, Y = A.y, te = Y - b; if (!te) return N; var ne = N - C, ce = 1 / E - 1 / te, de = ne / te; return ce ? (-de + Math.sqrt(de * de - 2 * ce * (ne * ne / (-2 * te) - Y + te / 2 + D - E / 2))) / ce + C : (C + N) / 2; } function z8(c, b) { var A = c.N; if (A) return R_(A, b); var C = c.site; return C.y === b ? C.x : 1 / 0; } function P_(c) { this.site = c, this.edges = []; } P_.prototype.prepare = function() { for (var c = this.edges, b = c.length, A; b--; ) A = c[b].edge, (!A.b || !A.a) && c.splice(b, 1); return c.sort($_), c.length; }; function I8(c) { for (var b = c[0][0], A = c[1][0], C = c[0][1], D = c[1][1], E, q, N, Y, te = Tl, ne = te.length, ce, de, Te, Ae, he, ye; ne--; ) if (ce = te[ne], !(!ce || !ce.prepare())) for (Te = ce.edges, Ae = Te.length, de = 0; de < Ae; ) ye = Te[de].end(), N = ye.x, Y = ye.y, he = Te[++de % Ae].start(), E = he.x, q = he.y, (w(N - E) > Ke || w(Y - q) > Ke) && (Te.splice(de, 0, new ud(j8(ce.site, ye, w(N - b) < Ke && D - Y > Ke ? { x: b, y: w(E - b) < Ke ? q : D } : w(Y - D) < Ke && A - N > Ke ? { x: w(q - D) < Ke ? E : A, y: D } : w(N - A) < Ke && Y - C > Ke ? { x: A, y: w(E - A) < Ke ? q : C } : w(Y - C) < Ke && N - b > Ke ? { x: w(q - C) < Ke ? E : b, y: C } : null), ce.site, null)), ++Ae); } function $_(c, b) { return b.angle - c.angle; } function N8() { fd(this), this.x = this.y = this.arc = this.site = this.cy = null; } function Ss(c) { var b = c.P, A = c.N; if (!(!b || !A)) { var C = b.site, D = c.site, E = A.site; if (C !== E) { var q = D.x, N = D.y, Y = C.x - q, te = C.y - N, ne = E.x - q, ye = E.y - N, ce = 2 * (Y * ye - te * ne); if (!(ce >= -st)) { var de = Y * Y + te * te, Te = ne * ne + ye * ye, Ae = (ye * de - te * Te) / ce, he = (Y * Te - ne * de) / ce, ye = he + N, be = E_.pop() || new N8(); be.arc = c, be.site = D, be.x = Ae + q, be.y = ye + Math.sqrt(Ae * Ae + he * he), be.cy = ye, c.circle = be; for (var Se = null, De = lf._; De; ) if (be.y < De.y || be.y === De.y && be.x <= De.x) if (De.L) De = De.L; else { Se = De.P; break; } else if (De.R) De = De.R; else { Se = De; break; } lf.insert(Se, be), Se || (rm = be); } } } } function Cs(c) { var b = c.circle; b && (b.P || (rm = b.N), lf.remove(b), E_.push(b), fd(b), c.circle = null); } function O8(c, b, A, C) { return function(D) { var E = D.a, q = D.b, N = E.x, Y = E.y, te = q.x, ne = q.y, ce = 0, de = 1, Te = te - N, Ae = ne - Y, he; if (he = c - N, !(!Te && he > 0)) { if (he /= Te, Te < 0) { if (he < ce) return; he < de && (de = he); } else if (Te > 0) { if (he > de) return; he > ce && (ce = he); } if (he = A - N, !(!Te && he < 0)) { if (he /= Te, Te < 0) { if (he > de) return; he > ce && (ce = he); } else if (Te > 0) { if (he < ce) return; he < de && (de = he); } if (he = b - Y, !(!Ae && he > 0)) { if (he /= Ae, Ae < 0) { if (he < ce) return; he < de && (de = he); } else if (Ae > 0) { if (he > de) return; he > ce && (ce = he); } if (he = C - Y, !(!Ae && he < 0)) { if (he /= Ae, Ae < 0) { if (he > de) return; he > ce && (ce = he); } else if (Ae > 0) { if (he < ce) return; he < de && (de = he); } return ce > 0 && (D.a = { x: N + ce * Te, y: Y + ce * Ae }), de < 1 && (D.b = { x: N + de * Te, y: Y + de * Ae }), D; } } } } }; } function H8(c) { for (var b = As, A = O8(c[0][0], c[0][1], c[1][0], c[1][1]), C = b.length, D; C--; ) D = b[C], (!B8(D, c) || !A(D) || w(D.a.x - D.b.x) < Ke && w(D.a.y - D.b.y) < Ke) && (D.a = D.b = null, b.splice(C, 1)); } function B8(c, b) { var A = c.b; if (A) return true; var C = c.a, D = b[0][0], E = b[1][0], q = b[0][1], N = b[1][1], Y = c.l, te = c.r, ne = Y.x, ce = Y.y, de = te.x, Te = te.y, Ae = (ne + de) / 2, he = (ce + Te) / 2, ye, be; if (Te === ce) { if (Ae < D || Ae >= E) return; if (ne > de) { if (!C) C = { x: Ae, y: q }; else if (C.y >= N) return; A = { x: Ae, y: N }; } else { if (!C) C = { x: Ae, y: N }; else if (C.y < q) return; A = { x: Ae, y: q }; } } else if (ye = (ne - de) / (Te - ce), be = he - ye * Ae, ye < -1 || ye > 1) if (ne > de) { if (!C) C = { x: (q - be) / ye, y: q }; else if (C.y >= N) return; A = { x: (N - be) / ye, y: N }; } else { if (!C) C = { x: (N - be) / ye, y: N }; else if (C.y < q) return; A = { x: (q - be) / ye, y: q }; } else if (ce < Te) { if (!C) C = { x: D, y: ye * D + be }; else if (C.x >= E) return; A = { x: E, y: ye * E + be }; } else { if (!C) C = { x: E, y: ye * E + be }; else if (C.x < D) return; A = { x: D, y: ye * D + be }; } return c.a = C, c.b = A, true; } function z_(c, b) { this.l = c, this.r = b, this.a = this.b = null; } function sf(c, b, A, C) { var D = new z_(c, b); return As.push(D), A && sd(D, c, b, A), C && sd(D, b, c, C), Tl[c.i].edges.push(new ud(D, c, b)), Tl[b.i].edges.push(new ud(D, b, c)), D; } function j8(c, b, A) { var C = new z_(c, null); return C.a = b, C.b = A, As.push(C), C; } function sd(c, b, A, C) { !c.a && !c.b ? (c.a = C, c.l = b, c.r = A) : c.l === A ? c.b = C : c.a = C; } function ud(c, b, A) { var C = c.a, D = c.b; this.edge = c, this.site = b, this.angle = A ? Math.atan2(A.y - b.y, A.x - b.x) : c.l === b ? Math.atan2(D.x - C.x, C.y - D.y) : Math.atan2(C.x - D.x, D.y - C.y); } ud.prototype = { start: function() { return this.edge.l === this.site ? this.edge.a : this.edge.b; }, end: function() { return this.edge.l === this.site ? this.edge.b : this.edge.a; } }; function am() { this._ = null; } function fd(c) { c.U = c.C = c.L = c.R = c.P = c.N = null; } am.prototype = { insert: function(c, b) { var A, C, D; if (c) { if (b.P = c, b.N = c.N, c.N && (c.N.P = b), c.N = b, c.R) { for (c = c.R; c.L; ) c = c.L; c.L = b; } else c.R = b; A = c; } else this._ ? (c = I_(this._), b.P = null, b.N = c, c.P = c.L = b, A = c) : (b.P = b.N = null, this._ = b, A = null); for (b.L = b.R = null, b.U = A, b.C = true, c = b; A && A.C; ) C = A.U, A === C.L ? (D = C.R, D && D.C ? (A.C = D.C = false, C.C = true, c = C) : (c === A.R && (uf(this, A), c = A, A = c.U), A.C = false, C.C = true, ff(this, C))) : (D = C.L, D && D.C ? (A.C = D.C = false, C.C = true, c = C) : (c === A.L && (ff(this, A), c = A, A = c.U), A.C = false, C.C = true, uf(this, C))), A = c.U; this._.C = false; }, remove: function(c) { c.N && (c.N.P = c.P), c.P && (c.P.N = c.N), c.N = c.P = null; var b = c.U, A, C = c.L, D = c.R, E, q; if (C ? D ? E = I_(D) : E = C : E = D, b ? b.L === c ? b.L = E : b.R = E : this._ = E, C && D ? (q = E.C, E.C = c.C, E.L = C, C.U = E, E !== D ? (b = E.U, E.U = c.U, c = E.R, b.L = c, E.R = D, D.U = E) : (E.U = b, b = E, c = E.R)) : (q = c.C, c = E), c && (c.U = b), !q) { if (c && c.C) { c.C = false; return; } do { if (c === this._) break; if (c === b.L) { if (A = b.R, A.C && (A.C = false, b.C = true, uf(this, b), A = b.R), A.L && A.L.C || A.R && A.R.C) { (!A.R || !A.R.C) && (A.L.C = false, A.C = true, ff(this, A), A = b.R), A.C = b.C, b.C = A.R.C = false, uf(this, b), c = this._; break; } } else if (A = b.L, A.C && (A.C = false, b.C = true, ff(this, b), A = b.L), A.L && A.L.C || A.R && A.R.C) { (!A.L || !A.L.C) && (A.R.C = false, A.C = true, uf(this, A), A = b.L), A.C = b.C, b.C = A.L.C = false, ff(this, b), c = this._; break; } A.C = true, c = b, b = b.U; } while (!c.C); c && (c.C = false); } } }; function uf(c, b) { var A = b, C = b.R, D = A.U; D ? D.L === A ? D.L = C : D.R = C : c._ = C, C.U = D, A.U = C, A.R = C.L, A.R && (A.R.U = A), C.L = A; } function ff(c, b) { var A = b, C = b.L, D = A.U; D ? D.L === A ? D.L = C : D.R = C : c._ = C, C.U = D, A.U = C, A.L = C.R, A.L && (A.L.U = A), C.R = A; } function I_(c) { for (; c.L; ) c = c.L; return c; } function im(c, b) { var A = c.sort(U8).pop(), C, D, E; for (As = [], Tl = new Array(c.length), Ms = new am(), lf = new am(); ; ) if (E = rm, A && (!E || A.y < E.y || A.y === E.y && A.x < E.x)) (A.x !== C || A.y !== D) && (Tl[A.i] = new P_(A), $8(A), C = A.x, D = A.y), A = c.pop(); else if (E) P8(E.arc); else break; b && (H8(b), I8(b)); var q = { cells: Tl, edges: As }; return Ms = lf = As = Tl = null, q; } function U8(c, b) { return b.y - c.y || b.x - c.x; } t.geom.voronoi = function(c) { var b = ks, A = of, C = b, D = A, E = cd; if (c) return q(c); function q(Y) { var te = new Array(Y.length), ne = E[0][0], ce = E[0][1], de = E[1][0], Te = E[1][1]; return im(N(Y), E).cells.forEach(function(Ae, he) { var ye = Ae.edges, be = Ae.site, Se = te[he] = ye.length ? ye.map(function(De) { var we = De.start(); return [we.x, we.y]; }) : be.x >= ne && be.x <= de && be.y >= ce && be.y <= Te ? [[ne, Te], [de, Te], [de, ce], [ne, ce]] : []; Se.point = Y[he]; }), te; } function N(Y) { return Y.map(function(te, ne) { return { x: Math.round(C(te, ne) / Ke) * Ke, y: Math.round(D(te, ne) / Ke) * Ke, i: ne }; }); } return q.links = function(Y) { return im(N(Y)).edges.filter(function(te) { return te.l && te.r; }).map(function(te) { return { source: Y[te.l.i], target: Y[te.r.i] }; }); }, q.triangles = function(Y) { var te = []; return im(N(Y)).cells.forEach(function(ne, ce) { for (var de = ne.site, Te = ne.edges.sort($_), Ae = -1, he = Te.length, ye, be = Te[he - 1].edge, Se = be.l === de ? be.r : be.l; ++Ae < he; ) ye = Se, be = Te[Ae].edge, Se = be.l === de ? be.r : be.l, ce < ye.i && ce < Se.i && G8(de, ye, Se) < 0 && te.push([Y[ce], Y[ye.i], Y[Se.i]]); }), te; }, q.x = function(Y) { return arguments.length ? (C = mr(b = Y), q) : b; }, q.y = function(Y) { return arguments.length ? (D = mr(A = Y), q) : A; }, q.clipExtent = function(Y) { return arguments.length ? (E = Y ?? cd, q) : E === cd ? null : E; }, q.size = function(Y) { return arguments.length ? q.clipExtent(Y && [[0, 0], Y]) : E === cd ? null : E && E[1]; }, q; }; var cd = [[-1e6, -1e6], [1e6, 1e6]]; function G8(c, b, A) { return (c.x - A.x) * (b.y - c.y) - (c.x - b.x) * (A.y - c.y); } t.geom.delaunay = function(c) { return t.geom.voronoi().triangles(c); }, t.geom.quadtree = function(c, b, A, C, D) { var E = ks, q = of, N; if (N = arguments.length) return E = V8, q = q8, N === 3 && (D = A, C = b, A = b = 0), Y(c); function Y(te) { var ne, ce = mr(E), de = mr(q), Te, Ae, he, ye, be, Se, De, we; if (b != null) be = b, Se = A, De = C, we = D; else if (De = we = -(be = Se = 1 / 0), Te = [], Ae = [], ye = te.length, N) for (he = 0; he < ye; ++he) ne = te[he], ne.x < be && (be = ne.x), ne.y < Se && (Se = ne.y), ne.x > De && (De = ne.x), ne.y > we && (we = ne.y), Te.push(ne.x), Ae.push(ne.y); else for (he = 0; he < ye; ++he) { var Ze = +ce(ne = te[he], he), mt = +de(ne, he); Ze < be && (be = Ze), mt < Se && (Se = mt), Ze > De && (De = Ze), mt > we && (we = mt), Te.push(Ze), Ae.push(mt); } var xt = De - be, yt = we - Se; xt > yt ? we = Se + xt : De = be + yt; function Lt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt) { if (!(isNaN(gr) || isNaN(Yr))) if (Ft.leaf) { var yr = Ft.x, Gr = Ft.y; if (yr != null) if (w(yr - gr) + w(Gr - Yr) < 0.01) Dt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt); else { var un = Ft.point; Ft.x = Ft.y = Ft.point = null, Dt(Ft, un, yr, Gr, xr, dt, Zt, Jt), Dt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt); } else Ft.x = gr, Ft.y = Yr, Ft.point = Gt; } else Dt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt); } function Dt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt) { var yr = (xr + Zt) * 0.5, Gr = (dt + Jt) * 0.5, un = gr >= yr, kn = Yr >= Gr, $n = kn << 1 | un; Ft.leaf = false, Ft = Ft.nodes[$n] || (Ft.nodes[$n] = N_()), un ? xr = yr : Zt = yr, kn ? dt = Gr : Jt = Gr, Lt(Ft, Gt, gr, Yr, xr, dt, Zt, Jt); } var Wt = N_(); if (Wt.add = function(Ft) { Lt(Wt, Ft, +ce(Ft, ++he), +de(Ft, he), be, Se, De, we); }, Wt.visit = function(Ft) { cf(Ft, Wt, be, Se, De, we); }, Wt.find = function(Ft) { return W8(Wt, Ft[0], Ft[1], be, Se, De, we); }, he = -1, b == null) { for (; ++he < ye; ) Lt(Wt, te[he], Te[he], Ae[he], be, Se, De, we); --he; } else te.forEach(Wt.add); return Te = Ae = te = ne = null, Wt; } return Y.x = function(te) { return arguments.length ? (E = te, Y) : E; }, Y.y = function(te) { return arguments.length ? (q = te, Y) : q; }, Y.extent = function(te) { return arguments.length ? (te == null ? b = A = C = D = null : (b = +te[0][0], A = +te[0][1], C = +te[1][0], D = +te[1][1]), Y) : b == null ? null : [[b, A], [C, D]]; }, Y.size = function(te) { return arguments.length ? (te == null ? b = A = C = D = null : (b = A = 0, C = +te[0], D = +te[1]), Y) : b == null ? null : [C - b, D - A]; }, Y; }; function V8(c) { return c.x; } function q8(c) { return c.y; } function N_() { return { leaf: true, nodes: [], point: null, x: null, y: null }; } function cf(c, b, A, C, D, E) { if (!c(b, A, C, D, E)) { var q = (A + D) * 0.5, N = (C + E) * 0.5, Y = b.nodes; Y[0] && cf(c, Y[0], A, C, q, N), Y[1] && cf(c, Y[1], q, C, D, N), Y[2] && cf(c, Y[2], A, N, q, E), Y[3] && cf(c, Y[3], q, N, D, E); } } function W8(c, b, A, C, D, E, q) { var N = 1 / 0, Y; return function te(ne, ce, de, Te, Ae) { if (!(ce > E || de > q || Te < C || Ae < D)) { if (he = ne.point) { var he, ye = b - ne.x, be = A - ne.y, Se = ye * ye + be * be; if (Se < N) { var De = Math.sqrt(N = Se); C = b - De, D = A - De, E = b + De, q = A + De, Y = he; } } for (var we = ne.nodes, Ze = (ce + Te) * 0.5, mt = (de + Ae) * 0.5, xt = b >= Ze, yt = A >= mt, Lt = yt << 1 | xt, Dt = Lt + 4; Lt < Dt; ++Lt) if (ne = we[Lt & 3]) switch (Lt & 3) { case 0: te(ne, ce, de, Ze, mt); break; case 1: te(ne, Ze, de, Te, mt); break; case 2: te(ne, ce, mt, Ze, Ae); break; case 3: te(ne, Ze, mt, Te, Ae); break; } } }(c, C, D, E, q), Y; } t.interpolateRgb = om; function om(c, b) { c = t.rgb(c), b = t.rgb(b); var A = c.r, C = c.g, D = c.b, E = b.r - A, q = b.g - C, N = b.b - D; return function(Y) { return "#" + vn(Math.round(A + E * Y)) + vn(Math.round(C + q * Y)) + vn(Math.round(D + N * Y)); }; } t.interpolateObject = O_; function O_(c, b) { var A = {}, C = {}, D; for (D in c) D in b ? A[D] = kl(c[D], b[D]) : C[D] = c[D]; for (D in b) D in c || (C[D] = b[D]); return function(E) { for (D in A) C[D] = A[D](E); return C; }; } t.interpolateNumber = ao; function ao(c, b) { return c = +c, b = +b, function(A) { return c * (1 - A) + b * A; }; } t.interpolateString = H_; function H_(c, b) { var A = lm.lastIndex = sm.lastIndex = 0, C, D, E, q = -1, N = [], Y = []; for (c = c + "", b = b + ""; (C = lm.exec(c)) && (D = sm.exec(b)); ) (E = D.index) > A && (E = b.slice(A, E), N[q] ? N[q] += E : N[++q] = E), (C = C[0]) === (D = D[0]) ? N[q] ? N[q] += D : N[++q] = D : (N[++q] = null, Y.push({ i: q, x: ao(C, D) })), A = sm.lastIndex; return A < b.length && (E = b.slice(A), N[q] ? N[q] += E : N[++q] = E), N.length < 2 ? Y[0] ? (b = Y[0].x, function(te) { return b(te) + ""; }) : function() { return b; } : (b = Y.length, function(te) { for (var ne = 0, ce; ne < b; ++ne) N[(ce = Y[ne]).i] = ce.x(te); return N.join(""); }); } var lm = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, sm = new RegExp(lm.source, "g"); t.interpolate = kl; function kl(c, b) { for (var A = t.interpolators.length, C; --A >= 0 && !(C = t.interpolators[A](c, b)); ) ; return C; } t.interpolators = [function(c, b) { var A = typeof b; return (A === "string" ? ka.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? om : H_ : b instanceof It ? om : Array.isArray(b) ? dd : A === "object" && isNaN(b) ? O_ : ao)(c, b); }], t.interpolateArray = dd; function dd(c, b) { var A = [], C = [], D = c.length, E = b.length, q = Math.min(c.length, b.length), N; for (N = 0; N < q; ++N) A.push(kl(c[N], b[N])); for (; N < D; ++N) C[N] = c[N]; for (; N < E; ++N) C[N] = b[N]; return function(Y) { for (N = 0; N < q; ++N) C[N] = A[N](Y); return C; }; } var B_ = function() { return V; }, Z8 = t.map({ linear: B_, poly: eF, quad: function() { return K8; }, cubic: function() { return J8; }, sin: function() { return tF; }, exp: function() { return rF; }, circle: function() { return nF; }, elastic: aF, back: iF, bounce: function() { return oF; } }), Y8 = t.map({ in: V, out: j_, "in-out": U_, "out-in": function(c) { return U_(j_(c)); } }); t.ease = function(c) { var b = c.indexOf("-"), A = b >= 0 ? c.slice(0, b) : c, C = b >= 0 ? c.slice(b + 1) : "in"; return A = Z8.get(A) || B_, C = Y8.get(C) || V, X8(C(A.apply(null, r.call(arguments, 1)))); }; function X8(c) { return function(b) { return b <= 0 ? 0 : b >= 1 ? 1 : c(b); }; } function j_(c) { return function(b) { return 1 - c(1 - b); }; } function U_(c) { return function(b) { return 0.5 * (b < 0.5 ? c(2 * b) : 2 - c(2 - 2 * b)); }; } function K8(c) { return c * c; } function J8(c) { return c * c * c; } function Q8(c) { if (c <= 0) return 0; if (c >= 1) return 1; var b = c * c, A = b * c; return 4 * (c < 0.5 ? A : 3 * (c - b) + A - 0.75); } function eF(c) { return function(b) { return Math.pow(b, c); }; } function tF(c) { return 1 - Math.cos(c * se); } function rF(c) { return Math.pow(2, 10 * (c - 1)); } function nF(c) { return 1 - Math.sqrt(1 - c * c); } function aF(c, b) { var A; return arguments.length < 2 && (b = 0.45), arguments.length ? A = b / ct * Math.asin(1 / c) : (c = 1, A = b / 4), function(C) { return 1 + c * Math.pow(2, -10 * C) * Math.sin((C - A) * ct / b); }; } function iF(c) { return c || (c = 1.70158), function(b) { return b * b * ((c + 1) * b - c); }; } function oF(c) { return c < 1 / 2.75 ? 7.5625 * c * c : c < 2 / 2.75 ? 7.5625 * (c -= 1.5 / 2.75) * c + 0.75 : c < 2.5 / 2.75 ? 7.5625 * (c -= 2.25 / 2.75) * c + 0.9375 : 7.5625 * (c -= 2.625 / 2.75) * c + 0.984375; } t.interpolateHcl = lF; function lF(c, b) { c = t.hcl(c), b = t.hcl(b); var A = c.h, C = c.c, D = c.l, E = b.h - A, q = b.c - C, N = b.l - D; return isNaN(q) && (q = 0, C = isNaN(C) ? b.c : C), isNaN(E) ? (E = 0, A = isNaN(A) ? b.h : A) : E > 180 ? E -= 360 : E < -180 && (E += 360), function(Y) { return Kt(A + E * Y, C + q * Y, D + N * Y) + ""; }; } t.interpolateHsl = sF; function sF(c, b) { c = t.hsl(c), b = t.hsl(b); var A = c.h, C = c.s, D = c.l, E = b.h - A, q = b.s - C, N = b.l - D; return isNaN(q) && (q = 0, C = isNaN(C) ? b.s : C), isNaN(E) ? (E = 0, A = isNaN(A) ? b.h : A) : E > 180 ? E -= 360 : E < -180 && (E += 360), function(Y) { return Ot(A + E * Y, C + q * Y, D + N * Y) + ""; }; } t.interpolateLab = uF; function uF(c, b) { c = t.lab(c), b = t.lab(b); var A = c.l, C = c.a, D = c.b, E = b.l - A, q = b.a - C, N = b.b - D; return function(Y) { return Ct(A + E * Y, C + q * Y, D + N * Y) + ""; }; } t.interpolateRound = G_; function G_(c, b) { return b -= c, function(A) { return Math.round(c + b * A); }; } t.transform = function(c) { var b = a.createElementNS(t.ns.prefix.svg, "g"); return (t.transform = function(A) { if (A != null) { b.setAttribute("transform", A); var C = b.transform.baseVal.consolidate(); } return new V_(C ? C.matrix : cF); })(c); }; function V_(c) { var b = [c.a, c.b], A = [c.c, c.d], C = W_(b), D = q_(b, A), E = W_(fF(A, b, -D)) || 0; b[0] * A[1] < A[0] * b[1] && (b[0] *= -1, b[1] *= -1, C *= -1, D *= -1), this.rotate = (C ? Math.atan2(b[1], b[0]) : Math.atan2(-A[0], A[1])) * fe, this.translate = [c.e, c.f], this.scale = [C, E], this.skew = E ? Math.atan2(D, E) * fe : 0; } V_.prototype.toString = function() { return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; }; function q_(c, b) { return c[0] * b[0] + c[1] * b[1]; } function W_(c) { var b = Math.sqrt(q_(c, c)); return b && (c[0] /= b, c[1] /= b), b; } function fF(c, b, A) { return c[0] += A * b[0], c[1] += A * b[1], c; } var cF = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 }; t.interpolateTransform = Z_; function Ls(c) { return c.length ? c.pop() + "," : ""; } function dF(c, b, A, C) { if (c[0] !== b[0] || c[1] !== b[1]) { var D = A.push("translate(", null, ",", null, ")"); C.push({ i: D - 4, x: ao(c[0], b[0]) }, { i: D - 2, x: ao(c[1], b[1]) }); } else (b[0] || b[1]) && A.push("translate(" + b + ")"); } function hF(c, b, A, C) { c !== b ? (c - b > 180 ? b += 360 : b - c > 180 && (c += 360), C.push({ i: A.push(Ls(A) + "rotate(", null, ")") - 2, x: ao(c, b) })) : b && A.push(Ls(A) + "rotate(" + b + ")"); } function vF(c, b, A, C) { c !== b ? C.push({ i: A.push(Ls(A) + "skewX(", null, ")") - 2, x: ao(c, b) }) : b && A.push(Ls(A) + "skewX(" + b + ")"); } function pF(c, b, A, C) { if (c[0] !== b[0] || c[1] !== b[1]) { var D = A.push(Ls(A) + "scale(", null, ",", null, ")"); C.push({ i: D - 4, x: ao(c[0], b[0]) }, { i: D - 2, x: ao(c[1], b[1]) }); } else (b[0] !== 1 || b[1] !== 1) && A.push(Ls(A) + "scale(" + b + ")"); } function Z_(c, b) { var A = [], C = []; return c = t.transform(c), b = t.transform(b), dF(c.translate, b.translate, A, C), hF(c.rotate, b.rotate, A, C), vF(c.skew, b.skew, A, C), pF(c.scale, b.scale, A, C), c = b = null, function(D) { for (var E = -1, q = C.length, N; ++E < q; ) A[(N = C[E]).i] = N.x(D); return A.join(""); }; } function mF(c, b) { return b = (b -= c = +c) || 1 / b, function(A) { return (A - c) / b; }; } function gF(c, b) { return b = (b -= c = +c) || 1 / b, function(A) { return Math.max(0, Math.min(1, (A - c) / b)); }; } t.layout = {}, t.layout.bundle = function() { return function(c) { for (var b = [], A = -1, C = c.length; ++A < C; ) b.push(yF(c[A])); return b; }; }; function yF(c) { for (var b = c.source, A = c.target, C = bF(b, A), D = [b]; b !== C; ) b = b.parent, D.push(b); for (var E = D.length; A !== C; ) D.splice(E, 0, A), A = A.parent; return D; } function Y_(c) { for (var b = [], A = c.parent; A != null; ) b.push(c), c = A, A = A.parent; return b.push(c), b; } function bF(c, b) { if (c === b) return c; for (var A = Y_(c), C = Y_(b), D = A.pop(), E = C.pop(), q = null; D === E; ) q = D, D = A.pop(), E = C.pop(); return q; } t.layout.chord = function() { var c = {}, b, A, C, D, E = 0, q, N, Y; function te() { var ce = {}, de = [], Te = t.range(D), Ae = [], he, ye, be, Se, De; for (b = [], A = [], he = 0, Se = -1; ++Se < D; ) { for (ye = 0, De = -1; ++De < D; ) ye += C[Se][De]; de.push(ye), Ae.push(t.range(D)), he += ye; } for (q && Te.sort(function(Wt, Ft) { return q(de[Wt], de[Ft]); }), N && Ae.forEach(function(Wt, Ft) { Wt.sort(function(Gt, gr) { return N(C[Ft][Gt], C[Ft][gr]); }); }), he = (ct - E * D) / he, ye = 0, Se = -1; ++Se < D; ) { for (be = ye, De = -1; ++De < D; ) { var we = Te[Se], Ze = Ae[we][De], mt = C[we][Ze], xt = ye, yt = ye += mt * he; ce[we + "-" + Ze] = { index: we, subindex: Ze, startAngle: xt, endAngle: yt, value: mt }; } A[we] = { index: we, startAngle: be, endAngle: ye, value: de[we] }, ye += E; } for (Se = -1; ++Se < D; ) for (De = Se - 1; ++De < D; ) { var Lt = ce[Se + "-" + De], Dt = ce[De + "-" + Se]; (Lt.value || Dt.value) && b.push(Lt.value < Dt.value ? { source: Dt, target: Lt } : { source: Lt, target: Dt }); } Y && ne(); } function ne() { b.sort(function(ce, de) { return Y((ce.source.value + ce.target.value) / 2, (de.source.value + de.target.value) / 2); }); } return c.matrix = function(ce) { return arguments.length ? (D = (C = ce) && C.length, b = A = null, c) : C; }, c.padding = function(ce) { return arguments.length ? (E = ce, b = A = null, c) : E; }, c.sortGroups = function(ce) { return arguments.length ? (q = ce, b = A = null, c) : q; }, c.sortSubgroups = function(ce) { return arguments.length ? (N = ce, b = null, c) : N; }, c.sortChords = function(ce) { return arguments.length ? (Y = ce, b && ne(), c) : Y; }, c.chords = function() { return b || te(), b; }, c.groups = function() { return A || te(), A; }, c; }, t.layout.force = function() { var c = {}, b = t.dispatch("start", "tick", "end"), A, C = [1, 1], D, E, q = 0.9, N = kF, Y = AF, te = -30, ne = MF, ce = 0.1, de = 0.64, Te = [], Ae = [], he, ye, be; function Se(we) { return function(Ze, mt, xt, yt) { if (Ze.point !== we) { var Lt = Ze.cx - we.x, Dt = Ze.cy - we.y, Wt = yt - mt, Ft = Lt * Lt + Dt * Dt; if (Wt * Wt / de < Ft) { if (Ft < ne) { var Gt = Ze.charge / Ft; we.px -= Lt * Gt, we.py -= Dt * Gt; } return true; } if (Ze.point && Ft && Ft < ne) { var Gt = Ze.pointCharge / Ft; we.px -= Lt * Gt, we.py -= Dt * Gt; } } return !Ze.charge; }; } c.tick = function() { if ((E *= 0.99) < 5e-3) return A = null, b.end({ type: "end", alpha: E = 0 }), true; var we = Te.length, Ze = Ae.length, mt, xt, yt, Lt, Dt, Wt, Ft, Gt, gr; for (xt = 0; xt < Ze; ++xt) yt = Ae[xt], Lt = yt.source, Dt = yt.target, Gt = Dt.x - Lt.x, gr = Dt.y - Lt.y, (Wt = Gt * Gt + gr * gr) && (Wt = E * ye[xt] * ((Wt = Math.sqrt(Wt)) - he[xt]) / Wt, Gt *= Wt, gr *= Wt, Dt.x -= Gt * (Ft = Lt.weight + Dt.weight ? Lt.weight / (Lt.weight + Dt.weight) : 0.5), Dt.y -= gr * Ft, Lt.x += Gt * (Ft = 1 - Ft), Lt.y += gr * Ft); if ((Ft = E * ce) && (Gt = C[0] / 2, gr = C[1] / 2, xt = -1, Ft)) for (; ++xt < we; ) yt = Te[xt], yt.x += (Gt - yt.x) * Ft, yt.y += (gr - yt.y) * Ft; if (te) for (X_(mt = t.geom.quadtree(Te), E, be), xt = -1; ++xt < we; ) (yt = Te[xt]).fixed || mt.visit(Se(yt)); for (xt = -1; ++xt < we; ) yt = Te[xt], yt.fixed ? (yt.x = yt.px, yt.y = yt.py) : (yt.x -= (yt.px - (yt.px = yt.x)) * q, yt.y -= (yt.py - (yt.py = yt.y)) * q); b.tick({ type: "tick", alpha: E }); }, c.nodes = function(we) { return arguments.length ? (Te = we, c) : Te; }, c.links = function(we) { return arguments.length ? (Ae = we, c) : Ae; }, c.size = function(we) { return arguments.length ? (C = we, c) : C; }, c.linkDistance = function(we) { return arguments.length ? (N = typeof we == "function" ? we : +we, c) : N; }, c.distance = c.linkDistance, c.linkStrength = function(we) { return arguments.length ? (Y = typeof we == "function" ? we : +we, c) : Y; }, c.friction = function(we) { return arguments.length ? (q = +we, c) : q; }, c.charge = function(we) { return arguments.length ? (te = typeof we == "function" ? we : +we, c) : te; }, c.chargeDistance = function(we) { return arguments.length ? (ne = we * we, c) : Math.sqrt(ne); }, c.gravity = function(we) { return arguments.length ? (ce = +we, c) : ce; }, c.theta = function(we) { return arguments.length ? (de = we * we, c) : Math.sqrt(de); }, c.alpha = function(we) { return arguments.length ? (we = +we, E ? we > 0 ? E = we : (A.c = null, A.t = NaN, A = null, b.end({ type: "end", alpha: E = 0 })) : we > 0 && (b.start({ type: "start", alpha: E = we }), A = ha(c.tick)), c) : E; }, c.start = function() { var we, Ze = Te.length, mt = Ae.length, xt = C[0], yt = C[1], Lt, Dt; for (we = 0; we < Ze; ++we) (Dt = Te[we]).index = we, Dt.weight = 0; for (we = 0; we < mt; ++we) Dt = Ae[we], typeof Dt.source == "number" && (Dt.source = Te[Dt.source]), typeof Dt.target == "number" && (Dt.target = Te[Dt.target]), ++Dt.source.weight, ++Dt.target.weight; for (we = 0; we < Ze; ++we) Dt = Te[we], isNaN(Dt.x) && (Dt.x = Wt("x", xt)), isNaN(Dt.y) && (Dt.y = Wt("y", yt)), isNaN(Dt.px) && (Dt.px = Dt.x), isNaN(Dt.py) && (Dt.py = Dt.y); if (he = [], typeof N == "function") for (we = 0; we < mt; ++we) he[we] = +N.call(this, Ae[we], we); else for (we = 0; we < mt; ++we) he[we] = N; if (ye = [], typeof Y == "function") for (we = 0; we < mt; ++we) ye[we] = +Y.call(this, Ae[we], we); else for (we = 0; we < mt; ++we) ye[we] = Y; if (be = [], typeof te == "function") for (we = 0; we < Ze; ++we) be[we] = +te.call(this, Te[we], we); else for (we = 0; we < Ze; ++we) be[we] = te; function Wt(Ft, Gt) { if (!Lt) { for (Lt = new Array(Ze), xr = 0; xr < Ze; ++xr) Lt[xr] = []; for (xr = 0; xr < mt; ++xr) { var gr = Ae[xr]; Lt[gr.source.index].push(gr.target), Lt[gr.target.index].push(gr.source); } } for (var Yr = Lt[we], xr = -1, dt = Yr.length, Zt; ++xr < dt; ) if (!isNaN(Zt = Yr[xr][Ft])) return Zt; return Math.random() * Gt; } return c.resume(); }, c.resume = function() { return c.alpha(0.1); }, c.stop = function() { return c.alpha(0); }, c.drag = function() { if (D || (D = t.behavior.drag().origin(V).on("dragstart.force", _F).on("drag.force", De).on("dragend.force", xF)), !arguments.length) return D; this.on("mouseover.force", wF).on("mouseout.force", TF).call(D); }; function De(we) { we.px = t.event.x, we.py = t.event.y, c.resume(); } return t.rebind(c, b, "on"); }; function _F(c) { c.fixed |= 2; } function xF(c) { c.fixed &= -7; } function wF(c) { c.fixed |= 4, c.px = c.x, c.py = c.y; } function TF(c) { c.fixed &= -5; } function X_(c, b, A) { var C = 0, D = 0; if (c.charge = 0, !c.leaf) for (var E = c.nodes, q = E.length, N = -1, Y; ++N < q; ) Y = E[N], Y != null && (X_(Y, b, A), c.charge += Y.charge, C += Y.charge * Y.cx, D += Y.charge * Y.cy); if (c.point) { c.leaf || (c.point.x += Math.random() - 0.5, c.point.y += Math.random() - 0.5); var te = b * A[c.point.index]; c.charge += c.pointCharge = te, C += te * c.point.x, D += te * c.point.y; } c.cx = C / c.charge, c.cy = D / c.charge; } var kF = 20, AF = 1, MF = 1 / 0; t.layout.hierarchy = function() { var c = LF, b = SF, A = CF; function C(D) { var E = [D], q = [], N; for (D.depth = 0; (N = E.pop()) != null; ) if (q.push(N), (te = b.call(C, N, N.depth)) && (Y = te.length)) { for (var Y, te, ne; --Y >= 0; ) E.push(ne = te[Y]), ne.parent = N, ne.depth = N.depth + 1; A && (N.value = 0), N.children = te; } else A && (N.value = +A.call(C, N, N.depth) || 0), delete N.children; return ki(D, function(ce) { var de, Te; c && (de = ce.children) && de.sort(c), A && (Te = ce.parent) && (Te.value += ce.value); }), q; } return C.sort = function(D) { return arguments.length ? (c = D, C) : c; }, C.children = function(D) { return arguments.length ? (b = D, C) : b; }, C.value = function(D) { return arguments.length ? (A = D, C) : A; }, C.revalue = function(D) { return A && (hf(D, function(E) { E.children && (E.value = 0); }), ki(D, function(E) { var q; E.children || (E.value = +A.call(C, E, E.depth) || 0), (q = E.parent) && (q.value += E.value); })), D; }, C; }; function df(c, b) { return t.rebind(c, b, "sort", "children", "value"), c.nodes = c, c.links = DF, c; } function hf(c, b) { for (var A = [c]; (c = A.pop()) != null; ) if (b(c), (D = c.children) && (C = D.length)) for (var C, D; --C >= 0; ) A.push(D[C]); } function ki(c, b) { for (var A = [c], C = []; (c = A.pop()) != null; ) if (C.push(c), (q = c.children) && (E = q.length)) for (var D = -1, E, q; ++D < E; ) A.push(q[D]); for (; (c = C.pop()) != null; ) b(c); } function SF(c) { return c.children; } function CF(c) { return c.value; } function LF(c, b) { return b.value - c.value; } function DF(c) { return t.merge(c.map(function(b) { return (b.children || []).map(function(A) { return { source: b, target: A }; }); })); } t.layout.partition = function() { var c = t.layout.hierarchy(), b = [1, 1]; function A(E, q, N, Y) { var te = E.children; if (E.x = q, E.y = E.depth * Y, E.dx = N, E.dy = Y, te && (ce = te.length)) { var ne = -1, ce, de, Te; for (N = E.value ? N / E.value : 0; ++ne < ce; ) A(de = te[ne], q, Te = de.value * N, Y), q += Te; } } function C(E) { var q = E.children, N = 0; if (q && (te = q.length)) for (var Y = -1, te; ++Y < te; ) N = Math.max(N, C(q[Y])); return 1 + N; } function D(E, q) { var N = c.call(this, E, q); return A(N[0], 0, b[0], b[1] / C(N[0])), N; } return D.size = function(E) { return arguments.length ? (b = E, D) : b; }, df(D, c); }, t.layout.pie = function() { var c = Number, b = K_, A = 0, C = ct, D = 0; function E(q) { var N = q.length, Y = q.map(function(Se, De) { return +c.call(E, Se, De); }), te = +(typeof A == "function" ? A.apply(this, arguments) : A), ne = (typeof C == "function" ? C.apply(this, arguments) : C) - te, ce = Math.min(Math.abs(ne) / N, +(typeof D == "function" ? D.apply(this, arguments) : D)), de = ce * (ne < 0 ? -1 : 1), Te = t.sum(Y), Ae = Te ? (ne - N * de) / Te : 0, he = t.range(N), ye = [], be; return b != null && he.sort(b === K_ ? function(Se, De) { return Y[De] - Y[Se]; } : function(Se, De) { return b(q[Se], q[De]); }), he.forEach(function(Se) { ye[Se] = { data: q[Se], value: be = Y[Se], startAngle: te, endAngle: te += be * Ae + de, padAngle: ce }; }), ye; } return E.value = function(q) { return arguments.length ? (c = q, E) : c; }, E.sort = function(q) { return arguments.length ? (b = q, E) : b; }, E.startAngle = function(q) { return arguments.length ? (A = q, E) : A; }, E.endAngle = function(q) { return arguments.length ? (C = q, E) : C; }, E.padAngle = function(q) { return arguments.length ? (D = q, E) : D; }, E; }; var K_ = {}; t.layout.stack = function() { var c = V, b = um, A = fm, C = RF, D = EF, E = FF; function q(N, Y) { if (!(Ae = N.length)) return N; var te = N.map(function(Se, De) { return c.call(q, Se, De); }), ne = te.map(function(Se) { return Se.map(function(De, we) { return [D.call(q, De, we), E.call(q, De, we)]; }); }), ce = b.call(q, ne, Y); te = t.permute(te, ce), ne = t.permute(ne, ce); var de = A.call(q, ne, Y), Te = te[0].length, Ae, he, ye, be; for (ye = 0; ye < Te; ++ye) for (C.call(q, te[0][ye], be = de[ye], ne[0][ye][1]), he = 1; he < Ae; ++he) C.call(q, te[he][ye], be += ne[he - 1][ye][1], ne[he][ye][1]); return N; } return q.values = function(N) { return arguments.length ? (c = N, q) : c; }, q.order = function(N) { return arguments.length ? (b = typeof N == "function" ? N : PF.get(N) || um, q) : b; }, q.offset = function(N) { return arguments.length ? (A = typeof N == "function" ? N : $F.get(N) || fm, q) : A; }, q.x = function(N) { return arguments.length ? (D = N, q) : D; }, q.y = function(N) { return arguments.length ? (E = N, q) : E; }, q.out = function(N) { return arguments.length ? (C = N, q) : C; }, q; }; function EF(c) { return c.x; } function FF(c) { return c.y; } function RF(c, b, A) { c.y0 = b, c.y = A; } var PF = t.map({ "inside-out": function(c) { var b = c.length, A, C, D = c.map(zF), E = c.map(IF), q = t.range(b).sort(function(ce, de) { return D[ce] - D[de]; }), N = 0, Y = 0, te = [], ne = []; for (A = 0; A < b; ++A) C = q[A], N < Y ? (N += E[C], te.push(C)) : (Y += E[C], ne.push(C)); return ne.reverse().concat(te); }, reverse: function(c) { return t.range(c.length).reverse(); }, default: um }), $F = t.map({ silhouette: function(c) { var b = c.length, A = c[0].length, C = [], D = 0, E, q, N, Y = []; for (q = 0; q < A; ++q) { for (E = 0, N = 0; E < b; E++) N += c[E][q][1]; N > D && (D = N), C.push(N); } for (q = 0; q < A; ++q) Y[q] = (D - C[q]) / 2; return Y; }, wiggle: function(c) { var b = c.length, A = c[0], C = A.length, D, E, q, N, Y, te, ne, ce, de, Te = []; for (Te[0] = ce = de = 0, E = 1; E < C; ++E) { for (D = 0, N = 0; D < b; ++D) N += c[D][E][1]; for (D = 0, Y = 0, ne = A[E][0] - A[E - 1][0]; D < b; ++D) { for (q = 0, te = (c[D][E][1] - c[D][E - 1][1]) / (2 * ne); q < D; ++q) te += (c[q][E][1] - c[q][E - 1][1]) / ne; Y += te * c[D][E][1]; } Te[E] = ce -= N ? Y / N * ne : 0, ce < de && (de = ce); } for (E = 0; E < C; ++E) Te[E] -= de; return Te; }, expand: function(c) { var b = c.length, A = c[0].length, C = 1 / b, D, E, q, N = []; for (E = 0; E < A; ++E) { for (D = 0, q = 0; D < b; D++) q += c[D][E][1]; if (q) for (D = 0; D < b; D++) c[D][E][1] /= q; else for (D = 0; D < b; D++) c[D][E][1] = C; } for (E = 0; E < A; ++E) N[E] = 0; return N; }, zero: fm }); function um(c) { return t.range(c.length); } function fm(c) { for (var b = -1, A = c[0].length, C = []; ++b < A; ) C[b] = 0; return C; } function zF(c) { for (var b = 1, A = 0, C = c[0][1], D, E = c.length; b < E; ++b) (D = c[b][1]) > C && (A = b, C = D); return A; } function IF(c) { return c.reduce(NF, 0); } function NF(c, b) { return c + b[1]; } t.layout.histogram = function() { var c = true, b = Number, A = HF, C = OF; function D(E, de) { for (var N = [], Y = E.map(b, this), te = A.call(this, Y, de), ne = C.call(this, te, Y, de), ce, de = -1, Te = Y.length, Ae = ne.length - 1, he = c ? 1 : 1 / Te, ye; ++de < Ae; ) ce = N[de] = [], ce.dx = ne[de + 1] - (ce.x = ne[de]), ce.y = 0; if (Ae > 0) for (de = -1; ++de < Te; ) ye = Y[de], ye >= te[0] && ye <= te[1] && (ce = N[t.bisect(ne, ye, 1, Ae) - 1], ce.y += he, ce.push(E[de])); return N; } return D.value = function(E) { return arguments.length ? (b = E, D) : b; }, D.range = function(E) { return arguments.length ? (A = mr(E), D) : A; }, D.bins = function(E) { return arguments.length ? (C = typeof E == "number" ? function(q) { return J_(q, E); } : mr(E), D) : C; }, D.frequency = function(E) { return arguments.length ? (c = !!E, D) : c; }, D; }; function OF(c, b) { return J_(c, Math.ceil(Math.log(b.length) / Math.LN2 + 1)); } function J_(c, b) { for (var A = -1, C = +c[0], D = (c[1] - C) / b, E = []; ++A <= b; ) E[A] = D * A + C; return E; } function HF(c) { return [t.min(c), t.max(c)]; } t.layout.pack = function() { var c = t.layout.hierarchy().sort(BF), b = 0, A = [1, 1], C; function D(E, q) { var N = c.call(this, E, q), Y = N[0], te = A[0], ne = A[1], ce = C == null ? Math.sqrt : typeof C == "function" ? C : function() { return C; }; if (Y.x = Y.y = 0, ki(Y, function(Te) { Te.r = +ce(Te.value); }), ki(Y, tx), b) { var de = b * (C ? 1 : Math.max(2 * Y.r / te, 2 * Y.r / ne)) / 2; ki(Y, function(Te) { Te.r += de; }), ki(Y, tx), ki(Y, function(Te) { Te.r -= de; }); } return rx(Y, te / 2, ne / 2, C ? 1 : 1 / Math.max(2 * Y.r / te, 2 * Y.r / ne)), N; } return D.size = function(E) { return arguments.length ? (A = E, D) : A; }, D.radius = function(E) { return arguments.length ? (C = E == null || typeof E == "function" ? E : +E, D) : C; }, D.padding = function(E) { return arguments.length ? (b = +E, D) : b; }, df(D, c); }; function BF(c, b) { return c.value - b.value; } function cm(c, b) { var A = c._pack_next; c._pack_next = b, b._pack_prev = c, b._pack_next = A, A._pack_prev = b; } function Q_(c, b) { c._pack_next = b, b._pack_prev = c; } function ex(c, b) { var A = b.x - c.x, C = b.y - c.y, D = c.r + b.r; return 0.999 * D * D > A * A + C * C; } function tx(c) { if (!(b = c.children) || !(de = b.length)) return; var b, A = 1 / 0, C = -1 / 0, D = 1 / 0, E = -1 / 0, q, N, Y, te, ne, ce, de; function Te(we) { A = Math.min(we.x - we.r, A), C = Math.max(we.x + we.r, C), D = Math.min(we.y - we.r, D), E = Math.max(we.y + we.r, E); } if (b.forEach(jF), q = b[0], q.x = -q.r, q.y = 0, Te(q), de > 1 && (N = b[1], N.x = N.r, N.y = 0, Te(N), de > 2)) for (Y = b[2], nx(q, N, Y), Te(Y), cm(q, Y), q._pack_prev = Y, cm(Y, N), N = q._pack_next, te = 3; te < de; te++) { nx(q, N, Y = b[te]); var Ae = 0, he = 1, ye = 1; for (ne = N._pack_next; ne !== N; ne = ne._pack_next, he++) if (ex(ne, Y)) { Ae = 1; break; } if (Ae == 1) for (ce = q._pack_prev; ce !== ne._pack_prev && !ex(ce, Y); ce = ce._pack_prev, ye++) ; Ae ? (he < ye || he == ye && N.r < q.r ? Q_(q, N = ne) : Q_(q = ce, N), te--) : (cm(q, Y), N = Y, Te(Y)); } var be = (A + C) / 2, Se = (D + E) / 2, De = 0; for (te = 0; te < de; te++) Y = b[te], Y.x -= be, Y.y -= Se, De = Math.max(De, Y.r + Math.sqrt(Y.x * Y.x + Y.y * Y.y)); c.r = De, b.forEach(UF); } function jF(c) { c._pack_next = c._pack_prev = c; } function UF(c) { delete c._pack_next, delete c._pack_prev; } function rx(c, b, A, C) { var D = c.children; if (c.x = b += C * c.x, c.y = A += C * c.y, c.r *= C, D) for (var E = -1, q = D.length; ++E < q; ) rx(D[E], b, A, C); } function nx(c, b, A) { var C = c.r + A.r, D = b.x - c.x, E = b.y - c.y; if (C && (D || E)) { var q = b.r + A.r, N = D * D + E * E; q *= q, C *= C; var Y = 0.5 + (C - q) / (2 * N), te = Math.sqrt(Math.max(0, 2 * q * (C + N) - (C -= N) * C - q * q)) / (2 * N); A.x = c.x + Y * D + te * E, A.y = c.y + Y * E - te * D; } else A.x = c.x + C, A.y = c.y; } t.layout.tree = function() { var c = t.layout.hierarchy().sort(null).value(null), b = ax, A = [1, 1], C = null; function D(ne, ce) { var de = c.call(this, ne, ce), Te = de[0], Ae = E(Te); if (ki(Ae, q), Ae.parent.m = -Ae.z, hf(Ae, N), C) hf(Te, te); else { var he = Te, ye = Te, be = Te; hf(Te, function(Ze) { Ze.x < he.x && (he = Ze), Ze.x > ye.x && (ye = Ze), Ze.depth > be.depth && (be = Ze); }); var Se = b(he, ye) / 2 - he.x, De = A[0] / (ye.x + b(ye, he) / 2 + Se), we = A[1] / (be.depth || 1); hf(Te, function(Ze) { Ze.x = (Ze.x + Se) * De, Ze.y = Ze.depth * we; }); } return de; } function E(ne) { for (var ce = { A: null, children: [ne] }, de = [ce], Te; (Te = de.pop()) != null; ) for (var Ae = Te.children, he, ye = 0, be = Ae.length; ye < be; ++ye) de.push((Ae[ye] = he = { _: Ae[ye], parent: Te, children: (he = Ae[ye].children) && he.slice() || [], A: null, a: null, z: 0, m: 0, c: 0, s: 0, t: null, i: ye }).a = he); return ce.children[0]; } function q(ne) { var ce = ne.children, de = ne.parent.children, Te = ne.i ? de[ne.i - 1] : null; if (ce.length) { VF(ne); var Ae = (ce[0].z + ce[ce.length - 1].z) / 2; Te ? (ne.z = Te.z + b(ne._, Te._), ne.m = ne.z - Ae) : ne.z = Ae; } else Te && (ne.z = Te.z + b(ne._, Te._)); ne.parent.A = Y(ne, Te, ne.parent.A || de[0]); } function N(ne) { ne._.x = ne.z + ne.parent.m, ne.m += ne.parent.m; } function Y(ne, ce, de) { if (ce) { for (var Te = ne, Ae = ne, he = ce, ye = Te.parent.children[0], be = Te.m, Se = Ae.m, De = he.m, we = ye.m, Ze; he = hm(he), Te = dm(Te), he && Te; ) ye = dm(ye), Ae = hm(Ae), Ae.a = ne, Ze = he.z + De - Te.z - be + b(he._, Te._), Ze > 0 && (GF(qF(he, ne, de), ne, Ze), be += Ze, Se += Ze), De += he.m, be += Te.m, we += ye.m, Se += Ae.m; he && !hm(Ae) && (Ae.t = he, Ae.m += De - Se), Te && !dm(ye) && (ye.t = Te, ye.m += be - we, de = ne); } return de; } function te(ne) { ne.x *= A[0], ne.y = ne.depth * A[1]; } return D.separation = function(ne) { return arguments.length ? (b = ne, D) : b; }, D.size = function(ne) { return arguments.length ? (C = (A = ne) == null ? te : null, D) : C ? null : A; }, D.nodeSize = function(ne) { return arguments.length ? (C = (A = ne) == null ? null : te, D) : C ? A : null; }, df(D, c); }; function ax(c, b) { return c.parent == b.parent ? 1 : 2; } function dm(c) { var b = c.children; return b.length ? b[0] : c.t; } function hm(c) { var b = c.children, A; return (A = b.length) ? b[A - 1] : c.t; } function GF(c, b, A) { var C = A / (b.i - c.i); b.c -= C, b.s += A, c.c += C, b.z += A, b.m += A; } function VF(c) { for (var b = 0, A = 0, C = c.children, D = C.length, E; --D >= 0; ) E = C[D], E.z += b, E.m += b, b += E.s + (A += E.c); } function qF(c, b, A) { return c.a.parent === b.parent ? c.a : A; } t.layout.cluster = function() { var c = t.layout.hierarchy().sort(null).value(null), b = ax, A = [1, 1], C = false; function D(E, q) { var N = c.call(this, E, q), Y = N[0], te, ne = 0; ki(Y, function(he) { var ye = he.children; ye && ye.length ? (he.x = ZF(ye), he.y = WF(ye)) : (he.x = te ? ne += b(he, te) : 0, he.y = 0, te = he); }); var ce = ix(Y), de = ox(Y), Te = ce.x - b(ce, de) / 2, Ae = de.x + b(de, ce) / 2; return ki(Y, C ? function(he) { he.x = (he.x - Y.x) * A[0], he.y = (Y.y - he.y) * A[1]; } : function(he) { he.x = (he.x - Te) / (Ae - Te) * A[0], he.y = (1 - (Y.y ? he.y / Y.y : 1)) * A[1]; }), N; } return D.separation = function(E) { return arguments.length ? (b = E, D) : b; }, D.size = function(E) { return arguments.length ? (C = (A = E) == null, D) : C ? null : A; }, D.nodeSize = function(E) { return arguments.length ? (C = (A = E) != null, D) : C ? A : null; }, df(D, c); }; function WF(c) { return 1 + t.max(c, function(b) { return b.y; }); } function ZF(c) { return c.reduce(function(b, A) { return b + A.x; }, 0) / c.length; } function ix(c) { var b = c.children; return b && b.length ? ix(b[0]) : c; } function ox(c) { var b = c.children, A; return b && (A = b.length) ? ox(b[A - 1]) : c; } t.layout.treemap = function() { var c = t.layout.hierarchy(), b = Math.round, A = [1, 1], C = null, D = vm, E = false, q, N = "squarify", Y = 0.5 * (1 + Math.sqrt(5)); function te(he, ye) { for (var be = -1, Se = he.length, De, we; ++be < Se; ) we = (De = he[be]).value * (ye < 0 ? 0 : ye), De.area = isNaN(we) || we <= 0 ? 0 : we; } function ne(he) { var ye = he.children; if (ye && ye.length) { var be = D(he), Se = [], De = ye.slice(), we, Ze = 1 / 0, mt, xt = N === "slice" ? be.dx : N === "dice" ? be.dy : N === "slice-dice" ? he.depth & 1 ? be.dy : be.dx : Math.min(be.dx, be.dy), yt; for (te(De, be.dx * be.dy / he.value), Se.area = 0; (yt = De.length) > 0; ) Se.push(we = De[yt - 1]), Se.area += we.area, N !== "squarify" || (mt = de(Se, xt)) <= Ze ? (De.pop(), Ze = mt) : (Se.area -= Se.pop().area, Te(Se, xt, be, false), xt = Math.min(be.dx, be.dy), Se.length = Se.area = 0, Ze = 1 / 0); Se.length && (Te(Se, xt, be, true), Se.length = Se.area = 0), ye.forEach(ne); } } function ce(he) { var ye = he.children; if (ye && ye.length) { var be = D(he), Se = ye.slice(), De, we = []; for (te(Se, be.dx * be.dy / he.value), we.area = 0; De = Se.pop(); ) we.push(De), we.area += De.area, De.z != null && (Te(we, De.z ? be.dx : be.dy, be, !Se.length), we.length = we.area = 0); ye.forEach(ce); } } function de(he, ye) { for (var be = he.area, Se, De = 0, we = 1 / 0, Ze = -1, mt = he.length; ++Ze < mt; ) (Se = he[Ze].area) && (Se < we && (we = Se), Se > De && (De = Se)); return be *= be, ye *= ye, be ? Math.max(ye * De * Y / be, be / (ye * we * Y)) : 1 / 0; } function Te(he, ye, be, Se) { var De = -1, we = he.length, Ze = be.x, mt = be.y, xt = ye ? b(he.area / ye) : 0, yt; if (ye == be.dx) { for ((Se || xt > be.dy) && (xt = be.dy); ++De < we; ) yt = he[De], yt.x = Ze, yt.y = mt, yt.dy = xt, Ze += yt.dx = Math.min(be.x + be.dx - Ze, xt ? b(yt.area / xt) : 0); yt.z = true, yt.dx += be.x + be.dx - Ze, be.y += xt, be.dy -= xt; } else { for ((Se || xt > be.dx) && (xt = be.dx); ++De < we; ) yt = he[De], yt.x = Ze, yt.y = mt, yt.dx = xt, mt += yt.dy = Math.min(be.y + be.dy - mt, xt ? b(yt.area / xt) : 0); yt.z = false, yt.dy += be.y + be.dy - mt, be.x += xt, be.dx -= xt; } } function Ae(he) { var ye = q || c(he), be = ye[0]; return be.x = be.y = 0, be.value ? (be.dx = A[0], be.dy = A[1]) : be.dx = be.dy = 0, q && c.revalue(be), te([be], be.dx * be.dy / be.value), (q ? ce : ne)(be), E && (q = ye), ye; } return Ae.size = function(he) { return arguments.length ? (A = he, Ae) : A; }, Ae.padding = function(he) { if (!arguments.length) return C; function ye(De) { var we = he.call(Ae, De, De.depth); return we == null ? vm(De) : lx(De, typeof we == "number" ? [we, we, we, we] : we); } function be(De) { return lx(De, he); } var Se; return D = (C = he) == null ? vm : (Se = typeof he) == "function" ? ye : (Se === "number" && (he = [he, he, he, he]), be), Ae; }, Ae.round = function(he) { return arguments.length ? (b = he ? Math.round : Number, Ae) : b != Number; }, Ae.sticky = function(he) { return arguments.length ? (E = he, q = null, Ae) : E; }, Ae.ratio = function(he) { return arguments.length ? (Y = he, Ae) : Y; }, Ae.mode = function(he) { return arguments.length ? (N = he + "", Ae) : N; }, df(Ae, c); }; function vm(c) { return { x: c.x, y: c.y, dx: c.dx, dy: c.dy }; } function lx(c, b) { var A = c.x + b[3], C = c.y + b[0], D = c.dx - b[1] - b[3], E = c.dy - b[0] - b[2]; return D < 0 && (A += D / 2, D = 0), E < 0 && (C += E / 2, E = 0), { x: A, y: C, dx: D, dy: E }; } t.random = { normal: function(c, b) { var A = arguments.length; return A < 2 && (b = 1), A < 1 && (c = 0), function() { var C, D, E; do C = Math.random() * 2 - 1, D = Math.random() * 2 - 1, E = C * C + D * D; while (!E || E > 1); return c + b * C * Math.sqrt(-2 * Math.log(E) / E); }; }, logNormal: function() { var c = t.random.normal.apply(t, arguments); return function() { return Math.exp(c()); }; }, bates: function(c) { var b = t.random.irwinHall(c); return function() { return b() / c; }; }, irwinHall: function(c) { return function() { for (var b = 0, A = 0; A < c; A++) b += Math.random(); return b; }; } }, t.scale = {}; function hd(c) { var b = c[0], A = c[c.length - 1]; return b < A ? [b, A] : [A, b]; } function vd(c) { return c.rangeExtent ? c.rangeExtent() : hd(c.range()); } function YF(c, b, A, C) { var D = A(c[0], c[1]), E = C(b[0], b[1]); return function(q) { return E(D(q)); }; } function pm(c, b) { var A = 0, C = c.length - 1, D = c[A], E = c[C], q; return E < D && (q = A, A = C, C = q, q = D, D = E, E = q), c[A] = b.floor(D), c[C] = b.ceil(E), c; } function sx(c) { return c ? { floor: function(b) { return Math.floor(b / c) * c; }, ceil: function(b) { return Math.ceil(b / c) * c; } } : XF; } var XF = { floor: V, ceil: V }; function KF(c, b, A, C) { var D = [], E = [], q = 0, N = Math.min(c.length, b.length) - 1; for (c[N] < c[0] && (c = c.slice().reverse(), b = b.slice().reverse()); ++q <= N; ) D.push(A(c[q - 1], c[q])), E.push(C(b[q - 1], b[q])); return function(Y) { var te = t.bisect(c, Y, 1, N) - 1; return E[te](D[te](Y)); }; } t.scale.linear = function() { return ux([0, 1], [0, 1], kl, false); }; function ux(c, b, A, C) { var D, E; function q() { var Y = Math.min(c.length, b.length) > 2 ? KF : YF, te = C ? gF : mF; return D = Y(c, b, te, A), E = Y(b, c, te, kl), N; } function N(Y) { return D(Y); } return N.invert = function(Y) { return E(Y); }, N.domain = function(Y) { return arguments.length ? (c = Y.map(Number), q()) : c; }, N.range = function(Y) { return arguments.length ? (b = Y, q()) : b; }, N.rangeRound = function(Y) { return N.range(Y).interpolate(G_); }, N.clamp = function(Y) { return arguments.length ? (C = Y, q()) : C; }, N.interpolate = function(Y) { return arguments.length ? (A = Y, q()) : A; }, N.ticks = function(Y) { return gm(c, Y); }, N.tickFormat = function(Y, te) { return d3_scale_linearTickFormat(c, Y, te); }, N.nice = function(Y) { return cx(c, Y), q(); }, N.copy = function() { return ux(c, b, A, C); }, q(); } function fx(c, b) { return t.rebind(c, b, "range", "rangeRound", "interpolate", "clamp"); } function cx(c, b) { return pm(c, sx(mm(c, b)[2])), pm(c, sx(mm(c, b)[2])), c; } function mm(c, b) { b == null && (b = 10); var A = hd(c), C = A[1] - A[0], D = Math.pow(10, Math.floor(Math.log(C / b) / Math.LN10)), E = b / C * D; return E <= 0.15 ? D *= 10 : E <= 0.35 ? D *= 5 : E <= 0.75 && (D *= 2), A[0] = Math.ceil(A[0] / D) * D, A[1] = Math.floor(A[1] / D) * D + D * 0.5, A[2] = D, A; } function gm(c, b) { return t.range.apply(t, mm(c, b)); } t.scale.log = function() { return dx(t.scale.linear().domain([0, 1]), 10, true, [1, 10]); }; function dx(c, b, A, C) { function D(N) { return (A ? Math.log(N < 0 ? 0 : N) : -Math.log(N > 0 ? 0 : -N)) / Math.log(b); } function E(N) { return A ? Math.pow(b, N) : -Math.pow(b, -N); } function q(N) { return c(D(N)); } return q.invert = function(N) { return E(c.invert(N)); }, q.domain = function(N) { return arguments.length ? (A = N[0] >= 0, c.domain((C = N.map(Number)).map(D)), q) : C; }, q.base = function(N) { return arguments.length ? (b = +N, c.domain(C.map(D)), q) : b; }, q.nice = function() { var N = pm(C.map(D), A ? Math : JF); return c.domain(N), C = N.map(E), q; }, q.ticks = function() { var N = hd(C), Y = [], te = N[0], ne = N[1], ce = Math.floor(D(te)), de = Math.ceil(D(ne)), Te = b % 1 ? 2 : b; if (isFinite(de - ce)) { if (A) { for (; ce < de; ce++) for (var Ae = 1; Ae < Te; Ae++) Y.push(E(ce) * Ae); Y.push(E(ce)); } else for (Y.push(E(ce)); ce++ < de; ) for (var Ae = Te - 1; Ae > 0; Ae--) Y.push(E(ce) * Ae); for (ce = 0; Y[ce] < te; ce++) ; for (de = Y.length; Y[de - 1] > ne; de--) ; Y = Y.slice(ce, de); } return Y; }, q.copy = function() { return dx(c.copy(), b, A, C); }, fx(q, c); } var JF = { floor: function(c) { return -Math.ceil(-c); }, ceil: function(c) { return -Math.floor(-c); } }; t.scale.pow = function() { return hx(t.scale.linear(), 1, [0, 1]); }; function hx(c, b, A) { var C = pd(b), D = pd(1 / b); function E(q) { return c(C(q)); } return E.invert = function(q) { return D(c.invert(q)); }, E.domain = function(q) { return arguments.length ? (c.domain((A = q.map(Number)).map(C)), E) : A; }, E.ticks = function(q) { return gm(A, q); }, E.tickFormat = function(q, N) { return d3_scale_linearTickFormat(A, q, N); }, E.nice = function(q) { return E.domain(cx(A, q)); }, E.exponent = function(q) { return arguments.length ? (C = pd(b = q), D = pd(1 / b), c.domain(A.map(C)), E) : b; }, E.copy = function() { return hx(c.copy(), b, A); }, fx(E, c); } function pd(c) { return function(b) { return b < 0 ? -Math.pow(-b, c) : Math.pow(b, c); }; } t.scale.sqrt = function() { return t.scale.pow().exponent(0.5); }, t.scale.ordinal = function() { return vx([], { t: "range", a: [[]] }); }; function vx(c, b) { var A, C, D; function E(N) { return C[((A.get(N) || (b.t === "range" ? A.set(N, c.push(N)) : NaN)) - 1) % C.length]; } function q(N, Y) { return t.range(c.length).map(function(te) { return N + Y * te; }); } return E.domain = function(N) { if (!arguments.length) return c; c = [], A = new _(); for (var Y = -1, te = N.length, ne; ++Y < te; ) A.has(ne = N[Y]) || A.set(ne, c.push(ne)); return E[b.t].apply(E, b.a); }, E.range = function(N) { return arguments.length ? (C = N, D = 0, b = { t: "range", a: arguments }, E) : C; }, E.rangePoints = function(N, Y) { arguments.length < 2 && (Y = 0); var te = N[0], ne = N[1], ce = c.length < 2 ? (te = (te + ne) / 2, 0) : (ne - te) / (c.length - 1 + Y); return C = q(te + ce * Y / 2, ce), D = 0, b = { t: "rangePoints", a: arguments }, E; }, E.rangeRoundPoints = function(N, Y) { arguments.length < 2 && (Y = 0); var te = N[0], ne = N[1], ce = c.length < 2 ? (te = ne = Math.round((te + ne) / 2), 0) : (ne - te) / (c.length - 1 + Y) | 0; return C = q(te + Math.round(ce * Y / 2 + (ne - te - (c.length - 1 + Y) * ce) / 2), ce), D = 0, b = { t: "rangeRoundPoints", a: arguments }, E; }, E.rangeBands = function(N, Y, te) { arguments.length < 2 && (Y = 0), arguments.length < 3 && (te = Y); var ne = N[1] < N[0], ce = N[ne - 0], de = N[1 - ne], Te = (de - ce) / (c.length - Y + 2 * te); return C = q(ce + Te * te, Te), ne && C.reverse(), D = Te * (1 - Y), b = { t: "rangeBands", a: arguments }, E; }, E.rangeRoundBands = function(N, Y, te) { arguments.length < 2 && (Y = 0), arguments.length < 3 && (te = Y); var ne = N[1] < N[0], ce = N[ne - 0], de = N[1 - ne], Te = Math.floor((de - ce) / (c.length - Y + 2 * te)); return C = q(ce + Math.round((de - ce - (c.length - Y) * Te) / 2), Te), ne && C.reverse(), D = Math.round(Te * (1 - Y)), b = { t: "rangeRoundBands", a: arguments }, E; }, E.rangeBand = function() { return D; }, E.rangeExtent = function() { return hd(b.a[0]); }, E.copy = function() { return vx(c, b); }, E.domain(c); } t.scale.category10 = function() { return t.scale.ordinal().range(QF); }, t.scale.category20 = function() { return t.scale.ordinal().range(eR); }, t.scale.category20b = function() { return t.scale.ordinal().range(tR); }, t.scale.category20c = function() { return t.scale.ordinal().range(rR); }; var QF = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(Pn), eR = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(Pn), tR = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(Pn), rR = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(Pn); t.scale.quantile = function() { return px([], []); }; function px(c, b) { var A; function C() { var E = 0, q = b.length; for (A = []; ++E < q; ) A[E - 1] = t.quantile(c, E / q); return D; } function D(E) { if (!isNaN(E = +E)) return b[t.bisect(A, E)]; } return D.domain = function(E) { return arguments.length ? (c = E.map(p).filter(v).sort(h), C()) : c; }, D.range = function(E) { return arguments.length ? (b = E, C()) : b; }, D.quantiles = function() { return A; }, D.invertExtent = function(E) { return E = b.indexOf(E), E < 0 ? [NaN, NaN] : [E > 0 ? A[E - 1] : c[0], E < A.length ? A[E] : c[c.length - 1]]; }, D.copy = function() { return px(c, b); }, C(); } t.scale.quantize = function() { return mx(0, 1, [0, 1]); }; function mx(c, b, A) { var C, D; function E(N) { return A[Math.max(0, Math.min(D, Math.floor(C * (N - c))))]; } function q() { return C = A.length / (b - c), D = A.length - 1, E; } return E.domain = function(N) { return arguments.length ? (c = +N[0], b = +N[N.length - 1], q()) : [c, b]; }, E.range = function(N) { return arguments.length ? (A = N, q()) : A; }, E.invertExtent = function(N) { return N = A.indexOf(N), N = N < 0 ? NaN : N / C + c, [N, N + 1 / C]; }, E.copy = function() { return mx(c, b, A); }, q(); } t.scale.threshold = function() { return gx([0.5], [0, 1]); }; function gx(c, b) { function A(C) { if (C <= C) return b[t.bisect(c, C)]; } return A.domain = function(C) { return arguments.length ? (c = C, A) : c; }, A.range = function(C) { return arguments.length ? (b = C, A) : b; }, A.invertExtent = function(C) { return C = b.indexOf(C), [c[C - 1], c[C]]; }, A.copy = function() { return gx(c, b); }, A; } t.scale.identity = function() { return yx([0, 1]); }; function yx(c) { function b(A) { return +A; } return b.invert = b, b.domain = b.range = function(A) { return arguments.length ? (c = A.map(b), b) : c; }, b.ticks = function(A) { return gm(c, A); }, b.tickFormat = function(A, C) { return d3_scale_linearTickFormat(c, A, C); }, b.copy = function() { return yx(c); }, b; } t.svg = {}; function nR() { return 0; } t.svg.arc = function() { var c = aR, b = iR, A = nR, C = md, D = bx, E = _x, q = oR; function N() { var te = Math.max(0, +c.apply(this, arguments)), ne = Math.max(0, +b.apply(this, arguments)), ce = D.apply(this, arguments) - se, de = E.apply(this, arguments) - se, Te = Math.abs(de - ce), Ae = ce > de ? 0 : 1; if (ne < te && (he = ne, ne = te, te = he), Te >= X) return Y(ne, Ae) + (te ? Y(te, 1 - Ae) : "") + "Z"; var he, ye, be, Se, De = 0, we = 0, Ze, mt, xt, yt, Lt, Dt, Wt, Ft, Gt = []; if ((Se = (+q.apply(this, arguments) || 0) / 2) && (be = C === md ? Math.sqrt(te * te + ne * ne) : +C.apply(this, arguments), Ae || (we *= -1), ne && (we = _e(be / ne * Math.sin(Se))), te && (De = _e(be / te * Math.sin(Se)))), ne) { Ze = ne * Math.cos(ce + we), mt = ne * Math.sin(ce + we), xt = ne * Math.cos(de - we), yt = ne * Math.sin(de - we); var gr = Math.abs(de - ce - 2 * we) <= rt ? 0 : 1; if (we && gd(Ze, mt, xt, yt) === Ae ^ gr) { var Yr = (ce + de) / 2; Ze = ne * Math.cos(Yr), mt = ne * Math.sin(Yr), xt = yt = null; } } else Ze = mt = 0; if (te) { Lt = te * Math.cos(de - De), Dt = te * Math.sin(de - De), Wt = te * Math.cos(ce + De), Ft = te * Math.sin(ce + De); var xr = Math.abs(ce - de + 2 * De) <= rt ? 0 : 1; if (De && gd(Lt, Dt, Wt, Ft) === 1 - Ae ^ xr) { var dt = (ce + de) / 2; Lt = te * Math.cos(dt), Dt = te * Math.sin(dt), Wt = Ft = null; } } else Lt = Dt = 0; if (Te > Ke && (he = Math.min(Math.abs(ne - te) / 2, +A.apply(this, arguments))) > 1e-3) { ye = te < ne ^ Ae ? 0 : 1; var Zt = he, Jt = he; if (Te < rt) { var yr = Wt == null ? [Lt, Dt] : xt == null ? [Ze, mt] : tm([Ze, mt], [Wt, Ft], [xt, yt], [Lt, Dt]), Gr = Ze - yr[0], un = mt - yr[1], kn = xt - yr[0], $n = yt - yr[1], Un = 1 / Math.sin(Math.acos((Gr * kn + un * $n) / (Math.sqrt(Gr * Gr + un * un) * Math.sqrt(kn * kn + $n * $n))) / 2), zn = Math.sqrt(yr[0] * yr[0] + yr[1] * yr[1]); Jt = Math.min(he, (te - zn) / (Un - 1)), Zt = Math.min(he, (ne - zn) / (Un + 1)); } if (xt != null) { var Qn = yd(Wt == null ? [Lt, Dt] : [Wt, Ft], [Ze, mt], ne, Zt, Ae), Cn = yd([xt, yt], [Lt, Dt], ne, Zt, Ae); he === Zt ? Gt.push("M", Qn[0], "A", Zt, ",", Zt, " 0 0,", ye, " ", Qn[1], "A", ne, ",", ne, " 0 ", 1 - Ae ^ gd(Qn[1][0], Qn[1][1], Cn[1][0], Cn[1][1]), ",", Ae, " ", Cn[1], "A", Zt, ",", Zt, " 0 0,", ye, " ", Cn[0]) : Gt.push("M", Qn[0], "A", Zt, ",", Zt, " 0 1,", ye, " ", Cn[0]); } else Gt.push("M", Ze, ",", mt); if (Wt != null) { var ea = yd([Ze, mt], [Wt, Ft], te, -Jt, Ae), Ml = yd([Lt, Dt], xt == null ? [Ze, mt] : [xt, yt], te, -Jt, Ae); he === Jt ? Gt.push("L", Ml[0], "A", Jt, ",", Jt, " 0 0,", ye, " ", Ml[1], "A", te, ",", te, " 0 ", Ae ^ gd(Ml[1][0], Ml[1][1], ea[1][0], ea[1][1]), ",", 1 - Ae, " ", ea[1], "A", Jt, ",", Jt, " 0 0,", ye, " ", ea[0]) : Gt.push("L", Ml[0], "A", Jt, ",", Jt, " 0 0,", ye, " ", ea[0]); } else Gt.push("L", Lt, ",", Dt); } else Gt.push("M", Ze, ",", mt), xt != null && Gt.push("A", ne, ",", ne, " 0 ", gr, ",", Ae, " ", xt, ",", yt), Gt.push("L", Lt, ",", Dt), Wt != null && Gt.push("A", te, ",", te, " 0 ", xr, ",", 1 - Ae, " ", Wt, ",", Ft); return Gt.push("Z"), Gt.join(""); } function Y(te, ne) { return "M0," + te + "A" + te + "," + te + " 0 1," + ne + " 0," + -te + "A" + te + "," + te + " 0 1," + ne + " 0," + te; } return N.innerRadius = function(te) { return arguments.length ? (c = mr(te), N) : c; }, N.outerRadius = function(te) { return arguments.length ? (b = mr(te), N) : b; }, N.cornerRadius = function(te) { return arguments.length ? (A = mr(te), N) : A; }, N.padRadius = function(te) { return arguments.length ? (C = te == md ? md : mr(te), N) : C; }, N.startAngle = function(te) { return arguments.length ? (D = mr(te), N) : D; }, N.endAngle = function(te) { return arguments.length ? (E = mr(te), N) : E; }, N.padAngle = function(te) { return arguments.length ? (q = mr(te), N) : q; }, N.centroid = function() { var te = (+c.apply(this, arguments) + +b.apply(this, arguments)) / 2, ne = (+D.apply(this, arguments) + +E.apply(this, arguments)) / 2 - se; return [Math.cos(ne) * te, Math.sin(ne) * te]; }, N; }; var md = "auto"; function aR(c) { return c.innerRadius; } function iR(c) { return c.outerRadius; } function bx(c) { return c.startAngle; } function _x(c) { return c.endAngle; } function oR(c) { return c && c.padAngle; } function gd(c, b, A, C) { return (c - A) * b - (b - C) * c > 0 ? 0 : 1; } function yd(c, b, A, C, D) { var E = c[0] - b[0], q = c[1] - b[1], N = (D ? C : -C) / Math.sqrt(E * E + q * q), Y = N * q, te = -N * E, ne = c[0] + Y, ce = c[1] + te, de = b[0] + Y, Te = b[1] + te, Ae = (ne + de) / 2, he = (ce + Te) / 2, ye = de - ne, be = Te - ce, Se = ye * ye + be * be, De = A - C, we = ne * Te - de * ce, Ze = (be < 0 ? -1 : 1) * Math.sqrt(Math.max(0, De * De * Se - we * we)), mt = (we * be - ye * Ze) / Se, xt = (-we * ye - be * Ze) / Se, yt = (we * be + ye * Ze) / Se, Lt = (-we * ye + be * Ze) / Se, Dt = mt - Ae, Wt = xt - he, Ft = yt - Ae, Gt = Lt - he; return Dt * Dt + Wt * Wt > Ft * Ft + Gt * Gt && (mt = yt, xt = Lt), [[mt - Y, xt - te], [mt * A / De, xt * A / De]]; } function xx() { return true; } function wx(c) { var b = ks, A = of, C = xx, D = Qa, E = D.key, q = 0.7; function N(Y) { var te = [], ne = [], ce = -1, de = Y.length, Te, Ae = mr(b), he = mr(A); function ye() { te.push("M", D(c(ne), q)); } for (; ++ce < de; ) C.call(this, Te = Y[ce], ce) ? ne.push([+Ae.call(this, Te, ce), +he.call(this, Te, ce)]) : ne.length && (ye(), ne = []); return ne.length && ye(), te.length ? te.join("") : null; } return N.x = function(Y) { return arguments.length ? (b = Y, N) : b; }, N.y = function(Y) { return arguments.length ? (A = Y, N) : A; }, N.defined = function(Y) { return arguments.length ? (C = Y, N) : C; }, N.interpolate = function(Y) { return arguments.length ? (typeof Y == "function" ? E = D = Y : E = (D = ym.get(Y) || Qa).key, N) : E; }, N.tension = function(Y) { return arguments.length ? (q = Y, N) : q; }, N; } t.svg.line = function() { return wx(V); }; var ym = t.map({ linear: Qa, "linear-closed": Tx, step: lR, "step-before": bm, "step-after": _m, basis: kx, "basis-open": cR, "basis-closed": dR, bundle: hR, cardinal: fR, "cardinal-open": sR, "cardinal-closed": uR, monotone: mR }); ym.forEach(function(c, b) { b.key = c, b.closed = /-closed$/.test(c); }); function Qa(c) { return c.length > 1 ? c.join("L") : c + "Z"; } function Tx(c) { return c.join("L") + "Z"; } function lR(c) { for (var b = 0, A = c.length, C = c[0], D = [C[0], ",", C[1]]; ++b < A; ) D.push("H", (C[0] + (C = c[b])[0]) / 2, "V", C[1]); return A > 1 && D.push("H", C[0]), D.join(""); } function bm(c) { for (var b = 0, A = c.length, C = c[0], D = [C[0], ",", C[1]]; ++b < A; ) D.push("V", (C = c[b])[1], "H", C[0]); return D.join(""); } function _m(c) { for (var b = 0, A = c.length, C = c[0], D = [C[0], ",", C[1]]; ++b < A; ) D.push("H", (C = c[b])[0], "V", C[1]); return D.join(""); } function sR(c, b) { return c.length < 4 ? Qa(c) : c[1] + bd(c.slice(1, -1), xm(c, b)); } function uR(c, b) { return c.length < 3 ? Tx(c) : c[0] + bd((c.push(c[0]), c), xm([c[c.length - 2]].concat(c, [c[1]]), b)); } function fR(c, b) { return c.length < 3 ? Qa(c) : c[0] + bd(c, xm(c, b)); } function bd(c, b) { if (b.length < 1 || c.length != b.length && c.length != b.length + 2) return Qa(c); var A = c.length != b.length, C = "", D = c[0], E = c[1], q = b[0], N = q, Y = 1; if (A && (C += "Q" + (E[0] - q[0] * 2 / 3) + "," + (E[1] - q[1] * 2 / 3) + "," + E[0] + "," + E[1], D = c[1], Y = 2), b.length > 1) { N = b[1], E = c[Y], Y++, C += "C" + (D[0] + q[0]) + "," + (D[1] + q[1]) + "," + (E[0] - N[0]) + "," + (E[1] - N[1]) + "," + E[0] + "," + E[1]; for (var te = 2; te < b.length; te++, Y++) E = c[Y], N = b[te], C += "S" + (E[0] - N[0]) + "," + (E[1] - N[1]) + "," + E[0] + "," + E[1]; } if (A) { var ne = c[Y]; C += "Q" + (E[0] + N[0] * 2 / 3) + "," + (E[1] + N[1] * 2 / 3) + "," + ne[0] + "," + ne[1]; } return C; } function xm(c, b) { for (var A = [], C = (1 - b) / 2, D, E = c[0], q = c[1], N = 1, Y = c.length; ++N < Y; ) D = E, E = q, q = c[N], A.push([C * (q[0] - D[0]), C * (q[1] - D[1])]); return A; } function kx(c) { if (c.length < 3) return Qa(c); var b = 1, A = c.length, C = c[0], D = C[0], E = C[1], q = [D, D, D, (C = c[1])[0]], N = [E, E, E, C[1]], Y = [D, ",", E, "L", Sa(Ro, q), ",", Sa(Ro, N)]; for (c.push(c[A - 1]); ++b <= A; ) C = c[b], q.shift(), q.push(C[0]), N.shift(), N.push(C[1]), wm(Y, q, N); return c.pop(), Y.push("L", C), Y.join(""); } function cR(c) { if (c.length < 4) return Qa(c); for (var b = [], A = -1, C = c.length, D, E = [0], q = [0]; ++A < 3; ) D = c[A], E.push(D[0]), q.push(D[1]); for (b.push(Sa(Ro, E) + "," + Sa(Ro, q)), --A; ++A < C; ) D = c[A], E.shift(), E.push(D[0]), q.shift(), q.push(D[1]), wm(b, E, q); return b.join(""); } function dR(c) { for (var b, A = -1, C = c.length, D = C + 4, E, q = [], N = []; ++A < 4; ) E = c[A % C], q.push(E[0]), N.push(E[1]); for (b = [Sa(Ro, q), ",", Sa(Ro, N)], --A; ++A < D; ) E = c[A % C], q.shift(), q.push(E[0]), N.shift(), N.push(E[1]), wm(b, q, N); return b.join(""); } function hR(c, b) { var A = c.length - 1; if (A) for (var C = c[0][0], D = c[0][1], E = c[A][0] - C, q = c[A][1] - D, N = -1, Y, te; ++N <= A; ) Y = c[N], te = N / A, Y[0] = b * Y[0] + (1 - b) * (C + te * E), Y[1] = b * Y[1] + (1 - b) * (D + te * q); return kx(c); } function Sa(c, b) { return c[0] * b[0] + c[1] * b[1] + c[2] * b[2] + c[3] * b[3]; } var Ax = [0, 2 / 3, 1 / 3, 0], Mx = [0, 1 / 3, 2 / 3, 0], Ro = [0, 1 / 6, 2 / 3, 1 / 6]; function wm(c, b, A) { c.push("C", Sa(Ax, b), ",", Sa(Ax, A), ",", Sa(Mx, b), ",", Sa(Mx, A), ",", Sa(Ro, b), ",", Sa(Ro, A)); } function Tm(c, b) { return (b[1] - c[1]) / (b[0] - c[0]); } function vR(c) { for (var b = 0, A = c.length - 1, C = [], D = c[0], E = c[1], q = C[0] = Tm(D, E); ++b < A; ) C[b] = (q + (q = Tm(D = E, E = c[b + 1]))) / 2; return C[b] = q, C; } function pR(c) { for (var b = [], A, C, D, E, q = vR(c), N = -1, Y = c.length - 1; ++N < Y; ) A = Tm(c[N], c[N + 1]), w(A) < Ke ? q[N] = q[N + 1] = 0 : (C = q[N] / A, D = q[N + 1] / A, E = C * C + D * D, E > 9 && (E = A * 3 / Math.sqrt(E), q[N] = E * C, q[N + 1] = E * D)); for (N = -1; ++N <= Y; ) E = (c[Math.min(Y, N + 1)][0] - c[Math.max(0, N - 1)][0]) / (6 * (1 + q[N] * q[N])), b.push([E || 0, q[N] * E || 0]); return b; } function mR(c) { return c.length < 3 ? Qa(c) : c[0] + bd(c, pR(c)); } t.svg.line.radial = function() { var c = wx(Sx); return c.radius = c.x, delete c.x, c.angle = c.y, delete c.y, c; }; function Sx(c) { for (var b, A = -1, C = c.length, D, E; ++A < C; ) b = c[A], D = b[0], E = b[1] - se, b[0] = D * Math.cos(E), b[1] = D * Math.sin(E); return c; } function Cx(c) { var b = ks, A = ks, C = 0, D = of, E = xx, q = Qa, N = q.key, Y = q, te = "L", ne = 0.7; function ce(de) { var Te = [], Ae = [], he = [], ye = -1, be = de.length, Se, De = mr(b), we = mr(C), Ze = b === A ? function() { return xt; } : mr(A), mt = C === D ? function() { return yt; } : mr(D), xt, yt; function Lt() { Te.push("M", q(c(he), ne), te, Y(c(Ae.reverse()), ne), "Z"); } for (; ++ye < be; ) E.call(this, Se = de[ye], ye) ? (Ae.push([xt = +De.call(this, Se, ye), yt = +we.call(this, Se, ye)]), he.push([+Ze.call(this, Se, ye), +mt.call(this, Se, ye)])) : Ae.length && (Lt(), Ae = [], he = []); return Ae.length && Lt(), Te.length ? Te.join("") : null; } return ce.x = function(de) { return arguments.length ? (b = A = de, ce) : A; }, ce.x0 = function(de) { return arguments.length ? (b = de, ce) : b; }, ce.x1 = function(de) { return arguments.length ? (A = de, ce) : A; }, ce.y = function(de) { return arguments.length ? (C = D = de, ce) : D; }, ce.y0 = function(de) { return arguments.length ? (C = de, ce) : C; }, ce.y1 = function(de) { return arguments.length ? (D = de, ce) : D; }, ce.defined = function(de) { return arguments.length ? (E = de, ce) : E; }, ce.interpolate = function(de) { return arguments.length ? (typeof de == "function" ? N = q = de : N = (q = ym.get(de) || Qa).key, Y = q.reverse || q, te = q.closed ? "M" : "L", ce) : N; }, ce.tension = function(de) { return arguments.length ? (ne = de, ce) : ne; }, ce; } bm.reverse = _m, _m.reverse = bm, t.svg.area = function() { return Cx(V); }, t.svg.area.radial = function() { var c = Cx(Sx); return c.radius = c.x, delete c.x, c.innerRadius = c.x0, delete c.x0, c.outerRadius = c.x1, delete c.x1, c.angle = c.y, delete c.y, c.startAngle = c.y0, delete c.y0, c.endAngle = c.y1, delete c.y1, c; }; function Lx(c) { return c.source; } function Dx(c) { return c.target; } t.svg.chord = function() { var c = Lx, b = Dx, A = gR, C = bx, D = _x; function E(ne, ce) { var de = q(this, c, ne, ce), Te = q(this, b, ne, ce); return "M" + de.p0 + Y(de.r, de.p1, de.a1 - de.a0) + (N(de, Te) ? te(de.r, de.p1, de.r, de.p0) : te(de.r, de.p1, Te.r, Te.p0) + Y(Te.r, Te.p1, Te.a1 - Te.a0) + te(Te.r, Te.p1, de.r, de.p0)) + "Z"; } function q(ne, ce, de, Te) { var Ae = ce.call(ne, de, Te), he = A.call(ne, Ae, Te), ye = C.call(ne, Ae, Te) - se, be = D.call(ne, Ae, Te) - se; return { r: he, a0: ye, a1: be, p0: [he * Math.cos(ye), he * Math.sin(ye)], p1: [he * Math.cos(be), he * Math.sin(be)] }; } function N(ne, ce) { return ne.a0 == ce.a0 && ne.a1 == ce.a1; } function Y(ne, ce, de) { return "A" + ne + "," + ne + " 0 " + +(de > rt) + ",1 " + ce; } function te(ne, ce, de, Te) { return "Q 0,0 " + Te; } return E.radius = function(ne) { return arguments.length ? (A = mr(ne), E) : A; }, E.source = function(ne) { return arguments.length ? (c = mr(ne), E) : c; }, E.target = function(ne) { return arguments.length ? (b = mr(ne), E) : b; }, E.startAngle = function(ne) { return arguments.length ? (C = mr(ne), E) : C; }, E.endAngle = function(ne) { return arguments.length ? (D = mr(ne), E) : D; }, E; }; function gR(c) { return c.radius; } t.svg.diagonal = function() { var c = Lx, b = Dx, A = Ex; function C(D, E) { var q = c.call(this, D, E), N = b.call(this, D, E), Y = (q.y + N.y) / 2, te = [q, { x: q.x, y: Y }, { x: N.x, y: Y }, N]; return te = te.map(A), "M" + te[0] + "C" + te[1] + " " + te[2] + " " + te[3]; } return C.source = function(D) { return arguments.length ? (c = mr(D), C) : c; }, C.target = function(D) { return arguments.length ? (b = mr(D), C) : b; }, C.projection = function(D) { return arguments.length ? (A = D, C) : A; }, C; }; function Ex(c) { return [c.x, c.y]; } t.svg.diagonal.radial = function() { var c = t.svg.diagonal(), b = Ex, A = c.projection; return c.projection = function(C) { return arguments.length ? A(yR(b = C)) : b; }, c; }; function yR(c) { return function() { var b = c.apply(this, arguments), A = b[0], C = b[1] - se; return [A * Math.cos(C), A * Math.sin(C)]; }; } t.svg.symbol = function() { var c = _R, b = bR; function A(C, D) { return (Rx.get(c.call(this, C, D)) || Fx)(b.call(this, C, D)); } return A.type = function(C) { return arguments.length ? (c = mr(C), A) : c; }, A.size = function(C) { return arguments.length ? (b = mr(C), A) : b; }, A; }; function bR() { return 64; } function _R() { return "circle"; } function Fx(c) { var b = Math.sqrt(c / rt); return "M0," + b + "A" + b + "," + b + " 0 1,1 0," + -b + "A" + b + "," + b + " 0 1,1 0," + b + "Z"; } var Rx = t.map({ circle: Fx, cross: function(c) { var b = Math.sqrt(c / 5) / 2; return "M" + -3 * b + "," + -b + "H" + -b + "V" + -3 * b + "H" + b + "V" + -b + "H" + 3 * b + "V" + b + "H" + b + "V" + 3 * b + "H" + -b + "V" + b + "H" + -3 * b + "Z"; }, diamond: function(c) { var b = Math.sqrt(c / (2 * Px)), A = b * Px; return "M0," + -b + "L" + A + ",0 0," + b + " " + -A + ",0Z"; }, square: function(c) { var b = Math.sqrt(c) / 2; return "M" + -b + "," + -b + "L" + b + "," + -b + " " + b + "," + b + " " + -b + "," + b + "Z"; }, "triangle-down": function(c) { var b = Math.sqrt(c / _d), A = b * _d / 2; return "M0," + A + "L" + b + "," + -A + " " + -b + "," + -A + "Z"; }, "triangle-up": function(c) { var b = Math.sqrt(c / _d), A = b * _d / 2; return "M0," + -A + "L" + b + "," + A + " " + -b + "," + A + "Z"; } }); t.svg.symbolTypes = Rx.keys(); var _d = Math.sqrt(3), Px = Math.tan(30 * ie); J.transition = function(c) { for (var b = Al || ++zx, A = Am(c), C = [], D, E, q = wd || { time: Date.now(), ease: Q8, delay: 0, duration: 250 }, N = -1, Y = this.length; ++N < Y; ) { C.push(D = []); for (var te = this[N], ne = -1, ce = te.length; ++ne < ce; ) (E = te[ne]) && Td(E, ne, A, b, q), D.push(E); } return vf(C, A, b); }, J.interrupt = function(c) { return this.each(c == null ? xd : $x(Am(c))); }; var xd = $x(Am()); function $x(c) { return function() { var b, A, C; (b = this[c]) && (C = b[A = b.active]) && (C.timer.c = null, C.timer.t = NaN, --b.count ? delete b[A] : delete this[c], b.active += 0.5, C.event && C.event.interrupt.call(this, this.__data__, C.index)); }; } function vf(c, b, A) { return ue(c, sn), c.namespace = b, c.id = A, c; } var sn = [], zx = 0, Al, wd; sn.call = J.call, sn.empty = J.empty, sn.node = J.node, sn.size = J.size, t.transition = function(c, b) { return c && c.transition ? Al ? c.transition(b) : c : t.selection().transition(c); }, t.transition.prototype = sn, sn.select = function(c) { var b = this.id, A = this.namespace, C = [], D, E, q; c = pe(c); for (var N = -1, Y = this.length; ++N < Y; ) { C.push(D = []); for (var te = this[N], ne = -1, ce = te.length; ++ne < ce; ) (q = te[ne]) && (E = c.call(q, q.__data__, ne, N)) ? ("__data__" in q && (E.__data__ = q.__data__), Td(E, ne, A, b, q[A][b]), D.push(E)) : D.push(null); } return vf(C, A, b); }, sn.selectAll = function(c) { var b = this.id, A = this.namespace, C = [], D, E, q, N, Y; c = ge(c); for (var te = -1, ne = this.length; ++te < ne; ) for (var ce = this[te], de = -1, Te = ce.length; ++de < Te; ) if (q = ce[de]) { Y = q[A][b], E = c.call(q, q.__data__, de, te), C.push(D = []); for (var Ae = -1, he = E.length; ++Ae < he; ) (N = E[Ae]) && Td(N, Ae, A, b, Y), D.push(N); } return vf(C, A, b); }, sn.filter = function(c) { var b = [], A, C, D; typeof c != "function" && (c = ht(c)); for (var E = 0, q = this.length; E < q; E++) { b.push(A = []); for (var C = this[E], N = 0, Y = C.length; N < Y; N++) (D = C[N]) && c.call(D, D.__data__, N, E) && A.push(D); } return vf(b, this.namespace, this.id); }, sn.tween = function(c, b) { var A = this.id, C = this.namespace; return arguments.length < 2 ? this.node()[C][A].tween.get(c) : nt(this, b == null ? function(D) { D[C][A].tween.remove(c); } : function(D) { D[C][A].tween.set(c, b); }); }; function km(c, b, A, C) { var D = c.id, E = c.namespace; return nt(c, typeof A == "function" ? function(q, N, Y) { q[E][D].tween.set(b, C(A.call(q, q.__data__, N, Y))); } : (A = C(A), function(q) { q[E][D].tween.set(b, A); })); } sn.attr = function(c, b) { if (arguments.length < 2) { for (b in c) this.attr(b, c[b]); return this; } var A = c == "transform" ? Z_ : kl, C = t.ns.qualify(c); function D() { this.removeAttribute(C); } function E() { this.removeAttributeNS(C.space, C.local); } function q(Y) { return Y == null ? D : (Y += "", function() { var te = this.getAttribute(C), ne; return te !== Y && (ne = A(te, Y), function(ce) { this.setAttribute(C, ne(ce)); }); }); } function N(Y) { return Y == null ? E : (Y += "", function() { var te = this.getAttributeNS(C.space, C.local), ne; return te !== Y && (ne = A(te, Y), function(ce) { this.setAttributeNS(C.space, C.local, ne(ce)); }); }); } return km(this, "attr." + c, b, C.local ? N : q); }, sn.attrTween = function(c, b) { var A = t.ns.qualify(c); function C(E, q) { var N = b.call(this, E, q, this.getAttribute(A)); return N && function(Y) { this.setAttribute(A, N(Y)); }; } function D(E, q) { var N = b.call(this, E, q, this.getAttributeNS(A.space, A.local)); return N && function(Y) { this.setAttributeNS(A.space, A.local, N(Y)); }; } return this.tween("attr." + c, A.local ? D : C); }, sn.style = function(c, b, A) { var C = arguments.length; if (C < 3) { if (typeof c != "string") { C < 2 && (b = ""); for (A in c) this.style(A, c[A], b); return this; } A = ""; } function D() { this.style.removeProperty(c); } function E(q) { return q == null ? D : (q += "", function() { var N = o(this).getComputedStyle(this, null).getPropertyValue(c), Y; return N !== q && (Y = kl(N, q), function(te) { this.style.setProperty(c, Y(te), A); }); }); } return km(this, "style." + c, b, E); }, sn.styleTween = function(c, b, A) { arguments.length < 3 && (A = ""); function C(D, E) { var q = b.call(this, D, E, o(this).getComputedStyle(this, null).getPropertyValue(c)); return q && function(N) { this.style.setProperty(c, q(N), A); }; } return this.tween("style." + c, C); }, sn.text = function(c) { return km(this, "text", c, xR); }; function xR(c) { return c == null && (c = ""), function() { this.textContent = c; }; } sn.remove = function() { var c = this.namespace; return this.each("end.transition", function() { var b; this[c].count < 2 && (b = this.parentNode) && b.removeChild(this); }); }, sn.ease = function(c) { var b = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][b].ease : (typeof c != "function" && (c = t.ease.apply(t, arguments)), nt(this, function(C) { C[A][b].ease = c; })); }, sn.delay = function(c) { var b = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][b].delay : nt(this, typeof c == "function" ? function(C, D, E) { C[A][b].delay = +c.call(C, C.__data__, D, E); } : (c = +c, function(C) { C[A][b].delay = c; })); }, sn.duration = function(c) { var b = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][b].duration : nt(this, typeof c == "function" ? function(C, D, E) { C[A][b].duration = Math.max(1, c.call(C, C.__data__, D, E)); } : (c = Math.max(1, c), function(C) { C[A][b].duration = c; })); }, sn.each = function(c, b) { var A = this.id, C = this.namespace; if (arguments.length < 2) { var D = wd, E = Al; try { Al = A, nt(this, function(q, N, Y) { wd = q[C][A], c.call(q, q.__data__, N, Y); }); } finally { wd = D, Al = E; } } else nt(this, function(q) { var N = q[C][A]; (N.event || (N.event = t.dispatch("start", "end", "interrupt"))).on(c, b); }); return this; }, sn.transition = function() { for (var c = this.id, b = ++zx, A = this.namespace, C = [], D, E, q, N, Y = 0, te = this.length; Y < te; Y++) { C.push(D = []); for (var E = this[Y], ne = 0, ce = E.length; ne < ce; ne++) (q = E[ne]) && (N = q[A][c], Td(q, ne, A, b, { time: N.time, ease: N.ease, delay: N.delay + N.duration, duration: N.duration })), D.push(q); } return vf(C, A, b); }; function Am(c) { return c == null ? "__transition__" : "__transition_" + c + "__"; } function Td(c, b, A, C, D) { var E = c[A] || (c[A] = { active: 0, count: 0 }), q = E[C], N, Y, te, ne, ce; function de(he) { var ye = q.delay; if (Y.t = ye + N, ye <= he) return Te(he - ye); Y.c = Te; } function Te(he) { var ye = E.active, be = E[ye]; be && (be.timer.c = null, be.timer.t = NaN, --E.count, delete E[ye], be.event && be.event.interrupt.call(c, c.__data__, be.index)); for (var Se in E) if (+Se < C) { var De = E[Se]; De.timer.c = null, De.timer.t = NaN, --E.count, delete E[Se]; } Y.c = Ae, ha(function() { return Y.c && Ae(he || 1) && (Y.c = null, Y.t = NaN), 1; }, 0, N), E.active = C, q.event && q.event.start.call(c, c.__data__, b), ce = [], q.tween.forEach(function(we, Ze) { (Ze = Ze.call(c, c.__data__, b)) && ce.push(Ze); }), ne = q.ease, te = q.duration; } function Ae(he) { for (var ye = he / te, be = ne(ye), Se = ce.length; Se > 0; ) ce[--Se].call(c, be); if (ye >= 1) return q.event && q.event.end.call(c, c.__data__, b), --E.count ? delete E[C] : delete c[A], 1; } q || (N = D.time, Y = ha(de, 0, N), q = E[C] = { tween: new _(), time: N, timer: Y, delay: D.delay, duration: D.duration, ease: D.ease, index: b }, D = null, ++E.count); } t.svg.axis = function() { var c = t.scale.linear(), b = Ix, A = 6, C = 6, D = 3, E = [10], q = null, N; function Y(te) { te.each(function() { var ne = t.select(this), ce = this.__chart__ || c, de = this.__chart__ = c.copy(), Te = q ?? (de.ticks ? de.ticks.apply(de, E) : de.domain()), Ae = N ?? (de.tickFormat ? de.tickFormat.apply(de, E) : V), he = ne.selectAll(".tick").data(Te, de), ye = he.enter().insert("g", ".domain").attr("class", "tick").style("opacity", Ke), be = t.transition(he.exit()).style("opacity", Ke).remove(), Se = t.transition(he.order()).style("opacity", 1), De = Math.max(A, 0) + D, we, Ze = vd(de), mt = ne.selectAll(".domain").data([0]), xt = (mt.enter().append("path").attr("class", "domain"), t.transition(mt)); ye.append("line"), ye.append("text"); var yt = ye.select("line"), Lt = Se.select("line"), Dt = he.select("text").text(Ae), Wt = ye.select("text"), Ft = Se.select("text"), Gt = b === "top" || b === "left" ? -1 : 1, gr, Yr, xr, dt; if (b === "bottom" || b === "top" ? (we = TR, gr = "x", xr = "y", Yr = "x2", dt = "y2", Dt.attr("dy", Gt < 0 ? "0em" : ".71em").style("text-anchor", "middle"), xt.attr("d", "M" + Ze[0] + "," + Gt * C + "V0H" + Ze[1] + "V" + Gt * C)) : (we = kR, gr = "y", xr = "x", Yr = "y2", dt = "x2", Dt.attr("dy", ".32em").style("text-anchor", Gt < 0 ? "end" : "start"), xt.attr("d", "M" + Gt * C + "," + Ze[0] + "H0V" + Ze[1] + "H" + Gt * C)), yt.attr(dt, Gt * A), Wt.attr(xr, Gt * De), Lt.attr(Yr, 0).attr(dt, Gt * A), Ft.attr(gr, 0).attr(xr, Gt * De), de.rangeBand) { var Zt = de, Jt = Zt.rangeBand() / 2; ce = de = function(yr) { return Zt(yr) + Jt; }; } else ce.rangeBand ? ce = de : be.call(we, de, ce); ye.call(we, ce, de), Se.call(we, de, de); }); } return Y.scale = function(te) { return arguments.length ? (c = te, Y) : c; }, Y.orient = function(te) { return arguments.length ? (b = te in wR ? te + "" : Ix, Y) : b; }, Y.ticks = function() { return arguments.length ? (E = n(arguments), Y) : E; }, Y.tickValues = function(te) { return arguments.length ? (q = te, Y) : q; }, Y.tickFormat = function(te) { return arguments.length ? (N = te, Y) : N; }, Y.tickSize = function(te) { var ne = arguments.length; return ne ? (A = +te, C = +arguments[ne - 1], Y) : A; }, Y.innerTickSize = function(te) { return arguments.length ? (A = +te, Y) : A; }, Y.outerTickSize = function(te) { return arguments.length ? (C = +te, Y) : C; }, Y.tickPadding = function(te) { return arguments.length ? (D = +te, Y) : D; }, Y.tickSubdivide = function() { return arguments.length && Y; }, Y; }; var Ix = "bottom", wR = { top: 1, right: 1, bottom: 1, left: 1 }; function TR(c, b, A) { c.attr("transform", function(C) { var D = b(C); return "translate(" + (isFinite(D) ? D : A(C)) + ",0)"; }); } function kR(c, b, A) { c.attr("transform", function(C) { var D = b(C); return "translate(0," + (isFinite(D) ? D : A(C)) + ")"; }); } t.svg.brush = function() { var c = ae(ne, "brushstart", "brush", "brushend"), b = null, A = null, C = [0, 0], D = [0, 0], E, q, N = true, Y = true, te = Mm[0]; function ne(he) { he.each(function() { var ye = t.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", Ae).on("touchstart.brush", Ae), be = ye.selectAll(".background").data([0]); be.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), ye.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move"); var Se = ye.selectAll(".resize").data(te, V); Se.exit().remove(), Se.enter().append("g").attr("class", function(mt) { return "resize " + mt; }).style("cursor", function(mt) { return AR[mt]; }).append("rect").attr("x", function(mt) { return /[ew]$/.test(mt) ? -3 : null; }).attr("y", function(mt) { return /^[ns]/.test(mt) ? -3 : null; }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), Se.style("display", ne.empty() ? "none" : null); var De = t.transition(ye), we = t.transition(be), Ze; b && (Ze = vd(b), we.attr("x", Ze[0]).attr("width", Ze[1] - Ze[0]), de(De)), A && (Ze = vd(A), we.attr("y", Ze[0]).attr("height", Ze[1] - Ze[0]), Te(De)), ce(De); }); } ne.event = function(he) { he.each(function() { var ye = c.of(this, arguments), be = { x: C, y: D, i: E, j: q }, Se = this.__chart__ || be; this.__chart__ = be, Al ? t.select(this).transition().each("start.brush", function() { E = Se.i, q = Se.j, C = Se.x, D = Se.y, ye({ type: "brushstart" }); }).tween("brush:brush", function() { var De = dd(C, be.x), we = dd(D, be.y); return E = q = null, function(Ze) { C = be.x = De(Ze), D = be.y = we(Ze), ye({ type: "brush", mode: "resize" }); }; }).each("end.brush", function() { E = be.i, q = be.j, ye({ type: "brush", mode: "resize" }), ye({ type: "brushend" }); }) : (ye({ type: "brushstart" }), ye({ type: "brush", mode: "resize" }), ye({ type: "brushend" })); }); }; function ce(he) { he.selectAll(".resize").attr("transform", function(ye) { return "translate(" + C[+/e$/.test(ye)] + "," + D[+/^s/.test(ye)] + ")"; }); } function de(he) { he.select(".extent").attr("x", C[0]), he.selectAll(".extent,.n>rect,.s>rect").attr("width", C[1] - C[0]); } function Te(he) { he.select(".extent").attr("y", D[0]), he.selectAll(".extent,.e>rect,.w>rect").attr("height", D[1] - D[0]); } function Ae() { var he = this, ye = t.select(t.event.target), be = c.of(he, arguments), Se = t.select(he), De = ye.datum(), we = !/^(n|s)$/.test(De) && b, Ze = !/^(e|w)$/.test(De) && A, mt = ye.classed("extent"), xt = gt(he), yt, Lt = t.mouse(he), Dt, Wt = t.select(o(he)).on("keydown.brush", gr).on("keyup.brush", Yr); if (t.event.changedTouches ? Wt.on("touchmove.brush", xr).on("touchend.brush", Zt) : Wt.on("mousemove.brush", xr).on("mouseup.brush", Zt), Se.interrupt().selectAll("*").interrupt(), mt) Lt[0] = C[0] - Lt[0], Lt[1] = D[0] - Lt[1]; else if (De) { var Ft = +/w$/.test(De), Gt = +/^n/.test(De); Dt = [C[1 - Ft] - Lt[0], D[1 - Gt] - Lt[1]], Lt[0] = C[Ft], Lt[1] = D[Gt]; } else t.event.altKey && (yt = Lt.slice()); Se.style("pointer-events", "none").selectAll(".resize").style("display", null), t.select("body").style("cursor", ye.style("cursor")), be({ type: "brushstart" }), xr(); function gr() { t.event.keyCode == 32 && (mt || (yt = null, Lt[0] -= C[1], Lt[1] -= D[1], mt = 2), ee()); } function Yr() { t.event.keyCode == 32 && mt == 2 && (Lt[0] += C[1], Lt[1] += D[1], mt = 0, ee()); } function xr() { var Jt = t.mouse(he), yr = false; Dt && (Jt[0] += Dt[0], Jt[1] += Dt[1]), mt || (t.event.altKey ? (yt || (yt = [(C[0] + C[1]) / 2, (D[0] + D[1]) / 2]), Lt[0] = C[+(Jt[0] < yt[0])], Lt[1] = D[+(Jt[1] < yt[1])]) : yt = null), we && dt(Jt, b, 0) && (de(Se), yr = true), Ze && dt(Jt, A, 1) && (Te(Se), yr = true), yr && (ce(Se), be({ type: "brush", mode: mt ? "move" : "resize" })); } function dt(Jt, yr, Gr) { var un = vd(yr), kn = un[0], $n = un[1], Un = Lt[Gr], zn = Gr ? D : C, Qn = zn[1] - zn[0], Cn, ea; if (mt && (kn -= Un, $n -= Qn + Un), Cn = (Gr ? Y : N) ? Math.max(kn, Math.min($n, Jt[Gr])) : Jt[Gr], mt ? ea = (Cn += Un) + Qn : (yt && (Un = Math.max(kn, Math.min($n, 2 * yt[Gr] - Cn))), Un < Cn ? (ea = Cn, Cn = Un) : ea = Un), zn[0] != Cn || zn[1] != ea) return Gr ? q = null : E = null, zn[0] = Cn, zn[1] = ea, true; } function Zt() { xr(), Se.style("pointer-events", "all").selectAll(".resize").style("display", ne.empty() ? "none" : null), t.select("body").style("cursor", null), Wt.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), xt(), be({ type: "brushend" }); } } return ne.x = function(he) { return arguments.length ? (b = he, te = Mm[!b << 1 | !A], ne) : b; }, ne.y = function(he) { return arguments.length ? (A = he, te = Mm[!b << 1 | !A], ne) : A; }, ne.clamp = function(he) { return arguments.length ? (b && A ? (N = !!he[0], Y = !!he[1]) : b ? N = !!he : A && (Y = !!he), ne) : b && A ? [N, Y] : b ? N : A ? Y : null; }, ne.extent = function(he) { var ye, be, Se, De, we; return arguments.length ? (b && (ye = he[0], be = he[1], A && (ye = ye[0], be = be[0]), E = [ye, be], b.invert && (ye = b(ye), be = b(be)), be < ye && (we = ye, ye = be, be = we), (ye != C[0] || be != C[1]) && (C = [ye, be])), A && (Se = he[0], De = he[1], b && (Se = Se[1], De = De[1]), q = [Se, De], A.invert && (Se = A(Se), De = A(De)), De < Se && (we = Se, Se = De, De = we), (Se != D[0] || De != D[1]) && (D = [Se, De])), ne) : (b && (E ? (ye = E[0], be = E[1]) : (ye = C[0], be = C[1], b.invert && (ye = b.invert(ye), be = b.invert(be)), be < ye && (we = ye, ye = be, be = we))), A && (q ? (Se = q[0], De = q[1]) : (Se = D[0], De = D[1], A.invert && (Se = A.invert(Se), De = A.invert(De)), De < Se && (we = Se, Se = De, De = we))), b && A ? [[ye, Se], [be, De]] : b ? [ye, be] : A && [Se, De]); }, ne.clear = function() { return ne.empty() || (C = [0, 0], D = [0, 0], E = q = null), ne; }, ne.empty = function() { return !!b && C[0] == C[1] || !!A && D[0] == D[1]; }, t.rebind(ne, c, "on"); }; var AR = { n: "ns-resize", e: "ew-resize", s: "ns-resize", w: "ew-resize", nw: "nwse-resize", ne: "nesw-resize", se: "nwse-resize", sw: "nesw-resize" }, Mm = [["n", "e", "s", "w", "nw", "ne", "se", "sw"], ["e", "w"], ["n", "s"], []]; t.text = Aa(function(c) { return c.responseText; }), t.json = function(c, b) { return Ja(c, "application/json", MR, b); }; function MR(c) { return JSON.parse(c.responseText); } t.html = function(c, b) { return Ja(c, "text/html", SR, b); }; function SR(c) { var b = a.createRange(); return b.selectNode(a.body), b.createContextualFragment(c.responseText); } t.xml = Aa(function(c) { return c.responseXML; }), e10.exports ? e10.exports = t : this.d3 = t; }).apply(self); })(iC); var lr = iC.exports; var Hm = /* @__PURE__ */ new Date(); var Bm = /* @__PURE__ */ new Date(); function wn(e10, t, r, n) { function a(i) { return e10(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i; } return a.floor = function(i) { return e10(i = /* @__PURE__ */ new Date(+i)), i; }, a.ceil = function(i) { return e10(i = new Date(i - 1)), t(i, 1), e10(i), i; }, a.round = function(i) { var o = a(i), l = a.ceil(i); return i - o < l - i ? o : l; }, a.offset = function(i, o) { return t(i = /* @__PURE__ */ new Date(+i), o == null ? 1 : Math.floor(o)), i; }, a.range = function(i, o, l) { var s = [], u; if (i = a.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < o) || !(l > 0)) return s; do s.push(u = /* @__PURE__ */ new Date(+i)), t(i, l), e10(i); while (u < i && i < o); return s; }, a.filter = function(i) { return wn(function(o) { if (o >= o) for (; e10(o), !i(o); ) o.setTime(o - 1); }, function(o, l) { if (o >= o) if (l < 0) for (; ++l <= 0; ) for (; t(o, -1), !i(o); ) ; else for (; --l >= 0; ) for (; t(o, 1), !i(o); ) ; }); }, r && (a.count = function(i, o) { return Hm.setTime(+i), Bm.setTime(+o), e10(Hm), e10(Bm), Math.floor(r(Hm, Bm)); }, a.every = function(i) { return i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? a.filter(n ? function(o) { return n(o) % i === 0; } : function(o) { return a.count(0, o) % i === 0; }) : a; }), a; } var gc = wn(function() { }, function(e10, t) { e10.setTime(+e10 + t); }, function(e10, t) { return t - e10; }); gc.every = function(e10) { return e10 = Math.floor(e10), !isFinite(e10) || !(e10 > 0) ? null : e10 > 1 ? wn(function(t) { t.setTime(Math.floor(t / e10) * e10); }, function(t, r) { t.setTime(+t + r * e10); }, function(t, r) { return (r - t) / e10; }) : gc; }; var Jw = gc.range; var nv = 1e3; var as = 6e4; var av = 36e5; var oC = 864e5; var lC = 6048e5; var ay = wn(function(e10) { e10.setTime(e10 - e10.getMilliseconds()); }, function(e10, t) { e10.setTime(+e10 + t * nv); }, function(e10, t) { return (t - e10) / nv; }, function(e10) { return e10.getUTCSeconds(); }); var Qw = ay.range; var sC = wn(function(e10) { e10.setTime(e10 - e10.getMilliseconds() - e10.getSeconds() * nv); }, function(e10, t) { e10.setTime(+e10 + t * as); }, function(e10, t) { return (t - e10) / as; }, function(e10) { return e10.getMinutes(); }); var TB = sC.range; var uC = wn(function(e10) { e10.setTime(e10 - e10.getMilliseconds() - e10.getSeconds() * nv - e10.getMinutes() * as); }, function(e10, t) { e10.setTime(+e10 + t * av); }, function(e10, t) { return (t - e10) / av; }, function(e10) { return e10.getHours(); }); var kB = uC.range; var ip = wn(function(e10) { e10.setHours(0, 0, 0, 0); }, function(e10, t) { e10.setDate(e10.getDate() + t); }, function(e10, t) { return (t - e10 - (t.getTimezoneOffset() - e10.getTimezoneOffset()) * as) / oC; }, function(e10) { return e10.getDate() - 1; }); var AB = ip.range; function vs(e10) { return wn(function(t) { t.setDate(t.getDate() - (t.getDay() + 7 - e10) % 7), t.setHours(0, 0, 0, 0); }, function(t, r) { t.setDate(t.getDate() + r * 7); }, function(t, r) { return (r - t - (r.getTimezoneOffset() - t.getTimezoneOffset()) * as) / lC; }); } var iv = vs(0); var yc = vs(1); var fC = vs(2); var cC = vs(3); var is = vs(4); var dC = vs(5); var hC = vs(6); var e2 = iv.range; var MB = yc.range; var SB = fC.range; var CB = cC.range; var LB = is.range; var DB = dC.range; var EB = hC.range; var vC = wn(function(e10) { e10.setDate(1), e10.setHours(0, 0, 0, 0); }, function(e10, t) { e10.setMonth(e10.getMonth() + t); }, function(e10, t) { return t.getMonth() - e10.getMonth() + (t.getFullYear() - e10.getFullYear()) * 12; }, function(e10) { return e10.getMonth(); }); var FB = vC.range; var sl = wn(function(e10) { e10.setMonth(0, 1), e10.setHours(0, 0, 0, 0); }, function(e10, t) { e10.setFullYear(e10.getFullYear() + t); }, function(e10, t) { return t.getFullYear() - e10.getFullYear(); }, function(e10) { return e10.getFullYear(); }); sl.every = function(e10) { return !isFinite(e10 = Math.floor(e10)) || !(e10 > 0) ? null : wn(function(t) { t.setFullYear(Math.floor(t.getFullYear() / e10) * e10), t.setMonth(0, 1), t.setHours(0, 0, 0, 0); }, function(t, r) { t.setFullYear(t.getFullYear() + r * e10); }); }; var RB = sl.range; var pC = wn(function(e10) { e10.setUTCSeconds(0, 0); }, function(e10, t) { e10.setTime(+e10 + t * as); }, function(e10, t) { return (t - e10) / as; }, function(e10) { return e10.getUTCMinutes(); }); var PB = pC.range; var mC = wn(function(e10) { e10.setUTCMinutes(0, 0, 0); }, function(e10, t) { e10.setTime(+e10 + t * av); }, function(e10, t) { return (t - e10) / av; }, function(e10) { return e10.getUTCHours(); }); var $B = mC.range; var op = wn(function(e10) { e10.setUTCHours(0, 0, 0, 0); }, function(e10, t) { e10.setUTCDate(e10.getUTCDate() + t); }, function(e10, t) { return (t - e10) / oC; }, function(e10) { return e10.getUTCDate() - 1; }); var zB = op.range; function ps(e10) { return wn(function(t) { t.setUTCDate(t.getUTCDate() - (t.getUTCDay() + 7 - e10) % 7), t.setUTCHours(0, 0, 0, 0); }, function(t, r) { t.setUTCDate(t.getUTCDate() + r * 7); }, function(t, r) { return (r - t) / lC; }); } var ov = ps(0); var bc = ps(1); var gC = ps(2); var yC = ps(3); var os = ps(4); var bC = ps(5); var _C = ps(6); var t2 = ov.range; var IB = bc.range; var NB = gC.range; var OB = yC.range; var HB = os.range; var BB = bC.range; var jB = _C.range; var xC = wn(function(e10) { e10.setUTCDate(1), e10.setUTCHours(0, 0, 0, 0); }, function(e10, t) { e10.setUTCMonth(e10.getUTCMonth() + t); }, function(e10, t) { return t.getUTCMonth() - e10.getUTCMonth() + (t.getUTCFullYear() - e10.getUTCFullYear()) * 12; }, function(e10) { return e10.getUTCMonth(); }); var UB = xC.range; var ul = wn(function(e10) { e10.setUTCMonth(0, 1), e10.setUTCHours(0, 0, 0, 0); }, function(e10, t) { e10.setUTCFullYear(e10.getUTCFullYear() + t); }, function(e10, t) { return t.getUTCFullYear() - e10.getUTCFullYear(); }, function(e10) { return e10.getUTCFullYear(); }); ul.every = function(e10) { return !isFinite(e10 = Math.floor(e10)) || !(e10 > 0) ? null : wn(function(t) { t.setUTCFullYear(Math.floor(t.getUTCFullYear() / e10) * e10), t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0); }, function(t, r) { t.setUTCFullYear(t.getUTCFullYear() + r * e10); }); }; var GB = ul.range; var VB = Object.freeze(Object.defineProperty({ __proto__: null, timeDay: ip, timeDays: AB, timeFriday: dC, timeFridays: DB, timeHour: uC, timeHours: kB, timeInterval: wn, timeMillisecond: gc, timeMilliseconds: Jw, timeMinute: sC, timeMinutes: TB, timeMonday: yc, timeMondays: MB, timeMonth: vC, timeMonths: FB, timeSaturday: hC, timeSaturdays: EB, timeSecond: ay, timeSeconds: Qw, timeSunday: iv, timeSundays: e2, timeThursday: is, timeThursdays: LB, timeTuesday: fC, timeTuesdays: SB, timeWednesday: cC, timeWednesdays: CB, timeWeek: iv, timeWeeks: e2, timeYear: sl, timeYears: RB, utcDay: op, utcDays: zB, utcFriday: bC, utcFridays: BB, utcHour: mC, utcHours: $B, utcMillisecond: gc, utcMilliseconds: Jw, utcMinute: pC, utcMinutes: PB, utcMonday: bc, utcMondays: IB, utcMonth: xC, utcMonths: UB, utcSaturday: _C, utcSaturdays: jB, utcSecond: ay, utcSeconds: Qw, utcSunday: ov, utcSundays: t2, utcThursday: os, utcThursdays: HB, utcTuesday: gC, utcTuesdays: NB, utcWednesday: yC, utcWednesdays: OB, utcWeek: ov, utcWeeks: t2, utcYear: ul, utcYears: GB }, Symbol.toStringTag, { value: "Module" })); function jm(e10) { if (0 <= e10.y && e10.y < 100) { var t = new Date(-1, e10.m, e10.d, e10.H, e10.M, e10.S, e10.L); return t.setFullYear(e10.y), t; } return new Date(e10.y, e10.m, e10.d, e10.H, e10.M, e10.S, e10.L); } function Um(e10) { if (0 <= e10.y && e10.y < 100) { var t = new Date(Date.UTC(-1, e10.m, e10.d, e10.H, e10.M, e10.S, e10.L)); return t.setUTCFullYear(e10.y), t; } return new Date(Date.UTC(e10.y, e10.m, e10.d, e10.H, e10.M, e10.S, e10.L)); } function gf(e10, t, r) { return { y: e10, m: t, d: r, H: 0, M: 0, S: 0, L: 0 }; } function wC(e10) { var t = e10.dateTime, r = e10.date, n = e10.time, a = e10.periods, i = e10.days, o = e10.shortDays, l = e10.months, s = e10.shortMonths, u = yf(a), f = bf(a), d = yf(i), h = bf(i), p = yf(o), v = bf(o), m = yf(l), g = bf(l), y = yf(s), w = bf(s), k = { a: z, A: P, b: R, B: H, c: null, d: l2, e: l2, f: vj, g: kj, G: Mj, H: cj, I: dj, j: hj, L: TC, m: pj, M: mj, p: B, q: W, Q: f2, s: c2, S: gj, u: yj, U: bj, V: _j, w: xj, W: wj, x: null, X: null, y: Tj, Y: Aj, Z: Sj, "%": u2 }, x = { a: ee, A: re, b: ae, B: Q, c: null, d: s2, e: s2, f: Ej, g: Bj, G: Uj, H: Cj, I: Lj, j: Dj, L: AC, m: Fj, M: Rj, p: ue, q: j, Q: f2, s: c2, S: Pj, u: $j, U: zj, V: Ij, w: Nj, W: Oj, x: null, X: null, y: Hj, Y: jj, Z: Gj, "%": u2 }, _ = { a: F, A: $, b: I, B: O, c: G, d: i2, e: i2, f: lj, g: a2, G: n2, H: o2, I: o2, j: nj, L: oj, m: rj, M: aj, p: L, q: tj, Q: uj, s: fj, S: ij, u: XB, U: KB, V: JB, w: YB, W: QB, x: K, X: V, y: a2, Y: n2, Z: ej, "%": sj }; k.x = T(r, k), k.X = T(n, k), k.c = T(t, k), x.x = T(r, x), x.X = T(n, x), x.c = T(t, x); function T(U, Z) { return function(le) { var J = [], pe = -1, ge = 0, ve = U.length, me, Le, ze; for (le instanceof Date || (le = /* @__PURE__ */ new Date(+le)); ++pe < ve; ) U.charCodeAt(pe) === 37 && (J.push(U.slice(ge, pe)), (Le = r2[me = U.charAt(++pe)]) != null ? me = U.charAt(++pe) : Le = me === "e" ? " " : "0", (ze = Z[me]) && (me = ze(le, Le)), J.push(me), ge = pe + 1); return J.push(U.slice(ge, pe)), J.join(""); }; } function S(U, Z) { return function(le) { var J = gf(1900, void 0, 1), pe = M(J, U, le += "", 0), ge, ve; if (pe != le.length) return null; if ("Q" in J) return new Date(J.Q); if ("s" in J) return new Date(J.s * 1e3 + ("L" in J ? J.L : 0)); if (Z && !("Z" in J) && (J.Z = 0), "p" in J && (J.H = J.H % 12 + J.p * 12), J.m === void 0 && (J.m = "q" in J ? J.q : 0), "V" in J) { if (J.V < 1 || J.V > 53) return null; "w" in J || (J.w = 1), "Z" in J ? (ge = Um(gf(J.y, 0, 1)), ve = ge.getUTCDay(), ge = ve > 4 || ve === 0 ? bc.ceil(ge) : bc(ge), ge = op.offset(ge, (J.V - 1) * 7), J.y = ge.getUTCFullYear(), J.m = ge.getUTCMonth(), J.d = ge.getUTCDate() + (J.w + 6) % 7) : (ge = jm(gf(J.y, 0, 1)), ve = ge.getDay(), ge = ve > 4 || ve === 0 ? yc.ceil(ge) : yc(ge), ge = ip.offset(ge, (J.V - 1) * 7), J.y = ge.getFullYear(), J.m = ge.getMonth(), J.d = ge.getDate() + (J.w + 6) % 7); } else ("W" in J || "U" in J) && ("w" in J || (J.w = "u" in J ? J.u % 7 : "W" in J ? 1 : 0), ve = "Z" in J ? Um(gf(J.y, 0, 1)).getUTCDay() : jm(gf(J.y, 0, 1)).getDay(), J.m = 0, J.d = "W" in J ? (J.w + 6) % 7 + J.W * 7 - (ve + 5) % 7 : J.w + J.U * 7 - (ve + 6) % 7); return "Z" in J ? (J.H += J.Z / 100 | 0, J.M += J.Z % 100, Um(J)) : jm(J); }; } function M(U, Z, le, J) { for (var pe = 0, ge = Z.length, ve = le.length, me, Le; pe < ge; ) { if (J >= ve) return -1; if (me = Z.charCodeAt(pe++), me === 37) { if (me = Z.charAt(pe++), Le = _[me in r2 ? Z.charAt(pe++) : me], !Le || (J = Le(U, le, J)) < 0) return -1; } else if (me != le.charCodeAt(J++)) return -1; } return J; } function L(U, Z, le) { var J = u.exec(Z.slice(le)); return J ? (U.p = f[J[0].toLowerCase()], le + J[0].length) : -1; } function F(U, Z, le) { var J = p.exec(Z.slice(le)); return J ? (U.w = v[J[0].toLowerCase()], le + J[0].length) : -1; } function $(U, Z, le) { var J = d.exec(Z.slice(le)); return J ? (U.w = h[J[0].toLowerCase()], le + J[0].length) : -1; } function I(U, Z, le) { var J = y.exec(Z.slice(le)); return J ? (U.m = w[J[0].toLowerCase()], le + J[0].length) : -1; } function O(U, Z, le) { var J = m.exec(Z.slice(le)); return J ? (U.m = g[J[0].toLowerCase()], le + J[0].length) : -1; } function G(U, Z, le) { return M(U, t, Z, le); } function K(U, Z, le) { return M(U, r, Z, le); } function V(U, Z, le) { return M(U, n, Z, le); } function z(U) { return o[U.getDay()]; } function P(U) { return i[U.getDay()]; } function R(U) { return s[U.getMonth()]; } function H(U) { return l[U.getMonth()]; } function B(U) { return a[+(U.getHours() >= 12)]; } function W(U) { return 1 + ~~(U.getMonth() / 3); } function ee(U) { return o[U.getUTCDay()]; } function re(U) { return i[U.getUTCDay()]; } function ae(U) { return s[U.getUTCMonth()]; } function Q(U) { return l[U.getUTCMonth()]; } function ue(U) { return a[+(U.getUTCHours() >= 12)]; } function j(U) { return 1 + ~~(U.getUTCMonth() / 3); } return { format: function(U) { var Z = T(U += "", k); return Z.toString = function() { return U; }, Z; }, parse: function(U) { var Z = S(U += "", false); return Z.toString = function() { return U; }, Z; }, utcFormat: function(U) { var Z = T(U += "", x); return Z.toString = function() { return U; }, Z; }, utcParse: function(U) { var Z = S(U += "", true); return Z.toString = function() { return U; }, Z; } }; } var r2 = { "-": "", _: " ", 0: "0" }; var Sn = /^\s*\d+/; var qB = /^%/; var WB = /[\\^$*+?|[\]().{}]/g; function Lr(e10, t, r) { var n = e10 < 0 ? "-" : "", a = (n ? -e10 : e10) + "", i = a.length; return n + (i < r ? new Array(r - i + 1).join(t) + a : a); } function ZB(e10) { return e10.replace(WB, "\\$&"); } function yf(e10) { return new RegExp("^(?:" + e10.map(ZB).join("|") + ")", "i"); } function bf(e10) { for (var t = {}, r = -1, n = e10.length; ++r < n; ) t[e10[r].toLowerCase()] = r; return t; } function YB(e10, t, r) { var n = Sn.exec(t.slice(r, r + 1)); return n ? (e10.w = +n[0], r + n[0].length) : -1; } function XB(e10, t, r) { var n = Sn.exec(t.slice(r, r + 1)); return n ? (e10.u = +n[0], r + n[0].length) : -1; } function KB(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.U = +n[0], r + n[0].length) : -1; } function JB(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.V = +n[0], r + n[0].length) : -1; } function QB(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.W = +n[0], r + n[0].length) : -1; } function n2(e10, t, r) { var n = Sn.exec(t.slice(r, r + 4)); return n ? (e10.y = +n[0], r + n[0].length) : -1; } function a2(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), r + n[0].length) : -1; } function ej(e10, t, r) { var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r, r + 6)); return n ? (e10.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), r + n[0].length) : -1; } function tj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 1)); return n ? (e10.q = n[0] * 3 - 3, r + n[0].length) : -1; } function rj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.m = n[0] - 1, r + n[0].length) : -1; } function i2(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.d = +n[0], r + n[0].length) : -1; } function nj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 3)); return n ? (e10.m = 0, e10.d = +n[0], r + n[0].length) : -1; } function o2(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.H = +n[0], r + n[0].length) : -1; } function aj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.M = +n[0], r + n[0].length) : -1; } function ij(e10, t, r) { var n = Sn.exec(t.slice(r, r + 2)); return n ? (e10.S = +n[0], r + n[0].length) : -1; } function oj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 3)); return n ? (e10.L = +n[0], r + n[0].length) : -1; } function lj(e10, t, r) { var n = Sn.exec(t.slice(r, r + 6)); return n ? (e10.L = Math.floor(n[0] / 1e3), r + n[0].length) : -1; } function sj(e10, t, r) { var n = qB.exec(t.slice(r, r + 1)); return n ? r + n[0].length : -1; } function uj(e10, t, r) { var n = Sn.exec(t.slice(r)); return n ? (e10.Q = +n[0], r + n[0].length) : -1; } function fj(e10, t, r) { var n = Sn.exec(t.slice(r)); return n ? (e10.s = +n[0], r + n[0].length) : -1; } function l2(e10, t) { return Lr(e10.getDate(), t, 2); } function cj(e10, t) { return Lr(e10.getHours(), t, 2); } function dj(e10, t) { return Lr(e10.getHours() % 12 || 12, t, 2); } function hj(e10, t) { return Lr(1 + ip.count(sl(e10), e10), t, 3); } function TC(e10, t) { return Lr(e10.getMilliseconds(), t, 3); } function vj(e10, t) { return TC(e10, t) + "000"; } function pj(e10, t) { return Lr(e10.getMonth() + 1, t, 2); } function mj(e10, t) { return Lr(e10.getMinutes(), t, 2); } function gj(e10, t) { return Lr(e10.getSeconds(), t, 2); } function yj(e10) { var t = e10.getDay(); return t === 0 ? 7 : t; } function bj(e10, t) { return Lr(iv.count(sl(e10) - 1, e10), t, 2); } function kC(e10) { var t = e10.getDay(); return t >= 4 || t === 0 ? is(e10) : is.ceil(e10); } function _j(e10, t) { return e10 = kC(e10), Lr(is.count(sl(e10), e10) + (sl(e10).getDay() === 4), t, 2); } function xj(e10) { return e10.getDay(); } function wj(e10, t) { return Lr(yc.count(sl(e10) - 1, e10), t, 2); } function Tj(e10, t) { return Lr(e10.getFullYear() % 100, t, 2); } function kj(e10, t) { return e10 = kC(e10), Lr(e10.getFullYear() % 100, t, 2); } function Aj(e10, t) { return Lr(e10.getFullYear() % 1e4, t, 4); } function Mj(e10, t) { var r = e10.getDay(); return e10 = r >= 4 || r === 0 ? is(e10) : is.ceil(e10), Lr(e10.getFullYear() % 1e4, t, 4); } function Sj(e10) { var t = e10.getTimezoneOffset(); return (t > 0 ? "-" : (t *= -1, "+")) + Lr(t / 60 | 0, "0", 2) + Lr(t % 60, "0", 2); } function s2(e10, t) { return Lr(e10.getUTCDate(), t, 2); } function Cj(e10, t) { return Lr(e10.getUTCHours(), t, 2); } function Lj(e10, t) { return Lr(e10.getUTCHours() % 12 || 12, t, 2); } function Dj(e10, t) { return Lr(1 + op.count(ul(e10), e10), t, 3); } function AC(e10, t) { return Lr(e10.getUTCMilliseconds(), t, 3); } function Ej(e10, t) { return AC(e10, t) + "000"; } function Fj(e10, t) { return Lr(e10.getUTCMonth() + 1, t, 2); } function Rj(e10, t) { return Lr(e10.getUTCMinutes(), t, 2); } function Pj(e10, t) { return Lr(e10.getUTCSeconds(), t, 2); } function $j(e10) { var t = e10.getUTCDay(); return t === 0 ? 7 : t; } function zj(e10, t) { return Lr(ov.count(ul(e10) - 1, e10), t, 2); } function MC(e10) { var t = e10.getUTCDay(); return t >= 4 || t === 0 ? os(e10) : os.ceil(e10); } function Ij(e10, t) { return e10 = MC(e10), Lr(os.count(ul(e10), e10) + (ul(e10).getUTCDay() === 4), t, 2); } function Nj(e10) { return e10.getUTCDay(); } function Oj(e10, t) { return Lr(bc.count(ul(e10) - 1, e10), t, 2); } function Hj(e10, t) { return Lr(e10.getUTCFullYear() % 100, t, 2); } function Bj(e10, t) { return e10 = MC(e10), Lr(e10.getUTCFullYear() % 100, t, 2); } function jj(e10, t) { return Lr(e10.getUTCFullYear() % 1e4, t, 4); } function Uj(e10, t) { var r = e10.getUTCDay(); return e10 = r >= 4 || r === 0 ? os(e10) : os.ceil(e10), Lr(e10.getUTCFullYear() % 1e4, t, 4); } function Gj() { return "+0000"; } function u2() { return "%"; } function f2(e10) { return +e10; } function c2(e10) { return Math.floor(+e10 / 1e3); } var Rs; var SC; var CC; var I1; var N1; LC({ dateTime: "%x, %X", date: "%-m/%-d/%Y", time: "%-I:%M:%S %p", periods: ["AM", "PM"], days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }); function LC(e10) { return Rs = wC(e10), SC = Rs.format, CC = Rs.parse, I1 = Rs.utcFormat, N1 = Rs.utcParse, Rs; } var DC = "%Y-%m-%dT%H:%M:%S.%LZ"; function Vj(e10) { return e10.toISOString(); } var qj = Date.prototype.toISOString ? Vj : I1(DC); function Wj(e10) { var t = new Date(e10); return isNaN(t) ? null : t; } var Zj = +/* @__PURE__ */ new Date("2000-01-01T00:00:00.000Z") ? Wj : N1(DC); var Yj = Object.freeze(Object.defineProperty({ __proto__: null, isoFormat: qj, isoParse: Zj, get timeFormat() { return SC; }, timeFormatDefaultLocale: LC, timeFormatLocale: wC, get timeParse() { return CC; }, get utcFormat() { return I1; }, get utcParse() { return N1; } }, Symbol.toStringTag, { value: "Module" })); var _c = tp(Yj); function Xj(e10) { return Math.abs(e10 = Math.round(e10)) >= 1e21 ? e10.toLocaleString("en").replace(/,/g, "") : e10.toString(10); } function lv(e10, t) { if ((r = (e10 = t ? e10.toExponential(t - 1) : e10.toExponential()).indexOf("e")) < 0) return null; var r, n = e10.slice(0, r); return [ n.length > 1 ? n[0] + n.slice(2) : n, +e10.slice(r + 1) ]; } function Du(e10) { return e10 = lv(Math.abs(e10)), e10 ? e10[1] : NaN; } function Kj(e10, t) { return function(r, n) { for (var a = r.length, i = [], o = 0, l = e10[0], s = 0; a > 0 && l > 0 && (s + l + 1 > n && (l = Math.max(1, n - s)), i.push(r.substring(a -= l, a + l)), !((s += l + 1) > n)); ) l = e10[o = (o + 1) % e10.length]; return i.reverse().join(t); }; } function Jj(e10) { return function(t) { return t.replace(/[0-9]/g, function(r) { return e10[+r]; }); }; } var Qj = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; function sv(e10) { if (!(t = Qj.exec(e10))) throw new Error("invalid format: " + e10); var t; return new lp({ fill: t[1], align: t[2], sign: t[3], symbol: t[4], zero: t[5], width: t[6], comma: t[7], precision: t[8] && t[8].slice(1), trim: t[9], type: t[10] }); } sv.prototype = lp.prototype; function lp(e10) { this.fill = e10.fill === void 0 ? " " : e10.fill + "", this.align = e10.align === void 0 ? ">" : e10.align + "", this.sign = e10.sign === void 0 ? "-" : e10.sign + "", this.symbol = e10.symbol === void 0 ? "" : e10.symbol + "", this.zero = !!e10.zero, this.width = e10.width === void 0 ? void 0 : +e10.width, this.comma = !!e10.comma, this.precision = e10.precision === void 0 ? void 0 : +e10.precision, this.trim = !!e10.trim, this.type = e10.type === void 0 ? "" : e10.type + ""; } lp.prototype.toString = function() { return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; }; function eU(e10) { e: for (var t = e10.length, r = 1, n = -1, a; r < t; ++r) switch (e10[r]) { case ".": n = a = r; break; case "0": n === 0 && (n = r), a = r; break; default: if (!+e10[r]) break e; n > 0 && (n = 0); break; } return n > 0 ? e10.slice(0, n) + e10.slice(a + 1) : e10; } var EC; function tU(e10, t) { var r = lv(e10, t); if (!r) return e10 + ""; var n = r[0], a = r[1], i = a - (EC = Math.max(-8, Math.min(8, Math.floor(a / 3))) * 3) + 1, o = n.length; return i === o ? n : i > o ? n + new Array(i - o + 1).join("0") : i > 0 ? n.slice(0, i) + "." + n.slice(i) : "0." + new Array(1 - i).join("0") + lv(e10, Math.max(0, t + i - 1))[0]; } function d2(e10, t) { var r = lv(e10, t); if (!r) return e10 + ""; var n = r[0], a = r[1]; return a < 0 ? "0." + new Array(-a).join("0") + n : n.length > a + 1 ? n.slice(0, a + 1) + "." + n.slice(a + 1) : n + new Array(a - n.length + 2).join("0"); } var h2 = { "%": function(e10, t) { return (e10 * 100).toFixed(t); }, b: function(e10) { return Math.round(e10).toString(2); }, c: function(e10) { return e10 + ""; }, d: Xj, e: function(e10, t) { return e10.toExponential(t); }, f: function(e10, t) { return e10.toFixed(t); }, g: function(e10, t) { return e10.toPrecision(t); }, o: function(e10) { return Math.round(e10).toString(8); }, p: function(e10, t) { return d2(e10 * 100, t); }, r: d2, s: tU, X: function(e10) { return Math.round(e10).toString(16).toUpperCase(); }, x: function(e10) { return Math.round(e10).toString(16); } }; function v2(e10) { return e10; } var p2 = Array.prototype.map; var m2 = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; function FC(e10) { var t = e10.grouping === void 0 || e10.thousands === void 0 ? v2 : Kj(p2.call(e10.grouping, Number), e10.thousands + ""), r = e10.currency === void 0 ? "" : e10.currency[0] + "", n = e10.currency === void 0 ? "" : e10.currency[1] + "", a = e10.decimal === void 0 ? "." : e10.decimal + "", i = e10.numerals === void 0 ? v2 : Jj(p2.call(e10.numerals, String)), o = e10.percent === void 0 ? "%" : e10.percent + "", l = e10.minus === void 0 ? "-" : e10.minus + "", s = e10.nan === void 0 ? "NaN" : e10.nan + ""; function u(d) { d = sv(d); var h = d.fill, p = d.align, v = d.sign, m = d.symbol, g = d.zero, y = d.width, w = d.comma, k = d.precision, x = d.trim, _ = d.type; _ === "n" ? (w = true, _ = "g") : h2[_] || (k === void 0 && (k = 12), x = true, _ = "g"), (g || h === "0" && p === "=") && (g = true, h = "0", p = "="); var T = m === "$" ? r : m === "#" && /[boxX]/.test(_) ? "0" + _.toLowerCase() : "", S = m === "$" ? n : /[%p]/.test(_) ? o : "", M = h2[_], L = /[defgprs%]/.test(_); k = k === void 0 ? 6 : /[gprs]/.test(_) ? Math.max(1, Math.min(21, k)) : Math.max(0, Math.min(20, k)); function F($) { var I = T, O = S, G, K, V; if (_ === "c") O = M($) + O, $ = ""; else { $ = +$; var z = $ < 0 || 1 / $ < 0; if ($ = isNaN($) ? s : M(Math.abs($), k), x && ($ = eU($)), z && +$ == 0 && v !== "+" && (z = false), I = (z ? v === "(" ? v : l : v === "-" || v === "(" ? "" : v) + I, O = (_ === "s" ? m2[8 + EC / 3] : "") + O + (z && v === "(" ? ")" : ""), L) { for (G = -1, K = $.length; ++G < K; ) if (V = $.charCodeAt(G), 48 > V || V > 57) { O = (V === 46 ? a + $.slice(G + 1) : $.slice(G)) + O, $ = $.slice(0, G); break; } } } w && !g && ($ = t($, 1 / 0)); var P = I.length + $.length + O.length, R = P < y ? new Array(y - P + 1).join(h) : ""; switch (w && g && ($ = t(R + $, R.length ? y - O.length : 1 / 0), R = ""), p) { case "<": $ = I + $ + O + R; break; case "=": $ = I + R + $ + O; break; case "^": $ = R.slice(0, P = R.length >> 1) + I + $ + O + R.slice(P); break; default: $ = R + I + $ + O; break; } return i($); } return F.toString = function() { return d + ""; }, F; } function f(d, h) { var p = u((d = sv(d), d.type = "f", d)), v = Math.max(-8, Math.min(8, Math.floor(Du(h) / 3))) * 3, m = Math.pow(10, -v), g = m2[8 + v / 3]; return function(y) { return p(m * y) + g; }; } return { format: u, formatPrefix: f }; } var Fd; var RC; var PC; $C({ decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], minus: "-" }); function $C(e10) { return Fd = FC(e10), RC = Fd.format, PC = Fd.formatPrefix, Fd; } function rU(e10) { return Math.max(0, -Du(Math.abs(e10))); } function nU(e10, t) { return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Du(t) / 3))) * 3 - Du(Math.abs(e10))); } function aU(e10, t) { return e10 = Math.abs(e10), t = Math.abs(t) - e10, Math.max(0, Du(t) - Du(e10)) + 1; } var iU = Object.freeze(Object.defineProperty({ __proto__: null, FormatSpecifier: lp, get format() { return RC; }, formatDefaultLocale: $C, formatLocale: FC, get formatPrefix() { return PC; }, formatSpecifier: sv, precisionFixed: rU, precisionPrefix: nU, precisionRound: aU }, Symbol.toStringTag, { value: "Module" })); var zC = tp(iU); var oU = function(e10) { for (var t = e10.length, r, n = 0; n < t; n++) if (r = e10.charCodeAt(n), (r < 9 || r > 13) && r !== 32 && r !== 133 && r !== 160 && r !== 5760 && r !== 6158 && (r < 8192 || r > 8205) && r !== 8232 && r !== 8233 && r !== 8239 && r !== 8287 && r !== 8288 && r !== 12288 && r !== 65279) return false; return true; }; var lU = oU; var sr = function(e10) { var t = typeof e10; if (t === "string") { var r = e10; if (e10 = +e10, e10 === 0 && lU(r)) return false; } else if (t !== "number") return false; return e10 - e10 < 1; }; var Qr = { /** * Standardize all missing data in calcdata to use undefined * never null or NaN. * That way we can use !==undefined, or !== BADNUM, * to test for real data */ BADNUM: void 0, /* * Limit certain operations to well below floating point max value * to avoid glitches: Make sure that even when you multiply it by the * number of pixels on a giant screen it still works */ FP_SAFE: Number.MAX_VALUE * 1e-4, /* * conversion of date units to milliseconds * year and month constants are marked "AVG" * to remind us that not all years and months * have the same length */ ONEMAXYEAR: 316224e5, // 366 * ONEDAY ONEAVGYEAR: 315576e5, // 365.25 days ONEMINYEAR: 31536e6, // 365 * ONEDAY ONEMAXQUARTER: 79488e5, // 92 * ONEDAY ONEAVGQUARTER: 78894e5, // 1/4 of ONEAVGYEAR ONEMINQUARTER: 76896e5, // 89 * ONEDAY ONEMAXMONTH: 26784e5, // 31 * ONEDAY ONEAVGMONTH: 26298e5, // 1/12 of ONEAVGYEAR ONEMINMONTH: 24192e5, // 28 * ONEDAY ONEWEEK: 6048e5, // 7 * ONEDAY ONEDAY: 864e5, // 24 * ONEHOUR ONEHOUR: 36e5, ONEMIN: 6e4, ONESEC: 1e3, /* * For fast conversion btwn world calendars and epoch ms, the Julian Day Number * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD() */ EPOCHJD: 24405875e-1, /* * Are two values nearly equal? Compare to 1PPM */ ALMOST_EQUAL: 1 - 1e-6, /* * If we're asked to clip a non-positive log value, how far off-screen * do we put it? */ LOG_CLIP: 10, /* * not a number, but for displaying numbers: the "minus sign" symbol is * wider than the regular ascii dash "-" */ MINUS_SIGN: "−" }; var an = {}; var su = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var Wf = typeof Uint8Array > "u" ? [] : new Uint8Array(256); for (Rd = 0; Rd < su.length; Rd++) Wf[su.charCodeAt(Rd)] = Rd; var Rd; var sU = function(e10) { var t = new Uint8Array(e10), r, n = t.length, a = ""; for (r = 0; r < n; r += 3) a += su[t[r] >> 2], a += su[(t[r] & 3) << 4 | t[r + 1] >> 4], a += su[(t[r + 1] & 15) << 2 | t[r + 2] >> 6], a += su[t[r + 2] & 63]; return n % 3 === 2 ? a = a.substring(0, a.length - 1) + "=" : n % 3 === 1 && (a = a.substring(0, a.length - 2) + "=="), a; }; var uU = function(e10) { var t = e10.length * 0.75, r = e10.length, n, a = 0, i, o, l, s; e10[e10.length - 1] === "=" && (t--, e10[e10.length - 2] === "=" && t--); var u = new ArrayBuffer(t), f = new Uint8Array(u); for (n = 0; n < r; n += 4) i = Wf[e10.charCodeAt(n)], o = Wf[e10.charCodeAt(n + 1)], l = Wf[e10.charCodeAt(n + 2)], s = Wf[e10.charCodeAt(n + 3)], f[a++] = i << 2 | o >> 4, f[a++] = (o & 15) << 4 | l >> 2, f[a++] = (l & 3) << 6 | s & 63; return u; }; var fU = Object.freeze(Object.defineProperty({ __proto__: null, decode: uU, encode: sU }, Symbol.toStringTag, { value: "Module" })); var IC = tp(fU); var ms = function(t) { return window && window.process && window.process.versions ? Object.prototype.toString.call(t) === "[object Object]" : Object.prototype.toString.call(t) === "[object Object]" && Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty"); }; var cU = IC.decode; var dU = ms; var O1 = Array.isArray; var hU = ArrayBuffer; var vU = DataView; function NC(e10) { return hU.isView(e10) && !(e10 instanceof vU); } an.isTypedArray = NC; function uv(e10) { return O1(e10) || NC(e10); } an.isArrayOrTypedArray = uv; function pU(e10) { return !uv(e10[0]); } an.isArray1D = pU; an.ensureArray = function(e10, t) { return O1(e10) || (e10 = []), e10.length = t, e10; }; var xn = { u1c: typeof Uint8ClampedArray > "u" ? void 0 : Uint8ClampedArray, // not supported in numpy? i1: typeof Int8Array > "u" ? void 0 : Int8Array, u1: typeof Uint8Array > "u" ? void 0 : Uint8Array, i2: typeof Int16Array > "u" ? void 0 : Int16Array, u2: typeof Uint16Array > "u" ? void 0 : Uint16Array, i4: typeof Int32Array > "u" ? void 0 : Int32Array, u4: typeof Uint32Array > "u" ? void 0 : Uint32Array, f4: typeof Float32Array > "u" ? void 0 : Float32Array, f8: typeof Float64Array > "u" ? void 0 : Float64Array /* TODO: potentially add Big Int i8: typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, u8: typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, */ }; xn.uint8c = xn.u1c; xn.uint8 = xn.u1; xn.int8 = xn.i1; xn.uint16 = xn.u2; xn.int16 = xn.i2; xn.uint32 = xn.u4; xn.int32 = xn.i4; xn.float32 = xn.f4; xn.float64 = xn.f8; function H1(e10) { return e10.constructor === ArrayBuffer; } an.isArrayBuffer = H1; an.decodeTypedArraySpec = function(e10) { var t = [], r = mU(e10), n = r.dtype, a = xn[n]; if (!a) throw new Error('Error in dtype: "' + n + '"'); var i = a.BYTES_PER_ELEMENT, o = r.bdata; H1(o) || (o = cU(o)); var l = r.shape === void 0 ? ( // detect 1-d length [o.byteLength / i] ) : ( // convert number to string and split to array ("" + r.shape).split(",") ); l.reverse(); var s = l.length, u, f, d = +l[0], h = i * d, p = 0; if (s === 1) t = new a(o); else if (s === 2) for (u = +l[1], f = 0; f < u; f++) t[f] = new a(o, p, d), p += h; else if (s === 3) { u = +l[1]; for (var v = +l[2], m = 0; m < v; m++) for (t[m] = [], f = 0; f < u; f++) t[m][f] = new a(o, p, d), p += h; } else throw new Error("ndim: " + s + 'is not supported with the shape:"' + r.shape + '"'); return t.bdata = r.bdata, t.dtype = r.dtype, t.shape = l.reverse().join(","), e10._inputArray = t, t; }; an.isTypedArraySpec = function(e10) { return dU(e10) && e10.hasOwnProperty("dtype") && typeof e10.dtype == "string" && e10.hasOwnProperty("bdata") && (typeof e10.bdata == "string" || H1(e10.bdata)) && (e10.shape === void 0 || e10.hasOwnProperty("shape") && (typeof e10.shape == "string" || typeof e10.shape == "number")); }; function mU(e10) { return { bdata: e10.bdata, dtype: e10.dtype, shape: e10.shape }; } an.concat = function() { var e10 = [], t = true, r = 0, n, a, i, o, l, s, u, f; for (i = 0; i < arguments.length; i++) o = arguments[i], s = o.length, s && (a ? e10.push(o) : (a = o, l = s), O1(o) ? n = false : (t = false, r ? n !== o.constructor && (n = false) : n = o.constructor), r += s); if (!r) return []; if (!e10.length) return a; if (t) return a.concat.apply(a, e10); if (n) { for (u = new n(r), u.set(a), i = 0; i < e10.length; i++) o = e10[i], u.set(o, l), l += o.length; return u; } for (u = new Array(r), f = 0; f < a.length; f++) u[f] = a[f]; for (i = 0; i < e10.length; i++) { for (o = e10[i], f = 0; f < o.length; f++) u[l + f] = o[f]; l += f; } return u; }; an.maxRowLength = function(e10) { return OC(e10, Math.max, 0); }; an.minRowLength = function(e10) { return OC(e10, Math.min, 1 / 0); }; function OC(e10, t, r) { if (uv(e10)) if (uv(e10[0])) { for (var n = r, a = 0; a < e10.length; a++) n = t(n, e10[a].length); return n; } else return e10.length; return 0; } var HC = sr; var B1 = an.isArrayOrTypedArray; var j1 = function(t, r) { if (HC(r)) r = String(r); else if (typeof r != "string" || r.substr(r.length - 4) === "[-1]") throw "bad property string"; var n = r.split("."), a, i, o, l; for (l = 0; l < n.length; l++) if (String(n[l]).slice(0, 2) === "__") throw "bad property string"; for (l = 0; l < n.length; ) { if (a = String(n[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/), a) { if (a[1]) n[l] = a[1]; else if (l === 0) n.splice(0, 1); else throw "bad property string"; for (i = a[2].substr(1, a[2].length - 2).split("]["), o = 0; o < i.length; o++) l++, n.splice(l, 0, Number(i[o])); } l++; } return typeof t != "object" ? _U(t, r, n) : { set: jC(t, n, r), get: BC(t, n), astr: r, parts: n, obj: t }; }; function BC(e10, t) { return function() { var r = e10, n, a, i, o, l; for (o = 0; o < t.length - 1; o++) { if (n = t[o], n === -1) { for (a = true, i = [], l = 0; l < r.length; l++) i[l] = BC(r[l], t.slice(o + 1))(), i[l] !== i[0] && (a = false); return a ? i[0] : i; } if (typeof n == "number" && !B1(r) || (r = r[n], typeof r != "object" || r === null)) return; } if (!(typeof r != "object" || r === null) && (i = r[t[o]], i !== null)) return i; }; } var gU = /(^|\.)args\[/; function iy(e10, t) { return e10 === void 0 || e10 === null && !t.match(gU); } function jC(e10, t, r) { return function(n) { var a = e10, i = "", o = iy(n, r), l, s; for (s = 0; s < t.length - 1; s++) { if (l = t[s], typeof l == "number" && !B1(a)) throw "array index but container is not an array"; if (l === -1) { if (o = !bU(a, t.slice(s + 1), n, r), o) break; return; } if (!UC(a, l, t[s + 1], o)) break; if (a = a[l], typeof a != "object" || a === null) throw "container is not an object"; i = yU(i, l); } if (o) { if (s === t.length - 1 && (delete a[t[s]], Array.isArray(a) && +t[s] === a.length - 1)) for (; a.length && a[a.length - 1] === void 0; ) a.pop(); } else a[t[s]] = n; }; } function yU(e10, t) { var r = t; return HC(t) ? r = "[" + t + "]" : e10 && (r = "." + t), e10 + r; } function bU(e10, t, r, n) { var a = B1(r), i = true, o = r, l = n.replace("-1", 0), s = a ? false : iy(r, l), u = t[0], f; for (f = 0; f < e10.length; f++) l = n.replace("-1", f), a && (o = r[f % r.length], s = iy(o, l)), s && (i = false), UC(e10, f, u, s) && jC(e10[f], t, n.replace("-1", f))(o); return i; } function UC(e10, t, r, n) { if (e10[t] === void 0) { if (n) return false; typeof r == "number" ? e10[t] = [] : e10[t] = {}; } return true; } function _U(e10, t, r) { return { set: function() { throw "bad container"; }, get: function() { }, astr: t, parts: r, obj: e10 }; } var Ps = j1; var xU = /^\w*$/; var wU = 0; var g2 = 1; var Pd = 2; var y2 = 3; var Ll = 4; var TU = function(t, r, n, a) { n = n || "name", a = a || "value"; var i, o, l, s = {}; r && r.length ? (l = Ps(t, r), o = l.get()) : o = t, r = r || ""; var u = {}; if (o) for (i = 0; i < o.length; i++) u[o[i][n]] = i; var f = xU.test(a), d = { set: function(h, p) { var v = p === null ? Ll : wU; if (!o) { if (!l || v === Ll) return; o = [], l.set(o); } var m = u[h]; if (m === void 0) { if (v === Ll) return; v = v | y2, m = o.length, u[h] = m; } else p !== (f ? o[m][a] : Ps(o[m], a).get()) && (v = v | Pd); var g = o[m] = o[m] || {}; return g[n] = h, f ? g[a] = p : Ps(g, a).set(p), p !== null && (v = v & ~Ll), s[m] = s[m] | v, d; }, get: function(h) { if (o) { var p = u[h]; if (p !== void 0) return f ? o[p][a] : Ps(o[p], a).get(); } }, rename: function(h, p) { var v = u[h]; return v === void 0 || (s[v] = s[v] | g2, u[p] = v, delete u[h], o[v][n] = p), d; }, remove: function(h) { var p = u[h]; if (p === void 0) return d; var v = o[p]; if (Object.keys(v).length > 2) return s[p] = s[p] | Pd, d.set(h, null); if (f) { for (i = p; i < o.length; i++) s[i] = s[i] | y2; for (i = p; i < o.length; i++) u[o[i][n]]--; o.splice(p, 1), delete u[h]; } else Ps(v, a).set(null), s[p] = s[p] | Pd | Ll; return d; }, constructUpdate: function() { for (var h, p, v = {}, m = Object.keys(s), g = 0; g < m.length; g++) p = m[g], h = r + "[" + p + "]", o[p] ? (s[p] & g2 && (v[h + "." + n] = o[p][n]), s[p] & Pd && (f ? v[h + "." + a] = s[p] & Ll ? null : o[p][a] : v[h + "." + a] = s[p] & Ll ? null : Ps(o[p], a).get())) : v[h] = null; return v; } }; return d; }; var kU = /^(.*)(\.[^\.\[\]]+|\[\d\])$/; var AU = /^[^\.\[\]]+$/; var MU = function(e10, t) { for (; t; ) { var r = e10.match(kU); if (r) e10 = r[1]; else if (e10.match(AU)) e10 = ""; else throw new Error("bad relativeAttr call:" + [e10, t]); if (t.charAt(0) === "^") t = t.slice(1); else break; } return e10 && t.charAt(0) !== "[" ? e10 + "." + t : e10 + t; }; var SU = sr; var U1 = function(t, r) { if (t > 0) return Math.log(t) / Math.LN10; var n = Math.log(Math.min(r[0], r[1])) / Math.LN10; return SU(n) || (n = Math.log(Math.max(r[0], r[1])) / Math.LN10 - 6), n; }; var b2 = an.isArrayOrTypedArray; var _f = ms; var CU = function e(t, r) { for (var n in r) { var a = r[n], i = t[n]; if (i !== a) if (n.charAt(0) === "_" || typeof a == "function") { if (n in t) continue; t[n] = a; } else if (b2(a) && b2(i) && _f(a[0])) { if (n === "customdata" || n === "ids") continue; for (var o = Math.min(a.length, i.length), l = 0; l < o; l++) i[l] !== a[l] && _f(a[l]) && _f(i[l]) && e(i[l], a[l]); } else _f(a) && _f(i) && (e(i, a), Object.keys(i).length || delete t[n]); } }; function LU(e10, t) { var r = e10 % t; return r < 0 ? r + t : r; } function DU(e10, t) { return Math.abs(e10) > t / 2 ? e10 - Math.round(e10 / t) * t : e10; } var Wc = { mod: LU, modHalf: DU }; var GC = {}; var VC = { exports: {} }; (function(e10, t) { (function(r, n) { e10.exports = n(); })(Wl, function() { function r(j) { "@babel/helpers - typeof"; return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(U) { return typeof U; } : function(U) { return U && typeof Symbol == "function" && U.constructor === Symbol && U !== Symbol.prototype ? "symbol" : typeof U; }, r(j); } var n = /^\s+/, a = /\s+$/; function i(j, U) { if (j = j || "", U = U || {}, j instanceof i) return j; if (!(this instanceof i)) return new i(j, U); var Z = o(j); this._originalInput = j, this._r = Z.r, this._g = Z.g, this._b = Z.b, this._a = Z.a, this._roundA = Math.round(100 * this._a) / 100, this._format = U.format || Z.format, this._gradientType = U.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = Z.ok; } i.prototype = { isDark: function() { return this.getBrightness() < 128; }, isLight: function() { return !this.isDark(); }, isValid: function() { return this._ok; }, getOriginalInput: function() { return this._originalInput; }, getFormat: function() { return this._format; }, getAlpha: function() { return this._a; }, getBrightness: function() { var U = this.toRgb(); return (U.r * 299 + U.g * 587 + U.b * 114) / 1e3; }, getLuminance: function() { var U = this.toRgb(), Z, le, J, pe, ge, ve; return Z = U.r / 255, le = U.g / 255, J = U.b / 255, Z <= 0.03928 ? pe = Z / 12.92 : pe = Math.pow((Z + 0.055) / 1.055, 2.4), le <= 0.03928 ? ge = le / 12.92 : ge = Math.pow((le + 0.055) / 1.055, 2.4), J <= 0.03928 ? ve = J / 12.92 : ve = Math.pow((J + 0.055) / 1.055, 2.4), 0.2126 * pe + 0.7152 * ge + 0.0722 * ve; }, setAlpha: function(U) { return this._a = G(U), this._roundA = Math.round(100 * this._a) / 100, this; }, toHsv: function() { var U = f(this._r, this._g, this._b); return { h: U.h * 360, s: U.s, v: U.v, a: this._a }; }, toHsvString: function() { var U = f(this._r, this._g, this._b), Z = Math.round(U.h * 360), le = Math.round(U.s * 100), J = Math.round(U.v * 100); return this._a == 1 ? "hsv(" + Z + ", " + le + "%, " + J + "%)" : "hsva(" + Z + ", " + le + "%, " + J + "%, " + this._roundA + ")"; }, toHsl: function() { var U = s(this._r, this._g, this._b); return { h: U.h * 360, s: U.s, l: U.l, a: this._a }; }, toHslString: function() { var U = s(this._r, this._g, this._b), Z = Math.round(U.h * 360), le = Math.round(U.s * 100), J = Math.round(U.l * 100); return this._a == 1 ? "hsl(" + Z + ", " + le + "%, " + J + "%)" : "hsla(" + Z + ", " + le + "%, " + J + "%, " + this._roundA + ")"; }, toHex: function(U) { return h(this._r, this._g, this._b, U); }, toHexString: function(U) { return "#" + this.toHex(U); }, toHex8: function(U) { return p(this._r, this._g, this._b, this._a, U); }, toHex8String: function(U) { return "#" + this.toHex8(U); }, toRgb: function() { return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a }; }, toRgbString: function() { return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: Math.round(K(this._r, 255) * 100) + "%", g: Math.round(K(this._g, 255) * 100) + "%", b: Math.round(K(this._b, 255) * 100) + "%", a: this._a }; }, toPercentageRgbString: function() { return this._a == 1 ? "rgb(" + Math.round(K(this._r, 255) * 100) + "%, " + Math.round(K(this._g, 255) * 100) + "%, " + Math.round(K(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(K(this._r, 255) * 100) + "%, " + Math.round(K(this._g, 255) * 100) + "%, " + Math.round(K(this._b, 255) * 100) + "%, " + this._roundA + ")"; }, toName: function() { return this._a === 0 ? "transparent" : this._a < 1 ? false : I[h(this._r, this._g, this._b, true)] || false; }, toFilter: function(U) { var Z = "#" + v(this._r, this._g, this._b, this._a), le = Z, J = this._gradientType ? "GradientType = 1, " : ""; if (U) { var pe = i(U); le = "#" + v(pe._r, pe._g, pe._b, pe._a); } return "progid:DXImageTransform.Microsoft.gradient(" + J + "startColorstr=" + Z + ",endColorstr=" + le + ")"; }, toString: function(U) { var Z = !!U; U = U || this._format; var le = false, J = this._a < 1 && this._a >= 0, pe = !Z && J && (U === "hex" || U === "hex6" || U === "hex3" || U === "hex4" || U === "hex8" || U === "name"); return pe ? U === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (U === "rgb" && (le = this.toRgbString()), U === "prgb" && (le = this.toPercentageRgbString()), (U === "hex" || U === "hex6") && (le = this.toHexString()), U === "hex3" && (le = this.toHexString(true)), U === "hex4" && (le = this.toHex8String(true)), U === "hex8" && (le = this.toHex8String()), U === "name" && (le = this.toName()), U === "hsl" && (le = this.toHslString()), U === "hsv" && (le = this.toHsvString()), le || this.toHexString()); }, clone: function() { return i(this.toString()); }, _applyModification: function(U, Z) { var le = U.apply(null, [this].concat([].slice.call(Z))); return this._r = le._r, this._g = le._g, this._b = le._b, this.setAlpha(le._a), this; }, lighten: function() { return this._applyModification(w, arguments); }, brighten: function() { return this._applyModification(k, arguments); }, darken: function() { return this._applyModification(x, arguments); }, desaturate: function() { return this._applyModification(m, arguments); }, saturate: function() { return this._applyModification(g, arguments); }, greyscale: function() { return this._applyModification(y, arguments); }, spin: function() { return this._applyModification(_, arguments); }, _applyCombination: function(U, Z) { return U.apply(null, [this].concat([].slice.call(Z))); }, analogous: function() { return this._applyCombination(L, arguments); }, complement: function() { return this._applyCombination(T, arguments); }, monochromatic: function() { return this._applyCombination(F, arguments); }, splitcomplement: function() { return this._applyCombination(M, arguments); }, // Disabled until https://github.com/bgrins/TinyColor/issues/254 // polyad: function (number) { // return this._applyCombination(polyad, [number]); // }, triad: function() { return this._applyCombination(S, [3]); }, tetrad: function() { return this._applyCombination(S, [4]); } }, i.fromRatio = function(j, U) { if (r(j) == "object") { var Z = {}; for (var le in j) j.hasOwnProperty(le) && (le === "a" ? Z[le] = j[le] : Z[le] = B(j[le])); j = Z; } return i(j, U); }; function o(j) { var U = { r: 0, g: 0, b: 0 }, Z = 1, le = null, J = null, pe = null, ge = false, ve = false; return typeof j == "string" && (j = Q(j)), r(j) == "object" && (ae(j.r) && ae(j.g) && ae(j.b) ? (U = l(j.r, j.g, j.b), ge = true, ve = String(j.r).substr(-1) === "%" ? "prgb" : "rgb") : ae(j.h) && ae(j.s) && ae(j.v) ? (le = B(j.s), J = B(j.v), U = d(j.h, le, J), ge = true, ve = "hsv") : ae(j.h) && ae(j.s) && ae(j.l) && (le = B(j.s), pe = B(j.l), U = u(j.h, le, pe), ge = true, ve = "hsl"), j.hasOwnProperty("a") && (Z = j.a)), Z = G(Z), { ok: ge, format: j.format || ve, r: Math.min(255, Math.max(U.r, 0)), g: Math.min(255, Math.max(U.g, 0)), b: Math.min(255, Math.max(U.b, 0)), a: Z }; } function l(j, U, Z) { return { r: K(j, 255) * 255, g: K(U, 255) * 255, b: K(Z, 255) * 255 }; } function s(j, U, Z) { j = K(j, 255), U = K(U, 255), Z = K(Z, 255); var le = Math.max(j, U, Z), J = Math.min(j, U, Z), pe, ge, ve = (le + J) / 2; if (le == J) pe = ge = 0; else { var me = le - J; switch (ge = ve > 0.5 ? me / (2 - le - J) : me / (le + J), le) { case j: pe = (U - Z) / me + (U < Z ? 6 : 0); break; case U: pe = (Z - j) / me + 2; break; case Z: pe = (j - U) / me + 4; break; } pe /= 6; } return { h: pe, s: ge, l: ve }; } function u(j, U, Z) { var le, J, pe; j = K(j, 360), U = K(U, 100), Z = K(Z, 100); function ge(Le, ze, Fe) { return Fe < 0 && (Fe += 1), Fe > 1 && (Fe -= 1), Fe < 1 / 6 ? Le + (ze - Le) * 6 * Fe : Fe < 1 / 2 ? ze : Fe < 2 / 3 ? Le + (ze - Le) * (2 / 3 - Fe) * 6 : Le; } if (U === 0) le = J = pe = Z; else { var ve = Z < 0.5 ? Z * (1 + U) : Z + U - Z * U, me = 2 * Z - ve; le = ge(me, ve, j + 1 / 3), J = ge(me, ve, j), pe = ge(me, ve, j - 1 / 3); } return { r: le * 255, g: J * 255, b: pe * 255 }; } function f(j, U, Z) { j = K(j, 255), U = K(U, 255), Z = K(Z, 255); var le = Math.max(j, U, Z), J = Math.min(j, U, Z), pe, ge, ve = le, me = le - J; if (ge = le === 0 ? 0 : me / le, le == J) pe = 0; else { switch (le) { case j: pe = (U - Z) / me + (U < Z ? 6 : 0); break; case U: pe = (Z - j) / me + 2; break; case Z: pe = (j - U) / me + 4; break; } pe /= 6; } return { h: pe, s: ge, v: ve }; } function d(j, U, Z) { j = K(j, 360) * 6, U = K(U, 100), Z = K(Z, 100); var le = Math.floor(j), J = j - le, pe = Z * (1 - U), ge = Z * (1 - J * U), ve = Z * (1 - (1 - J) * U), me = le % 6, Le = [Z, ge, pe, pe, ve, Z][me], ze = [ve, Z, Z, ge, pe, pe][me], Fe = [pe, pe, ve, Z, Z, ge][me]; return { r: Le * 255, g: ze * 255, b: Fe * 255 }; } function h(j, U, Z, le) { var J = [H(Math.round(j).toString(16)), H(Math.round(U).toString(16)), H(Math.round(Z).toString(16))]; return le && J[0].charAt(0) == J[0].charAt(1) && J[1].charAt(0) == J[1].charAt(1) && J[2].charAt(0) == J[2].charAt(1) ? J[0].charAt(0) + J[1].charAt(0) + J[2].charAt(0) : J.join(""); } function p(j, U, Z, le, J) { var pe = [H(Math.round(j).toString(16)), H(Math.round(U).toString(16)), H(Math.round(Z).toString(16)), H(W(le))]; return J && pe[0].charAt(0) == pe[0].charAt(1) && pe[1].charAt(0) == pe[1].charAt(1) && pe[2].charAt(0) == pe[2].charAt(1) && pe[3].charAt(0) == pe[3].charAt(1) ? pe[0].charAt(0) + pe[1].charAt(0) + pe[2].charAt(0) + pe[3].charAt(0) : pe.join(""); } function v(j, U, Z, le) { var J = [H(W(le)), H(Math.round(j).toString(16)), H(Math.round(U).toString(16)), H(Math.round(Z).toString(16))]; return J.join(""); } i.equals = function(j, U) { return !j || !U ? false : i(j).toRgbString() == i(U).toRgbString(); }, i.random = function() { return i.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }); }; function m(j, U) { U = U === 0 ? 0 : U || 10; var Z = i(j).toHsl(); return Z.s -= U / 100, Z.s = V(Z.s), i(Z); } function g(j, U) { U = U === 0 ? 0 : U || 10; var Z = i(j).toHsl(); return Z.s += U / 100, Z.s = V(Z.s), i(Z); } function y(j) { return i(j).desaturate(100); } function w(j, U) { U = U === 0 ? 0 : U || 10; var Z = i(j).toHsl(); return Z.l += U / 100, Z.l = V(Z.l), i(Z); } function k(j, U) { U = U === 0 ? 0 : U || 10; var Z = i(j).toRgb(); return Z.r = Math.max(0, Math.min(255, Z.r - Math.round(255 * -(U / 100)))), Z.g = Math.max(0, Math.min(255, Z.g - Math.round(255 * -(U / 100)))), Z.b = Math.max(0, Math.min(255, Z.b - Math.round(255 * -(U / 100)))), i(Z); } function x(j, U) { U = U === 0 ? 0 : U || 10; var Z = i(j).toHsl(); return Z.l -= U / 100, Z.l = V(Z.l), i(Z); } function _(j, U) { var Z = i(j).toHsl(), le = (Z.h + U) % 360; return Z.h = le < 0 ? 360 + le : le, i(Z); } function T(j) { var U = i(j).toHsl(); return U.h = (U.h + 180) % 360, i(U); } function S(j, U) { if (isNaN(U) || U <= 0) throw new Error("Argument to polyad must be a positive number"); for (var Z = i(j).toHsl(), le = [i(j)], J = 360 / U, pe = 1; pe < U; pe++) le.push(i({ h: (Z.h + pe * J) % 360, s: Z.s, l: Z.l })); return le; } function M(j) { var U = i(j).toHsl(), Z = U.h; return [i(j), i({ h: (Z + 72) % 360, s: U.s, l: U.l }), i({ h: (Z + 216) % 360, s: U.s, l: U.l })]; } function L(j, U, Z) { U = U || 6, Z = Z || 30; var le = i(j).toHsl(), J = 360 / Z, pe = [i(j)]; for (le.h = (le.h - (J * U >> 1) + 720) % 360; --U; ) le.h = (le.h + J) % 360, pe.push(i(le)); return pe; } function F(j, U) { U = U || 6; for (var Z = i(j).toHsv(), le = Z.h, J = Z.s, pe = Z.v, ge = [], ve = 1 / U; U--; ) ge.push(i({ h: le, s: J, v: pe })), pe = (pe + ve) % 1; return ge; } i.mix = function(j, U, Z) { Z = Z === 0 ? 0 : Z || 50; var le = i(j).toRgb(), J = i(U).toRgb(), pe = Z / 100, ge = { r: (J.r - le.r) * pe + le.r, g: (J.g - le.g) * pe + le.g, b: (J.b - le.b) * pe + le.b, a: (J.a - le.a) * pe + le.a }; return i(ge); }, i.readability = function(j, U) { var Z = i(j), le = i(U); return (Math.max(Z.getLuminance(), le.getLuminance()) + 0.05) / (Math.min(Z.getLuminance(), le.getLuminance()) + 0.05); }, i.isReadable = function(j, U, Z) { var le = i.readability(j, U), J, pe; switch (pe = false, J = ue(Z), J.level + J.size) { case "AAsmall": case "AAAlarge": pe = le >= 4.5; break; case "AAlarge": pe = le >= 3; break; case "AAAsmall": pe = le >= 7; break; } return pe; }, i.mostReadable = function(j, U, Z) { var le = null, J = 0, pe, ge, ve, me; Z = Z || {}, ge = Z.includeFallbackColors, ve = Z.level, me = Z.size; for (var Le = 0; Le < U.length; Le++) pe = i.readability(j, U[Le]), pe > J && (J = pe, le = i(U[Le])); return i.isReadable(j, le, { level: ve, size: me }) || !ge ? le : (Z.includeFallbackColors = false, i.mostReadable(j, ["#fff", "#000"], Z)); }; var $ = i.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, I = i.hexNames = O($); function O(j) { var U = {}; for (var Z in j) j.hasOwnProperty(Z) && (U[j[Z]] = Z); return U; } function G(j) { return j = parseFloat(j), (isNaN(j) || j < 0 || j > 1) && (j = 1), j; } function K(j, U) { P(j) && (j = "100%"); var Z = R(j); return j = Math.min(U, Math.max(0, parseFloat(j))), Z && (j = parseInt(j * U, 10) / 100), Math.abs(j - U) < 1e-6 ? 1 : j % U / parseFloat(U); } function V(j) { return Math.min(1, Math.max(0, j)); } function z(j) { return parseInt(j, 16); } function P(j) { return typeof j == "string" && j.indexOf(".") != -1 && parseFloat(j) === 1; } function R(j) { return typeof j == "string" && j.indexOf("%") != -1; } function H(j) { return j.length == 1 ? "0" + j : "" + j; } function B(j) { return j <= 1 && (j = j * 100 + "%"), j; } function W(j) { return Math.round(parseFloat(j) * 255).toString(16); } function ee(j) { return z(j) / 255; } var re = function() { var j = "[-\\+]?\\d+%?", U = "[-\\+]?\\d*\\.\\d+%?", Z = "(?:" + U + ")|(?:" + j + ")", le = "[\\s|\\(]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")\\s*\\)?", J = "[\\s|\\(]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")\\s*\\)?"; return { CSS_UNIT: new RegExp(Z), rgb: new RegExp("rgb" + le), rgba: new RegExp("rgba" + J), hsl: new RegExp("hsl" + le), hsla: new RegExp("hsla" + J), hsv: new RegExp("hsv" + le), hsva: new RegExp("hsva" + J), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; }(); function ae(j) { return !!re.CSS_UNIT.exec(j); } function Q(j) { j = j.replace(n, "").replace(a, "").toLowerCase(); var U = false; if ($[j]) j = $[j], U = true; else if (j == "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var Z; return (Z = re.rgb.exec(j)) ? { r: Z[1], g: Z[2], b: Z[3] } : (Z = re.rgba.exec(j)) ? { r: Z[1], g: Z[2], b: Z[3], a: Z[4] } : (Z = re.hsl.exec(j)) ? { h: Z[1], s: Z[2], l: Z[3] } : (Z = re.hsla.exec(j)) ? { h: Z[1], s: Z[2], l: Z[3], a: Z[4] } : (Z = re.hsv.exec(j)) ? { h: Z[1], s: Z[2], v: Z[3] } : (Z = re.hsva.exec(j)) ? { h: Z[1], s: Z[2], v: Z[3], a: Z[4] } : (Z = re.hex8.exec(j)) ? { r: z(Z[1]), g: z(Z[2]), b: z(Z[3]), a: ee(Z[4]), format: U ? "name" : "hex8" } : (Z = re.hex6.exec(j)) ? { r: z(Z[1]), g: z(Z[2]), b: z(Z[3]), format: U ? "name" : "hex" } : (Z = re.hex4.exec(j)) ? { r: z(Z[1] + "" + Z[1]), g: z(Z[2] + "" + Z[2]), b: z(Z[3] + "" + Z[3]), a: ee(Z[4] + "" + Z[4]), format: U ? "name" : "hex8" } : (Z = re.hex3.exec(j)) ? { r: z(Z[1] + "" + Z[1]), g: z(Z[2] + "" + Z[2]), b: z(Z[3] + "" + Z[3]), format: U ? "name" : "hex" } : false; } function ue(j) { var U, Z; return j = j || { level: "AA", size: "small" }, U = (j.level || "AA").toUpperCase(), Z = (j.size || "small").toLowerCase(), U !== "AA" && U !== "AAA" && (U = "AA"), Z !== "small" && Z !== "large" && (Z = "small"), { level: U, size: Z }; } return i; }); })(VC); var bi = VC.exports; var Fn = function(e10) { var t = e10.editType, r = e10.colorEditType; r === void 0 && (r = t); var n = { family: { valType: "string", noBlank: true, strict: true, editType: t, description: [ "HTML font family - the typeface that will be applied by the web browser.", "The web browser will only be able to apply a font if it is available on the system", "which it operates. Provide multiple font families, separated by commas, to indicate", "the preference in which to apply fonts if they aren't available on the system.", "The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server,", "where only a select number of", "fonts are installed and supported.", "These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,", "*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,", "*PT Sans Narrow*, *Raleway*, *Times New Roman*." ].join(" ") }, size: { valType: "number", min: 1, editType: t }, color: { valType: "color", editType: r }, editType: t, // blank strings so compress_attributes can remove // TODO - that's uber hacky... better solution? description: "" + (e10.description || "") }; return e10.autoSize && (n.size.dflt = "auto"), e10.autoColor && (n.color.dflt = "auto"), e10.arrayOk && (n.family.arrayOk = true, n.size.arrayOk = true, n.color.arrayOk = true), n; }; var sp = { // hover labels for multiple horizontal bars get tilted by this angle YANGLE: 60, // size and display constants for hover text // pixel size of hover arrows HOVERARROWSIZE: 6, // pixels padding around text HOVERTEXTPAD: 3, // hover font HOVERFONTSIZE: 13, HOVERFONT: "Arial, sans-serif", // minimum time (msec) between hover calls HOVERMINTIME: 50, // ID suffix (with fullLayout._uid) for hover events in the throttle cache HOVERID: "-hover" }; var qC = sp; var WC = Fn; var G1 = WC({ editType: "none", description: "Sets the default hover label font used by all traces on the graph." }); G1.family.dflt = qC.HOVERFONT; G1.size.dflt = qC.HOVERFONTSIZE; var Zc = { clickmode: { valType: "flaglist", flags: ["event", "select"], dflt: "event", editType: "plot", extras: ["none"], description: [ "Determines the mode of single click interactions.", "*event* is the default value and emits the `plotly_click`", "event. In addition this mode emits the `plotly_selected` event", "in drag modes *lasso* and *select*, but with no event data attached", "(kept for compatibility reasons).", "The *select* flag enables selecting single", "data points via click. This mode also supports persistent selections,", "meaning that pressing Shift while clicking, adds to / subtracts from an", "existing selection. *select* with `hovermode`: *x* can be confusing, consider", "explicitly setting `hovermode`: *closest* when using this feature.", "Selection events are sent accordingly as long as *event* flag is set as well.", "When the *event* flag is missing, `plotly_click` and `plotly_selected`", "events are not fired." ].join(" ") }, dragmode: { valType: "enumerated", values: [ "zoom", "pan", "select", "lasso", "drawclosedpath", "drawopenpath", "drawline", "drawrect", "drawcircle", "orbit", "turntable", false ], dflt: "zoom", editType: "modebar", description: [ "Determines the mode of drag interactions.", "*select* and *lasso* apply only to scatter traces with", "markers or text. *orbit* and *turntable* apply only to", "3D scenes." ].join(" ") }, hovermode: { valType: "enumerated", values: ["x", "y", "closest", false, "x unified", "y unified"], dflt: "closest", editType: "modebar", description: [ "Determines the mode of hover interactions.", "If *closest*, a single hoverlabel will appear", "for the *closest* point within the `hoverdistance`.", "If *x* (or *y*), multiple hoverlabels will appear for multiple points", "at the *closest* x- (or y-) coordinate within the `hoverdistance`,", "with the caveat that no more than one hoverlabel will appear per trace.", "If *x unified* (or *y unified*), a single hoverlabel will appear", "multiple points at the closest x- (or y-) coordinate within the `hoverdistance`", "with the caveat that no more than one hoverlabel will appear per trace.", "In this mode, spikelines are enabled by default perpendicular to the specified axis.", "If false, hover interactions are disabled." ].join(" ") }, hoverdistance: { valType: "integer", min: -1, dflt: 20, editType: "none", description: [ "Sets the default distance (in pixels) to look for data", "to add hover labels (-1 means no cutoff, 0 means no looking for data).", "This is only a real distance for hovering on point-like objects,", "like scatter points. For area-like objects (bars, scatter fills, etc)", "hovering is on inside the area and off outside, but these objects", "will not supersede hover on point-like objects in case of conflict." ].join(" ") }, spikedistance: { valType: "integer", min: -1, dflt: -1, editType: "none", description: [ "Sets the default distance (in pixels) to look for data to draw", "spikelines to (-1 means no cutoff, 0 means no looking for data).", "As with hoverdistance, distance does not apply to area-like objects.", "In addition, some objects can be hovered on but will not generate", "spikelines, such as scatter fills." ].join(" ") }, hoverlabel: { bgcolor: { valType: "color", editType: "none", description: [ "Sets the background color of all hover labels on graph" ].join(" ") }, bordercolor: { valType: "color", editType: "none", description: [ "Sets the border color of all hover labels on graph." ].join(" ") }, font: G1, grouptitlefont: WC({ editType: "none", description: [ "Sets the font for group titles in hover (unified modes).", "Defaults to `hoverlabel.font`." ].join(" ") }), align: { valType: "enumerated", values: ["left", "right", "auto"], dflt: "auto", editType: "none", description: [ "Sets the horizontal alignment of the text content within hover label box.", "Has an effect only if the hover label text spans more two or more lines" ].join(" ") }, namelength: { valType: "integer", min: -1, dflt: 15, editType: "none", description: [ "Sets the default length (in number of characters) of the trace name in", "the hover labels for all traces. -1 shows the whole name", "regardless of length. 0-3 shows the first 0-3 characters, and", "an integer >3 will show the whole name if it is less than that", "many characters, but if it is longer, will truncate to", "`namelength - 3` characters and add an ellipsis." ].join(" ") }, editType: "none" }, selectdirection: { valType: "enumerated", values: ["h", "v", "d", "any"], dflt: "any", description: [ "When `dragmode` is set to *select*, this limits the selection of the drag to", "horizontal, vertical or diagonal. *h* only allows horizontal selection,", "*v* only vertical, *d* only diagonal and *any* sets no limit." ].join(" "), editType: "none" } }; var en = {}; var _2 = ms; var xf = Array.isArray; function EU(e10, t) { var r, n; for (r = 0; r < e10.length; r++) { if (n = e10[r], n !== null && typeof n == "object") return false; n !== void 0 && (t[r] = n); } return true; } en.extendFlat = function() { return Yc(arguments, false, false, false); }; en.extendDeep = function() { return Yc(arguments, true, false, false); }; en.extendDeepAll = function() { return Yc(arguments, true, true, false); }; en.extendDeepNoArrays = function() { return Yc(arguments, true, false, true); }; function Yc(e10, t, r, n) { var a = e10[0], i = e10.length, o, l, s, u, f, d, h; if (i === 2 && xf(a) && xf(e10[1]) && a.length === 0) { if (h = EU(e10[1], a), h) return a; a.splice(0, a.length); } for (var p = 1; p < i; p++) { o = e10[p]; for (l in o) s = a[l], u = o[l], n && xf(u) ? a[l] = u : t && u && (_2(u) || (f = xf(u))) ? (f ? (f = false, d = s && xf(s) ? s : []) : d = s && _2(s) ? s : {}, a[l] = Yc([d, u], t, r, n)) : (typeof u < "u" || r) && (a[l] = u); } return a; } var FU = Fn; var $d = Zc.hoverlabel; var zd = en.extendFlat; var V1 = { hoverlabel: { bgcolor: zd({}, $d.bgcolor, { arrayOk: true, description: "Sets the background color of the hover labels for this trace" }), bordercolor: zd({}, $d.bordercolor, { arrayOk: true, description: "Sets the border color of the hover labels for this trace." }), font: FU({ arrayOk: true, editType: "none", description: "Sets the font used in hover labels." }), align: zd({}, $d.align, { arrayOk: true }), namelength: zd({}, $d.namelength, { arrayOk: true }), editType: "none" } }; var RU = Fn; var PU = V1; var Wi = { type: { valType: "enumerated", values: [], // listed dynamically dflt: "scatter", editType: "calc+clearAxisTypes", _noTemplating: true // we handle this at a higher level }, visible: { valType: "enumerated", values: [true, false, "legendonly"], dflt: true, editType: "calc", description: [ "Determines whether or not this trace is visible.", "If *legendonly*, the trace is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }, showlegend: { valType: "boolean", dflt: true, editType: "style", description: [ "Determines whether or not an item corresponding to this", "trace is shown in the legend." ].join(" ") }, legend: { valType: "subplotid", dflt: "legend", editType: "style", description: [ "Sets the reference to a legend to show this trace in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }, legendgroup: { valType: "string", dflt: "", editType: "style", description: [ "Sets the legend group for this trace.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }, legendgrouptitle: { text: { valType: "string", dflt: "", editType: "style", description: [ "Sets the title of the legend group." ].join(" ") }, font: RU({ editType: "style", description: [ "Sets this legend group's title font." ].join(" ") }), editType: "style" }, legendrank: { valType: "number", dflt: 1e3, editType: "style", description: [ "Sets the legend rank for this trace.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items.", "When having unranked or equal rank items shapes would be displayed after traces", "i.e. according to their order in data and layout." ].join(" ") }, legendwidth: { valType: "number", min: 0, editType: "style", description: "Sets the width (in px or fraction) of the legend for this trace." }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "style", description: "Sets the opacity of the trace." }, name: { valType: "string", editType: "style", description: [ "Sets the trace name.", "The trace name appears as the legend item and on hover." ].join(" ") }, uid: { valType: "string", editType: "plot", anim: true, description: [ "Assign an id to this trace,", "Use this to provide object constancy between traces during animations", "and transitions." ].join(" ") }, ids: { valType: "data_array", editType: "calc", anim: true, description: [ "Assigns id labels to each datum.", "These ids for object constancy of data points during animation.", "Should be an array of strings, not numbers or any other type." ].join(" ") }, customdata: { valType: "data_array", editType: "calc", description: [ "Assigns extra data each datum.", "This may be useful when listening to hover, click and selection events.", "Note that, *scatter* traces also appends customdata items in the markers", "DOM elements" ].join(" ") }, meta: { valType: "any", arrayOk: true, editType: "plot", description: [ "Assigns extra meta information associated with this trace", "that can be used in various text attributes.", "Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`", "`rangeselector`, `updatemenues` and `sliders` `label` text", "all support `meta`.", "To access the trace `meta` values in an attribute in the same trace, simply use", "`%{meta[i]}` where `i` is the index or key of the `meta`", "item in question.", "To access trace `meta` in layout attributes, use", "`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`", "and `n` is the trace index." ].join(" ") }, // N.B. these cannot be 'data_array' as they do not have the same length as // other data arrays and arrayOk attributes in general // // Maybe add another valType: // https://github.com/plotly/plotly.js/issues/1894 selectedpoints: { valType: "any", editType: "calc", description: [ "Array containing integer indices of selected points.", "Has an effect only for traces that support selections.", "Note that an empty array means an empty selection where the `unselected`", "are turned on for all points, whereas, any other non-array values means no", "selection all where the `selected` and `unselected` styles have no effect." ].join(" ") }, hoverinfo: { valType: "flaglist", flags: ["x", "y", "z", "text", "name"], extras: ["all", "none", "skip"], arrayOk: true, dflt: "all", editType: "none", description: [ "Determines which trace information appear on hover.", "If `none` or `skip` are set, no information is displayed upon hovering.", "But, if `none` is set, click and hover events are still fired." ].join(" ") }, hoverlabel: PU.hoverlabel, stream: { token: { valType: "string", noBlank: true, strict: true, editType: "calc", description: [ "The stream id number links a data trace on a plot with a stream.", "See https://chart-studio.plotly.com/settings for more details." ].join(" ") }, maxpoints: { valType: "number", min: 0, max: 1e4, dflt: 500, editType: "calc", description: [ "Sets the maximum number of points to keep on the plots from an", "incoming stream.", "If `maxpoints` is set to *50*, only the newest 50 points will", "be displayed on the plot." ].join(" ") }, editType: "calc" }, transforms: { _isLinkedToArray: "transform", editType: "calc", description: [ "WARNING: All transforms are deprecated and may be removed from the API in next major version.", "An array of operations that manipulate the trace data,", "for example filtering or sorting the data arrays." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of some user-driven changes to the trace:", "`constraintrange` in `parcoords` traces, as well as some", "`editable: true` modifications such as `name` and `colorbar.title`.", "Defaults to `layout.uirevision`.", "Note that other user-driven trace attribute changes are controlled", "by `layout` attributes:", "`trace.visible` is controlled by `layout.legend.uirevision`,", "`selectedpoints` is controlled by `layout.selectionrevision`,", "and `colorbar.(x|y)` (accessible with `config: {editable: true}`)", "is controlled by `layout.editrevision`.", "Trace changes are tracked by `uid`, which only falls back on trace", "index if no `uid` is provided. So if your app can add/remove traces", "before the end of the `data` array, such that the same trace has a", "different index, you can still preserve user-driven changes if you", "give each trace a `uid` that stays with it as it moves." ].join(" ") } }; var $U = bi; var up = { Greys: [ [0, "rgb(0,0,0)"], [1, "rgb(255,255,255)"] ], YlGnBu: [ [0, "rgb(8,29,88)"], [0.125, "rgb(37,52,148)"], [0.25, "rgb(34,94,168)"], [0.375, "rgb(29,145,192)"], [0.5, "rgb(65,182,196)"], [0.625, "rgb(127,205,187)"], [0.75, "rgb(199,233,180)"], [0.875, "rgb(237,248,217)"], [1, "rgb(255,255,217)"] ], Greens: [ [0, "rgb(0,68,27)"], [0.125, "rgb(0,109,44)"], [0.25, "rgb(35,139,69)"], [0.375, "rgb(65,171,93)"], [0.5, "rgb(116,196,118)"], [0.625, "rgb(161,217,155)"], [0.75, "rgb(199,233,192)"], [0.875, "rgb(229,245,224)"], [1, "rgb(247,252,245)"] ], YlOrRd: [ [0, "rgb(128,0,38)"], [0.125, "rgb(189,0,38)"], [0.25, "rgb(227,26,28)"], [0.375, "rgb(252,78,42)"], [0.5, "rgb(253,141,60)"], [0.625, "rgb(254,178,76)"], [0.75, "rgb(254,217,118)"], [0.875, "rgb(255,237,160)"], [1, "rgb(255,255,204)"] ], Bluered: [ [0, "rgb(0,0,255)"], [1, "rgb(255,0,0)"] ], // modified RdBu based on // http://www.kennethmoreland.com/color-maps/ RdBu: [ [0, "rgb(5,10,172)"], [0.35, "rgb(106,137,247)"], [0.5, "rgb(190,190,190)"], [0.6, "rgb(220,170,132)"], [0.7, "rgb(230,145,90)"], [1, "rgb(178,10,28)"] ], // Scale for non-negative numeric values Reds: [ [0, "rgb(220,220,220)"], [0.2, "rgb(245,195,157)"], [0.4, "rgb(245,160,105)"], [1, "rgb(178,10,28)"] ], // Scale for non-positive numeric values Blues: [ [0, "rgb(5,10,172)"], [0.35, "rgb(40,60,190)"], [0.5, "rgb(70,100,245)"], [0.6, "rgb(90,120,245)"], [0.7, "rgb(106,137,247)"], [1, "rgb(220,220,220)"] ], Picnic: [ [0, "rgb(0,0,255)"], [0.1, "rgb(51,153,255)"], [0.2, "rgb(102,204,255)"], [0.3, "rgb(153,204,255)"], [0.4, "rgb(204,204,255)"], [0.5, "rgb(255,255,255)"], [0.6, "rgb(255,204,255)"], [0.7, "rgb(255,153,255)"], [0.8, "rgb(255,102,204)"], [0.9, "rgb(255,102,102)"], [1, "rgb(255,0,0)"] ], Rainbow: [ [0, "rgb(150,0,90)"], [0.125, "rgb(0,0,200)"], [0.25, "rgb(0,25,255)"], [0.375, "rgb(0,152,255)"], [0.5, "rgb(44,255,150)"], [0.625, "rgb(151,255,0)"], [0.75, "rgb(255,234,0)"], [0.875, "rgb(255,111,0)"], [1, "rgb(255,0,0)"] ], Portland: [ [0, "rgb(12,51,131)"], [0.25, "rgb(10,136,186)"], [0.5, "rgb(242,211,56)"], [0.75, "rgb(242,143,56)"], [1, "rgb(217,30,30)"] ], Jet: [ [0, "rgb(0,0,131)"], [0.125, "rgb(0,60,170)"], [0.375, "rgb(5,255,255)"], [0.625, "rgb(255,255,0)"], [0.875, "rgb(250,0,0)"], [1, "rgb(128,0,0)"] ], Hot: [ [0, "rgb(0,0,0)"], [0.3, "rgb(230,0,0)"], [0.6, "rgb(255,210,0)"], [1, "rgb(255,255,255)"] ], Blackbody: [ [0, "rgb(0,0,0)"], [0.2, "rgb(230,0,0)"], [0.4, "rgb(230,210,0)"], [0.7, "rgb(255,255,255)"], [1, "rgb(160,200,255)"] ], Earth: [ [0, "rgb(0,0,130)"], [0.1, "rgb(0,180,180)"], [0.2, "rgb(40,210,40)"], [0.4, "rgb(230,230,50)"], [0.6, "rgb(120,70,20)"], [1, "rgb(255,255,255)"] ], Electric: [ [0, "rgb(0,0,0)"], [0.15, "rgb(30,0,100)"], [0.4, "rgb(120,0,100)"], [0.6, "rgb(160,90,0)"], [0.8, "rgb(230,200,0)"], [1, "rgb(255,250,220)"] ], Viridis: [ [0, "#440154"], [0.06274509803921569, "#48186a"], [0.12549019607843137, "#472d7b"], [0.18823529411764706, "#424086"], [0.25098039215686274, "#3b528b"], [0.3137254901960784, "#33638d"], [0.3764705882352941, "#2c728e"], [0.4392156862745098, "#26828e"], [0.5019607843137255, "#21918c"], [0.5647058823529412, "#1fa088"], [0.6274509803921569, "#28ae80"], [0.6901960784313725, "#3fbc73"], [0.7529411764705882, "#5ec962"], [0.8156862745098039, "#84d44b"], [0.8784313725490196, "#addc30"], [0.9411764705882353, "#d8e219"], [1, "#fde725"] ], Cividis: [ [0, "rgb(0,32,76)"], [0.058824, "rgb(0,42,102)"], [0.117647, "rgb(0,52,110)"], [0.176471, "rgb(39,63,108)"], [0.235294, "rgb(60,74,107)"], [0.294118, "rgb(76,85,107)"], [0.352941, "rgb(91,95,109)"], [0.411765, "rgb(104,106,112)"], [0.470588, "rgb(117,117,117)"], [0.529412, "rgb(131,129,120)"], [0.588235, "rgb(146,140,120)"], [0.647059, "rgb(161,152,118)"], [0.705882, "rgb(176,165,114)"], [0.764706, "rgb(192,177,109)"], [0.823529, "rgb(209,191,102)"], [0.882353, "rgb(225,204,92)"], [0.941176, "rgb(243,219,79)"], [1, "rgb(255,233,69)"] ] }; var ZC = up.RdBu; function zU(e10, t) { if (t || (t = ZC), !e10) return t; function r() { try { e10 = up[e10] || JSON.parse(e10); } catch { e10 = t; } } return typeof e10 == "string" && (r(), typeof e10 == "string" && r()), YC(e10) ? e10 : t; } function YC(e10) { var t = 0; if (!Array.isArray(e10) || e10.length < 2 || !e10[0] || !e10[e10.length - 1] || +e10[0][0] != 0 || +e10[e10.length - 1][0] != 1) return false; for (var r = 0; r < e10.length; r++) { var n = e10[r]; if (n.length !== 2 || +n[0] < t || !$U(n[1]).isValid()) return false; t = +n[0]; } return true; } function IU(e10) { return up[e10] !== void 0 ? true : YC(e10); } var Wu = { scales: up, defaultScale: ZC, get: zU, isValid: IU }; var XC = { exports: {} }; var da = {}; da.defaults = [ "#1f77b4", // muted blue "#ff7f0e", // safety orange "#2ca02c", // cooked asparagus green "#d62728", // brick red "#9467bd", // muted purple "#8c564b", // chestnut brown "#e377c2", // raspberry yogurt pink "#7f7f7f", // middle gray "#bcbd22", // curry yellow-green "#17becf" // blue-teal ]; da.defaultLine = "#444"; da.lightLine = "#eee"; da.background = "#fff"; da.borderLine = "#BEC8D9"; da.lightFraction = 100 * 10 / 11; var hi = bi; var NU = sr; var OU = an.isTypedArray; var _n = XC.exports = {}; var fp = da; _n.defaults = fp.defaults; var HU = _n.defaultLine = fp.defaultLine; _n.lightLine = fp.lightLine; var oy = _n.background = fp.background; _n.tinyRGB = function(e10) { var t = e10.toRgb(); return "rgb(" + Math.round(t.r) + ", " + Math.round(t.g) + ", " + Math.round(t.b) + ")"; }; _n.rgb = function(e10) { return _n.tinyRGB(hi(e10)); }; _n.opacity = function(e10) { return e10 ? hi(e10).getAlpha() : 0; }; _n.addOpacity = function(e10, t) { var r = hi(e10).toRgb(); return "rgba(" + Math.round(r.r) + ", " + Math.round(r.g) + ", " + Math.round(r.b) + ", " + t + ")"; }; _n.combine = function(e10, t) { var r = hi(e10).toRgb(); if (r.a === 1) return hi(e10).toRgbString(); var n = hi(t || oy).toRgb(), a = n.a === 1 ? n : { r: 255 * (1 - n.a) + n.r * n.a, g: 255 * (1 - n.a) + n.g * n.a, b: 255 * (1 - n.a) + n.b * n.a }, i = { r: a.r * (1 - r.a) + r.r * r.a, g: a.g * (1 - r.a) + r.g * r.a, b: a.b * (1 - r.a) + r.b * r.a }; return hi(i).toRgbString(); }; _n.contrast = function(e10, t, r) { var n = hi(e10); n.getAlpha() !== 1 && (n = hi(_n.combine(e10, oy))); var a = n.isDark() ? t ? n.lighten(t) : oy : r ? n.darken(r) : HU; return a.toString(); }; _n.stroke = function(e10, t) { var r = hi(t); e10.style({ stroke: _n.tinyRGB(r), "stroke-opacity": r.getAlpha() }); }; _n.fill = function(e10, t) { var r = hi(t); e10.style({ fill: _n.tinyRGB(r), "fill-opacity": r.getAlpha() }); }; _n.clean = function(e10) { if (!(!e10 || typeof e10 != "object")) { var t = Object.keys(e10), r, n, a, i; for (r = 0; r < t.length; r++) if (a = t[r], i = e10[a], a.substr(a.length - 5) === "color") if (Array.isArray(i)) for (n = 0; n < i.length; n++) i[n] = Gm(i[n]); else e10[a] = Gm(i); else if (a.substr(a.length - 10) === "colorscale" && Array.isArray(i)) for (n = 0; n < i.length; n++) Array.isArray(i[n]) && (i[n][1] = Gm(i[n][1])); else if (Array.isArray(i)) { var o = i[0]; if (!Array.isArray(o) && o && typeof o == "object") for (n = 0; n < i.length; n++) _n.clean(i[n]); } else i && typeof i == "object" && !OU(i) && _n.clean(i); } }; function Gm(e10) { if (NU(e10) || typeof e10 != "string") return e10; var t = e10.trim(); if (t.substr(0, 3) !== "rgb") return e10; var r = t.match(/^rgba?\s*\(([^()]*)\)$/); if (!r) return e10; var n = r[1].trim().split(/\s*[\s,]\s*/), a = t.charAt(3) === "a" && n.length === 4; if (!a && n.length !== 3) return e10; for (var i = 0; i < n.length; i++) { if (!n[i].length || (n[i] = Number(n[i]), !(n[i] >= 0))) return e10; if (i === 3) n[i] > 1 && (n[i] = 1); else if (n[i] >= 1) return e10; } var o = Math.round(n[0] * 255) + ", " + Math.round(n[1] * 255) + ", " + Math.round(n[2] * 255); return a ? "rgba(" + o + ", " + n[3] + ")" : "rgb(" + o + ")"; } var nr = XC.exports; var q1 = { /** * Timing information for interactive elements */ SHOW_PLACEHOLDER: 100, HIDE_PLACEHOLDER: 1e3, // opacity dimming fraction for points that are not in selection DESELECTDIM: 0.2 }; var Zu = {}; Zu.counter = function(e10, t, r, n) { var a = (t || "") + (r ? "" : "$"), i = n === false ? "" : "^"; return e10 === "xy" ? new RegExp(i + "x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?" + a) : new RegExp(i + e10 + "([2-9]|[1-9][0-9]+)?" + a); }; (function(e10) { var t = sr, r = bi, n = Wi, a = Wu, i = nr, o = q1.DESELECTDIM, l = j1, s = Zu.counter, u = Wc.modHalf, f = an.isArrayOrTypedArray, d = an.isTypedArraySpec, h = an.decodeTypedArraySpec; e10.valObjectMeta = { data_array: { // You can use *dflt=[] to force said array to exist though. description: [ "An {array} of data.", "The value must represent an {array} or it will be ignored,", "but this array can be provided in several forms:", "(1) a regular {array} object", "(2) a typed array (e.g. Float32Array)", "(3) an object with keys dtype, bdata, and optionally shape.", "In this 3rd form, dtype is one of", "*f8*, *f4*.", "*i4*, *u4*,", "*i2*, *u2*,", "*i1*, *u1* or *u1c* for Uint8ClampedArray.", "In addition to shorthand `dtype` above one could also use the following forms:", "*float64*, *float32*,", "*int32*, *uint32*,", "*int16*, *uint16*,", "*int8*, *uint8* or *uint8c* for Uint8ClampedArray.", "`bdata` is either a base64-encoded string or the ArrayBuffer of", "an integer or float typed array.", "For either multi-dimensional arrays you must also", "provide its dimensions separated by comma via `shape`.", "For example using `dtype`: *f4* and `shape`: *5,100* you can", "declare a 2-D array that has 5 rows and 100 columns", "containing float32 values i.e. 4 bits per value.", "`shape` is optional for one dimensional arrays." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(v, m, g) { m.set( f(v) ? v : d(v) ? h(v) : g ); } }, enumerated: { description: [ "Enumerated value type. The available values are listed", "in `values`." ].join(" "), requiredOpts: ["values"], otherOpts: ["dflt", "coerceNumber", "arrayOk"], coerceFunction: function(v, m, g, y) { y.coerceNumber && (v = +v), y.values.indexOf(v) === -1 ? m.set(g) : m.set(v); }, validateFunction: function(v, m) { m.coerceNumber && (v = +v); for (var g = m.values, y = 0; y < g.length; y++) { var w = String(g[y]); if (w.charAt(0) === "/" && w.charAt(w.length - 1) === "/") { var k = new RegExp(w.substr(1, w.length - 2)); if (k.test(v)) return true; } else if (v === g[y]) return true; } return false; } }, boolean: { description: "A boolean (true/false) value.", requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(v, m, g) { v === true || v === false ? m.set(v) : m.set(g); } }, number: { description: [ "A number or a numeric value", "(e.g. a number inside a string).", "When applicable, values greater (less) than `max` (`min`)", "are coerced to the `dflt`." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "min", "max", "arrayOk"], coerceFunction: function(v, m, g, y) { !t(v) || y.min !== void 0 && v < y.min || y.max !== void 0 && v > y.max ? m.set(g) : m.set(+v); } }, integer: { description: [ "An integer or an integer inside a string.", "When applicable, values greater (less) than `max` (`min`)", "are coerced to the `dflt`." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "min", "max", "arrayOk"], coerceFunction: function(v, m, g, y) { v % 1 || !t(v) || y.min !== void 0 && v < y.min || y.max !== void 0 && v > y.max ? m.set(g) : m.set(+v); } }, string: { description: [ "A string value.", "Numbers are converted to strings except for attributes with", "`strict` set to true." ].join(" "), requiredOpts: [], // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter) otherOpts: ["dflt", "noBlank", "strict", "arrayOk", "values"], coerceFunction: function(v, m, g, y) { if (typeof v != "string") { var w = typeof v == "number"; y.strict === true || !w ? m.set(g) : m.set(String(v)); } else y.noBlank && !v ? m.set(g) : m.set(v); } }, color: { description: [ "A string describing color.", "Supported formats:", "- hex (e.g. '#d3d3d3')", "- rgb (e.g. 'rgb(255, 0, 0)')", "- rgba (e.g. 'rgb(255, 0, 0, 0.5)')", "- hsl (e.g. 'hsl(0, 100%, 50%)')", "- hsv (e.g. 'hsv(0, 100%, 100%)')", "- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)" ].join(" "), requiredOpts: [], otherOpts: ["dflt", "arrayOk"], coerceFunction: function(v, m, g) { r(v).isValid() ? m.set(v) : m.set(g); } }, colorlist: { description: [ "A list of colors.", "Must be an {array} containing valid colors." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(v, m, g) { function y(w) { return r(w).isValid(); } !Array.isArray(v) || !v.length ? m.set(g) : v.every(y) ? m.set(v) : m.set(g); } }, colorscale: { description: [ "A Plotly colorscale either picked by a name:", "(any of", Object.keys(a.scales).join(", "), ")", "customized as an {array} of 2-element {arrays} where", "the first element is the normalized color level value", "(starting at *0* and ending at *1*),", "and the second item is a valid color string." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(v, m, g) { m.set(a.get(v, g)); } }, angle: { description: [ "A number (in degree) between -180 and 180." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "arrayOk"], coerceFunction: function(v, m, g) { v === "auto" ? m.set("auto") : t(v) ? m.set(u(+v, 360)) : m.set(g); } }, subplotid: { description: [ "An id string of a subplot type (given by dflt), optionally", "followed by an integer >1. e.g. if dflt='geo', we can have", "'geo', 'geo2', 'geo3', ..." ].join(" "), requiredOpts: ["dflt"], otherOpts: ["regex"], coerceFunction: function(v, m, g, y) { var w = y.regex || s(g); if (typeof v == "string" && w.test(v)) { m.set(v); return; } m.set(g); }, validateFunction: function(v, m) { var g = m.dflt; return v === g ? true : typeof v != "string" ? false : !!s(g).test(v); } }, flaglist: { description: [ "A string representing a combination of flags", "(order does not matter here).", "Combine any of the available `flags` with *+*.", "(e.g. ('lines+markers')).", "Values in `extras` cannot be combined." ].join(" "), requiredOpts: ["flags"], otherOpts: ["dflt", "extras", "arrayOk"], coerceFunction: function(v, m, g, y) { if ((y.extras || []).indexOf(v) !== -1) { m.set(v); return; } if (typeof v != "string") { m.set(g); return; } for (var w = v.split("+"), k = 0; k < w.length; ) { var x = w[k]; y.flags.indexOf(x) === -1 || w.indexOf(x) < k ? w.splice(k, 1) : k++; } w.length ? m.set(w.join("+")) : m.set(g); } }, any: { description: "Any type.", requiredOpts: [], otherOpts: ["dflt", "values", "arrayOk"], coerceFunction: function(v, m, g) { v === void 0 ? m.set(g) : m.set( d(v) ? h(v) : v ); } }, info_array: { description: [ "An {array} of plot information." ].join(" "), requiredOpts: ["items"], // set `dimensions=2` for a 2D array or '1-2' for either // `items` may be a single object instead of an array, in which case // `freeLength` must be true. // if `dimensions='1-2'` and items is a 1D array, then the value can // either be a matching 1D array or an array of such matching 1D arrays otherOpts: ["dflt", "freeLength", "dimensions"], coerceFunction: function(v, m, g, y) { function w(V, z, P) { var R, H = { set: function(B) { R = B; } }; return P === void 0 && (P = z.dflt), e10.valObjectMeta[z.valType].coerceFunction(V, H, P, z), R; } if (d(v) && (v = h(v)), !f(v)) { m.set(g); return; } var k = y.dimensions === 2 || y.dimensions === "1-2" && Array.isArray(v) && f(v[0]), x = y.items, _ = [], T = Array.isArray(x), S = T && k && f(x[0]), M = k && T && !S, L = T && !M ? x.length : v.length, F, $, I, O, G, K; if (g = Array.isArray(g) ? g : [], k) for (F = 0; F < L; F++) for (_[F] = [], I = f(v[F]) ? v[F] : [], M ? G = x.length : T ? G = x[F].length : G = I.length, $ = 0; $ < G; $++) M ? O = x[$] : T ? O = x[F][$] : O = x, K = w(I[$], O, (g[F] || [])[$]), K !== void 0 && (_[F][$] = K); else for (F = 0; F < L; F++) K = w(v[F], T ? x[F] : x, g[F]), K !== void 0 && (_[F] = K); m.set(_); }, validateFunction: function(v, m) { if (!f(v)) return false; var g = m.items, y = Array.isArray(g), w = m.dimensions === 2; if (!m.freeLength && v.length !== g.length) return false; for (var k = 0; k < v.length; k++) if (w) { if (!f(v[k]) || !m.freeLength && v[k].length !== g[k].length) return false; for (var x = 0; x < v[k].length; x++) if (!p(v[k][x], y ? g[k][x] : g)) return false; } else if (!p(v[k], y ? g[k] : g)) return false; return true; } } }, e10.coerce = function(v, m, g, y, w) { var k = l(g, y).get(), x = l(v, y), _ = l(m, y), T = x.get(), S = m._template; if (T === void 0 && S && (T = l(S, y).get(), S = 0), w === void 0 && (w = k.dflt), k.arrayOk) { if (f(T)) return _.set(T), T; if (d(T)) return T = h(T), _.set(T), T; } var M = e10.valObjectMeta[k.valType].coerceFunction; M(T, _, w, k); var L = _.get(); return S && L === w && !p(T, k) && (T = l(S, y).get(), M(T, _, w, k), L = _.get()), L; }, e10.coerce2 = function(v, m, g, y, w) { var k = l(v, y), x = e10.coerce(v, m, g, y, w), _ = k.get(); return _ != null ? x : false; }, e10.coerceFont = function(v, m, g) { var y = {}; return g = g || {}, y.family = v(m + ".family", g.family), y.size = v(m + ".size", g.size), y.color = v(m + ".color", g.color), y; }, e10.coercePattern = function(v, m, g, y) { var w = v(m + ".shape"); if (w) { v(m + ".solidity"), v(m + ".size"); var k = v(m + ".fillmode"), x = k === "overlay"; if (!y) { var _ = v( m + ".bgcolor", x ? g : void 0 ); v( m + ".fgcolor", x ? i.contrast(_) : g ); } v( m + ".fgopacity", x ? 0.5 : 1 ); } }, e10.coerceHoverinfo = function(v, m, g) { var y = m._module.attributes, w = y.hoverinfo ? y : n, k = w.hoverinfo, x; if (g._dataLength === 1) { var _ = k.dflt === "all" ? k.flags.slice() : k.dflt.split("+"); _.splice(_.indexOf("name"), 1), x = _.join("+"); } return e10.coerce(v, m, w, "hoverinfo", x); }, e10.coerceSelectionMarkerOpacity = function(v, m) { if (v.marker) { var g = v.marker.opacity; if (g !== void 0) { var y, w; !f(g) && !v.selected && !v.unselected && (y = g, w = o * g), m("selected.marker.opacity", y), m("unselected.marker.opacity", w); } } }; function p(v, m) { var g = e10.valObjectMeta[m.valType]; if (m.arrayOk && f(v)) return true; if (g.validateFunction) return g.validateFunction(v, m); var y = {}, w = y, k = { set: function(x) { w = x; } }; return g.coerceFunction(v, k, y, m), w !== y; } e10.validate = p; })(GC); var KC = {}; var JC = { exports: {} }; var QC = { staticPlot: { valType: "boolean", dflt: false, description: [ "Determines whether the graphs are interactive or not.", "If *false*, no interactivity, for export or image generation." ].join(" ") }, typesetMath: { valType: "boolean", dflt: true, description: [ "Determines whether math should be typeset or not,", "when MathJax (either v2 or v3) is present on the page." ].join(" ") }, plotlyServerURL: { valType: "string", dflt: "", description: [ "When set it determines base URL for", "the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button", "and the showLink/sendData on-graph link.", "To enable sending your data to Chart Studio Cloud, you need to", "set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and", "also set `showSendToCloud` to true." ].join(" ") }, editable: { valType: "boolean", dflt: false, description: [ "Determines whether the graph is editable or not.", "Sets all pieces of `edits`", "unless a separate `edits` config item overrides individual parts." ].join(" ") }, edits: { annotationPosition: { valType: "boolean", dflt: false, description: [ "Determines if the main anchor of the annotation is editable.", "The main anchor corresponds to the", "text (if no arrow) or the arrow (which drags the whole thing leaving", "the arrow length & direction unchanged)." ].join(" ") }, annotationTail: { valType: "boolean", dflt: false, description: [ "Has only an effect for annotations with arrows.", "Enables changing the length and direction of the arrow." ].join(" ") }, annotationText: { valType: "boolean", dflt: false, description: "Enables editing annotation text." }, axisTitleText: { valType: "boolean", dflt: false, description: "Enables editing axis title text." }, colorbarPosition: { valType: "boolean", dflt: false, description: "Enables moving colorbars." }, colorbarTitleText: { valType: "boolean", dflt: false, description: "Enables editing colorbar title text." }, legendPosition: { valType: "boolean", dflt: false, description: "Enables moving the legend." }, legendText: { valType: "boolean", dflt: false, description: "Enables editing the trace name fields from the legend" }, shapePosition: { valType: "boolean", dflt: false, description: "Enables moving shapes." }, titleText: { valType: "boolean", dflt: false, description: "Enables editing the global layout title." } }, editSelection: { valType: "boolean", dflt: true, description: "Enables moving selections." }, autosizable: { valType: "boolean", dflt: false, description: [ "Determines whether the graphs are plotted with respect to", "layout.autosize:true and infer its container size." ].join(" ") }, responsive: { valType: "boolean", dflt: false, description: [ "Determines whether to change the layout size when window is resized.", "In v3, this option will be removed and will always be true." ].join(" ") }, fillFrame: { valType: "boolean", dflt: false, description: [ "When `layout.autosize` is turned on, determines whether the graph", "fills the container (the default) or the screen (if set to *true*)." ].join(" ") }, frameMargins: { valType: "number", dflt: 0, min: 0, max: 0.5, description: [ "When `layout.autosize` is turned on, set the frame margins", "in fraction of the graph size." ].join(" ") }, scrollZoom: { valType: "flaglist", flags: ["cartesian", "gl3d", "geo", "mapbox"], extras: [true, false], dflt: "gl3d+geo+mapbox", description: [ "Determines whether mouse wheel or two-finger scroll zooms is enable.", "Turned on by default for gl3d, geo and mapbox subplots", "(as these subplot types do not have zoombox via pan),", "but turned off by default for cartesian subplots.", "Set `scrollZoom` to *false* to disable scrolling for all subplots." ].join(" ") }, doubleClick: { valType: "enumerated", values: [false, "reset", "autosize", "reset+autosize"], dflt: "reset+autosize", description: [ "Sets the double click interaction mode.", "Has an effect only in cartesian plots.", "If *false*, double click is disable.", "If *reset*, double click resets the axis ranges to their initial values.", "If *autosize*, double click set the axis ranges to their autorange values.", "If *reset+autosize*, the odd double clicks resets the axis ranges", "to their initial values and even double clicks set the axis ranges", "to their autorange values." ].join(" ") }, doubleClickDelay: { valType: "number", dflt: 300, min: 0, description: [ "Sets the delay for registering a double-click in ms.", "This is the time interval (in ms) between first mousedown and", "2nd mouseup to constitute a double-click.", "This setting propagates to all on-subplot double clicks", "(except for geo and mapbox) and on-legend double clicks." ].join(" ") }, showAxisDragHandles: { valType: "boolean", dflt: true, description: [ "Set to *false* to omit cartesian axis pan/zoom drag handles." ].join(" ") }, showAxisRangeEntryBoxes: { valType: "boolean", dflt: true, description: [ "Set to *false* to omit direct range entry at the pan/zoom drag points,", "note that `showAxisDragHandles` must be enabled to have an effect." ].join(" ") }, showTips: { valType: "boolean", dflt: true, description: [ "Determines whether or not tips are shown while interacting", "with the resulting graphs." ].join(" ") }, showLink: { valType: "boolean", dflt: false, description: [ "Determines whether a link to Chart Studio Cloud is displayed", "at the bottom right corner of resulting graphs.", "Use with `sendData` and `linkText`." ].join(" ") }, linkText: { valType: "string", dflt: "Edit chart", noBlank: true, description: [ "Sets the text appearing in the `showLink` link." ].join(" ") }, sendData: { valType: "boolean", dflt: true, description: [ "If *showLink* is true, does it contain data", "just link to a Chart Studio Cloud file?" ].join(" ") }, showSources: { valType: "any", dflt: false, description: [ "Adds a source-displaying function to show sources on", "the resulting graphs." ].join(" ") }, displayModeBar: { valType: "enumerated", values: ["hover", true, false], dflt: "hover", description: [ "Determines the mode bar display mode.", "If *true*, the mode bar is always visible.", "If *false*, the mode bar is always hidden.", "If *hover*, the mode bar is visible while the mouse cursor", "is on the graph container." ].join(" ") }, showSendToCloud: { valType: "boolean", dflt: false, description: [ 'Should we include a ModeBar button, labeled "Edit in Chart Studio",', "that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server", "as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0", "this button was included by default, now it is opt-in using this flag.", "Note that this button can (depending on `plotlyServerURL` being set) send your data", "to an external server. However that server does not persist your data", 'until you arrive at the Chart Studio and explicitly click "Save".' ].join(" ") }, showEditInChartStudio: { valType: "boolean", dflt: false, description: [ "Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.", "Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,", "only `showEditInChartStudio` will be honored." ].join(" ") }, modeBarButtonsToRemove: { valType: "any", dflt: [], description: [ "Remove mode bar buttons by name.", "See ./components/modebar/buttons.js for the list of names." ].join(" ") }, modeBarButtonsToAdd: { valType: "any", dflt: [], description: [ "Add mode bar button using config objects", "See ./components/modebar/buttons.js for list of arguments.", "To enable predefined modebar buttons e.g. shape drawing, hover and spikelines,", "simply provide their string name(s). This could include:", "*v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*,", "*drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*.", "Please note that these predefined buttons will only be shown if they are compatible", "with all trace types used in a graph." ].join(" ") }, modeBarButtons: { valType: "any", dflt: false, description: [ "Define fully custom mode bar buttons as nested array,", "where the outer arrays represents button groups, and", "the inner arrays have buttons config objects or names of default buttons", "See ./components/modebar/buttons.js for more info." ].join(" ") }, toImageButtonOptions: { valType: "any", dflt: {}, description: [ "Statically override options for toImage modebar button", "allowed keys are format, filename, width, height, scale", "see ../components/modebar/buttons.js" ].join(" ") }, displaylogo: { valType: "boolean", dflt: true, description: [ "Determines whether or not the plotly logo is displayed", "on the end of the mode bar." ].join(" ") }, watermark: { valType: "boolean", dflt: false, description: "watermark the images with the company's logo" }, plotGlPixelRatio: { valType: "number", dflt: 2, min: 1, max: 4, description: [ "Set the pixel ratio during WebGL image export.", "This config option was formerly named `plot3dPixelRatio`", "which is now deprecated." ].join(" ") }, setBackground: { valType: "any", dflt: "transparent", description: [ "Set function to add the background color (i.e. `layout.paper_color`)", "to a different container.", "This function take the graph div as first argument and the current background", "color as second argument.", "Alternatively, set to string *opaque* to ensure there is white behind it." ].join(" ") }, topojsonURL: { valType: "string", noBlank: true, dflt: "https://cdn.plot.ly/", description: [ "Set the URL to topojson used in geo charts.", "By default, the topojson files are fetched from cdn.plot.ly.", "For example, set this option to:", "/dist/topojson/", "to render geographical feature using the topojson files", "that ship with the plotly.js module." ].join(" ") }, mapboxAccessToken: { valType: "string", dflt: null, description: [ "Mapbox access token (required to plot mapbox trace types)", "If using an Mapbox Atlas server, set this option to ''", "so that plotly.js won't attempt to authenticate to the public Mapbox server." ].join(" ") }, logging: { valType: "integer", min: 0, max: 2, dflt: 1, description: [ "Turn all console logging on or off (errors will be thrown)", "This should ONLY be set via Plotly.setPlotConfig", "Available levels:", "0: no logs", "1: warnings and errors, but not informational messages", "2: verbose logs" ].join(" ") }, notifyOnLogging: { valType: "integer", min: 0, max: 2, dflt: 0, description: [ "Set on-graph logging (notifier) level", "This should ONLY be set via Plotly.setPlotConfig", "Available levels:", "0: no on-graph logs", "1: warnings and errors, but not informational messages", "2: verbose logs" ].join(" ") }, queueLength: { valType: "integer", min: 0, dflt: 0, description: "Sets the length of the undo/redo queue." }, globalTransforms: { valType: "any", dflt: [], description: [ "Set global transform to be applied to all traces with no", "specification needed" ].join(" ") }, locale: { valType: "string", dflt: "en-US", description: [ "Which localization should we use?", "Should be a string like 'en' or 'en-US'." ].join(" ") }, locales: { valType: "any", dflt: {}, description: [ "Localization definitions", "Locales can be provided either here (specific to one chart) or globally", "by registering them as modules.", "Should be an object of objects {locale: {dictionary: {...}, format: {...}}}", "{", " da: {", " dictionary: {'Reset axes': 'Nulstil aksler', ...},", " format: {months: [...], shortMonths: [...]}", " },", " ...", "}", "All parts are optional. When looking for translation or format fields, we", "look first for an exact match in a config locale, then in a registered", "module. If those fail, we strip off any regionalization ('en-US' -> 'en')", "and try each (config, registry) again. The final fallback for translation", "is untranslated (which is US English) and for formats is the base English", "(the only consequence being the last fallback date format %x is DD/MM/YYYY", "instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored", "for our automatic number formatting, but can be used in custom formats." ].join(" ") } }; var eL = {}; function tL(e10, t) { for (var r in e10) { var n = e10[r]; n.valType ? t[r] = n.dflt : (t[r] || (t[r] = {}), tL(n, t[r])); } } tL(QC, eL); var Yu = { configAttributes: QC, dfltConfig: eL }; var Vm = lr; var BU = sr; var wf = []; var rL = function(e10, t) { if (wf.indexOf(e10) !== -1) return; wf.push(e10); var r = 1e3; BU(t) ? r = t : t === "long" && (r = 3e3); var n = Vm.select("body").selectAll(".plotly-notifier").data([0]); n.enter().append("div").classed("plotly-notifier", true); var a = n.selectAll(".notifier-note").data(wf); function i(o) { o.duration(700).style("opacity", 0).each("end", function(l) { var s = wf.indexOf(l); s !== -1 && wf.splice(s, 1), Vm.select(this).remove(); }); } a.enter().append("div").classed("notifier-note", true).style("opacity", 0).each(function(o) { var l = Vm.select(this); l.append("button").classed("notifier-close", true).html("×").on("click", function() { l.transition().call(i); }); for (var s = l.append("p"), u = o.split(//g), f = 0; f < u.length; f++) f && s.append("br"), s.append("span").text(u[f]); t === "stick" ? l.transition().duration(350).style("opacity", 1) : l.transition().duration(700).style("opacity", 1).transition().delay(r).call(i); }); }; var Eu = Yu.dfltConfig; var W1 = rL; var Z1 = JC.exports = {}; Z1.log = function() { var e10; if (Eu.logging > 1) { var t = ["LOG:"]; for (e10 = 0; e10 < arguments.length; e10++) t.push(arguments[e10]); console.trace.apply(console, t); } if (Eu.notifyOnLogging > 1) { var r = []; for (e10 = 0; e10 < arguments.length; e10++) r.push(arguments[e10]); W1(r.join("
"), "long"); } }; Z1.warn = function() { var e10; if (Eu.logging > 0) { var t = ["WARN:"]; for (e10 = 0; e10 < arguments.length; e10++) t.push(arguments[e10]); console.trace.apply(console, t); } if (Eu.notifyOnLogging > 0) { var r = []; for (e10 = 0; e10 < arguments.length; e10++) r.push(arguments[e10]); W1(r.join("
"), "stick"); } }; Z1.error = function() { var e10; if (Eu.logging > 0) { var t = ["ERROR:"]; for (e10 = 0; e10 < arguments.length; e10++) t.push(arguments[e10]); console.error.apply(console, t); } if (Eu.notifyOnLogging > 0) { var r = []; for (e10 = 0; e10 < arguments.length; e10++) r.push(arguments[e10]); W1(r.join("
"), "stick"); } }; var Xu = JC.exports; var Nt = {}; var Y1 = function() { }; var nL = function(t, r) { if (r instanceof RegExp) { for (var n = r.toString(), a = 0; a < t.length; a++) if (t[a] instanceof RegExp && t[a].toString() === n) return t; t.push(r); } else (r || r === 0) && t.indexOf(r) === -1 && t.push(r); return t; }; var cp = {}; var jU = UU; function UU() { var e10 = new Float32Array(16); return e10[0] = 1, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = 1, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = 1, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var GU = VU; function VU(e10) { var t = new Float32Array(16); return t[0] = e10[0], t[1] = e10[1], t[2] = e10[2], t[3] = e10[3], t[4] = e10[4], t[5] = e10[5], t[6] = e10[6], t[7] = e10[7], t[8] = e10[8], t[9] = e10[9], t[10] = e10[10], t[11] = e10[11], t[12] = e10[12], t[13] = e10[13], t[14] = e10[14], t[15] = e10[15], t; } var qU = WU; function WU(e10, t) { return e10[0] = t[0], e10[1] = t[1], e10[2] = t[2], e10[3] = t[3], e10[4] = t[4], e10[5] = t[5], e10[6] = t[6], e10[7] = t[7], e10[8] = t[8], e10[9] = t[9], e10[10] = t[10], e10[11] = t[11], e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15], e10; } var aL = ZU; function ZU(e10) { return e10[0] = 1, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = 1, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = 1, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var YU = XU; function XU(e10, t) { if (e10 === t) { var r = t[1], n = t[2], a = t[3], i = t[6], o = t[7], l = t[11]; e10[1] = t[4], e10[2] = t[8], e10[3] = t[12], e10[4] = r, e10[6] = t[9], e10[7] = t[13], e10[8] = n, e10[9] = i, e10[11] = t[14], e10[12] = a, e10[13] = o, e10[14] = l; } else e10[0] = t[0], e10[1] = t[4], e10[2] = t[8], e10[3] = t[12], e10[4] = t[1], e10[5] = t[5], e10[6] = t[9], e10[7] = t[13], e10[8] = t[2], e10[9] = t[6], e10[10] = t[10], e10[11] = t[14], e10[12] = t[3], e10[13] = t[7], e10[14] = t[11], e10[15] = t[15]; return e10; } var KU = JU; function JU(e10, t) { var r = t[0], n = t[1], a = t[2], i = t[3], o = t[4], l = t[5], s = t[6], u = t[7], f = t[8], d = t[9], h = t[10], p = t[11], v = t[12], m = t[13], g = t[14], y = t[15], w = r * l - n * o, k = r * s - a * o, x = r * u - i * o, _ = n * s - a * l, T = n * u - i * l, S = a * u - i * s, M = f * m - d * v, L = f * g - h * v, F = f * y - p * v, $ = d * g - h * m, I = d * y - p * m, O = h * y - p * g, G = w * O - k * I + x * $ + _ * F - T * L + S * M; return G ? (G = 1 / G, e10[0] = (l * O - s * I + u * $) * G, e10[1] = (a * I - n * O - i * $) * G, e10[2] = (m * S - g * T + y * _) * G, e10[3] = (h * T - d * S - p * _) * G, e10[4] = (s * F - o * O - u * L) * G, e10[5] = (r * O - a * F + i * L) * G, e10[6] = (g * x - v * S - y * k) * G, e10[7] = (f * S - h * x + p * k) * G, e10[8] = (o * I - l * F + u * M) * G, e10[9] = (n * F - r * I - i * M) * G, e10[10] = (v * T - m * x + y * w) * G, e10[11] = (d * x - f * T - p * w) * G, e10[12] = (l * L - o * $ - s * M) * G, e10[13] = (r * $ - n * L + a * M) * G, e10[14] = (m * k - v * _ - g * w) * G, e10[15] = (f * _ - d * k + h * w) * G, e10) : null; } var QU = eG; function eG(e10, t) { var r = t[0], n = t[1], a = t[2], i = t[3], o = t[4], l = t[5], s = t[6], u = t[7], f = t[8], d = t[9], h = t[10], p = t[11], v = t[12], m = t[13], g = t[14], y = t[15]; return e10[0] = l * (h * y - p * g) - d * (s * y - u * g) + m * (s * p - u * h), e10[1] = -(n * (h * y - p * g) - d * (a * y - i * g) + m * (a * p - i * h)), e10[2] = n * (s * y - u * g) - l * (a * y - i * g) + m * (a * u - i * s), e10[3] = -(n * (s * p - u * h) - l * (a * p - i * h) + d * (a * u - i * s)), e10[4] = -(o * (h * y - p * g) - f * (s * y - u * g) + v * (s * p - u * h)), e10[5] = r * (h * y - p * g) - f * (a * y - i * g) + v * (a * p - i * h), e10[6] = -(r * (s * y - u * g) - o * (a * y - i * g) + v * (a * u - i * s)), e10[7] = r * (s * p - u * h) - o * (a * p - i * h) + f * (a * u - i * s), e10[8] = o * (d * y - p * m) - f * (l * y - u * m) + v * (l * p - u * d), e10[9] = -(r * (d * y - p * m) - f * (n * y - i * m) + v * (n * p - i * d)), e10[10] = r * (l * y - u * m) - o * (n * y - i * m) + v * (n * u - i * l), e10[11] = -(r * (l * p - u * d) - o * (n * p - i * d) + f * (n * u - i * l)), e10[12] = -(o * (d * g - h * m) - f * (l * g - s * m) + v * (l * h - s * d)), e10[13] = r * (d * g - h * m) - f * (n * g - a * m) + v * (n * h - a * d), e10[14] = -(r * (l * g - s * m) - o * (n * g - a * m) + v * (n * s - a * l)), e10[15] = r * (l * h - s * d) - o * (n * h - a * d) + f * (n * s - a * l), e10; } var tG = rG; function rG(e10) { var t = e10[0], r = e10[1], n = e10[2], a = e10[3], i = e10[4], o = e10[5], l = e10[6], s = e10[7], u = e10[8], f = e10[9], d = e10[10], h = e10[11], p = e10[12], v = e10[13], m = e10[14], g = e10[15], y = t * o - r * i, w = t * l - n * i, k = t * s - a * i, x = r * l - n * o, _ = r * s - a * o, T = n * s - a * l, S = u * v - f * p, M = u * m - d * p, L = u * g - h * p, F = f * m - d * v, $ = f * g - h * v, I = d * g - h * m; return y * I - w * $ + k * F + x * L - _ * M + T * S; } var nG = aG; function aG(e10, t, r) { var n = t[0], a = t[1], i = t[2], o = t[3], l = t[4], s = t[5], u = t[6], f = t[7], d = t[8], h = t[9], p = t[10], v = t[11], m = t[12], g = t[13], y = t[14], w = t[15], k = r[0], x = r[1], _ = r[2], T = r[3]; return e10[0] = k * n + x * l + _ * d + T * m, e10[1] = k * a + x * s + _ * h + T * g, e10[2] = k * i + x * u + _ * p + T * y, e10[3] = k * o + x * f + _ * v + T * w, k = r[4], x = r[5], _ = r[6], T = r[7], e10[4] = k * n + x * l + _ * d + T * m, e10[5] = k * a + x * s + _ * h + T * g, e10[6] = k * i + x * u + _ * p + T * y, e10[7] = k * o + x * f + _ * v + T * w, k = r[8], x = r[9], _ = r[10], T = r[11], e10[8] = k * n + x * l + _ * d + T * m, e10[9] = k * a + x * s + _ * h + T * g, e10[10] = k * i + x * u + _ * p + T * y, e10[11] = k * o + x * f + _ * v + T * w, k = r[12], x = r[13], _ = r[14], T = r[15], e10[12] = k * n + x * l + _ * d + T * m, e10[13] = k * a + x * s + _ * h + T * g, e10[14] = k * i + x * u + _ * p + T * y, e10[15] = k * o + x * f + _ * v + T * w, e10; } var iG = oG; function oG(e10, t, r) { var n = r[0], a = r[1], i = r[2], o, l, s, u, f, d, h, p, v, m, g, y; return t === e10 ? (e10[12] = t[0] * n + t[4] * a + t[8] * i + t[12], e10[13] = t[1] * n + t[5] * a + t[9] * i + t[13], e10[14] = t[2] * n + t[6] * a + t[10] * i + t[14], e10[15] = t[3] * n + t[7] * a + t[11] * i + t[15]) : (o = t[0], l = t[1], s = t[2], u = t[3], f = t[4], d = t[5], h = t[6], p = t[7], v = t[8], m = t[9], g = t[10], y = t[11], e10[0] = o, e10[1] = l, e10[2] = s, e10[3] = u, e10[4] = f, e10[5] = d, e10[6] = h, e10[7] = p, e10[8] = v, e10[9] = m, e10[10] = g, e10[11] = y, e10[12] = o * n + f * a + v * i + t[12], e10[13] = l * n + d * a + m * i + t[13], e10[14] = s * n + h * a + g * i + t[14], e10[15] = u * n + p * a + y * i + t[15]), e10; } var lG = sG; function sG(e10, t, r) { var n = r[0], a = r[1], i = r[2]; return e10[0] = t[0] * n, e10[1] = t[1] * n, e10[2] = t[2] * n, e10[3] = t[3] * n, e10[4] = t[4] * a, e10[5] = t[5] * a, e10[6] = t[6] * a, e10[7] = t[7] * a, e10[8] = t[8] * i, e10[9] = t[9] * i, e10[10] = t[10] * i, e10[11] = t[11] * i, e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15], e10; } var uG = fG; function fG(e10, t, r, n) { var a = n[0], i = n[1], o = n[2], l = Math.sqrt(a * a + i * i + o * o), s, u, f, d, h, p, v, m, g, y, w, k, x, _, T, S, M, L, F, $, I, O, G, K; return Math.abs(l) < 1e-6 ? null : (l = 1 / l, a *= l, i *= l, o *= l, s = Math.sin(r), u = Math.cos(r), f = 1 - u, d = t[0], h = t[1], p = t[2], v = t[3], m = t[4], g = t[5], y = t[6], w = t[7], k = t[8], x = t[9], _ = t[10], T = t[11], S = a * a * f + u, M = i * a * f + o * s, L = o * a * f - i * s, F = a * i * f - o * s, $ = i * i * f + u, I = o * i * f + a * s, O = a * o * f + i * s, G = i * o * f - a * s, K = o * o * f + u, e10[0] = d * S + m * M + k * L, e10[1] = h * S + g * M + x * L, e10[2] = p * S + y * M + _ * L, e10[3] = v * S + w * M + T * L, e10[4] = d * F + m * $ + k * I, e10[5] = h * F + g * $ + x * I, e10[6] = p * F + y * $ + _ * I, e10[7] = v * F + w * $ + T * I, e10[8] = d * O + m * G + k * K, e10[9] = h * O + g * G + x * K, e10[10] = p * O + y * G + _ * K, e10[11] = v * O + w * G + T * K, t !== e10 && (e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15]), e10); } var cG = dG; function dG(e10, t, r) { var n = Math.sin(r), a = Math.cos(r), i = t[4], o = t[5], l = t[6], s = t[7], u = t[8], f = t[9], d = t[10], h = t[11]; return t !== e10 && (e10[0] = t[0], e10[1] = t[1], e10[2] = t[2], e10[3] = t[3], e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15]), e10[4] = i * a + u * n, e10[5] = o * a + f * n, e10[6] = l * a + d * n, e10[7] = s * a + h * n, e10[8] = u * a - i * n, e10[9] = f * a - o * n, e10[10] = d * a - l * n, e10[11] = h * a - s * n, e10; } var hG = vG; function vG(e10, t, r) { var n = Math.sin(r), a = Math.cos(r), i = t[0], o = t[1], l = t[2], s = t[3], u = t[8], f = t[9], d = t[10], h = t[11]; return t !== e10 && (e10[4] = t[4], e10[5] = t[5], e10[6] = t[6], e10[7] = t[7], e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15]), e10[0] = i * a - u * n, e10[1] = o * a - f * n, e10[2] = l * a - d * n, e10[3] = s * a - h * n, e10[8] = i * n + u * a, e10[9] = o * n + f * a, e10[10] = l * n + d * a, e10[11] = s * n + h * a, e10; } var pG = mG; function mG(e10, t, r) { var n = Math.sin(r), a = Math.cos(r), i = t[0], o = t[1], l = t[2], s = t[3], u = t[4], f = t[5], d = t[6], h = t[7]; return t !== e10 && (e10[8] = t[8], e10[9] = t[9], e10[10] = t[10], e10[11] = t[11], e10[12] = t[12], e10[13] = t[13], e10[14] = t[14], e10[15] = t[15]), e10[0] = i * a + u * n, e10[1] = o * a + f * n, e10[2] = l * a + d * n, e10[3] = s * a + h * n, e10[4] = u * a - i * n, e10[5] = f * a - o * n, e10[6] = d * a - l * n, e10[7] = h * a - s * n, e10; } var gG = yG; function yG(e10, t, r) { var n, a, i, o = r[0], l = r[1], s = r[2], u = Math.sqrt(o * o + l * l + s * s); return Math.abs(u) < 1e-6 ? null : (u = 1 / u, o *= u, l *= u, s *= u, n = Math.sin(t), a = Math.cos(t), i = 1 - a, e10[0] = o * o * i + a, e10[1] = l * o * i + s * n, e10[2] = s * o * i - l * n, e10[3] = 0, e10[4] = o * l * i - s * n, e10[5] = l * l * i + a, e10[6] = s * l * i + o * n, e10[7] = 0, e10[8] = o * s * i + l * n, e10[9] = l * s * i - o * n, e10[10] = s * s * i + a, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10); } var bG = _G; function _G(e10, t, r) { var n = t[0], a = t[1], i = t[2], o = t[3], l = n + n, s = a + a, u = i + i, f = n * l, d = n * s, h = n * u, p = a * s, v = a * u, m = i * u, g = o * l, y = o * s, w = o * u; return e10[0] = 1 - (p + m), e10[1] = d + w, e10[2] = h - y, e10[3] = 0, e10[4] = d - w, e10[5] = 1 - (f + m), e10[6] = v + g, e10[7] = 0, e10[8] = h + y, e10[9] = v - g, e10[10] = 1 - (f + p), e10[11] = 0, e10[12] = r[0], e10[13] = r[1], e10[14] = r[2], e10[15] = 1, e10; } var xG = wG; function wG(e10, t) { return e10[0] = t[0], e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = t[1], e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = t[2], e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var TG = kG; function kG(e10, t) { return e10[0] = 1, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = 1, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = 1, e10[11] = 0, e10[12] = t[0], e10[13] = t[1], e10[14] = t[2], e10[15] = 1, e10; } var AG = MG; function MG(e10, t) { var r = Math.sin(t), n = Math.cos(t); return e10[0] = 1, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = n, e10[6] = r, e10[7] = 0, e10[8] = 0, e10[9] = -r, e10[10] = n, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var SG = CG; function CG(e10, t) { var r = Math.sin(t), n = Math.cos(t); return e10[0] = n, e10[1] = 0, e10[2] = -r, e10[3] = 0, e10[4] = 0, e10[5] = 1, e10[6] = 0, e10[7] = 0, e10[8] = r, e10[9] = 0, e10[10] = n, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var LG = DG; function DG(e10, t) { var r = Math.sin(t), n = Math.cos(t); return e10[0] = n, e10[1] = r, e10[2] = 0, e10[3] = 0, e10[4] = -r, e10[5] = n, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = 1, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var iL = EG; function EG(e10, t) { var r = t[0], n = t[1], a = t[2], i = t[3], o = r + r, l = n + n, s = a + a, u = r * o, f = n * o, d = n * l, h = a * o, p = a * l, v = a * s, m = i * o, g = i * l, y = i * s; return e10[0] = 1 - d - v, e10[1] = f + y, e10[2] = h - g, e10[3] = 0, e10[4] = f - y, e10[5] = 1 - u - v, e10[6] = p + m, e10[7] = 0, e10[8] = h + g, e10[9] = p - m, e10[10] = 1 - u - d, e10[11] = 0, e10[12] = 0, e10[13] = 0, e10[14] = 0, e10[15] = 1, e10; } var FG = RG; function RG(e10, t, r, n, a, i, o) { var l = 1 / (r - t), s = 1 / (a - n), u = 1 / (i - o); return e10[0] = i * 2 * l, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = i * 2 * s, e10[6] = 0, e10[7] = 0, e10[8] = (r + t) * l, e10[9] = (a + n) * s, e10[10] = (o + i) * u, e10[11] = -1, e10[12] = 0, e10[13] = 0, e10[14] = o * i * 2 * u, e10[15] = 0, e10; } var PG = $G; function $G(e10, t, r, n, a) { var i = 1 / Math.tan(t / 2), o = 1 / (n - a); return e10[0] = i / r, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = i, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = (a + n) * o, e10[11] = -1, e10[12] = 0, e10[13] = 0, e10[14] = 2 * a * n * o, e10[15] = 0, e10; } var zG = IG; function IG(e10, t, r, n) { var a = Math.tan(t.upDegrees * Math.PI / 180), i = Math.tan(t.downDegrees * Math.PI / 180), o = Math.tan(t.leftDegrees * Math.PI / 180), l = Math.tan(t.rightDegrees * Math.PI / 180), s = 2 / (o + l), u = 2 / (a + i); return e10[0] = s, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = u, e10[6] = 0, e10[7] = 0, e10[8] = -((o - l) * s * 0.5), e10[9] = (a - i) * u * 0.5, e10[10] = n / (r - n), e10[11] = -1, e10[12] = 0, e10[13] = 0, e10[14] = n * r / (r - n), e10[15] = 0, e10; } var NG = OG; function OG(e10, t, r, n, a, i, o) { var l = 1 / (t - r), s = 1 / (n - a), u = 1 / (i - o); return e10[0] = -2 * l, e10[1] = 0, e10[2] = 0, e10[3] = 0, e10[4] = 0, e10[5] = -2 * s, e10[6] = 0, e10[7] = 0, e10[8] = 0, e10[9] = 0, e10[10] = 2 * u, e10[11] = 0, e10[12] = (t + r) * l, e10[13] = (a + n) * s, e10[14] = (o + i) * u, e10[15] = 1, e10; } var HG = aL; var BG = jG; function jG(e10, t, r, n) { var a, i, o, l, s, u, f, d, h, p, v = t[0], m = t[1], g = t[2], y = n[0], w = n[1], k = n[2], x = r[0], _ = r[1], T = r[2]; return Math.abs(v - x) < 1e-6 && Math.abs(m - _) < 1e-6 && Math.abs(g - T) < 1e-6 ? HG(e10) : (f = v - x, d = m - _, h = g - T, p = 1 / Math.sqrt(f * f + d * d + h * h), f *= p, d *= p, h *= p, a = w * h - k * d, i = k * f - y * h, o = y * d - w * f, p = Math.sqrt(a * a + i * i + o * o), p ? (p = 1 / p, a *= p, i *= p, o *= p) : (a = 0, i = 0, o = 0), l = d * o - h * i, s = h * a - f * o, u = f * i - d * a, p = Math.sqrt(l * l + s * s + u * u), p ? (p = 1 / p, l *= p, s *= p, u *= p) : (l = 0, s = 0, u = 0), e10[0] = a, e10[1] = l, e10[2] = f, e10[3] = 0, e10[4] = i, e10[5] = s, e10[6] = d, e10[7] = 0, e10[8] = o, e10[9] = u, e10[10] = h, e10[11] = 0, e10[12] = -(a * v + i * m + o * g), e10[13] = -(l * v + s * m + u * g), e10[14] = -(f * v + d * m + h * g), e10[15] = 1, e10); } var UG = GG; function GG(e10) { return "mat4(" + e10[0] + ", " + e10[1] + ", " + e10[2] + ", " + e10[3] + ", " + e10[4] + ", " + e10[5] + ", " + e10[6] + ", " + e10[7] + ", " + e10[8] + ", " + e10[9] + ", " + e10[10] + ", " + e10[11] + ", " + e10[12] + ", " + e10[13] + ", " + e10[14] + ", " + e10[15] + ")"; } var oL = { create: jU, clone: GU, copy: qU, identity: aL, transpose: YU, invert: KU, adjoint: QU, determinant: tG, multiply: nG, translate: iG, scale: lG, rotate: uG, rotateX: cG, rotateY: hG, rotateZ: pG, fromRotation: gG, fromRotationTranslation: bG, fromScaling: xG, fromTranslation: TG, fromXRotation: AG, fromYRotation: SG, fromZRotation: LG, fromQuat: iL, frustum: FG, perspective: PG, perspectiveFromFieldOfView: zG, ortho: NG, lookAt: BG, str: UG }; (function(e10) { var t = oL; e10.init2dArray = function(r, n) { for (var a = new Array(r), i = 0; i < r; i++) a[i] = new Array(n); return a; }, e10.transposeRagged = function(r) { var n = 0, a = r.length, i, o; for (i = 0; i < a; i++) n = Math.max(n, r[i].length); var l = new Array(n); for (i = 0; i < n; i++) for (l[i] = new Array(a), o = 0; o < a; o++) l[i][o] = r[o][i]; return l; }, e10.dot = function(r, n) { if (!(r.length && n.length) || r.length !== n.length) return null; var a = r.length, i, o; if (r[0].length) for (i = new Array(a), o = 0; o < a; o++) i[o] = e10.dot(r[o], n); else if (n[0].length) { var l = e10.transposeRagged(n); for (i = new Array(l.length), o = 0; o < l.length; o++) i[o] = e10.dot(r, l[o]); } else for (i = 0, o = 0; o < a; o++) i += r[o] * n[o]; return i; }, e10.translationMatrix = function(r, n) { return [[1, 0, r], [0, 1, n], [0, 0, 1]]; }, e10.rotationMatrix = function(r) { var n = r * Math.PI / 180; return [ [Math.cos(n), -Math.sin(n), 0], [Math.sin(n), Math.cos(n), 0], [0, 0, 1] ]; }, e10.rotationXYMatrix = function(r, n, a) { return e10.dot( e10.dot( e10.translationMatrix(n, a), e10.rotationMatrix(r) ), e10.translationMatrix(-n, -a) ); }, e10.apply3DTransform = function(r) { return function() { var n = arguments, a = arguments.length === 1 ? n[0] : [n[0], n[1], n[2] || 0]; return e10.dot(r, [a[0], a[1], a[2], 1]).slice(0, 3); }; }, e10.apply2DTransform = function(r) { return function() { var n = arguments; n.length === 3 && (n = n[0]); var a = arguments.length === 1 ? n[0] : [n[0], n[1]]; return e10.dot(r, [a[0], a[1], 1]).slice(0, 2); }; }, e10.apply2DTransform2 = function(r) { var n = e10.apply2DTransform(r); return function(a) { return n(a.slice(0, 2)).concat(n(a.slice(2, 4))); }; }, e10.convertCssMatrix = function(r) { if (r) { var n = r.length; if (n === 16) return r; if (n === 6) return [ r[0], r[1], 0, 0, r[2], r[3], 0, 0, 0, 0, 1, 0, r[4], r[5], 0, 1 ]; } return [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; }, e10.inverseTransformMatrix = function(r) { var n = []; return t.invert(n, r), [ [n[0], n[1], n[2], n[3]], [n[4], n[5], n[6], n[7]], [n[8], n[9], n[10], n[11]], [n[12], n[13], n[14], n[15]] ]; }; })(cp); var VG = lr; var qG = Xu; var WG = cp; var ZG = oL; function YG(e10) { var t; if (typeof e10 == "string") { if (t = document.getElementById(e10), t === null) throw new Error("No DOM element with id '" + e10 + "' exists on the page."); return t; } else if (e10 == null) throw new Error("DOM element provided is null or undefined"); return e10; } function XG(e10) { var t = VG.select(e10); return t.node() instanceof HTMLElement && t.size() && t.classed("js-plotly-plot"); } function lL(e10) { var t = e10 && e10.parentNode; t && t.removeChild(e10); } function KG(e10, t) { sL("global", e10, t); } function sL(e10, t, r) { var n = "plotly.js-style-" + e10, a = document.getElementById(n); a || (a = document.createElement("style"), a.setAttribute("id", n), a.appendChild(document.createTextNode("")), document.head.appendChild(a)); var i = a.sheet; i.insertRule ? i.insertRule(t + "{" + r + "}", 0) : i.addRule ? i.addRule(t, r, 0) : qG.warn("addStyleRule failed"); } function JG(e10) { var t = "plotly.js-style-" + e10, r = document.getElementById(t); r && lL(r); } function QG(e10) { var t = fL(e10), r = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; return t.forEach(function(n) { var a = uL(n); if (a) { var i = WG.convertCssMatrix(a); r = ZG.multiply(r, r, i); } }), r; } function uL(e10) { var t = window.getComputedStyle(e10, null), r = t.getPropertyValue("-webkit-transform") || t.getPropertyValue("-moz-transform") || t.getPropertyValue("-ms-transform") || t.getPropertyValue("-o-transform") || t.getPropertyValue("transform"); return r === "none" ? null : r.replace("matrix", "").replace("3d", "").slice(1, -1).split(",").map(function(n) { return +n; }); } function fL(e10) { for (var t = []; eV(e10); ) t.push(e10), e10 = e10.parentNode; return t; } function eV(e10) { return e10 && (e10 instanceof Element || e10 instanceof HTMLElement); } function tV(e10, t) { return e10 && t && e10.top === t.top && e10.left === t.left && e10.right === t.right && e10.bottom === t.bottom; } var dp = { getGraphDiv: YG, isPlotDiv: XG, removeElement: lL, addStyleRule: KG, addRelatedStyleRule: sL, deleteRelatedStyleRule: JG, getFullTransformMatrix: QG, getElementTransformMatrix: uL, getElementAndAncestors: fL, equalDomRects: tV }; var hp = { mode: { valType: "enumerated", dflt: "afterall", values: ["immediate", "next", "afterall"], description: [ "Describes how a new animate call interacts with currently-running", "animations. If `immediate`, current animations are interrupted and", "the new animation is started. If `next`, the current frame is allowed", "to complete, after which the new animation is started. If `afterall`", "all existing frames are animated to completion before the new animation", "is started." ].join(" ") }, direction: { valType: "enumerated", values: ["forward", "reverse"], dflt: "forward", description: [ "The direction in which to play the frames triggered by the animation call" ].join(" ") }, fromcurrent: { valType: "boolean", dflt: false, description: [ "Play frames starting at the current frame instead of the beginning." ].join(" ") }, frame: { duration: { valType: "number", min: 0, dflt: 500, description: [ "The duration in milliseconds of each frame. If greater than the frame", "duration, it will be limited to the frame duration." ].join(" ") }, redraw: { valType: "boolean", dflt: true, description: [ "Redraw the plot at completion of the transition. This is desirable", "for transitions that include properties that cannot be transitioned,", "but may significantly slow down updates that do not require a full", "redraw of the plot" ].join(" ") } }, transition: { duration: { valType: "number", min: 0, dflt: 500, editType: "none", description: [ "The duration of the transition, in milliseconds. If equal to zero,", "updates are synchronous." ].join(" ") }, easing: { valType: "enumerated", dflt: "cubic-in-out", values: [ "linear", "quad", "cubic", "sin", "exp", "circle", "elastic", "back", "bounce", "linear-in", "quad-in", "cubic-in", "sin-in", "exp-in", "circle-in", "elastic-in", "back-in", "bounce-in", "linear-out", "quad-out", "cubic-out", "sin-out", "exp-out", "circle-out", "elastic-out", "back-out", "bounce-out", "linear-in-out", "quad-in-out", "cubic-in-out", "sin-in-out", "exp-in-out", "circle-in-out", "elastic-in-out", "back-in-out", "bounce-in-out" ], editType: "none", description: "The easing function used for the transition" }, ordering: { valType: "enumerated", values: ["layout first", "traces first"], dflt: "layout first", editType: "none", description: [ "Determines whether the figure's layout or traces smoothly transitions", "during updates that make both traces and layout change." ].join(" ") } } }; var cL = en.extendFlat; var rV = ms; var dL = { valType: "flaglist", extras: ["none"], flags: ["calc", "clearAxisTypes", "plot", "style", "markerSize", "colorbars"], description: [ "trace attributes should include an `editType` string matching this flaglist.", "*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`", "to force it to be regenerated", "*clearAxisTypes* resets the types of the axes this trace is on, because new data could", "cause the automatic axis type detection to change. Log type will not be cleared, as that", "is never automatically chosen so must have been user-specified.", "*plot* (re)plots but without first clearing `gd.calcdata`.", "*style* only calls `module.style` (or module.editStyle) for all trace modules and redraws the legend.", "*markerSize* is like *style*, but propagate axis-range changes due to scatter `marker.size`", "*colorbars* only redraws colorbars." ].join(" ") }; var hL = { valType: "flaglist", extras: ["none"], flags: [ "calc", "plot", "legend", "ticks", "axrange", "layoutstyle", "modebar", "camera", "arraydraw", "colorbars" ], description: [ "layout attributes should include an `editType` string matching this flaglist.", "*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`", "to force it to be regenerated", "*plot* (re)plots but without first clearing `gd.calcdata`.", "*legend* only redraws the legend.", "*ticks* only redraws axis ticks, labels, and gridlines.", "*axrange* minimal sequence when updating axis ranges.", "*layoutstyle* reapplies global and SVG cartesian axis styles.", "*modebar* just updates the modebar.", "*camera* just updates the camera settings for gl3d scenes.", "*arraydraw* allows component arrays to invoke the redraw routines just for the", "component(s) that changed.", "*colorbars* only redraws colorbars." ].join(" ") }; var nV = dL.flags.slice().concat(["fullReplot"]); var aV = hL.flags.slice().concat("layoutReplot"); var Lo = { traces: dL, layout: hL, /* * default (all false) edit flags for restyle (traces) * creates a new object each call, so the caller can mutate freely */ traceFlags: function() { return x2(nV); }, /* * default (all false) edit flags for relayout * creates a new object each call, so the caller can mutate freely */ layoutFlags: function() { return x2(aV); }, /* * update `flags` with the `editType` values found in `attr` */ update: function(e10, t) { var r = t.editType; if (r && r !== "none") for (var n = r.split("+"), a = 0; a < n.length; a++) e10[n[a]] = true; }, overrideAll: vL }; function x2(e10) { for (var t = {}, r = 0; r < e10.length; r++) t[e10[r]] = false; return t; } function vL(e10, t, r) { var n = cL({}, e10); for (var a in n) { var i = n[a]; rV(i) && (n[a] = pL(i, t, r, a)); } return r === "from-root" && (n.editType = t), n; } function pL(e10, t, r, n) { if (e10.valType) { var a = cL({}, e10); if (a.editType = t, Array.isArray(e10.items)) { a.items = new Array(e10.items.length); for (var i = 0; i < e10.items.length; i++) a.items[i] = pL(e10.items[i], t); } return a; } else return vL( e10, t, n.charAt(0) === "_" ? "nested" : "from-root" ); } var Zi = {}; Zi.dash = { valType: "string", // string type usually doesn't take values... this one should really be // a special type or at least a special coercion function, from the GUI // you only get these values but elsewhere the user can supply a list of // dash lengths in px, and it will be honored values: ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"], dflt: "solid", editType: "style", description: [ "Sets the dash style of lines. Set to a dash type string", "(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)", "or a dash length list in px (eg *5px,10px,2px,2px*)." ].join(" ") }; Zi.pattern = { shape: { valType: "enumerated", values: ["", "/", "\\", "x", "-", "|", "+", "."], dflt: "", arrayOk: true, editType: "style", description: [ "Sets the shape of the pattern fill.", "By default, no pattern is used for filling the area." ].join(" ") }, fillmode: { valType: "enumerated", values: ["replace", "overlay"], dflt: "replace", editType: "style", description: [ "Determines whether `marker.color` should be used", "as a default to `bgcolor` or a `fgcolor`." ].join(" ") }, bgcolor: { valType: "color", arrayOk: true, editType: "style", description: [ "When there is no colorscale sets the color of background pattern fill.", "Defaults to a `marker.color` background when `fillmode` is *overlay*.", "Otherwise, defaults to a transparent background." ].join(" ") }, fgcolor: { valType: "color", arrayOk: true, editType: "style", description: [ "When there is no colorscale sets the color of foreground pattern fill.", "Defaults to a `marker.color` background when `fillmode` is *replace*.", "Otherwise, defaults to dark grey or white", "to increase contrast with the `bgcolor`." ].join(" ") }, fgopacity: { valType: "number", editType: "style", min: 0, max: 1, description: [ "Sets the opacity of the foreground pattern fill.", "Defaults to a 0.5 when `fillmode` is *overlay*.", "Otherwise, defaults to 1." ].join(" ") }, size: { valType: "number", min: 0, dflt: 8, arrayOk: true, editType: "style", description: [ "Sets the size of unit squares of the pattern fill in pixels,", "which corresponds to the interval of repetition of the pattern." ].join(" ") }, solidity: { valType: "number", min: 0, max: 1, dflt: 0.3, arrayOk: true, editType: "style", description: [ "Sets the solidity of the pattern fill.", "Solidity is roughly the fraction of the area filled by the pattern.", "Solidity of 0 shows only the background color without pattern", "and solidty of 1 shows only the foreground color without pattern." ].join(" ") }, editType: "style", description: [ "Sets the pattern within the marker." ].join(" ") }; var _i = {}; var mL = { FORMAT_LINK: "https://github.com/d3/d3-format/tree/v1.4.5#d3-format", DATE_FORMAT_LINK: "https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format" }; var gL = mL; var yL = gL.FORMAT_LINK; var bL = gL.DATE_FORMAT_LINK; function _L(e10) { var t = e10 && e10.supportOther; return [ "Variables are inserted using %{variable},", 'for example "y: %{y}"' + (t ? " as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown." : "."), `Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`, yL, "for details on the formatting syntax.", `Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`, bL, "for details on the date formatting syntax." ].join(" "); } function iV() { return [ "Variables are inserted using %{variable},", 'for example "x0: %{x0}".', `Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{x0:$.2f}". See`, yL, "for details on the formatting syntax.", `Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{x0|%m %b %Y}". See`, bL, "for details on the date formatting syntax.", "A single multiplication or division operation may be applied to numeric variables, and combined with", 'd3 number formatting, for example "Length in cm: %{x0*2.54}", "%{slope*60:.1f} meters per second."', "For log axes, variable values are given in log units.", "For date axes, x/y coordinate variables and center variables use datetimes, while all other variable values use values in ms." ].join(" "); } function X1(e10) { var t = e10.description ? " " + e10.description : "", r = e10.keys || []; if (r.length > 0) { for (var n = [], a = 0; a < r.length; a++) n[a] = "`" + r[a] + "`"; t = t + "Finally, the template string has access to ", r.length === 1 ? t = t + "variable " + n[0] : t = t + "variables " + n.slice(0, -1).join(", ") + " and " + n.slice(-1) + "."; } return t; } _i.hovertemplateAttrs = function(e10, t) { e10 = e10 || {}, t = t || {}; var r = X1(t), n = { valType: "string", dflt: "", editType: e10.editType || "none", description: [ "Template string used for rendering the information that appear on hover box.", "Note that this will override `hoverinfo`.", _L({ supportOther: true }), "The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.", "Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.", r, 'Anything contained in tag `` is displayed in the secondary box, for example "{fullData.name}".', "To hide the secondary box completely, use an empty tag ``." ].join(" ") }; return e10.arrayOk !== false && (n.arrayOk = true), n; }; _i.texttemplateAttrs = function(e10, t) { e10 = e10 || {}, t = t || {}; var r = X1(t), n = { valType: "string", dflt: "", editType: e10.editType || "calc", description: [ "Template string used for rendering the information text that appear on points.", "Note that this will override `textinfo`.", _L(), "Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.", r ].join(" ") }; return e10.arrayOk !== false && (n.arrayOk = true), n; }; _i.shapeTexttemplateAttrs = function(e10, t) { e10 = e10 || {}, t = t || {}; var r = e10.newshape ? "new " : "", n = X1(t), a = { valType: "string", dflt: "", editType: e10.editType || "arraydraw", description: [ "Template string used for rendering the " + r + "shape's label.", "Note that this will override `text`.", iV(), n ].join(" ") }; return a; }; function fl(e10, t) { return t ? t.d2l(e10) : e10; } function xL(e10, t) { return t ? t.l2d(e10) : e10; } function oV(e10) { return e10.x0; } function lV(e10) { return e10.x1; } function sV(e10) { return e10.y0; } function uV(e10) { return e10.y1; } function vp(e10, t) { return fl(e10.x1, t) - fl(e10.x0, t); } function pp(e10, t, r) { return fl(e10.y1, r) - fl(e10.y0, r); } function fV(e10, t) { return Math.abs(vp(e10, t)); } function cV(e10, t, r) { return Math.abs(pp(e10, t, r)); } function dV(e10, t, r) { return e10.type !== "line" ? void 0 : Math.sqrt( Math.pow(vp(e10, t), 2) + Math.pow(pp(e10, t, r), 2) ); } function hV(e10, t) { return xL((fl(e10.x1, t) + fl(e10.x0, t)) / 2, t); } function vV(e10, t, r) { return xL((fl(e10.y1, r) + fl(e10.y0, r)) / 2, r); } function pV(e10, t, r) { return e10.type !== "line" ? void 0 : pp(e10, t, r) / vp(e10, t); } var K1 = { x0: oV, x1: lV, y0: sV, y1: uV, slope: pV, dx: vp, dy: pp, width: fV, height: cV, length: dV, xcenter: hV, ycenter: vV }; var mV = Lo.overrideAll; var Dl = Wi; var w2 = Fn; var gV = Zi.dash; var zo = en.extendFlat; var yV = _i.shapeTexttemplateAttrs; var bV = K1; var _V = mV({ newshape: { visible: zo({}, Dl.visible, { description: [ "Determines whether or not new shape is visible.", "If *legendonly*, the shape is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }), showlegend: { valType: "boolean", dflt: false, description: [ "Determines whether or not new", "shape is shown in the legend." ].join(" ") }, legend: zo({}, Dl.legend, { description: [ "Sets the reference to a legend to show new shape in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }), legendgroup: zo({}, Dl.legendgroup, { description: [ "Sets the legend group for new shape.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }), legendgrouptitle: { text: zo({}, Dl.legendgrouptitle.text, {}), font: w2({ description: [ "Sets this legend group's title font." ].join(" ") }) }, legendrank: zo({}, Dl.legendrank, { description: [ "Sets the legend rank for new shape.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items." ].join(" ") }), legendwidth: zo({}, Dl.legendwidth, { description: "Sets the width (in px or fraction) of the legend for new shape." }), line: { color: { valType: "color", description: [ "Sets the line color.", "By default uses either dark grey or white", "to increase contrast with background color." ].join(" ") }, width: { valType: "number", min: 0, dflt: 4, description: "Sets the line width (in px)." }, dash: zo({}, gV, { dflt: "solid" }) }, fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", description: [ "Sets the color filling new shapes' interior.", "Please note that if using a fillcolor with alpha greater than half,", "drag inside the active shape starts moving the shape underneath,", "otherwise a new shape could be started over." ].join(" ") }, fillrule: { valType: "enumerated", values: ["evenodd", "nonzero"], dflt: "evenodd", description: [ "Determines the path's interior.", "For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule" ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, description: "Sets the opacity of new shapes." }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", description: "Specifies whether new shapes are drawn below or above traces." }, drawdirection: { valType: "enumerated", values: ["ortho", "horizontal", "vertical", "diagonal"], dflt: "diagonal", description: [ "When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*", "this limits the drag to be horizontal, vertical or diagonal.", "Using *diagonal* there is no limit e.g. in drawing lines in any direction.", "*ortho* limits the draw to be either horizontal or vertical.", "*horizontal* allows horizontal extend.", "*vertical* allows vertical extend." ].join(" ") }, name: zo({}, Dl.name, { description: [ "Sets new shape name.", "The name appears as the legend item." ].join(" ") }), label: { text: { valType: "string", dflt: "", description: [ "Sets the text to display with the new shape.", "It is also used for legend item if `name` is not provided." ].join(" ") }, texttemplate: yV({ newshape: true }, { keys: Object.keys(bV) }), font: w2({ description: "Sets the new shape label text font." }), textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end" ], description: [ "Sets the position of the label text relative to the new shape.", "Supported values for rectangles, circles and paths are", "*top left*, *top center*, *top right*, *middle left*,", "*middle center*, *middle right*, *bottom left*, *bottom center*,", "and *bottom right*.", "Supported values for lines are *start*, *middle*, and *end*.", "Default: *middle center* for rectangles, circles, and paths; *middle* for lines." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", description: [ "Sets the angle at which the label text is drawn", "with respect to the horizontal. For lines, angle *auto*", "is the same angle as the line. For all other shapes,", "angle *auto* is horizontal." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", description: [ "Sets the label's horizontal position anchor", "This anchor binds the specified `textposition` to the *left*, *center*", "or *right* of the label text.", "For example, if `textposition` is set to *top right* and", "`xanchor` to *right* then the right-most portion of the", "label text lines up with the right-most edge of the", "new shape." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], description: [ "Sets the label's vertical position anchor", "This anchor binds the specified `textposition` to the *top*, *middle*", "or *bottom* of the label text.", "For example, if `textposition` is set to *top right* and", "`yanchor` to *top* then the top-most portion of the", "label text lines up with the top-most edge of the", "new shape." ].join(" ") }, padding: { valType: "number", dflt: 3, min: 0, description: "Sets padding (in px) between edge of label and edge of new shape." } } }, activeshape: { fillcolor: { valType: "color", dflt: "rgb(255,0,255)", description: "Sets the color filling the active shape' interior." }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.5, description: "Sets the opacity of the active shape." } } }, "none", "from-root"); var xV = Zi.dash; var wV = en.extendFlat; var TV = { newselection: { mode: { valType: "enumerated", values: ["immediate", "gradual"], dflt: "immediate", editType: "none", description: [ "Describes how a new selection is created.", "If `immediate`, a new selection is created after first mouse up.", "If `gradual`, a new selection is not created after first mouse.", "By adding to and subtracting from the initial selection,", "this option allows declaring extra outlines of the selection." ].join(" ") }, line: { color: { valType: "color", editType: "none", description: [ "Sets the line color.", "By default uses either dark grey or white", "to increase contrast with background color." ].join(" ") }, width: { valType: "number", min: 1, dflt: 1, editType: "none", description: "Sets the line width (in px)." }, dash: wV({}, xV, { dflt: "dot", editType: "none" }), editType: "none" }, // no drawdirection here noting that layout.selectdirection is used instead. editType: "none" }, activeselection: { fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "none", description: "Sets the color filling the active selection' interior." }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.5, editType: "none", description: "Sets the opacity of the active selection." }, editType: "none" } }; var J1 = function(e10) { var t = e10.editType; return { t: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) along the top of the component." }, r: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) on the right side of the component." }, b: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) along the bottom of the component." }, l: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) on the left side of the component." }, editType: t }; }; var ly = Fn; var kV = hp; var Fh = da; var T2 = _V; var k2 = TV; var AV = J1; var A2 = en.extendFlat; var mp = ly({ editType: "calc", description: [ "Sets the global font.", "Note that fonts used in traces and other", "layout components inherit from the global font." ].join(" ") }); mp.family.dflt = '"Open Sans", verdana, arial, sans-serif'; mp.size.dflt = 12; mp.color.dflt = Fh.defaultLine; var Xc = { font: mp, title: { text: { valType: "string", editType: "layoutstyle", description: [ "Sets the plot's title.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: ly({ editType: "layoutstyle", description: [ "Sets the title font.", "Note that the title's font used to be customized", "by the now deprecated `titlefont` attribute." ].join(" ") }), xref: { valType: "enumerated", dflt: "container", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, yref: { valType: "enumerated", dflt: "container", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, x: { valType: "number", min: 0, max: 1, dflt: 0.5, editType: "layoutstyle", description: [ "Sets the x position with respect to `xref` in normalized", "coordinates from *0* (left) to *1* (right)." ].join(" ") }, y: { valType: "number", min: 0, max: 1, dflt: "auto", editType: "layoutstyle", description: [ "Sets the y position with respect to `yref` in normalized", "coordinates from *0* (bottom) to *1* (top).", "*auto* places the baseline of the title onto the", "vertical center of the top margin." ].join(" ") }, xanchor: { valType: "enumerated", dflt: "auto", values: ["auto", "left", "center", "right"], editType: "layoutstyle", description: [ "Sets the title's horizontal alignment with respect to its x position.", "*left* means that the title starts at x,", "*right* means that the title ends at x", "and *center* means that the title's center is at x.", "*auto* divides `xref` by three and calculates the `xanchor`", "value automatically based on the value of `x`." ].join(" ") }, yanchor: { valType: "enumerated", dflt: "auto", values: ["auto", "top", "middle", "bottom"], editType: "layoutstyle", description: [ "Sets the title's vertical alignment with respect to its y position.", "*top* means that the title's cap line is at y,", "*bottom* means that the title's baseline is at y", "and *middle* means that the title's midline is at y.", "*auto* divides `yref` by three and calculates the `yanchor`", "value automatically based on the value of `y`." ].join(" ") }, pad: A2(AV({ editType: "layoutstyle" }), { description: [ "Sets the padding of the title.", "Each padding value only applies when the corresponding", "`xanchor`/`yanchor` value is set accordingly. E.g. for left", "padding to take effect, `xanchor` must be set to *left*.", "The same rule applies if `xanchor`/`yanchor` is determined automatically.", "Padding is muted if the respective anchor value is *middle*/*center*." ].join(" ") }), automargin: { valType: "boolean", dflt: false, editType: "plot", description: [ "Determines whether the title can automatically push the figure margins.", "If `yref='paper'` then the margin will expand to ensure that the title doesn’t", "overlap with the edges of the container. If `yref='container'` then the margins", "will ensure that the title doesn’t overlap with the plot area, tick labels,", "and axis titles. If `automargin=true` and the margins need to be expanded,", "then y will be set to a default 1 and yanchor will be set to an appropriate", "default to ensure that minimal margin space is needed. Note that when `yref='paper'`,", "only 1 or 0 are allowed y values. Invalid values will be reset to the default 1." ].join(" ") }, editType: "layoutstyle" }, uniformtext: { mode: { valType: "enumerated", values: [false, "hide", "show"], dflt: false, editType: "plot", description: [ "Determines how the font size for various text", "elements are uniformed between each trace type.", "If the computed text sizes were smaller than", "the minimum size defined by `uniformtext.minsize`", "using *hide* option hides the text; and", "using *show* option shows the text without further downscaling.", "Please note that if the size defined by `minsize` is greater than", "the font size defined by trace, then the `minsize` is used." ].join(" ") }, minsize: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets the minimum text size between traces of the same type." ].join(" ") }, editType: "plot" }, autosize: { valType: "boolean", dflt: false, // autosize, width, and height get special editType treatment in _relayout // so we can handle noop resizes more efficiently editType: "none", description: [ "Determines whether or not a layout width or height", "that has been left undefined by the user", "is initialized on each relayout.", "Note that, regardless of this attribute,", "an undefined layout width or height", "is always initialized on the first call to plot." ].join(" ") }, width: { valType: "number", min: 10, dflt: 700, editType: "plot", description: [ "Sets the plot's width (in px)." ].join(" ") }, height: { valType: "number", min: 10, dflt: 450, editType: "plot", description: [ "Sets the plot's height (in px)." ].join(" ") }, minreducedwidth: { valType: "number", min: 2, dflt: 64, editType: "plot", description: "Minimum width of the plot with margin.automargin applied (in px)" }, minreducedheight: { valType: "number", min: 2, dflt: 64, editType: "plot", description: "Minimum height of the plot with margin.automargin applied (in px)" }, margin: { l: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the left margin (in px)." }, r: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the right margin (in px)." }, t: { valType: "number", min: 0, dflt: 100, editType: "plot", description: "Sets the top margin (in px)." }, b: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the bottom margin (in px)." }, pad: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets the amount of padding (in px)", "between the plotting area and the axis lines" ].join(" ") }, autoexpand: { valType: "boolean", dflt: true, editType: "plot", description: [ "Turns on/off margin expansion computations.", "Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider", "are allowed to push the margins by defaults." ].join(" ") }, editType: "plot" }, computed: { valType: "any", editType: "none", description: [ "Placeholder for exporting automargin-impacting values namely", "`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode." ].join(" ") }, paper_bgcolor: { valType: "color", dflt: Fh.background, editType: "plot", description: "Sets the background color of the paper where the graph is drawn." }, plot_bgcolor: { // defined here, but set in cartesian.supplyLayoutDefaults // because it needs to know if there are (2D) axes or not valType: "color", dflt: Fh.background, editType: "layoutstyle", description: [ "Sets the background color of the plotting area in-between x and y axes." ].join(" ") }, autotypenumbers: { valType: "enumerated", values: ["convert types", "strict"], dflt: "convert types", editType: "calc", description: [ "Using *strict* a numeric string in trace data is not converted to a number.", "Using *convert types* a numeric string in trace data may be", "treated as a number during automatic axis `type` detection.", "This is the default value; however it could be overridden for individual axes." ].join(" ") }, separators: { valType: "string", editType: "plot", description: [ "Sets the decimal and thousand separators.", "For example, *. * puts a '.' before decimals and a space", "between thousands. In English locales, dflt is *.,* but", "other locales may alter this default." ].join(" ") }, hidesources: { valType: "boolean", dflt: false, editType: "plot", description: [ "Determines whether or not a text link citing the data source is", "placed at the bottom-right cored of the figure.", "Has only an effect only on graphs that have been generated via", "forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise)." ].join(" ") }, showlegend: { // handled in legend.supplyLayoutDefaults // but included here because it's not in the legend object valType: "boolean", editType: "legend", description: [ "Determines whether or not a legend is drawn.", "Default is `true` if there is a trace to show and any of these:", "a) Two or more traces would by default be shown in the legend.", "b) One pie trace is shown in the legend.", "c) One trace is explicitly given with `showlegend: true`." ].join(" ") }, colorway: { valType: "colorlist", dflt: Fh.defaults, editType: "calc", description: "Sets the default trace colors." }, datarevision: { valType: "any", editType: "calc", description: [ "If provided, a changed value tells `Plotly.react` that", "one or more data arrays has changed. This way you can modify", "arrays in-place rather than making a complete new copy for an", "incremental change.", "If NOT provided, `Plotly.react` assumes that data arrays are", "being treated as immutable, thus any data array with a", "different identity from its predecessor contains new data." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Used to allow user interactions with the plot to persist after", "`Plotly.react` calls that are unaware of these interactions.", "If `uirevision` is omitted, or if it is given and it changed from", "the previous `Plotly.react` call, the exact new figure is used.", "If `uirevision` is truthy and did NOT change, any attribute", "that has been affected by user interactions and did not receive a", "different value in the new figure will keep the interaction value.", "`layout.uirevision` attribute serves as the default for", "`uirevision` attributes in various sub-containers. For finer", "control you can set these sub-attributes directly. For example,", "if your app separately controls the data on the x and y axes you", "might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.", "Then if only the y data is changed, you can update", "`yaxis.uirevision=*quantity*` and the y axis range will reset but", "the x axis range will retain any user-driven zoom." ].join(" ") }, editrevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in `editable: true`", "configuration, other than trace names and axis titles.", "Defaults to `layout.uirevision`." ].join(" ") }, selectionrevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in selected points", "from all traces." ].join(" ") }, template: { valType: "any", editType: "calc", description: [ "Default attributes to be applied to the plot. Templates can be", "created from existing plots using `Plotly.makeTemplate`, or", "created manually. They should be objects with format:", "`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`", "`layoutTemplate` and `traceTemplate` are objects matching the", "attribute structure of `layout` and a data trace. ", "Trace templates are applied cyclically to traces of each type.", "Container arrays (eg `annotations`) have special handling:", "An object ending in `defaults` (eg `annotationdefaults`) is applied", "to each array item. But if an item has a `templateitemname` key", "we look in the template array for an item with matching `name` and", "apply that instead. If no matching `name` is found we mark the item", "invisible. Any named template item not referenced is appended to", "the end of the array, so you can use this for a watermark annotation", "or a logo image, for example. To omit one of these items on the plot,", "make an item with matching `templateitemname` and `visible: false`." ].join(" ") }, newshape: T2.newshape, activeshape: T2.activeshape, newselection: k2.newselection, activeselection: k2.activeselection, meta: { valType: "any", arrayOk: true, editType: "plot", description: [ "Assigns extra meta information that can be used in various `text` attributes.", "Attributes such as the graph, axis and colorbar `title.text`, annotation `text`", "`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text", "all support `meta`. One can access `meta` fields using template strings:", "`%{meta[i]}` where `i` is the index of the `meta`", "item in question.", "`meta` can also be an object for example `{key: value}` which can be accessed", "%{meta[key]}." ].join(" ") }, transition: A2({}, kV.transition, { description: [ "Sets transition options used during Plotly.react updates." ].join(" "), editType: "none" }), _deprecated: { title: { valType: "string", editType: "layoutstyle", description: [ "Value of `title` is no longer a simple *string* but a set of sub-attributes.", "To set the contents of the title, please use `title.text` now." ].join(" ") }, titlefont: ly({ editType: "layoutstyle", description: [ "Former `titlefont` is now the sub-attribute `font` of `title`.", "To customize title font properties, please use `title.font` now." ].join(" ") }) } }; (function(e10) { var t = Xu, r = Y1, n = nL, a = ms, i = dp.addStyleRule, o = en, l = Wi, s = Xc, u = o.extendFlat, f = o.extendDeepAll; e10.modules = {}, e10.allCategories = {}, e10.allTypes = [], e10.subplotsRegistry = {}, e10.transformsRegistry = {}, e10.componentsRegistry = {}, e10.layoutArrayContainers = [], e10.layoutArrayRegexes = [], e10.traceLayoutAttributes = {}, e10.localeRegistry = {}, e10.apiMethodRegistry = {}, e10.collectableSubplotTypes = null, e10.register = function(T) { if (e10.collectableSubplotTypes = null, T) T && !Array.isArray(T) && (T = [T]); else throw new Error("No argument passed to Plotly.register."); for (var S = 0; S < T.length; S++) { var M = T[S]; if (!M) throw new Error("Invalid module was attempted to be registered!"); switch (M.moduleType) { case "trace": d(M); break; case "transform": v(M); break; case "component": p(M); break; case "locale": m(M); break; case "apiMethod": var L = M.name; e10.apiMethodRegistry[L] = M.fn; break; default: throw new Error("Invalid module was attempted to be registered!"); } } }, e10.getModule = function(_) { var T = e10.modules[x(_)]; return T ? T._module : false; }, e10.traceIs = function(_, T) { if (_ = x(_), _ === "various") return false; var S = e10.modules[_]; return S || (_ && t.log("Unrecognized trace type " + _ + "."), S = e10.modules[l.type.dflt]), !!S.categories[T]; }, e10.getTransformIndices = function(_, T) { for (var S = [], M = _.transforms || [], L = 0; L < M.length; L++) M[L].type === T && S.push(L); return S; }, e10.hasTransform = function(_, T) { for (var S = _.transforms || [], M = 0; M < S.length; M++) if (S[M].type === T) return true; return false; }, e10.getComponentMethod = function(_, T) { var S = e10.componentsRegistry[_]; return S && S[T] || r; }, e10.call = function() { var _ = arguments[0], T = [].slice.call(arguments, 1); return e10.apiMethodRegistry[_].apply(null, T); }; function d(_) { var T = _.name, S = _.categories, M = _.meta; if (e10.modules[T]) { t.log("Type " + T + " already registered"); return; } e10.subplotsRegistry[_.basePlotModule.name] || h(_.basePlotModule); for (var L = {}, F = 0; F < S.length; F++) L[S[F]] = true, e10.allCategories[S[F]] = true; e10.modules[T] = { _module: _, categories: L }, M && Object.keys(M).length && (e10.modules[T].meta = M), e10.allTypes.push(T); for (var $ in e10.componentsRegistry) y($, T); _.layoutAttributes && u(e10.traceLayoutAttributes, _.layoutAttributes); var I = _.basePlotModule, O = I.name; if (O === "mapbox") { var G = I.constants.styleRules; for (var K in G) i(".js-plotly-plot .plotly .mapboxgl-" + K, G[K]); } (O === "geo" || O === "mapbox") && window.PlotlyGeoAssets === void 0 && (window.PlotlyGeoAssets = { topojson: {} }); } function h(_) { var T = _.name; if (e10.subplotsRegistry[T]) { t.log("Plot type " + T + " already registered."); return; } g(_), e10.subplotsRegistry[T] = _; for (var S in e10.componentsRegistry) k(S, _.name); } function p(_) { if (typeof _.name != "string") throw new Error("Component module *name* must be a string."); var T = _.name; e10.componentsRegistry[T] = _, _.layoutAttributes && (_.layoutAttributes._isLinkedToArray && n(e10.layoutArrayContainers, T), g(_)); for (var S in e10.modules) y(T, S); for (var M in e10.subplotsRegistry) k(T, M); for (var L in e10.transformsRegistry) w(T, L); _.schema && _.schema.layout && f(s, _.schema.layout); } function v(_) { if (typeof _.name != "string") throw new Error("Transform module *name* must be a string."); var T = "Transform module " + _.name, S = typeof _.transform == "function", M = typeof _.calcTransform == "function"; if (!S && !M) throw new Error(T + " is missing a *transform* or *calcTransform* method."); S && M && t.log([ T + " has both a *transform* and *calcTransform* methods.", "Please note that all *transform* methods are executed", "before all *calcTransform* methods." ].join(" ")), a(_.attributes) || t.log(T + " registered without an *attributes* object."), typeof _.supplyDefaults != "function" && t.log(T + " registered without a *supplyDefaults* method."), e10.transformsRegistry[_.name] = _; for (var L in e10.componentsRegistry) w(L, _.name); } function m(_) { var T = _.name, S = T.split("-")[0], M = _.dictionary, L = _.format, F = M && Object.keys(M).length, $ = L && Object.keys(L).length, I = e10.localeRegistry, O = I[T]; if (O || (I[T] = O = {}), S !== T) { var G = I[S]; G || (I[S] = G = {}), F && G.dictionary === O.dictionary && (G.dictionary = M), $ && G.format === O.format && (G.format = L); } F && (O.dictionary = M), $ && (O.format = L); } function g(_) { if (_.layoutAttributes) { var T = _.layoutAttributes._arrayAttrRegexps; if (T) for (var S = 0; S < T.length; S++) n(e10.layoutArrayRegexes, T[S]); } } function y(_, T) { var S = e10.componentsRegistry[_].schema; if (!(!S || !S.traces)) { var M = S.traces[T]; M && f(e10.modules[T]._module.attributes, M); } } function w(_, T) { var S = e10.componentsRegistry[_].schema; if (!(!S || !S.transforms)) { var M = S.transforms[T]; M && f(e10.transformsRegistry[T].attributes, M); } } function k(_, T) { var S = e10.componentsRegistry[_].schema; if (!(!S || !S.subplots)) { var M = e10.subplotsRegistry[T], L = M.layoutAttributes, F = M.attr === "subplot" ? M.name : M.attr; Array.isArray(F) && (F = F[0]); var $ = S.subplots[F]; L && $ && f(L, $); } } function x(_) { return typeof _ == "object" && (_ = _.type), _; } })(Nt); (function(e10) { var t = _c.timeFormat, r = sr, n = Xu, a = Wc.mod, i = Qr, o = i.BADNUM, l = i.ONEDAY, s = i.ONEHOUR, u = i.ONEMIN, f = i.ONESEC, d = i.EPOCHJD, h = Nt, p = _c.utcFormat, v = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, m = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, g = (/* @__PURE__ */ new Date()).getFullYear() - 70; function y(z) { return z && h.componentsRegistry.calendars && typeof z == "string" && z !== "gregorian"; } e10.dateTick0 = function(z, P) { var R = w(z, !!P); if (P < 2) return R; var H = e10.dateTime2ms(R, z); return H += l * (P - 1), e10.ms2DateTime(H, 0, z); }; function w(z, P) { return y(z) ? P ? h.getComponentMethod("calendars", "CANONICAL_SUNDAY")[z] : h.getComponentMethod("calendars", "CANONICAL_TICK")[z] : P ? "2000-01-02" : "2000-01-01"; } e10.dfltRange = function(z) { return y(z) ? h.getComponentMethod("calendars", "DFLTRANGE")[z] : ["2000-01-01", "2001-01-01"]; }, e10.isJSDate = function(z) { return typeof z == "object" && z !== null && typeof z.getTime == "function"; }; var k, x; e10.dateTime2ms = function(z, P) { if (e10.isJSDate(z)) { var R = z.getTimezoneOffset() * u, H = (z.getUTCMinutes() - z.getMinutes()) * u + (z.getUTCSeconds() - z.getSeconds()) * f + (z.getUTCMilliseconds() - z.getMilliseconds()); if (H) { var B = 3 * u; R = R - B / 2 + a(H - R + B / 2, B); } return z = Number(z) - R, z >= k && z <= x ? z : o; } if (typeof z != "string" && typeof z != "number") return o; z = String(z); var W = y(P), ee = z.charAt(0); W && (ee === "G" || ee === "g") && (z = z.substr(1), P = ""); var re = W && P.substr(0, 7) === "chinese", ae = z.match(re ? m : v); if (!ae) return o; var Q = ae[1], ue = ae[3] || "1", j = Number(ae[5] || 1), U = Number(ae[7] || 0), Z = Number(ae[9] || 0), le = Number(ae[11] || 0); if (W) { if (Q.length === 2) return o; Q = Number(Q); var J; try { var pe = h.getComponentMethod("calendars", "getCal")(P); if (re) { var ge = ue.charAt(ue.length - 1) === "i"; ue = parseInt(ue, 10), J = pe.newDate(Q, pe.toMonthIndex(Q, ue, ge), j); } else J = pe.newDate(Q, Number(ue), j); } catch { return o; } return J ? (J.toJD() - d) * l + U * s + Z * u + le * f : o; } Q.length === 2 ? Q = (Number(Q) + 2e3 - g) % 100 + g : Q = Number(Q), ue -= 1; var ve = new Date(Date.UTC(2e3, ue, j, U, Z)); return ve.setUTCFullYear(Q), ve.getUTCMonth() !== ue || ve.getUTCDate() !== j ? o : ve.getTime() + le * f; }, k = e10.MIN_MS = e10.dateTime2ms("-9999"), x = e10.MAX_MS = e10.dateTime2ms("9999-12-31 23:59:59.9999"), e10.isDateTime = function(z, P) { return e10.dateTime2ms(z, P) !== o; }; function _(z, P) { return String(z + Math.pow(10, P)).substr(1); } var T = 90 * l, S = 3 * s, M = 5 * u; e10.ms2DateTime = function(z, P, R) { if (typeof z != "number" || !(z >= k && z <= x)) return o; P || (P = 0); var H = Math.floor(a(z + 0.05, 1) * 10), B = Math.round(z - H / 10), W, ee, re, ae, Q, ue; if (y(R)) { var j = Math.floor(B / l) + d, U = Math.floor(a(z, l)); try { W = h.getComponentMethod("calendars", "getCal")(R).fromJD(j).formatDate("yyyy-mm-dd"); } catch { W = p("G%Y-%m-%d")(new Date(B)); } if (W.charAt(0) === "-") for (; W.length < 11; ) W = "-0" + W.substr(1); else for (; W.length < 10; ) W = "0" + W; ee = P < T ? Math.floor(U / s) : 0, re = P < T ? Math.floor(U % s / u) : 0, ae = P < S ? Math.floor(U % u / f) : 0, Q = P < M ? U % f * 10 + H : 0; } else ue = new Date(B), W = p("%Y-%m-%d")(ue), ee = P < T ? ue.getUTCHours() : 0, re = P < T ? ue.getUTCMinutes() : 0, ae = P < S ? ue.getUTCSeconds() : 0, Q = P < M ? ue.getUTCMilliseconds() * 10 + H : 0; return L(W, ee, re, ae, Q); }, e10.ms2DateTimeLocal = function(z) { if (!(z >= k + l && z <= x - l)) return o; var P = Math.floor(a(z + 0.05, 1) * 10), R = new Date(Math.round(z - P / 10)), H = t("%Y-%m-%d")(R), B = R.getHours(), W = R.getMinutes(), ee = R.getSeconds(), re = R.getUTCMilliseconds() * 10 + P; return L(H, B, W, ee, re); }; function L(z, P, R, H, B) { if ((P || R || H || B) && (z += " " + _(P, 2) + ":" + _(R, 2), (H || B) && (z += ":" + _(H, 2), B))) { for (var W = 4; B % 10 === 0; ) W -= 1, B /= 10; z += "." + _(B, W); } return z; } e10.cleanDate = function(z, P, R) { if (z === o) return P; if (e10.isJSDate(z) || typeof z == "number" && isFinite(z)) { if (y(R)) return n.error("JS Dates and milliseconds are incompatible with world calendars", z), P; if (z = e10.ms2DateTimeLocal(+z), !z && P !== void 0) return P; } else if (!e10.isDateTime(z, R)) return n.error("unrecognized date", z), P; return z; }; var F = /%\d?f/g, $ = /%h/g, I = { 1: "1", 2: "1", 3: "2", 4: "2" }; function O(z, P, R, H) { z = z.replace(F, function(W) { var ee = Math.min(+W.charAt(1) || 6, 6), re = (P / 1e3 % 1 + 2).toFixed(ee).substr(2).replace(/0+$/, "") || "0"; return re; }); var B = new Date(Math.floor(P + 0.05)); if (z = z.replace($, function() { return I[R("%q")(B)]; }), y(H)) try { z = h.getComponentMethod("calendars", "worldCalFmt")(z, P, H); } catch { return "Invalid"; } return R(z)(B); } var G = [59, 59.9, 59.99, 59.999, 59.9999]; function K(z, P) { var R = a(z + 0.05, l), H = _(Math.floor(R / s), 2) + ":" + _(a(Math.floor(R / u), 60), 2); if (P !== "M") { r(P) || (P = 0); var B = Math.min(a(z / f, 60), G[P]), W = (100 + B).toFixed(P).substr(1); P > 0 && (W = W.replace(/0+$/, "").replace(/[\.]$/, "")), H += ":" + W; } return H; } e10.formatDate = function(z, P, R, H, B, W) { if (B = y(B) && B, !P) if (R === "y") P = W.year; else if (R === "m") P = W.month; else if (R === "d") P = W.dayMonth + ` ` + W.year; else return K(z, R) + ` ` + O(W.dayMonthYear, z, H, B); return O(P, z, H, B); }; var V = 3 * l; e10.incrementMonth = function(z, P, R) { R = y(R) && R; var H = a(z, l); if (z = Math.round(z - H), R) try { var B = Math.round(z / l) + d, W = h.getComponentMethod("calendars", "getCal")(R), ee = W.fromJD(B); return P % 12 ? W.add(ee, P, "m") : W.add(ee, P / 12, "y"), (ee.toJD() - d) * l + H; } catch { n.error("invalid ms " + z + " in calendar " + R); } var re = new Date(z + V); return re.setUTCMonth(re.getUTCMonth() + P) + H - V; }, e10.findExactDates = function(z, P) { for (var R = 0, H = 0, B = 0, W = 0, ee, re, ae = y(P) && h.getComponentMethod("calendars", "getCal")(P), Q = 0; Q < z.length; Q++) { if (re = z[Q], !r(re)) { W++; continue; } if (!(re % l)) if (ae) try { ee = ae.fromJD(re / l + d), ee.day() === 1 ? ee.month() === 1 ? R++ : H++ : B++; } catch { } else ee = new Date(re), ee.getUTCDate() === 1 ? ee.getUTCMonth() === 0 ? R++ : H++ : B++; } H += R, B += H; var ue = z.length - W; return { exactYears: R / ue, exactMonths: H / ue, exactDays: B / ue }; }; })(KC); var Q1 = {}; var wL = function(t) { return t; }; (function(e10) { var t = sr, r = Xu, n = wL, a = Qr.BADNUM, i = 1e-9; e10.findBin = function(f, d, h) { if (t(d.start)) return h ? Math.ceil((f - d.start) / d.size - i) - 1 : Math.floor((f - d.start) / d.size + i); var p = 0, v = d.length, m = 0, g = v > 1 ? (d[v - 1] - d[0]) / (v - 1) : 1, y, w; for (g >= 0 ? w = h ? o : l : w = h ? u : s, f += g * i * (h ? -1 : 1) * (g >= 0 ? 1 : -1); p < v && m++ < 100; ) y = Math.floor((p + v) / 2), w(d[y], f) ? p = y + 1 : v = y; return m > 90 && r.log("Long binary search..."), p - 1; }; function o(f, d) { return f < d; } function l(f, d) { return f <= d; } function s(f, d) { return f > d; } function u(f, d) { return f >= d; } e10.sorterAsc = function(f, d) { return f - d; }, e10.sorterDes = function(f, d) { return d - f; }, e10.distinctVals = function(f) { var d = f.slice(); d.sort(e10.sorterAsc); var h; for (h = d.length - 1; h > -1 && d[h] === a; h--) ; for (var p = d[h] - d[0] || 1, v = p / (h || 1) / 1e4, m = [], g, y = 0; y <= h; y++) { var w = d[y], k = w - g; g === void 0 ? (m.push(w), g = w) : k > v && (p = Math.min(p, k), m.push(w), g = w); } return { vals: m, minDiff: p }; }, e10.roundUp = function(f, d, h) { for (var p = 0, v = d.length - 1, m, g = 0, y = h ? 0 : 1, w = h ? 1 : 0, k = h ? Math.ceil : Math.floor; p < v && g++ < 100; ) m = k((p + v) / 2), d[m] <= f ? p = m + y : v = m - w; return d[p]; }, e10.sort = function(f, d) { for (var h = 0, p = 0, v = 1; v < f.length; v++) { var m = d(f[v], f[v - 1]); if (m < 0 ? h = 1 : m > 0 && (p = 1), h && p) return f.sort(d); } return p ? f : f.reverse(); }, e10.findIndexOfMin = function(f, d) { d = d || n; for (var h = 1 / 0, p, v = 0; v < f.length; v++) { var m = d(f[v]); m < h && (h = m, p = v); } return p; }; })(Q1); var TL = function(t) { return Object.keys(t).sort(); }; var kL = {}; (function(e10) { var t = sr, r = an.isArrayOrTypedArray; e10.aggNums = function(n, a, i, o) { var l, s; if ((!o || o > i.length) && (o = i.length), t(a) || (a = false), r(i[0])) { for (s = new Array(o), l = 0; l < o; l++) s[l] = e10.aggNums(n, a, i[l]); i = s; } for (l = 0; l < o; l++) t(a) ? t(i[l]) && (a = n(+a, +i[l])) : a = i[l]; return a; }, e10.len = function(n) { return e10.aggNums(function(a) { return a + 1; }, 0, n); }, e10.mean = function(n, a) { return a || (a = e10.len(n)), e10.aggNums(function(i, o) { return i + o; }, 0, n) / a; }, e10.midRange = function(n) { if (!(n === void 0 || n.length === 0)) return (e10.aggNums(Math.max, null, n) + e10.aggNums(Math.min, null, n)) / 2; }, e10.variance = function(n, a, i) { return a || (a = e10.len(n)), t(i) || (i = e10.mean(n, a)), e10.aggNums(function(o, l) { return o + Math.pow(l - i, 2); }, 0, n) / a; }, e10.stdev = function(n, a, i) { return Math.sqrt(e10.variance(n, a, i)); }, e10.median = function(n) { var a = n.slice().sort(); return e10.interp(a, 0.5); }, e10.interp = function(n, a) { if (!t(a)) throw "n should be a finite number"; if (a = a * n.length - 0.5, a < 0) return n[0]; if (a > n.length - 1) return n[n.length - 1]; var i = a % 1; return i * n[Math.ceil(a)] + (1 - i) * n[Math.floor(a)]; }; })(kL); var AL = Wc; var qm = AL.mod; var MV = AL.modHalf; var xc = Math.PI; var Jo = 2 * xc; function SV(e10) { return e10 / 180 * xc; } function CV(e10) { return e10 / xc * 180; } function eb(e10) { return Math.abs(e10[1] - e10[0]) > Jo - 1e-14; } function ML(e10, t) { return MV(t - e10, Jo); } function LV(e10, t) { return Math.abs(ML(e10, t)); } function SL(e10, t) { if (eb(t)) return true; var r, n; t[0] < t[1] ? (r = t[0], n = t[1]) : (r = t[1], n = t[0]), r = qm(r, Jo), n = qm(n, Jo), r > n && (n += Jo); var a = qm(e10, Jo), i = a + Jo; return a >= r && a <= n || i >= r && i <= n; } function DV(e10, t, r, n) { if (!SL(t, n)) return false; var a, i; return r[0] < r[1] ? (a = r[0], i = r[1]) : (a = r[1], i = r[0]), e10 >= a && e10 <= i; } function tb(e10, t, r, n, a, i, o) { a = a || 0, i = i || 0; var l = eb([r, n]), s, u, f, d, h; l ? (s = 0, u = xc, f = Jo) : r < n ? (s = r, f = n) : (s = n, f = r), e10 < t ? (d = e10, h = t) : (d = t, h = e10); function p(y, w) { return [y * Math.cos(w) + a, i - y * Math.sin(w)]; } var v = Math.abs(f - s) <= xc ? 0 : 1; function m(y, w, k) { return "A" + [y, y] + " " + [0, v, k] + " " + p(y, w); } var g; return l ? d === null ? g = "M" + p(h, s) + m(h, u, 0) + m(h, f, 0) + "Z" : g = "M" + p(d, s) + m(d, u, 0) + m(d, f, 0) + "ZM" + p(h, s) + m(h, u, 1) + m(h, f, 1) + "Z" : d === null ? (g = "M" + p(h, s) + m(h, f, 0), o && (g += "L0,0Z")) : g = "M" + p(d, s) + "L" + p(h, s) + m(h, f, 0) + "L" + p(d, f) + m(d, s, 1) + "Z", g; } function EV(e10, t, r, n, a) { return tb(null, e10, t, r, n, a, 0); } function FV(e10, t, r, n, a) { return tb(null, e10, t, r, n, a, 1); } function RV(e10, t, r, n, a, i) { return tb(e10, t, r, n, a, i, 1); } var PV = { deg2rad: SV, rad2deg: CV, angleDelta: ML, angleDist: LV, isFullCircle: eb, isAngleInsideSector: SL, isPtInsideSector: DV, pathArc: EV, pathSector: FV, pathAnnulus: RV }; var gs = {}; gs.isLeftAnchor = function(t) { return t.xanchor === "left" || t.xanchor === "auto" && t.x <= 1 / 3; }; gs.isCenterAnchor = function(t) { return t.xanchor === "center" || t.xanchor === "auto" && t.x > 1 / 3 && t.x < 2 / 3; }; gs.isRightAnchor = function(t) { return t.xanchor === "right" || t.xanchor === "auto" && t.x >= 2 / 3; }; gs.isTopAnchor = function(t) { return t.yanchor === "top" || t.yanchor === "auto" && t.y >= 2 / 3; }; gs.isMiddleAnchor = function(t) { return t.yanchor === "middle" || t.yanchor === "auto" && t.y > 1 / 3 && t.y < 2 / 3; }; gs.isBottomAnchor = function(t) { return t.yanchor === "bottom" || t.yanchor === "auto" && t.y <= 1 / 3; }; var ys = {}; var Wm = Wc.mod; ys.segmentsIntersect = CL; function CL(e10, t, r, n, a, i, o, l) { var s = r - e10, u = a - e10, f = o - a, d = n - t, h = i - t, p = l - i, v = s * p - f * d; if (v === 0) return null; var m = (u * p - f * h) / v, g = (u * d - s * h) / v; return g < 0 || g > 1 || m < 0 || m > 1 ? null : { x: e10 + s * m, y: t + d * m }; } ys.segmentDistance = function(t, r, n, a, i, o, l, s) { if (CL(t, r, n, a, i, o, l, s)) return 0; var u = n - t, f = a - r, d = l - i, h = s - o, p = u * u + f * f, v = d * d + h * h, m = Math.min( Id(u, f, p, i - t, o - r), Id(u, f, p, l - t, s - r), Id(d, h, v, t - i, r - o), Id(d, h, v, n - i, a - o) ); return Math.sqrt(m); }; function Id(e10, t, r, n, a) { var i = n * e10 + a * t; if (i < 0) return n * n + a * a; if (i > r) { var o = n - e10, l = a - t; return o * o + l * l; } else { var s = n * t - a * e10; return s * s / r; } } var Nd; var sy; var M2; ys.getTextLocation = function(t, r, n, a) { if ((t !== sy || a !== M2) && (Nd = {}, sy = t, M2 = a), Nd[n]) return Nd[n]; var i = t.getPointAtLength(Wm(n - a / 2, r)), o = t.getPointAtLength(Wm(n + a / 2, r)), l = Math.atan((o.y - i.y) / (o.x - i.x)), s = t.getPointAtLength(Wm(n, r)), u = (s.x * 4 + i.x + o.x) / 6, f = (s.y * 4 + i.y + o.y) / 6, d = { x: u, y: f, theta: l }; return Nd[n] = d, d; }; ys.clearLocationCache = function() { sy = null; }; ys.getVisibleSegment = function(t, r, n) { var a = r.left, i = r.right, o = r.top, l = r.bottom, s = 0, u = t.getTotalLength(), f = u, d, h; function p(m) { var g = t.getPointAtLength(m); m === 0 ? d = g : m === u && (h = g); var y = g.x < a ? a - g.x : g.x > i ? g.x - i : 0, w = g.y < o ? o - g.y : g.y > l ? g.y - l : 0; return Math.sqrt(y * y + w * w); } for (var v = p(s); v; ) { if (s += v + n, s > f) return; v = p(s); } for (v = p(f); v; ) { if (f -= v + n, s > f) return; v = p(f); } return { min: s, max: f, len: f - s, total: u, isClosed: s === 0 && f === u && Math.abs(d.x - h.x) < 0.1 && Math.abs(d.y - h.y) < 0.1 }; }; ys.findPointOnPath = function(t, r, n, a) { a = a || {}; for (var i = a.pathLength || t.getTotalLength(), o = a.tolerance || 1e-3, l = a.iterationLimit || 30, s = t.getPointAtLength(0)[n] > t.getPointAtLength(i)[n] ? -1 : 1, u = 0, f = 0, d = i, h, p, v; u < l; ) { if (h = (f + d) / 2, p = t.getPointAtLength(h), v = p[n] - r, Math.abs(v) < o) return p; s * v > 0 ? d = h : f = h, u++; } return p; }; var gp = {}; (function(e10) { var t = {}; e10.throttle = function(a, i, o) { var l = t[a], s = Date.now(); if (!l) { for (var u in t) t[u].ts < s - 6e4 && delete t[u]; l = t[a] = { ts: 0, timer: null }; } r(l); function f() { o(), l.ts = Date.now(), l.onDone && (l.onDone(), l.onDone = null); } if (s > l.ts + i) { f(); return; } l.timer = setTimeout(function() { f(), l.timer = null; }, i); }, e10.done = function(n) { var a = t[n]; return !a || !a.timer ? Promise.resolve() : new Promise(function(i) { var o = a.onDone; a.onDone = function() { o && o(), i(), a.onDone = null; }; }); }, e10.clear = function(n) { if (n) r(t[n]), delete t[n]; else for (var a in t) e10.clear(a); }; function r(n) { n && n.timer !== null && (clearTimeout(n.timer), n.timer = null); } })(gp); var $V = function(t) { t._responsiveChartHandler && (window.removeEventListener("resize", t._responsiveChartHandler), delete t._responsiveChartHandler); }; var yp = { exports: {} }; yp.exports = rb; yp.exports.isMobile = rb; yp.exports.default = rb; var zV = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i; var IV = /CrOS/; var NV = /android|ipad|playbook|silk/i; function rb(e10) { e10 || (e10 = {}); let t = e10.ua; if (!t && typeof navigator < "u" && (t = navigator.userAgent), t && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string") return false; let r = zV.test(t) && !IV.test(t) || !!e10.tablet && NV.test(t); return !r && e10.tablet && e10.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.indexOf("Macintosh") !== -1 && t.indexOf("Safari") !== -1 && (r = true), r; } var OV = yp.exports; var HV = sr; var BV = OV; var jV = function(t) { var r; if (t && t.hasOwnProperty("userAgent") ? r = t.userAgent : r = UV(), typeof r != "string") return true; var n = BV({ ua: { headers: { "user-agent": r } }, tablet: true, featureDetect: false }); if (!n) for (var a = r.split(" "), i = 1; i < a.length; i++) { var o = a[i]; if (o.indexOf("Safari") !== -1) for (var l = i - 1; l > -1; l--) { var s = a[l]; if (s.substr(0, 8) === "Version/") { var u = s.substr(8).split(".")[0]; if (HV(u) && (u = +u), u >= 13) return true; } } } return n; }; function UV() { var e10; return typeof navigator < "u" && (e10 = navigator.userAgent), e10 && e10.headers && typeof e10.headers["user-agent"] == "string" && (e10 = e10.headers["user-agent"]), e10; } var GV = lr; var VV = function(t, r, n) { var a = t.selectAll("g." + n.replace(/\s/g, ".")).data(r, function(o) { return o[0].trace.uid; }); a.exit().remove(), a.enter().append("g").attr("class", n), a.order(); var i = t.classed("rangeplot") ? "nodeRangePlot3" : "node3"; return a.each(function(o) { o[0][i] = GV.select(this); }), a; }; var qV = Nt; var WV = function(t, r) { for (var n = t._context.locale, a = 0; a < 2; a++) { for (var i = t._context.locales, o = 0; o < 2; o++) { var l = (i[n] || {}).dictionary; if (l) { var s = l[r]; if (s) return s; } i = qV.localeRegistry; } var u = n.split("-")[0]; if (u === n) break; n = u; } return r; }; var ZV = function(t) { for (var r = {}, n = [], a = 0, i = 0; i < t.length; i++) { var o = t[i]; r[o] !== 1 && (r[o] = 1, n[a++] = o); } return n; }; var YV = function(t) { for (var r = JV(t) ? KV : XV, n = [], a = 0; a < t.length; a++) { var i = t[a]; r(i) && n.push(i); } return n; }; function XV(e10) { return e10.visible === true; } function KV(e10) { var t = e10[0].trace; return t.visible === true && t._length !== 0; } function JV(e10) { return Array.isArray(e10) && Array.isArray(e10[0]) && e10[0][0] && e10[0][0].trace; } var QV = function(t, r) { if (!r) return t; var n = 1 / Math.abs(r), a = n > 1 ? (n * t + n * r) / n : t + r, i = String(a).length; if (i > 16) { var o = String(r).length, l = String(t).length; if (i >= l + o) { var s = parseFloat(a).toPrecision(12); s.indexOf("e+") === -1 && (a = +s); } } return a; }; var eq = sr; var tq = Qr.BADNUM; var rq = /^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g; var nq = function(t) { return typeof t == "string" && (t = t.replace(rq, "")), eq(t) ? Number(t) : tq; }; var Zf = lr; var aq = _c.utcFormat; var iq = zC.format; var LL = sr; var DL = Qr; var EL = DL.FP_SAFE; var oq = -EL; var S2 = DL.BADNUM; var xe = aC.exports = {}; xe.adjustFormat = function(t) { return !t || /^\d[.]\df/.test(t) || /[.]\d%/.test(t) ? t : t === "0.f" ? "~f" : /^\d%/.test(t) ? "~%" : /^\ds/.test(t) ? "~s" : !/^[~,.0$]/.test(t) && /[&fps]/.test(t) ? "~" + t : t; }; var C2 = {}; xe.warnBadFormat = function(e10) { var t = String(e10); C2[t] || (C2[t] = 1, xe.warn('encountered bad format: "' + t + '"')); }; xe.noFormat = function(e10) { return String(e10); }; xe.numberFormat = function(e10) { var t; try { t = iq(xe.adjustFormat(e10)); } catch { return xe.warnBadFormat(e10), xe.noFormat; } return t; }; xe.nestedProperty = j1; xe.keyedContainer = TU; xe.relativeAttr = MU; xe.isPlainObject = ms; xe.toLogRange = U1; xe.relinkPrivateKeys = CU; var pl = an; xe.isArrayBuffer = pl.isArrayBuffer; xe.isTypedArray = pl.isTypedArray; xe.isArrayOrTypedArray = pl.isArrayOrTypedArray; xe.isArray1D = pl.isArray1D; xe.ensureArray = pl.ensureArray; xe.concat = pl.concat; xe.maxRowLength = pl.maxRowLength; xe.minRowLength = pl.minRowLength; var FL = Wc; xe.mod = FL.mod; xe.modHalf = FL.modHalf; var ml = GC; xe.valObjectMeta = ml.valObjectMeta; xe.coerce = ml.coerce; xe.coerce2 = ml.coerce2; xe.coerceFont = ml.coerceFont; xe.coercePattern = ml.coercePattern; xe.coerceHoverinfo = ml.coerceHoverinfo; xe.coerceSelectionMarkerOpacity = ml.coerceSelectionMarkerOpacity; xe.validate = ml.validate; var Ta = KC; xe.dateTime2ms = Ta.dateTime2ms; xe.isDateTime = Ta.isDateTime; xe.ms2DateTime = Ta.ms2DateTime; xe.ms2DateTimeLocal = Ta.ms2DateTimeLocal; xe.cleanDate = Ta.cleanDate; xe.isJSDate = Ta.isJSDate; xe.formatDate = Ta.formatDate; xe.incrementMonth = Ta.incrementMonth; xe.dateTick0 = Ta.dateTick0; xe.dfltRange = Ta.dfltRange; xe.findExactDates = Ta.findExactDates; xe.MIN_MS = Ta.MIN_MS; xe.MAX_MS = Ta.MAX_MS; var bs = Q1; xe.findBin = bs.findBin; xe.sorterAsc = bs.sorterAsc; xe.sorterDes = bs.sorterDes; xe.distinctVals = bs.distinctVals; xe.roundUp = bs.roundUp; xe.sort = bs.sort; xe.findIndexOfMin = bs.findIndexOfMin; xe.sortObjectKeys = TL; var gl = kL; xe.aggNums = gl.aggNums; xe.len = gl.len; xe.mean = gl.mean; xe.median = gl.median; xe.midRange = gl.midRange; xe.variance = gl.variance; xe.stdev = gl.stdev; xe.interp = gl.interp; var xi = cp; xe.init2dArray = xi.init2dArray; xe.transposeRagged = xi.transposeRagged; xe.dot = xi.dot; xe.translationMatrix = xi.translationMatrix; xe.rotationMatrix = xi.rotationMatrix; xe.rotationXYMatrix = xi.rotationXYMatrix; xe.apply3DTransform = xi.apply3DTransform; xe.apply2DTransform = xi.apply2DTransform; xe.apply2DTransform2 = xi.apply2DTransform2; xe.convertCssMatrix = xi.convertCssMatrix; xe.inverseTransformMatrix = xi.inverseTransformMatrix; var Yi = PV; xe.deg2rad = Yi.deg2rad; xe.rad2deg = Yi.rad2deg; xe.angleDelta = Yi.angleDelta; xe.angleDist = Yi.angleDist; xe.isFullCircle = Yi.isFullCircle; xe.isAngleInsideSector = Yi.isAngleInsideSector; xe.isPtInsideSector = Yi.isPtInsideSector; xe.pathArc = Yi.pathArc; xe.pathSector = Yi.pathSector; xe.pathAnnulus = Yi.pathAnnulus; var Ku = gs; xe.isLeftAnchor = Ku.isLeftAnchor; xe.isCenterAnchor = Ku.isCenterAnchor; xe.isRightAnchor = Ku.isRightAnchor; xe.isTopAnchor = Ku.isTopAnchor; xe.isMiddleAnchor = Ku.isMiddleAnchor; xe.isBottomAnchor = Ku.isBottomAnchor; var Ju = ys; xe.segmentsIntersect = Ju.segmentsIntersect; xe.segmentDistance = Ju.segmentDistance; xe.getTextLocation = Ju.getTextLocation; xe.clearLocationCache = Ju.clearLocationCache; xe.getVisibleSegment = Ju.getVisibleSegment; xe.findPointOnPath = Ju.findPointOnPath; var bp = en; xe.extendFlat = bp.extendFlat; xe.extendDeep = bp.extendDeep; xe.extendDeepAll = bp.extendDeepAll; xe.extendDeepNoArrays = bp.extendDeepNoArrays; var nb = Xu; xe.log = nb.log; xe.warn = nb.warn; xe.error = nb.error; var lq = Zu; xe.counterRegex = lq.counter; var ab = gp; xe.throttle = ab.throttle; xe.throttleDone = ab.done; xe.clearThrottle = ab.clear; var Xi = dp; xe.getGraphDiv = Xi.getGraphDiv; xe.isPlotDiv = Xi.isPlotDiv; xe.removeElement = Xi.removeElement; xe.addStyleRule = Xi.addStyleRule; xe.addRelatedStyleRule = Xi.addRelatedStyleRule; xe.deleteRelatedStyleRule = Xi.deleteRelatedStyleRule; xe.getFullTransformMatrix = Xi.getFullTransformMatrix; xe.getElementTransformMatrix = Xi.getElementTransformMatrix; xe.getElementAndAncestors = Xi.getElementAndAncestors; xe.equalDomRects = Xi.equalDomRects; xe.clearResponsive = $V; xe.preserveDrawingBuffer = jV; xe.makeTraceGroups = VV; xe._ = WV; xe.notifier = rL; xe.filterUnique = ZV; xe.filterVisible = YV; xe.pushUnique = nL; xe.increment = QV; xe.cleanNumber = nq; xe.ensureNumber = function(t) { return LL(t) ? (t = Number(t), t > EL || t < oq ? S2 : t) : S2; }; xe.isIndex = function(e10, t) { return t !== void 0 && e10 >= t ? false : LL(e10) && e10 >= 0 && e10 % 1 === 0; }; xe.noop = Y1; xe.identity = wL; xe.repeat = function(e10, t) { for (var r = new Array(t), n = 0; n < t; n++) r[n] = e10; return r; }; xe.swapAttrs = function(e10, t, r, n) { r || (r = "x"), n || (n = "y"); for (var a = 0; a < t.length; a++) { var i = t[a], o = xe.nestedProperty(e10, i.replace("?", r)), l = xe.nestedProperty(e10, i.replace("?", n)), s = o.get(); o.set(l.get()), l.set(s); } }; xe.raiseToTop = function(t) { t.parentNode.appendChild(t); }; xe.cancelTransition = function(e10) { return e10.transition().duration(0); }; xe.constrain = function(e10, t, r) { return t > r ? Math.max(r, Math.min(t, e10)) : Math.max(t, Math.min(r, e10)); }; xe.bBoxIntersect = function(e10, t, r) { return r = r || 0, e10.left <= t.right + r && t.left <= e10.right + r && e10.top <= t.bottom + r && t.top <= e10.bottom + r; }; xe.simpleMap = function(e10, t, r, n, a) { for (var i = e10.length, o = new Array(i), l = 0; l < i; l++) o[l] = t(e10[l], r, n, a); return o; }; xe.randstr = function e3(t, r, n, a) { if (n || (n = 16), r === void 0 && (r = 24), r <= 0) return "0"; var i = Math.log(Math.pow(2, r)) / Math.log(n), o = "", l, s, u; for (l = 2; i === 1 / 0; l *= 2) i = Math.log(Math.pow(2, r / l)) / Math.log(n) * l; var f = i - Math.floor(i); for (l = 0; l < Math.floor(i); l++) u = Math.floor(Math.random() * n).toString(n), o = u + o; f && (s = Math.pow(n, f), u = Math.floor(Math.random() * s).toString(n), o = u + o); var d = parseInt(o, n); return t && t[o] || d !== 1 / 0 && d >= Math.pow(2, r) ? a > 10 ? (xe.warn("randstr failed uniqueness"), o) : e3(t, r, n, (a || 0) + 1) : o; }; xe.OptionControl = function(e10, t) { e10 || (e10 = {}), t || (t = "opt"); var r = {}; return r.optionList = [], r._newoption = function(n) { n[t] = e10, r[n.name] = n, r.optionList.push(n); }, r["_" + t] = e10, r; }; xe.smooth = function(e10, t) { if (t = Math.round(t) || 0, t < 2) return e10; var r = e10.length, n = 2 * r, a = 2 * t - 1, i = new Array(a), o = new Array(r), l, s, u, f; for (l = 0; l < a; l++) i[l] = (1 - Math.cos(Math.PI * (l + 1) / t)) / (2 * t); for (l = 0; l < r; l++) { for (f = 0, s = 0; s < a; s++) u = l + s + 1 - t, u < -r ? u -= n * Math.round(u / n) : u >= n && (u -= n * Math.floor(u / n)), u < 0 ? u = -1 - u : u >= r && (u = n - 1 - u), f += e10[u] * i[s]; o[l] = f; } return o; }; xe.syncOrAsync = function(e10, t, r) { var n, a; function i() { return xe.syncOrAsync(e10, t, r); } for (; e10.length; ) if (a = e10.splice(0, 1)[0], n = a(t), n && n.then) return n.then(i); return r && r(t); }; xe.stripTrailingSlash = function(e10) { return e10.substr(-1) === "/" ? e10.substr(0, e10.length - 1) : e10; }; xe.noneOrAll = function(e10, t, r) { if (e10) { var n = false, a = true, i, o; for (i = 0; i < r.length; i++) o = e10[r[i]], o != null ? n = true : a = false; if (n && !a) for (i = 0; i < r.length; i++) e10[r[i]] = t[r[i]]; } }; xe.mergeArray = function(e10, t, r, n) { var a = typeof n == "function"; if (xe.isArrayOrTypedArray(e10)) for (var i = Math.min(e10.length, t.length), o = 0; o < i; o++) { var l = e10[o]; t[o][r] = a ? n(l) : l; } }; xe.mergeArrayCastPositive = function(e10, t, r) { return xe.mergeArray(e10, t, r, function(n) { var a = +n; return isFinite(a) && a > 0 ? a : 0; }); }; xe.fillArray = function(e10, t, r, n) { if (n = n || xe.identity, xe.isArrayOrTypedArray(e10)) for (var a = 0; a < t.length; a++) t[a][r] = n(e10[a]); }; xe.castOption = function(e10, t, r, n) { n = n || xe.identity; var a = xe.nestedProperty(e10, r).get(); return xe.isArrayOrTypedArray(a) ? Array.isArray(t) && xe.isArrayOrTypedArray(a[t[0]]) ? n(a[t[0]][t[1]]) : n(a[t]) : a; }; xe.extractOption = function(e10, t, r, n) { if (r in e10) return e10[r]; var a = xe.nestedProperty(t, n).get(); if (!Array.isArray(a)) return a; }; function RL(e10) { var t = {}; for (var r in e10) for (var n = e10[r], a = 0; a < n.length; a++) t[n[a]] = +r; return t; } xe.tagSelected = function(e10, t, r) { var n = t.selectedpoints, a = t._indexToPoints, i; a && (i = RL(a)); function o(d) { return d !== void 0 && d < e10.length; } for (var l = 0; l < n.length; l++) { var s = n[l]; if (xe.isIndex(s) || xe.isArrayOrTypedArray(s) && xe.isIndex(s[0]) && xe.isIndex(s[1])) { var u = i ? i[s] : s, f = r ? r[u] : u; o(f) && (e10[f].selected = 1); } } }; xe.selIndices2selPoints = function(e10) { var t = e10.selectedpoints, r = e10._indexToPoints; if (r) { for (var n = RL(r), a = [], i = 0; i < t.length; i++) { var o = t[i]; if (xe.isIndex(o)) { var l = n[o]; xe.isIndex(l) && a.push(l); } } return a; } else return t; }; xe.getTargetArray = function(e10, t) { var r = t.target; if (typeof r == "string" && r) { var n = xe.nestedProperty(e10, r).get(); return xe.isArrayOrTypedArray(n) ? n : false; } else if (xe.isArrayOrTypedArray(r)) return r; return false; }; function PL(e10, t, r) { var n = {}; typeof t != "object" && (t = {}); var a = r === "pieLike" ? -1 : 3, i = Object.keys(e10), o, l, s; for (o = 0; o < i.length; o++) l = i[o], s = e10[l], !(l.charAt(0) === "_" || typeof s == "function") && (l === "module" ? n[l] = s : Array.isArray(s) ? l === "colorscale" || a === -1 ? n[l] = s.slice() : n[l] = s.slice(0, a) : xe.isTypedArray(s) ? a === -1 ? n[l] = s.subarray() : n[l] = s.subarray(0, a) : s && typeof s == "object" ? n[l] = PL(e10[l], t[l], r) : n[l] = s); for (i = Object.keys(t), o = 0; o < i.length; o++) l = i[o], s = t[l], (typeof s != "object" || !(l in n) || typeof n[l] != "object") && (n[l] = s); return n; } xe.minExtend = PL; xe.titleCase = function(e10) { return e10.charAt(0).toUpperCase() + e10.substr(1); }; xe.containsAny = function(e10, t) { for (var r = 0; r < t.length; r++) if (e10.indexOf(t[r]) !== -1) return true; return false; }; xe.isIE = function() { return typeof window.navigator.msSaveBlob < "u"; }; var sq = /Version\/[\d\.]+.*Safari/; xe.isSafari = function() { return sq.test(window.navigator.userAgent); }; var uq = /iPad|iPhone|iPod/; xe.isIOS = function() { return uq.test(window.navigator.userAgent); }; var fq = /Firefox\/(\d+)\.\d+/; xe.getFirefoxVersion = function() { var e10 = fq.exec(window.navigator.userAgent); if (e10 && e10.length === 2) { var t = parseInt(e10[1]); if (!isNaN(t)) return t; } return null; }; xe.isD3Selection = function(e10) { return e10 instanceof Zf.selection; }; xe.ensureSingle = function(e10, t, r, n) { var a = e10.select(t + (r ? "." + r : "")); if (a.size()) return a; var i = e10.append(t); return r && i.classed(r, true), n && i.call(n), i; }; xe.ensureSingleById = function(e10, t, r, n) { var a = e10.select(t + "#" + r); if (a.size()) return a; var i = e10.append(t).attr("id", r); return n && i.call(n), i; }; xe.objectFromPath = function(e10, t) { for (var r = e10.split("."), n, a = n = {}, i = 0; i < r.length; i++) { var o = r[i], l = null, s = r[i].match(/(.*)\[([0-9]+)\]/); s ? (o = s[1], l = s[2], n = n[o] = [], i === r.length - 1 ? n[l] = t : n[l] = {}, n = n[l]) : (i === r.length - 1 ? n[o] = t : n[o] = {}, n = n[o]); } return a; }; var cq = /^([^\[\.]+)\.(.+)?/; var dq = /^([^\.]+)\[([0-9]+)\](\.)?(.+)?/; function Od(e10) { return e10.slice(0, 2) === "__"; } xe.expandObjectPaths = function(e10) { var t, r, n, a, i, o, l; if (typeof e10 == "object" && !Array.isArray(e10)) { for (r in e10) if (e10.hasOwnProperty(r)) if (t = r.match(cq)) { if (a = e10[r], n = t[1], Od(n)) continue; delete e10[r], e10[n] = xe.extendDeepNoArrays(e10[n] || {}, xe.objectFromPath(r, xe.expandObjectPaths(a))[n]); } else if (t = r.match(dq)) { if (a = e10[r], n = t[1], Od(n)) continue; if (i = parseInt(t[2]), delete e10[r], e10[n] = e10[n] || [], t[3] === ".") l = t[4], o = e10[n][i] = e10[n][i] || {}, xe.extendDeepNoArrays(o, xe.objectFromPath(l, xe.expandObjectPaths(a))); else { if (Od(n)) continue; e10[n][i] = xe.expandObjectPaths(a); } } else { if (Od(r)) continue; e10[r] = xe.expandObjectPaths(e10[r]); } } return e10; }; xe.numSeparate = function(e10, t, r) { if (r || (r = false), typeof t != "string" || t.length === 0) throw new Error("Separator string required for formatting!"); typeof e10 == "number" && (e10 = String(e10)); var n = /(\d+)(\d{3})/, a = t.charAt(0), i = t.charAt(1), o = e10.split("."), l = o[0], s = o.length > 1 ? a + o[1] : ""; if (i && (o.length > 1 || l.length > 4 || r)) for (; n.test(l); ) l = l.replace(n, "$1" + i + "$2"); return l + s; }; xe.TEMPLATE_STRING_REGEX = /%{([^\s%{}:]*)([:|\|][^}]*)?}/g; var $L = /^\w*$/; xe.templateString = function(e10, t) { var r = {}; return e10.replace(xe.TEMPLATE_STRING_REGEX, function(n, a) { var i; return $L.test(a) ? i = t[a] : (r[a] = r[a] || xe.nestedProperty(t, a).get, i = r[a]()), xe.isValidTextValue(i) ? i : ""; }); }; var hq = { max: 10, count: 0, name: "hovertemplate" }; xe.hovertemplateString = function() { return ib.apply(hq, arguments); }; var vq = { max: 10, count: 0, name: "texttemplate" }; xe.texttemplateString = function() { return ib.apply(vq, arguments); }; var pq = /^(\S+)([\*\/])(-?\d+(\.\d+)?)$/; function mq(e10) { var t = e10.match(pq); return t ? { key: t[1], op: t[2], number: Number(t[3]) } : { key: e10, op: null, number: null }; } var gq = { max: 10, count: 0, name: "texttemplate", parseMultDiv: true }; xe.texttemplateStringForShapes = function() { return ib.apply(gq, arguments); }; var L2 = /^[:|\|]/; function ib(e10, t, r) { var n = this, a = arguments; t || (t = {}); var i = {}; return e10.replace(xe.TEMPLATE_STRING_REGEX, function(o, l, s) { var u = l === "xother" || l === "yother", f = l === "_xother" || l === "_yother", d = l === "_xother_" || l === "_yother_", h = l === "xother_" || l === "yother_", p = u || f || h || d, v = l; (f || d) && (v = v.substring(1)), (h || d) && (v = v.substring(0, v.length - 1)); var m = null, g = null; if (n.parseMultDiv) { var y = mq(v); v = y.key, m = y.op, g = y.number; } var w; if (p) { if (w = t[v], w === void 0) return ""; } else { var k, x; for (x = 3; x < a.length; x++) if (k = a[x], !!k) { if (k.hasOwnProperty(v)) { w = k[v]; break; } if ($L.test(v) || (w = xe.nestedProperty(k, v).get(), w = i[v] || xe.nestedProperty(k, v).get(), w && (i[v] = w)), w !== void 0) break; } } if (w !== void 0 && (m === "*" && (w *= g), m === "/" && (w /= g)), w === void 0 && n) return n.count < n.max && (xe.warn("Variable '" + v + "' in " + n.name + " could not be found!"), w = o), n.count === n.max && xe.warn("Too many " + n.name + " warnings - additional warnings will be suppressed"), n.count++, o; if (s) { var _; if (s[0] === ":" && (_ = r ? r.numberFormat : xe.numberFormat, w = _(s.replace(L2, ""))(w)), s[0] === "|") { _ = r ? r.timeFormat : aq; var T = xe.dateTime2ms(w); w = xe.formatDate(T, s.replace(L2, ""), false, _); } } else { var S = v + "Label"; t.hasOwnProperty(S) && (w = t[S]); } return p && (w = "(" + w + ")", (f || d) && (w = " " + w), (h || d) && (w = w + " ")), w; }); } var Hd = 48; var D2 = 57; xe.subplotSort = function(e10, t) { for (var r = Math.min(e10.length, t.length) + 1, n = 0, a = 0, i = 0; i < r; i++) { var o = e10.charCodeAt(i) || 0, l = t.charCodeAt(i) || 0, s = o >= Hd && o <= D2, u = l >= Hd && l <= D2; if (s && (n = 10 * n + o - Hd), u && (a = 10 * a + l - Hd), !s || !u) { if (n !== a) return n - a; if (o !== l) return o - l; } } return a - n; }; var ru = 2e9; xe.seedPseudoRandom = function() { ru = 2e9; }; xe.pseudoRandom = function() { var e10 = ru; return ru = (69069 * ru + 1) % 4294967296, Math.abs(ru - e10) < 429496729 ? xe.pseudoRandom() : ru / 4294967296; }; xe.fillText = function(e10, t, r) { var n = Array.isArray(r) ? function(o) { r.push(o); } : function(o) { r.text = o; }, a = xe.extractOption(e10, t, "htx", "hovertext"); if (xe.isValidTextValue(a)) return n(a); var i = xe.extractOption(e10, t, "tx", "text"); if (xe.isValidTextValue(i)) return n(i); }; xe.isValidTextValue = function(e10) { return e10 || e10 === 0; }; xe.formatPercent = function(e10, t) { t = t || 0; for (var r = (Math.round(100 * e10 * Math.pow(10, t)) * Math.pow(0.1, t)).toFixed(t) + "%", n = 0; n < t; n++) r.indexOf(".") !== -1 && (r = r.replace("0%", "%"), r = r.replace(".%", "%")); return r; }; xe.isHidden = function(e10) { var t = window.getComputedStyle(e10).display; return !t || t === "none"; }; xe.strTranslate = function(e10, t) { return e10 || t ? "translate(" + e10 + "," + t + ")" : ""; }; xe.strRotate = function(e10) { return e10 ? "rotate(" + e10 + ")" : ""; }; xe.strScale = function(e10) { return e10 !== 1 ? "scale(" + e10 + ")" : ""; }; xe.getTextTransform = function(e10) { var t = e10.noCenter, r = e10.textX, n = e10.textY, a = e10.targetX, i = e10.targetY, o = e10.anchorX || 0, l = e10.anchorY || 0, s = e10.rotate, u = e10.scale; return u ? u > 1 && (u = 1) : u = 0, xe.strTranslate( a - u * (r + o), i - u * (n + l) ) + xe.strScale(u) + (s ? "rotate(" + s + (t ? "" : " " + r + " " + n) + ")" : ""); }; xe.setTransormAndDisplay = function(e10, t) { e10.attr("transform", xe.getTextTransform(t)), e10.style("display", t.scale ? null : "none"); }; xe.ensureUniformFontSize = function(e10, t) { var r = xe.extendFlat({}, t); return r.size = Math.max( t.size, e10._fullLayout.uniformtext.minsize || 0 ), r; }; xe.join2 = function(e10, t, r) { var n = e10.length; return n > 1 ? e10.slice(0, -1).join(t) + r + e10[n - 1] : e10.join(t); }; xe.bigFont = function(e10) { return Math.round(1.2 * e10); }; var E2 = xe.getFirefoxVersion(); var yq = E2 !== null && E2 < 86; xe.getPositionFromD3Event = function() { return yq ? [ Zf.event.layerX, Zf.event.layerY ] : [ Zf.event.offsetX, Zf.event.offsetY ]; }; var Ue = aC.exports; var bq = Ue; var F2 = { "X,X div": 'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;', "X input,X button": 'font-family:"Open Sans",verdana,arial,sans-serif;', "X input:focus,X button:focus": "outline:none;", "X a": "text-decoration:none;", "X a:hover": "text-decoration:none;", "X .crisp": "shape-rendering:crispEdges;", "X .user-select-none": "-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;", "X svg": "overflow:hidden;", "X svg a": "fill:#447adb;", "X svg a:hover": "fill:#3c6dc5;", "X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;", "X .main-svg .draglayer": "pointer-events:all;", "X .cursor-default": "cursor:default;", "X .cursor-pointer": "cursor:pointer;", "X .cursor-crosshair": "cursor:crosshair;", "X .cursor-move": "cursor:move;", "X .cursor-col-resize": "cursor:col-resize;", "X .cursor-row-resize": "cursor:row-resize;", "X .cursor-ns-resize": "cursor:ns-resize;", "X .cursor-ew-resize": "cursor:ew-resize;", "X .cursor-sw-resize": "cursor:sw-resize;", "X .cursor-s-resize": "cursor:s-resize;", "X .cursor-se-resize": "cursor:se-resize;", "X .cursor-w-resize": "cursor:w-resize;", "X .cursor-e-resize": "cursor:e-resize;", "X .cursor-nw-resize": "cursor:nw-resize;", "X .cursor-n-resize": "cursor:n-resize;", "X .cursor-ne-resize": "cursor:ne-resize;", "X .cursor-grab": "cursor:-webkit-grab;cursor:grab;", "X .modebar": "position:absolute;top:2px;right:2px;", "X .ease-bg": "-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;", "X .modebar--hover>:not(.watermark)": "opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;", "X:hover .modebar--hover .modebar-group": "opacity:1;", "X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;", "X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;", "X .modebar-btn svg": "position:relative;top:2px;", "X .modebar.vertical": "display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;", "X .modebar.vertical svg": "top:-1px;", "X .modebar.vertical .modebar-group": "display:block;float:none;padding-left:0px;padding-bottom:8px;", "X .modebar.vertical .modebar-group .modebar-btn": "display:block;text-align:center;", "X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;", "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;", "X [data-title]:before": 'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;', "X [data-title]:after": "content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;", "X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;", "X .vertical [data-title]:before": "border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;", Y: 'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;', "Y p": "margin:0;", "Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;", "Y .notifier-close": "color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;", "Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;" }; for (R2 in F2) { _q = R2.replace(/^,/, " ,").replace(/X/g, ".js-plotly-plot .plotly").replace(/Y/g, ".plotly-notifier"); bq.addStyleRule(_q, F2[R2]); } var _q; var R2; var Or = {}; var ob = {}; var xq = true; var wq = xq; var uy; typeof Wl.matchMedia == "function" ? uy = !Wl.matchMedia("(hover: none)").matches : uy = wq; var zL = uy; var lb = { exports: {} }; var gu = typeof Reflect == "object" ? Reflect : null; var P2 = gu && typeof gu.apply == "function" ? gu.apply : function(t, r, n) { return Function.prototype.apply.call(t, r, n); }; var Rh; gu && typeof gu.ownKeys == "function" ? Rh = gu.ownKeys : Object.getOwnPropertySymbols ? Rh = function(t) { return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)); } : Rh = function(t) { return Object.getOwnPropertyNames(t); }; function Tq(e10) { console && console.warn && console.warn(e10); } var IL = Number.isNaN || function(t) { return t !== t; }; function Nr() { Nr.init.call(this); } lb.exports = Nr; lb.exports.once = Sq; Nr.EventEmitter = Nr; Nr.prototype._events = void 0; Nr.prototype._eventsCount = 0; Nr.prototype._maxListeners = void 0; var $2 = 10; function _p(e10) { if (typeof e10 != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e10); } Object.defineProperty(Nr, "defaultMaxListeners", { enumerable: true, get: function() { return $2; }, set: function(e10) { if (typeof e10 != "number" || e10 < 0 || IL(e10)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e10 + "."); $2 = e10; } }); Nr.init = function() { (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; }; Nr.prototype.setMaxListeners = function(t) { if (typeof t != "number" || t < 0 || IL(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + "."); return this._maxListeners = t, this; }; function NL(e10) { return e10._maxListeners === void 0 ? Nr.defaultMaxListeners : e10._maxListeners; } Nr.prototype.getMaxListeners = function() { return NL(this); }; Nr.prototype.emit = function(t) { for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]); var a = t === "error", i = this._events; if (i !== void 0) a = a && i.error === void 0; else if (!a) return false; if (a) { var o; if (r.length > 0 && (o = r[0]), o instanceof Error) throw o; var l = new Error("Unhandled error." + (o ? " (" + o.message + ")" : "")); throw l.context = o, l; } var s = i[t]; if (s === void 0) return false; if (typeof s == "function") P2(s, this, r); else for (var u = s.length, f = UL(s, u), n = 0; n < u; ++n) P2(f[n], this, r); return true; }; function OL(e10, t, r, n) { var a, i, o; if (_p(r), i = e10._events, i === void 0 ? (i = e10._events = /* @__PURE__ */ Object.create(null), e10._eventsCount = 0) : (i.newListener !== void 0 && (e10.emit( "newListener", t, r.listener ? r.listener : r ), i = e10._events), o = i[t]), o === void 0) o = i[t] = r, ++e10._eventsCount; else if (typeof o == "function" ? o = i[t] = n ? [r, o] : [o, r] : n ? o.unshift(r) : o.push(r), a = NL(e10), a > 0 && o.length > a && !o.warned) { o.warned = true; var l = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit"); l.name = "MaxListenersExceededWarning", l.emitter = e10, l.type = t, l.count = o.length, Tq(l); } return e10; } Nr.prototype.addListener = function(t, r) { return OL(this, t, r, false); }; Nr.prototype.on = Nr.prototype.addListener; Nr.prototype.prependListener = function(t, r) { return OL(this, t, r, true); }; function kq() { if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = true, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); } function HL(e10, t, r) { var n = { fired: false, wrapFn: void 0, target: e10, type: t, listener: r }, a = kq.bind(n); return a.listener = r, n.wrapFn = a, a; } Nr.prototype.once = function(t, r) { return _p(r), this.on(t, HL(this, t, r)), this; }; Nr.prototype.prependOnceListener = function(t, r) { return _p(r), this.prependListener(t, HL(this, t, r)), this; }; Nr.prototype.removeListener = function(t, r) { var n, a, i, o, l; if (_p(r), a = this._events, a === void 0) return this; if (n = a[t], n === void 0) return this; if (n === r || n.listener === r) --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete a[t], a.removeListener && this.emit("removeListener", t, n.listener || r)); else if (typeof n != "function") { for (i = -1, o = n.length - 1; o >= 0; o--) if (n[o] === r || n[o].listener === r) { l = n[o].listener, i = o; break; } if (i < 0) return this; i === 0 ? n.shift() : Aq(n, i), n.length === 1 && (a[t] = n[0]), a.removeListener !== void 0 && this.emit("removeListener", t, l || r); } return this; }; Nr.prototype.off = Nr.prototype.removeListener; Nr.prototype.removeAllListeners = function(t) { var r, n, a; if (n = this._events, n === void 0) return this; if (n.removeListener === void 0) return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : n[t] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete n[t]), this; if (arguments.length === 0) { var i = Object.keys(n), o; for (a = 0; a < i.length; ++a) o = i[a], o !== "removeListener" && this.removeAllListeners(o); return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; } if (r = n[t], typeof r == "function") this.removeListener(t, r); else if (r !== void 0) for (a = r.length - 1; a >= 0; a--) this.removeListener(t, r[a]); return this; }; function BL(e10, t, r) { var n = e10._events; if (n === void 0) return []; var a = n[t]; return a === void 0 ? [] : typeof a == "function" ? r ? [a.listener || a] : [a] : r ? Mq(a) : UL(a, a.length); } Nr.prototype.listeners = function(t) { return BL(this, t, true); }; Nr.prototype.rawListeners = function(t) { return BL(this, t, false); }; Nr.listenerCount = function(e10, t) { return typeof e10.listenerCount == "function" ? e10.listenerCount(t) : jL.call(e10, t); }; Nr.prototype.listenerCount = jL; function jL(e10) { var t = this._events; if (t !== void 0) { var r = t[e10]; if (typeof r == "function") return 1; if (r !== void 0) return r.length; } return 0; } Nr.prototype.eventNames = function() { return this._eventsCount > 0 ? Rh(this._events) : []; }; function UL(e10, t) { for (var r = new Array(t), n = 0; n < t; ++n) r[n] = e10[n]; return r; } function Aq(e10, t) { for (; t + 1 < e10.length; t++) e10[t] = e10[t + 1]; e10.pop(); } function Mq(e10) { for (var t = new Array(e10.length), r = 0; r < t.length; ++r) t[r] = e10[r].listener || e10[r]; return t; } function Sq(e10, t) { return new Promise(function(r, n) { function a(o) { e10.removeListener(t, i), n(o); } function i() { typeof e10.removeListener == "function" && e10.removeListener("error", a), r([].slice.call(arguments)); } GL(e10, t, i, { once: true }), t !== "error" && Cq(e10, a, { once: true }); }); } function Cq(e10, t, r) { typeof e10.on == "function" && GL(e10, "error", t, r); } function GL(e10, t, r, n) { if (typeof e10.on == "function") n.once ? e10.once(t, r) : e10.on(t, r); else if (typeof e10.addEventListener == "function") e10.addEventListener(t, function a(i) { n.once && e10.removeEventListener(t, a), r(i); }); else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e10); } var sb = lb.exports; var Zm = sb.EventEmitter; var Lq = { init: function(e10) { if (e10._ev instanceof Zm) return e10; var t = new Zm(), r = new Zm(); return e10._ev = t, e10._internalEv = r, e10.on = t.on.bind(t), e10.once = t.once.bind(t), e10.removeListener = t.removeListener.bind(t), e10.removeAllListeners = t.removeAllListeners.bind(t), e10._internalOn = r.on.bind(r), e10._internalOnce = r.once.bind(r), e10._removeInternalListener = r.removeListener.bind(r), e10._removeAllInternalListeners = r.removeAllListeners.bind(r), e10.emit = function(n, a) { typeof jQuery < "u" && jQuery(e10).trigger(n, a), t.emit(n, a), r.emit(n, a); }, e10; }, /* * This function behaves like jQuery's triggerHandler. It calls * all handlers for a particular event and returns the return value * of the LAST handler. This function also triggers jQuery's * triggerHandler for backwards compatibility. */ triggerHandler: function(e10, t, r) { var n, a; typeof jQuery < "u" && (n = jQuery(e10).triggerHandler(t, r)); var i = e10._ev; if (!i) return n; var o = i._events[t]; if (!o) return n; function l(u) { if (u.listener) { if (i.removeListener(t, u.listener), !u.fired) return u.fired = true, u.listener.apply(i, [r]); } else return u.apply(i, [r]); } o = Array.isArray(o) ? o : [o]; var s; for (s = 0; s < o.length - 1; s++) l(o[s]); return a = l(o[s]), n !== void 0 ? n : a; }, purge: function(e10) { return delete e10._ev, delete e10.on, delete e10.once, delete e10.removeListener, delete e10.removeAllListeners, delete e10.emit, delete e10._ev, delete e10._internalEv, delete e10._internalOn, delete e10._internalOnce, delete e10._removeInternalListener, delete e10._removeAllInternalListeners, e10; } }; var xp = Lq; var z2 = Ue; var Dq = Yu.dfltConfig; function Eq(e10, t) { for (var r = [], n, a = 0; a < t.length; a++) n = t[a], n === e10 ? r[a] = n : typeof n == "object" ? r[a] = Array.isArray(n) ? z2.extendDeep([], n) : z2.extendDeepAll({}, n) : r[a] = n; return r; } var ko = {}; ko.add = function(e10, t, r, n, a) { var i, o; if (e10.undoQueue = e10.undoQueue || { index: 0, queue: [], sequence: false }, o = e10.undoQueue.index, e10.autoplay) { e10.undoQueue.inSequence || (e10.autoplay = false); return; } !e10.undoQueue.sequence || e10.undoQueue.beginSequence ? (i = { undo: { calls: [], args: [] }, redo: { calls: [], args: [] } }, e10.undoQueue.queue.splice(o, e10.undoQueue.queue.length - o, i), e10.undoQueue.index += 1) : i = e10.undoQueue.queue[o - 1], e10.undoQueue.beginSequence = false, i && (i.undo.calls.unshift(t), i.undo.args.unshift(r), i.redo.calls.push(n), i.redo.args.push(a)), e10.undoQueue.queue.length > Dq.queueLength && (e10.undoQueue.queue.shift(), e10.undoQueue.index--); }; ko.startSequence = function(e10) { e10.undoQueue = e10.undoQueue || { index: 0, queue: [], sequence: false }, e10.undoQueue.sequence = true, e10.undoQueue.beginSequence = true; }; ko.stopSequence = function(e10) { e10.undoQueue = e10.undoQueue || { index: 0, queue: [], sequence: false }, e10.undoQueue.sequence = false, e10.undoQueue.beginSequence = false; }; ko.undo = function(t) { var r, n; if (!(t.undoQueue === void 0 || isNaN(t.undoQueue.index) || t.undoQueue.index <= 0)) { for (t.undoQueue.index--, r = t.undoQueue.queue[t.undoQueue.index], t.undoQueue.inSequence = true, n = 0; n < r.undo.calls.length; n++) ko.plotDo(t, r.undo.calls[n], r.undo.args[n]); t.undoQueue.inSequence = false, t.autoplay = false; } }; ko.redo = function(t) { var r, n; if (!(t.undoQueue === void 0 || isNaN(t.undoQueue.index) || t.undoQueue.index >= t.undoQueue.queue.length)) { for (r = t.undoQueue.queue[t.undoQueue.index], t.undoQueue.inSequence = true, n = 0; n < r.redo.calls.length; n++) ko.plotDo(t, r.redo.calls[n], r.redo.args[n]); t.undoQueue.inSequence = false, t.autoplay = false, t.undoQueue.index++; } }; ko.plotDo = function(e10, t, r) { e10.autoplay = true, r = Eq(e10, r), t.apply(null, r); }; var Fq = ko; var Qu = {}; var VL = { _isLinkedToArray: "frames_entry", group: { valType: "string", description: [ "An identifier that specifies the group to which the frame belongs,", "used by animate to select a subset of frames." ].join(" ") }, name: { valType: "string", description: "A label by which to identify the frame" }, traces: { valType: "any", description: [ "A list of trace indices that identify the respective traces in the", "data attribute" ].join(" ") }, baseframe: { valType: "string", description: [ "The name of the frame into which this frame's properties are merged", "before applying. This is used to unify properties and avoid needing", "to specify the same values for the same properties in multiple frames." ].join(" ") }, data: { valType: "any", description: [ "A list of traces this frame modifies. The format is identical to the", "normal trace definition." ].join(" ") }, layout: { valType: "any", description: [ "Layout properties which this frame modifies. The format is identical", "to the normal layout definition." ].join(" ") } }; (function(e10) { var t = Nt, r = Ue, n = Wi, a = Xc, i = VL, o = hp, l = Yu.configAttributes, s = Lo, u = r.extendDeepAll, f = r.isPlainObject, d = r.isArrayOrTypedArray, h = r.nestedProperty, p = r.valObjectMeta, v = "_isSubplotObj", m = "_isLinkedToArray", g = "_arrayAttrRegexps", y = "_deprecated", w = [v, m, g, y]; e10.IS_SUBPLOT_OBJ = v, e10.IS_LINKED_TO_ARRAY = m, e10.DEPRECATED = y, e10.UNDERSCORE_ATTRS = w, e10.get = function() { var V = {}; t.allTypes.forEach(function(P) { V[P] = T(P); }); var z = {}; return Object.keys(t.transformsRegistry).forEach(function(P) { z[P] = M(P); }), { defs: { valObjects: p, metaKeys: w.concat(["description", "role", "editType", "impliedEdits"]), editType: { traces: s.traces, layout: s.layout }, impliedEdits: { description: [ "Sometimes when an attribute is changed, other attributes", "must be altered as well in order to achieve the intended", "result. For example, when `range` is specified, it is", "important to set `autorange` to `false` or the new `range`", "value would be lost in the redraw. `impliedEdits` is the", "mechanism to do this: `impliedEdits: {autorange: false}`.", "Each key is a relative paths to the attribute string to", "change, using *^* to ascend into the parent container,", "for example `range[0]` has `impliedEdits: {*^autorange*: false}`.", "A value of `undefined` means that the attribute will not be", "changed, but its previous value should be recorded in case", "we want to reverse this change later. For example, `autorange`", "has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined}", "because the range will likely be changed by redraw." ].join(" ") } }, traces: V, layout: S(), transforms: z, frames: L(), animation: F(o), config: F(l) }; }, e10.crawl = function(V, z, P, R) { var H = P || 0; R = R || "", Object.keys(V).forEach(function(B) { var W = V[B]; if (w.indexOf(B) === -1) { var ee = (R ? R + "." : "") + B; z(W, B, V, H, ee), !e10.isValObject(W) && f(W) && B !== "impliedEdits" && e10.crawl(W, z, H + 1, ee); } }); }, e10.isValObject = function(V) { return V && V.valType !== void 0; }, e10.findArrayAttributes = function(V) { var z = [], P = [], R = [], H, B; function W(j, U, Z, le) { P = P.slice(0, le).concat([U]), R = R.slice(0, le).concat([j && j._isLinkedToArray]); var J = j && (j.valType === "data_array" || j.arrayOk === true) && !(P[le - 1] === "colorbar" && (U === "ticktext" || U === "tickvals")); J && ee(H, 0, ""); } function ee(j, U, Z) { var le = j[P[U]], J = Z + P[U]; if (U === P.length - 1) d(le) && z.push(B + J); else if (R[U]) { if (Array.isArray(le)) for (var pe = 0; pe < le.length; pe++) f(le[pe]) && ee(le[pe], U + 1, J + "[" + pe + "]."); } else f(le) && ee(le, U + 1, J + "."); } H = V, B = "", e10.crawl(n, W), V._module && V._module.attributes && e10.crawl(V._module.attributes, W); var re = V.transforms; if (re) for (var ae = 0; ae < re.length; ae++) { var Q = re[ae], ue = Q._module; ue && (B = "transforms[" + ae + "].", H = Q, e10.crawl(ue.attributes, W)); } return z; }, e10.getTraceValObject = function(V, z) { var P = z[0], R = 1, H, B; if (P === "transforms") { if (z.length === 1) return n.transforms; var W = V.transforms; if (!Array.isArray(W) || !W.length) return false; var ee = z[1]; if (!_(ee) || ee >= W.length) return false; H = (t.transformsRegistry[W[ee].type] || {}).attributes, B = H && H[z[2]], R = 3; } else { var re = V._module; if (re || (re = (t.modules[V.type || n.type.dflt] || {})._module), !re) return false; if (H = re.attributes, B = H && H[P], !B) { var ae = re.basePlotModule; ae && ae.attributes && (B = ae.attributes[P]); } B || (B = n[P]); } return x(B, z, R); }, e10.getLayoutValObject = function(V, z) { var P = k(V, z[0]); return x(P, z, 1); }; function k(V, z) { var P, R, H, B, W = V._basePlotModules; if (W) { var ee; for (P = 0; P < W.length; P++) { if (H = W[P], H.attrRegex && H.attrRegex.test(z)) { if (H.layoutAttrOverrides) return H.layoutAttrOverrides; !ee && H.layoutAttributes && (ee = H.layoutAttributes); } var re = H.baseLayoutAttrOverrides; if (re && z in re) return re[z]; } if (ee) return ee; } var ae = V._modules; if (ae) { for (P = 0; P < ae.length; P++) if (B = ae[P].layoutAttributes, B && z in B) return B[z]; } for (R in t.componentsRegistry) { if (H = t.componentsRegistry[R], H.name === "colorscale" && z.indexOf("coloraxis") === 0) return H.layoutAttributes[z]; if (!H.schema && z === H.name) return H.layoutAttributes; } return z in a ? a[z] : false; } function x(V, z, P) { if (!V) return false; if (V._isLinkedToArray) { if (_(z[P])) P++; else if (P < z.length) return false; } for (; P < z.length; P++) { var R = V[z[P]]; if (f(R)) V = R; else break; if (P === z.length - 1) break; if (V._isLinkedToArray) { if (P++, !_(z[P])) return false; } else if (V.valType === "info_array") { P++; var H = z[P]; if (!_(H)) return false; var B = V.items; if (Array.isArray(B)) { if (H >= B.length) return false; if (V.dimensions === 2) { if (P++, z.length === P) return V; var W = z[P]; if (!_(W)) return false; V = B[H][W]; } else V = B[H]; } else V = B; } } return V; } function _(V) { return V === Math.round(V) && V >= 0; } function T(V) { var z, P; z = t.modules[V]._module, P = z.basePlotModule; var R = {}; R.type = null; var H = u({}, n), B = u({}, z.attributes); e10.crawl(B, function(re, ae, Q, ue, j) { h(H, j).set(void 0), re === void 0 && h(B, j).set(void 0); }), u(R, H), t.traceIs(V, "noOpacity") && delete R.opacity, t.traceIs(V, "showLegend") || (delete R.showlegend, delete R.legendgroup), t.traceIs(V, "noHover") && (delete R.hoverinfo, delete R.hoverlabel), z.selectPoints || delete R.selectedpoints, u(R, B), P.attributes && u(R, P.attributes), R.type = V; var W = { meta: z.meta || {}, categories: z.categories || {}, animatable: !!z.animatable, type: V, attributes: F(R) }; if (z.layoutAttributes) { var ee = {}; u(ee, z.layoutAttributes), W.layoutAttributes = F(ee); } return z.animatable || e10.crawl(W, function(re) { e10.isValObject(re) && "anim" in re && delete re.anim; }), W; } function S() { var V = {}, z, P; u(V, a); for (z in t.subplotsRegistry) if (P = t.subplotsRegistry[z], !!P.layoutAttributes) if (Array.isArray(P.attr)) for (var R = 0; R < P.attr.length; R++) G(V, P, P.attr[R]); else { var H = P.attr === "subplot" ? P.name : P.attr; G(V, P, H); } for (z in t.componentsRegistry) { P = t.componentsRegistry[z]; var B = P.schema; if (B && (B.subplots || B.layout)) { var W = B.subplots; if (W && W.xaxis && !W.yaxis) for (var ee in W.xaxis) delete V.yaxis[ee]; delete V.xaxis.shift, delete V.xaxis.autoshift; } else P.name === "colorscale" ? u(V, P.layoutAttributes) : P.layoutAttributes && K(V, P.layoutAttributes, P.name); } return { layoutAttributes: F(V) }; } function M(V) { var z = t.transformsRegistry[V], P = u({}, z.attributes); return Object.keys(t.componentsRegistry).forEach(function(R) { var H = t.componentsRegistry[R]; H.schema && H.schema.transforms && H.schema.transforms[V] && Object.keys(H.schema.transforms[V]).forEach(function(B) { K(P, H.schema.transforms[V][B], B); }); }), { attributes: F(P) }; } function L() { var V = { frames: u({}, i) }; return F(V), V.frames; } function F(V) { return $(V), I(V), O(V), V; } function $(V) { function z(R) { return { valType: "string", description: "Sets the source reference on Chart Studio Cloud for `" + R + "`.", editType: "none" }; } function P(R, H, B) { e10.isValObject(R) ? (R.arrayOk === true || R.valType === "data_array") && (B[H + "src"] = z(H)) : f(R) && (R.role = "object"); } e10.crawl(V, P); } function I(V) { function z(P, R, H) { if (P) { var B = P[m]; B && (delete P[m], H[R] = { items: {} }, H[R].items[B] = P, H[R].role = "object"); } } e10.crawl(V, z); } function O(V) { function z(P) { for (var R in P) if (f(P[R])) z(P[R]); else if (Array.isArray(P[R])) for (var H = 0; H < P[R].length; H++) z(P[R][H]); else P[R] instanceof RegExp && (P[R] = P[R].toString()); } z(V); } function G(V, z, P) { var R = h(V, P), H = u({}, z.layoutAttributes); H[v] = true, R.set(H); } function K(V, z, P) { var R = h(V, P); R.set(u(R.get() || {}, z)); } })(Qu); var qL = { exports: {} }; var Mr = {}; var yu = Ue; var Rq = Wi; var rl = "templateitemname"; var fy = { name: { valType: "string", editType: "none", description: [ "When used in a template, named items are created in the output figure", "in addition to any items the figure already has in this array.", "You can modify these items in the output figure by making your own", "item with `templateitemname` matching this `name`", "alongside your modifications (including `visible: false` or", "`enabled: false` to hide it).", "Has no effect outside of a template." ].join(" ") } }; fy[rl] = { valType: "string", editType: "calc", description: [ "Used to refer to a named item in this array in the template. Named", "items from the template will be created even without a matching item", "in the input figure, but you can modify one by making an item with", "`templateitemname` matching its `name`, alongside your modifications", "(including `visible: false` or `enabled: false` to hide it).", "If there is no template or no matching item, this item will be", "hidden unless you explicitly show it with `visible: true`." ].join(" ") }; Mr.templatedArray = function(e10, t) { return t._isLinkedToArray = e10, t.name = fy.name, t[rl] = fy[rl], t; }; Mr.traceTemplater = function(e10) { var t = {}, r, n; for (r in e10) n = e10[r], Array.isArray(n) && n.length && (t[r] = 0); function a(i) { r = yu.coerce(i, {}, Rq, "type"); var o = { type: r, _template: null }; if (r in t) { n = e10[r]; var l = t[r] % n.length; t[r]++, o._template = n[l]; } return o; } return { newTrace: a // TODO: function to figure out what's left & what didn't work }; }; Mr.newContainer = function(e10, t, r) { var n = e10._template, a = n && (n[t] || r && n[r]); yu.isPlainObject(a) || (a = null); var i = e10[t] = { _template: a }; return i; }; Mr.arrayTemplater = function(e10, t, r) { var n = e10._template, a = n && n[WL(t)], i = n && n[t]; (!Array.isArray(i) || !i.length) && (i = []); var o = {}; function l(u) { var f = { name: u.name, _input: u }, d = f[rl] = u[rl]; if (!I2(d)) return f._template = a, f; for (var h = 0; h < i.length; h++) { var p = i[h]; if (p.name === d) return o[d] = 1, f._template = p, f; } return f[r] = u[r] || false, f._template = false, f; } function s() { for (var u = [], f = 0; f < i.length; f++) { var d = i[f], h = d.name; if (I2(h) && !o[h]) { var p = { _template: d, name: h, _input: { _templateitemname: h } }; p[rl] = d[rl], u.push(p), o[h] = 1; } } return u; } return { newItem: l, defaultItems: s }; }; function I2(e10) { return e10 && typeof e10 == "string"; } function WL(e10) { var t = e10.length - 1; return e10.charAt(t) !== "s" && yu.warn("bad argument to arrayDefaultKey: " + e10), e10.substr(0, e10.length - 1) + "defaults"; } Mr.arrayDefaultKey = WL; Mr.arrayEditor = function(e10, t, r) { var n = (yu.nestedProperty(e10, t).get() || []).length, a = r._index, i = a >= n && (r._input || {})._templateitemname; i && (a = n); var o = t + "[" + a + "]", l; function s() { l = {}, i && (l[o] = {}, l[o][rl] = i); } s(); function u(p, v) { l[p] = v; } function f(p, v) { i ? yu.nestedProperty(l[o], p).set(v) : l[o + "." + p] = v; } function d() { var p = l; return s(), p; } function h(p, v) { p && f(p, v); var m = d(); for (var g in m) yu.nestedProperty(e10, g).set(m[g]); } return { modifyBase: u, modifyItem: f, getUpdateObj: d, applyUpdate: h }; }; var gn = {}; var Tf = Zu.counter; var Yn = { idRegex: { x: Tf("x", "( domain)?"), y: Tf("y", "( domain)?") }, attrRegex: Tf("[xy]axis"), // axis match regular expression xAxisMatch: Tf("xaxis"), yAxisMatch: Tf("yaxis"), // pattern matching axis ids and names // note that this is more permissive than counterRegex, as // id2name, name2id, and cleanId accept "x1" etc AX_ID_PATTERN: /^[xyz][0-9]*( domain)?$/, AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/, // and for 2D subplots SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/, HOUR_PATTERN: "hour", WEEKDAY_PATTERN: "day of week", // pixels to move mouse before you stop clamping to starting point MINDRAG: 8, // smallest dimension allowed for a zoombox MINZOOM: 20, // width of axis drag regions DRAGGERSIZE: 20, // delay before a redraw (relayout) after smooth panning and zooming REDRAWDELAY: 50, // last resort axis ranges for x and y axes if we have no data DFLTRANGEX: [-1, 6], DFLTRANGEY: [-1, 4], // Layers to keep trace types in the right order // N.B. each 'unique' plot method must have its own layer traceLayerClasses: [ "imagelayer", "heatmaplayer", "contourcarpetlayer", "contourlayer", "funnellayer", "waterfalllayer", "barlayer", "carpetlayer", "violinlayer", "boxlayer", "ohlclayer", "scattercarpetlayer", "scatterlayer" ], clipOnAxisFalseQuery: [ ".scatterlayer", ".barlayer", ".funnellayer", ".waterfalllayer" ], layerValue2layerClass: { "above traces": "above", "below traces": "below" } }; (function(e10) { var t = Nt, r = Yn; e10.id2name = function(i) { if (!(typeof i != "string" || !i.match(r.AX_ID_PATTERN))) { var o = i.split(" ")[0].substr(1); return o === "1" && (o = ""), i.charAt(0) + "axis" + o; } }, e10.name2id = function(i) { if (i.match(r.AX_NAME_PATTERN)) { var o = i.substr(5); return o === "1" && (o = ""), i.charAt(0) + o; } }, e10.cleanId = function(i, o, l) { var s = /( domain)$/.test(i); if (!(typeof i != "string" || !i.match(r.AX_ID_PATTERN)) && !(o && i.charAt(0) !== o) && !(s && !l)) { var u = i.split(" ")[0].substr(1).replace(/^0+/, ""); return u === "1" && (u = ""), i.charAt(0) + u + (s && l ? " domain" : ""); } }, e10.list = function(a, i, o) { var l = a._fullLayout; if (!l) return []; var s = e10.listIds(a, i), u = new Array(s.length), f; for (f = 0; f < s.length; f++) { var d = s[f]; u[f] = l[d.charAt(0) + "axis" + d.substr(1)]; } if (!o) { var h = l._subplots.gl3d || []; for (f = 0; f < h.length; f++) { var p = l[h[f]]; i ? u.push(p[i + "axis"]) : u.push(p.xaxis, p.yaxis, p.zaxis); } } return u; }, e10.listIds = function(a, i) { var o = a._fullLayout; if (!o) return []; var l = o._subplots; return i ? l[i + "axis"] : l.xaxis.concat(l.yaxis); }, e10.getFromId = function(a, i, o) { var l = a._fullLayout; return i = i === void 0 || typeof i != "string" ? i : i.replace(" domain", ""), o === "x" ? i = i.replace(/y[0-9]*/, "") : o === "y" && (i = i.replace(/x[0-9]*/, "")), l[e10.id2name(i)]; }, e10.getFromTrace = function(a, i, o) { var l = a._fullLayout, s = null; if (t.traceIs(i, "gl3d")) { var u = i.scene; u.substr(0, 5) === "scene" && (s = l[u][o + "axis"]); } else s = e10.getFromId(a, i[o + "axis"] || o); return s; }, e10.idSort = function(a, i) { var o = a.charAt(0), l = i.charAt(0); return o !== l ? o > l ? 1 : -1 : +(a.substr(1) || 1) - +(i.substr(1) || 1); }, e10.ref2id = function(a) { return /^[xyz]/.test(a) ? a.split(" ")[0] : false; }; function n(a, i) { if (i && i.length) { for (var o = 0; o < i.length; o++) if (i[o][a]) return true; } return false; } e10.isLinked = function(a, i) { return n(i, a._axisMatchGroups) || n(i, a._axisConstraintGroups); }; })(gn); function Pq(e10) { var t = e10._fullLayout._zoomlayer; t && t.selectAll(".outline-controllers").remove(); } function $q(e10) { var t = e10._fullLayout._zoomlayer; t && t.selectAll(".select-outline").remove(), e10._fullLayout._outlining = false; } var _s = { clearOutlineControllers: Pq, clearOutline: $q }; var ub = { scattermode: { valType: "enumerated", values: ["group", "overlay"], dflt: "overlay", editType: "calc", description: [ "Determines how scatter points at the same location coordinate", "are displayed on the graph.", "With *group*, the scatter points are plotted next to one another", "centered around the shared location.", "With *overlay*, the scatter points are plotted over one another,", "you might need to reduce *opacity* to see multiple scatter points." ].join(" ") }, scattergap: { valType: "number", min: 0, max: 1, editType: "calc", description: [ "Sets the gap (in plot fraction) between scatter points of", "adjacent location coordinates.", "Defaults to `bargap`." ].join(" ") } }; var Kc = {}; var tc = Nt; var zq = Yn.SUBPLOT_PATTERN; Kc.getSubplotCalcData = function(e10, t, r) { var n = tc.subplotsRegistry[t]; if (!n) return []; for (var a = n.attr, i = [], o = 0; o < e10.length; o++) { var l = e10[o], s = l[0].trace; s[a] === r && i.push(l); } return i; }; Kc.getModuleCalcData = function(e10, t) { var r = [], n = [], a; if (typeof t == "string" ? a = tc.getModule(t).plot : typeof t == "function" ? a = t : a = t.plot, !a) return [r, e10]; for (var i = 0; i < e10.length; i++) { var o = e10[i], l = o[0].trace; l.visible !== true || l._length === 0 || (l._module && l._module.plot === a ? r.push(o) : n.push(o)); } return [r, n]; }; Kc.getSubplotData = function(t, r, n) { if (!tc.subplotsRegistry[r]) return []; var a = tc.subplotsRegistry[r].attr, i = [], o, l, s; if (r === "gl2d") { var u = n.match(zq); l = "x" + u[1], s = "y" + u[2]; } for (var f = 0; f < t.length; f++) o = t[f], r === "gl2d" && tc.traceIs(o, "gl2d") ? o[a[0]] === l && o[a[1]] === s && i.push(o) : o[a] === n && i.push(o); return i; }; var Ym = {}; var N2; function Iq() { return N2 || (N2 = 1, function(e10) { var t = Nt, r = Ue; e10.manageCommandObserver = function(s, u, f, d) { var h = {}, p = true; u && u._commandObserver && (h = u._commandObserver), h.cache || (h.cache = {}), h.lookupTable = {}; var v = e10.hasSimpleAPICommandBindings(s, f, h.lookupTable); if (u && u._commandObserver) { if (v) return h; if (u._commandObserver.remove) return u._commandObserver.remove(), u._commandObserver = null, h; } if (v) { n(s, v, h.cache), h.check = function() { if (p) { var w = n(s, v, h.cache); return w.changed && d && h.lookupTable[w.value] !== void 0 && (h.disable(), Promise.resolve(d({ value: w.value, type: v.type, prop: v.prop, traces: v.traces, index: h.lookupTable[w.value] })).then(h.enable, h.enable)), w.changed; } }; for (var m = [ "plotly_relayout", "plotly_redraw", "plotly_restyle", "plotly_update", "plotly_animatingframe", "plotly_afterplot" ], g = 0; g < m.length; g++) s._internalOn(m[g], h.check); h.remove = function() { for (var y = 0; y < m.length; y++) s._removeInternalListener(m[y], h.check); }; } else r.log("Unable to automatically bind plot updates to API command"), h.lookupTable = {}, h.remove = function() { }; return h.disable = function() { p = false; }, h.enable = function() { p = true; }, u && (u._commandObserver = h), h; }, e10.hasSimpleAPICommandBindings = function(s, u, f) { var d, h = u.length, p; for (d = 0; d < h; d++) { var v, m = u[d], g = m.method, y = m.args; if (Array.isArray(y) || (y = []), !g) return false; var w = e10.computeAPICommandBindings(s, g, y); if (w.length !== 1) return false; if (!p) p = w[0], Array.isArray(p.traces) && p.traces.sort(); else { if (v = w[0], v.type !== p.type || v.prop !== p.prop) return false; if (Array.isArray(p.traces)) if (Array.isArray(v.traces)) { v.traces.sort(); for (var k = 0; k < p.traces.length; k++) if (p.traces[k] !== v.traces[k]) return false; } else return false; else if (v.prop !== p.prop) return false; } v = w[0]; var x = v.value; if (Array.isArray(x)) if (x.length === 1) x = x[0]; else return false; f && (f[x] = d); } return p; }; function n(s, u, f) { var d, h, p, v = false; if (u.type === "data") d = s._fullData[u.traces !== null ? u.traces[0] : 0]; else if (u.type === "layout") d = s._fullLayout; else return false; return h = r.nestedProperty(d, u.prop).get(), p = f[u.type] = f[u.type] || {}, p.hasOwnProperty(u.prop) && p[u.prop] !== h && (v = true), p[u.prop] = h, { changed: v, value: h }; } e10.executeAPICommand = function(s, u, f) { if (u === "skip") return Promise.resolve(); var d = t.apiMethodRegistry[u], h = [s]; Array.isArray(f) || (f = []); for (var p = 0; p < f.length; p++) h.push(f[p]); return d.apply(null, h).catch(function(v) { return r.warn("API call to Plotly." + u + " rejected.", v), Promise.reject(v); }); }, e10.computeAPICommandBindings = function(s, u, f) { var d; switch (Array.isArray(f) || (f = []), u) { case "restyle": d = o(s, f); break; case "relayout": d = i(s, f); break; case "update": d = o(s, [f[0], f[2]]).concat(i(s, [f[1]])); break; case "animate": d = a(s, f); break; default: d = []; } return d; }; function a(s, u) { return Array.isArray(u[0]) && u[0].length === 1 && ["string", "number"].indexOf(typeof u[0][0]) !== -1 ? [{ type: "layout", prop: "_currentFrame", value: u[0][0].toString() }] : []; } function i(s, u) { var f = [], d = u[0], h = {}; if (typeof d == "string") h[d] = u[1]; else if (r.isPlainObject(d)) h = d; else return f; return l(h, function(p, v, m) { f.push({ type: "layout", prop: p, value: m }); }, "", 0), f; } function o(s, u) { var f, d, h, p, v = []; if (d = u[0], h = u[1], f = u[2], p = {}, typeof d == "string") p[d] = h; else if (r.isPlainObject(d)) p = d, f === void 0 && (f = h); else return v; return f === void 0 && (f = null), l(p, function(m, g, y) { var w, k; if (Array.isArray(y)) { k = y.slice(); var x = Math.min(k.length, s.data.length); f && (x = Math.min(x, f.length)), w = []; for (var _ = 0; _ < x; _++) w[_] = f ? f[_] : _; } else k = y, w = f ? f.slice() : null; if (w === null) Array.isArray(k) && (k = k[0]); else if (Array.isArray(w)) { if (!Array.isArray(k)) { var T = k; k = []; for (var S = 0; S < w.length; S++) k[S] = T; } k.length = Math.min(w.length, k.length); } v.push({ type: "data", prop: m, traces: w, value: k }); }, "", 0), v; } function l(s, u, f, d) { Object.keys(s).forEach(function(h) { var p = s[h]; if (h[0] !== "_") { var v = f + (d > 0 ? "." : "") + h; r.isPlainObject(p) ? l(p, u, v, d + 1) : u(v, h, p); } }); } }(Ym)), Ym; } var ZL = lr; var Nq = _c.timeFormatLocale; var Oq = zC.formatLocale; var rc = sr; var Hq = IC; var hr = Nt; var YL = Qu; var Bq = Mr; var _t = Ue; var XL = nr; var O2 = Qr.BADNUM; var oa = gn; var jq = _s.clearOutline; var Uq = ub; var fb = hp; var Gq = VL; var Vq = Kc.getModuleCalcData; var cy = _t.relinkPrivateKeys; var $s = _t._; var lt = qL.exports = {}; _t.extendFlat(lt, hr); lt.attributes = Wi; lt.attributes.type.values = lt.allTypes; lt.fontAttrs = Fn; lt.layoutAttributes = Xc; lt.fontWeight = "normal"; var wp = lt.transformsRegistry; var Tp = Iq(); lt.executeAPICommand = Tp.executeAPICommand; lt.computeAPICommandBindings = Tp.computeAPICommandBindings; lt.manageCommandObserver = Tp.manageCommandObserver; lt.hasSimpleAPICommandBindings = Tp.hasSimpleAPICommandBindings; lt.redrawText = function(e10) { return e10 = _t.getGraphDiv(e10), new Promise(function(t) { setTimeout(function() { e10._fullLayout && (hr.getComponentMethod("annotations", "draw")(e10), hr.getComponentMethod("legend", "draw")(e10), hr.getComponentMethod("colorbar", "draw")(e10), t(lt.previousPromises(e10))); }, 300); }); }; lt.resize = function(e10) { e10 = _t.getGraphDiv(e10); var t, r = new Promise(function(n, a) { (!e10 || _t.isHidden(e10)) && a(new Error("Resize must be passed a displayed plot div element.")), e10._redrawTimer && clearTimeout(e10._redrawTimer), e10._resolveResize && (t = e10._resolveResize), e10._resolveResize = n, e10._redrawTimer = setTimeout(function() { if (!e10.layout || e10.layout.width && e10.layout.height || _t.isHidden(e10)) { n(e10); return; } delete e10.layout.width, delete e10.layout.height; var i = e10.changed; e10.autoplay = true, hr.call("relayout", e10, { autosize: true }).then(function() { e10.changed = i, e10._resolveResize === n && (delete e10._resolveResize, n(e10)); }); }, 100); }); return t && t(r), r; }; lt.previousPromises = function(e10) { if ((e10._promises || []).length) return Promise.all(e10._promises).then(function() { e10._promises = []; }); }; lt.addLinks = function(e10) { if (!(!e10._context.showLink && !e10._context.showSources)) { var t = e10._fullLayout, r = _t.ensureSingle(t._paper, "text", "js-plot-link-container", function(s) { s.style({ "font-family": '"Open Sans", Arial, sans-serif', "font-size": "12px", fill: XL.defaultLine, "pointer-events": "all" }).each(function() { var u = ZL.select(this); u.append("tspan").classed("js-link-to-tool", true), u.append("tspan").classed("js-link-spacer", true), u.append("tspan").classed("js-sourcelinks", true); }); }), n = r.node(), a = { y: t._paper.attr("height") - 9 }; document.body.contains(n) && n.getComputedTextLength() >= t.width - 20 ? (a["text-anchor"] = "start", a.x = 5) : (a["text-anchor"] = "end", a.x = t._paper.attr("width") - 7), r.attr(a); var i = r.select(".js-link-to-tool"), o = r.select(".js-link-spacer"), l = r.select(".js-sourcelinks"); e10._context.showSources && e10._context.showSources(e10), e10._context.showLink && qq(e10, i), o.text(i.text() && l.text() ? " - " : ""); } }; function qq(e10, t) { t.text(""); var r = t.append("a").attr({ "xlink:xlink:href": "#", class: "link--impt link--embedview", "font-weight": "bold" }).text(e10._context.linkText + " »"); if (e10._context.sendData) r.on("click", function() { lt.sendDataToCloud(e10); }); else { var n = window.location.pathname.split("/"), a = window.location.search; r.attr({ "xlink:xlink:show": "new", "xlink:xlink:href": "/" + n[2].split(".")[0] + "/" + n[1] + a }); } } lt.sendDataToCloud = function(e10) { var t = (window.PLOTLYENV || {}).BASE_URL || e10._context.plotlyServerURL; if (t) { e10.emit("plotly_beforeexport"); var r = ZL.select(e10).append("div").attr("id", "hiddenform").style("display", "none"), n = r.append("form").attr({ action: t + "/external", method: "post", target: "_blank" }), a = n.append("input").attr({ type: "text", name: "data" }); return a.node().value = lt.graphJson(e10, false, "keepdata"), n.node().submit(), r.remove(), e10.emit("plotly_afterexport"), false; } }; var Wq = [ "days", "shortDays", "months", "shortMonths", "periods", "dateTime", "date", "time", "decimal", "thousands", "grouping", "currency" ]; var Zq = [ "year", "month", "dayMonth", "dayMonthYear" ]; lt.supplyDefaults = function(e10, t) { var r = t && t.skipUpdateCalc, n = e10._fullLayout || {}; if (n._skipDefaults) { delete n._skipDefaults; return; } var a = e10._fullLayout = {}, i = e10.layout || {}, o = e10._fullData || [], l = e10._fullData = [], s = e10.data || [], u = e10.calcdata || [], f = e10._context || {}, d; e10._transitionData || lt.createTransitionData(e10), a._dfltTitle = { plot: $s(e10, "Click to enter Plot title"), x: $s(e10, "Click to enter X axis title"), y: $s(e10, "Click to enter Y axis title"), colorbar: $s(e10, "Click to enter Colorscale title"), annotation: $s(e10, "new text") }, a._traceWord = $s(e10, "trace"); var h = H2(e10, Wq); if (a._mapboxAccessToken = f.mapboxAccessToken, n._initialAutoSizeIsDone) { var p = n.width, v = n.height; lt.supplyLayoutGlobalDefaults(i, a, h), i.width || (a.width = p), i.height || (a.height = v), lt.sanitizeMargins(a); } else { lt.supplyLayoutGlobalDefaults(i, a, h); var m = !i.width || !i.height, g = a.autosize, y = f.autosizable, w = m && (g || y); w ? lt.plotAutoSize(e10, i, a) : m && lt.sanitizeMargins(a), !g && m && (i.width = a.width, i.height = a.height); } a._d3locale = Kq(h, a.separators), a._extraFormat = H2(e10, Zq), a._initialAutoSizeIsDone = true, a._dataLength = s.length, a._modules = [], a._visibleModules = [], a._basePlotModules = []; var k = a._subplots = Xq(), x = a._splomAxes = { x: {}, y: {} }, _ = a._splomSubplots = {}; a._splomGridDflt = {}, a._scatterStackOpts = {}, a._firstScatter = {}, a._alignmentOpts = {}, a._colorAxes = {}, a._requestRangeslider = {}, a._traceUids = Yq(o, s), a._globalTransforms = (e10._context || {}).globalTransforms, lt.supplyDataDefaults(s, l, i, a); var T = Object.keys(x.x), S = Object.keys(x.y); if (T.length > 1 && S.length > 1) { for (hr.getComponentMethod("grid", "sizeDefaults")(i, a), d = 0; d < T.length; d++) _t.pushUnique(k.xaxis, T[d]); for (d = 0; d < S.length; d++) _t.pushUnique(k.yaxis, S[d]); for (var M in _) _t.pushUnique(k.cartesian, M); } if (a._has = lt._hasPlotType.bind(a), o.length === l.length) for (d = 0; d < l.length; d++) cy(l[d], o[d]); lt.supplyLayoutModuleDefaults(i, a, l, e10._transitionData); var L = a._visibleModules, F = []; for (d = 0; d < L.length; d++) { var $ = L[d].crossTraceDefaults; $ && _t.pushUnique(F, $); } for (d = 0; d < F.length; d++) F[d](l, a); a._hasOnlyLargeSploms = a._basePlotModules.length === 1 && a._basePlotModules[0].name === "splom" && T.length > 15 && S.length > 15 && a.shapes.length === 0 && a.images.length === 0, lt.linkSubplots(l, a, o, n), lt.cleanPlot(l, a, o, n); var I = !!(n._has && n._has("gl2d")), O = !!(a._has && a._has("gl2d")), G = !!(n._has && n._has("cartesian")), K = !!(a._has && a._has("cartesian")), V = G || I, z = K || O; V && !z ? n._bgLayer.remove() : z && !V && (a._shouldCreateBgLayer = true), n._zoomlayer && !e10._dragging && jq({ // mock old gd _fullLayout: n }), Jq(l, a), cy(a, n), hr.getComponentMethod("colorscale", "crossTraceDefaults")(l, a), a._preGUI || (a._preGUI = {}), a._tracePreGUI || (a._tracePreGUI = {}); var P = a._tracePreGUI, R = {}, H; for (H in P) R[H] = "old"; for (d = 0; d < l.length; d++) H = l[d]._fullInput.uid, R[H] || (P[H] = {}), R[H] = "new"; for (H in R) R[H] === "old" && delete P[H]; JL(a), hr.getComponentMethod("rangeslider", "makeData")(a), !r && u.length === l.length && lt.supplyDefaultsUpdateCalc(u, l); }; lt.supplyDefaultsUpdateCalc = function(e10, t) { for (var r = 0; r < t.length; r++) { var n = t[r], a = (e10[r] || [])[0]; if (a && a.trace) { var i = a.trace; if (i._hasCalcTransform) { var o = i._arrayAttrs, l, s, u; for (l = 0; l < o.length; l++) s = o[l], u = _t.nestedProperty(i, s).get().slice(), _t.nestedProperty(n, s).set(u); } a.trace = n; } } }; function Yq(e10, t) { var r = t.length, n = [], a, i; for (a = 0; a < e10.length; a++) { var o = e10[a]._fullInput; o !== i && n.push(o), i = o; } var l = n.length, s = new Array(r), u = {}; function f(p, v) { s[v] = p, u[p] = 1; } function d(p, v) { if (p && typeof p == "string" && !u[p]) return f(p, v), true; } for (a = 0; a < r; a++) { var h = t[a].uid; typeof h == "number" && (h = String(h)), !d(h, a) && (a < l && d(n[a].uid, a) || f(_t.randstr(u), a)); } return s; } function Xq() { var e10 = hr.collectableSubplotTypes, t = {}, r, n; if (!e10) { e10 = []; var a = hr.subplotsRegistry; for (var i in a) { var o = a[i], l = o.attr; if (l && (e10.push(i), Array.isArray(l))) for (n = 0; n < l.length; n++) _t.pushUnique(e10, l[n]); } } for (r = 0; r < e10.length; r++) t[e10[r]] = []; return t; } function H2(e10, t) { var r = e10._context.locale; r || (r = "en-US"); var n = false, a = {}; function i(d) { for (var h = true, p = 0; p < t.length; p++) { var v = t[p]; a[v] || (d[v] ? a[v] = d[v] : h = false); } h && (n = true); } for (var o = 0; o < 2; o++) { for (var l = e10._context.locales, s = 0; s < 2; s++) { var u = (l[r] || {}).format; if (u && (i(u), n)) break; l = hr.localeRegistry; } var f = r.split("-")[0]; if (n || f === r) break; r = f; } return n || i(hr.localeRegistry.en.format), a; } function Kq(e10, t) { return e10.decimal = t.charAt(0), e10.thousands = t.charAt(1), { numberFormat: function(r) { try { r = Oq(e10).format( _t.adjustFormat(r) ); } catch { return _t.warnBadFormat(r), _t.noFormat; } return r; }, timeFormat: Nq(e10).utcFormat }; } function Jq(e10, t) { var r, n = []; t.meta && (r = t._meta = { meta: t.meta, layout: { meta: t.meta } }); for (var a = 0; a < e10.length; a++) { var i = e10[a]; i.meta ? n[i.index] = i._meta = { meta: i.meta } : t.meta && (i._meta = { meta: t.meta }), t.meta && (i._meta.layout = { meta: t.meta }); } n.length && (r || (r = t._meta = {}), r.data = n); } lt.createTransitionData = function(e10) { e10._transitionData || (e10._transitionData = {}), e10._transitionData._frames || (e10._transitionData._frames = []), e10._transitionData._frameHash || (e10._transitionData._frameHash = {}), e10._transitionData._counter || (e10._transitionData._counter = 0), e10._transitionData._interruptCallbacks || (e10._transitionData._interruptCallbacks = []); }; lt._hasPlotType = function(e10) { var t, r = this._basePlotModules || []; for (t = 0; t < r.length; t++) if (r[t].name === e10) return true; var n = this._modules || []; for (t = 0; t < n.length; t++) { var a = n[t].name; if (a === e10) return true; var i = hr.modules[a]; if (i && i.categories[e10]) return true; } return false; }; lt.cleanPlot = function(e10, t, r, n) { var a, i, o = n._basePlotModules || []; for (a = 0; a < o.length; a++) { var l = o[a]; l.clean && l.clean(e10, t, r, n); } var s = n._has && n._has("gl"), u = t._has && t._has("gl"); s && !u && n._glcontainer !== void 0 && (n._glcontainer.selectAll(".gl-canvas").remove(), n._glcontainer.selectAll(".no-webgl").remove(), n._glcanvas = null); var f = !!n._infolayer; e: for (a = 0; a < r.length; a++) { var d = r[a], h = d.uid; for (i = 0; i < e10.length; i++) { var p = e10[i]; if (h === p.uid) continue e; } f && n._infolayer.select(".cb" + h).remove(); } }; lt.linkSubplots = function(e10, t, r, n) { var a, i, o = n._plots || {}, l = t._plots = {}, s = t._subplots, u = { _fullData: e10, _fullLayout: t }, f = s.cartesian.concat(s.gl2d || []); for (a = 0; a < f.length; a++) { var d = f[a], h = o[d], p = oa.getFromId(u, d, "x"), v = oa.getFromId(u, d, "y"), m; for (h ? m = l[d] = h : (m = l[d] = {}, m.id = d), p._counterAxes.push(v._id), v._counterAxes.push(p._id), p._subplotsWith.push(d), v._subplotsWith.push(d), m.xaxis = p, m.yaxis = v, m._hasClipOnAxisFalse = false, i = 0; i < e10.length; i++) { var g = e10[i]; if (g.xaxis === m.xaxis._id && g.yaxis === m.yaxis._id && g.cliponaxis === false) { m._hasClipOnAxisFalse = true; break; } } } var y = oa.list(u, null, true), w; for (a = 0; a < y.length; a++) { w = y[a]; var k = null; w.overlaying && (k = oa.getFromId(u, w.overlaying), k && k.overlaying && (w.overlaying = false, k = null)), w._mainAxis = k || w, k && (w.domain = k.domain.slice()), w._anchorAxis = w.anchor === "free" ? null : oa.getFromId(u, w.anchor); } for (a = 0; a < y.length; a++) if (w = y[a], w._counterAxes.sort(oa.idSort), w._subplotsWith.sort(_t.subplotSort), w._mainSubplot = Qq(w, t), w._counterAxes.length && (w.spikemode && w.spikemode.indexOf("across") !== -1 || w.automargin && w.mirror && w.anchor !== "free" || hr.getComponentMethod("rangeslider", "isVisible")(w))) { var x = 1, _ = 0; for (i = 0; i < w._counterAxes.length; i++) { var T = oa.getFromId(u, w._counterAxes[i]); x = Math.min(x, T.domain[0]), _ = Math.max(_, T.domain[1]); } x < _ && (w._counterDomainMin = x, w._counterDomainMax = _); } }; function Qq(e10, t) { var r = { _fullLayout: t }, n = e10._id.charAt(0) === "x", a = e10._mainAxis._anchorAxis, i = "", o = "", l = ""; if (a && (l = a._mainAxis._id, i = n ? e10._id + l : l + e10._id), !i || !t._plots[i]) { i = ""; for (var s = e10._counterAxes, u = 0; u < s.length; u++) { var f = s[u], d = n ? e10._id + f : f + e10._id; o || (o = d); var h = oa.getFromId(r, f); if (l && h.overlaying === l) { i = d; break; } } } return i || o; } lt.clearExpandedTraceDefaultColors = function(e10) { var t, r, n; function a(o, l, s, u) { r[u] = l, r.length = u + 1, o.valType === "color" && o.dflt === void 0 && t.push(r.join(".")); } for (r = [], t = e10._module._colorAttrs, t || (e10._module._colorAttrs = t = [], YL.crawl( e10._module.attributes, a )), n = 0; n < t.length; n++) { var i = _t.nestedProperty(e10, "_input." + t[n]); i.get() || _t.nestedProperty(e10, t[n]).set(null); } }; lt.supplyDataDefaults = function(e10, t, r, n) { var a = n._modules, i = n._visibleModules, o = n._basePlotModules, l = 0, s = 0, u, f, d; n._transformModules = []; function h(S) { t.push(S); var M = S._module; M && (_t.pushUnique(a, M), S.visible === true && _t.pushUnique(i, M), _t.pushUnique(o, S._module.basePlotModule), l++, S._input.visible !== false && s++); } var p = {}, v = [], m = (r.template || {}).data || {}, g = Bq.traceTemplater(m); for (u = 0; u < e10.length; u++) { if (d = e10[u], f = g.newTrace(d), f.uid = n._traceUids[u], lt.supplyTraceDefaults(d, f, s, n, u), f.index = u, f._input = d, f._expandedIndex = l, f.transforms && f.transforms.length) for (var y = d.visible !== false && f.visible === false, w = eW(f, t, r, n), k = 0; k < w.length; k++) { var x = w[k], _ = { _template: f._template, type: f.type, // set uid using parent uid and expanded index // to promote consistency between update calls uid: f.uid + k }; y && x.visible === false && delete x.visible, lt.supplyTraceDefaults(x, _, l, n, u), cy(_, x), _.index = u, _._input = d, _._fullInput = f, _._expandedIndex = l, _._expandedInput = x, h(_); } else f._fullInput = f, f._expandedInput = f, h(f); hr.traceIs(f, "carpetAxis") && (p[f.carpet] = f), hr.traceIs(f, "carpetDependent") && v.push(u); } for (u = 0; u < v.length; u++) if (f = t[v[u]], !!f.visible) { var T = p[f.carpet]; if (f._carpet = T, !T || !T.visible) { f.visible = false; continue; } f.xaxis = T.xaxis, f.yaxis = T.yaxis; } }; lt.supplyAnimationDefaults = function(e10) { e10 = e10 || {}; var t, r = {}; function n(a, i) { return _t.coerce(e10 || {}, r, fb, a, i); } if (n("mode"), n("direction"), n("fromcurrent"), Array.isArray(e10.frame)) for (r.frame = [], t = 0; t < e10.frame.length; t++) r.frame[t] = lt.supplyAnimationFrameDefaults(e10.frame[t] || {}); else r.frame = lt.supplyAnimationFrameDefaults(e10.frame || {}); if (Array.isArray(e10.transition)) for (r.transition = [], t = 0; t < e10.transition.length; t++) r.transition[t] = lt.supplyAnimationTransitionDefaults(e10.transition[t] || {}); else r.transition = lt.supplyAnimationTransitionDefaults(e10.transition || {}); return r; }; lt.supplyAnimationFrameDefaults = function(e10) { var t = {}; function r(n, a) { return _t.coerce(e10 || {}, t, fb.frame, n, a); } return r("duration"), r("redraw"), t; }; lt.supplyAnimationTransitionDefaults = function(e10) { var t = {}; function r(n, a) { return _t.coerce(e10 || {}, t, fb.transition, n, a); } return r("duration"), r("easing"), t; }; lt.supplyFrameDefaults = function(e10) { var t = {}; function r(n, a) { return _t.coerce(e10, t, Gq, n, a); } return r("group"), r("name"), r("traces"), r("baseframe"), r("data"), r("layout"), t; }; lt.supplyTraceDefaults = function(e10, t, r, n, a) { var i = n.colorway || XL.defaults, o = i[r % i.length], l; function s(k, x) { return _t.coerce(e10, t, lt.attributes, k, x); } var u = s("visible"); s("type"), s("name", n._traceWord + " " + a), s("uirevision", n.uirevision); var f = lt.getModule(t); if (t._module = f, f) { var d = f.basePlotModule, h = d.attr, p = d.attributes; if (h && p) { var v = n._subplots, m = ""; if (u || d.name !== "gl2d") { if (Array.isArray(h)) for (l = 0; l < h.length; l++) { var g = h[l], y = _t.coerce(e10, t, p, g); v[g] && _t.pushUnique(v[g], y), m += y; } else m = _t.coerce(e10, t, p, h); v[d.name] && _t.pushUnique(v[d.name], m); } } } if (u) { if (s("customdata"), s("ids"), s("meta"), hr.traceIs(t, "showLegend") ? (_t.coerce( e10, t, f.attributes.showlegend ? f.attributes : lt.attributes, "showlegend" ), s("legend"), s("legendwidth"), s("legendgroup"), s("legendgrouptitle.text"), s("legendrank"), t._dfltShowLegend = true) : t._dfltShowLegend = false, f && f.supplyDefaults(e10, t, o, n), hr.traceIs(t, "noOpacity") || s("opacity"), hr.traceIs(t, "notLegendIsolatable") && (t.visible = !!t.visible), hr.traceIs(t, "noHover") || (t.hovertemplate || _t.coerceHoverinfo(e10, t, n), t.type !== "parcats" && hr.getComponentMethod("fx", "supplyDefaults")(e10, t, o, n)), f && f.selectPoints) { var w = s("selectedpoints"); _t.isTypedArray(w) && (t.selectedpoints = Array.from(w)); } lt.supplyTransformDefaults(e10, t, n); } return t; }; function KL(e10) { var t = e10.transforms; if (Array.isArray(t) && t.length) for (var r = 0; r < t.length; r++) { var n = t[r], a = n._module || wp[n.type]; if (a && a.makesData) return true; } return false; } lt.hasMakesDataTransform = KL; lt.supplyTransformDefaults = function(e10, t, r) { if (t._length || KL(e10)) { var n = r._globalTransforms || [], a = r._transformModules || []; if (!(!Array.isArray(e10.transforms) && n.length === 0)) for (var i = e10.transforms || [], o = n.concat(i), l = t.transforms = [], s = 0; s < o.length; s++) { var u = o[s], f = u.type, d = wp[f], h, p = !(u._module && u._module === d), v = d && typeof d.transform == "function"; d || _t.warn("Unrecognized transform type " + f + "."), d && d.supplyDefaults && (p || v) ? (h = d.supplyDefaults(u, t, r, e10), h.type = f, h._module = d, _t.pushUnique(a, d)) : h = _t.extendFlat({}, u), l.push(h); } } }; function eW(e10, t, r, n) { for (var a = e10.transforms, i = [e10], o = 0; o < a.length; o++) { var l = a[o], s = wp[l.type]; s && s.transform && (i = s.transform(i, { transform: l, fullTrace: e10, fullData: t, layout: r, fullLayout: n, transformIndex: o })); } return i; } lt.supplyLayoutGlobalDefaults = function(e10, t, r) { function n(d, h) { return _t.coerce(e10, t, lt.layoutAttributes, d, h); } var a = e10.template; _t.isPlainObject(a) && (t.template = a, t._template = a.layout, t._dataTemplate = a.data), n("autotypenumbers"); var i = _t.coerceFont(n, "font"), o = i.size; _t.coerceFont(n, "title.font", _t.extendFlat({}, i, { size: Math.round(o * 1.4) })), n("title.text", t._dfltTitle.plot), n("title.xref"); var l = n("title.yref"); n("title.pad.t"), n("title.pad.r"), n("title.pad.b"), n("title.pad.l"); var s = n("title.automargin"); n("title.x"), n("title.xanchor"), n("title.y"), n("title.yanchor"), s && (l === "paper" && (t.title.y !== 0 && (t.title.y = 1), t.title.yanchor === "auto" && (t.title.yanchor = t.title.y === 0 ? "top" : "bottom")), l === "container" && (t.title.y === "auto" && (t.title.y = 1), t.title.yanchor === "auto" && (t.title.yanchor = t.title.y < 0.5 ? "bottom" : "top"))); var u = n("uniformtext.mode"); u && n("uniformtext.minsize"), n("autosize", !(e10.width && e10.height)), n("width"), n("height"), n("minreducedwidth"), n("minreducedheight"), n("margin.l"), n("margin.r"), n("margin.t"), n("margin.b"), n("margin.pad"), n("margin.autoexpand"), e10.width && e10.height && lt.sanitizeMargins(t), hr.getComponentMethod("grid", "sizeDefaults")(e10, t), n("paper_bgcolor"), n("separators", r.decimal + r.thousands), n("hidesources"), n("colorway"), n("datarevision"); var f = n("uirevision"); n("editrevision", f), n("selectionrevision", f), hr.getComponentMethod( "modebar", "supplyLayoutDefaults" )(e10, t), hr.getComponentMethod( "shapes", "supplyDrawNewShapeDefaults" )(e10, t, n), hr.getComponentMethod( "selections", "supplyDrawNewSelectionDefaults" )(e10, t, n), n("meta"), _t.isPlainObject(e10.transition) && (n("transition.duration"), n("transition.easing"), n("transition.ordering")), hr.getComponentMethod( "calendars", "handleDefaults" )(e10, t, "calendar"), hr.getComponentMethod( "fx", "supplyLayoutGlobalDefaults" )(e10, t, n), _t.coerce(e10, t, Uq, "scattermode"); }; function Bd(e10) { return typeof e10 == "string" && e10.substr(e10.length - 2) === "px" && parseFloat(e10); } lt.plotAutoSize = function(t, r, n) { var a = t._context || {}, i = a.frameMargins, o, l, s = _t.isPlotDiv(t); if (s && t.emit("plotly_autosize"), a.fillFrame) o = window.innerWidth, l = window.innerHeight, document.body.style.overflow = "hidden"; else { var u = s ? window.getComputedStyle(t) : {}; if (o = Bd(u.width) || Bd(u.maxWidth) || n.width, l = Bd(u.height) || Bd(u.maxHeight) || n.height, rc(i) && i > 0) { var f = 1 - 2 * i; o = Math.round(f * o), l = Math.round(f * l); } } var d = lt.layoutAttributes.width.min, h = lt.layoutAttributes.height.min; o < d && (o = d), l < h && (l = h); var p = !r.width && Math.abs(n.width - o) > 1, v = !r.height && Math.abs(n.height - l) > 1; (v || p) && (p && (n.width = o), v && (n.height = l)), t._initialAutoSize || (t._initialAutoSize = { width: o, height: l }), lt.sanitizeMargins(n); }; lt.supplyLayoutModuleDefaults = function(e10, t, r, n) { var a = hr.componentsRegistry, i = t._basePlotModules, o, l, s, u = hr.subplotsRegistry.cartesian; for (o in a) s = a[o], s.includeBasePlot && s.includeBasePlot(e10, t); i.length || i.push(u), t._has("cartesian") && (hr.getComponentMethod("grid", "contentDefaults")(e10, t), u.finalizeSubplots(e10, t)); for (var f in t._subplots) t._subplots[f].sort(_t.subplotSort); for (l = 0; l < i.length; l++) s = i[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e10, t, r); var d = t._modules; for (l = 0; l < d.length; l++) s = d[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e10, t, r); var h = t._transformModules; for (l = 0; l < h.length; l++) s = h[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e10, t, r, n); for (o in a) s = a[o], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e10, t, r); }; lt.purge = function(e10) { var t = e10._fullLayout || {}; t._glcontainer !== void 0 && (t._glcontainer.selectAll(".gl-canvas").remove(), t._glcontainer.remove(), t._glcanvas = null), t._modeBar && t._modeBar.destroy(), e10._transitionData && (e10._transitionData._interruptCallbacks && (e10._transitionData._interruptCallbacks.length = 0), e10._transitionData._animationRaf && window.cancelAnimationFrame(e10._transitionData._animationRaf)), _t.clearThrottle(), _t.clearResponsive(e10), delete e10.data, delete e10.layout, delete e10._fullData, delete e10._fullLayout, delete e10.calcdata, delete e10.empty, delete e10.fid, delete e10.undoqueue, delete e10.undonum, delete e10.autoplay, delete e10.changed, delete e10._promises, delete e10._redrawTimer, delete e10._hmlumcount, delete e10._hmpixcount, delete e10._transitionData, delete e10._transitioning, delete e10._initialAutoSize, delete e10._transitioningWithDuration, delete e10._dragging, delete e10._dragged, delete e10._dragdata, delete e10._hoverdata, delete e10._snapshotInProgress, delete e10._editing, delete e10._mouseDownTime, delete e10._legendMouseDownTime, e10.removeAllListeners && e10.removeAllListeners(); }; lt.style = function(e10) { var t = e10._fullLayout._visibleModules, r = [], n; for (n = 0; n < t.length; n++) { var a = t[n]; a.style && _t.pushUnique(r, a.style); } for (n = 0; n < r.length; n++) r[n](e10); }; lt.sanitizeMargins = function(e10) { if (!(!e10 || !e10.margin)) { var t = e10.width, r = e10.height, n = e10.margin, a = t - (n.l + n.r), i = r - (n.t + n.b), o; a < 0 && (o = (t - 1) / (n.l + n.r), n.l = Math.floor(o * n.l), n.r = Math.floor(o * n.r)), i < 0 && (o = (r - 1) / (n.t + n.b), n.t = Math.floor(o * n.t), n.b = Math.floor(o * n.b)); } }; lt.clearAutoMarginIds = function(e10) { e10._fullLayout._pushmarginIds = {}; }; lt.allowAutoMargin = function(e10, t) { e10._fullLayout._pushmarginIds[t] = 1; }; function JL(e10) { var t = e10.margin; if (!e10._size) { var r = e10._size = { l: Math.round(t.l), r: Math.round(t.r), t: Math.round(t.t), b: Math.round(t.b), p: Math.round(t.pad) }; r.w = Math.round(e10.width) - r.l - r.r, r.h = Math.round(e10.height) - r.t - r.b; } e10._pushmargin || (e10._pushmargin = {}), e10._pushmarginIds || (e10._pushmarginIds = {}), e10._reservedMargin || (e10._reservedMargin = {}); } var QL = 2; var e4 = 2; lt.autoMargin = function(e10, t, r) { var n = e10._fullLayout, a = n.width, i = n.height, o = n.margin, l = n.minreducedwidth, s = n.minreducedheight, u = _t.constrain( a - o.l - o.r, QL, l ), f = _t.constrain( i - o.t - o.b, e4, s ), d = Math.max(0, a - u), h = Math.max(0, i - f), p = n._pushmargin, v = n._pushmarginIds; if (o.autoexpand !== false) { if (!r) delete p[t], delete v[t]; else { var m = r.pad; if (m === void 0 && (m = Math.min(12, o.l, o.r, o.t, o.b)), d) { var g = (r.l + r.r) / d; g > 1 && (r.l /= g, r.r /= g); } if (h) { var y = (r.t + r.b) / h; y > 1 && (r.t /= y, r.b /= y); } var w = r.xl !== void 0 ? r.xl : r.x, k = r.xr !== void 0 ? r.xr : r.x, x = r.yt !== void 0 ? r.yt : r.y, _ = r.yb !== void 0 ? r.yb : r.y; p[t] = { l: { val: w, size: r.l + m }, r: { val: k, size: r.r + m }, b: { val: _, size: r.b + m }, t: { val: x, size: r.t + m } }, v[t] = 1; } if (!n._replotting) return lt.doAutoMargin(e10); } }; function tW(e10) { if ("_redrawFromAutoMarginCount" in e10._fullLayout) return false; var t = oa.list(e10, "", true); for (var r in t) if (t[r].autoshift || t[r].shift) return true; return false; } lt.doAutoMargin = function(e10) { var t = e10._fullLayout, r = t.width, n = t.height; t._size || (t._size = {}), JL(t); var a = t._size, i = t.margin, o = { t: 0, b: 0, l: 0, r: 0 }, l = _t.extendFlat({}, a), s = i.l, u = i.r, f = i.t, d = i.b, h = t._pushmargin, p = t._pushmarginIds, v = t.minreducedwidth, m = t.minreducedheight; if (i.autoexpand !== false) { for (var g in h) p[g] || delete h[g]; var y = e10._fullLayout._reservedMargin; for (var w in y) for (var k in y[w]) { var x = y[w][k]; o[k] = Math.max(o[k], x); } h.base = { l: { val: 0, size: s }, r: { val: 1, size: u }, t: { val: 1, size: f }, b: { val: 0, size: d } }; for (var _ in o) { var T = 0; for (var S in h) S !== "base" && rc(h[S][_].size) && (T = h[S][_].size > T ? h[S][_].size : T); var M = Math.max(0, i[_] - T); o[_] = Math.max(0, o[_] - M); } for (var L in h) { var F = h[L].l || {}, $ = h[L].b || {}, I = F.val, O = F.size, G = $.val, K = $.size, V = r - o.r - o.l, z = n - o.t - o.b; for (var P in h) { if (rc(O) && h[P].r) { var R = h[P].r.val, H = h[P].r.size; if (R > I) { var B = (O * R + (H - V) * I) / (R - I), W = (H * (1 - I) + (O - V) * (1 - R)) / (R - I); B + W > s + u && (s = B, u = W); } } if (rc(K) && h[P].t) { var ee = h[P].t.val, re = h[P].t.size; if (ee > G) { var ae = (K * ee + (re - z) * G) / (ee - G), Q = (re * (1 - G) + (K - z) * (1 - ee)) / (ee - G); ae + Q > d + f && (d = ae, f = Q); } } } } } var ue = _t.constrain( r - i.l - i.r, QL, v ), j = _t.constrain( n - i.t - i.b, e4, m ), U = Math.max(0, r - ue), Z = Math.max(0, n - j); if (U) { var le = (s + u) / U; le > 1 && (s /= le, u /= le); } if (Z) { var J = (d + f) / Z; J > 1 && (d /= J, f /= J); } if (a.l = Math.round(s) + o.l, a.r = Math.round(u) + o.r, a.t = Math.round(f) + o.t, a.b = Math.round(d) + o.b, a.p = Math.round(i.pad), a.w = Math.round(r) - a.l - a.r, a.h = Math.round(n) - a.t - a.b, !t._replotting && (lt.didMarginChange(l, a) || tW(e10))) { "_redrawFromAutoMarginCount" in t ? t._redrawFromAutoMarginCount++ : t._redrawFromAutoMarginCount = 1; var pe = 3 * (1 + Object.keys(p).length); if (t._redrawFromAutoMarginCount < pe) return hr.call("_doPlot", e10); t._size = l, _t.warn("Too many auto-margin redraws."); } rW(e10); }; function rW(e10) { var t = oa.list(e10, "", true); [ "_adjustTickLabelsOverflow", "_hideCounterAxisInsideTickLabels" ].forEach(function(r) { for (var n = 0; n < t.length; n++) { var a = t[n][r]; a && a(); } }); } var B2 = ["l", "r", "t", "b", "p", "w", "h"]; lt.didMarginChange = function(e10, t) { for (var r = 0; r < B2.length; r++) { var n = B2[r], a = e10[n], i = t[n]; if (!rc(a) || Math.abs(i - a) > 1) return true; } return false; }; lt.graphJson = function(e10, t, r, n, a, i) { (a && t && !e10._fullData || a && !t && !e10._fullLayout) && lt.supplyDefaults(e10); var o = a ? e10._fullData : e10.data, l = a ? e10._fullLayout : e10.layout, s = (e10._transitionData || {})._frames; function u(h, p) { if (typeof h == "function") return p ? "_function_" : null; if (_t.isPlainObject(h)) { var v = {}, m; return Object.keys(h).sort().forEach(function(k) { if (["_", "["].indexOf(k.charAt(0)) === -1) { if (typeof h[k] == "function") { p && (v[k] = "_function"); return; } if (r === "keepdata") { if (k.substr(k.length - 3) === "src") return; } else if (r === "keepstream") { if (m = h[k + "src"], typeof m == "string" && m.indexOf(":") > 0 && !_t.isPlainObject(h.stream)) return; } else if (r !== "keepall" && (m = h[k + "src"], typeof m == "string" && m.indexOf(":") > 0)) return; v[k] = u(h[k], p); } }), v; } var g = Array.isArray(h), y = _t.isTypedArray(h); if ((g || y) && h.dtype && h.shape) { var w = h.bdata; return u({ dtype: h.dtype, shape: h.shape, bdata: ( // case of ArrayBuffer _t.isArrayBuffer(w) ? Hq.encode(w) : ( // case of b64 string w ) ) }, p); } return g ? h.map(function(k) { return u(k, p); }) : y ? _t.simpleMap(h, _t.identity) : _t.isJSDate(h) ? _t.ms2DateTimeLocal(+h) : h; } var f = { data: (o || []).map(function(h) { var p = u(h); return t && delete p.fit, p; }) }; if (!t && (f.layout = u(l), a)) { var d = l._size; f.layout.computed = { margin: { b: d.b, l: d.l, r: d.r, t: d.t } }; } return s && (f.frames = u(s)), i && (f.config = u(e10._context, true)), n === "object" ? f : JSON.stringify(f); }; lt.modifyFrames = function(e10, t) { var r, n, a, i = e10._transitionData._frames, o = e10._transitionData._frameHash; for (r = 0; r < t.length; r++) switch (n = t[r], n.type) { case "replace": a = n.value; var l = (i[n.index] || {}).name, s = a.name; i[n.index] = o[s] = a, s !== l && (delete o[l], o[s] = a); break; case "insert": a = n.value, o[a.name] = a, i.splice(n.index, 0, a); break; case "delete": a = i[n.index], delete o[a.name], i.splice(n.index, 1); break; } return Promise.resolve(); }; lt.computeFrame = function(e10, t) { var r = e10._transitionData._frameHash, n, a, i, o; if (!t) throw new Error("computeFrame must be given a string frame name"); var l = r[t.toString()]; if (!l) return false; for (var s = [l], u = [l.name]; l.baseframe && (l = r[l.baseframe.toString()]) && u.indexOf(l.name) === -1; ) s.push(l), u.push(l.name); for (var f = {}; l = s.pop(); ) if (l.layout && (f.layout = lt.extendLayout(f.layout, l.layout)), l.data) { if (f.data || (f.data = []), a = l.traces, !a) for (a = [], n = 0; n < l.data.length; n++) a[n] = n; for (f.traces || (f.traces = []), n = 0; n < l.data.length; n++) i = a[n], i != null && (o = f.traces.indexOf(i), o === -1 && (o = f.data.length, f.traces[o] = i), f.data[o] = lt.extendTrace(f.data[o], l.data[n])); } return f; }; lt.recomputeFrameHash = function(e10) { for (var t = e10._transitionData._frameHash = {}, r = e10._transitionData._frames, n = 0; n < r.length; n++) { var a = r[n]; a && a.name && (t[a.name] = a); } }; lt.extendObjectWithContainers = function(e10, t, r) { var n, a, i, o, l, s, u, f, d = _t.extendDeepNoArrays({}, t || {}), h = _t.expandObjectPaths(d), p = {}; if (r && r.length) for (i = 0; i < r.length; i++) n = _t.nestedProperty(h, r[i]), a = n.get(), a === void 0 ? _t.nestedProperty(p, r[i]).set(null) : (n.set(null), _t.nestedProperty(p, r[i]).set(a)); if (e10 = _t.extendDeepNoArrays(e10 || {}, h), r && r.length) { for (i = 0; i < r.length; i++) if (l = _t.nestedProperty(p, r[i]), u = l.get(), !!u) { for (s = _t.nestedProperty(e10, r[i]), f = s.get(), Array.isArray(f) || (f = [], s.set(f)), o = 0; o < u.length; o++) { var v = u[o]; v === null ? f[o] = null : f[o] = lt.extendObjectWithContainers(f[o], v); } s.set(f); } } return e10; }; lt.dataArrayContainers = ["transforms", "dimensions"]; lt.layoutArrayContainers = hr.layoutArrayContainers; lt.extendTrace = function(e10, t) { return lt.extendObjectWithContainers(e10, t, lt.dataArrayContainers); }; lt.extendLayout = function(e10, t) { return lt.extendObjectWithContainers(e10, t, lt.layoutArrayContainers); }; lt.transition = function(e10, t, r, n, a, i) { var o = { redraw: a.redraw }, l = {}, s = []; return o.prepareFn = function() { for (var u = Array.isArray(t) ? t.length : 0, f = n.slice(0, u), d = 0; d < f.length; d++) { var h = f[d], p = e10._fullData[h], v = p._module; if (v) { if (v.animatable) { var m = v.basePlotModule.name; l[m] || (l[m] = []), l[m].push(h); } e10.data[f[d]] = lt.extendTrace(e10.data[f[d]], t[d]); } } var g = _t.expandObjectPaths(_t.extendDeepNoArrays({}, r)), y = /^[xy]axis[0-9]*$/; for (var w in g) y.test(w) && delete g[w].range; lt.extendLayout(e10.layout, g), delete e10.calcdata, lt.supplyDefaults(e10), lt.doCalcdata(e10); var k = _t.expandObjectPaths(r); if (k) { var x = e10._fullLayout._plots; for (var _ in x) { var T = x[_], S = T.xaxis, M = T.yaxis, L = S.range.slice(), F = M.range.slice(), $ = null, I = null, O = null, G = null; Array.isArray(k[S._name + ".range"]) ? $ = k[S._name + ".range"].slice() : Array.isArray((k[S._name] || {}).range) && ($ = k[S._name].range.slice()), Array.isArray(k[M._name + ".range"]) ? I = k[M._name + ".range"].slice() : Array.isArray((k[M._name] || {}).range) && (I = k[M._name].range.slice()), L && $ && (S.r2l(L[0]) !== S.r2l($[0]) || S.r2l(L[1]) !== S.r2l($[1])) && (O = { xr0: L, xr1: $ }), F && I && (M.r2l(F[0]) !== M.r2l(I[0]) || M.r2l(F[1]) !== M.r2l(I[1])) && (G = { yr0: F, yr1: I }), (O || G) && s.push(_t.extendFlat({ plotinfo: T }, O, G)); } } return Promise.resolve(); }, o.runFn = function(u) { var f, d = e10._fullLayout._basePlotModules, h = s.length, p; if (r) for (p = 0; p < d.length; p++) d[p].transitionAxes && d[p].transitionAxes(e10, s, i, u); h ? (f = _t.extendFlat({}, i), f.duration = 0, delete l.cartesian) : f = i; for (var v in l) { var m = l[v], g = e10._fullData[m[0]]._module; g.basePlotModule.plot(e10, m, f, u); } }, t4(e10, i, o); }; lt.transitionFromReact = function(e10, t, r, n) { var a = e10._fullLayout, i = a.transition, o = {}, l = []; return o.prepareFn = function() { var s = a._plots; o.redraw = false, t.anim === "some" && (o.redraw = true), r.anim === "some" && (o.redraw = true); for (var u in s) { var f = s[u], d = f.xaxis, h = f.yaxis, p = n[d._name].range.slice(), v = n[h._name].range.slice(), m = d.range.slice(), g = h.range.slice(); d.setScale(), h.setScale(); var y = null, w = null; (d.r2l(p[0]) !== d.r2l(m[0]) || d.r2l(p[1]) !== d.r2l(m[1])) && (y = { xr0: p, xr1: m }), (h.r2l(v[0]) !== h.r2l(g[0]) || h.r2l(v[1]) !== h.r2l(g[1])) && (w = { yr0: v, yr1: g }), (y || w) && l.push(_t.extendFlat({ plotinfo: f }, y, w)); } return Promise.resolve(); }, o.runFn = function(s) { for (var u = e10._fullData, f = e10._fullLayout, d = f._basePlotModules, h, p, v, m = [], g = 0; g < u.length; g++) m.push(g); function y() { if (e10._fullLayout) for (var k = 0; k < d.length; k++) d[k].transitionAxes && d[k].transitionAxes(e10, l, h, s); } function w() { if (e10._fullLayout) for (var k = 0; k < d.length; k++) d[k].plot(e10, v, p, s); } l.length && t.anim ? i.ordering === "traces first" ? (h = _t.extendFlat({}, i, { duration: 0 }), v = m, p = i, setTimeout(y, i.duration), w()) : (h = i, v = null, p = _t.extendFlat({}, i, { duration: 0 }), setTimeout(w, h.duration), y()) : l.length ? (h = i, y()) : t.anim && (v = m, p = i, w()); }, t4(e10, i, o); }; function t4(e10, t, r) { var n = false; function a(d) { var h = Promise.resolve(); if (!d) return h; for (; d.length; ) h = h.then(d.shift()); return h; } function i(d) { if (d) for (; d.length; ) d.shift(); } function o() { return e10.emit("plotly_transitioning", []), new Promise(function(d) { e10._transitioning = true, t.duration > 0 && (e10._transitioningWithDuration = true), e10._transitionData._interruptCallbacks.push(function() { n = true; }), r.redraw && e10._transitionData._interruptCallbacks.push(function() { return hr.call("redraw", e10); }), e10._transitionData._interruptCallbacks.push(function() { e10.emit("plotly_transitioninterrupted", []); }); var h = 0, p = 0; function v() { return h++, function() { p++, !n && p === h && l(d); }; } r.runFn(v), setTimeout(v()); }); } function l(d) { if (e10._transitionData) return i(e10._transitionData._interruptCallbacks), Promise.resolve().then(function() { if (r.redraw) return hr.call("redraw", e10); }).then(function() { e10._transitioning = false, e10._transitioningWithDuration = false, e10.emit("plotly_transitioned", []); }).then(d); } function s() { if (e10._transitionData) return e10._transitioning = false, a(e10._transitionData._interruptCallbacks); } var u = [ lt.previousPromises, s, r.prepareFn, lt.rehover, lt.reselect, o ], f = _t.syncOrAsync(u, e10); return (!f || !f.then) && (f = Promise.resolve()), f.then(function() { return e10; }); } lt.doCalcdata = function(e10, t) { var r = oa.list(e10), n = e10._fullData, a = e10._fullLayout, i, o, l, s, u = new Array(n.length), f = (e10.calcdata || []).slice(); for (e10.calcdata = u, a._numBoxes = 0, a._numViolins = 0, a._violinScaleGroupStats = {}, e10._hmpixcount = 0, e10._hmlumcount = 0, a._piecolormap = {}, a._sunburstcolormap = {}, a._treemapcolormap = {}, a._iciclecolormap = {}, a._funnelareacolormap = {}, l = 0; l < n.length; l++) if (Array.isArray(t) && t.indexOf(l) === -1) { u[l] = f[l]; continue; } for (l = 0; l < n.length; l++) i = n[l], i._arrayAttrs = YL.findArrayAttributes(i), i._extremes = {}; var d = a._subplots.polar || []; for (l = 0; l < d.length; l++) r.push( a[d[l]].radialaxis, a[d[l]].angularaxis ); for (var h in a._colorAxes) { var p = a[h]; p.cauto !== false && (delete p.cmin, delete p.cmax); } var v = false; function m(w) { if (i = n[w], o = i._module, i.visible === true && i.transforms) { if (o && o.calc) { var k = o.calc(e10, i); k[0] && k[0].t && k[0].t._scene && delete k[0].t._scene.dirty; } for (s = 0; s < i.transforms.length; s++) { var x = i.transforms[s]; o = wp[x.type], o && o.calcTransform && (i._hasCalcTransform = true, v = true, o.calcTransform(e10, i, x)); } } } function g(w, k) { if (i = n[w], o = i._module, !!o.isContainer === k) { var x = []; if (i.visible === true && i._length !== 0) { delete i._indexToPoints; var _ = i.transforms || []; for (s = _.length - 1; s >= 0; s--) if (_[s].enabled) { i._indexToPoints = _[s]._indexToPoints; break; } o && o.calc && (x = o.calc(e10, i)); } (!Array.isArray(x) || !x[0]) && (x = [{ x: O2, y: O2 }]), x[0].t || (x[0].t = {}), x[0].trace = i, u[w] = x; } } for (j2(r, n, a), l = 0; l < n.length; l++) g(l, true); for (l = 0; l < n.length; l++) m(l); for (v && j2(r, n, a), l = 0; l < n.length; l++) g(l, true); for (l = 0; l < n.length; l++) g(l, false); U2(e10); var y = aW(r, e10); if (y.length) { for (a._numBoxes = 0, a._numViolins = 0, l = 0; l < y.length; l++) g(y[l], true); for (l = 0; l < y.length; l++) g(y[l], false); U2(e10); } hr.getComponentMethod("fx", "calc")(e10), hr.getComponentMethod("errorbars", "calc")(e10); }; var nW = /(total|sum|min|max|mean|median) (ascending|descending)/; function aW(e10, t) { var r = [], n, a, i, o, l; function s(P, R, H) { var B = R._id.charAt(0); if (P === "histogram2dcontour") { var W = R._counterAxes[0], ee = oa.getFromId(t, W), re = B === "x" || W === "x" && ee.type === "category", ae = B === "y" || W === "y" && ee.type === "category"; return function(Q, ue) { return Q === 0 || ue === 0 || re && Q === H[ue].length - 1 || ae && ue === H.length - 1 ? -1 : (B === "y" ? ue : Q) - 1; }; } else return function(Q, ue) { return B === "y" ? ue : Q; }; } var u = { min: function(P) { return _t.aggNums(Math.min, null, P); }, max: function(P) { return _t.aggNums(Math.max, null, P); }, sum: function(P) { return _t.aggNums(function(R, H) { return R + H; }, null, P); }, total: function(P) { return _t.aggNums(function(R, H) { return R + H; }, null, P); }, mean: function(P) { return _t.mean(P); }, median: function(P) { return _t.median(P); } }; function f(P, R) { return P[1] - R[1]; } function d(P, R) { return R[1] - P[1]; } for (n = 0; n < e10.length; n++) { var h = e10[n]; if (h.type === "category") { var p = h.categoryorder.match(nW); if (p) { var v = p[1], m = p[2], g = h._id.charAt(0), y = g === "x", w = []; for (a = 0; a < h._categories.length; a++) w.push([h._categories[a], []]); for (a = 0; a < h._traceIndices.length; a++) { var k = h._traceIndices[a], x = t._fullData[k]; if (x.visible === true) { var _ = x.type; hr.traceIs(x, "histogram") && (delete x._xautoBinFinished, delete x._yautoBinFinished); var T = _ === "splom", S = _ === "scattergl", M = t.calcdata[k]; for (i = 0; i < M.length; i++) { var L = M[i], F, $; if (T) { var I = x._axesDim[h._id]; if (!y) { var O = x._diag[I][0]; O && (h = t._fullLayout[oa.id2name(O)]); } var G = L.trace.dimensions[I].values; for (o = 0; o < G.length; o++) for (F = h._categoriesMap[G[o]], l = 0; l < L.trace.dimensions.length; l++) if (l !== I) { var K = L.trace.dimensions[l]; w[F][1].push(K.values[o]); } } else if (S) { for (o = 0; o < L.t.x.length; o++) y ? (F = L.t.x[o], $ = L.t.y[o]) : (F = L.t.y[o], $ = L.t.x[o]), w[F][1].push($); L.t && L.t._scene && delete L.t._scene.dirty; } else if (L.hasOwnProperty("z")) { $ = L.z; var V = s(x.type, h, $); for (o = 0; o < $.length; o++) for (l = 0; l < $[o].length; l++) F = V(l, o), F + 1 && w[F][1].push($[o][l]); } else for (F = L.p, F === void 0 && (F = L[g]), $ = L.s, $ === void 0 && ($ = L.v), $ === void 0 && ($ = y ? L.y : L.x), Array.isArray($) || ($ === void 0 ? $ = [] : $ = [$]), o = 0; o < $.length; o++) w[F][1].push($[o]); } } } h._categoriesValue = w; var z = []; for (a = 0; a < w.length; a++) z.push([ w[a][0], u[v](w[a][1]) ]); z.sort(m === "descending" ? d : f), h._categoriesAggregatedValue = z, h._initialCategories = z.map(function(P) { return P[0]; }), r = r.concat(h.sortByInitialCategories()); } } } return r; } function j2(e10, t, r) { var n = {}; function a(s) { s.clearCalc(), s.type === "multicategory" && s.setupMultiCategory(t), n[s._id] = 1; } _t.simpleMap(e10, a); for (var i = r._axisMatchGroups || [], o = 0; o < i.length; o++) for (var l in i[o]) n[l] || a(r[oa.id2name(l)]); } function U2(e10) { var t = e10._fullLayout, r = t._visibleModules, n = {}, a, i, o; for (i = 0; i < r.length; i++) { var l = r[i], s = l.crossTraceCalc; if (s) { var u = l.basePlotModule.name; n[u] ? _t.pushUnique(n[u], s) : n[u] = [s]; } } for (o in n) { var f = n[o], d = t._subplots[o]; if (Array.isArray(d)) for (a = 0; a < d.length; a++) { var h = d[a], p = o === "cartesian" ? t._plots[h] : t[h]; for (i = 0; i < f.length; i++) f[i](e10, p, h); } else for (i = 0; i < f.length; i++) f[i](e10); } } lt.rehover = function(e10) { e10._fullLayout._rehover && e10._fullLayout._rehover(); }; lt.redrag = function(e10) { e10._fullLayout._redrag && e10._fullLayout._redrag(); }; lt.reselect = function(e10) { var t = e10._fullLayout, r = (e10.layout || {}).selections, n = t._previousSelections; t._previousSelections = r; var a = t._reselect || JSON.stringify(r) !== JSON.stringify(n); hr.getComponentMethod("selections", "reselect")(e10, a); }; lt.generalUpdatePerTraceModule = function(e10, t, r, n) { var a = t.traceHash, i = {}, o; for (o = 0; o < r.length; o++) { var l = r[o], s = l[0].trace; s.visible && (i[s.type] = i[s.type] || [], i[s.type].push(l)); } for (var u in a) if (!i[u]) { var f = a[u][0], d = f[0].trace; d.visible = false, i[u] = [f]; } for (var h in i) { var p = i[h], v = p[0][0].trace._module; v.plot(e10, t, _t.filterVisible(p), n); } t.traceHash = i; }; lt.plotBasePlot = function(e10, t, r, n, a) { var i = hr.getModule(e10), o = Vq(t.calcdata, i)[0]; i.plot(t, o, n, a); }; lt.cleanBasePlot = function(e10, t, r, n, a) { var i = a._has && a._has(e10), o = r._has && r._has(e10); i && !o && a["_" + e10 + "layer"].selectAll("g.trace").remove(); }; var Tn = qL.exports; var r4 = { exports: {} }; var Rn = {}; var yl = {}; (function(e10) { e10.xmlns = "http://www.w3.org/2000/xmlns/", e10.svg = "http://www.w3.org/2000/svg", e10.xlink = "http://www.w3.org/1999/xlink", e10.svgAttrs = { xmlns: e10.svg, "xmlns:xlink": e10.xlink }; })(yl); var On = { // from bottom left: this is the origin of our paper-reference // positioning system FROM_BL: { left: 0, center: 0.5, right: 1, bottom: 0, middle: 0.5, top: 1 }, // from top left: this is the screen pixel positioning origin FROM_TL: { left: 0, center: 0.5, right: 1, bottom: 1, middle: 0.5, top: 0 }, // from bottom right: sometimes you just need the opposite of ^^ FROM_BR: { left: 1, center: 0.5, right: 0, bottom: 0, middle: 0.5, top: 1 }, // multiple of fontSize to get the vertical offset between lines LINE_SPACING: 1.3, // multiple of fontSize to shift from the baseline // to the cap (captical letter) line // (to use when we don't calculate this shift from Drawing.bBox) // This is an approximation since in reality cap height can differ // from font to font. However, according to Wikipedia // an "average" font might have a cap height of 70% of the em // https://en.wikipedia.org/wiki/Em_(typography)#History CAP_SHIFT: 0.7, // half the cap height (distance between baseline and cap line) // of an "average" font (for more info see above). MID_SHIFT: 0.35, OPPOSITE_SIDE: { left: "right", right: "left", top: "bottom", bottom: "top" } }; (function(e10) { var t = lr, r = Ue, n = r.strTranslate, a = yl, i = On.LINE_SPACING, o = /([^$]*)([$]+[^$]*[$]+)([^$]*)/; e10.convertToTspans = function(R, H, B) { var W = R.text(), ee = !R.attr("data-notex") && H && H._context.typesetMath && typeof MathJax < "u" && W.match(o), re = t.select(R.node().parentNode); if (re.empty()) return; var ae = R.attr("class") ? R.attr("class").split(" ")[0] : "text"; ae += "-math", re.selectAll("svg." + ae).remove(), re.selectAll("g." + ae + "-group").remove(), R.style("display", null).attr({ // some callers use data-unformatted *from the element* in 'cancel' // so we need it here even if we're going to turn it into math // these two (plus style and text-anchor attributes) form the key we're // going to use for Drawing.bBox "data-unformatted": W, "data-math": "N" }); function Q() { re.empty() || (ae = R.attr("class") + "-math", re.select("svg." + ae).remove()), R.text("").style("white-space", "pre"); var ue = K(R.node(), W); ue && R.style("pointer-events", "all"), e10.positionText(R), B && B.call(R); } return ee ? (H && H._promises || []).push(new Promise(function(ue) { R.style("display", "none"); var j = parseInt(R.node().style.fontSize, 10), U = { fontSize: j }; d(ee[2], U, function(Z, le, J) { re.selectAll("svg." + ae).remove(), re.selectAll("g." + ae + "-group").remove(); var pe = Z && Z.select("svg"); if (!pe || !pe.node()) { Q(), ue(); return; } var ge = re.append("g").classed(ae + "-group", true).attr({ "pointer-events": "none", "data-unformatted": W, "data-math": "Y" }); ge.node().appendChild(pe.node()), le && le.node() && pe.node().insertBefore( le.node().cloneNode(true), pe.node().firstChild ); var ve = J.width, me = J.height; pe.attr({ class: ae, height: me, preserveAspectRatio: "xMinYMin meet" }).style({ overflow: "visible", "pointer-events": "none" }); var Le = R.node().style.fill || "black", ze = pe.select("g"); ze.attr({ fill: Le, stroke: Le }); var Fe = ze.node().getBoundingClientRect(), Oe = Fe.width, Re = Fe.height; (Oe > ve || Re > me) && (pe.style("overflow", "hidden"), Fe = pe.node().getBoundingClientRect(), Oe = Fe.width, Re = Fe.height); var We = +R.attr("x"), Me = +R.attr("y"), Ve = j || R.node().getBoundingClientRect().height, qe = -Ve / 4; if (ae[0] === "y") ge.attr({ transform: "rotate(" + [-90, We, Me] + ")" + n(-Oe / 2, qe - Re / 2) }); else if (ae[0] === "l") Me = qe - Re / 2; else if (ae[0] === "a" && ae.indexOf("atitle") !== 0) We = 0, Me = qe; else { var Qe = R.attr("text-anchor"); We = We - Oe * (Qe === "middle" ? 0.5 : Qe === "end" ? 1 : 0), Me = Me + qe - Re / 2; } pe.attr({ x: We, y: Me }), B && B.call(R, ge), ue(ge); }); })) : Q(), R; }; var l = /(<|<|<)/g, s = /(>|>|>)/g; function u(R) { return R.replace(l, "\\lt ").replace(s, "\\gt "); } var f = [["$", "$"], ["\\(", "\\)"]]; function d(R, H, B) { var W = parseInt( (MathJax.version || "").split(".")[0] ); if (W !== 2 && W !== 3) { r.warn("No MathJax version:", MathJax.version); return; } var ee, re, ae, Q, ue = function() { return re = r.extendDeepAll({}, MathJax.Hub.config), ae = MathJax.Hub.processSectionDelay, MathJax.Hub.processSectionDelay !== void 0 && (MathJax.Hub.processSectionDelay = 0), MathJax.Hub.Config({ messageStyle: "none", tex2jax: { inlineMath: f }, displayAlign: "left" }); }, j = function() { re = r.extendDeepAll({}, MathJax.config), MathJax.config.tex || (MathJax.config.tex = {}), MathJax.config.tex.inlineMath = f; }, U = function() { if (ee = MathJax.Hub.config.menuSettings.renderer, ee !== "SVG") return MathJax.Hub.setRenderer("SVG"); }, Z = function() { ee = MathJax.config.startup.output, ee !== "svg" && (MathJax.config.startup.output = "svg"); }, le = function() { var Le = "math-output-" + r.randstr({}, 64); Q = t.select("body").append("div").attr({ id: Le }).style({ visibility: "hidden", position: "absolute", "font-size": H.fontSize + "px" }).text(u(R)); var ze = Q.node(); return W === 2 ? MathJax.Hub.Typeset(ze) : MathJax.typeset([ze]); }, J = function() { var Le = Q.select( W === 2 ? ".MathJax_SVG" : ".MathJax" ), ze = !Le.empty() && Q.select("svg").node(); if (!ze) r.log("There was an error in the tex syntax.", R), B(); else { var Fe = ze.getBoundingClientRect(), Oe; W === 2 ? Oe = t.select("body").select("#MathJax_SVG_glyphs") : Oe = Le.select("defs"), B(Le, Oe, Fe); } Q.remove(); }, pe = function() { if (ee !== "SVG") return MathJax.Hub.setRenderer(ee); }, ge = function() { ee !== "svg" && (MathJax.config.startup.output = ee); }, ve = function() { return ae !== void 0 && (MathJax.Hub.processSectionDelay = ae), MathJax.Hub.Config(re); }, me = function() { MathJax.config = re; }; W === 2 ? MathJax.Hub.Queue( ue, U, le, J, pe, ve ) : W === 3 && (j(), Z(), MathJax.startup.defaultReady(), MathJax.startup.promise.then(function() { le(), J(), ge(), me(); })); } var h = { // would like to use baseline-shift for sub/sup but FF doesn't support it // so we need to use dy along with the uber hacky shift-back-to // baseline below sup: "font-size:70%", sub: "font-size:70%", b: "font-weight:bold", i: "font-style:italic", a: "cursor:pointer", span: "", em: "font-style:italic;font-weight:bold" }, p = { sub: "0.3em", sup: "-0.6em" }, v = { sub: "-0.21em", sup: "0.42em" }, m = "​", g = ["http:", "https:", "mailto:", "", void 0, ":"], y = e10.NEWLINES = /(\r\n?|\n)/g, w = /(<[^<>]*>)/, k = /<(\/?)([^ >]*)(\s+(.*))?>/i, x = //i; e10.BR_TAG_ALL = //gi; var _ = /(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i, T = /(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i, S = /(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i, M = /(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i; function L(R, H) { if (!R) return null; var B = R.match(H), W = B && (B[3] || B[4]); return W && O(W); } var F = /(^|;)\s*color:/; e10.plainText = function(R, H) { H = H || {}; for (var B = H.len !== void 0 && H.len !== -1 ? H.len : 1 / 0, W = H.allowedTags !== void 0 ? H.allowedTags : ["br"], ee = "...", re = ee.length, ae = R.split(w), Q = [], ue = "", j = 0, U = 0; U < ae.length; U++) { var Z = ae[U], le = Z.match(k), J = le && le[2].toLowerCase(); if (J) W.indexOf(J) !== -1 && (Q.push(Z), ue = J); else { var pe = Z.length; if (j + pe < B) Q.push(Z), j += pe; else if (j < B) { var ge = B - j; ue && (ue !== "br" || ge <= re || pe <= re) && Q.pop(), B > re ? Q.push(Z.substr(0, ge - re) + ee) : Q.push(Z.substr(0, ge)); break; } ue = ""; } } return Q.join(""); }; var $ = { mu: "μ", amp: "&", lt: "<", gt: ">", nbsp: " ", times: "×", plusmn: "±", deg: "°" }, I = /&(#\d+|#x[\da-fA-F]+|[a-z]+);/g; function O(R) { return R.replace(I, function(H, B) { var W; return B.charAt(0) === "#" ? W = G( B.charAt(1) === "x" ? parseInt(B.substr(2), 16) : parseInt(B.substr(1), 10) ) : W = $[B], W || H; }); } e10.convertEntities = O; function G(R) { if (!(R > 1114111)) { var H = String.fromCodePoint; if (H) return H(R); var B = String.fromCharCode; return R <= 65535 ? B(R) : B( (R >> 10) + 55232, R % 1024 + 56320 ); } } function K(R, H) { H = H.replace(y, " "); var B = false, W = [], ee, re = -1; function ae() { re++; var Re = document.createElementNS(a.svg, "tspan"); t.select(Re).attr({ class: "line", dy: re * i + "em" }), R.appendChild(Re), ee = Re; var We = W; if (W = [{ node: Re }], We.length > 1) for (var Me = 1; Me < We.length; Me++) Q(We[Me]); } function Q(Re) { var We = Re.type, Me = {}, Ve; if (We === "a") { Ve = "a"; var qe = Re.target, Qe = Re.href, ot = Re.popup; Qe && (Me = { "xlink:xlink:show": qe === "_blank" || qe.charAt(0) !== "_" ? "new" : "replace", target: qe, "xlink:xlink:href": Qe }, ot && (Me.onclick = 'window.open(this.href.baseVal,this.target.baseVal,"' + ot + '");return false;')); } else Ve = "tspan"; Re.style && (Me.style = Re.style); var ht = document.createElementNS(a.svg, Ve); if (We === "sup" || We === "sub") { ue(ee, m), ee.appendChild(ht); var vt = document.createElementNS(a.svg, "tspan"); ue(vt, m), t.select(vt).attr("dy", v[We]), Me.dy = p[We], ee.appendChild(ht), ee.appendChild(vt); } else ee.appendChild(ht); t.select(ht).attr(Me), ee = Re.node = ht, W.push(Re); } function ue(Re, We) { Re.appendChild(document.createTextNode(We)); } function j(Re) { if (W.length === 1) { r.log("Ignoring unexpected end tag .", H); return; } var We = W.pop(); Re !== We.type && r.log("Start tag <" + We.type + "> doesnt match end tag <" + Re + ">. Pretending it did match.", H), ee = W[W.length - 1].node; } var U = x.test(H); U ? ae() : (ee = R, W = [{ node: R }]); for (var Z = H.split(w), le = 0; le < Z.length; le++) { var J = Z[le], pe = J.match(k), ge = pe && pe[2].toLowerCase(), ve = h[ge]; if (ge === "br") ae(); else if (ve === void 0) ue(ee, O(J)); else if (pe[1]) j(ge); else { var me = pe[4], Le = { type: ge }, ze = L(me, _); if (ze ? (ze = ze.replace(F, "$1 fill:"), ve && (ze += ";" + ve)) : ve && (ze = ve), ze && (Le.style = ze), ge === "a") { B = true; var Fe = L(me, T); if (Fe) { var Oe = V(Fe); Oe && (Le.href = Oe, Le.target = L(me, S) || "_blank", Le.popup = L(me, M)); } } Q(Le); } } return B; } function V(R) { var H = encodeURI(decodeURI(R)), B = document.createElement("a"), W = document.createElement("a"); B.href = R, W.href = H; var ee = B.protocol, re = W.protocol; return g.indexOf(ee) !== -1 && g.indexOf(re) !== -1 ? H : ""; } e10.sanitizeHTML = function(H) { H = H.replace(y, " "); for (var B = document.createElement("p"), W = B, ee = [], re = H.split(w), ae = 0; ae < re.length; ae++) { var Q = re[ae], ue = Q.match(k), j = ue && ue[2].toLowerCase(); if (j in h) if (ue[1]) ee.length && (W = ee.pop()); else { var U = ue[4], Z = L(U, _), le = Z ? { style: Z } : {}; if (j === "a") { var J = L(U, T); if (J) { var pe = V(J); if (pe) { le.href = pe; var ge = L(U, S); ge && (le.target = ge); } } } var ve = document.createElement(j); W.appendChild(ve), t.select(ve).attr(le), W = ve, ee.push(ve); } else W.appendChild( document.createTextNode(O(Q)) ); } var me = "innerHTML"; return B[me]; }, e10.lineCount = function(H) { return H.selectAll("tspan.line").size() || 1; }, e10.positionText = function(H, B, W) { return H.each(function() { var ee = t.select(this); function re(ue, j) { return j === void 0 ? (j = ee.attr(ue), j === null && (ee.attr(ue, 0), j = 0)) : ee.attr(ue, j), j; } var ae = re("x", B), Q = re("y", W); this.nodeName === "text" && ee.selectAll("tspan.line").attr({ x: ae, y: Q }); }); }; function z(R, H, B) { var W = B.horizontalAlign, ee = B.verticalAlign || "top", re = R.node().getBoundingClientRect(), ae = H.node().getBoundingClientRect(), Q, ue, j; return ee === "bottom" ? ue = function() { return re.bottom - Q.height; } : ee === "middle" ? ue = function() { return re.top + (re.height - Q.height) / 2; } : ue = function() { return re.top; }, W === "right" ? j = function() { return re.right - Q.width; } : W === "center" ? j = function() { return re.left + (re.width - Q.width) / 2; } : j = function() { return re.left; }, function() { Q = this.node().getBoundingClientRect(); var U = j() - ae.left, Z = ue() - ae.top, le = B.gd || {}; if (B.gd) { le._fullLayout._calcInverseTransform(le); var J = r.apply3DTransform(le._fullLayout._invTransform)(U, Z); U = J[0], Z = J[1]; } return this.style({ top: Z + "px", left: U + "px", "z-index": 1e3 }), this; }; } var P = "1px "; e10.makeTextShadow = function(R) { var H = P, B = P, W = P; return H + B + W + R + ", -" + H + "-" + B + W + R + ", " + H + "-" + B + W + R + ", -" + H + B + W + R; }, e10.makeEditable = function(R, H) { var B = H.gd, W = H.delegate, ee = t.dispatch("edit", "input", "cancel"), re = W || R; if (R.style({ "pointer-events": W ? "none" : "all" }), R.size() !== 1) throw new Error("boo"); function ae() { ue(), R.style({ opacity: 0 }); var j = re.attr("class"), U; j ? U = "." + j.split(" ")[0] + "-math-group" : U = "[class*=-math-group]", U && t.select(R.node().parentNode).select(U).style({ opacity: 0 }); } function Q(j) { var U = j.node(), Z = document.createRange(); Z.selectNodeContents(U); var le = window.getSelection(); le.removeAllRanges(), le.addRange(Z), U.focus(); } function ue() { var j = t.select(B), U = j.select(".svg-container"), Z = U.append("div"), le = R.node().style, J = parseFloat(le.fontSize || 12), pe = H.text; pe === void 0 && (pe = R.attr("data-unformatted")), Z.classed("plugin-editable editable", true).style({ position: "absolute", "font-family": le.fontFamily || "Arial", "font-size": J, color: H.fill || le.fill || "black", opacity: 1, "background-color": H.background || "transparent", outline: "#ffffff33 1px solid", margin: [-J / 8 + 1, 0, 0, -1].join("px ") + "px", padding: "0", "box-sizing": "border-box" }).attr({ contenteditable: true }).text(pe).call(z(R, U, H)).on("blur", function() { B._editing = false, R.text(this.textContent).style({ opacity: 1 }); var ge = t.select(this).attr("class"), ve; ge ? ve = "." + ge.split(" ")[0] + "-math-group" : ve = "[class*=-math-group]", ve && t.select(R.node().parentNode).select(ve).style({ opacity: 0 }); var me = this.textContent; t.select(this).transition().duration(0).remove(), t.select(document).on("mouseup", null), ee.edit.call(R, me); }).on("focus", function() { var ge = this; B._editing = true, t.select(document).on("mouseup", function() { if (t.event.target === ge) return false; document.activeElement === Z.node() && Z.node().blur(); }); }).on("keyup", function() { t.event.which === 27 ? (B._editing = false, R.style({ opacity: 1 }), t.select(this).style({ opacity: 0 }).on("blur", function() { return false; }).transition().remove(), ee.cancel.call(R, this.textContent)) : (ee.input.call(R, this.textContent), t.select(this).call(z(R, U, H))); }).on("keydown", function() { t.event.which === 13 && this.blur(); }).call(Q); } return H.immediate ? ae() : re.on("click", ae), t.rebind(R, ee, "on"); }; })(Rn); var n4 = { exports: {} }; var iW = lr; var Ph = bi; var nc = sr; var jd = Ue; var G2 = nr; var oW = Wu.isValid; function lW(e10, t, r) { var n = t ? jd.nestedProperty(e10, t).get() || {} : e10, a = n[r || "color"]; a && a._inputArray && (a = a._inputArray); var i = false; if (jd.isArrayOrTypedArray(a)) { for (var o = 0; o < a.length; o++) if (nc(a[o])) { i = true; break; } } return jd.isPlainObject(n) && (i || n.showscale === true || nc(n.cmin) && nc(n.cmax) || oW(n.colorscale) || jd.isPlainObject(n.colorbar)); } var V2 = ["showscale", "autocolorscale", "colorscale", "reversescale", "colorbar"]; var kf = ["min", "max", "mid", "auto"]; function a4(e10) { var t = e10._colorAx, r = t || e10, n = {}, a, i, o; for (i = 0; i < V2.length; i++) o = V2[i], n[o] = r[o]; if (t) for (a = "c", i = 0; i < kf.length; i++) o = kf[i], n[o] = r["c" + o]; else { var l; for (i = 0; i < kf.length; i++) { if (o = kf[i], l = "c" + o, l in r) { n[o] = r[l]; continue; } l = "z" + o, l in r && (n[o] = r[l]); } a = l.charAt(0); } return n._sync = function(s, u) { var f = kf.indexOf(s) !== -1 ? a + s : s; r[f] = r["_" + f] = u; }, n; } function i4(e10) { for (var t = a4(e10), r = t.min, n = t.max, a = t.reversescale ? o4(t.colorscale) : t.colorscale, i = a.length, o = new Array(i), l = new Array(i), s = 0; s < i; s++) { var u = a[s]; o[s] = r + u[0] * (n - r), l[s] = u[1]; } return { domain: o, range: l }; } function o4(e10) { for (var t = e10.length, r = new Array(t), n = t - 1, a = 0; n >= 0; n--, a++) { var i = e10[n]; r[a] = [1 - i[0], i[1]]; } return r; } function l4(e10, t) { t = t || {}; for (var r = e10.domain, n = e10.range, a = n.length, i = new Array(a), o = 0; o < a; o++) { var l = Ph(n[o]).toRgb(); i[o] = [l.r, l.g, l.b, l.a]; } var s = iW.scale.linear().domain(r).range(i).clamp(true), u = t.noNumericCheck, f = t.returnArray, d; return u && f ? d = s : u ? d = function(h) { return q2(s(h)); } : f ? d = function(h) { return nc(h) ? s(h) : Ph(h).isValid() ? h : G2.defaultLine; } : d = function(h) { return nc(h) ? q2(s(h)) : Ph(h).isValid() ? h : G2.defaultLine; }, d.domain = s.domain, d.range = function() { return n; }, d; } function sW(e10, t) { return l4(i4(e10), t); } function q2(e10) { var t = { r: e10[0], g: e10[1], b: e10[2], a: e10[3] }; return Ph(t).toRgbString(); } var wi = { hasColorscale: lW, extractOpts: a4, extractScale: i4, flipScale: o4, makeColorScaleFunc: l4, makeColorScaleFuncFromTrace: sW }; var s4 = mL; var uW = s4.FORMAT_LINK; var fW = s4.DATE_FORMAT_LINK; function cW(e10, t) { return { valType: "string", dflt: "", editType: "none", description: (t ? cb : u4)("hover text", e10) + [ "By default the values are formatted using " + (t ? "generic number format" : "`" + e10 + "axis.hoverformat`") + "." ].join(" ") }; } function cb(e10, t) { return [ "Sets the " + e10 + " formatting rule" + (t ? "for `" + t + "` " : ""), "using d3 formatting mini-languages", "which are very similar to those in Python. For numbers, see: " + uW + "." ].join(" "); } function u4(e10, t) { return cb(e10, t) + [ " And for dates see: " + fW + ".", "We add two items to d3's date formatter:", "*%h* for half of the year as a decimal number as well as", "*%{n}f* for fractional seconds", "with n digits. For example, *2016-10-13 09:15:23.456* with tickformat", "*%H~%M~%S.%2f* would display *09~15~23.46*" ].join(" "); } var kp = { axisHoverFormat: cW, descriptionOnlyNumbers: cb, descriptionWithDates: u4 }; var Xm = Fn; var uu = da; var f4 = Zi.dash; var db = en.extendFlat; var W2 = Mr.templatedArray; var Z2 = kp.descriptionWithDates; var dW = Qr.ONEDAY; var Fi = Yn; var Km = Fi.HOUR_PATTERN; var Jm = Fi.WEEKDAY_PATTERN; var $h = { valType: "enumerated", values: ["auto", "linear", "array"], editType: "ticks", impliedEdits: { tick0: void 0, dtick: void 0 }, description: [ "Sets the tick mode for this axis.", "If *auto*, the number of ticks is set via `nticks`.", "If *linear*, the placement of the ticks is determined by", "a starting position `tick0` and a tick step `dtick`", "(*linear* is the default value if `tick0` and `dtick` are provided).", "If *array*, the placement of the ticks is set via `tickvals`", "and the tick text is `ticktext`.", "(*array* is the default value if `tickvals` is provided)." ].join(" ") }; var hW = db({}, $h, { values: $h.values.slice().concat(["sync"]), description: [ $h.description, "If *sync*, the number of ticks will sync with the overlayed axis", "set by `overlaying` property." ].join(" ") }); function Y2(e10) { return { valType: "integer", min: 0, dflt: e10 ? 5 : 0, editType: "ticks", description: [ "Specifies the maximum number of ticks for the particular axis.", "The actual number of ticks will be chosen automatically to be", "less than or equal to `nticks`.", "Has an effect only if `tickmode` is set to *auto*." ].join(" ") }; } var X2 = { valType: "any", editType: "ticks", impliedEdits: { tickmode: "linear" }, description: [ "Sets the placement of the first tick on this axis.", "Use with `dtick`.", "If the axis `type` is *log*, then you must take the log of your starting tick", "(e.g. to set the starting tick to 100, set the `tick0` to 2)", "except when `dtick`=*L* (see `dtick` for more info).", "If the axis `type` is *date*, it should be a date string, like date data.", "If the axis `type` is *category*, it should be a number, using the scale where", "each category is assigned a serial number from zero in the order it appears." ].join(" ") }; var K2 = { valType: "any", editType: "ticks", impliedEdits: { tickmode: "linear" }, description: [ "Sets the step in-between ticks on this axis. Use with `tick0`.", "Must be a positive number, or special strings available to *log* and *date* axes.", "If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n", "is the tick number. For example,", "to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.", "To set tick marks at 1, 100, 10000, ... set dtick to 2.", "To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.", "*log* has several special values; *L*, where `f` is a positive number,", "gives ticks linearly spaced in value (but not position).", "For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.", "To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).", "`tick0` is ignored for *D1* and *D2*.", "If the axis `type` is *date*, then you must convert the time to milliseconds.", "For example, to set the interval between ticks to one day,", "set `dtick` to 86400000.0.", "*date* also has special values *M* gives ticks spaced by a number of months.", "`n` must be a positive integer.", "To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.", "To set ticks every 4 years, set `dtick` to *M48*" ].join(" ") }; var J2 = { valType: "data_array", editType: "ticks", description: [ "Sets the values at which ticks on this axis appear.", "Only has an effect if `tickmode` is set to *array*.", "Used with `ticktext`." ].join(" ") }; var Q2 = { valType: "enumerated", values: ["outside", "inside", ""], editType: "ticks", description: [ "Determines whether ticks are drawn or not.", "If **, this axis' ticks are not drawn.", "If *outside* (*inside*), this axis' are drawn outside (inside)", "the axis lines." ].join(" ") }; function eT(e10) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the tick length (in px)." }; return e10 || (t.dflt = 5), t; } function tT(e10) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the tick width (in px)." }; return e10 || (t.dflt = 1), t; } var rT = { valType: "color", dflt: uu.defaultLine, editType: "ticks", description: "Sets the tick color." }; var nT = { valType: "color", dflt: uu.lightLine, editType: "ticks", description: "Sets the color of the grid lines." }; function aT(e10) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the width (in px) of the grid lines." }; return e10 || (t.dflt = 1), t; } var iT = db({}, f4, { editType: "ticks" }); var oT = { valType: "boolean", editType: "ticks", description: [ "Determines whether or not grid lines are drawn.", "If *true*, the grid lines are drawn at every tick mark." ].join(" ") }; var Ki = { visible: { valType: "boolean", editType: "plot", description: [ "A single toggle to hide the axis while preserving interaction like dragging.", "Default is true when a cheater plot is present on the axis, otherwise", "false" ].join(" ") }, color: { valType: "color", dflt: uu.defaultLine, editType: "ticks", description: [ "Sets default for all colors associated with this axis", "all at once: line, font, tick, and grid colors.", "Grid color is lightened by blending this with the plot background", "Individual pieces can override this." ].join(" ") }, title: { text: { valType: "string", editType: "ticks", description: [ "Sets the title of this axis.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: Xm({ editType: "ticks", description: [ "Sets this axis' title font.", "Note that the title's font used to be customized", "by the now deprecated `titlefont` attribute." ].join(" ") }), standoff: { valType: "number", min: 0, editType: "ticks", description: [ "Sets the standoff distance (in px) between the axis labels and the title text", "The default value is a function of the axis tick labels, the title `font.size`", "and the axis `linewidth`.", "Note that the axis title position is always constrained within the margins,", "so the actual standoff distance is always less than the set or default value.", "By setting `standoff` and turning on `automargin`, plotly.js will push the", "margins to fit the axis title at given standoff distance." ].join(" ") }, editType: "ticks" }, type: { valType: "enumerated", // '-' means we haven't yet run autotype or couldn't find any data // it gets turned into linear in gd._fullLayout but not copied back // to gd.data like the others are. values: ["-", "linear", "log", "date", "category", "multicategory"], dflt: "-", editType: "calc", // we forget when an axis has been autotyped, just writing the auto // value back to the input - so it doesn't make sense to template this. // Note: we do NOT prohibit this in `coerce`, so if someone enters a // type in the template explicitly it will be honored as the default. _noTemplating: true, description: [ "Sets the axis type.", "By default, plotly attempts to determined the axis type", "by looking into the data of the traces that referenced", "the axis in question." ].join(" ") }, autotypenumbers: { valType: "enumerated", values: ["convert types", "strict"], dflt: "convert types", editType: "calc", description: [ "Using *strict* a numeric string in trace data is not converted to a number.", "Using *convert types* a numeric string in trace data may be", "treated as a number during automatic axis `type` detection.", "Defaults to layout.autotypenumbers." ].join(" ") }, autorange: { valType: "enumerated", values: [true, false, "reversed", "min reversed", "max reversed", "min", "max"], dflt: true, editType: "axrange", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Determines whether or not the range of this axis is", "computed in relation to the input data.", "See `rangemode` for more info.", "If `range` is provided and it has a value for both the", "lower and upper bound, `autorange` is set to *false*.", "Using *min* applies autorange only to set the minimum.", "Using *max* applies autorange only to set the maximum.", "Using *min reversed* applies autorange only to set the minimum on a reversed axis.", "Using *max reversed* applies autorange only to set the maximum on a reversed axis.", "Using *reversed* applies autorange on both ends and reverses the axis direction." ].join(" ") }, autorangeoptions: { minallowed: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Use this value exactly as autorange minimum." ].join(" ") }, maxallowed: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Use this value exactly as autorange maximum." ].join(" ") }, clipmin: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Clip autorange minimum if it goes beyond this value.", "Has no effect when `autorangeoptions.minallowed` is provided." ].join(" ") }, clipmax: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Clip autorange maximum if it goes beyond this value.", "Has no effect when `autorangeoptions.maxallowed` is provided." ].join(" ") }, include: { valType: "any", arrayOk: true, editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Ensure this value is included in autorange." ].join(" ") }, editType: "plot" }, rangemode: { valType: "enumerated", values: ["normal", "tozero", "nonnegative"], dflt: "normal", editType: "plot", description: [ "If *normal*, the range is computed in relation to the extrema", "of the input data.", "If *tozero*`, the range extends to 0,", "regardless of the input data", "If *nonnegative*, the range is non-negative,", "regardless of the input data.", "Applies only to linear axes." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "axrange", impliedEdits: { "^autorange": false }, anim: true }, { valType: "any", editType: "axrange", impliedEdits: { "^autorange": false }, anim: true } ], editType: "axrange", impliedEdits: { autorange: false }, anim: true, description: [ "Sets the range of this axis.", "If the axis `type` is *log*, then you must take the log of your", "desired range (e.g. to set the range from 1 to 100,", "set the range from 0 to 2).", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears.", "Leaving either or both elements `null` impacts the default `autorange`." ].join(" ") }, minallowed: { valType: "any", editType: "plot", impliedEdits: { "^autorange": false }, description: [ "Determines the minimum range of this axis." ].join(" ") }, maxallowed: { valType: "any", editType: "plot", impliedEdits: { "^autorange": false }, description: [ "Determines the maximum range of this axis." ].join(" ") }, fixedrange: { valType: "boolean", dflt: false, editType: "calc", description: [ "Determines whether or not this axis is zoom-able.", "If true, then zoom is disabled." ].join(" ") }, insiderange: { valType: "info_array", items: [ { valType: "any", editType: "plot" }, { valType: "any", editType: "plot" } ], editType: "plot", description: [ "Could be used to set the desired inside range of this axis", "(excluding the labels) when `ticklabelposition` of", "the anchored axis has *inside*.", "Not implemented for axes with `type` *log*.", "This would be ignored when `range` is provided." ].join(" ") }, // scaleanchor: not used directly, just put here for reference // values are any opposite-letter axis id, or `false`. scaleanchor: { valType: "enumerated", values: [ Fi.idRegex.x.toString(), Fi.idRegex.y.toString(), false ], editType: "plot", description: [ "If set to another axis id (e.g. `x2`, `y`), the range of this axis", "changes together with the range of the corresponding axis", "such that the scale of pixels per unit is in a constant ratio.", "Both axes are still zoomable, but when you zoom one, the other will", "zoom the same amount, keeping a fixed midpoint.", "`constrain` and `constraintoward` determine how we enforce the constraint.", "You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}`", "but you can only link axes of the same `type`.", "The linked axis can have the opposite letter (to constrain the aspect ratio)", "or the same letter (to match scales across subplots).", "Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant", "and the last constraint encountered will be ignored to avoid possible", "inconsistent constraints via `scaleratio`.", "Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint", "is currently forbidden.", "Setting `false` allows to remove a default constraint (occasionally,", "you may need to prevent a default `scaleanchor` constraint from", 'being applied, eg. when having an image trace `yaxis: {scaleanchor: "x"}`', "is set automatically in order for pixels to be rendered as squares,", "setting `yaxis: {scaleanchor: false}` allows to remove the constraint)." ].join(" ") }, scaleratio: { valType: "number", min: 0, dflt: 1, editType: "plot", description: [ "If this axis is linked to another by `scaleanchor`, this determines the pixel", "to unit scale ratio. For example, if this value is 10, then every unit on", "this axis spans 10 times the number of pixels as a unit on the linked axis.", "Use this for example to create an elevation profile where the vertical scale", "is exaggerated a fixed amount with respect to the horizontal." ].join(" ") }, constrain: { valType: "enumerated", values: ["range", "domain"], editType: "plot", description: [ "If this axis needs to be compressed (either due to its own `scaleanchor` and", "`scaleratio` or those of the other axis), determines how that happens:", "by increasing the *range*, or by decreasing the *domain*.", "Default is *domain* for axes containing image traces, *range* otherwise." ].join(" ") }, // constraintoward: not used directly, just put here for reference constraintoward: { valType: "enumerated", values: ["left", "center", "right", "top", "middle", "bottom"], editType: "plot", description: [ "If this axis needs to be compressed (either due to its own `scaleanchor` and", "`scaleratio` or those of the other axis), determines which direction we push", "the originally specified plot area. Options are *left*, *center* (default),", "and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes." ].join(" ") }, matches: { valType: "enumerated", values: [ Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "calc", description: [ "If set to another axis id (e.g. `x2`, `y`), the range of this axis", "will match the range of the corresponding axis in data-coordinates space.", "Moreover, matching axes share auto-range values, category lists and", "histogram auto-bins.", "Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint", "is currently forbidden.", "Moreover, note that matching axes must have the same `type`." ].join(" ") }, rangebreaks: W2("rangebreak", { enabled: { valType: "boolean", dflt: true, editType: "calc", description: [ "Determines whether this axis rangebreak is enabled or disabled.", "Please note that `rangebreaks` only work for *date* axis type." ].join(" ") }, bounds: { valType: "info_array", items: [ { valType: "any", editType: "calc" }, { valType: "any", editType: "calc" } ], editType: "calc", description: [ "Sets the lower and upper bounds of this axis rangebreak.", "Can be used with `pattern`." ].join(" ") }, pattern: { valType: "enumerated", values: [Jm, Km, ""], editType: "calc", description: [ "Determines a pattern on the time line that generates breaks.", "If *" + Jm + "* - days of the week in English e.g. 'Sunday' or `sun`", "(matching is case-insensitive and considers only the first three characters),", "as well as Sunday-based integers between 0 and 6.", "If *" + Km + "* - hour (24-hour clock) as decimal numbers between 0 and 24.", "for more info.", "Examples:", "- { pattern: '" + Jm + "', bounds: [6, 1] }", " or simply { bounds: ['sat', 'mon'] }", " breaks from Saturday to Monday (i.e. skips the weekends).", "- { pattern: '" + Km + "', bounds: [17, 8] }", " breaks from 5pm to 8am (i.e. skips non-work hours)." ].join(" ") }, values: { valType: "info_array", freeLength: true, editType: "calc", items: { valType: "any", editType: "calc" }, description: [ "Sets the coordinate values corresponding to the rangebreaks.", "An alternative to `bounds`.", "Use `dvalue` to set the size of the values along the axis." ].join(" ") }, dvalue: { // TODO could become 'any' to add support for 'months', 'years' valType: "number", editType: "calc", min: 0, dflt: dW, description: [ "Sets the size of each `values` item.", "The default is one day in milliseconds." ].join(" ") }, /* gap: { valType: 'number', min: 0, dflt: 0, // for *date* axes, maybe something else for *linear* editType: 'calc', description: [ 'Sets the gap distance between the start and the end of this rangebreak.', 'Use with `gapmode` to set the unit of measurement.' ].join(' ') }, gapmode: { valType: 'enumerated', values: ['pixels', 'fraction'], dflt: 'pixels', editType: 'calc', description: [ 'Determines if the `gap` value corresponds to a pixel length', 'or a fraction of the plot area.' ].join(' ') }, */ // To complete https://github.com/plotly/plotly.js/issues/4210 // we additionally need `gap` and make this work on *linear*, and // possibly all other cartesian axis types. We possibly would also need // some style attributes controlling the zig-zag on the corresponding // axis. editType: "calc" }), // ticks tickmode: hW, nticks: Y2(), tick0: X2, dtick: K2, ticklabelstep: { valType: "integer", min: 1, dflt: 1, editType: "ticks", description: [ "Sets the spacing between tick labels as compared to the spacing between ticks.", "A value of 1 (default) means each tick gets a label.", "A value of 2 means shows every 2nd label.", "A larger value n means only every nth tick is labeled.", "`tick0` determines which labels are shown.", "Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*." ].join(" ") }, tickvals: J2, ticktext: { valType: "data_array", editType: "ticks", description: [ "Sets the text displayed at the ticks position via `tickvals`.", "Only has an effect if `tickmode` is set to *array*.", "Used with `tickvals`." ].join(" ") }, ticks: Q2, tickson: { valType: "enumerated", values: ["labels", "boundaries"], dflt: "labels", editType: "ticks", description: [ "Determines where ticks and grid lines are drawn with respect to their", "corresponding tick labels.", "Only has an effect for axes of `type` *category* or *multicategory*.", "When set to *boundaries*, ticks and grid lines are drawn half a category", "to the left/bottom of labels." ].join(" ") }, ticklabelmode: { valType: "enumerated", values: ["instant", "period"], dflt: "instant", editType: "ticks", description: [ "Determines where tick labels are drawn with respect to their", "corresponding ticks and grid lines.", "Only has an effect for axes of `type` *date*", "When set to *period*, tick labels are drawn in the middle of the period", "between ticks." ].join(" ") }, // ticklabelposition: not used directly, as values depend on direction (similar to side) // left/right options are for x axes, and top/bottom options are for y axes ticklabelposition: { valType: "enumerated", values: [ "outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom" ], dflt: "outside", editType: "calc", description: [ "Determines where tick labels are drawn with respect to the axis", "Please note that", "top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*.", "Similarly", "left or right has no effect on y axes or when `ticklabelmode` is set to *period*.", "Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.", "When used on axes linked by `matches` or `scaleanchor`,", "no extra padding for inside labels would be added by autorange,", "so that the scales could match." ].join(" ") }, ticklabeloverflow: { valType: "enumerated", values: [ "allow", "hide past div", "hide past domain" ], editType: "calc", description: [ "Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.", "The default value for inside tick labels is *hide past domain*.", "Otherwise on *category* and *multicategory* axes the default is *allow*.", "In other cases the default is *hide past div*." ].join(" ") }, mirror: { valType: "enumerated", values: [true, "ticks", false, "all", "allticks"], dflt: false, editType: "ticks+layoutstyle", description: [ "Determines if the axis lines or/and ticks are mirrored to", "the opposite side of the plotting area.", "If *true*, the axis lines are mirrored.", "If *ticks*, the axis lines and ticks are mirrored.", "If *false*, mirroring is disable.", "If *all*, axis lines are mirrored on all shared-axes subplots.", "If *allticks*, axis lines and ticks are mirrored", "on all shared-axes subplots." ].join(" ") }, ticklen: eT(), tickwidth: tT(), tickcolor: rT, showticklabels: { valType: "boolean", dflt: true, editType: "ticks", description: "Determines whether or not the tick labels are drawn." }, labelalias: { valType: "any", dflt: false, editType: "ticks", description: [ "Replacement text for specific tick or hover labels.", "For example using {US: 'USA', CA: 'Canada'} changes US to USA", "and CA to Canada. The labels we would have shown must match", "the keys exactly, after adding any tickprefix or ticksuffix.", "For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash.", "That means you need to use −1 instead of -1.", "labelalias can be used with any axis type, and both keys (if needed)", "and values (if desired) can include html-like tags or MathJax." ].join(" ") }, automargin: { valType: "flaglist", flags: ["height", "width", "left", "right", "top", "bottom"], extras: [true, false], dflt: false, editType: "ticks", description: [ "Determines whether long tick labels automatically grow the figure", "margins." ].join(" ") }, showspikes: { valType: "boolean", dflt: false, editType: "modebar", description: [ "Determines whether or not spikes (aka droplines) are drawn for this axis.", "Note: This only takes affect when hovermode = closest" ].join(" ") }, spikecolor: { valType: "color", dflt: null, editType: "none", description: "Sets the spike color. If undefined, will use the series color" }, spikethickness: { valType: "number", dflt: 3, editType: "none", description: "Sets the width (in px) of the zero line." }, spikedash: db({}, f4, { dflt: "dash", editType: "none" }), spikemode: { valType: "flaglist", flags: ["toaxis", "across", "marker"], dflt: "toaxis", editType: "none", description: [ "Determines the drawing mode for the spike line", "If *toaxis*, the line is drawn from the data point to the axis the ", "series is plotted on.", "If *across*, the line is drawn across the entire plot area, and", "supercedes *toaxis*.", "If *marker*, then a marker dot is drawn on the axis the series is", "plotted on" ].join(" ") }, spikesnap: { valType: "enumerated", values: ["data", "cursor", "hovered data"], dflt: "hovered data", editType: "none", description: "Determines whether spikelines are stuck to the cursor or to the closest datapoints." }, tickfont: Xm({ editType: "ticks", description: "Sets the tick font." }), tickangle: { valType: "angle", dflt: "auto", editType: "ticks", description: [ "Sets the angle of the tick labels with respect to the horizontal.", "For example, a `tickangle` of -90 draws the tick labels", "vertically." ].join(" ") }, tickprefix: { valType: "string", dflt: "", editType: "ticks", description: "Sets a tick label prefix." }, showtickprefix: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: [ "If *all*, all tick labels are displayed with a prefix.", "If *first*, only the first tick is displayed with a prefix.", "If *last*, only the last tick is displayed with a suffix.", "If *none*, tick prefixes are hidden." ].join(" ") }, ticksuffix: { valType: "string", dflt: "", editType: "ticks", description: "Sets a tick label suffix." }, showticksuffix: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: "Same as `showtickprefix` but for tick suffixes." }, showexponent: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: [ "If *all*, all exponents are shown besides their significands.", "If *first*, only the exponent of the first tick is shown.", "If *last*, only the exponent of the last tick is shown.", "If *none*, no exponents appear." ].join(" ") }, exponentformat: { valType: "enumerated", values: ["none", "e", "E", "power", "SI", "B"], dflt: "B", editType: "ticks", description: [ "Determines a formatting rule for the tick exponents.", "For example, consider the number 1,000,000,000.", "If *none*, it appears as 1,000,000,000.", "If *e*, 1e+9.", "If *E*, 1E+9.", "If *power*, 1x10^9 (with 9 in a super script).", "If *SI*, 1G.", "If *B*, 1B." ].join(" ") }, minexponent: { valType: "number", dflt: 3, min: 0, editType: "ticks", description: [ "Hide SI prefix for 10^n if |n| is below this number.", "This only has an effect when `tickformat` is *SI* or *B*." ].join(" ") }, separatethousands: { valType: "boolean", dflt: false, editType: "ticks", description: [ 'If "true", even 4-digit integers are separated' ].join(" ") }, tickformat: { valType: "string", dflt: "", editType: "ticks", description: Z2("tick label") }, tickformatstops: W2("tickformatstop", { enabled: { valType: "boolean", dflt: true, editType: "ticks", description: [ "Determines whether or not this stop is used.", "If `false`, this stop is ignored even within its `dtickrange`." ].join(" ") }, dtickrange: { valType: "info_array", items: [ { valType: "any", editType: "ticks" }, { valType: "any", editType: "ticks" } ], editType: "ticks", description: [ "range [*min*, *max*], where *min*, *max* - dtick values", "which describe some zoom level, it is possible to omit *min*", "or *max* value by passing *null*" ].join(" ") }, value: { valType: "string", dflt: "", editType: "ticks", description: [ "string - dtickformat for described zoom level, the same as *tickformat*" ].join(" ") }, editType: "ticks" }), hoverformat: { valType: "string", dflt: "", editType: "none", description: Z2("hover text") }, // lines and grids showline: { valType: "boolean", dflt: false, editType: "ticks+layoutstyle", description: [ "Determines whether or not a line bounding this axis is drawn." ].join(" ") }, linecolor: { valType: "color", dflt: uu.defaultLine, editType: "layoutstyle", description: "Sets the axis line color." }, linewidth: { valType: "number", min: 0, dflt: 1, editType: "ticks+layoutstyle", description: "Sets the width (in px) of the axis line." }, showgrid: oT, gridcolor: nT, gridwidth: aT(), griddash: iT, zeroline: { valType: "boolean", editType: "ticks", description: [ "Determines whether or not a line is drawn at along the 0 value", "of this axis.", "If *true*, the zero line is drawn on top of the grid lines." ].join(" ") }, zerolinecolor: { valType: "color", dflt: uu.defaultLine, editType: "ticks", description: "Sets the line color of the zero line." }, zerolinewidth: { valType: "number", dflt: 1, editType: "ticks", description: "Sets the width (in px) of the zero line." }, showdividers: { valType: "boolean", dflt: true, editType: "ticks", description: [ "Determines whether or not a dividers are drawn", "between the category levels of this axis.", "Only has an effect on *multicategory* axes." ].join(" ") }, dividercolor: { valType: "color", dflt: uu.defaultLine, editType: "ticks", description: [ "Sets the color of the dividers", "Only has an effect on *multicategory* axes." ].join(" ") }, dividerwidth: { valType: "number", dflt: 1, editType: "ticks", description: [ "Sets the width (in px) of the dividers", "Only has an effect on *multicategory* axes." ].join(" ") }, // TODO dividerlen: that would override "to label base" length? // positioning attributes // anchor: not used directly, just put here for reference // values are any opposite-letter axis id anchor: { valType: "enumerated", values: [ "free", Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "plot", description: [ "If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to", "the corresponding opposite-letter axis.", "If set to *free*, this axis' position is determined by `position`." ].join(" ") }, // side: not used directly, as values depend on direction // values are top, bottom for x axes, and left, right for y side: { valType: "enumerated", values: ["top", "bottom", "left", "right"], editType: "plot", description: [ "Determines whether a x (y) axis is positioned", "at the *bottom* (*left*) or *top* (*right*)", "of the plotting area." ].join(" ") }, // overlaying: not used directly, just put here for reference // values are false and any other same-letter axis id that's not // itself overlaying anything overlaying: { valType: "enumerated", values: [ "free", Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "plot", description: [ "If set a same-letter axis id, this axis is overlaid on top of", "the corresponding same-letter axis, with traces and axes visible for both", "axes.", "If *false*, this axis does not overlay any same-letter axes.", "In this case, for axes with overlapping domains only the highest-numbered", "axis will be visible." ].join(" ") }, minor: { tickmode: $h, nticks: Y2("minor"), tick0: X2, dtick: K2, tickvals: J2, ticks: Q2, ticklen: eT("minor"), tickwidth: tT("minor"), tickcolor: rT, gridcolor: nT, gridwidth: aT("minor"), griddash: iT, showgrid: oT, editType: "ticks" }, layer: { valType: "enumerated", values: ["above traces", "below traces"], dflt: "above traces", editType: "plot", description: [ "Sets the layer on which this axis is displayed.", "If *above traces*, this axis is displayed above all the subplot's traces", "If *below traces*, this axis is displayed below all the subplot's traces,", "but above the grid lines.", "Useful when used together with scatter-like traces with `cliponaxis`", "set to *false* to show markers and/or text nodes above this axis." ].join(" ") }, domain: { valType: "info_array", items: [ { valType: "number", min: 0, max: 1, editType: "plot" }, { valType: "number", min: 0, max: 1, editType: "plot" } ], dflt: [0, 1], editType: "plot", description: [ "Sets the domain of this axis (in plot fraction)." ].join(" ") }, position: { valType: "number", min: 0, max: 1, dflt: 0, editType: "plot", description: [ "Sets the position of this axis in the plotting space", "(in normalized coordinates).", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, autoshift: { valType: "boolean", dflt: false, editType: "plot", description: [ "Automatically reposition the axis to avoid", "overlap with other axes with the same `overlaying` value.", "This repositioning will account for any `shift` amount applied to other", "axes on the same side with `autoshift` is set to true.", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, shift: { valType: "number", editType: "plot", description: [ "Moves the axis a given number of pixels from where it would have been otherwise.", "Accepts both positive and negative values, which will shift the axis either right", "or left, respectively.", "If `autoshift` is set to true, then this defaults to a padding of -3 if `side` is set to *left*.", "and defaults to +3 if `side` is set to *right*. Defaults to 0 if `autoshift` is set to false.", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, categoryorder: { valType: "enumerated", values: [ "trace", "category ascending", "category descending", "array", "total ascending", "total descending", "min ascending", "min descending", "max ascending", "max descending", "sum ascending", "sum descending", "mean ascending", "mean descending", "median ascending", "median descending" ], dflt: "trace", editType: "calc", description: [ "Specifies the ordering logic for the case of categorical variables.", "By default, plotly uses *trace*, which specifies the order that is present in the data supplied.", "Set `categoryorder` to *category ascending* or *category descending* if order should be determined by", "the alphanumerical order of the category names.", "Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category", "is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to", "the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", "Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the", "numerical order of the values.", "Similarly, the order can be determined by the min, max, sum, mean or median of all the values." ].join(" ") }, categoryarray: { valType: "data_array", editType: "calc", description: [ "Sets the order in which categories on this axis appear.", "Only has an effect if `categoryorder` is set to *array*.", "Used with `categoryorder`." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in axis `range`,", "`autorange`, and `title` if in `editable: true` configuration.", "Defaults to `layout.uirevision`." ].join(" ") }, editType: "calc", _deprecated: { autotick: { valType: "boolean", editType: "ticks", description: [ "Obsolete.", "Set `tickmode` to *auto* for old `autotick` *true* behavior.", "Set `tickmode` to *linear* for `autotick` *false*." ].join(" ") }, title: { valType: "string", editType: "ticks", description: [ "Value of `title` is no longer a simple *string* but a set of sub-attributes.", "To set the axis' title, please use `title.text` now." ].join(" ") }, titlefont: Xm({ editType: "ticks", description: [ "Former `titlefont` is now the sub-attribute `font` of `title`.", "To customize title font properties, please use `title.font` now." ].join(" ") }) } }; var Ir = Ki; var Qm = Fn; var lT = en.extendFlat; var vW = Lo.overrideAll; var hb = vW({ orientation: { valType: "enumerated", values: ["h", "v"], dflt: "v", description: "Sets the orientation of the colorbar." }, thicknessmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "pixels", description: [ "Determines whether this color bar's thickness", "(i.e. the measure in the constant color direction)", "is set in units of plot *fraction* or in *pixels*.", "Use `thickness` to set the value." ].join(" ") }, thickness: { valType: "number", min: 0, dflt: 30, description: [ "Sets the thickness of the color bar", "This measure excludes the size of the padding, ticks and labels." ].join(" ") }, lenmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "fraction", description: [ "Determines whether this color bar's length", "(i.e. the measure in the color variation direction)", "is set in units of plot *fraction* or in *pixels.", "Use `len` to set the value." ].join(" ") }, len: { valType: "number", min: 0, dflt: 1, description: [ "Sets the length of the color bar", "This measure excludes the padding of both ends.", "That is, the color bar length is this length minus the", "padding on both ends." ].join(" ") }, x: { valType: "number", description: [ "Sets the x position with respect to `xref` of the color bar (in plot fraction).", "When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and", "0.5 when `orientation` is *h*.", "When `xref` is *container*, defaults to *1* when `orientation` is *v* and", "0.5 when `orientation` is *h*.", "Must be between *0* and *1* if `xref` is *container*", "and between *-2* and *3* if `xref` is *paper*." ].join(" ") }, xref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], description: [ "Sets this color bar's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the color bar.", "Defaults to *left* when `orientation` is *v* and", "*center* when `orientation` is *h*." ].join(" ") }, xpad: { valType: "number", min: 0, dflt: 10, description: "Sets the amount of padding (in px) along the x direction." }, y: { valType: "number", description: [ "Sets the y position with respect to `yref` of the color bar (in plot fraction).", "When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and", "1.02 when `orientation` is *h*.", "When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and", "1 when `orientation` is *h*.", "Must be between *0* and *1* if `yref` is *container*", "and between *-2* and *3* if `yref` is *paper*." ].join(" ") }, yref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], description: [ "Sets this color bar's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the color bar.", "Defaults to *middle* when `orientation` is *v* and", "*bottom* when `orientation` is *h*." ].join(" ") }, ypad: { valType: "number", min: 0, dflt: 10, description: "Sets the amount of padding (in px) along the y direction." }, // a possible line around the bar itself outlinecolor: Ir.linecolor, outlinewidth: Ir.linewidth, // Should outlinewidth have {dflt: 0} ? // another possible line outside the padding and tick labels bordercolor: Ir.linecolor, borderwidth: { valType: "number", min: 0, dflt: 0, description: [ "Sets the width (in px) or the border enclosing this color bar." ].join(" ") }, bgcolor: { valType: "color", dflt: "rgba(0,0,0,0)", description: "Sets the color of padded area." }, // tick and title properties named and function exactly as in axes tickmode: Ir.minor.tickmode, nticks: Ir.nticks, tick0: Ir.tick0, dtick: Ir.dtick, tickvals: Ir.tickvals, ticktext: Ir.ticktext, ticks: lT({}, Ir.ticks, { dflt: "" }), ticklabeloverflow: lT({}, Ir.ticklabeloverflow, { description: [ "Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.", "The default value for inside tick labels is *hide past domain*.", "In other cases the default is *hide past div*." ].join(" ") }), // ticklabelposition: not used directly, as values depend on orientation // left/right options are for x axes, and top/bottom options are for y axes ticklabelposition: { valType: "enumerated", values: [ "outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom" ], dflt: "outside", description: [ "Determines where tick labels are drawn relative to the ticks.", "Left and right options are used when `orientation` is *h*,", "top and bottom when `orientation` is *v*." ].join(" ") }, ticklen: Ir.ticklen, tickwidth: Ir.tickwidth, tickcolor: Ir.tickcolor, ticklabelstep: Ir.ticklabelstep, showticklabels: Ir.showticklabels, labelalias: Ir.labelalias, tickfont: Qm({ description: "Sets the color bar's tick label font" }), tickangle: Ir.tickangle, tickformat: Ir.tickformat, tickformatstops: Ir.tickformatstops, tickprefix: Ir.tickprefix, showtickprefix: Ir.showtickprefix, ticksuffix: Ir.ticksuffix, showticksuffix: Ir.showticksuffix, separatethousands: Ir.separatethousands, exponentformat: Ir.exponentformat, minexponent: Ir.minexponent, showexponent: Ir.showexponent, title: { text: { valType: "string", description: [ "Sets the title of the color bar.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: Qm({ description: [ "Sets this color bar's title font.", "Note that the title's font used to be set", "by the now deprecated `titlefont` attribute." ].join(" ") }), side: { valType: "enumerated", values: ["right", "top", "bottom"], description: [ "Determines the location of color bar's title", "with respect to the color bar.", "Defaults to *top* when `orientation` if *v* and ", "defaults to *right* when `orientation` if *h*.", "Note that the title's location used to be set", "by the now deprecated `titleside` attribute." ].join(" ") } }, _deprecated: { title: { valType: "string", description: [ "Deprecated in favor of color bar's `title.text`.", "Note that value of color bar's `title` is no longer a simple", "*string* but a set of sub-attributes." ].join(" ") }, titlefont: Qm({ description: "Deprecated in favor of color bar's `title.font`." }), titleside: { valType: "enumerated", values: ["right", "top", "bottom"], dflt: "top", description: "Deprecated in favor of color bar's `title.side`." } } }, "colorbars", "from-root"); var pW = hb; var mW = Zu.counter; var gW = TL; var c4 = Wu.scales; var yW = gW(c4); function Af(e10) { return "`" + e10 + "`"; } var Jc = function(t, r) { t = t || "", r = r || {}; var n = r.cLetter || "c", a = "onlyIfNumerical" in r ? r.onlyIfNumerical : !!t, i = "noScale" in r ? r.noScale : t === "marker.line", o = "showScaleDflt" in r ? r.showScaleDflt : n === "z", l = typeof r.colorscaleDflt == "string" ? c4[r.colorscaleDflt] : null, s = r.editTypeOverride || "", u = t ? t + "." : "", f, d; "colorAttr" in r ? (f = r.colorAttr, d = r.colorAttr) : (f = { z: "z", c: "color" }[n], d = "in " + Af(u + f)); var h = a ? " Has an effect only if " + d + " is set to a numerical array." : "", p = n + "auto", v = n + "min", m = n + "max", g = n + "mid", y = Af(u + p), w = Af(u + v), k = Af(u + m), x = w + " and " + k, _ = {}; _[v] = _[m] = void 0; var T = {}; T[p] = false; var S = {}; return f === "color" && (S.color = { valType: "color", arrayOk: true, editType: s || "style", description: [ "Sets the", t, "color.", "It accepts either a specific color", "or an array of numbers that are mapped to the colorscale", "relative to the max and min values of the array or relative to", x, "if set." ].join(" ") }, r.anim && (S.color.anim = true)), S[p] = { valType: "boolean", dflt: true, editType: "calc", impliedEdits: _, description: [ "Determines whether or not the color domain is computed", "with respect to the input data (here " + d + ") or the bounds set in", x + h, "Defaults to `false` when", x, "are set by the user." ].join(" ") }, S[v] = { valType: "number", dflt: null, editType: s || "plot", impliedEdits: T, description: [ "Sets the lower bound of the color domain." + h, "Value should have the same units as", d, "and if set,", k, "must be set as well." ].join(" ") }, S[m] = { valType: "number", dflt: null, editType: s || "plot", impliedEdits: T, description: [ "Sets the upper bound of the color domain." + h, "Value should have the same units as", d, "and if set,", w, "must be set as well." ].join(" ") }, S[g] = { valType: "number", dflt: null, editType: "calc", impliedEdits: _, description: [ "Sets the mid-point of the color domain by scaling", w, "and/or", k, "to be equidistant to this point." + h, "Value should have the same units as", d + ".", "Has no effect when", y, "is `false`." ].join(" ") }, S.colorscale = { valType: "colorscale", editType: "calc", dflt: l, impliedEdits: { autocolorscale: false }, description: [ "Sets the colorscale." + h, "The colorscale must be an array containing", "arrays mapping a normalized value to an", "rgb, rgba, hex, hsl, hsv, or named color string.", "At minimum, a mapping for the lowest (0) and highest (1)", "values are required. For example,", "`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.", "To control the bounds of the colorscale in color space,", "use", x + ".", "Alternatively, `colorscale` may be a palette name string", "of the following list: " + yW + "." ].join(" ") }, S.autocolorscale = { valType: "boolean", // gets overrode in 'heatmap' & 'surface' for backwards comp. dflt: r.autoColorDflt !== false, editType: "calc", impliedEdits: { colorscale: void 0 }, description: [ "Determines whether the colorscale is a default palette (`autocolorscale: true`)", "or the palette determined by", Af(u + "colorscale") + "." + h, "In case `colorscale` is unspecified or `autocolorscale` is true, the default", "palette will be chosen according to whether numbers in the `color` array are", "all positive, all negative or mixed." ].join(" ") }, S.reversescale = { valType: "boolean", dflt: false, editType: "plot", description: [ "Reverses the color mapping if true." + h, "If true,", w, "will correspond to the last color", "in the array and", k, "will correspond to the first color." ].join(" ") }, i || (S.showscale = { valType: "boolean", dflt: o, editType: "calc", description: [ "Determines whether or not a colorbar is displayed for this trace." + h ].join(" ") }, S.colorbar = pW), r.noColorAxis || (S.coloraxis = { valType: "subplotid", regex: mW("coloraxis"), dflt: null, editType: "calc", description: [ "Sets a reference to a shared color axis.", "References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc.", "Settings for these shared color axes are set in the layout, under", "`layout.coloraxis`, `layout.coloraxis2`, etc.", "Note that multiple color scales can be linked to the same color axis." ].join(" ") }), S; }; var bW = en.extendFlat; var _W = Jc; var eg = Wu.scales; var tg = "Note that `autocolorscale` must be true for this attribute to work."; var d4 = { editType: "calc", colorscale: { editType: "calc", sequential: { valType: "colorscale", dflt: eg.Reds, editType: "calc", description: [ "Sets the default sequential colorscale for positive values.", tg ].join(" ") }, sequentialminus: { valType: "colorscale", dflt: eg.Blues, editType: "calc", description: [ "Sets the default sequential colorscale for negative values.", tg ].join(" ") }, diverging: { valType: "colorscale", dflt: eg.RdBu, editType: "calc", description: [ "Sets the default diverging colorscale.", tg ].join(" ") } }, coloraxis: bW({ // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: true, editType: "calc", description: [ "" ].join(" ") }, _W("", { colorAttr: "corresponding trace color array(s)", noColorAxis: true, showScaleDflt: true })) }; var xW = Ue; var h4 = function(t) { return xW.isPlainObject(t.colorbar); }; var Ap = {}; var dy = sr; var sT = Ue; var v4 = Qr; var wW = v4.ONEDAY; var TW = v4.ONEWEEK; Ap.dtick = function(e10, t) { var r = t === "log", n = t === "date", a = t === "category", i = n ? wW : 1; if (!e10) return i; if (dy(e10)) return e10 = Number(e10), e10 <= 0 ? i : a ? Math.max(1, Math.round(e10)) : n ? Math.max(0.1, e10) : e10; if (typeof e10 != "string" || !(n || r)) return i; var o = e10.charAt(0), l = e10.substr(1); return l = dy(l) ? Number(l) : 0, l <= 0 || !// "M" gives ticks every (integer) n months (n && o === "M" && l === Math.round(l) || // "L" gives ticks linearly spaced in data (not in position) every (float) f r && o === "L" || // "D1" gives powers of 10 with all small digits between, "D2" gives only 2 and 5 r && o === "D" && (l === 1 || l === 2)) ? i : e10; }; Ap.tick0 = function(e10, t, r, n) { if (t === "date") return sT.cleanDate( e10, sT.dateTick0(r, n % TW === 0 ? 1 : 0) ); if (!(n === "D1" || n === "D2")) return dy(e10) ? Number(e10) : 0; }; var uT = Ap; var kW = Ue.isArrayOrTypedArray; var AW = an.isTypedArraySpec; var MW = an.decodeTypedArraySpec; var p4 = function(t, r, n, a, i) { i || (i = {}); var o = i.isMinor, l = o ? t.minor || {} : t, s = o ? r.minor : r, u = o ? "minor." : ""; function f(w) { var k = l[w]; return AW(k) && (k = MW(k)), k !== void 0 ? k : (s._template || {})[w]; } var d = f("tick0"), h = f("dtick"), p = f("tickvals"), v = kW(p) ? "array" : h ? "linear" : "auto", m = n(u + "tickmode", v); if (m === "auto" || m === "sync") n(u + "nticks"); else if (m === "linear") { var g = s.dtick = uT.dtick( h, a ); s.tick0 = uT.tick0( d, a, r.calendar, g ); } else if (a !== "multicategory") { var y = n(u + "tickvals"); y === void 0 ? s.tickmode = "auto" : o || n("ticktext"); } }; var rg = Ue; var fT = Ki; var m4 = function(t, r, n, a) { var i = a.isMinor, o = i ? t.minor || {} : t, l = i ? r.minor : r, s = i ? fT.minor : fT, u = i ? "minor." : "", f = rg.coerce2(o, l, s, "ticklen", i ? (r.ticklen || 5) * 0.6 : void 0), d = rg.coerce2(o, l, s, "tickwidth", i ? r.tickwidth || 1 : void 0), h = rg.coerce2(o, l, s, "tickcolor", (i ? r.tickcolor : void 0) || l.color), p = n(u + "ticks", !i && a.outerTicks || f || d || h ? "outside" : ""); p || (delete l.ticklen, delete l.tickwidth, delete l.tickcolor); }; var g4 = function(t) { var r = ["showexponent", "showtickprefix", "showticksuffix"], n = r.filter(function(i) { return t[i] !== void 0; }), a = function(i) { return t[i] === t[n[0]]; }; if (n.every(a) || n.length === 1) return t[n[0]]; }; var Ud = Ue; var SW = Mr; var Ji = function(t, r, n) { var a = n.name, i = n.inclusionAttr || "visible", o = r[a], l = Ud.isArrayOrTypedArray(t[a]) ? t[a] : [], s = r[a] = [], u = SW.arrayTemplater(r, a, i), f, d; for (f = 0; f < l.length; f++) { var h = l[f]; Ud.isPlainObject(h) ? d = u.newItem(h) : (d = u.newItem({}), d[i] = false), d._index = f, d[i] !== false && n.handleItemDefaults(h, d, r, n), s.push(d); } var p = u.defaultItems(); for (f = 0; f < p.length; f++) d = p[f], d._index = s.length, n.handleItemDefaults({}, d, r, n, {}), s.push(d); if (Ud.isArrayOrTypedArray(o)) { var v = Math.min(o.length, s.length); for (f = 0; f < v; f++) Ud.relinkPrivateKeys(s[f], o[f]); } return s; }; var hy = Ue; var CW = nr.contrast; var y4 = Ki; var LW = g4; var DW = Ji; var b4 = function(t, r, n, a, i) { i || (i = {}); var o = n("labelalias"); hy.isPlainObject(o) || delete r.labelalias; var l = LW(t), s = n("showticklabels"); if (s) { var u = i.font || {}, f = r.color, d = r.ticklabelposition || "", h = d.indexOf("inside") !== -1 ? CW(i.bgColor) : ( // as with titlefont.color, inherit axis.color only if one was // explicitly provided f && f !== y4.color.dflt ? f : u.color ); if (hy.coerceFont(n, "tickfont", { family: u.family, size: u.size, color: h }), !i.noTicklabelstep && a !== "multicategory" && a !== "log" && n("ticklabelstep"), i.noAng || n("tickangle"), a !== "category") { var p = n("tickformat"); DW(t, r, { name: "tickformatstops", inclusionAttr: "enabled", handleItemDefaults: EW }), r.tickformatstops.length || delete r.tickformatstops, !i.noExp && !p && a !== "date" && (n("showexponent", l), n("exponentformat"), n("minexponent"), n("separatethousands")); } } }; function EW(e10, t) { function r(a, i) { return hy.coerce(e10, t, y4.tickformatstops, a, i); } var n = r("enabled"); n && (r("dtickrange"), r("value")); } var FW = g4; var _4 = function(t, r, n, a, i) { i || (i = {}); var o = i.tickSuffixDflt, l = FW(t), s = n("tickprefix"); s && n("showtickprefix", l); var u = n("ticksuffix", o); u && n("showticksuffix", l); }; var Io = Ue; var RW = Mr; var PW = p4; var $W = m4; var zW = b4; var IW = _4; var NW = hb; var x4 = function(t, r, n) { var a = RW.newContainer(r, "colorbar"), i = t.colorbar || {}; function o($, I) { return Io.coerce(i, a, NW, $, I); } var l = n.margin || { t: 0, b: 0, l: 0, r: 0 }, s = n.width - l.l - l.r, u = n.height - l.t - l.b, f = o("orientation"), d = f === "v", h = o("thicknessmode"); o( "thickness", h === "fraction" ? 30 / (d ? s : u) : 30 ); var p = o("lenmode"); o( "len", p === "fraction" ? 1 : d ? u : s ); var v = o("yref"), m = o("xref"), g = v === "paper", y = m === "paper", w, k, x, _ = "left"; d ? (x = "middle", _ = y ? "left" : "right", w = y ? 1.02 : 1, k = 0.5) : (x = g ? "bottom" : "top", _ = "center", w = 0.5, k = g ? 1.02 : 1), Io.coerce(i, a, { x: { valType: "number", min: y ? -2 : 0, max: y ? 3 : 1, dflt: w } }, "x"), Io.coerce(i, a, { y: { valType: "number", min: g ? -2 : 0, max: g ? 3 : 1, dflt: k } }, "y"), o("xanchor", _), o("xpad"), o("yanchor", x), o("ypad"), Io.noneOrAll(i, a, ["x", "y"]), o("outlinecolor"), o("outlinewidth"), o("bordercolor"), o("borderwidth"), o("bgcolor"); var T = Io.coerce(i, a, { ticklabelposition: { valType: "enumerated", dflt: "outside", values: d ? [ "outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom" ] : [ "outside", "inside", "outside left", "inside left", "outside right", "inside right" ] } }, "ticklabelposition"); o("ticklabeloverflow", T.indexOf("inside") !== -1 ? "hide past domain" : "hide past div"), PW(i, a, o, "linear"); var S = n.font, M = { outerTicks: false, font: S }; T.indexOf("inside") !== -1 && (M.bgColor = "black"), IW(i, a, o, "linear", M), zW(i, a, o, "linear", M), $W(i, a, o, "linear"), o("title.text", n._dfltTitle.colorbar); var L = a.showticklabels ? a.tickfont : S, F = Io.extendFlat({}, L, { color: S.color, size: Io.bigFont(L.size) }); Io.coerceFont(o, "title.font", F), o("title.side", d ? "top" : "right"); }; var cT = sr; var vy = Ue; var OW = h4; var HW = x4; var dT = Wu.isValid; var BW = Nt.traceIs; function ng(e10, t) { var r = t.slice(0, t.length - 1); return t ? vy.nestedProperty(e10, r).get() || {} : e10; } var ef = function e6(t, r, n, a, i) { var o = i.prefix, l = i.cLetter, s = "_module" in r, u = ng(t, o), f = ng(r, o), d = ng(r._template || {}, o) || {}, h = function() { return delete t.coloraxis, delete r.coloraxis, e6(t, r, n, a, i); }; if (s) { var p = n._colorAxes || {}, v = a(o + "coloraxis"); if (v) { var m = BW(r, "contour") && vy.nestedProperty(r, "contours.coloring").get() || "heatmap", g = p[v]; g ? (g[2].push(h), g[0] !== m && (g[0] = false, vy.warn([ "Ignoring coloraxis:", v, "setting", "as it is linked to incompatible colorscales." ].join(" ")))) : p[v] = [m, r, [h]]; return; } } var y = u[l + "min"], w = u[l + "max"], k = cT(y) && cT(w) && y < w, x = a(o + l + "auto", !k); x ? a(o + l + "mid") : (a(o + l + "min"), a(o + l + "max")); var _ = u.colorscale, T = d.colorscale, S; if (_ !== void 0 && (S = !dT(_)), T !== void 0 && (S = !dT(T)), a(o + "autocolorscale", S), a(o + "colorscale"), a(o + "reversescale"), o !== "marker.line.") { var M; o && s && (M = OW(u)); var L = a(o + "showscale", M); L && (o && d && (f._template = d), HW(u, f, n)); } }; var hT = Ue; var jW = Mr; var vT = d4; var UW = ef; var GW = function(t, r) { function n(d, h) { return hT.coerce(t, r, vT, d, h); } n("colorscale.sequential"), n("colorscale.sequentialminus"), n("colorscale.diverging"); var a = r._colorAxes, i, o; function l(d, h) { return hT.coerce(i, o, vT.coloraxis, d, h); } for (var s in a) { var u = a[s]; if (u[0]) i = t[s] || {}, o = jW.newContainer(r, s, "coloraxis"), o._name = s, UW(i, o, r, l, { prefix: "", cLetter: "c" }); else { for (var f = 0; f < u[2].length; f++) u[2][f](); delete r._colorAxes[s]; } } }; var VW = Ue; var qW = wi.hasColorscale; var WW = wi.extractOpts; var ZW = function(t, r) { function n(f, d) { var h = f["_" + d]; h !== void 0 && (f[d] = h); } function a(f, d) { var h = d.container ? VW.nestedProperty(f, d.container).get() : f; if (h) if (h.coloraxis) h._colorAx = r[h.coloraxis]; else { var p = WW(h), v = p.auto; (v || p.min === void 0) && n(h, d.min), (v || p.max === void 0) && n(h, d.max), p.autocolorscale && n(h, "colorscale"); } } for (var i = 0; i < t.length; i++) { var o = t[i], l = o._module.colorbar; if (l) if (Array.isArray(l)) for (var s = 0; s < l.length; s++) a(o, l[s]); else a(o, l); qW(o, "marker.line") && a(o, { container: "marker.line", min: "cmin", max: "cmax" }); } for (var u in r._colorAxes) a(r[u], { min: "cmin", max: "cmax" }); }; var pT = sr; var ag = Ue; var YW = wi.extractOpts; var Mp = function(t, r, n) { var a = t._fullLayout, i = n.vals, o = n.containerStr, l = o ? ag.nestedProperty(r, o).get() : r, s = YW(l), u = s.auto !== false, f = s.min, d = s.max, h = s.mid, p = function() { return ag.aggNums(Math.min, null, i); }, v = function() { return ag.aggNums(Math.max, null, i); }; if (f === void 0 ? f = p() : u && (l._colorAx && pT(f) ? f = Math.min(f, p()) : f = p()), d === void 0 ? d = v() : u && (l._colorAx && pT(d) ? d = Math.max(d, v()) : d = v()), u && h !== void 0 && (d - h > h - f ? f = h - (d - h) : d - h < h - f && (d = h + (h - f))), f === d && (f -= 0.5, d += 0.5), s._sync("min", f), s._sync("max", d), s.autocolorscale) { var m; f * d < 0 ? m = a.colorscale.diverging : f >= 0 ? m = a.colorscale.sequential : m = a.colorscale.sequentialminus, s._sync("colorscale", m); } }; var Gd = Wu; var zs = wi; var Qc = { moduleType: "component", name: "colorscale", attributes: Jc, layoutAttributes: d4, supplyLayoutDefaults: GW, handleDefaults: ef, crossTraceDefaults: ZW, calc: Mp, // ./scales.js is required in lib/coerce.js ; // it needs to be a separate module to avoid a circular dependency scales: Gd.scales, defaultScale: Gd.defaultScale, getScale: Gd.get, isValidScale: Gd.isValid, hasColorscale: zs.hasColorscale, extractOpts: zs.extractOpts, extractScale: zs.extractScale, flipScale: zs.flipScale, makeColorScaleFunc: zs.makeColorScaleFunc, makeColorScaleFuncFromTrace: zs.makeColorScaleFuncFromTrace }; var mT = Ue; var XW = an.isTypedArraySpec; var Ya = { hasLines: function(e10) { return e10.visible && e10.mode && e10.mode.indexOf("lines") !== -1; }, hasMarkers: function(e10) { return e10.visible && (e10.mode && e10.mode.indexOf("markers") !== -1 || // until splom implements 'mode' e10.type === "splom"); }, hasText: function(e10) { return e10.visible && e10.mode && e10.mode.indexOf("text") !== -1; }, isBubble: function(e10) { var t = e10.marker; return mT.isPlainObject(t) && (mT.isArrayOrTypedArray(t.size) || XW(t.size)); } }; var KW = sr; var JW = function(t, r) { r || (r = 2); var n = t.marker, a = n.sizeref || 1, i = n.sizemin || 0, o = n.sizemode === "area" ? function(l) { return Math.sqrt(l / a); } : function(l) { return l / a; }; return function(l) { var s = o(l / r); return KW(s) && s > 0 ? Math.max(s, i) : 0; }; }; var Do = {}; (function(e10) { var t = Ue; e10.getSubplot = function(l) { return l.subplot || l.xaxis + l.yaxis || l.geo; }, e10.isTraceInSubplots = function(l, s) { if (l.type === "splom") { for (var u = l.xaxes || [], f = l.yaxes || [], d = 0; d < u.length; d++) for (var h = 0; h < f.length; h++) if (s.indexOf(u[d] + f[h]) !== -1) return true; return false; } return s.indexOf(e10.getSubplot(l)) !== -1; }, e10.flat = function(l, s) { for (var u = new Array(l.length), f = 0; f < l.length; f++) u[f] = s; return u; }, e10.p2c = function(l, s) { for (var u = new Array(l.length), f = 0; f < l.length; f++) u[f] = l[f].p2c(s); return u; }, e10.getDistanceFunction = function(l, s, u, f) { return l === "closest" ? f || e10.quadrature(s, u) : l.charAt(0) === "x" ? s : u; }, e10.getClosest = function(l, s, u) { if (u.index !== false) u.index >= 0 && u.index < l.length ? u.distance = 0 : u.index = false; else for (var f = 0; f < l.length; f++) { var d = s(l[f]); d <= u.distance && (u.index = f, u.distance = d); } return u; }, e10.inbox = function(l, s, u) { return l * s < 0 || l === 0 ? u : 1 / 0; }, e10.quadrature = function(l, s) { return function(u) { var f = l(u), d = s(u); return Math.sqrt(f * f + d * d); }; }, e10.makeEventData = function(l, s, u) { var f = "index" in l ? l.index : l.pointNumber, d = { data: s._input, fullData: s, curveNumber: s.index, pointNumber: f }; if (s._indexToPoints) { var h = s._indexToPoints[f]; h.length === 1 ? d.pointIndex = h[0] : d.pointIndices = h; } else d.pointIndex = f; return s._module.eventData ? d = s._module.eventData(d, l, s, u, f) : ("xVal" in l ? d.x = l.xVal : "x" in l && (d.x = l.x), "yVal" in l ? d.y = l.yVal : "y" in l && (d.y = l.y), l.xa && (d.xaxis = l.xa), l.ya && (d.yaxis = l.ya), l.zLabelVal !== void 0 && (d.z = l.zLabelVal)), e10.appendArrayPointValue(d, s, f), d; }, e10.appendArrayPointValue = function(l, s, u) { var f = s._arrayAttrs; if (f) for (var d = 0; d < f.length; d++) { var h = f[d], p = n(h); if (l[p] === void 0) { var v = t.nestedProperty(s, h).get(), m = a(v, u); m !== void 0 && (l[p] = m); } } }, e10.appendArrayMultiPointValues = function(l, s, u) { var f = s._arrayAttrs; if (f) for (var d = 0; d < f.length; d++) { var h = f[d], p = n(h); if (l[p] === void 0) { for (var v = t.nestedProperty(s, h).get(), m = new Array(u.length), g = 0; g < u.length; g++) m[g] = a(v, u[g]); l[p] = m; } } }; var r = { ids: "id", locations: "location", labels: "label", values: "value", "marker.colors": "color", parents: "parent" }; function n(l) { return r[l] || l; } function a(l, s) { if (Array.isArray(s)) { if (Array.isArray(l) && Array.isArray(l[s[0]])) return l[s[0]][s[1]]; } else return l[s]; } var i = { x: true, y: true }, o = { "x unified": true, "y unified": true }; e10.isUnifiedHover = function(l) { return typeof l != "string" ? false : !!o[l]; }, e10.isXYhover = function(l) { return typeof l != "string" ? false : !!i[l]; }; })(Do); var w4 = eZ; var ig = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }; var QW = /([astvzqmhlc])([^astvzqmhlc]*)/ig; function eZ(e10) { var t = []; return e10.replace(QW, function(r, n, a) { var i = n.toLowerCase(); for (a = rZ(a), i == "m" && a.length > 2 && (t.push([n].concat(a.splice(0, 2))), i = "l", n = n == "m" ? "l" : "L"); ; ) { if (a.length == ig[i]) return a.unshift(n), t.push(a); if (a.length < ig[i]) throw new Error("malformed path data"); t.push([n].concat(a.splice(0, ig[i]))); } }), t; } var tZ = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig; function rZ(e10) { var t = e10.match(tZ); return t ? t.map(Number) : []; } var og; var gT; function nZ() { if (gT) return og; gT = 1; var e10 = w4, t = lr.round, r = "M0,0Z", n = Math.sqrt(2), a = Math.sqrt(3), i = Math.PI, o = Math.cos, l = Math.sin; og = { circle: { n: 0, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = "M" + y + ",0A" + y + "," + y + " 0 1,1 0,-" + y + "A" + y + "," + y + " 0 0,1 " + y + ",0Z"; return g ? p(m, g, w) : w; } }, square: { n: 1, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "H-" + y + "V-" + y + "H" + y + "Z"); } }, diamond: { n: 2, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.3, 2); return p(m, g, "M" + y + ",0L0," + y + "L-" + y + ",0L0,-" + y + "Z"); } }, cross: { n: 3, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.4, 2), w = t(v * 1.2, 2); return p(m, g, "M" + w + "," + y + "H" + y + "V" + w + "H-" + y + "V" + y + "H-" + w + "V-" + y + "H-" + y + "V-" + w + "H" + y + "V-" + y + "H" + w + "Z"); } }, x: { n: 4, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.8 / n, 2), w = "l" + y + "," + y, k = "l" + y + ",-" + y, x = "l-" + y + ",-" + y, _ = "l-" + y + "," + y; return p(m, g, "M0," + y + w + k + x + k + x + _ + x + _ + w + _ + w + "Z"); } }, "triangle-up": { n: 5, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2 / a, 2), w = t(v / 2, 2), k = t(v, 2); return p(m, g, "M-" + y + "," + w + "H" + y + "L0,-" + k + "Z"); } }, "triangle-down": { n: 6, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2 / a, 2), w = t(v / 2, 2), k = t(v, 2); return p(m, g, "M-" + y + ",-" + w + "H" + y + "L0," + k + "Z"); } }, "triangle-left": { n: 7, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2 / a, 2), w = t(v / 2, 2), k = t(v, 2); return p(m, g, "M" + w + ",-" + y + "V" + y + "L-" + k + ",0Z"); } }, "triangle-right": { n: 8, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2 / a, 2), w = t(v / 2, 2), k = t(v, 2); return p(m, g, "M-" + w + ",-" + y + "V" + y + "L" + k + ",0Z"); } }, "triangle-ne": { n: 9, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.6, 2), w = t(v * 1.2, 2); return p(m, g, "M-" + w + ",-" + y + "H" + y + "V" + w + "Z"); } }, "triangle-se": { n: 10, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.6, 2), w = t(v * 1.2, 2); return p(m, g, "M" + y + ",-" + w + "V" + y + "H-" + w + "Z"); } }, "triangle-sw": { n: 11, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.6, 2), w = t(v * 1.2, 2); return p(m, g, "M" + w + "," + y + "H-" + y + "V-" + w + "Z"); } }, "triangle-nw": { n: 12, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.6, 2), w = t(v * 1.2, 2); return p(m, g, "M-" + y + "," + w + "V-" + y + "H" + w + "Z"); } }, pentagon: { n: 13, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.951, 2), w = t(v * 0.588, 2), k = t(-v, 2), x = t(v * -0.309, 2), _ = t(v * 0.809, 2); return p(m, g, "M" + y + "," + x + "L" + w + "," + _ + "H-" + w + "L-" + y + "," + x + "L0," + k + "Z"); } }, hexagon: { n: 14, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v / 2, 2), k = t(v * a / 2, 2); return p(m, g, "M" + k + ",-" + w + "V" + w + "L0," + y + "L-" + k + "," + w + "V-" + w + "L0,-" + y + "Z"); } }, hexagon2: { n: 15, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v / 2, 2), k = t(v * a / 2, 2); return p(m, g, "M-" + w + "," + k + "H" + w + "L" + y + ",0L" + w + ",-" + k + "H-" + w + "L-" + y + ",0Z"); } }, octagon: { n: 16, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.924, 2), w = t(v * 0.383, 2); return p(m, g, "M-" + w + ",-" + y + "H" + w + "L" + y + ",-" + w + "V" + w + "L" + w + "," + y + "H-" + w + "L-" + y + "," + w + "V-" + w + "Z"); } }, star: { n: 17, f: function(v, m, g) { if (s(m)) return r; var y = v * 1.4, w = t(y * 0.225, 2), k = t(y * 0.951, 2), x = t(y * 0.363, 2), _ = t(y * 0.588, 2), T = t(-y, 2), S = t(y * -0.309, 2), M = t(y * 0.118, 2), L = t(y * 0.809, 2), F = t(y * 0.382, 2); return p(m, g, "M" + w + "," + S + "H" + k + "L" + x + "," + M + "L" + _ + "," + L + "L0," + F + "L-" + _ + "," + L + "L-" + x + "," + M + "L-" + k + "," + S + "H-" + w + "L0," + T + "Z"); } }, hexagram: { n: 18, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.66, 2), w = t(v * 0.38, 2), k = t(v * 0.76, 2); return p(m, g, "M-" + k + ",0l-" + w + ",-" + y + "h" + k + "l" + w + ",-" + y + "l" + w + "," + y + "h" + k + "l-" + w + "," + y + "l" + w + "," + y + "h-" + k + "l-" + w + "," + y + "l-" + w + ",-" + y + "h-" + k + "Z"); } }, "star-triangle-up": { n: 19, f: function(v, m, g) { if (s(m)) return r; var y = t(v * a * 0.8, 2), w = t(v * 0.8, 2), k = t(v * 1.6, 2), x = t(v * 4, 2), _ = "A " + x + "," + x + " 0 0 1 "; return p(m, g, "M-" + y + "," + w + _ + y + "," + w + _ + "0,-" + k + _ + "-" + y + "," + w + "Z"); } }, "star-triangle-down": { n: 20, f: function(v, m, g) { if (s(m)) return r; var y = t(v * a * 0.8, 2), w = t(v * 0.8, 2), k = t(v * 1.6, 2), x = t(v * 4, 2), _ = "A " + x + "," + x + " 0 0 1 "; return p(m, g, "M" + y + ",-" + w + _ + "-" + y + ",-" + w + _ + "0," + k + _ + y + ",-" + w + "Z"); } }, "star-square": { n: 21, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.1, 2), w = t(v * 2, 2), k = "A " + w + "," + w + " 0 0 1 "; return p(m, g, "M-" + y + ",-" + y + k + "-" + y + "," + y + k + y + "," + y + k + y + ",-" + y + k + "-" + y + ",-" + y + "Z"); } }, "star-diamond": { n: 22, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.4, 2), w = t(v * 1.9, 2), k = "A " + w + "," + w + " 0 0 1 "; return p(m, g, "M-" + y + ",0" + k + "0," + y + k + y + ",0" + k + "0,-" + y + k + "-" + y + ",0Z"); } }, "diamond-tall": { n: 23, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 0.7, 2), w = t(v * 1.4, 2); return p(m, g, "M0," + w + "L" + y + ",0L0,-" + w + "L-" + y + ",0Z"); } }, "diamond-wide": { n: 24, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.4, 2), w = t(v * 0.7, 2); return p(m, g, "M0," + w + "L" + y + ",0L0,-" + w + "L-" + y + ",0Z"); } }, hourglass: { n: 25, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "H-" + y + "L" + y + ",-" + y + "H-" + y + "Z"); }, noDot: true }, bowtie: { n: 26, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "V-" + y + "L-" + y + "," + y + "V-" + y + "Z"); }, noDot: true }, "circle-cross": { n: 27, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M0," + y + "V-" + y + "M" + y + ",0H-" + y + "M" + y + ",0A" + y + "," + y + " 0 1,1 0,-" + y + "A" + y + "," + y + " 0 0,1 " + y + ",0Z"); }, needLine: true, noDot: true }, "circle-x": { n: 28, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v / n, 2); return p(m, g, "M" + w + "," + w + "L-" + w + ",-" + w + "M" + w + ",-" + w + "L-" + w + "," + w + "M" + y + ",0A" + y + "," + y + " 0 1,1 0,-" + y + "A" + y + "," + y + " 0 0,1 " + y + ",0Z"); }, needLine: true, noDot: true }, "square-cross": { n: 29, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M0," + y + "V-" + y + "M" + y + ",0H-" + y + "M" + y + "," + y + "H-" + y + "V-" + y + "H" + y + "Z"); }, needLine: true, noDot: true }, "square-x": { n: 30, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "L-" + y + ",-" + y + "M" + y + ",-" + y + "L-" + y + "," + y + "M" + y + "," + y + "H-" + y + "V-" + y + "H" + y + "Z"); }, needLine: true, noDot: true }, "diamond-cross": { n: 31, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.3, 2); return p(m, g, "M" + y + ",0L0," + y + "L-" + y + ",0L0,-" + y + "ZM0,-" + y + "V" + y + "M-" + y + ",0H" + y); }, needLine: true, noDot: true }, "diamond-x": { n: 32, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.3, 2), w = t(v * 0.65, 2); return p(m, g, "M" + y + ",0L0," + y + "L-" + y + ",0L0,-" + y + "ZM-" + w + ",-" + w + "L" + w + "," + w + "M-" + w + "," + w + "L" + w + ",-" + w); }, needLine: true, noDot: true }, "cross-thin": { n: 33, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.4, 2); return p(m, g, "M0," + y + "V-" + y + "M" + y + ",0H-" + y); }, needLine: true, noDot: true, noFill: true }, "x-thin": { n: 34, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "L-" + y + ",-" + y + "M" + y + ",-" + y + "L-" + y + "," + y); }, needLine: true, noDot: true, noFill: true }, asterisk: { n: 35, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.2, 2), w = t(v * 0.85, 2); return p(m, g, "M0," + y + "V-" + y + "M" + y + ",0H-" + y + "M" + w + "," + w + "L-" + w + ",-" + w + "M" + w + ",-" + w + "L-" + w + "," + w); }, needLine: true, noDot: true, noFill: true }, hash: { n: 36, f: function(v, m, g) { if (s(m)) return r; var y = t(v / 2, 2), w = t(v, 2); return p(m, g, "M" + y + "," + w + "V-" + w + "M" + (y - w) + ",-" + w + "V" + w + "M" + w + "," + y + "H-" + w + "M-" + w + "," + (y - w) + "H" + w); }, needLine: true, noFill: true }, "y-up": { n: 37, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.2, 2), w = t(v * 1.6, 2), k = t(v * 0.8, 2); return p(m, g, "M-" + y + "," + k + "L0,0M" + y + "," + k + "L0,0M0,-" + w + "L0,0"); }, needLine: true, noDot: true, noFill: true }, "y-down": { n: 38, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.2, 2), w = t(v * 1.6, 2), k = t(v * 0.8, 2); return p(m, g, "M-" + y + ",-" + k + "L0,0M" + y + ",-" + k + "L0,0M0," + w + "L0,0"); }, needLine: true, noDot: true, noFill: true }, "y-left": { n: 39, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.2, 2), w = t(v * 1.6, 2), k = t(v * 0.8, 2); return p(m, g, "M" + k + "," + y + "L0,0M" + k + ",-" + y + "L0,0M-" + w + ",0L0,0"); }, needLine: true, noDot: true, noFill: true }, "y-right": { n: 40, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.2, 2), w = t(v * 1.6, 2), k = t(v * 0.8, 2); return p(m, g, "M-" + k + "," + y + "L0,0M-" + k + ",-" + y + "L0,0M" + w + ",0L0,0"); }, needLine: true, noDot: true, noFill: true }, "line-ew": { n: 41, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.4, 2); return p(m, g, "M" + y + ",0H-" + y); }, needLine: true, noDot: true, noFill: true }, "line-ns": { n: 42, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 1.4, 2); return p(m, g, "M0," + y + "V-" + y); }, needLine: true, noDot: true, noFill: true }, "line-ne": { n: 43, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + ",-" + y + "L-" + y + "," + y); }, needLine: true, noDot: true, noFill: true }, "line-nw": { n: 44, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2); return p(m, g, "M" + y + "," + y + "L-" + y + ",-" + y); }, needLine: true, noDot: true, noFill: true }, "arrow-up": { n: 45, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v * 2, 2); return p(m, g, "M0,0L-" + y + "," + w + "H" + y + "Z"); }, backoff: 1, noDot: true }, "arrow-down": { n: 46, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v * 2, 2); return p(m, g, "M0,0L-" + y + ",-" + w + "H" + y + "Z"); }, noDot: true }, "arrow-left": { n: 47, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2, 2), w = t(v, 2); return p(m, g, "M0,0L" + y + ",-" + w + "V" + w + "Z"); }, noDot: true }, "arrow-right": { n: 48, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2, 2), w = t(v, 2); return p(m, g, "M0,0L-" + y + ",-" + w + "V" + w + "Z"); }, noDot: true }, "arrow-bar-up": { n: 49, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v * 2, 2); return p(m, g, "M-" + y + ",0H" + y + "M0,0L-" + y + "," + w + "H" + y + "Z"); }, backoff: 1, needLine: true, noDot: true }, "arrow-bar-down": { n: 50, f: function(v, m, g) { if (s(m)) return r; var y = t(v, 2), w = t(v * 2, 2); return p(m, g, "M-" + y + ",0H" + y + "M0,0L-" + y + ",-" + w + "H" + y + "Z"); }, needLine: true, noDot: true }, "arrow-bar-left": { n: 51, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2, 2), w = t(v, 2); return p(m, g, "M0,-" + w + "V" + w + "M0,0L" + y + ",-" + w + "V" + w + "Z"); }, needLine: true, noDot: true }, "arrow-bar-right": { n: 52, f: function(v, m, g) { if (s(m)) return r; var y = t(v * 2, 2), w = t(v, 2); return p(m, g, "M0,-" + w + "V" + w + "M0,0L-" + y + ",-" + w + "V" + w + "Z"); }, needLine: true, noDot: true }, arrow: { n: 53, f: function(v, m, g) { if (s(m)) return r; var y = i / 2.5, w = 2 * v * o(y), k = 2 * v * l(y); return p( m, g, "M0,0L" + -w + "," + k + "L" + w + "," + k + "Z" ); }, backoff: 0.9, noDot: true }, "arrow-wide": { n: 54, f: function(v, m, g) { if (s(m)) return r; var y = i / 4, w = 2 * v * o(y), k = 2 * v * l(y); return p( m, g, "M0,0L" + -w + "," + k + "A " + 2 * v + "," + 2 * v + " 0 0 1 " + w + "," + k + "Z" ); }, backoff: 0.4, noDot: true } }; function s(v) { return v === null; } var u, f, d, h; function p(v, m, g) { if ((!v || v % 360 === 0) && !m) return g; if (d === v && h === m && u === g) return f; d = v, h = m, u = g; function y(G, K) { var V = o(G), z = l(G), P = K[0], R = K[1] + (m || 0); return [ P * V - R * z, P * z + R * V ]; } for (var w = v / 180 * i, k = 0, x = 0, _ = e10(g), T = "", S = 0; S < _.length; S++) { var M = _[S], L = M[0], F = k, $ = x; if (L === "M" || L === "L") k = +M[1], x = +M[2]; else if (L === "m" || L === "l") k += +M[1], x += +M[2]; else if (L === "H") k = +M[1]; else if (L === "h") k += +M[1]; else if (L === "V") x = +M[1]; else if (L === "v") x += +M[1]; else if (L === "A") { k = +M[1], x = +M[2]; var I = y(w, [+M[6], +M[7]]); M[6] = I[0], M[7] = I[1], M[3] = +M[3] + v; } (L === "H" || L === "V") && (L = "L"), (L === "h" || L === "v") && (L = "l"), (L === "m" || L === "l") && (k -= F, x -= $); var O = y(w, [k, x]); (L === "H" || L === "V") && (L = "L"), (L === "M" || L === "L" || L === "m" || L === "l") && (M[1] = O[0], M[2] = O[1]), M[0] = L, T += M[0] + M.slice(1).join(","); } return f = T, T; } return og; } var mn = lr; var Tr = Ue; var aZ = Tr.numberFormat; var ls = sr; var py = bi; var Sp = Nt; var Dn = nr; var iZ = Qc; var wc = Tr.strTranslate; var vb = Rn; var oZ = yl; var lZ = On; var sZ = lZ.LINE_SPACING; var T4 = q1.DESELECTDIM; var uZ = Ya; var fZ = JW; var cZ = Do.appendArrayPointValue; var ut = n4.exports = {}; ut.font = function(e10, t, r, n) { Tr.isPlainObject(t) && (n = t.color, r = t.size, t = t.family), t && e10.style("font-family", t), r + 1 && e10.style("font-size", r + "px"), n && e10.call(Dn.fill, n); }; ut.setPosition = function(e10, t, r) { e10.attr("x", t).attr("y", r); }; ut.setSize = function(e10, t, r) { e10.attr("width", t).attr("height", r); }; ut.setRect = function(e10, t, r, n, a) { e10.call(ut.setPosition, t, r).call(ut.setSize, n, a); }; ut.translatePoint = function(e10, t, r, n) { var a = r.c2p(e10.x), i = n.c2p(e10.y); if (ls(a) && ls(i) && t.node()) t.node().nodeName === "text" ? t.attr("x", a).attr("y", i) : t.attr("transform", wc(a, i)); else return false; return true; }; ut.translatePoints = function(e10, t, r) { e10.each(function(n) { var a = mn.select(this); ut.translatePoint(n, a, t, r); }); }; ut.hideOutsideRangePoint = function(e10, t, r, n, a, i) { t.attr( "display", r.isPtWithinRange(e10, a) && n.isPtWithinRange(e10, i) ? null : "none" ); }; ut.hideOutsideRangePoints = function(e10, t) { if (t._hasClipOnAxisFalse) { var r = t.xaxis, n = t.yaxis; e10.each(function(a) { var i = a[0].trace, o = i.xcalendar, l = i.ycalendar, s = Sp.traceIs(i, "bar-like") ? ".bartext" : ".point,.textpoint"; e10.selectAll(s).each(function(u) { ut.hideOutsideRangePoint(u, mn.select(this), r, n, o, l); }); }); } }; ut.crispRound = function(e10, t, r) { return !t || !ls(t) ? r || 0 : e10._context.staticPlot ? t : t < 1 ? 1 : Math.round(t); }; ut.singleLineStyle = function(e10, t, r, n, a) { t.style("fill", "none"); var i = (((e10 || [])[0] || {}).trace || {}).line || {}, o = r || i.width || 0, l = a || i.dash || ""; Dn.stroke(t, n || i.color), ut.dashLine(t, l, o); }; ut.lineGroupStyle = function(e10, t, r, n) { e10.style("fill", "none").each(function(a) { var i = (((a || [])[0] || {}).trace || {}).line || {}, o = t || i.width || 0, l = n || i.dash || ""; mn.select(this).call(Dn.stroke, r || i.color).call(ut.dashLine, l, o); }); }; ut.dashLine = function(e10, t, r) { r = +r || 0, t = ut.dashStyle(t, r), e10.style({ "stroke-dasharray": t, "stroke-width": r + "px" }); }; ut.dashStyle = function(e10, t) { t = +t || 1; var r = Math.max(t, 3); return e10 === "solid" ? e10 = "" : e10 === "dot" ? e10 = r + "px," + r + "px" : e10 === "dash" ? e10 = 3 * r + "px," + 3 * r + "px" : e10 === "longdash" ? e10 = 5 * r + "px," + 5 * r + "px" : e10 === "dashdot" ? e10 = 3 * r + "px," + r + "px," + r + "px," + r + "px" : e10 === "longdashdot" && (e10 = 5 * r + "px," + 2 * r + "px," + r + "px," + 2 * r + "px"), e10; }; function k4(e10, t, r) { var n = t.fillpattern, a = n && ut.getPatternAttr(n.shape, 0, ""); if (a) { var i = ut.getPatternAttr(n.bgcolor, 0, null), o = ut.getPatternAttr(n.fgcolor, 0, null), l = n.fgopacity, s = ut.getPatternAttr(n.size, 0, 8), u = ut.getPatternAttr(n.solidity, 0, 0.3), f = t.uid; ut.pattern( e10, "point", r, f, a, s, u, void 0, n.fillmode, i, o, l ); } else t.fillcolor && e10.call(Dn.fill, t.fillcolor); } ut.singleFillStyle = function(e10, t) { var r = mn.select(e10.node()), n = r.data(), a = ((n[0] || [])[0] || {}).trace || {}; k4(e10, a, t); }; ut.fillGroupStyle = function(e10, t) { e10.style("stroke-width", 0).each(function(r) { var n = mn.select(this); r[0].trace && k4(n, r[0].trace, t); }); }; var yT = nZ(); ut.symbolNames = []; ut.symbolFuncs = []; ut.symbolBackOffs = []; ut.symbolNeedLines = {}; ut.symbolNoDot = {}; ut.symbolNoFill = {}; ut.symbolList = []; Object.keys(yT).forEach(function(e10) { var t = yT[e10], r = t.n; ut.symbolList.push( r, String(r), e10, r + 100, String(r + 100), e10 + "-open" ), ut.symbolNames[r] = e10, ut.symbolFuncs[r] = t.f, ut.symbolBackOffs[r] = t.backoff || 0, t.needLine && (ut.symbolNeedLines[r] = true), t.noDot ? ut.symbolNoDot[r] = true : ut.symbolList.push( r + 200, String(r + 200), e10 + "-dot", r + 300, String(r + 300), e10 + "-open-dot" ), t.noFill && (ut.symbolNoFill[r] = true); }); var dZ = ut.symbolNames.length; var hZ = "M0,0.5L0.5,0L0,-0.5L-0.5,0Z"; ut.symbolNumber = function(e10) { if (ls(e10)) e10 = +e10; else if (typeof e10 == "string") { var t = 0; e10.indexOf("-open") > 0 && (t = 100, e10 = e10.replace("-open", "")), e10.indexOf("-dot") > 0 && (t += 200, e10 = e10.replace("-dot", "")), e10 = ut.symbolNames.indexOf(e10), e10 >= 0 && (e10 += t); } return e10 % 100 >= dZ || e10 >= 400 ? 0 : Math.floor(Math.max(e10, 0)); }; function A4(e10, t, r, n) { var a = e10 % 100; return ut.symbolFuncs[a](t, r, n) + (e10 >= 200 ? hZ : ""); } var bT = { x1: 1, x2: 0, y1: 0, y2: 0 }; var _T = { x1: 0, x2: 0, y1: 1, y2: 0 }; var xT = aZ("~f"); var M4 = { radial: { node: "radialGradient" }, radialreversed: { node: "radialGradient", reversed: true }, horizontal: { node: "linearGradient", attrs: bT }, horizontalreversed: { node: "linearGradient", attrs: bT, reversed: true }, vertical: { node: "linearGradient", attrs: _T }, verticalreversed: { node: "linearGradient", attrs: _T, reversed: true } }; ut.gradient = function(e10, t, r, n, a, i) { for (var o = a.length, l = M4[n], s = new Array(o), u = 0; u < o; u++) l.reversed ? s[o - 1 - u] = [xT((1 - a[u][0]) * 100), a[u][1]] : s[u] = [xT(a[u][0] * 100), a[u][1]]; var f = t._fullLayout, d = "g" + f._uid + "-" + r, h = f._defs.select(".gradients").selectAll("#" + d).data([n + s.join(";")], Tr.identity); h.exit().remove(), h.enter().append(l.node).each(function() { var p = mn.select(this); l.attrs && p.attr(l.attrs), p.attr("id", d); var v = p.selectAll("stop").data(s); v.exit().remove(), v.enter().append("stop"), v.each(function(m) { var g = py(m[1]); mn.select(this).attr({ offset: m[0] + "%", "stop-color": Dn.tinyRGB(g), "stop-opacity": g.getAlpha() }); }); }), e10.style(i, pb(d, t)).style(i + "-opacity", null), e10.classed("gradient_filled", true); }; ut.pattern = function(e10, t, r, n, a, i, o, l, s, u, f, d) { var h = t === "legend"; l && (s === "overlay" ? (u = l, f = Dn.contrast(u)) : (u = void 0, f = l)); var p = r._fullLayout, v = "p" + p._uid + "-" + n, m, g, y = function(O, G, K, V, z) { return V + (z - V) * (O - G) / (K - G); }, w, k, x, _, T = {}, S = py(f), M = Dn.tinyRGB(S), L = S.getAlpha(), F = d * L; switch (a) { case "/": m = i * Math.sqrt(2), g = i * Math.sqrt(2), w = "M-" + m / 4 + "," + g / 4 + "l" + m / 2 + ",-" + g / 2 + "M0," + g + "L" + m + ",0M" + m / 4 * 3 + "," + g / 4 * 5 + "l" + m / 2 + ",-" + g / 2, k = o * i, _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case "\\": m = i * Math.sqrt(2), g = i * Math.sqrt(2), w = "M" + m / 4 * 3 + ",-" + g / 4 + "l" + m / 2 + "," + g / 2 + "M0,0L" + m + "," + g + "M-" + m / 4 + "," + g / 4 * 3 + "l" + m / 2 + "," + g / 2, k = o * i, _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case "x": m = i * Math.sqrt(2), g = i * Math.sqrt(2), w = "M-" + m / 4 + "," + g / 4 + "l" + m / 2 + ",-" + g / 2 + "M0," + g + "L" + m + ",0M" + m / 4 * 3 + "," + g / 4 * 5 + "l" + m / 2 + ",-" + g / 2 + "M" + m / 4 * 3 + ",-" + g / 4 + "l" + m / 2 + "," + g / 2 + "M0,0L" + m + "," + g + "M-" + m / 4 + "," + g / 4 * 3 + "l" + m / 2 + "," + g / 2, k = i - i * Math.sqrt(1 - o), _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case "|": m = i, g = i, _ = "path", w = "M" + m / 2 + ",0L" + m / 2 + "," + g, k = o * i, _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case "-": m = i, g = i, _ = "path", w = "M0," + g / 2 + "L" + m + "," + g / 2, k = o * i, _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case "+": m = i, g = i, _ = "path", w = "M" + m / 2 + ",0L" + m / 2 + "," + g + "M0," + g / 2 + "L" + m + "," + g / 2, k = i - i * Math.sqrt(1 - o), _ = "path", T = { d: w, opacity: F, stroke: M, "stroke-width": k + "px" }; break; case ".": m = i, g = i, o < Math.PI / 4 ? x = Math.sqrt(o * i * i / Math.PI) : x = y(o, Math.PI / 4, 1, i / 2, i / Math.sqrt(2)), _ = "circle", T = { cx: m / 2, cy: g / 2, r: x, opacity: F, fill: M }; break; } var $ = [ a || "noSh", u || "noBg", f || "noFg", i, o ].join(";"), I = p._defs.select(".patterns").selectAll("#" + v).data([$], Tr.identity); I.exit().remove(), I.enter().append("pattern").each(function() { var O = mn.select(this); if (O.attr({ id: v, width: m + "px", height: g + "px", patternUnits: "userSpaceOnUse", // for legends scale down patterns just a bit so that default size (i.e 8) nicely fit in small icons patternTransform: h ? "scale(0.8)" : "" }), u) { var G = py(u), K = Dn.tinyRGB(G), V = G.getAlpha(), z = O.selectAll("rect").data([0]); z.exit().remove(), z.enter().append("rect").attr({ width: m + "px", height: g + "px", fill: K, "fill-opacity": V }); } var P = O.selectAll(_).data([0]); P.exit().remove(), P.enter().append(_).attr(T); }), e10.style("fill", pb(v, r)).style("fill-opacity", null), e10.classed("pattern_filled", true); }; ut.initGradients = function(e10) { var t = e10._fullLayout, r = Tr.ensureSingle(t._defs, "g", "gradients"); r.selectAll("linearGradient,radialGradient").remove(), mn.select(e10).selectAll(".gradient_filled").classed("gradient_filled", false); }; ut.initPatterns = function(e10) { var t = e10._fullLayout, r = Tr.ensureSingle(t._defs, "g", "patterns"); r.selectAll("pattern").remove(), mn.select(e10).selectAll(".pattern_filled").classed("pattern_filled", false); }; ut.getPatternAttr = function(e10, t, r) { return e10 && Tr.isArrayOrTypedArray(e10) ? t < e10.length ? e10[t] : r : e10; }; ut.pointStyle = function(e10, t, r, n) { if (e10.size()) { var a = ut.makePointStyleFns(t); e10.each(function(i) { ut.singlePointStyle(i, mn.select(this), t, a, r, n); }); } }; ut.singlePointStyle = function(e10, t, r, n, a, i) { var o = r.marker, l = o.line; if (i && i.i >= 0 && e10.i === void 0 && (e10.i = i.i), t.style( "opacity", n.selectedOpacityFn ? n.selectedOpacityFn(e10) : e10.mo === void 0 ? o.opacity : e10.mo ), n.ms2mrc) { var s; e10.ms === "various" || o.size === "various" ? s = 3 : s = n.ms2mrc(e10.ms), e10.mrc = s, n.selectedSizeFn && (s = e10.mrc = n.selectedSizeFn(e10)); var u = ut.symbolNumber(e10.mx || o.symbol) || 0; e10.om = u % 200 >= 100; var f = gb(e10, r), d = mb(e10, r); t.attr("d", A4(u, s, f, d)); } var h = false, p, v, m; if (e10.so) m = l.outlierwidth, v = l.outliercolor, p = o.outliercolor; else { var g = (l || {}).width; m = (e10.mlw + 1 || g + 1 || // TODO: we need the latter for legends... can we get rid of it? (e10.trace ? (e10.trace.marker.line || {}).width : 0) + 1) - 1 || 0, "mlc" in e10 ? v = e10.mlcc = n.lineScale(e10.mlc) : Tr.isArrayOrTypedArray(l.color) ? v = Dn.defaultLine : v = l.color, Tr.isArrayOrTypedArray(o.color) && (p = Dn.defaultLine, h = true), "mc" in e10 ? p = e10.mcc = n.markerScale(e10.mc) : p = o.color || o.colors || "rgba(0,0,0,0)", n.selectedColorFn && (p = n.selectedColorFn(e10)); } if (e10.om) t.call(Dn.stroke, p).style({ "stroke-width": (m || 1) + "px", fill: "none" }); else { t.style("stroke-width", (e10.isBlank ? 0 : m) + "px"); var y = o.gradient, w = e10.mgt; w ? h = true : w = y && y.type, Tr.isArrayOrTypedArray(w) && (w = w[0], M4[w] || (w = 0)); var k = o.pattern, x = k && ut.getPatternAttr(k.shape, e10.i, ""); if (w && w !== "none") { var _ = e10.mgc; _ ? h = true : _ = y.color; var T = r.uid; h && (T += "-" + e10.i), ut.gradient( t, a, T, w, [[0, _], [1, p]], "fill" ); } else if (x) { var S = false, M = k.fgcolor; !M && i && i.color && (M = i.color, S = true); var L = ut.getPatternAttr(M, e10.i, i && i.color || null), F = ut.getPatternAttr(k.bgcolor, e10.i, null), $ = k.fgopacity, I = ut.getPatternAttr(k.size, e10.i, 8), O = ut.getPatternAttr(k.solidity, e10.i, 0.3); S = S || e10.mcc || Tr.isArrayOrTypedArray(k.shape) || Tr.isArrayOrTypedArray(k.bgcolor) || Tr.isArrayOrTypedArray(k.fgcolor) || Tr.isArrayOrTypedArray(k.size) || Tr.isArrayOrTypedArray(k.solidity); var G = r.uid; S && (G += "-" + e10.i), ut.pattern( t, "point", a, G, x, I, O, e10.mcc, k.fillmode, F, L, $ ); } else Tr.isArrayOrTypedArray(p) ? Dn.fill(t, p[e10.i]) : Dn.fill(t, p); m && Dn.stroke(t, v); } }; ut.makePointStyleFns = function(e10) { var t = {}, r = e10.marker; return t.markerScale = ut.tryColorscale(r, ""), t.lineScale = ut.tryColorscale(r, "line"), Sp.traceIs(e10, "symbols") && (t.ms2mrc = uZ.isBubble(e10) ? fZ(e10) : function() { return (r.size || 6) / 2; }), e10.selectedpoints && Tr.extendFlat(t, ut.makeSelectedPointStyleFns(e10)), t; }; ut.makeSelectedPointStyleFns = function(e10) { var t = {}, r = e10.selected || {}, n = e10.unselected || {}, a = e10.marker || {}, i = r.marker || {}, o = n.marker || {}, l = a.opacity, s = i.opacity, u = o.opacity, f = s !== void 0, d = u !== void 0; (Tr.isArrayOrTypedArray(l) || f || d) && (t.selectedOpacityFn = function(x) { var _ = x.mo === void 0 ? a.opacity : x.mo; return x.selected ? f ? s : _ : d ? u : T4 * _; }); var h = a.color, p = i.color, v = o.color; (p || v) && (t.selectedColorFn = function(x) { var _ = x.mcc || h; return x.selected ? p || _ : v || _; }); var m = a.size, g = i.size, y = o.size, w = g !== void 0, k = y !== void 0; return Sp.traceIs(e10, "symbols") && (w || k) && (t.selectedSizeFn = function(x) { var _ = x.mrc || m / 2; return x.selected ? w ? g / 2 : _ : k ? y / 2 : _; }), t; }; ut.makeSelectedTextStyleFns = function(e10) { var t = {}, r = e10.selected || {}, n = e10.unselected || {}, a = e10.textfont || {}, i = r.textfont || {}, o = n.textfont || {}, l = a.color, s = i.color, u = o.color; return t.selectedTextColorFn = function(f) { var d = f.tc || l; return f.selected ? s || d : u || (s ? d : Dn.addOpacity(d, T4)); }, t; }; ut.selectedPointStyle = function(e10, t) { if (!(!e10.size() || !t.selectedpoints)) { var r = ut.makeSelectedPointStyleFns(t), n = t.marker || {}, a = []; r.selectedOpacityFn && a.push(function(i, o) { i.style("opacity", r.selectedOpacityFn(o)); }), r.selectedColorFn && a.push(function(i, o) { Dn.fill(i, r.selectedColorFn(o)); }), r.selectedSizeFn && a.push(function(i, o) { var l = o.mx || n.symbol || 0, s = r.selectedSizeFn(o); i.attr("d", A4(ut.symbolNumber(l), s, gb(o, t), mb(o, t))), o.mrc2 = s; }), a.length && e10.each(function(i) { for (var o = mn.select(this), l = 0; l < a.length; l++) a[l](o, i); }); } }; ut.tryColorscale = function(e10, t) { var r = t ? Tr.nestedProperty(e10, t).get() : e10; if (r) { var n = r.color; if ((r.colorscale || r._colorAx) && Tr.isArrayOrTypedArray(n)) return iZ.makeColorScaleFuncFromTrace(r); } return Tr.identity; }; var lg = { start: 1, end: -1, middle: 0, bottom: 1, top: -1 }; function S4(e10, t, r, n, a) { var i = mn.select(e10.node().parentNode), o = t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle", l = t.indexOf("left") !== -1 ? "end" : t.indexOf("right") !== -1 ? "start" : "middle", s = n ? n / 0.8 + 1 : 0, u = (vb.lineCount(e10) - 1) * sZ + 1, f = lg[l] * s, d = r * 0.75 + lg[o] * s + (lg[o] - 1) * u * r / 2; e10.attr("text-anchor", l), a || i.attr("transform", wc(f, d)); } function C4(e10, t) { var r = e10.ts || t.textfont.size; return ls(r) && r > 0 ? r : 0; } ut.textPointStyle = function(e10, t, r) { if (e10.size()) { var n; if (t.selectedpoints) { var a = ut.makeSelectedTextStyleFns(t); n = a.selectedTextColorFn; } var i = t.texttemplate, o = r._fullLayout; e10.each(function(l) { var s = mn.select(this), u = i ? Tr.extractOption(l, t, "txt", "texttemplate") : Tr.extractOption(l, t, "tx", "text"); if (!u && u !== 0) { s.remove(); return; } if (i) { var f = t._module.formatLabels, d = f ? f(l, t, o) : {}, h = {}; cZ(h, t, l.i); var p = t._meta || {}; u = Tr.texttemplateString(u, d, o._d3locale, h, l, p); } var v = l.tp || t.textposition, m = C4(l, t), g = n ? n(l) : l.tc || t.textfont.color; s.call( ut.font, l.tf || t.textfont.family, m, g ).text(u).call(vb.convertToTspans, r).call(S4, v, m, l.mrc); }); } }; ut.selectedTextStyle = function(e10, t) { if (!(!e10.size() || !t.selectedpoints)) { var r = ut.makeSelectedTextStyleFns(t); e10.each(function(n) { var a = mn.select(this), i = r.selectedTextColorFn(n), o = n.tp || t.textposition, l = C4(n, t); Dn.fill(a, i); var s = Sp.traceIs(t, "bar-like"); S4(a, o, l, n.mrc2 || n.mrc, s); }); } }; var wT = 0.5; ut.smoothopen = function(e10, t) { if (e10.length < 3) return "M" + e10.join("L"); var r = "M" + e10[0], n = [], a; for (a = 1; a < e10.length - 1; a++) n.push(zh(e10[a - 1], e10[a], e10[a + 1], t)); for (r += "Q" + n[0][0] + " " + e10[1], a = 2; a < e10.length - 1; a++) r += "C" + n[a - 2][1] + " " + n[a - 1][0] + " " + e10[a]; return r += "Q" + n[e10.length - 3][1] + " " + e10[e10.length - 1], r; }; ut.smoothclosed = function(e10, t) { if (e10.length < 3) return "M" + e10.join("L") + "Z"; var r = "M" + e10[0], n = e10.length - 1, a = [zh(e10[n], e10[0], e10[1], t)], i; for (i = 1; i < n; i++) a.push(zh(e10[i - 1], e10[i], e10[i + 1], t)); for (a.push( zh(e10[n - 1], e10[n], e10[0], t) ), i = 1; i <= n; i++) r += "C" + a[i - 1][1] + " " + a[i][0] + " " + e10[i]; return r += "C" + a[n][1] + " " + a[0][0] + " " + e10[0] + "Z", r; }; var L4; var D4; function fu(e10, t, r) { return r && (e10 = E4(e10)), t ? Yl(e10[1]) : Zl(e10[0]); } function Zl(e10) { var t = mn.round(e10, 2); return L4 = t, t; } function Yl(e10) { var t = mn.round(e10, 2); return D4 = t, t; } function zh(e10, t, r, n) { var a = e10[0] - t[0], i = e10[1] - t[1], o = r[0] - t[0], l = r[1] - t[1], s = Math.pow(a * a + i * i, wT / 2), u = Math.pow(o * o + l * l, wT / 2), f = (u * u * a - s * s * o) * n, d = (u * u * i - s * s * l) * n, h = 3 * u * (s + u), p = 3 * s * (s + u); return [ [ Zl(t[0] + (h && f / h)), Yl(t[1] + (h && d / h)) ], [ Zl(t[0] - (p && f / p)), Yl(t[1] - (p && d / p)) ] ]; } var vZ = { hv: function(e10, t, r) { return "H" + Zl(t[0]) + "V" + fu(t, 1, r); }, vh: function(e10, t, r) { return "V" + Yl(t[1]) + "H" + fu(t, 0, r); }, hvh: function(e10, t, r) { return "H" + Zl((e10[0] + t[0]) / 2) + "V" + Yl(t[1]) + "H" + fu(t, 0, r); }, vhv: function(e10, t, r) { return "V" + Yl((e10[1] + t[1]) / 2) + "H" + Zl(t[0]) + "V" + fu(t, 1, r); } }; var pZ = function(e10, t, r) { return "L" + fu(t, 0, r) + "," + fu(t, 1, r); }; ut.steps = function(e10) { var t = vZ[e10] || pZ; return function(r) { for (var n = "M" + Zl(r[0][0]) + "," + Yl(r[0][1]), a = r.length, i = 1; i < a; i++) n += t(r[i - 1], r[i], i === a - 1); return n; }; }; function E4(e10, t) { var r = e10.backoff, n = e10.trace, a = e10.d, i = e10.i; if (r && n && n.marker && n.marker.angle % 360 === 0 && n.line && n.line.shape !== "spline") { var o = Tr.isArrayOrTypedArray(r), l = e10, s = t ? t[0] : L4 || 0, u = t ? t[1] : D4 || 0, f = l[0], d = l[1], h = f - s, p = d - u, v = Math.atan2(p, h), m = o ? r[i] : r; if (m === "auto") { var g = l.i; n.type === "scatter" && g--; var y = l.marker, w = y.symbol; Tr.isArrayOrTypedArray(w) && (w = w[g]); var k = y.size; Tr.isArrayOrTypedArray(k) && (k = k[g]), m = y ? ut.symbolBackOffs[ut.symbolNumber(w)] * k : 0, m += ut.getMarkerStandoff(a[g], n) || 0; } var x = f - m * Math.cos(v), _ = d - m * Math.sin(v); (x <= f && x >= s || x >= f && x <= s) && (_ <= d && _ >= u || _ >= d && _ <= u) && (e10 = [x, _]); } return e10; } ut.applyBackoff = E4; ut.makeTester = function() { var e10 = Tr.ensureSingleById(mn.select("body"), "svg", "js-plotly-tester", function(r) { r.attr(oZ.svgAttrs).style({ position: "absolute", left: "-10000px", top: "-10000px", width: "9000px", height: "9000px", "z-index": "1" }); }), t = Tr.ensureSingle(e10, "path", "js-reference-point", function(r) { r.attr("d", "M0,0H1V1H0Z").style({ "stroke-width": 0, fill: "black" }); }); ut.tester = e10, ut.testref = t; }; ut.savedBBoxes = {}; var sg = 0; var mZ = 1e4; ut.bBox = function(e10, t, r) { r || (r = TT(e10)); var n; if (r) { if (n = ut.savedBBoxes[r], n) return Tr.extendFlat({}, n); } else if (e10.childNodes.length === 1) { var a = e10.childNodes[0]; if (r = TT(a), r) { var i = +a.getAttribute("x") || 0, o = +a.getAttribute("y") || 0, l = a.getAttribute("transform"); if (!l) { var s = ut.bBox(a, false, r); return i && (s.left += i, s.right += i), o && (s.top += o, s.bottom += o), s; } if (r += "~" + i + "~" + o + "~" + l, n = ut.savedBBoxes[r], n) return Tr.extendFlat({}, n); } } var u, f; t ? u = e10 : (f = ut.tester.node(), u = e10.cloneNode(true), f.appendChild(u)), mn.select(u).attr("transform", null).call(vb.positionText, 0, 0); var d = u.getBoundingClientRect(), h = ut.testref.node().getBoundingClientRect(); t || f.removeChild(u); var p = { height: d.height, width: d.width, left: d.left - h.left, top: d.top - h.top, right: d.right - h.left, bottom: d.bottom - h.top }; return sg >= mZ && (ut.savedBBoxes = {}, sg = 0), r && (ut.savedBBoxes[r] = p), sg++, Tr.extendFlat({}, p); }; function TT(e10) { var t = e10.getAttribute("data-unformatted"); if (t !== null) return t + e10.getAttribute("data-math") + e10.getAttribute("text-anchor") + e10.getAttribute("style"); } ut.setClipUrl = function(e10, t, r) { e10.attr("clip-path", pb(t, r)); }; function pb(e10, t) { if (!e10) return null; var r = t._context, n = r._exportedPlot ? "" : r._baseUrl || ""; return n ? "url('" + n + "#" + e10 + "')" : "url(#" + e10 + ")"; } ut.getTranslate = function(e10) { var t = /.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/, r = e10.attr ? "attr" : "getAttribute", n = e10[r]("transform") || "", a = n.replace(t, function(i, o, l) { return [o, l].join(" "); }).split(" "); return { x: +a[0] || 0, y: +a[1] || 0 }; }; ut.setTranslate = function(e10, t, r) { var n = /(\btranslate\(.*?\);?)/, a = e10.attr ? "attr" : "getAttribute", i = e10.attr ? "attr" : "setAttribute", o = e10[a]("transform") || ""; return t = t || 0, r = r || 0, o = o.replace(n, "").trim(), o += wc(t, r), o = o.trim(), e10[i]("transform", o), o; }; ut.getScale = function(e10) { var t = /.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/, r = e10.attr ? "attr" : "getAttribute", n = e10[r]("transform") || "", a = n.replace(t, function(i, o, l) { return [o, l].join(" "); }).split(" "); return { x: +a[0] || 1, y: +a[1] || 1 }; }; ut.setScale = function(e10, t, r) { var n = /(\bscale\(.*?\);?)/, a = e10.attr ? "attr" : "getAttribute", i = e10.attr ? "attr" : "setAttribute", o = e10[a]("transform") || ""; return t = t || 1, r = r || 1, o = o.replace(n, "").trim(), o += "scale(" + t + "," + r + ")", o = o.trim(), e10[i]("transform", o), o; }; var gZ = /\s*sc.*/; ut.setPointGroupScale = function(e10, t, r) { if (t = t || 1, r = r || 1, !!e10) { var n = t === 1 && r === 1 ? "" : "scale(" + t + "," + r + ")"; e10.each(function() { var a = (this.getAttribute("transform") || "").replace(gZ, ""); a += n, a = a.trim(), this.setAttribute("transform", a); }); } }; var yZ = /translate\([^)]*\)\s*$/; ut.setTextPointsScale = function(e10, t, r) { e10 && e10.each(function() { var n, a = mn.select(this), i = a.select("text"); if (i.node()) { var o = parseFloat(i.attr("x") || 0), l = parseFloat(i.attr("y") || 0), s = (a.attr("transform") || "").match(yZ); t === 1 && r === 1 ? n = [] : n = [ wc(o, l), "scale(" + t + "," + r + ")", wc(-o, -l) ], s && n.push(s), a.attr("transform", n.join("")); } }); }; function mb(e10, t) { var r; return e10 && (r = e10.mf), r === void 0 && (r = t.marker && t.marker.standoff || 0), !t._geo && !t._xA ? -r : r; } ut.getMarkerStandoff = mb; var Mf = Math.atan2; var Il = Math.cos; var cu = Math.sin; function kT(e10, t) { var r = t[0], n = t[1]; return [ r * Il(e10) - n * cu(e10), r * cu(e10) + n * Il(e10) ]; } var AT; var MT; var ST; var CT; var ug; var fg; function gb(e10, t) { var r = e10.ma; r === void 0 && (r = t.marker.angle, (!r || Tr.isArrayOrTypedArray(r)) && (r = 0)); var n, a, i = t.marker.angleref; if (i === "previous" || i === "north") { if (t._geo) { var o = t._geo.project(e10.lonlat); n = o[0], a = o[1]; } else { var l = t._xA, s = t._yA; if (l && s) n = l.c2p(e10.x), a = s.c2p(e10.y); else return 90; } if (t._geo) { var u = e10.lonlat[0], f = e10.lonlat[1], d = t._geo.project([ u, f + 1e-5 // epsilon ]), h = t._geo.project([ u + 1e-5, // epsilon f ]), p = Mf( h[1] - a, h[0] - n ), v = Mf( d[1] - a, d[0] - n ), m; if (i === "north") m = r / 180 * Math.PI; else if (i === "previous") { var g = u / 180 * Math.PI, y = f / 180 * Math.PI, w = AT / 180 * Math.PI, k = MT / 180 * Math.PI, x = w - g, _ = Il(k) * cu(x), T = cu(k) * Il(y) - Il(k) * cu(y) * Il(x); m = -Mf( _, T ) - Math.PI, AT = u, MT = f; } var S = kT(p, [Il(m), 0]), M = kT(v, [cu(m), 0]); r = Mf( S[1] + M[1], S[0] + M[0] ) / Math.PI * 180, i === "previous" && !(fg === t.uid && e10.i === ug + 1) && (r = null); } if (i === "previous" && !t._geo) if (fg === t.uid && e10.i === ug + 1 && ls(n) && ls(a)) { var L = n - ST, F = a - CT, $ = t.line && t.line.shape || "", I = $.slice($.length - 1); I === "h" && (F = 0), I === "v" && (L = 0), r += Mf(F, L) / Math.PI * 180 + 90; } else r = null; } return ST = n, CT = a, ug = e10.i, fg = t.uid, r; } ut.getMarkerAngle = gb; var Sr = n4.exports; var Vd = lr; var bZ = sr; var LT = Tn; var DT = Nt; var nu = Ue; var ET = nu.strTranslate; var FT = Sr; var RT = nr; var cg = Rn; var PT = q1; var _Z = On.OPPOSITE_SIDE; var $T = / [XY][0-9]* /; function xZ(e10, t, r) { var n = r.propContainer, a = r.propName, i = r.placeholder, o = r.traceIndex, l = r.avoid || {}, s = r.attributes, u = r.transform, f = r.containerGroup, d = e10._fullLayout, h = 1, p = false, v = n.title, m = (v && v.text ? v.text : "").trim(), g = v && v.font ? v.font : {}, y = g.family, w = g.size, k = g.color, x; a === "title.text" ? x = "titleText" : a.indexOf("axis") !== -1 ? x = "axisTitleText" : a.indexOf("colorbar" !== -1) && (x = "colorbarTitleText"); var _ = e10._context.edits[x]; m === "" ? h = 0 : m.replace($T, " % ") === i.replace($T, " % ") && (h = 0.2, p = true, _ || (m = "")), r._meta ? m = nu.templateString(m, r._meta) : d._meta && (m = nu.templateString(m, d._meta)); var T = m || _, S; f || (f = nu.ensureSingle(d._infolayer, "g", "g-" + t), S = d._hColorbarMoveTitle); var M = f.selectAll("text").data(T ? [0] : []); if (M.enter().append("text"), M.text(m).attr("class", t), M.exit().remove(), !T) return f; function L(O) { nu.syncOrAsync([F, $], O); } function F(O) { var G; return !u && S && (u = {}), u ? (G = "", u.rotate && (G += "rotate(" + [u.rotate, s.x, s.y] + ")"), (u.offset || S) && (G += ET(0, (u.offset || 0) - (S || 0)))) : G = null, O.attr("transform", G), O.style({ "font-family": y, "font-size": Vd.round(w, 2) + "px", fill: RT.rgb(k), opacity: h * RT.opacity(k), "font-weight": LT.fontWeight }).attr(s).call(cg.convertToTspans, e10), LT.previousPromises(e10); } function $(O) { var G = Vd.select(O.node().parentNode); if (l && l.selection && l.side && m) { G.attr("transform", null); var K = _Z[l.side], V = l.side === "left" || l.side === "top" ? -1 : 1, z = bZ(l.pad) ? l.pad : 2, P = FT.bBox(G.node()), R = { t: 0, b: 0, l: 0, r: 0 }, H = e10._fullLayout._reservedMargin; for (var B in H) for (var W in H[B]) { var ee = H[B][W]; R[W] = Math.max(R[W], ee); } var re = { left: R.l, top: R.t, right: d.width - R.r, bottom: d.height - R.b }, ae = l.maxShift || V * (re[l.side] - P[l.side]), Q = 0; if (ae < 0) Q = ae; else { var ue = l.offsetLeft || 0, j = l.offsetTop || 0; P.left -= ue, P.right -= ue, P.top -= j, P.bottom -= j, l.selection.each(function() { var Z = FT.bBox(this); nu.bBoxIntersect(P, Z, z) && (Q = Math.max(Q, V * (Z[l.side] - P[K]) + z)); }), Q = Math.min(ae, Q), n._titleScoot = Math.abs(Q); } if (Q > 0 || ae < 0) { var U = { left: [-Q, 0], right: [Q, 0], top: [0, -Q], bottom: [0, Q] }[l.side]; G.attr("transform", ET(U[0], U[1])); } } } M.call(L); function I() { h = 0, p = true, M.text(i).on("mouseover.opacity", function() { Vd.select(this).transition().duration(PT.SHOW_PLACEHOLDER).style("opacity", 1); }).on("mouseout.opacity", function() { Vd.select(this).transition().duration(PT.HIDE_PLACEHOLDER).style("opacity", 0); }); } return _ && (m ? M.on(".opacity", null) : I(), M.call(cg.makeEditable, { gd: e10 }).on("edit", function(O) { o !== void 0 ? DT.call("_guiRestyle", e10, a, O, o) : DT.call("_guiRelayout", e10, a, O); }).on("cancel", function() { this.text(this.attr("data-unformatted")).call(L); }).on("input", function(O) { this.text(O || " ").call(cg.positionText, s.x, s.y); })), M.classed("js-placeholder", p), f; } var Cp = { draw: xZ }; var wZ = lr; var TZ = _c.utcFormat; var Dr = Ue; var kZ = Dr.numberFormat; var Mi = sr; var No = Dr.cleanNumber; var AZ = Dr.ms2DateTime; var zT = Dr.dateTime2ms; var Si = Dr.ensureNumber; var IT = Dr.isArrayOrTypedArray; var bl = Qr; var qd = bl.FP_SAFE; var ti = bl.BADNUM; var MZ = bl.LOG_CLIP; var SZ = bl.ONEWEEK; var Wd = bl.ONEDAY; var Zd = bl.ONEHOUR; var NT = bl.ONEMIN; var OT = bl.ONESEC; var Yd = gn; var fv = Yn; var Xd = fv.HOUR_PATTERN; var Kd = fv.WEEKDAY_PATTERN; function Sf(e10) { return Math.pow(10, e10); } function dg(e10) { return e10 != null; } var yb = function(t, r) { r = r || {}; var n = t._id || "x", a = n.charAt(0); function i(x, _) { if (x > 0) return Math.log(x) / Math.LN10; if (x <= 0 && _ && t.range && t.range.length === 2) { var T = t.range[0], S = t.range[1]; return 0.5 * (T + S - 2 * MZ * Math.abs(T - S)); } else return ti; } function o(x, _, T, S) { if ((S || {}).msUTC && Mi(x)) return +x; var M = zT(x, T || t.calendar); if (M === ti) if (Mi(x)) { x = +x; var L = Math.floor(Dr.mod(x + 0.05, 1) * 10), F = Math.round(x - L / 10); M = zT(new Date(F)) + L / 10; } else return ti; return M; } function l(x, _, T) { return AZ(x, _, T || t.calendar); } function s(x) { return t._categories[Math.round(x)]; } function u(x) { if (dg(x)) { if (t._categoriesMap === void 0 && (t._categoriesMap = {}), t._categoriesMap[x] !== void 0) return t._categoriesMap[x]; t._categories.push(typeof x == "number" ? String(x) : x); var _ = t._categories.length - 1; return t._categoriesMap[x] = _, _; } return ti; } function f(x, _) { for (var T = new Array(_), S = 0; S < _; S++) { var M = (x[0] || [])[S], L = (x[1] || [])[S]; T[S] = d([M, L]); } return T; } function d(x) { if (t._categoriesMap) return t._categoriesMap[x]; } function h(x) { var _ = d(x); if (_ !== void 0) return _; if (Mi(x)) return +x; } function p(x) { return Mi(x) ? +x : d(x); } function v(x, _, T) { return wZ.round(T + _ * x, 2); } function m(x, _, T) { return (x - T) / _; } var g = function(_) { return Mi(_) ? v(_, t._m, t._b) : ti; }, y = function(x) { return m(x, t._m, t._b); }; if (t.rangebreaks) { var w = a === "y"; g = function(x) { if (!Mi(x)) return ti; var _ = t._rangebreaks.length; if (!_) return v(x, t._m, t._b); var T = w; t.range[0] > t.range[1] && (T = !T); for (var S = T ? -1 : 1, M = S * x, L = 0, F = 0; F < _; F++) { var $ = S * t._rangebreaks[F].min, I = S * t._rangebreaks[F].max; if (M < $) break; if (M > I) L = F + 1; else { L = M < ($ + I) / 2 ? F : F + 1; break; } } var O = t._B[L] || 0; return isFinite(O) ? v(x, t._m2, O) : 0; }, y = function(x) { var _ = t._rangebreaks.length; if (!_) return m(x, t._m, t._b); for (var T = 0, S = 0; S < _ && !(x < t._rangebreaks[S].pmin); S++) x > t._rangebreaks[S].pmax && (T = S + 1); return m(x, t._m2, t._B[T]); }; } t.c2l = t.type === "log" ? i : Si, t.l2c = t.type === "log" ? Sf : Si, t.l2p = g, t.p2l = y, t.c2p = t.type === "log" ? function(x, _) { return g(i(x, _)); } : g, t.p2c = t.type === "log" ? function(x) { return Sf(y(x)); } : y, ["linear", "-"].indexOf(t.type) !== -1 ? (t.d2r = t.r2d = t.d2c = t.r2c = t.d2l = t.r2l = No, t.c2d = t.c2r = t.l2d = t.l2r = Si, t.d2p = t.r2p = function(x) { return t.l2p(No(x)); }, t.p2d = t.p2r = y, t.cleanPos = Si) : t.type === "log" ? (t.d2r = t.d2l = function(x, _) { return i(No(x), _); }, t.r2d = t.r2c = function(x) { return Sf(No(x)); }, t.d2c = t.r2l = No, t.c2d = t.l2r = Si, t.c2r = i, t.l2d = Sf, t.d2p = function(x, _) { return t.l2p(t.d2r(x, _)); }, t.p2d = function(x) { return Sf(y(x)); }, t.r2p = function(x) { return t.l2p(No(x)); }, t.p2r = y, t.cleanPos = Si) : t.type === "date" ? (t.d2r = t.r2d = Dr.identity, t.d2c = t.r2c = t.d2l = t.r2l = o, t.c2d = t.c2r = t.l2d = t.l2r = l, t.d2p = t.r2p = function(x, _, T) { return t.l2p(o(x, 0, T)); }, t.p2d = t.p2r = function(x, _, T) { return l(y(x), _, T); }, t.cleanPos = function(x) { return Dr.cleanDate(x, ti, t.calendar); }) : t.type === "category" ? (t.d2c = t.d2l = u, t.r2d = t.c2d = t.l2d = s, t.d2r = t.d2l_noadd = h, t.r2c = function(x) { var _ = p(x); return _ !== void 0 ? _ : t.fraction2r(0.5); }, t.l2r = t.c2r = Si, t.r2l = p, t.d2p = function(x) { return t.l2p(t.r2c(x)); }, t.p2d = function(x) { return s(y(x)); }, t.r2p = t.d2p, t.p2r = y, t.cleanPos = function(x) { return typeof x == "string" && x !== "" ? x : Si(x); }) : t.type === "multicategory" && (t.r2d = t.c2d = t.l2d = s, t.d2r = t.d2l_noadd = h, t.r2c = function(x) { var _ = h(x); return _ !== void 0 ? _ : t.fraction2r(0.5); }, t.r2c_just_indices = d, t.l2r = t.c2r = Si, t.r2l = h, t.d2p = function(x) { return t.l2p(t.r2c(x)); }, t.p2d = function(x) { return s(y(x)); }, t.r2p = t.d2p, t.p2r = y, t.cleanPos = function(x) { return Array.isArray(x) || typeof x == "string" && x !== "" ? x : Si(x); }, t.setupMultiCategory = function(x) { var _ = t._traceIndices, T, S, M = t._matchGroup; if (M && t._categories.length === 0) { for (var L in M) if (L !== n) { var F = r[Yd.id2name(L)]; _ = _.concat(F._traceIndices); } } var $ = [[0, {}], [0, {}]], I = []; for (T = 0; T < _.length; T++) { var O = x[_[T]]; if (a in O) { var G = O[a], K = O._length || Dr.minRowLength(G); if (IT(G[0]) && IT(G[1])) for (S = 0; S < K; S++) { var V = G[0][S], z = G[1][S]; dg(V) && dg(z) && (I.push([V, z]), V in $[0][1] || ($[0][1][V] = $[0][0]++), z in $[1][1] || ($[1][1][z] = $[1][0]++)); } } } for (I.sort(function(P, R) { var H = $[0][1], B = H[P[0]] - H[R[0]]; if (B) return B; var W = $[1][1]; return W[P[1]] - W[R[1]]; }), T = 0; T < I.length; T++) u(I[T]); }), t.fraction2r = function(x) { var _ = t.r2l(t.range[0]), T = t.r2l(t.range[1]); return t.l2r(_ + x * (T - _)); }, t.r2fraction = function(x) { var _ = t.r2l(t.range[0]), T = t.r2l(t.range[1]); return (t.r2l(x) - _) / (T - _); }, t.limitRange = function(x) { var _ = t.minallowed, T = t.maxallowed; if (!(_ === void 0 && T === void 0)) { x || (x = "range"); var S = Dr.nestedProperty(t, x).get(), M = Dr.simpleMap(S, t.r2l), L = M[1] < M[0]; L && M.reverse(); var F = Dr.simpleMap([_, T], t.r2l); if (_ !== void 0 && M[0] < F[0] && (S[L ? 1 : 0] = _), T !== void 0 && M[1] > F[1] && (S[L ? 0 : 1] = T), S[0] === S[1]) { var $ = t.l2r(_), I = t.l2r(T); if (_ !== void 0) { var O = $ + 1; T !== void 0 && (O = Math.min(O, I)), S[L ? 1 : 0] = O; } if (T !== void 0) { var G = I + 1; _ !== void 0 && (G = Math.max(G, $)), S[L ? 0 : 1] = G; } } } }, t.cleanRange = function(x, _) { t._cleanRange(x, _), t.limitRange(x); }, t._cleanRange = function(x, _) { _ || (_ = {}), x || (x = "range"); var T = Dr.nestedProperty(t, x).get(), S, M; if (t.type === "date" ? M = Dr.dfltRange(t.calendar) : a === "y" ? M = fv.DFLTRANGEY : t._name === "realaxis" ? M = [0, 1] : M = _.dfltRange || fv.DFLTRANGEX, M = M.slice(), (t.rangemode === "tozero" || t.rangemode === "nonnegative") && (M[0] = 0), !T || T.length !== 2) { Dr.nestedProperty(t, x).set(M); return; } var L = T[0] === null, F = T[1] === null; for (t.type === "date" && !t.autorange && (T[0] = Dr.cleanDate(T[0], ti, t.calendar), T[1] = Dr.cleanDate(T[1], ti, t.calendar)), S = 0; S < 2; S++) if (t.type === "date") { if (!Dr.isDateTime(T[S], t.calendar)) { t[x] = M; break; } if (t.r2l(T[0]) === t.r2l(T[1])) { var $ = Dr.constrain( t.r2l(T[0]), Dr.MIN_MS + 1e3, Dr.MAX_MS - 1e3 ); T[0] = t.l2r($ - 1e3), T[1] = t.l2r($ + 1e3); break; } } else { if (!Mi(T[S])) if (!(L || F) && Mi(T[1 - S])) T[S] = T[1 - S] * (S ? 10 : 0.1); else { t[x] = M; break; } if (T[S] < -qd ? T[S] = -qd : T[S] > qd && (T[S] = qd), T[0] === T[1]) { var I = Math.max(1, Math.abs(T[0] * 1e-6)); T[0] -= I, T[1] += I; } } }, t.setScale = function(x) { var _ = r._size; if (t.overlaying) { var T = Yd.getFromId({ _fullLayout: r }, t.overlaying); t.domain = T.domain; } var S = x && t._r ? "_r" : "range", M = t.calendar; t.cleanRange(S); var L = t.r2l(t[S][0], M), F = t.r2l(t[S][1], M), $ = a === "y"; if ($ ? (t._offset = _.t + (1 - t.domain[1]) * _.h, t._length = _.h * (t.domain[1] - t.domain[0]), t._m = t._length / (L - F), t._b = -t._m * F) : (t._offset = _.l + t.domain[0] * _.w, t._length = _.w * (t.domain[1] - t.domain[0]), t._m = t._length / (F - L), t._b = -t._m * L), t._rangebreaks = [], t._lBreaks = 0, t._m2 = 0, t._B = [], t.rangebreaks) { var I, O; if (t._rangebreaks = t.locateBreaks( Math.min(L, F), Math.max(L, F) ), t._rangebreaks.length) { for (I = 0; I < t._rangebreaks.length; I++) O = t._rangebreaks[I], t._lBreaks += Math.abs(O.max - O.min); var G = $; L > F && (G = !G), G && t._rangebreaks.reverse(); var K = G ? -1 : 1; for (t._m2 = K * t._length / (Math.abs(F - L) - t._lBreaks), t._B.push(-t._m2 * ($ ? F : L)), I = 0; I < t._rangebreaks.length; I++) O = t._rangebreaks[I], t._B.push( t._B[t._B.length - 1] - K * t._m2 * (O.max - O.min) ); for (I = 0; I < t._rangebreaks.length; I++) O = t._rangebreaks[I], O.pmin = g(O.min), O.pmax = g(O.max); } } if (!isFinite(t._m) || !isFinite(t._b) || t._length < 0) throw r._replotting = false, new Error("Something went wrong with axis scaling"); }, t.maskBreaks = function(x) { var _ = t.rangebreaks || [], T, S, M, L, F; _._cachedPatterns || (_._cachedPatterns = _.map(function(H) { return H.enabled && H.bounds ? Dr.simpleMap( H.bounds, H.pattern ? No : t.d2c // case of pattern: '' ) : null; })), _._cachedValues || (_._cachedValues = _.map(function(H) { return H.enabled && H.values ? Dr.simpleMap(H.values, t.d2c).sort(Dr.sorterAsc) : null; })); for (var $ = 0; $ < _.length; $++) { var I = _[$]; if (I.enabled) { if (I.bounds) { var O = I.pattern; switch (T = _._cachedPatterns[$], S = T[0], M = T[1], O) { case Kd: F = new Date(x), L = F.getUTCDay(), S > M && (M += 7, L < S && (L += 7)); break; case Xd: F = new Date(x); var G = F.getUTCHours(), K = F.getUTCMinutes(), V = F.getUTCSeconds(), z = F.getUTCMilliseconds(); L = G + (K / 60 + V / 3600 + z / 36e5), S > M && (M += 24, L < S && (L += 24)); break; case "": L = x; break; } if (L >= S && L < M) return ti; } else for (var P = _._cachedValues[$], R = 0; R < P.length; R++) if (S = P[R], M = S + I.dvalue, x >= S && x < M) return ti; } } return x; }, t.locateBreaks = function(x, _) { var T, S, M, L, F = []; if (!t.rangebreaks) return F; var $ = t.rangebreaks.slice().sort(function(W, ee) { return W.pattern === Kd && ee.pattern === Xd ? -1 : ee.pattern === Kd && W.pattern === Xd ? 1 : 0; }), I = function(W, ee) { if (W = Dr.constrain(W, x, _), ee = Dr.constrain(ee, x, _), W !== ee) { for (var re = true, ae = 0; ae < F.length; ae++) { var Q = F[ae]; W < Q.max && ee >= Q.min && (W < Q.min && (Q.min = W), ee > Q.max && (Q.max = ee), re = false); } re && F.push({ min: W, max: ee }); } }; for (T = 0; T < $.length; T++) { var O = $[T]; if (O.enabled) if (O.bounds) { var G = x, K = _; O.pattern && (G = Math.floor(G)), S = Dr.simpleMap(O.bounds, O.pattern ? No : t.r2l), M = S[0], L = S[1]; var V = new Date(G), z, P; switch (O.pattern) { case Kd: P = SZ, z = ((L < M ? 7 : 0) + (L - M)) * Wd, G += M * Wd - (V.getUTCDay() * Wd + V.getUTCHours() * Zd + V.getUTCMinutes() * NT + V.getUTCSeconds() * OT + V.getUTCMilliseconds()); break; case Xd: P = Wd, z = ((L < M ? 24 : 0) + (L - M)) * Zd, G += M * Zd - (V.getUTCHours() * Zd + V.getUTCMinutes() * NT + V.getUTCSeconds() * OT + V.getUTCMilliseconds()); break; default: G = Math.min(S[0], S[1]), K = Math.max(S[0], S[1]), P = K - G, z = P; } for (var R = G; R < K; R += P) I(R, R + z); } else for (var H = Dr.simpleMap(O.values, t.d2c), B = 0; B < H.length; B++) M = H[B], L = M + O.dvalue, I(M, L); } return F.sort(function(W, ee) { return W.min - ee.min; }), F; }, t.makeCalcdata = function(x, _, T) { var S, M, L, F, $ = t.type, I = $ === "date" && x[_ + "calendar"]; if (_ in x) { if (S = x[_], F = x._length || Dr.minRowLength(S), Dr.isTypedArray(S) && ($ === "linear" || $ === "log")) { if (F === S.length) return S; if (S.subarray) return S.subarray(0, F); } if ($ === "multicategory") return f(S, F); for (M = new Array(F), L = 0; L < F; L++) M[L] = t.d2c(S[L], 0, I, T); } else { var O = _ + "0" in x ? t.d2c(x[_ + "0"], 0, I) : 0, G = x["d" + _] ? Number(x["d" + _]) : 1; for (S = x[{ x: "y", y: "x" }[_]], F = x._length || S.length, M = new Array(F), L = 0; L < F; L++) M[L] = O + L * G; } if (t.rangebreaks) for (L = 0; L < F; L++) M[L] = t.maskBreaks(M[L]); return M; }, t.isValidRange = function(x, _) { return Array.isArray(x) && x.length === 2 && (_ && x[0] === null || Mi(t.r2l(x[0]))) && (_ && x[1] === null || Mi(t.r2l(x[1]))); }, t.getAutorangeDflt = function(x, _) { var T = !t.isValidRange(x, "nullOk"); return T && _ && _.reverseDflt ? T = "reversed" : x && (x[0] === null && x[1] === null ? T = true : x[0] === null && x[1] !== null ? T = "min" : x[0] !== null && x[1] === null && (T = "max")), T; }, t.isReversed = function() { var x = t.autorange; return x === "reversed" || x === "min reversed" || x === "max reversed"; }, t.isPtWithinRange = function(x, _) { var T = t.c2l(x[a], null, _), S = t.r2l(t.range[0]), M = t.r2l(t.range[1]); return S < M ? S <= T && T <= M : M <= T && T <= S; }, t._emptyCategories = function() { t._categories = [], t._categoriesMap = {}; }, t.clearCalc = function() { var x = t._matchGroup; if (x) { var _ = null, T = null; for (var S in x) { var M = r[Yd.id2name(S)]; if (M._categories) { _ = M._categories, T = M._categoriesMap; break; } } _ && T ? (t._categories = _, t._categoriesMap = T) : t._emptyCategories(); } else t._emptyCategories(); if (t._initialCategories) for (var L = 0; L < t._initialCategories.length; L++) u(t._initialCategories[L]); }, t.sortByInitialCategories = function() { var x = []; if (t._emptyCategories(), t._initialCategories) for (var _ = 0; _ < t._initialCategories.length; _++) u(t._initialCategories[_]); x = x.concat(t._traceIndices); var T = t._matchGroup; for (var S in T) if (n !== S) { var M = r[Yd.id2name(S)]; M._categories = t._categories, M._categoriesMap = t._categoriesMap, x = x.concat(M._traceIndices); } return x; }; var k = r._d3locale; t.type === "date" && (t._dateFormat = k ? k.timeFormat : TZ, t._extraFormat = r._extraFormat), t._separators = r.separators, t._numFormat = k ? k.numberFormat : kZ, delete t._minDtick, delete t._forceTick0; }; var F4 = sr; var bb = Ue; var CZ = Qr.BADNUM; var cv = bb.isArrayOrTypedArray; var LZ = bb.isDateTime; var DZ = bb.cleanNumber; var R4 = Math.round; var P4 = function(t, r, n) { var a = t, i = n.noMultiCategory; if (cv(a) && !a.length) return "-"; if (!i && $Z(a)) return "multicategory"; if (i && Array.isArray(a[0])) { for (var o = [], l = 0; l < a.length; l++) if (cv(a[l])) for (var s = 0; s < a[l].length; s++) o.push(a[l][s]); a = o; } if (RZ(a, r)) return "date"; var u = n.autotypenumbers !== "strict"; return PZ(a, u) ? "category" : FZ(a, u) ? "linear" : "-"; }; function EZ(e10, t) { return t ? F4(e10) : typeof e10 == "number"; } function FZ(e10, t) { for (var r = e10.length, n = 0; n < r; n++) if (EZ(e10[n], t)) return true; return false; } function RZ(e10, t) { for (var r = e10.length, n = $4(r), a = 0, i = 0, o = {}, l = 0; l < r; l += n) { var s = R4(l), u = e10[s], f = String(u); o[f] || (o[f] = 1, LZ(u, t) && a++, F4(u) && i++); } return a > i * 2; } function $4(e10) { return Math.max(1, (e10 - 1) / 1e3); } function PZ(e10, t) { for (var r = e10.length, n = $4(r), a = 0, i = 0, o = {}, l = 0; l < r; l += n) { var s = R4(l), u = e10[s], f = String(u); if (!o[f]) { o[f] = 1; var d = typeof u; d === "boolean" ? i++ : (t ? DZ(u) !== CZ : d === "number") ? a++ : d === "string" && i++; } } return i > a * 2; } function $Z(e10) { return cv(e10[0]) && cv(e10[1]); } var zZ = lr; var z4 = sr; var il = Ue; var Ih = Qr.FP_SAFE; var IZ = Nt; var NZ = Sr; var I4 = gn; var OZ = I4.getFromId; var HZ = I4.isLinked; var Lp = { applyAutorangeOptions: O4, getAutoRange: my, makePadFn: gy, doAutoRange: jZ, findExtremes: UZ, concatExtremes: _b }; function my(e10, t) { var r, n, a = [], i = e10._fullLayout, o = gy(i, t, 0), l = gy(i, t, 1), s = _b(e10, t), u = s.min, f = s.max; if (u.length === 0 || f.length === 0) return il.simpleMap(t.range, t.r2l); var d = u[0].val, h = f[0].val; for (r = 1; r < u.length && d === h; r++) d = Math.min(d, u[r].val); for (r = 1; r < f.length && d === h; r++) h = Math.max(h, f[r].val); var p = t.autorange, v = p === "reversed" || p === "min reversed" || p === "max reversed"; if (!v && t.range) { var m = il.simpleMap(t.range, t.r2l); v = m[1] < m[0]; } t.autorange === "reversed" && (t.autorange = true); var g = t.rangemode, y = g === "tozero", w = g === "nonnegative", k = t._length, x = k / 10, _ = 0, T, S, M, L, F, $; for (r = 0; r < u.length; r++) for (T = u[r], n = 0; n < f.length; n++) S = f[n], $ = S.val - T.val - HT(t, T.val, S.val), $ > 0 && (F = k - o(T) - l(S), F > x ? $ / F > _ && (M = T, L = S, _ = $ / F) : $ / k > _ && (M = { val: T.val, nopad: 1 }, L = { val: S.val, nopad: 1 }, _ = $ / k)); function I(z, P) { return Math.max(z, l(P)); } if (d === h) { var O = d - 1, G = d + 1; if (y) if (d === 0) a = [0, 1]; else { var K = (d > 0 ? f : u).reduce(I, 0), V = d / (1 - Math.min(0.5, K / k)); a = d > 0 ? [0, V] : [V, 0]; } else w ? a = [Math.max(0, O), Math.max(1, G)] : a = [O, G]; } else y ? (M.val >= 0 && (M = { val: 0, nopad: 1 }), L.val <= 0 && (L = { val: 0, nopad: 1 })) : w && (M.val - _ * o(M) < 0 && (M = { val: 0, nopad: 1 }), L.val <= 0 && (L = { val: 1, nopad: 1 })), _ = (L.val - M.val - HT(t, T.val, S.val)) / (k - o(M) - l(L)), a = [ M.val - _ * o(M), L.val + _ * l(L) ]; return a = O4(a, t), t.limitRange && t.limitRange(), v && a.reverse(), il.simpleMap(a, t.l2r || Number); } function HT(e10, t, r) { var n = 0; if (e10.rangebreaks) for (var a = e10.locateBreaks(t, r), i = 0; i < a.length; i++) { var o = a[i]; n += o.max - o.min; } return n; } function gy(e10, t, r) { var n = 0.05 * t._length, a = t._anchorAxis || {}; if ((t.ticklabelposition || "").indexOf("inside") !== -1 || (a.ticklabelposition || "").indexOf("inside") !== -1) { var i = t.isReversed(); if (!i) { var o = il.simpleMap(t.range, t.r2l); i = o[1] < o[0]; } i && (r = !r); } var l = 0; return HZ(e10, t._id) || (l = BZ(e10, t, r)), n = Math.max(l, n), t.constrain === "domain" && t._inputDomain && (n *= (t._inputDomain[1] - t._inputDomain[0]) / (t.domain[1] - t.domain[0])), function(u) { return u.nopad ? 0 : u.pad + (u.extrapad ? n : l); }; } var BT = 3; function BZ(e10, t, r) { var n = 0, a = t._id.charAt(0) === "x"; for (var i in e10._plots) { var o = e10._plots[i]; if (!(t._id !== o.xaxis._id && t._id !== o.yaxis._id)) { var l = (a ? o.yaxis : o.xaxis) || {}; if ((l.ticklabelposition || "").indexOf("inside") !== -1 && (!r && (l.side === "left" || l.side === "bottom") || r && (l.side === "top" || l.side === "right"))) { if (l._vals) { var s = il.deg2rad(l._tickAngles[l._id + "tick"] || 0), u = Math.abs(Math.cos(s)), f = Math.abs(Math.sin(s)); if (!l._vals[0].bb) { var d = l._id + "tick", h = l._selections[d]; h.each(function(w) { var k = zZ.select(this), x = k.select(".text-math-group"); x.empty() && (w.bb = NZ.bBox(k.node())); }); } for (var p = 0; p < l._vals.length; p++) { var v = l._vals[p], m = v.bb; if (m) { var g = 2 * BT + m.width, y = 2 * BT + m.height; n = Math.max( n, a ? Math.max(g * u, y * f) : Math.max(y * u, g * f) ); } } } l.ticks === "inside" && l.ticklabelposition === "inside" && (n += l.ticklen || 0); } } } return n; } function _b(e10, t, r) { var n = t._id, a = e10._fullData, i = e10._fullLayout, o = [], l = [], s, u, f; function d(g, y) { for (s = 0; s < y.length; s++) { var w = g[y[s]], k = (w._extremes || {})[n]; if (w.visible === true && k) { for (u = 0; u < k.min.length; u++) f = k.min[u], yy(o, f.val, f.pad, { extrapad: f.extrapad }); for (u = 0; u < k.max.length; u++) f = k.max[u], by(l, f.val, f.pad, { extrapad: f.extrapad }); } } } if (d(a, t._traceIndices), d(i.annotations || [], t._annIndices || []), d(i.shapes || [], t._shapeIndices || []), t._matchGroup && !r) { for (var h in t._matchGroup) if (h !== t._id) { var p = OZ(e10, h), v = _b(e10, p, true), m = t._length / p._length; for (u = 0; u < v.min.length; u++) f = v.min[u], yy(o, f.val, f.pad * m, { extrapad: f.extrapad }); for (u = 0; u < v.max.length; u++) f = v.max[u], by(l, f.val, f.pad * m, { extrapad: f.extrapad }); } } return { min: o, max: l }; } function jZ(e10, t, r) { if (t.setScale(), t.autorange) { t.range = r ? r.slice() : my(e10, t), t._r = t.range.slice(), t._rl = il.simpleMap(t._r, t.r2l); var n = t._input, a = {}; a[t._attr + ".range"] = t.range, a[t._attr + ".autorange"] = t.autorange, IZ.call("_storeDirectGUIEdit", e10.layout, e10._fullLayout._preGUI, a), n.range = t.range.slice(), n.autorange = t.autorange; } var i = t._anchorAxis; if (i && i.rangeslider) { var o = i.rangeslider[t._name]; o && o.rangemode === "auto" && (o.range = my(e10, t)), i._input.rangeslider[t._name] = il.extendFlat({}, o); } } function UZ(e10, t, r) { r || (r = {}), e10._m || e10.setScale(); var n = [], a = [], i = t.length, o = r.padded || false, l = r.tozero && (e10.type === "linear" || e10.type === "-"), s = e10.type === "log", u = false, f = r.vpadLinearized || false, d, h, p, v, m, g, y, w, k; function x(I) { if (Array.isArray(I)) return u = true, function(G) { return Math.max(Number(I[G] || 0), 0); }; var O = Math.max(Number(I || 0), 0); return function() { return O; }; } var _ = x((e10._m > 0 ? r.ppadplus : r.ppadminus) || r.ppad || 0), T = x((e10._m > 0 ? r.ppadminus : r.ppadplus) || r.ppad || 0), S = x(r.vpadplus || r.vpad), M = x(r.vpadminus || r.vpad); if (!u) { if (w = 1 / 0, k = -1 / 0, s) for (d = 0; d < i; d++) h = t[d], h < w && h > 0 && (w = h), h > k && h < Ih && (k = h); else for (d = 0; d < i; d++) h = t[d], h < w && h > -Ih && (w = h), h > k && h < Ih && (k = h); t = [w, k], i = 2; } var L = { tozero: l, extrapad: o }; function F(I) { p = t[I], z4(p) && (g = _(I), y = T(I), f ? (v = e10.c2l(p) - M(I), m = e10.c2l(p) + S(I)) : (w = p - M(I), k = p + S(I), s && w < k / 10 && (w = k / 10), v = e10.c2l(w), m = e10.c2l(k)), l && (v = Math.min(0, v), m = Math.max(0, m)), jT(v) && yy(n, v, y, L), jT(m) && by(a, m, g, L)); } var $ = Math.min(6, i); for (d = 0; d < $; d++) F(d); for (d = i - 1; d >= $; d--) F(d); return { min: n, max: a, opts: r }; } function yy(e10, t, r, n) { N4(e10, t, r, n, GZ); } function by(e10, t, r, n) { N4(e10, t, r, n, VZ); } function N4(e10, t, r, n, a) { for (var i = n.tozero, o = n.extrapad, l = true, s = 0; s < e10.length && l; s++) { var u = e10[s]; if (a(u.val, t) && u.pad >= r && (u.extrapad || !o)) { l = false; break; } else a(t, u.val) && u.pad <= r && (o || !u.extrapad) && (e10.splice(s, 1), s--); } if (l) { var f = i && t === 0; e10.push({ val: t, pad: f ? 0 : r, extrapad: f ? false : o }); } } function jT(e10) { return z4(e10) && Math.abs(e10) < Ih; } function GZ(e10, t) { return e10 <= t; } function VZ(e10, t) { return e10 >= t; } function qZ(e10, t) { var r = t.autorangeoptions; return r && r.minallowed !== void 0 && dv(t, r.minallowed, r.maxallowed) ? r.minallowed : r && r.clipmin !== void 0 && dv(t, r.clipmin, r.clipmax) ? Math.max(e10, t.d2l(r.clipmin)) : e10; } function WZ(e10, t) { var r = t.autorangeoptions; return r && r.maxallowed !== void 0 && dv(t, r.minallowed, r.maxallowed) ? r.maxallowed : r && r.clipmax !== void 0 && dv(t, r.clipmin, r.clipmax) ? Math.min(e10, t.d2l(r.clipmax)) : e10; } function dv(e10, t, r) { return t !== void 0 && r !== void 0 ? (t = e10.d2l(t), r = e10.d2l(r), t < r) : true; } function O4(e10, t) { if (!t || !t.autorangeoptions) return e10; var r = e10[0], n = e10[1], a = t.autorangeoptions.include; if (a !== void 0) { var i = t.d2l(r), o = t.d2l(n); il.isArrayOrTypedArray(a) || (a = [a]); for (var l = 0; l < a.length; l++) { var s = t.d2l(a[l]); i >= s && (i = s, r = s), o <= s && (o = s, n = s); } } return r = qZ(r, t), n = WZ(n, t), [r, n]; } var Na = lr; var Jr = sr; var bu = Tn; var Tc = Nt; var jt = Ue; var Fu = jt.strTranslate; var Yf = Rn; var ZZ = Cp; var kc = nr; var ya = Sr; var YZ = Ki; var UT = Ap; var Hn = Qr; var XZ = Hn.ONEMAXYEAR; var hv = Hn.ONEAVGYEAR; var _y = Hn.ONEMINYEAR; var KZ = Hn.ONEMAXQUARTER; var xy = Hn.ONEAVGQUARTER; var wy = Hn.ONEMINQUARTER; var JZ = Hn.ONEMAXMONTH; var Ru = Hn.ONEAVGMONTH; var Ty = Hn.ONEMINMONTH; var Ua = Hn.ONEWEEK; var Wn = Hn.ONEDAY; var Xl = Wn / 2; var xo = Hn.ONEHOUR; var vv = Hn.ONEMIN; var ky = Hn.ONESEC; var Kl = Hn.MINUS_SIGN; var Dp = Hn.BADNUM; var Ay = { K: "zeroline" }; var My = { K: "gridline", L: "path" }; var Sy = { K: "minor-gridline", L: "path" }; var H4 = { K: "tick", L: "path" }; var GT = { K: "tick", L: "text" }; var VT = { width: ["x", "r", "l", "xl", "xr"], height: ["y", "t", "b", "yt", "yb"], right: ["r", "xr"], left: ["l", "xl"], top: ["t", "yt"], bottom: ["b", "yb"] }; var Ep = On; var Jd = Ep.MID_SHIFT; var Jl = Ep.CAP_SHIFT; var pv = Ep.LINE_SPACING; var QZ = Ep.OPPOSITE_SIDE; var mv = 3; var Ye = r4.exports = {}; Ye.setConvert = yb; var eY = P4; var Eo = gn; var tY = Eo.idSort; var rY = Eo.isLinked; Ye.id2name = Eo.id2name; Ye.name2id = Eo.name2id; Ye.cleanId = Eo.cleanId; Ye.list = Eo.list; Ye.listIds = Eo.listIds; Ye.getFromId = Eo.getFromId; Ye.getFromTrace = Eo.getFromTrace; var B4 = Lp; Ye.getAutoRange = B4.getAutoRange; Ye.findExtremes = B4.findExtremes; var nY = 1e-4; function xb(e10) { var t = (e10[1] - e10[0]) * nY; return [ e10[0] - t, e10[1] + t ]; } Ye.coerceRef = function(e10, t, r, n, a, i) { var o = n.charAt(n.length - 1), l = r._fullLayout._subplots[o + "axis"], s = n + "ref", u = {}; return a || (a = l[0] || (typeof i == "string" ? i : i[0])), i || (i = a), l = l.concat(l.map(function(f) { return f + " domain"; })), u[s] = { valType: "enumerated", values: l.concat(i ? typeof i == "string" ? [i] : i : []), dflt: a }, jt.coerce(e10, t, u, s); }; Ye.getRefType = function(e10) { return e10 === void 0 ? e10 : e10 === "paper" ? "paper" : e10 === "pixel" ? "pixel" : /( domain)$/.test(e10) ? "domain" : "range"; }; Ye.coercePosition = function(e10, t, r, n, a, i) { var o, l, s = Ye.getRefType(n); if (s !== "range") o = jt.ensureNumber, l = r(a, i); else { var u = Ye.getFromId(t, n); i = u.fraction2r(i), l = r(a, i), o = u.cleanPos; } e10[a] = o(l); }; Ye.cleanPosition = function(e10, t, r) { var n = r === "paper" || r === "pixel" ? jt.ensureNumber : Ye.getFromId(t, r).cleanPos; return n(e10); }; Ye.redrawComponents = function(e10, t) { t = t || Ye.listIds(e10); var r = e10._fullLayout; function n(a, i, o, l) { for (var s = Tc.getComponentMethod(a, i), u = {}, f = 0; f < t.length; f++) for (var d = r[Ye.id2name(t[f])], h = d[o], p = 0; p < h.length; p++) { var v = h[p]; if (!u[v] && (s(e10, v), u[v] = 1, l)) return; } } n("annotations", "drawOne", "_annIndices"), n("shapes", "drawOne", "_shapeIndices"), n("images", "draw", "_imgIndices", true), n("selections", "drawOne", "_selectionIndices"); }; var aY = Ye.getDataConversions = function(e10, t, r, n) { var a, i = r === "x" || r === "y" || r === "z" ? r : n; if (jt.isArrayOrTypedArray(i)) { if (a = { type: eY(n, void 0, { autotypenumbers: e10._fullLayout.autotypenumbers }), _categories: [] }, Ye.setConvert(a), a.type === "category") for (var o = 0; o < n.length; o++) a.d2c(n[o]); } else a = Ye.getFromTrace(e10, t, i); return a ? { d2c: a.d2c, c2d: a.c2d } : i === "ids" ? { d2c: WT, c2d: WT } : { d2c: qT, c2d: qT }; }; function qT(e10) { return +e10; } function WT(e10) { return String(e10); } Ye.getDataToCoordFunc = function(e10, t, r, n) { return aY(e10, t, r, n).d2c; }; Ye.counterLetter = function(e10) { var t = e10.charAt(0); if (t === "x") return "y"; if (t === "y") return "x"; }; Ye.minDtick = function(e10, t, r, n) { ["log", "category", "multicategory"].indexOf(e10.type) !== -1 || !n ? e10._minDtick = 0 : e10._minDtick === void 0 ? (e10._minDtick = t, e10._forceTick0 = r) : e10._minDtick && ((e10._minDtick / t + 1e-6) % 1 < 2e-6 && // existing minDtick is an integer multiple of newDiff // (within rounding err) // and forceTick0 can be shifted to newFirst ((r - e10._forceTick0) / t % 1 + 1.000001) % 1 < 2e-6 ? (e10._minDtick = t, e10._forceTick0 = r) : ((t / e10._minDtick + 1e-6) % 1 > 2e-6 || // if the converse is true (newDiff is a multiple of minDtick and // newFirst can be shifted to forceTick0) then do nothing - same // forcing stands. Otherwise, cancel forced minimum ((r - e10._forceTick0) / e10._minDtick % 1 + 1.000001) % 1 > 2e-6) && (e10._minDtick = 0)); }; Ye.saveRangeInitial = function(e10, t) { for (var r = Ye.list(e10, "", true), n = false, a = 0; a < r.length; a++) { var i = r[a], o = i._rangeInitial0 === void 0 && i._rangeInitial1 === void 0, l = o || i.range[0] !== i._rangeInitial0 || i.range[1] !== i._rangeInitial1, s = i.autorange; (o && s !== true || t && l) && (i._rangeInitial0 = s === "min" || s === "max reversed" ? void 0 : i.range[0], i._rangeInitial1 = s === "max" || s === "min reversed" ? void 0 : i.range[1], i._autorangeInitial = s, n = true); } return n; }; Ye.saveShowSpikeInitial = function(e10, t) { for (var r = Ye.list(e10, "", true), n = false, a = "on", i = 0; i < r.length; i++) { var o = r[i], l = o._showSpikeInitial === void 0, s = l || o.showspikes !== o._showspikes; (l || t && s) && (o._showSpikeInitial = o.showspikes, n = true), a === "on" && !o.showspikes && (a = "off"); } return e10._fullLayout._cartesianSpikesEnabled = a, n; }; Ye.autoBin = function(e10, t, r, n, a, i) { var o = jt.aggNums(Math.min, null, e10), l = jt.aggNums(Math.max, null, e10); if (t.type === "category" || t.type === "multicategory") return { start: o - 0.5, end: l + 0.5, size: Math.max(1, Math.round(i) || 1), _dataSpan: l - o }; a || (a = t.calendar); var s; if (t.type === "log" ? s = { type: "linear", range: [o, l] } : s = { type: t.type, range: jt.simpleMap([o, l], t.c2r, 0, a), calendar: a }, Ye.setConvert(s), i = i && UT.dtick(i, s.type), i) s.dtick = i, s.tick0 = UT.tick0(void 0, s.type, a); else { var u; if (r) u = (l - o) / r; else { var f = jt.distinctVals(e10), d = Math.pow(10, Math.floor( Math.log(f.minDiff) / Math.LN10 )), h = d * jt.roundUp( f.minDiff / d, [0.9, 1.9, 4.9, 9.9], true ); u = Math.max(h, 2 * jt.stdev(e10) / Math.pow(e10.length, n ? 0.25 : 0.4)), Jr(u) || (u = 1); } Ye.autoTicks(s, u); } var p = s.dtick, v = Ye.tickIncrement( Ye.tickFirst(s), p, "reverse", a ), m, g; if (typeof p == "number") v = iY(v, e10, s, o, l), g = 1 + Math.floor((l - v) / p), m = v + g * p; else for (s.dtick.charAt(0) === "M" && (v = oY(v, e10, p, o, a)), m = v, g = 0; m <= l; ) m = Ye.tickIncrement(m, p, false, a), g++; return { start: t.c2r(v, 0, a), end: t.c2r(m, 0, a), size: p, _dataSpan: l - o }; }; function iY(e10, t, r, n, a) { var i = 0, o = 0, l = 0, s = 0; function u(p) { return (1 + (p - e10) * 100 / r.dtick) % 100 < 2; } for (var f = 0; f < t.length; f++) t[f] % 1 === 0 ? l++ : Jr(t[f]) || s++, u(t[f]) && i++, u(t[f] + r.dtick / 2) && o++; var d = t.length - s; if (l === d && r.type !== "date") r.dtick < 1 ? e10 = n - 0.5 * r.dtick : (e10 -= 0.5, e10 + r.dtick < n && (e10 += r.dtick)); else if (o < d * 0.1 && (i > d * 0.3 || u(n) || u(a))) { var h = r.dtick / 2; e10 += e10 + h < n ? h : -h; } return e10; } function oY(e10, t, r, n, a) { var i = jt.findExactDates(t, a), o = 0.8; if (i.exactDays > o) { var l = Number(r.substr(1)); i.exactYears > o && l % 12 === 0 ? e10 = Ye.tickIncrement(e10, "M6", "reverse") + Wn * 1.5 : i.exactMonths > o ? e10 = Ye.tickIncrement(e10, "M1", "reverse") + Wn * 15.5 : e10 -= Xl; var s = Ye.tickIncrement(e10, r); if (s <= n) return s; } return e10; } Ye.prepMinorTicks = function(e10, t, r) { if (!t.minor.dtick) { delete e10.dtick; var n = t.dtick && Jr(t._tmin), a; if (n) { var i = Ye.tickIncrement(t._tmin, t.dtick, true); a = [t._tmin, i * 0.99 + t._tmin * 0.01]; } else { var o = jt.simpleMap(t.range, t.r2l); a = [o[0], 0.8 * o[0] + 0.2 * o[1]]; } if (e10.range = jt.simpleMap(a, t.l2r), e10._isMinor = true, Ye.prepTicks(e10, r), n) { var l = Jr(t.dtick), s = Jr(e10.dtick), u = l ? t.dtick : +t.dtick.substring(1), f = s ? e10.dtick : +e10.dtick.substring(1); l && s ? hg(u, f) ? u === 2 * Ua && f === 2 * Wn && (e10.dtick = Ua) : u === 2 * Ua && f === 3 * Wn ? e10.dtick = Ua : u === Ua && !(t._input.minor || {}).nticks ? e10.dtick = Wn : ZT(u / f, 2.5) ? e10.dtick = u / 2 : e10.dtick = u : String(t.dtick).charAt(0) === "M" ? s ? e10.dtick = "M1" : hg(u, f) ? u >= 12 && f === 2 && (e10.dtick = "M3") : e10.dtick = t.dtick : String(e10.dtick).charAt(0) === "L" ? String(t.dtick).charAt(0) === "L" ? hg(u, f) || (e10.dtick = ZT(u / f, 2.5) ? t.dtick / 2 : t.dtick) : e10.dtick = "D1" : e10.dtick === "D2" && +t.dtick > 1 && (e10.dtick = 1); } e10.range = t.range; } t.minor._tick0Init === void 0 && (e10.tick0 = t.tick0); }; function hg(e10, t) { return Math.abs((e10 / t + 0.5) % 1 - 0.5) < 1e-3; } function ZT(e10, t) { return Math.abs(e10 / t - 1) < 1e-3; } Ye.prepTicks = function(e10, t) { var r = jt.simpleMap(e10.range, e10.r2l, void 0, void 0, t); if (e10.tickmode === "auto" || !e10.dtick) { var n = e10.nticks, a; n || (e10.type === "category" || e10.type === "multicategory" ? (a = e10.tickfont ? jt.bigFont(e10.tickfont.size || 12) : 15, n = e10._length / a) : (a = e10._id.charAt(0) === "y" ? 40 : 80, n = jt.constrain(e10._length / a, 4, 9) + 1), e10._name === "radialaxis" && (n *= 2)), e10.minor && e10.minor.tickmode !== "array" || e10.tickmode === "array" && (n *= 100), e10._roughDTick = Math.abs(r[1] - r[0]) / n, Ye.autoTicks(e10, e10._roughDTick), e10._minDtick > 0 && e10.dtick < e10._minDtick * 2 && (e10.dtick = e10._minDtick, e10.tick0 = e10.l2r(e10._forceTick0)); } e10.ticklabelmode === "period" && lY(e10), e10.tick0 || (e10.tick0 = e10.type === "date" ? "2000-01-01" : 0), e10.type === "date" && e10.dtick < 0.1 && (e10.dtick = 0.1), V4(e10); }; function vg(e10) { return +e10.substring(1); } function lY(e10) { var t; function r() { return !(Jr(e10.dtick) || e10.dtick.charAt(0) !== "M"); } var n = r(), a = Ye.getTickFormat(e10); if (a) { var i = e10._dtickInit !== e10.dtick; /%[fLQsSMX]/.test(a) || (/%[HI]/.test(a) ? (t = xo, i && !n && e10.dtick < xo && (e10.dtick = xo)) : /%p/.test(a) ? (t = Xl, i && !n && e10.dtick < Xl && (e10.dtick = Xl)) : /%[Aadejuwx]/.test(a) ? (t = Wn, i && !n && e10.dtick < Wn && (e10.dtick = Wn)) : /%[UVW]/.test(a) ? (t = Ua, i && !n && e10.dtick < Ua && (e10.dtick = Ua)) : /%[Bbm]/.test(a) ? (t = Ru, i && (n ? vg(e10.dtick) < 1 : e10.dtick < Ty) && (e10.dtick = "M1")) : /%[q]/.test(a) ? (t = xy, i && (n ? vg(e10.dtick) < 3 : e10.dtick < wy) && (e10.dtick = "M3")) : /%[Yy]/.test(a) && (t = hv, i && (n ? vg(e10.dtick) < 12 : e10.dtick < _y) && (e10.dtick = "M12"))); } n = r(), n && e10.tick0 === e10._dowTick0 && (e10.tick0 = e10._rawTick0), e10._definedDelta = t; } function sY(e10, t, r) { for (var n = 0; n < e10.length; n++) { var a = e10[n].value, i = n, o = n + 1; n < e10.length - 1 ? (i = n, o = n + 1) : n > 0 ? (i = n - 1, o = n) : (i = n, o = n); var l = e10[i].value, s = e10[o].value, u = Math.abs(s - l), f = r || u, d = 0; f >= _y ? u >= _y && u <= XZ ? d = u : d = hv : r === xy && f >= wy ? u >= wy && u <= KZ ? d = u : d = xy : f >= Ty ? u >= Ty && u <= JZ ? d = u : d = Ru : r === Ua && f >= Ua ? d = Ua : f >= Wn ? d = Wn : r === Xl && f >= Xl ? d = Xl : r === xo && f >= xo && (d = xo); var h; d >= u && (d = u, h = true); var p = a + d; if (t.rangebreaks && d > 0) { for (var v = 84, m = 0, g = 0; g < v; g++) { var y = (g + 0.5) / v; t.maskBreaks(a * (1 - y) + y * p) !== Dp && m++; } d *= m / v, d || (e10[n].drop = true), h && u > Ua && (d = u); } (d > 0 || // not instant n === 0) && (e10[n].periodX = a + d / 2); } } Ye.calcTicks = function(t, r) { for (var n = t.type, a = t.calendar, i = t.ticklabelstep, o = t.ticklabelmode === "period", l = jt.simpleMap(t.range, t.r2l, void 0, void 0, r), s = l[1] < l[0], u = Math.min(l[0], l[1]), f = Math.max(l[0], l[1]), d = Math.max(1e3, t._length || 0), h = [], p = [], v = [], m = [], g = t.minor && (t.minor.ticks || t.minor.showgrid), y = 1; y >= (g ? 0 : 1); y--) { var w = !y; y ? (t._dtickInit = t.dtick, t._tick0Init = t.tick0) : (t.minor._dtickInit = t.minor.dtick, t.minor._tick0Init = t.minor.tick0); var k = y ? t : jt.extendFlat({}, t, t.minor); if (w ? Ye.prepMinorTicks(k, t, r) : Ye.prepTicks(k, r), k.tickmode === "array") { y ? (v = [], h = YT(t, !w)) : (m = [], p = YT(t, !w)); continue; } if (k.tickmode === "sync") { v = [], h = uY(t); continue; } var x = xb(l), _ = x[0], T = x[1], S = Jr(k.dtick), M = n === "log" && !(S || k.dtick.charAt(0) === "L"), L = Ye.tickFirst(k, r); if (y) { if (t._tmin = L, L < _ !== s) break; (n === "category" || n === "multicategory") && (T = s ? Math.max(-0.5, T) : Math.min(t._categories.length - 0.5, T)); } var F = null, $ = L, I; if (y) { var O; S ? O = t.dtick : n === "date" ? typeof t.dtick == "string" && t.dtick.charAt(0) === "M" && (O = Ru * t.dtick.substring(1)) : O = t._roughDTick, I = Math.round((t.r2l($) - t.r2l(t.tick0)) / O) - 1; } var G = k.dtick; for (k.rangebreaks && k._tick0Init !== k.tick0 && ($ = pg($, t), s || ($ = Ye.tickIncrement($, G, !s, a))), y && o && ($ = Ye.tickIncrement($, G, !s, a), I--); s ? $ >= T : $ <= T; $ = Ye.tickIncrement( $, G, s, a )) { if (y && I++, k.rangebreaks && !s) { if ($ < _) continue; if (k.maskBreaks($) === Dp && pg($, k) >= f) break; } if (v.length > d || $ === F) break; F = $; var K = { value: $ }; y ? (M && $ !== ($ | 0) && (K.simpleLabel = true), i > 1 && I % i && (K.skipLabel = true), v.push(K)) : (K.minor = true, m.push(K)); } } if (g) { var V = t.minor.ticks === "inside" && t.ticks === "outside" || t.minor.ticks === "outside" && t.ticks === "inside"; if (!V) { for (var z = v.map(function(ve) { return ve.value; }), P = [], R = 0; R < m.length; R++) { var H = m[R], B = H.value; if (z.indexOf(B) === -1) { for (var W = false, ee = 0; !W && ee < v.length; ee++) 1e7 + v[ee].value === 1e7 + B && (W = true); W || P.push(H); } } m = P; } } o && sY(v, t, t._definedDelta); var re; if (t.rangebreaks) { var ae = t._id.charAt(0) === "y", Q = 1; t.tickmode === "auto" && (Q = t.tickfont ? t.tickfont.size : 12); var ue = NaN; for (re = v.length - 1; re > -1; re--) { if (v[re].drop) { v.splice(re, 1); continue; } v[re].value = pg(v[re].value, t); var j = t.c2p(v[re].value); (ae ? ue > j - Q : ue < j + Q) ? v.splice(s ? re + 1 : re, 1) : ue = j; } } Ab(t) && Math.abs(l[1] - l[0]) === 360 && v.pop(), t._tmax = (v[v.length - 1] || {}).value, t._prevDateHead = "", t._inCalcTicks = true; var U, Z = function(ve) { ve.text = "", t._prevDateHead = U; }; v = v.concat(m); var le, J; for (re = 0; re < v.length; re++) { var pe = v[re].minor, ge = v[re].value; pe ? p.push({ x: ge, minor: true }) : (U = t._prevDateHead, le = Ye.tickText( t, ge, false, // hover v[re].simpleLabel // noSuffixPrefix ), J = v[re].periodX, J !== void 0 && (le.periodX = J, (J > f || J < u) && (J > f && (le.periodX = f), J < u && (le.periodX = u), Z(le))), v[re].skipLabel && Z(le), h.push(le)); } return h = h.concat(p), t._inCalcTicks = false, o && h.length && (h[0].noTick = true), h; }; function j4(e10, t) { return e10.rangebreaks && (t = t.filter(function(r) { return e10.maskBreaks(r.x) !== Dp; })), t; } function uY(e10) { var t = e10._mainAxis, r = []; if (t._vals) { for (var n = 0; n < t._vals.length; n++) if (!t._vals[n].noTick) { var a = t.l2p(t._vals[n].x), i = e10.p2l(a), o = Ye.tickText(e10, i); t._vals[n].minor && (o.minor = true, o.text = ""), r.push(o); } } return r = j4(e10, r), r; } function YT(e10, t) { var r = jt.simpleMap(e10.range, e10.r2l), n = xb(r), a = Math.min(n[0], n[1]), i = Math.max(n[0], n[1]), o = e10.type === "category" ? e10.d2l_noadd : e10.d2l; e10.type === "log" && String(e10.dtick).charAt(0) !== "L" && (e10.dtick = "L" + Math.pow(10, Math.floor(Math.min(e10.range[0], e10.range[1])) - 1)); for (var l = [], s = 0; s <= 1; s++) if (!(t !== void 0 && (t && s || t === false && !s)) && !(s && !e10.minor)) { var u = s ? e10.minor.tickvals : e10.tickvals, f = s ? [] : e10.ticktext; if (u) { jt.isArrayOrTypedArray(f) || (f = []); for (var d = 0; d < u.length; d++) { var h = o(u[d]); if (h > a && h < i) { var p = f[d] === void 0 ? Ye.tickText(e10, h) : wb(e10, h, String(f[d])); s && (p.minor = true, p.text = ""), l.push(p); } } } } return l = j4(e10, l), l; } var Qd = [2, 5, 10]; var XT = [1, 2, 3, 6, 12]; var KT = [1, 2, 5, 10, 15, 30]; var fY = [1, 2, 3, 7, 14]; var U4 = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1]; var G4 = [-0.301, 0, 0.301, 0.699, 1]; var cY = [15, 30, 45, 90, 180]; function Ci(e10, t, r) { return t * jt.roundUp(e10 / t, r); } Ye.autoTicks = function(e10, t, r) { var n; function a(d) { return Math.pow(d, Math.floor(Math.log(t) / Math.LN10)); } if (e10.type === "date") { e10.tick0 = jt.dateTick0(e10.calendar, 0); var i = 2 * t; if (i > hv) t /= hv, n = a(10), e10.dtick = "M" + 12 * Ci(t, n, Qd); else if (i > Ru) t /= Ru, e10.dtick = "M" + Ci(t, 1, XT); else if (i > Wn) { if (e10.dtick = Ci(t, Wn, e10._hasDayOfWeekBreaks ? [1, 2, 7, 14] : fY), !r) { var o = Ye.getTickFormat(e10), l = e10.ticklabelmode === "period"; l && (e10._rawTick0 = e10.tick0), /%[uVW]/.test(o) ? e10.tick0 = jt.dateTick0(e10.calendar, 2) : e10.tick0 = jt.dateTick0(e10.calendar, 1), l && (e10._dowTick0 = e10.tick0); } } else i > xo ? e10.dtick = Ci(t, xo, XT) : i > vv ? e10.dtick = Ci(t, vv, KT) : i > ky ? e10.dtick = Ci(t, ky, KT) : (n = a(10), e10.dtick = Ci(t, n, Qd)); } else if (e10.type === "log") { e10.tick0 = 0; var s = jt.simpleMap(e10.range, e10.r2l); if (e10._isMinor && (t *= 1.5), t > 0.7) e10.dtick = Math.ceil(t); else if (Math.abs(s[1] - s[0]) < 1) { var u = 1.5 * Math.abs((s[1] - s[0]) / t); t = Math.abs(Math.pow(10, s[1]) - Math.pow(10, s[0])) / u, n = a(10), e10.dtick = "L" + Ci(t, n, Qd); } else e10.dtick = t > 0.3 ? "D2" : "D1"; } else e10.type === "category" || e10.type === "multicategory" ? (e10.tick0 = 0, e10.dtick = Math.ceil(Math.max(t, 1))) : Ab(e10) ? (e10.tick0 = 0, n = 1, e10.dtick = Ci(t, n, cY)) : (e10.tick0 = 0, n = a(10), e10.dtick = Ci(t, n, Qd)); if (e10.dtick === 0 && (e10.dtick = 1), !Jr(e10.dtick) && typeof e10.dtick != "string") { var f = e10.dtick; throw e10.dtick = 1, "ax.dtick error: " + String(f); } }; function V4(e10) { var t = e10.dtick; if (e10._tickexponent = 0, !Jr(t) && typeof t != "string" && (t = 1), (e10.type === "category" || e10.type === "multicategory") && (e10._tickround = null), e10.type === "date") { var r = e10.r2l(e10.tick0), n = e10.l2r(r).replace(/(^-|i)/g, ""), a = n.length; if (String(t).charAt(0) === "M") a > 10 || n.substr(5) !== "01-01" ? e10._tickround = "d" : e10._tickround = +t.substr(1) % 12 === 0 ? "y" : "m"; else if (t >= Wn && a <= 10 || t >= Wn * 15) e10._tickround = "d"; else if (t >= vv && a <= 16 || t >= xo) e10._tickround = "M"; else if (t >= ky && a <= 19 || t >= vv) e10._tickround = "S"; else { var i = e10.l2r(r + t).replace(/^-/, "").length; e10._tickround = Math.max(a, i) - 20, e10._tickround < 0 && (e10._tickround = 4); } } else if (Jr(t) || t.charAt(0) === "L") { var o = e10.range.map(e10.r2d || Number); Jr(t) || (t = Number(t.substr(1))), e10._tickround = 2 - Math.floor(Math.log(t) / Math.LN10 + 0.01); var l = Math.max(Math.abs(o[0]), Math.abs(o[1])), s = Math.floor(Math.log(l) / Math.LN10 + 0.01), u = e10.minexponent === void 0 ? 3 : e10.minexponent; Math.abs(s) > u && (gv(e10.exponentformat) && !Tb(s) ? e10._tickexponent = 3 * Math.round((s - 1) / 3) : e10._tickexponent = s); } else e10._tickround = null; } Ye.tickIncrement = function(e10, t, r, n) { var a = r ? -1 : 1; if (Jr(t)) return jt.increment(e10, a * t); var i = t.charAt(0), o = a * Number(t.substr(1)); if (i === "M") return jt.incrementMonth(e10, o, n); if (i === "L") return Math.log(Math.pow(10, e10) + o) / Math.LN10; if (i === "D") { var l = t === "D2" ? G4 : U4, s = e10 + a * 0.01, u = jt.roundUp(jt.mod(s, 1), l, r); return Math.floor(s) + Math.log(Na.round(Math.pow(10, u), 1)) / Math.LN10; } throw "unrecognized dtick " + String(t); }; Ye.tickFirst = function(e10, t) { var r = e10.r2l || Number, n = jt.simpleMap(e10.range, r, void 0, void 0, t), a = n[1] < n[0], i = a ? Math.floor : Math.ceil, o = xb(n)[0], l = e10.dtick, s = r(e10.tick0); if (Jr(l)) { var u = i((o - s) / l) * l + s; return (e10.type === "category" || e10.type === "multicategory") && (u = jt.constrain(u, 0, e10._categories.length - 1)), u; } var f = l.charAt(0), d = Number(l.substr(1)); if (f === "M") { for (var h = 0, p = s, v, m, g; h < 10; ) { if (v = Ye.tickIncrement(p, l, a, e10.calendar), (v - o) * (p - o) <= 0) return a ? Math.min(p, v) : Math.max(p, v); m = (o - (p + v) / 2) / (v - p), g = f + (Math.abs(Math.round(m)) || 1) * d, p = Ye.tickIncrement(p, g, m < 0 ? !a : a, e10.calendar), h++; } return jt.error("tickFirst did not converge", e10), p; } else { if (f === "L") return Math.log(i( (Math.pow(10, o) - s) / d ) * d + s) / Math.LN10; if (f === "D") { var y = l === "D2" ? G4 : U4, w = jt.roundUp(jt.mod(o, 1), y, a); return Math.floor(o) + Math.log(Na.round(Math.pow(10, w), 1)) / Math.LN10; } else throw "unrecognized dtick " + String(l); } }; Ye.tickText = function(e10, t, r, n) { var a = wb(e10, t), i = e10.tickmode === "array", o = r || i, l = e10.type, s = l === "category" ? e10.d2l_noadd : e10.d2l, u; if (i && jt.isArrayOrTypedArray(e10.ticktext)) { var f = jt.simpleMap(e10.range, e10.r2l), d = (Math.abs(f[1] - f[0]) - (e10._lBreaks || 0)) / 1e4; for (u = 0; u < e10.ticktext.length && !(Math.abs(t - s(e10.tickvals[u])) < d); u++) ; if (u < e10.ticktext.length) return a.text = String(e10.ticktext[u]), a; } function h(g) { if (g === void 0) return true; if (r) return g === "none"; var y = { first: e10._tmin, last: e10._tmax }[g]; return g !== "all" && t !== y; } var p = r ? "never" : e10.exponentformat !== "none" && h(e10.showexponent) ? "hide" : ""; if (l === "date" ? dY(e10, a, r, o) : l === "log" ? hY(e10, a, r, o, p) : l === "category" ? vY(e10, a) : l === "multicategory" ? pY(e10, a, r) : Ab(e10) ? gY(e10, a, r, o, p) : mY(e10, a, r, o, p), n || (e10.tickprefix && !h(e10.showtickprefix) && (a.text = e10.tickprefix + a.text), e10.ticksuffix && !h(e10.showticksuffix) && (a.text += e10.ticksuffix)), e10.labelalias && e10.labelalias.hasOwnProperty(a.text)) { var v = e10.labelalias[a.text]; typeof v == "string" && (a.text = v); } if (e10.tickson === "boundaries" || e10.showdividers) { var m = function(g) { var y = e10.l2p(g); return y >= 0 && y <= e10._length ? g : null; }; a.xbnd = [ m(a.x - 0.5), m(a.x + e10.dtick - 0.5) ]; } return a; }; Ye.hoverLabelText = function(e10, t, r) { r && (e10 = jt.extendFlat({}, e10, { hoverformat: r })); var n = jt.isArrayOrTypedArray(t) ? t[0] : t, a = jt.isArrayOrTypedArray(t) ? t[1] : void 0; if (a !== void 0 && a !== n) return Ye.hoverLabelText(e10, n, r) + " - " + Ye.hoverLabelText(e10, a, r); var i = e10.type === "log" && n <= 0, o = Ye.tickText(e10, e10.c2l(i ? -n : n), "hover").text; return i ? n === 0 ? "0" : Kl + o : o; }; function wb(e10, t, r) { var n = e10.tickfont || {}; return { x: t, dx: 0, dy: 0, text: r || "", fontSize: n.size, font: n.family, fontColor: n.color }; } function dY(e10, t, r, n) { var a = e10._tickround, i = r && e10.hoverformat || Ye.getTickFormat(e10); n = !i && n, n && (Jr(a) ? a = 4 : a = { y: "m", m: "d", d: "M", M: "S", S: 4 }[a]); var o = jt.formatDate(t.x, i, a, e10._dateFormat, e10.calendar, e10._extraFormat), l, s = o.indexOf(` `); if (s !== -1 && (l = o.substr(s + 1), o = o.substr(0, s)), n && (l !== void 0 && (o === "00:00:00" || o === "00:00") ? (o = l, l = "") : o.length === 8 && (o = o.replace(/:00$/, ""))), l) if (r) a === "d" ? o += ", " + l : o = l + (o ? ", " + o : ""); else if (!e10._inCalcTicks || e10._prevDateHead !== l) e10._prevDateHead = l, o += "
" + l; else { var u = Mc(e10), f = e10._trueSide || e10.side; (!u && f === "top" || u && f === "bottom") && (o += "
"); } t.text = o; } function hY(e10, t, r, n, a) { var i = e10.dtick, o = t.x, l = e10.tickformat, s = typeof i == "string" && i.charAt(0); if (a === "never" && (a = ""), n && s !== "L" && (i = "L3", s = "L"), l || s === "L") t.text = Ac(Math.pow(10, o), e10, a, n); else if (Jr(i) || s === "D" && jt.mod(o + 0.01, 1) < 0.1) { var u = Math.round(o), f = Math.abs(u), d = e10.exponentformat; d === "power" || gv(d) && Tb(u) ? (u === 0 ? t.text = 1 : u === 1 ? t.text = "10" : t.text = "10" + (u > 1 ? "" : Kl) + f + "", t.fontSize *= 1.25) : (d === "e" || d === "E") && f > 2 ? t.text = "1" + d + (u > 0 ? "+" : Kl) + f : (t.text = Ac(Math.pow(10, o), e10, "", "fakehover"), i === "D1" && e10._id.charAt(0) === "y" && (t.dy -= t.fontSize / 6)); } else if (s === "D") t.text = String(Math.round(Math.pow(10, jt.mod(o, 1)))), t.fontSize *= 0.75; else throw "unrecognized dtick " + String(i); if (e10.dtick === "D1") { var h = String(t.text).charAt(0); (h === "0" || h === "1") && (e10._id.charAt(0) === "y" ? t.dx -= t.fontSize / 4 : (t.dy += t.fontSize / 2, t.dx += (e10.range[1] > e10.range[0] ? 1 : -1) * t.fontSize * (o < 0 ? 0.5 : 0.25))); } } function vY(e10, t) { var r = e10._categories[Math.round(t.x)]; r === void 0 && (r = ""), t.text = String(r); } function pY(e10, t, r) { var n = Math.round(t.x), a = e10._categories[n] || [], i = a[1] === void 0 ? "" : String(a[1]), o = a[0] === void 0 ? "" : String(a[0]); r ? t.text = o + " - " + i : (t.text = i, t.text2 = o); } function mY(e10, t, r, n, a) { a === "never" ? a = "" : e10.showexponent === "all" && Math.abs(t.x / e10.dtick) < 1e-6 && (a = "hide"), t.text = Ac(t.x, e10, a, n); } function gY(e10, t, r, n, a) { if (e10.thetaunit === "radians" && !r) { var i = t.x / 180; if (i === 0) t.text = "0"; else { var o = yY(i); if (o[1] >= 100) t.text = Ac(jt.deg2rad(t.x), e10, a, n); else { var l = t.x < 0; o[1] === 1 ? o[0] === 1 ? t.text = "π" : t.text = o[0] + "π" : t.text = [ "", o[0], "", "⁄", "", o[1], "", "π" ].join(""), l && (t.text = Kl + t.text); } } } else t.text = Ac(t.x, e10, a, n); } function yY(e10) { function t(l, s) { return Math.abs(l - s) <= 1e-6; } function r(l, s) { return t(s, 0) ? l : r(s, l % s); } function n(l) { for (var s = 1; !t(Math.round(l * s) / s, l); ) s *= 10; return s; } var a = n(e10), i = e10 * a, o = Math.abs(r(i, a)); return [ // numerator Math.round(i / o), // denominator Math.round(a / o) ]; } var bY = ["f", "p", "n", "μ", "m", "", "k", "M", "G", "T"]; function gv(e10) { return e10 === "SI" || e10 === "B"; } function Tb(e10) { return e10 > 14 || e10 < -15; } function Ac(e10, t, r, n) { var a = e10 < 0, i = t._tickround, o = r || t.exponentformat || "B", l = t._tickexponent, s = Ye.getTickFormat(t), u = t.separatethousands; if (n) { var f = { exponentformat: o, minexponent: t.minexponent, dtick: t.showexponent === "none" ? t.dtick : Jr(e10) && Math.abs(e10) || 1, // if not showing any exponents, don't change the exponent // from what we calculate range: t.showexponent === "none" ? t.range.map(t.r2d) : [0, e10 || 1] }; V4(f), i = (Number(f._tickround) || 0) + 4, l = f._tickexponent, t.hoverformat && (s = t.hoverformat); } if (s) return t._numFormat(s)(e10).replace(/-/g, Kl); var d = Math.pow(10, -i) / 2; if (o === "none" && (l = 0), e10 = Math.abs(e10), e10 < d) e10 = "0", a = false; else { if (e10 += d, l && (e10 *= Math.pow(10, -l), i += l), i === 0) e10 = String(Math.floor(e10)); else if (i < 0) { e10 = String(Math.round(e10)), e10 = e10.substr(0, e10.length + i); for (var h = i; h < 0; h++) e10 += "0"; } else { e10 = String(e10); var p = e10.indexOf(".") + 1; p && (e10 = e10.substr(0, p + i).replace(/\.?0+$/, "")); } e10 = jt.numSeparate(e10, t._separators, u); } if (l && o !== "hide") { gv(o) && Tb(l) && (o = "power"); var v; l < 0 ? v = Kl + -l : o !== "power" ? v = "+" + l : v = String(l), o === "e" || o === "E" ? e10 += o + v : o === "power" ? e10 += "×10" + v + "" : o === "B" && l === 9 ? e10 += "B" : gv(o) && (e10 += bY[l / 3 + 5]); } return a ? Kl + e10 : e10; } Ye.getTickFormat = function(e10) { var t; function r(s) { return typeof s != "string" ? s : Number(s.replace("M", "")) * Ru; } function n(s, u) { var f = ["L", "D"]; if (typeof s == typeof u) { if (typeof s == "number") return s - u; var d = f.indexOf(s.charAt(0)), h = f.indexOf(u.charAt(0)); return d === h ? Number(s.replace(/(L|D)/g, "")) - Number(u.replace(/(L|D)/g, "")) : d - h; } else return typeof s == "number" ? 1 : -1; } function a(s, u, f) { var d = f || function(v) { return v; }, h = u[0], p = u[1]; return (!h && typeof h != "number" || d(h) <= d(s)) && (!p && typeof p != "number" || d(p) >= d(s)); } function i(s, u) { var f = u[0] === null, d = u[1] === null, h = n(s, u[0]) >= 0, p = n(s, u[1]) <= 0; return (f || h) && (d || p); } var o, l; if (e10.tickformatstops && e10.tickformatstops.length > 0) switch (e10.type) { case "date": case "linear": { for (t = 0; t < e10.tickformatstops.length; t++) if (l = e10.tickformatstops[t], l.enabled && a(e10.dtick, l.dtickrange, r)) { o = l; break; } break; } case "log": { for (t = 0; t < e10.tickformatstops.length; t++) if (l = e10.tickformatstops[t], l.enabled && i(e10.dtick, l.dtickrange)) { o = l; break; } break; } } return o ? o.value : e10.tickformat; }; Ye.getSubplots = function(e10, t) { var r = e10._fullLayout._subplots, n = r.cartesian.concat(r.gl2d || []), a = t ? Ye.findSubplotsWithAxis(n, t) : n; return a.sort(function(i, o) { var l = i.substr(1).split("y"), s = o.substr(1).split("y"); return l[0] === s[0] ? +l[1] - +s[1] : +l[0] - +s[0]; }), a; }; Ye.findSubplotsWithAxis = function(e10, t) { for (var r = new RegExp( t._id.charAt(0) === "x" ? "^" + t._id + "y" : t._id + "$" ), n = [], a = 0; a < e10.length; a++) { var i = e10[a]; r.test(i) && n.push(i); } return n; }; Ye.makeClipPaths = function(e10) { var t = e10._fullLayout; if (!t._hasOnlyLargeSploms) { var r = { _offset: 0, _length: t.width, _id: "" }, n = { _offset: 0, _length: t.height, _id: "" }, a = Ye.list(e10, "x", true), i = Ye.list(e10, "y", true), o = [], l, s; for (l = 0; l < a.length; l++) for (o.push({ x: a[l], y: n }), s = 0; s < i.length; s++) l === 0 && o.push({ x: r, y: i[s] }), o.push({ x: a[l], y: i[s] }); var u = t._clips.selectAll(".axesclip").data(o, function(f) { return f.x._id + f.y._id; }); u.enter().append("clipPath").classed("axesclip", true).attr("id", function(f) { return "clip" + t._uid + f.x._id + f.y._id; }).append("rect"), u.exit().remove(), u.each(function(f) { Na.select(this).select("rect").attr({ x: f.x._offset || 0, y: f.y._offset || 0, width: f.x._length || 1, height: f.y._length || 1 }); }); } }; Ye.draw = function(e10, t, r) { var n = e10._fullLayout; t === "redraw" && n._paper.selectAll("g.subplot").each(function(s) { var u = s[0], f = n._plots[u]; if (f) { var d = f.xaxis, h = f.yaxis; f.xaxislayer.selectAll("." + d._id + "tick").remove(), f.yaxislayer.selectAll("." + h._id + "tick").remove(), f.xaxislayer.selectAll("." + d._id + "tick2").remove(), f.yaxislayer.selectAll("." + h._id + "tick2").remove(), f.xaxislayer.selectAll("." + d._id + "divider").remove(), f.yaxislayer.selectAll("." + h._id + "divider").remove(), f.minorGridlayer && f.minorGridlayer.selectAll("path").remove(), f.gridlayer && f.gridlayer.selectAll("path").remove(), f.zerolinelayer && f.zerolinelayer.selectAll("path").remove(), n._infolayer.select(".g-" + d._id + "title").remove(), n._infolayer.select(".g-" + h._id + "title").remove(); } }); var a = !t || t === "redraw" ? Ye.listIds(e10) : t, i = Ye.list(e10), o = i.filter(function(s) { return s.autoshift; }).map(function(s) { return s.overlaying; }); a.map(function(s) { var u = Ye.getFromId(e10, s); if (u.tickmode === "sync" && u.overlaying) { var f = a.findIndex(function(d) { return d === u.overlaying; }); f >= 0 && a.unshift(a.splice(f, 1).shift()); } }); var l = { false: { left: 0, right: 0 } }; return jt.syncOrAsync(a.map(function(s) { return function() { if (s) { var u = Ye.getFromId(e10, s); r || (r = {}), r.axShifts = l, r.overlayingShiftedAx = o; var f = Ye.drawOne(e10, u, r); return u._shiftPusher && Ey(u, u._fullDepth || 0, l, true), u._r = u.range.slice(), u._rl = jt.simpleMap(u._r, u.r2l), f; } }; })); }; Ye.drawOne = function(e10, t, r) { r = r || {}; var n = r.axShifts || {}, a = r.overlayingShiftedAx || [], i, o, l; t.setScale(); var s = e10._fullLayout, u = t._id, f = u.charAt(0), d = Ye.counterLetter(u), h = s._plots[t._mainSubplot]; if (!h) return; if (t._shiftPusher = t.autoshift || a.indexOf(t._id) !== -1 || a.indexOf(t.overlaying) !== -1, t._shiftPusher & t.anchor === "free") { var p = t.linewidth / 2 || 0; t.ticks === "inside" && (p += t.ticklen), Ey(t, p, n, true), Ey(t, t.shift || 0, n, false); } (r.skipTitle !== true || t._shift === void 0) && (t._shift = FY(t, n)); var v = h[f + "axislayer"], m = t._mainLinePosition, g = m += t._shift, y = t._mainMirrorPosition, w = t._vals = Ye.calcTicks(t), k = [t.mirror, g, y].join("_"); for (i = 0; i < w.length; i++) w[i].axInfo = k; t._selections = {}, t._tickAngles && (t._prevTickAngles = t._tickAngles), t._tickAngles = {}, t._depth = null; var x = {}; function _(Fe) { var Oe = u + (Fe || "tick"); return x[Oe] || (x[Oe] = TY(t, Oe)), x[Oe]; } if (t.visible) { var T = Ye.makeTransTickFn(t), S = Ye.makeTransTickLabelFn(t), M, L, F = t.ticks === "inside", $ = t.ticks === "outside"; if (t.tickson === "boundaries") { var I = _Y(t, w); L = Ye.clipEnds(t, I), M = F ? L : I; } else L = Ye.clipEnds(t, w), M = F && t.ticklabelmode !== "period" ? L : w; var O = t._gridVals = L, G = wY(t, w); if (!s._hasOnlyLargeSploms) { var K = t._subplotsWith, V = {}; for (i = 0; i < K.length; i++) { o = K[i], l = s._plots[o]; var z = l[d + "axis"], P = z._mainAxis._id; if (!V[P]) { V[P] = 1; var R = f === "x" ? "M0," + z._offset + "v" + z._length : "M" + z._offset + ",0h" + z._length; Ye.drawGrid(e10, t, { vals: O, counterAxis: z, layer: l.gridlayer.select("." + u), minorLayer: l.minorGridlayer.select("." + u), path: R, transFn: T }), Ye.drawZeroLine(e10, t, { counterAxis: z, layer: l.zerolinelayer, path: R, transFn: T }); } } } var H, B = Ye.getTickSigns(t), W = Ye.getTickSigns(t, "minor"); if (t.ticks || t.minor && t.minor.ticks) { var ee = Ye.makeTickPath(t, g, B[2]), re = Ye.makeTickPath(t, g, W[2], { minor: true }), ae, Q, ue, j; if (t._anchorAxis && t.mirror && t.mirror !== true ? (ae = Ye.makeTickPath(t, y, B[3]), Q = Ye.makeTickPath(t, y, W[3], { minor: true }), ue = ee + ae, j = re + Q) : (ae = "", Q = "", ue = ee, j = re), t.showdividers && $ && t.tickson === "boundaries") { var U = {}; for (i = 0; i < G.length; i++) U[G[i].x] = 1; H = function(Fe) { return U[Fe.x] ? ae : ue; }; } else H = function(Fe) { return Fe.minor ? j : ue; }; } if (Ye.drawTicks(e10, t, { vals: M, layer: v, path: H, transFn: T }), t.mirror === "allticks") { var Z = Object.keys(t._linepositions || {}); for (i = 0; i < Z.length; i++) { o = Z[i], l = s._plots[o]; var le = t._linepositions[o] || [], J = le[0], pe = le[1], ge = le[2], ve = Ye.makeTickPath( t, J, ge ? B[0] : W[0], { minor: ge } ) + Ye.makeTickPath( t, pe, ge ? B[1] : W[1], { minor: ge } ); Ye.drawTicks(e10, t, { vals: M, layer: l[f + "axislayer"], path: ve, transFn: T }); } } var me = []; if (me.push(function() { return Ye.drawLabels(e10, t, { vals: w, layer: v, plotinfo: l, transFn: S, labelFns: Ye.makeLabelFns(t, g) }); }), t.type === "multicategory") { var Le = { x: 2, y: 10 }[f]; me.push(function() { var Fe = { x: "height", y: "width" }[f], Oe = _()[Fe] + Le + (t._tickAngles[u + "tick"] ? t.tickfont.size * pv : 0); return Ye.drawLabels(e10, t, { vals: xY(t, w), layer: v, cls: u + "tick2", repositionOnUpdate: true, secondary: true, transFn: T, labelFns: Ye.makeLabelFns(t, g + Oe * B[4]) }); }), me.push(function() { return t._depth = B[4] * (_("tick2")[t.side] - g), AY(e10, t, { vals: G, layer: v, path: Ye.makeTickPath(t, g, B[4], { len: t._depth }), transFn: T }); }); } else t.title.hasOwnProperty("standoff") && me.push(function() { t._depth = B[4] * (_()[t.side] - g); }); var ze = Tc.getComponentMethod("rangeslider", "isVisible")(t); return !r.skipTitle && !(ze && t.side === "bottom") && me.push(function() { return MY(e10, t); }), me.push(function() { var Fe = t.side.charAt(0), Oe = QZ[t.side].charAt(0), Re = Ye.getPxPosition(e10, t), We = $ ? t.ticklen : 0, Me, Ve, qe, Qe; (t.automargin || ze || t._shiftPusher) && (t.type === "multicategory" ? Me = _("tick2") : (Me = _(), f === "x" && Fe === "b" && (t._depth = Math.max(Me.width > 0 ? Me.bottom - Re : 0, We)))); var ot = 0, ht = 0; if (t._shiftPusher && (ot = Math.max( We, Me.height > 0 ? Fe === "l" ? Re - Me.left : Me.right - Re : 0 ), t.title.text !== s._dfltTitle[f] && (ht = (t._titleStandoff || 0) + (t._titleScoot || 0), Fe === "l" && (ht += Ly(t))), t._fullDepth = Math.max(ot, ht)), t.automargin) { Ve = { x: 0, y: 0, r: 0, l: 0, t: 0, b: 0 }; var vt = [0, 1], nt = typeof t._shift == "number" ? t._shift : 0; if (f === "x") { if (Fe === "b" ? Ve[Fe] = t._depth : (Ve[Fe] = t._depth = Math.max(Me.width > 0 ? Re - Me.top : 0, We), vt.reverse()), Me.width > 0) { var ft = Me.right - (t._offset + t._length); ft > 0 && (Ve.xr = 1, Ve.r = ft); var Pe = t._offset - Me.left; Pe > 0 && (Ve.xl = 0, Ve.l = Pe); } } else if (Fe === "l" ? (t._depth = Math.max(Me.height > 0 ? Re - Me.left : 0, We), Ve[Fe] = t._depth - nt) : (t._depth = Math.max(Me.height > 0 ? Me.right - Re : 0, We), Ve[Fe] = t._depth + nt, vt.reverse()), Me.height > 0) { var Ie = Me.bottom - (t._offset + t._length); Ie > 0 && (Ve.yb = 0, Ve.b = Ie); var Ne = t._offset - Me.top; Ne > 0 && (Ve.yt = 1, Ve.t = Ne); } Ve[d] = t.anchor === "free" ? t.position : t._anchorAxis.domain[vt[0]], t.title.text !== s._dfltTitle[f] && (Ve[Fe] += Ly(t) + (t.title.standoff || 0)), t.mirror && t.anchor !== "free" && (qe = { x: 0, y: 0, r: 0, l: 0, t: 0, b: 0 }, qe[Oe] = t.linewidth, t.mirror && t.mirror !== true && (qe[Oe] += We), t.mirror === true || t.mirror === "ticks" ? qe[d] = t._anchorAxis.domain[vt[1]] : (t.mirror === "all" || t.mirror === "allticks") && (qe[d] = [t._counterDomainMin, t._counterDomainMax][vt[1]])); } ze && (Qe = Tc.getComponentMethod("rangeslider", "autoMarginOpts")(e10, t)), typeof t.automargin == "string" && (JT(Ve, t.automargin), JT(qe, t.automargin)), bu.autoMargin(e10, kb(t), Ve), bu.autoMargin(e10, W4(t), qe), bu.autoMargin(e10, Z4(t), Qe); }), jt.syncOrAsync(me); } }; function JT(e10, t) { if (e10) { var r = Object.keys(VT).reduce(function(n, a) { return t.indexOf(a) !== -1 && VT[a].forEach(function(i) { n[i] = 1; }), n; }, {}); Object.keys(e10).forEach(function(n) { r[n] || (n.length === 1 ? e10[n] = 0 : delete e10[n]); }); } } function _Y(e10, t) { var r = [], n, a = function(i, o) { var l = i.xbnd[o]; l !== null && r.push(jt.extendFlat({}, i, { x: l })); }; if (t.length) { for (n = 0; n < t.length; n++) a(t[n], 0); a(t[n - 1], 1); } return r; } function xY(e10, t) { for (var r = [], n = {}, a = 0; a < t.length; a++) { var i = t[a]; n[i.text2] ? n[i.text2].push(i.x) : n[i.text2] = [i.x]; } for (var o in n) r.push(wb(e10, jt.interp(n[o], 0.5), o)); return r; } function wY(e10, t) { var r = [], n, a, i = t.length && t[t.length - 1].x < t[0].x, o = function(s, u) { var f = s.xbnd[u]; f !== null && r.push(jt.extendFlat({}, s, { x: f })); }; if (e10.showdividers && t.length) { for (n = 0; n < t.length; n++) { var l = t[n]; l.text2 !== a && o(l, i ? 1 : 0), a = l.text2; } o(t[n - 1], i ? 0 : 1); } return r; } function TY(e10, t) { var r, n, a, i; return e10._selections[t].size() ? (r = 1 / 0, n = -1 / 0, a = 1 / 0, i = -1 / 0, e10._selections[t].each(function() { var o = Dy(this), l = ya.bBox(o.node().parentNode); r = Math.min(r, l.top), n = Math.max(n, l.bottom), a = Math.min(a, l.left), i = Math.max(i, l.right); })) : (r = 0, n = 0, a = 0, i = 0), { top: r, bottom: n, left: a, right: i, height: n - r, width: i - a }; } Ye.getTickSigns = function(e10, t) { var r = e10._id.charAt(0), n = { x: "top", y: "right" }[r], a = e10.side === n ? 1 : -1, i = [-1, 1, a, -a], o = t ? (e10.minor || {}).ticks : e10.ticks; return o !== "inside" == (r === "x") && (i = i.map(function(l) { return -l; })), e10.side && i.push({ l: -1, t: -1, r: 1, b: 1 }[e10.side.charAt(0)]), i; }; Ye.makeTransTickFn = function(e10) { return e10._id.charAt(0) === "x" ? function(t) { return Fu(e10._offset + e10.l2p(t.x), 0); } : function(t) { return Fu(0, e10._offset + e10.l2p(t.x)); }; }; Ye.makeTransTickLabelFn = function(e10) { var t = kY(e10), r = t[0], n = t[1]; return e10._id.charAt(0) === "x" ? function(a) { return Fu( r + e10._offset + e10.l2p(Cy(a)), n ); } : function(a) { return Fu( n, r + e10._offset + e10.l2p(Cy(a)) ); }; }; function Cy(e10) { return e10.periodX !== void 0 ? e10.periodX : e10.x; } function kY(e10) { var t = e10.ticklabelposition || "", r = function(p) { return t.indexOf(p) !== -1; }, n = r("top"), a = r("left"), i = r("right"), o = r("bottom"), l = r("inside"), s = o || a || n || i; if (!s && !l) return [0, 0]; var u = e10.side, f = s ? (e10.tickwidth || 0) / 2 : 0, d = mv, h = e10.tickfont ? e10.tickfont.size : 12; return (o || n) && (f += h * Jl, d += (e10.linewidth || 0) / 2), (a || i) && (f += (e10.linewidth || 0) / 2, d += mv), l && u === "top" && (d -= h * (1 - Jl)), (a || n) && (f = -f), (u === "bottom" || u === "right") && (d = -d), [ s ? f : 0, l ? d : 0 ]; } Ye.makeTickPath = function(e10, t, r, n) { n || (n = {}); var a = n.minor; if (a && !e10.minor) return ""; var i = n.len !== void 0 ? n.len : a ? e10.minor.ticklen : e10.ticklen, o = e10._id.charAt(0), l = (e10.linewidth || 1) / 2; return o === "x" ? "M0," + (t + l * r) + "v" + i * r : "M" + (t + l * r) + ",0h" + i * r; }; Ye.makeLabelFns = function(e10, t, r) { var n = e10.ticklabelposition || "", a = function(I) { return n.indexOf(I) !== -1; }, i = a("top"), o = a("left"), l = a("right"), s = a("bottom"), u = s || o || i || l, f = a("inside"), d = n === "inside" && e10.ticks === "inside" || !f && e10.ticks === "outside" && e10.tickson !== "boundaries", h = 0, p = 0, v = d ? e10.ticklen : 0; if (f ? v *= -1 : u && (v = 0), d && (h += v, r)) { var m = jt.deg2rad(r); h = v * Math.cos(m) + 1, p = v * Math.sin(m); } e10.showticklabels && (d || e10.showline) && (h += 0.2 * e10.tickfont.size), h += (e10.linewidth || 1) / 2 * (f ? -1 : 1); var g = { labelStandoff: h, labelShift: p }, y, w, k, x, _ = 0, T = e10.side, S = e10._id.charAt(0), M = e10.tickangle, L; if (S === "x") L = !f && T === "bottom" || f && T === "top", x = L ? 1 : -1, f && (x *= -1), y = p * x, w = t + h * x, k = L ? 1 : -0.2, Math.abs(M) === 90 && (f ? k += Jd : M === -90 && T === "bottom" ? k = Jl : M === 90 && T === "top" ? k = Jd : k = 0.5, _ = Jd / 2 * (M / 90)), g.xFn = function(I) { return I.dx + y + _ * I.fontSize; }, g.yFn = function(I) { return I.dy + w + I.fontSize * k; }, g.anchorFn = function(I, O) { if (u) { if (o) return "end"; if (l) return "start"; } return !Jr(O) || O === 0 || O === 180 ? "middle" : O * x < 0 !== f ? "end" : "start"; }, g.heightFn = function(I, O, G) { return O < -60 || O > 60 ? -0.5 * G : e10.side === "top" !== f ? -G : 0; }; else if (S === "y") { if (L = !f && T === "left" || f && T === "right", x = L ? 1 : -1, f && (x *= -1), y = h, w = p * x, k = 0, !f && Math.abs(M) === 90 && (M === -90 && T === "left" || M === 90 && T === "right" ? k = Jl : k = 0.5), f) { var F = Jr(M) ? +M : 0; if (F !== 0) { var $ = jt.deg2rad(F); _ = Math.abs(Math.sin($)) * Jl * x, k = 0; } } g.xFn = function(I) { return I.dx + t - (y + I.fontSize * k) * x + _ * I.fontSize; }, g.yFn = function(I) { return I.dy + w + I.fontSize * Jd; }, g.anchorFn = function(I, O) { return Jr(O) && Math.abs(O) === 90 ? "middle" : L ? "end" : "start"; }, g.heightFn = function(I, O, G) { return e10.side === "right" && (O *= -1), O < -30 ? -G : O < 30 ? -0.5 * G : 0; }; } return g; }; function Fp(e10) { return [e10.text, e10.x, e10.axInfo, e10.font, e10.fontSize, e10.fontColor].join("_"); } Ye.drawTicks = function(e10, t, r) { r = r || {}; var n = t._id + "tick", a = [].concat( t.minor && t.minor.ticks ? ( // minor vals r.vals.filter(function(o) { return o.minor && !o.noTick; }) ) : [] ).concat( t.ticks ? ( // major vals r.vals.filter(function(o) { return !o.minor && !o.noTick; }) ) : [] ), i = r.layer.selectAll("path." + n).data(a, Fp); i.exit().remove(), i.enter().append("path").classed(n, 1).classed("ticks", 1).classed("crisp", r.crisp !== false).each(function(o) { return kc.stroke(Na.select(this), o.minor ? t.minor.tickcolor : t.tickcolor); }).style("stroke-width", function(o) { return ya.crispRound( e10, o.minor ? t.minor.tickwidth : t.tickwidth, 1 ) + "px"; }).attr("d", r.path).style("display", null), Rp(t, [H4]), i.attr("transform", r.transFn); }; Ye.drawGrid = function(e10, t, r) { if (r = r || {}, t.tickmode !== "sync") { var n = t._id + "grid", a = t.minor && t.minor.showgrid, i = a ? r.vals.filter(function(y) { return y.minor; }) : [], o = t.showgrid ? r.vals.filter(function(y) { return !y.minor; }) : [], l = r.counterAxis; if (l && Ye.shouldShowZeroLine(e10, t, l)) for (var s = t.tickmode === "array", u = 0; u < o.length; u++) { var f = o[u].x; if (s ? !f : Math.abs(f) < t.dtick / 100) if (o = o.slice(0, u).concat(o.slice(u + 1)), s) u--; else break; } t._gw = ya.crispRound(e10, t.gridwidth, 1); for (var d = a ? ya.crispRound(e10, t.minor.gridwidth, 1) : 0, h = r.layer, p = r.minorLayer, v = 1; v >= 0; v--) { var m = v ? h : p; if (m) { var g = m.selectAll("path." + n).data(v ? o : i, Fp); g.exit().remove(), g.enter().append("path").classed(n, 1).classed("crisp", r.crisp !== false), g.attr("transform", r.transFn).attr("d", r.path).each(function(y) { return kc.stroke( Na.select(this), y.minor ? t.minor.gridcolor : t.gridcolor || "#ddd" ); }).style("stroke-dasharray", function(y) { return ya.dashStyle( y.minor ? t.minor.griddash : t.griddash, y.minor ? t.minor.gridwidth : t.gridwidth ); }).style("stroke-width", function(y) { return (y.minor ? d : t._gw) + "px"; }).style("display", null), typeof r.path == "function" && g.attr("d", r.path); } } Rp(t, [My, Sy]); } }; Ye.drawZeroLine = function(e10, t, r) { r = r || r; var n = t._id + "zl", a = Ye.shouldShowZeroLine(e10, t, r.counterAxis), i = r.layer.selectAll("path." + n).data(a ? [{ x: 0, id: t._id }] : []); i.exit().remove(), i.enter().append("path").classed(n, 1).classed("zl", 1).classed("crisp", r.crisp !== false).each(function() { r.layer.selectAll("path").sort(function(o, l) { return tY(o.id, l.id); }); }), i.attr("transform", r.transFn).attr("d", r.path).call(kc.stroke, t.zerolinecolor || kc.defaultLine).style("stroke-width", ya.crispRound(e10, t.zerolinewidth, t._gw || 1) + "px").style("display", null), Rp(t, [Ay]); }; Ye.drawLabels = function(e10, t, r) { r = r || {}; var n = e10._fullLayout, a = t._id, i = a.charAt(0), o = r.cls || a + "tick", l = r.vals.filter(function(G) { return G.text; }), s = r.labelFns, u = r.secondary ? 0 : t.tickangle, f = (t._prevTickAngles || {})[o], d = r.layer.selectAll("g." + o).data(t.showticklabels ? l : [], Fp), h = []; d.enter().append("g").classed(o, 1).append("text").attr("text-anchor", "middle").each(function(G) { var K = Na.select(this), V = e10._promises.length; K.call(Yf.positionText, s.xFn(G), s.yFn(G)).call(ya.font, G.font, G.fontSize, G.fontColor).text(G.text).call(Yf.convertToTspans, e10), e10._promises[V] ? h.push(e10._promises.pop().then(function() { p(K, u); })) : p(K, u); }), Rp(t, [GT]), d.exit().remove(), r.repositionOnUpdate && d.each(function(G) { Na.select(this).select("text").call(Yf.positionText, s.xFn(G), s.yFn(G)); }); function p(G, K) { G.each(function(V) { var z = Na.select(this), P = z.select(".text-math-group"), R = s.anchorFn(V, K), H = r.transFn.call(z.node(), V) + (Jr(K) && +K != 0 ? " rotate(" + K + "," + s.xFn(V) + "," + (s.yFn(V) - V.fontSize / 2) + ")" : ""), B = Yf.lineCount(z), W = pv * V.fontSize, ee = s.heightFn(V, Jr(K) ? +K : 0, (B - 1) * W); if (ee && (H += Fu(0, ee)), P.empty()) { var re = z.select("text"); re.attr({ transform: H, "text-anchor": R }), re.style("opacity", 1), t._adjustTickLabelsOverflow && t._adjustTickLabelsOverflow(); } else { var ae = ya.bBox(P.node()).width, Q = ae * { end: -0.5, start: 0.5 }[R]; P.attr("transform", H + Fu(Q, 0)); } }); } t._adjustTickLabelsOverflow = function() { var G = t.ticklabeloverflow; if (!(!G || G === "allow")) { var K = G.indexOf("hide") !== -1, V = t._id.charAt(0) === "x", z = 0, P = V ? e10._fullLayout.width : e10._fullLayout.height; if (G.indexOf("domain") !== -1) { var R = jt.simpleMap(t.range, t.r2l); z = t.l2p(R[0]) + t._offset, P = t.l2p(R[1]) + t._offset; } var H = Math.min(z, P), B = Math.max(z, P), W = t.side, ee = 1 / 0, re = -1 / 0; d.each(function(j) { var U = Na.select(this), Z = U.select(".text-math-group"); if (Z.empty()) { var le = ya.bBox(U.node()), J = 0; V ? (le.right > B || le.left < H) && (J = 1) : (le.bottom > B || le.top + (t.tickangle ? 0 : j.fontSize / 4) < H) && (J = 1); var pe = U.select("text"); J ? K && pe.style("opacity", 0) : (pe.style("opacity", 1), W === "bottom" || W === "right" ? ee = Math.min(ee, V ? le.top : le.left) : ee = -1 / 0, W === "top" || W === "left" ? re = Math.max(re, V ? le.bottom : le.right) : re = 1 / 0); } }); for (var ae in n._plots) { var Q = n._plots[ae]; if (!(t._id !== Q.xaxis._id && t._id !== Q.yaxis._id)) { var ue = V ? Q.yaxis : Q.xaxis; ue && (ue["_visibleLabelMin_" + t._id] = ee, ue["_visibleLabelMax_" + t._id] = re); } } } }, t._hideCounterAxisInsideTickLabels = function(G) { var K = t._id.charAt(0) === "x", V = []; for (var z in n._plots) { var P = n._plots[z]; t._id !== P.xaxis._id && t._id !== P.yaxis._id || V.push(K ? P.yaxis : P.xaxis); } V.forEach(function(R, H) { R && Mc(R) && (G || [ Ay, Sy, My, H4, GT ]).forEach(function(B) { var W = B.K === "tick" && B.L === "text" && t.ticklabelmode === "period", ee = n._plots[t._mainSubplot], re; B.K === Ay.K ? re = ee.zerolinelayer.selectAll("." + t._id + "zl") : B.K === Sy.K ? re = ee.minorGridlayer.selectAll("." + t._id) : B.K === My.K ? re = ee.gridlayer.selectAll("." + t._id) : re = ee[t._id.charAt(0) + "axislayer"], re.each(function() { var ae = Na.select(this); B.L && (ae = ae.selectAll(B.L)), ae.each(function(Q) { var ue = t.l2p( W ? Cy(Q) : Q.x ) + t._offset, j = Na.select(this); ue < t["_visibleLabelMax_" + R._id] && ue > t["_visibleLabelMin_" + R._id] ? j.style("display", "none") : B.K === "tick" && !H && j.style("display", null); }); }); }); }); }, p(d, f + 1 ? f : u); function v() { return h.length && Promise.all(h); } var m = null; function g() { if (p(d, u), l.length && i === "x" && !Jr(u) && (t.type !== "log" || String(t.dtick).charAt(0) !== "D")) { m = 0; var G = 0, K = [], V; if (d.each(function(le) { G = Math.max(G, le.fontSize); var J = t.l2p(le.x), pe = Dy(this), ge = ya.bBox(pe.node()); K.push({ // ignore about y, just deal with x overlaps top: 0, bottom: 10, height: 10, left: J - ge.width / 2, // impose a 2px gap right: J + ge.width / 2 + 2, width: ge.width + 2 }); }), (t.tickson === "boundaries" || t.showdividers) && !r.secondary) { var z = 2; for (t.ticks && (z += t.tickwidth / 2), V = 0; V < K.length; V++) { var P = l[V].xbnd, R = K[V]; if (P[0] !== null && R.left - t.l2p(P[0]) < z || P[1] !== null && t.l2p(P[1]) - R.right < z) { m = 90; break; } } } else { var H = l.length, B = Math.abs((l[H - 1].x - l[0].x) * t._m) / (H - 1), W = t.ticklabelposition || "", ee = function(le) { return W.indexOf(le) !== -1; }, re = ee("top"), ae = ee("left"), Q = ee("right"), ue = ee("bottom"), j = ue || ae || re || Q, U = j ? (t.tickwidth || 0) + 2 * mv : 0, Z = B < G * 2.5 || t.type === "multicategory" || t._name === "realaxis"; for (V = 0; V < K.length - 1; V++) if (jt.bBoxIntersect(K[V], K[V + 1], U)) { m = Z ? 90 : 30; break; } } m && p(d, m); } } t._selections && (t._selections[o] = d); var y = [v]; t.automargin && n._redrawFromAutoMarginCount && f === 90 ? (m = 90, y.push(function() { p(d, f); })) : y.push(g), t._tickAngles && y.push(function() { t._tickAngles[o] = m === null ? Jr(u) ? u : 0 : m; }); var w = function() { var G = 0, K = 0; return d.each(function(V, z) { var P = Dy(this), R = P.select(".text-math-group"); if (R.empty()) { var H; t._vals[z] && (H = t._vals[z].bb || ya.bBox(P.node()), t._vals[z].bb = H), G = Math.max(G, H.width), K = Math.max(K, H.height); } }), { labelsMaxW: G, labelsMaxH: K }; }, k = t._anchorAxis; if (k && (k.autorange || k.insiderange) && Mc(t) && !rY(n, t._id) && (n._insideTickLabelsUpdaterange || (n._insideTickLabelsUpdaterange = {}), k.autorange && (n._insideTickLabelsUpdaterange[k._name + ".autorange"] = k.autorange, y.push(w)), k.insiderange)) { var x = w(), _ = t._id.charAt(0) === "y" ? x.labelsMaxW : x.labelsMaxH; _ += 2 * mv, t.ticklabelposition === "inside" && (_ += t.ticklen || 0); var T = t.side === "right" || t.side === "top" ? 1 : -1, S = T === 1 ? 1 : 0, M = T === 1 ? 0 : 1, L = []; L[M] = k.range[M]; var F = k.d2p(k.range[S]), $ = k.d2p(k.range[M]), I = Math.abs($ - F); I - _ > 0 ? (I -= _, _ *= 1 + _ / I) : _ = 0, t._id.charAt(0) !== "y" && (_ = -_), L[S] = k.p2d( k.d2p(k.range[S]) + T * _ ), k.autorange === "min" || k.autorange === "max reversed" ? (L[0] = null, k._rangeInitial0 = void 0, k._rangeInitial1 = void 0) : (k.autorange === "max" || k.autorange === "min reversed") && (L[1] = null, k._rangeInitial0 = void 0, k._rangeInitial1 = void 0), n._insideTickLabelsUpdaterange[k._name + ".range"] = L; } var O = jt.syncOrAsync(y); return O && O.then && e10._promises.push(O), O; }; function AY(e10, t, r) { var n = t._id + "divider", a = r.vals, i = r.layer.selectAll("path." + n).data(a, Fp); i.exit().remove(), i.enter().insert("path", ":first-child").classed(n, 1).classed("crisp", 1).call(kc.stroke, t.dividercolor).style("stroke-width", ya.crispRound(e10, t.dividerwidth, 1) + "px"), i.attr("transform", r.transFn).attr("d", r.path); } Ye.getPxPosition = function(e10, t) { var r = e10._fullLayout._size, n = t._id.charAt(0), a = t.side, i; if (t.anchor !== "free" ? i = t._anchorAxis : n === "x" ? i = { _offset: r.t + (1 - (t.position || 0)) * r.h, _length: 0 } : n === "y" && (i = { _offset: r.l + (t.position || 0) * r.w + t._shift, _length: 0 }), a === "top" || a === "left") return i._offset; if (a === "bottom" || a === "right") return i._offset + i._length; }; function Ly(e10) { var t = e10.title.font.size, r = (e10.title.text.match(Yf.BR_TAG_ALL) || []).length; return e10.title.hasOwnProperty("standoff") ? r ? t * (Jl + r * pv) : t * Jl : r ? t * (r + 1) * pv : t; } function MY(e10, t) { var r = e10._fullLayout, n = t._id, a = n.charAt(0), i = t.title.font.size, o; if (t.title.hasOwnProperty("standoff")) o = t._depth + t.title.standoff + Ly(t); else { var l = Mc(t); if (t.type === "multicategory") o = t._depth; else { var s = 1.5 * i; l && (s = 0.5 * i, t.ticks === "outside" && (s += t.ticklen)), o = 10 + s + (t.linewidth ? t.linewidth - 1 : 0); } l || (a === "x" ? o += t.side === "top" ? i * (t.showticklabels ? 1 : 0) : i * (t.showticklabels ? 1.5 : 0.5) : o += t.side === "right" ? i * (t.showticklabels ? 1 : 0.5) : i * (t.showticklabels ? 0.5 : 0)); } var u = Ye.getPxPosition(e10, t), f, d, h; a === "x" ? (d = t._offset + t._length / 2, h = t.side === "top" ? u - o : u + o) : (h = t._offset + t._length / 2, d = t.side === "right" ? u + o : u - o, f = { rotate: "-90", offset: 0 }); var p; if (t.type !== "multicategory") { var v = t._selections[t._id + "tick"]; if (p = { selection: v, side: t.side }, v && v.node() && v.node().parentNode) { var m = ya.getTranslate(v.node().parentNode); p.offsetLeft = m.x, p.offsetTop = m.y; } t.title.hasOwnProperty("standoff") && (p.pad = 0); } return t._titleStandoff = o, ZZ.draw(e10, n + "title", { propContainer: t, propName: t._name + ".title.text", placeholder: r._dfltTitle[a], avoid: p, transform: f, attributes: { x: d, y: h, "text-anchor": "middle" } }); } Ye.shouldShowZeroLine = function(e10, t, r) { var n = jt.simpleMap(t.range, t.r2l); return n[0] * n[1] <= 0 && t.zeroline && (t.type === "linear" || t.type === "-") && !(t.rangebreaks && t.maskBreaks(0) === Dp) && (q4(t, 0) || !SY(e10, t, r, n) || CY(e10, t)); }; Ye.clipEnds = function(e10, t) { return t.filter(function(r) { return q4(e10, r.x); }); }; function q4(e10, t) { var r = e10.l2p(t); return r > 1 && r < e10._length - 1; } function SY(e10, t, r, n) { var a = r._mainAxis; if (!a) return; var i = e10._fullLayout, o = t._id.charAt(0), l = Ye.counterLetter(t._id), s = t._offset + (Math.abs(n[0]) < Math.abs(n[1]) == (o === "x") ? 0 : t._length); function u(v) { if (!v.showline || !v.linewidth) return false; var m = Math.max((v.linewidth + t.zerolinewidth) / 2, 1); function g(k) { return typeof k == "number" && Math.abs(k - s) < m; } if (g(v._mainLinePosition) || g(v._mainMirrorPosition)) return true; var y = v._linepositions || {}; for (var w in y) if (g(y[w][0]) || g(y[w][1])) return true; } var f = i._plots[r._mainSubplot]; if (!(f.mainplotinfo || f).overlays.length) return u(r); for (var d = Ye.list(e10, l), h = 0; h < d.length; h++) { var p = d[h]; if (p._mainAxis === a && u(p)) return true; } } function CY(e10, t) { for (var r = e10._fullData, n = t._mainSubplot, a = t._id.charAt(0), i = 0; i < r.length; i++) { var o = r[i]; if (o.visible === true && o.xaxis + o.yaxis === n && (Tc.traceIs(o, "bar-like") && o.orientation === { x: "h", y: "v" }[a] || o.fill && o.fill.charAt(o.fill.length - 1) === a)) return true; } return false; } function Dy(e10) { var t = Na.select(e10), r = t.select(".text-math-group"); return r.empty() ? t.select("text") : r; } Ye.allowAutoMargin = function(e10) { for (var t = Ye.list(e10, "", true), r = 0; r < t.length; r++) { var n = t[r]; n.automargin && (bu.allowAutoMargin(e10, kb(n)), n.mirror && bu.allowAutoMargin(e10, W4(n))), Tc.getComponentMethod("rangeslider", "isVisible")(n) && bu.allowAutoMargin(e10, Z4(n)); } }; function kb(e10) { return e10._id + ".automargin"; } function W4(e10) { return kb(e10) + ".mirror"; } function Z4(e10) { return e10._id + ".rangeslider"; } Ye.swap = function(e10, t) { for (var r = LY(e10, t), n = 0; n < r.length; n++) DY(e10, r[n].x, r[n].y); }; function LY(e10, t) { var r = [], n, a; for (n = 0; n < t.length; n++) { var i = [], o = e10._fullData[t[n]].xaxis, l = e10._fullData[t[n]].yaxis; if (!(!o || !l)) { for (a = 0; a < r.length; a++) (r[a].x.indexOf(o) !== -1 || r[a].y.indexOf(l) !== -1) && i.push(a); if (!i.length) { r.push({ x: [o], y: [l] }); continue; } var s = r[i[0]], u; if (i.length > 1) for (a = 1; a < i.length; a++) u = r[i[a]], eh(s.x, u.x), eh(s.y, u.y); eh(s.x, [o]), eh(s.y, [l]); } } return r; } function eh(e10, t) { for (var r = 0; r < t.length; r++) e10.indexOf(t[r]) === -1 && e10.push(t[r]); } function DY(e10, t, r) { var n = [], a = [], i = e10.layout, o, l; for (o = 0; o < t.length; o++) n.push(Ye.getFromId(e10, t[o])); for (o = 0; o < r.length; o++) a.push(Ye.getFromId(e10, r[o])); var s = Object.keys(YZ), u = [ "anchor", "domain", "overlaying", "position", "side", "tickangle", "editType" ], f = ["linear", "log"]; for (o = 0; o < s.length; o++) { var d = s[o], h = n[0][d], p = a[0][d], v = true, m = false, g = false; if (!(d.charAt(0) === "_" || typeof h == "function" || u.indexOf(d) !== -1)) { for (l = 1; l < n.length && v; l++) { var y = n[l][d]; d === "type" && f.indexOf(h) !== -1 && f.indexOf(y) !== -1 && h !== y ? m = true : y !== h && (v = false); } for (l = 1; l < a.length && v; l++) { var w = a[l][d]; d === "type" && f.indexOf(p) !== -1 && f.indexOf(w) !== -1 && p !== w ? g = true : a[l][d] !== p && (v = false); } v && (m && (i[n[0]._name].type = "linear"), g && (i[a[0]._name].type = "linear"), EY(i, d, n, a, e10._fullLayout._dfltTitle)); } } for (o = 0; o < e10._fullLayout.annotations.length; o++) { var k = e10._fullLayout.annotations[o]; t.indexOf(k.xref) !== -1 && r.indexOf(k.yref) !== -1 && jt.swapAttrs(i.annotations[o], ["?"]); } } function EY(e10, t, r, n, a) { var i = jt.nestedProperty, o = i(e10[r[0]._name], t).get(), l = i(e10[n[0]._name], t).get(), s; for (t === "title" && (o && o.text === a.x && (o.text = a.y), l && l.text === a.y && (l.text = a.x)), s = 0; s < r.length; s++) i(e10, r[s]._name + "." + t).set(l); for (s = 0; s < n.length; s++) i(e10, n[s]._name + "." + t).set(o); } function Ab(e10) { return e10._id === "angularaxis"; } function pg(e10, t) { for (var r = t._rangebreaks.length, n = 0; n < r; n++) { var a = t._rangebreaks[n]; if (e10 >= a.min && e10 < a.max) return a.max; } return e10; } function Mc(e10) { return (e10.ticklabelposition || "").indexOf("inside") !== -1; } function Rp(e10, t) { Mc(e10._anchorAxis || {}) && e10._hideCounterAxisInsideTickLabels && e10._hideCounterAxisInsideTickLabels(t); } function Ey(e10, t, r, n) { var a = e10.anchor !== "free" && (e10.overlaying === void 0 || e10.overlaying === false) ? e10._id : e10.overlaying, i; n ? i = e10.side === "right" ? t : -t : i = t, a in r || (r[a] = {}), e10.side in r[a] || (r[a][e10.side] = 0), r[a][e10.side] += i; } function FY(e10, t) { return e10.autoshift ? t[e10.overlaying][e10.side] : e10.shift || 0; } var Cr = r4.exports; var RY = function(t, r, n) { var a, i; if (n) { var o = r === "reversed" || r === "min reversed" || r === "max reversed"; a = n[o ? 1 : 0], i = n[o ? 0 : 1]; } var l = t("autorangeoptions.minallowed", i === null ? a : void 0), s = t("autorangeoptions.maxallowed", a === null ? i : void 0); l === void 0 && t("autorangeoptions.clipmin"), s === void 0 && t("autorangeoptions.clipmax"), t("autorangeoptions.include"); }; var PY = RY; var Y4 = function(t, r, n, a) { var i = r._template || {}, o = r.type || i.type || "-"; n("minallowed"), n("maxallowed"); var l = n("range"); if (!l) { var s; !a.noInsiderange && o !== "log" && (s = n("insiderange"), s && (s[0] === null || s[1] === null) && (r.insiderange = false, s = void 0), s && (l = n("range", s))); } var u = r.getAutorangeDflt(l, a), f = n("autorange", u), d; l && (l[0] === null && l[1] === null || (l[0] === null || l[1] === null) && (f === "reversed" || f === true) || l[0] !== null && (f === "min" || f === "max reversed") || l[1] !== null && (f === "max" || f === "min reversed")) && (l = void 0, delete r.range, r.autorange = true, d = true), d || (u = r.getAutorangeDflt(l, a), f = n("autorange", u)), f && (PY(n, f, l), (o === "linear" || o === "-") && n("rangemode")), r.cleanRange(); }; var Mb = {}; var X4 = { exports: {} }; var $Y = { left: 0, top: 0 }; var zY = IY; function IY(e10, t, r) { t = t || e10.currentTarget || e10.srcElement, Array.isArray(r) || (r = [0, 0]); var n = e10.clientX || 0, a = e10.clientY || 0, i = NY(t); return r[0] = n - i.left, r[1] = a - i.top, r; } function NY(e10) { return e10 === window || e10 === document || e10 === document.body ? $Y : e10.getBoundingClientRect(); } function OY() { var e10 = false; try { var t = Object.defineProperty({}, "passive", { get: function() { e10 = true; } }); window.addEventListener("test", null, t), window.removeEventListener("test", null, t); } catch { e10 = false; } return e10; } var K4 = OY(); var HY = function(t, r, n, a, i) { var o = (t - n) / (a - n), l = o + r / (a - n), s = (o + l) / 2; return i === "left" || i === "bottom" ? o : i === "center" || i === "middle" ? s : i === "right" || i === "top" ? l : o < 2 / 3 - s ? o : l > 4 / 3 - s ? l : s; }; var QT = Ue; var BY = [ ["sw-resize", "s-resize", "se-resize"], ["w-resize", "move", "e-resize"], ["nw-resize", "n-resize", "ne-resize"] ]; var jY = function(t, r, n, a) { return n === "left" ? t = 0 : n === "center" ? t = 1 : n === "right" ? t = 2 : t = QT.constrain(Math.floor(t * 3), 0, 2), a === "bottom" ? r = 0 : a === "middle" ? r = 1 : a === "top" ? r = 2 : r = QT.constrain(Math.floor(r * 3), 0, 2), BY[r][t]; }; var J4 = { exports: {} }; var UY = xp; var GY = gp; var VY = dp.getGraphDiv; var qY = sp; var Fy = J4.exports = {}; Fy.wrapped = function(e10, t, r) { e10 = VY(e10), e10._fullLayout && GY.clear(e10._fullLayout._uid + qY.HOVERID), Fy.raw(e10, t, r); }; Fy.raw = function(t, r) { var n = t._fullLayout, a = t._hoverdata; r || (r = {}), !(r.target && !t._dragged && UY.triggerHandler(t, "plotly_beforehover", r) === false) && (n._hoverlayer.selectAll("g").remove(), n._hoverlayer.selectAll("line").remove(), n._hoverlayer.selectAll("circle").remove(), t._hoverdata = void 0, r.target && a && t.emit("plotly_unhover", { event: r, points: a })); }; var WY = J4.exports; var ZY = zY; var mg = zL; var YY = K4; var XY = Ue.removeElement; var KY = Yn; var ss = X4.exports = {}; ss.align = HY; ss.getCursor = jY; var Q4 = WY; ss.unhover = Q4.wrapped; ss.unhoverRaw = Q4.raw; ss.init = function(t) { var r = t.gd, n = 1, a = r._context.doubleClickDelay, i = t.element, o, l, s, u, f, d, h, p; r._mouseDownTime || (r._mouseDownTime = 0), i.style.pointerEvents = "all", i.onmousedown = g, YY ? (i._ontouchstart && i.removeEventListener("touchstart", i._ontouchstart), i._ontouchstart = g, i.addEventListener("touchstart", g, { passive: false })) : i.ontouchstart = g; function v(k, x, _) { return Math.abs(k) < _ && (k = 0), Math.abs(x) < _ && (x = 0), [k, x]; } var m = t.clampFn || v; function g(k) { r._dragged = false, r._dragging = true; var x = gg(k); o = x[0], l = x[1], h = k.target, d = k, p = k.buttons === 2 || k.ctrlKey, typeof k.clientX > "u" && typeof k.clientY > "u" && (k.clientX = o, k.clientY = l), s = (/* @__PURE__ */ new Date()).getTime(), s - r._mouseDownTime < a ? n += 1 : (n = 1, r._mouseDownTime = s), t.prepFn && t.prepFn(k, o, l), mg && !p ? (f = eD(), f.style.cursor = window.getComputedStyle(i).cursor) : mg || (f = document, u = window.getComputedStyle(document.documentElement).cursor, document.documentElement.style.cursor = window.getComputedStyle(i).cursor), document.addEventListener("mouseup", w), document.addEventListener("touchend", w), t.dragmode !== false && (k.preventDefault(), document.addEventListener("mousemove", y), document.addEventListener("touchmove", y, { passive: false })); } function y(k) { k.preventDefault(); var x = gg(k), _ = t.minDrag || KY.MINDRAG, T = m(x[0] - o, x[1] - l, _), S = T[0], M = T[1]; (S || M) && (r._dragged = true, ss.unhover(r, k)), r._dragged && t.moveFn && !p && (r._dragdata = { element: i, dx: S, dy: M }, t.moveFn(S, M)); } function w(k) { if (delete r._dragdata, t.dragmode !== false && (k.preventDefault(), document.removeEventListener("mousemove", y), document.removeEventListener("touchmove", y)), document.removeEventListener("mouseup", w), document.removeEventListener("touchend", w), mg ? XY(f) : u && (f.documentElement.style.cursor = u, u = null), !r._dragging) { r._dragged = false; return; } if (r._dragging = false, (/* @__PURE__ */ new Date()).getTime() - r._mouseDownTime > a && (n = Math.max(n - 1, 1)), r._dragged) t.doneFn && t.doneFn(); else if (t.clickFn && t.clickFn(n, d), !p) { var x; try { x = new MouseEvent("click", k); } catch { var _ = gg(k); x = document.createEvent("MouseEvents"), x.initMouseEvent( "click", k.bubbles, k.cancelable, k.view, k.detail, k.screenX, k.screenY, _[0], _[1], k.ctrlKey, k.altKey, k.shiftKey, k.metaKey, k.button, k.relatedTarget ); } h.dispatchEvent(x); } r._dragging = false, r._dragged = false; } }; function eD() { var e10 = document.createElement("div"); e10.className = "dragcover"; var t = e10.style; return t.position = "fixed", t.left = 0, t.right = 0, t.top = 0, t.bottom = 0, t.zIndex = 999999999, t.background = "none", document.body.appendChild(e10), e10; } ss.coverSlip = eD; function gg(e10) { return ZY( e10.changedTouches ? e10.changedTouches[0] : e10, document.body ); } var Qi = X4.exports; var Pp = {}; var xs = function(t, r) { (t.attr("class") || "").split(" ").forEach(function(n) { n.indexOf("cursor-") === 0 && t.classed(n, false); }), r && t.classed("cursor-" + r, true); }; var yg = xs; var Cf = "data-savedcursor"; var ek = "!!"; var JY = function(t, r) { var n = t.attr(Cf); if (r) { if (!n) { for (var a = (t.attr("class") || "").split(" "), i = 0; i < a.length; i++) { var o = a[i]; o.indexOf("cursor-") === 0 && t.attr(Cf, o.substr(7)).classed(o, false); } t.attr(Cf) || t.attr(Cf, ek); } yg(t, r); } else n && (t.attr(Cf, null), n === ek ? yg(t) : yg(t, n)); }; var bg = Fn; var QY = da; var tD = { // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: true, visible: { valType: "boolean", dflt: true, editType: "legend", description: [ "Determines whether or not this legend is visible." ].join(" ") }, bgcolor: { valType: "color", editType: "legend", description: [ "Sets the legend background color.", "Defaults to `layout.paper_bgcolor`." ].join(" ") }, bordercolor: { valType: "color", dflt: QY.defaultLine, editType: "legend", description: "Sets the color of the border enclosing the legend." }, borderwidth: { valType: "number", min: 0, dflt: 0, editType: "legend", description: "Sets the width (in px) of the border enclosing the legend." }, font: bg({ editType: "legend", description: "Sets the font used to text the legend items." }), grouptitlefont: bg({ editType: "legend", description: [ "Sets the font for group titles in legend.", "Defaults to `legend.font` with its size increased about 10%." ].join(" ") }), orientation: { valType: "enumerated", values: ["v", "h"], dflt: "v", editType: "legend", description: "Sets the orientation of the legend." }, traceorder: { valType: "flaglist", flags: ["reversed", "grouped"], extras: ["normal"], editType: "legend", description: [ "Determines the order at which the legend items are displayed.", "If *normal*, the items are displayed top-to-bottom in the same", "order as the input data.", "If *reversed*, the items are displayed in the opposite order", "as *normal*.", "If *grouped*, the items are displayed in groups", "(when a trace `legendgroup` is provided).", "if *grouped+reversed*, the items are displayed in the opposite order", "as *grouped*." ].join(" ") }, tracegroupgap: { valType: "number", min: 0, dflt: 10, editType: "legend", description: [ "Sets the amount of vertical space (in px) between legend groups." ].join(" ") }, entrywidth: { valType: "number", min: 0, editType: "legend", description: [ "Sets the width (in px or fraction) of the legend.", "Use 0 to size the entry based on the text width,", "when `entrywidthmode` is set to *pixels*." ].join(" ") }, entrywidthmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "pixels", editType: "legend", description: "Determines what entrywidth means." }, itemsizing: { valType: "enumerated", values: ["trace", "constant"], dflt: "trace", editType: "legend", description: [ "Determines if the legend items symbols scale with their corresponding *trace* attributes", "or remain *constant* independent of the symbol size on the graph." ].join(" ") }, itemwidth: { valType: "number", min: 30, dflt: 30, editType: "legend", description: "Sets the width (in px) of the legend item symbols (the part other than the title.text)." }, itemclick: { valType: "enumerated", values: ["toggle", "toggleothers", false], dflt: "toggle", editType: "legend", description: [ "Determines the behavior on legend item click.", "*toggle* toggles the visibility of the item clicked on the graph.", "*toggleothers* makes the clicked item the sole visible item on the graph.", "*false* disables legend item click interactions." ].join(" ") }, itemdoubleclick: { valType: "enumerated", values: ["toggle", "toggleothers", false], dflt: "toggleothers", editType: "legend", description: [ "Determines the behavior on legend item double-click.", "*toggle* toggles the visibility of the item clicked on the graph.", "*toggleothers* makes the clicked item the sole visible item on the graph.", "*false* disables legend item double-click interactions." ].join(" ") }, groupclick: { valType: "enumerated", values: ["toggleitem", "togglegroup"], dflt: "togglegroup", editType: "legend", description: [ "Determines the behavior on legend group item click.", "*toggleitem* toggles the visibility of the individual item clicked on the graph.", "*togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph." ].join(" ") }, x: { valType: "number", editType: "legend", description: [ "Sets the x position with respect to `xref` (in normalized coordinates) of the legend.", "When `xref` is *paper*, defaults to *1.02* for vertical legends and", "defaults to *0* for horizontal legends.", "When `xref` is *container*, defaults to *1* for vertical legends and", "defaults to *0* for horizontal legends.", "Must be between *0* and *1* if `xref` is *container*.", "and between *-2* and *3* if `xref` is *paper*." ].join(" ") }, xref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", editType: "legend", description: [ "Sets the legend's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the legend.", "Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,", "anchors legends to the left for `x` values less than or equal to 1/3 and", "anchors legends with respect to their center otherwise." ].join(" ") }, y: { valType: "number", editType: "legend", description: [ "Sets the y position with respect to `yref` (in normalized coordinates) of the legend.", "When `yref` is *paper*, defaults to *1* for vertical legends,", "defaults to *-0.1* for horizontal legends on graphs w/o range sliders and", "defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.", "When `yref` is *container*, defaults to *1*.", "Must be between *0* and *1* if `yref` is *container*", "and between *-2* and *3* if `yref` is *paper*." ].join(" ") }, yref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], editType: "legend", description: [ "Sets the legend's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the legend.", "Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,", "anchors legends to at their top for `y` values greater than or equal to 2/3 and", "anchors legends with respect to their middle otherwise." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of legend-driven changes in trace and pie label", "visibility. Defaults to `layout.uirevision`." ].join(" ") }, valign: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "middle", editType: "legend", description: [ "Sets the vertical alignment of the symbols with respect to their associated text." ].join(" ") }, title: { text: { valType: "string", dflt: "", editType: "legend", description: [ "Sets the title of the legend." ].join(" ") }, font: bg({ editType: "legend", description: [ "Sets this legend's title font.", "Defaults to `legend.font` with its size increased about 20%." ].join(" ") }), side: { valType: "enumerated", values: ["top", "left", "top left", "top center", "top right"], editType: "legend", description: [ "Determines the location of legend's title", "with respect to the legend items.", "Defaulted to *top* with `orientation` is *h*.", "Defaulted to *left* with `orientation` is *v*.", "The *top left* options could be used to expand", "top center and top right are for horizontal alignment", "legend area in both x and y sides." ].join(" ") }, editType: "legend" }, editType: "legend" }; var tf = {}; tf.isGrouped = function(t) { return (t.traceorder || "").indexOf("grouped") !== -1; }; tf.isVertical = function(t) { return t.orientation !== "h"; }; tf.isReversed = function(t) { return (t.traceorder || "").indexOf("reversed") !== -1; }; var _g = Nt; var ra = Ue; var eX = Mr; var tX = Wi; var rX = tD; var nX = Xc; var xg = tf; function aX(e10, t, r, n) { var a = t[e10] || {}, i = eX.newContainer(r, e10); function o(z, P) { return ra.coerce(a, i, rX, z, P); } var l = ra.coerceFont(o, "font", r.font); o("bgcolor", r.paper_bgcolor), o("bordercolor"); var s = o("visible"); if (s) { for (var u, f = function(z, P) { var R = u._input, H = u; return ra.coerce(R, H, tX, z, P); }, d = r.font || {}, h = ra.coerceFont(o, "grouptitlefont", ra.extendFlat({}, d, { size: Math.round(d.size * 1.1) })), p = 0, v = false, m = "normal", g = (r.shapes || []).filter(function(z) { return z.showlegend; }), y = n.concat(g).filter(function(z) { return e10 === (z.legend || "legend"); }), w = 0; w < y.length; w++) if (u = y[w], !!u.visible) { var k = u._isShape; (u.showlegend || u._dfltShowLegend && !(u._module && u._module.attributes && u._module.attributes.showlegend && u._module.attributes.showlegend.dflt === false)) && (p++, u.showlegend && (v = true, (!k && _g.traceIs(u, "pie-like") || u._input.showlegend === true) && p++), ra.coerceFont(f, "legendgrouptitle.font", h)), (!k && _g.traceIs(u, "bar") && r.barmode === "stack" || ["tonextx", "tonexty"].indexOf(u.fill) !== -1) && (m = xg.isGrouped({ traceorder: m }) ? "grouped+reversed" : "reversed"), u.legendgroup !== void 0 && u.legendgroup !== "" && (m = xg.isReversed({ traceorder: m }) ? "reversed+grouped" : "grouped"); } var x = ra.coerce( t, r, nX, "showlegend", v && p > (e10 === "legend" ? 1 : 0) ); if (x === false && (r[e10] = void 0), !(x === false && !a.uirevision) && (o("uirevision", r.uirevision), x !== false)) { o("borderwidth"); var _ = o("orientation"), T = o("yref"), S = o("xref"), M = _ === "h", L = T === "paper", F = S === "paper", $, I, O, G = "left"; M ? ($ = 0, _g.getComponentMethod("rangeslider", "isVisible")(t.xaxis) ? L ? (I = 1.1, O = "bottom") : (I = 1, O = "top") : L ? (I = -0.1, O = "top") : (I = 0, O = "bottom")) : (I = 1, O = "auto", F ? $ = 1.02 : ($ = 1, G = "right")), ra.coerce(a, i, { x: { valType: "number", editType: "legend", min: F ? -2 : 0, max: F ? 3 : 1, dflt: $ } }, "x"), ra.coerce(a, i, { y: { valType: "number", editType: "legend", min: L ? -2 : 0, max: L ? 3 : 1, dflt: I } }, "y"), o("traceorder", m), xg.isGrouped(r[e10]) && o("tracegroupgap"), o("entrywidth"), o("entrywidthmode"), o("itemsizing"), o("itemwidth"), o("itemclick"), o("itemdoubleclick"), o("groupclick"), o("xanchor", G), o("yanchor", O), o("valign"), ra.noneOrAll(a, i, ["x", "y"]); var K = o("title.text"); if (K) { o("title.side", M ? "left" : "top"); var V = ra.extendFlat({}, l, { size: ra.bigFont(l.size) }); ra.coerceFont(o, "title.font", V); } } } } var rD = function(t, r, n) { var a, i = n.slice(), o = r.shapes; if (o) for (a = 0; a < o.length; a++) { var l = o[a]; if (l.showlegend) { var s = { _input: l._input, visible: l.visible, showlegend: l.showlegend, legend: l.legend }; i.push(s); } } var u = ["legend"]; for (a = 0; a < i.length; a++) ra.pushUnique(u, i[a].legend); for (r._legends = [], a = 0; a < u.length; a++) { var f = u[a]; aX(f, t, r, i), r[f] && r[f].visible && (r[f]._id = f), r._legends.push(f); } }; var Oo = Nt; var Nh = Ue; var iX = Nh.pushUnique; var wg = true; var oX = function(t, r, n) { var a = r._fullLayout; if (r._dragged || r._editing) return; var i = a.legend.itemclick, o = a.legend.itemdoubleclick, l = a.legend.groupclick; n === 1 && i === "toggle" && o === "toggleothers" && wg && r.data && r._context.showTips && Nh.notifier(Nh._(r, "Double-click on legend to isolate one trace"), "long"), wg = false; var s; if (n === 1 ? s = i : n === 2 && (s = o), !s) return; var u = l === "togglegroup", f = a.hiddenlabels ? a.hiddenlabels.slice() : [], d = t.data()[0][0]; if (d.groupTitle && d.noClick) return; var h = r._fullData, p = (a.shapes || []).filter(function(Re) { return Re.showlegend; }), v = h.concat(p), m = d.trace; m._isShape && (m = m._fullInput); var g = m.legendgroup, y, w, k, x, _, T, S = {}, M = [], L = [], F = []; function $(Re, We) { var Me = M.indexOf(Re), Ve = S.visible; return Ve || (Ve = S.visible = []), M.indexOf(Re) === -1 && (M.push(Re), Me = M.length - 1), Ve[Me] = We, Me; } var I = (a.shapes || []).map(function(Re) { return Re._input; }), O = false; function G(Re, We) { I[Re].visible = We, O = true; } function K(Re, We) { if (!(d.groupTitle && !u)) { var Me = Re._fullInput || Re, Ve = Me._isShape, qe = Me.index; if (qe === void 0 && (qe = Me._index), Oo.hasTransform(Me, "groupby")) { var Qe = L[qe]; if (!Qe) { var ot = Oo.getTransformIndices(Me, "groupby"), ht = ot[ot.length - 1]; Qe = Nh.keyedContainer(Me, "transforms[" + ht + "].styles", "target", "value.visible"), L[qe] = Qe; } var vt = Qe.get(Re._group); vt === void 0 && (vt = true), vt !== false && Qe.set(Re._group, We), F[qe] = $(qe, Me.visible !== false); } else { var nt = Me.visible === false ? false : We; Ve ? G(qe, nt) : $(qe, nt); } } } var V = m.legend, z = m._fullInput, P = z && z._isShape; if (!P && Oo.traceIs(m, "pie-like")) { var R = d.label, H = f.indexOf(R); if (s === "toggle") H === -1 ? f.push(R) : f.splice(H, 1); else if (s === "toggleothers") { var B = H !== -1, W = []; for (y = 0; y < r.calcdata.length; y++) { var ee = r.calcdata[y]; for (w = 0; w < ee.length; w++) { var re = ee[w], ae = re.label; V === ee[0].trace.legend && R !== ae && (f.indexOf(ae) === -1 && (B = true), iX(f, ae), W.push(ae)); } } if (!B) for (var Q = 0; Q < W.length; Q++) { var ue = f.indexOf(W[Q]); ue !== -1 && f.splice(ue, 1); } } Oo.call("_guiRelayout", r, "hiddenlabels", f); } else { var j = g && g.length, U = [], Z; if (j) for (y = 0; y < v.length; y++) Z = v[y], Z.visible && Z.legendgroup === g && U.push(y); if (s === "toggle") { var le; switch (m.visible) { case true: le = "legendonly"; break; case false: le = false; break; case "legendonly": le = true; break; } if (j) if (u) for (y = 0; y < v.length; y++) { var J = v[y]; J.visible !== false && J.legendgroup === g && K(J, le); } else K(m, le); else K(m, le); } else if (s === "toggleothers") { var pe, ge, ve, me, Le, ze = true; for (y = 0; y < v.length; y++) if (Le = v[y], pe = Le === m, ve = Le.showlegend !== true, !(pe || ve) && (ge = j && Le.legendgroup === g, !ge && Le.legend === V && Le.visible === true && !Oo.traceIs(Le, "notLegendIsolatable"))) { ze = false; break; } for (y = 0; y < v.length; y++) if (Le = v[y], !(Le.visible === false || Le.legend !== V) && !Oo.traceIs(Le, "notLegendIsolatable")) switch (m.visible) { case "legendonly": K(Le, true); break; case true: me = ze ? true : "legendonly", pe = Le === m, ve = Le.showlegend !== true && !Le.legendgroup, ge = pe || j && Le.legendgroup === g, K(Le, ge || ve ? true : me); break; } } for (y = 0; y < L.length; y++) if (k = L[y], !!k) { var Fe = k.constructUpdate(), Oe = Object.keys(Fe); for (w = 0; w < Oe.length; w++) x = Oe[w], T = S[x] = S[x] || [], T[F[y]] = Fe[x]; } for (_ = Object.keys(S), y = 0; y < _.length; y++) for (x = _[y], w = 0; w < M.length; w++) S[x].hasOwnProperty(w) || (S[x][w] = void 0); O ? Oo.call("_guiUpdate", r, S, { shapes: I }, M) : Oo.call("_guiRestyle", r, S, M); } }; var nD = { scrollBarWidth: 6, scrollBarMinHeight: 20, scrollBarColor: "#808BA4", scrollBarMargin: 4, scrollBarEnterAttrs: { rx: 20, ry: 3, width: 0, height: 0 }, // number of px between legend title and (left) side of legend (always in x direction and from inner border) titlePad: 2, // number of px between each legend item (x and/or y direction) itemGap: 5 }; var tk = Nt; var Tg = tf; var lX = function(t, r, n) { var a = r._inHover, i = Tg.isGrouped(r), o = Tg.isReversed(r), l = {}, s = [], u = false, f = {}, d = 0, h = 0, p, v; function m(z, P, R) { if (r.visible !== false && !(n && z !== r._id)) if (P === "" || !Tg.isGrouped(r)) { var H = "~~i" + d; s.push(H), l[H] = [R], d++; } else s.indexOf(P) === -1 ? (s.push(P), u = true, l[P] = [R]) : l[P].push(R); } for (p = 0; p < t.length; p++) { var g = t[p], y = g[0], w = y.trace, k = w.legend, x = w.legendgroup; if (!(!a && (!w.visible || !w.showlegend))) if (tk.traceIs(w, "pie-like")) for (f[x] || (f[x] = {}), v = 0; v < g.length; v++) { var _ = g[v].label; f[x][_] || (m(k, x, { label: _, color: g[v].color, i: g[v].i, trace: w, pts: g[v].pts }), f[x][_] = true, h = Math.max(h, (_ || "").length)); } else m(k, x, y), h = Math.max(h, (w.name || "").length); } if (!s.length) return []; var T = !u || !i, S = []; for (p = 0; p < s.length; p++) { var M = l[s[p]]; T ? S.push(M[0]) : S.push(M); } for (T && (S = [S]), p = 0; p < S.length; p++) { var L = 1 / 0; for (v = 0; v < S[p].length; v++) { var F = S[p][v].trace.legendrank; L > F && (L = F); } S[p][0]._groupMinRank = L, S[p][0]._preGroupSort = p; } var $ = function(z, P) { return z[0]._groupMinRank - P[0]._groupMinRank || z[0]._preGroupSort - P[0]._preGroupSort; }, I = function(z, P) { return z.trace.legendrank - P.trace.legendrank || z._preSort - P._preSort; }; for (S.forEach(function(z, P) { z[0]._preGroupSort = P; }), S.sort($), p = 0; p < S.length; p++) { S[p].forEach(function(z, P) { z._preSort = P; }), S[p].sort(I); var O = S[p][0].trace, G = null; for (v = 0; v < S[p].length; v++) { var K = S[p][v].trace.legendgrouptitle; if (K && K.text) { G = K, a && (K.font = r._groupTitleFont); break; } } if (o && S[p].reverse(), G) { var V = false; for (v = 0; v < S[p].length; v++) if (tk.traceIs(S[p][v].trace, "pie-like")) { V = true; break; } S[p].unshift({ i: -1, groupTitle: G, noClick: V, trace: { showlegend: O.showlegend, legendgroup: O.legendgroup, visible: r.groupclick === "toggleitem" ? true : O.visible } }); } for (v = 0; v < S[p].length; v++) S[p][v] = [ S[p][v] ]; } return r._lgroupsLength = S.length, r._maxNameLength = h, S; }; var Sb = {}; (function(e10) { var t = Ue; function r(n) { return n.indexOf("e") !== -1 ? n.replace(/[.]?0+e/, "e") : n.indexOf(".") !== -1 ? n.replace(/[.]?0+$/, "") : n; } e10.formatPiePercent = function(a, i) { var o = r((a * 100).toPrecision(3)); return t.numSeparate(o, i) + "%"; }, e10.formatPieValue = function(a, i) { var o = r(a.toPrecision(10)); return t.numSeparate(o, i); }, e10.getFirstFilled = function(a, i) { if (t.isArrayOrTypedArray(a)) for (var o = 0; o < i.length; o++) { var l = a[i[o]]; if (l || l === 0 || l === "") return l; } }, e10.castOption = function(a, i) { if (t.isArrayOrTypedArray(a)) return e10.getFirstFilled(a, i); if (a) return a; }, e10.getRotationAngle = function(n) { return (n === "auto" ? 0 : n) * Math.PI / 180; }; })(Sb); var sX = Sr; var uX = nr; var fX = function(t, r, n, a) { var i = n.marker.pattern; i && i.shape ? sX.pointStyle(t, n, a, r) : uX.fill(t, r.color); }; var rk = nr; var nk = Sb.castOption; var cX = fX; var dX = function(t, r, n, a) { var i = n.marker.line, o = nk(i.color, r.pts) || rk.defaultLine, l = nk(i.width, r.pts) || 0; t.call(cX, r, n, a).style("stroke-width", l).call(rk.stroke, o); }; var In = lr; var kg = Nt; var Ln = Ue; var ak = Ln.strTranslate; var Gn = Sr; var Da = nr; var Ag = wi.extractOpts; var yv = Ya; var hX = dX; var vX = Sb.castOption; var pX = nD; var ik = 12; var ok = 5; var El = 2; var mX = 10; var Is = 5; var aD = function(t, r, n) { var a = r._fullLayout; n || (n = a.legend); var i = n.itemsizing === "constant", o = n.itemwidth, l = (o + pX.itemGap * 2) / 2, s = ak(l, 0), u = function(S, M, L, F) { var $; if (S + 1) $ = S; else if (M && M.width > 0) $ = M.width; else return 0; return i ? F : Math.min($, L); }; t.each(function(S) { var M = In.select(this), L = Ln.ensureSingle(M, "g", "layers"); L.style("opacity", S[0].trace.opacity); var F = n.valign, $ = S[0].lineHeight, I = S[0].height; if (F === "middle" || !$ || !I) L.attr("transform", null); else { var O = { top: 1, bottom: -1 }[F], G = O * (0.5 * ($ - I + 3)); L.attr("transform", ak(0, G)); } var K = L.selectAll("g.legendfill").data([S]); K.enter().append("g").classed("legendfill", true); var V = L.selectAll("g.legendlines").data([S]); V.enter().append("g").classed("legendlines", true); var z = L.selectAll("g.legendsymbols").data([S]); z.enter().append("g").classed("legendsymbols", true), z.selectAll("g.legendpoints").data([S]).enter().append("g").classed("legendpoints", true); }).each(T).each(h).each(v).each(p).each(g).each(x).each(k).each(f).each(d).each(y).each(w); function f(S) { var M = lk(S), L = M.showFill, F = M.showLine, $ = M.showGradientLine, I = M.showGradientFill, O = M.anyFill, G = M.anyLine, K = S[0], V = K.trace, z, P, R = Ag(V), H = R.colorscale, B = R.reversescale, W = function(U) { if (U.size()) if (L) Gn.fillGroupStyle(U, r); else { var Z = "legendfill-" + V.uid; Gn.gradient( U, r, Z, Mg(B), H, "fill" ); } }, ee = function(U) { if (U.size()) { var Z = "legendline-" + V.uid; Gn.lineGroupStyle(U), Gn.gradient( U, r, Z, Mg(B), H, "stroke" ); } }, re = yv.hasMarkers(V) || !O ? "M5,0" : ( // with a line leave it slightly below center, to leave room for the // line thickness and because the line is usually more prominent G ? "M5,-2" : "M5,-3" ), ae = In.select(this), Q = ae.select(".legendfill").selectAll("path").data(L || I ? [S] : []); if (Q.enter().append("path").classed("js-fill", true), Q.exit().remove(), Q.attr("d", re + "h" + o + "v6h-" + o + "z").call(W), F || $) { var ue = u(void 0, V.line, mX, ok); P = Ln.minExtend(V, { line: { width: ue } }), z = [Ln.minExtend(K, { trace: P })]; } var j = ae.select(".legendlines").selectAll("path").data(F || $ ? [z] : []); j.enter().append("path").classed("js-line", true), j.exit().remove(), j.attr("d", re + ($ ? "l" + o + ",0.0001" : "h" + o)).call(F ? Gn.lineGroupStyle : ee); } function d(S) { var M = lk(S), L = M.anyFill, F = M.anyLine, $ = M.showLine, I = M.showMarker, O = S[0], G = O.trace, K = !I && !F && !L && yv.hasText(G), V, z; function P(Q, ue, j, U) { var Z = Ln.nestedProperty(G, Q).get(), le = Ln.isArrayOrTypedArray(Z) && ue ? ue(Z) : Z; if (i && le && U !== void 0 && (le = U), j) { if (le < j[0]) return j[0]; if (le > j[1]) return j[1]; } return le; } function R(Q) { return O._distinct && O.index && Q[O.index] ? Q[O.index] : Q[0]; } if (I || K || $) { var H = {}, B = {}; if (I) { H.mc = P("marker.color", R), H.mx = P("marker.symbol", R), H.mo = P("marker.opacity", Ln.mean, [0.2, 1]), H.mlc = P("marker.line.color", R), H.mlw = P("marker.line.width", Ln.mean, [0, 5], El), B.marker = { sizeref: 1, sizemin: 1, sizemode: "diameter" }; var W = P("marker.size", Ln.mean, [2, 16], ik); H.ms = W, B.marker.size = W; } $ && (B.line = { width: P("line.width", R, [0, 10], ok) }), K && (H.tx = "Aa", H.tp = P("textposition", R), H.ts = 10, H.tc = P("textfont.color", R), H.tf = P("textfont.family", R)), V = [Ln.minExtend(O, H)], z = Ln.minExtend(G, B), z.selectedpoints = null, z.texttemplate = null; } var ee = In.select(this).select("g.legendpoints"), re = ee.selectAll("path.scatterpts").data(I ? V : []); re.enter().insert("path", ":first-child").classed("scatterpts", true).attr("transform", s), re.exit().remove(), re.call(Gn.pointStyle, z, r), I && (V[0].mrc = 3); var ae = ee.selectAll("g.pointtext").data(K ? V : []); ae.enter().append("g").classed("pointtext", true).append("text").attr("transform", s), ae.exit().remove(), ae.selectAll("text").call(Gn.textPointStyle, z, r); } function h(S) { var M = S[0].trace, L = M.type === "waterfall"; if (S[0]._distinct && L) { var F = S[0].trace[S[0].dir].marker; return S[0].mc = F.color, S[0].mlw = F.line.width, S[0].mlc = F.line.color, m(S, this, "waterfall"); } var $ = []; M.visible && L && ($ = S[0].hasTotals ? [["increasing", "M-6,-6V6H0Z"], ["totals", "M6,6H0L-6,-6H-0Z"], ["decreasing", "M6,6V-6H0Z"]] : [["increasing", "M-6,-6V6H6Z"], ["decreasing", "M6,6V-6H-6Z"]]); var I = In.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data($); I.enter().append("path").classed("legendwaterfall", true).attr("transform", s).style("stroke-miterlimit", 1), I.exit().remove(), I.each(function(O) { var G = In.select(this), K = M[O[0]].marker, V = u(void 0, K.line, Is, El); G.attr("d", O[1]).style("stroke-width", V + "px").call(Da.fill, K.color), V && G.call(Da.stroke, K.line.color); }); } function p(S) { m(S, this); } function v(S) { m(S, this, "funnel"); } function m(S, M, L) { var F = S[0].trace, $ = F.marker || {}, I = $.line || {}, O = L ? F.visible && F.type === L : kg.traceIs(F, "bar"), G = In.select(M).select("g.legendpoints").selectAll("path.legend" + L).data(O ? [S] : []); G.enter().append("path").classed("legend" + L, true).attr("d", "M6,6H-6V-6H6Z").attr("transform", s), G.exit().remove(), G.each(function(K) { var V = In.select(this), z = K[0], P = u(z.mlw, $.line, Is, El); V.style("stroke-width", P + "px"); var R = z.mcc; if (!n._inHover && "mc" in z) { var H = Ag($), B = H.mid; B === void 0 && (B = (H.max + H.min) / 2), R = Gn.tryColorscale($, "")(B); } var W = R || z.mc || $.color, ee = $.pattern, re = ee && Gn.getPatternAttr(ee.shape, 0, ""); if (re) { var ae = Gn.getPatternAttr(ee.bgcolor, 0, null), Q = Gn.getPatternAttr(ee.fgcolor, 0, null), ue = ee.fgopacity, j = sk(ee.size, 8, 10), U = sk(ee.solidity, 0.5, 1), Z = "legend-" + F.uid; V.call( Gn.pattern, "legend", r, Z, re, j, U, R, ee.fillmode, ae, Q, ue ); } else V.call(Da.fill, W); P && Da.stroke(V, z.mlc || I.color); }); } function g(S) { var M = S[0].trace, L = In.select(this).select("g.legendpoints").selectAll("path.legendbox").data(M.visible && kg.traceIs(M, "box-violin") ? [S] : []); L.enter().append("path").classed("legendbox", true).attr("d", "M6,6H-6V-6H6Z").attr("transform", s), L.exit().remove(), L.each(function() { var F = In.select(this); if ((M.boxpoints === "all" || M.points === "all") && Da.opacity(M.fillcolor) === 0 && Da.opacity((M.line || {}).color) === 0) { var $ = Ln.minExtend(M, { marker: { size: i ? ik : Ln.constrain(M.marker.size, 2, 16), sizeref: 1, sizemin: 1, sizemode: "diameter" } }); L.call(Gn.pointStyle, $, r); } else { var I = u(void 0, M.line, Is, El); F.style("stroke-width", I + "px").call(Da.fill, M.fillcolor), I && Da.stroke(F, M.line.color); } }); } function y(S) { var M = S[0].trace, L = In.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(M.visible && M.type === "candlestick" ? [S, S] : []); L.enter().append("path").classed("legendcandle", true).attr("d", function(F, $) { return $ ? "M-15,0H-8M-8,6V-6H8Z" : "M15,0H8M8,-6V6H-8Z"; }).attr("transform", s).style("stroke-miterlimit", 1), L.exit().remove(), L.each(function(F, $) { var I = In.select(this), O = M[$ ? "increasing" : "decreasing"], G = u(void 0, O.line, Is, El); I.style("stroke-width", G + "px").call(Da.fill, O.fillcolor), G && Da.stroke(I, O.line.color); }); } function w(S) { var M = S[0].trace, L = In.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(M.visible && M.type === "ohlc" ? [S, S] : []); L.enter().append("path").classed("legendohlc", true).attr("d", function(F, $) { return $ ? "M-15,0H0M-8,-6V0" : "M15,0H0M8,6V0"; }).attr("transform", s).style("stroke-miterlimit", 1), L.exit().remove(), L.each(function(F, $) { var I = In.select(this), O = M[$ ? "increasing" : "decreasing"], G = u(void 0, O.line, Is, El); I.style("fill", "none").call(Gn.dashLine, O.line.dash, G), G && Da.stroke(I, O.line.color); }); } function k(S) { _(S, this, "pie"); } function x(S) { _(S, this, "funnelarea"); } function _(S, M, L) { var F = S[0], $ = F.trace, I = L ? $.visible && $.type === L : kg.traceIs($, L), O = In.select(M).select("g.legendpoints").selectAll("path.legend" + L).data(I ? [S] : []); if (O.enter().append("path").classed("legend" + L, true).attr("d", "M6,6H-6V-6H6Z").attr("transform", s), O.exit().remove(), O.size()) { var G = $.marker || {}, K = u(vX(G.line.width, F.pts), G.line, Is, El), V = "pieLike", z = Ln.minExtend($, { marker: { line: { width: K } } }, V), P = Ln.minExtend(F, { trace: z }, V); hX(O, P, z, r); } } function T(S) { var M = S[0].trace, L, F = []; if (M.visible) switch (M.type) { case "histogram2d": case "heatmap": F = [ ["M-15,-2V4H15V-2Z"] // similar to contour ], L = true; break; case "choropleth": case "choroplethmapbox": F = [ ["M-6,-6V6H6V-6Z"] ], L = true; break; case "densitymapbox": F = [ ["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"] ], L = "radial"; break; case "cone": F = [ ["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"], ["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"] ], L = false; break; case "streamtube": F = [ ["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"], ["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"] ], L = false; break; case "surface": F = [ ["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"], ["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"] ], L = true; break; case "mesh3d": F = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"] ], L = false; break; case "volume": F = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"] ], L = true; break; case "isosurface": F = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"] ], L = false; break; } var $ = In.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(F); $.enter().append("path").classed("legend3dandfriends", true).attr("transform", s).style("stroke-miterlimit", 1), $.exit().remove(), $.each(function(I, O) { var G = In.select(this), K = Ag(M), V = K.colorscale, z = K.reversescale, P = function(W) { if (W.size()) { var ee = "legendfill-" + M.uid; Gn.gradient( W, r, ee, Mg(z, L === "radial"), V, "fill" ); } }, R; if (V) { if (!L) { var B = V.length; R = O === 0 ? V[z ? B - 1 : 0][1] : ( // minimum O === 1 ? V[z ? 0 : B - 1][1] : ( // maximum V[Math.floor((B - 1) / 2)][1] ) ); } } else { var H = M.vertexcolor || M.facecolor || M.color; R = Ln.isArrayOrTypedArray(H) ? H[O] || H[0] : H; } G.attr("d", I[0]), R ? G.call(Da.fill, R) : G.call(P); }); } }; function Mg(e10, t) { var r = t ? "radial" : "horizontal"; return r + (e10 ? "" : "reversed"); } function lk(e10) { var t = e10[0].trace, r = t.contours, n = yv.hasLines(t), a = yv.hasMarkers(t), i = t.visible && t.fill && t.fill !== "none", o = false, l = false; if (r) { var s = r.coloring; s === "lines" ? o = true : n = s === "none" || s === "heatmap" || r.showlines, r.type === "constraint" ? i = r._operation !== "=" : (s === "fill" || s === "heatmap") && (l = true); } return { showMarker: a, showLine: n, showFill: i, showGradientLine: o, showGradientFill: l, anyLine: n || o, anyFill: i || l }; } function sk(e10, t, r) { return e10 && Ln.isArrayOrTypedArray(e10) ? t : e10 > r ? r : e10; } var aa = lr; var Xr = Ue; var Ry = Tn; var Qo = Nt; var uk = xp; var Sg = Qi; var nn = Sr; var Oh = nr; var Ql = Rn; var fk = oX; var fn = nD; var Cb = On; var iD = Cb.LINE_SPACING; var du = Cb.FROM_TL; var ck = Cb.FROM_BR; var dk = lX; var gX = aD; var hk = tf; var au = 1; var yX = /^legend[0-9]*$/; var oD = function(t, r) { if (r) vk(t, r); else { var n = t._fullLayout, a = n._legends, i = n._infolayer.selectAll('[class^="legend"]'); i.each(function() { var u = aa.select(this), f = u.attr("class"), d = f.split(" ")[0]; d.match(yX) && a.indexOf(d) === -1 && u.remove(); }); for (var o = 0; o < a.length; o++) { var l = a[o], s = t._fullLayout[l]; vk(t, s); } } }; function bX(e10, t, r) { if (!(t.title.side !== "top center" && t.title.side !== "top right")) { var n = t.title.font, a = n.size * iD, i = 0, o = e10.node(), l = nn.bBox(o).width; t.title.side === "top center" ? i = 0.5 * (t._width - 2 * r - 2 * fn.titlePad - l) : t.title.side === "top right" && (i = t._width - 2 * r - 2 * fn.titlePad - l), Ql.positionText( e10, r + fn.titlePad + i, r + a ); } } function vk(e10, t) { var r = t || {}, n = e10._fullLayout, a = $p(r), i, o, l = r._inHover; if (l ? (o = r.layer, i = "hover") : (o = n._infolayer, i = a), !!o) { i += n._uid, e10._legendMouseDownTime || (e10._legendMouseDownTime = 0); var s; if (l) { if (!r.entries) return; s = dk(r.entries, r); } else { for (var u = (e10.calcdata || []).slice(), f = n.shapes, d = 0; d < f.length; d++) { var h = f[d]; if (h.showlegend) { var p = { _isShape: true, _fullInput: h, index: h._index, name: h.name || h.label.text || "shape " + h._index, legend: h.legend, legendgroup: h.legendgroup, legendgrouptitle: h.legendgrouptitle, legendrank: h.legendrank, legendwidth: h.legendwidth, showlegend: h.showlegend, visible: h.visible, opacity: h.opacity, mode: h.type === "line" ? "lines" : "markers", line: h.line, marker: { line: h.line, color: h.fillcolor, size: 12, symbol: h.type === "rect" ? "square" : h.type === "circle" ? "circle" : ( // case of path "hexagon2" ) } }; u.push([{ trace: p }]); } } s = n.showlegend && dk(u, r, n._legends.length > 1); } var v = n.hiddenlabels || []; if (!l && (!n.showlegend || !s.length)) return o.selectAll("." + a).remove(), n._topdefs.select("#" + i).remove(), Ry.autoMargin(e10, a); var m = Xr.ensureSingle(o, "g", a, function(M) { l || M.attr("pointer-events", "all"); }), g = Xr.ensureSingleById(n._topdefs, "clipPath", i, function(M) { M.append("rect"); }), y = Xr.ensureSingle(m, "rect", "bg", function(M) { M.attr("shape-rendering", "crispEdges"); }); y.call(Oh.stroke, r.bordercolor).call(Oh.fill, r.bgcolor).style("stroke-width", r.borderwidth + "px"); var w = Xr.ensureSingle(m, "g", "scrollbox"), k = r.title; r._titleWidth = 0, r._titleHeight = 0; var x; k.text ? (x = Xr.ensureSingle(w, "text", a + "titletext"), x.attr("text-anchor", "start").call(nn.font, k.font).text(k.text), Hh(x, w, e10, r, au)) : w.selectAll("." + a + "titletext").remove(); var _ = Xr.ensureSingle(m, "rect", "scrollbar", function(M) { M.attr(fn.scrollBarEnterAttrs).call(Oh.fill, fn.scrollBarColor); }), T = w.selectAll("g.groups").data(s); T.enter().append("g").attr("class", "groups"), T.exit().remove(); var S = T.selectAll("g.traces").data(Xr.identity); S.enter().append("g").attr("class", "traces"), S.exit().remove(), S.style("opacity", function(M) { var L = M[0].trace; return Qo.traceIs(L, "pie-like") ? v.indexOf(M[0].label) !== -1 ? 0.5 : 1 : L.visible === "legendonly" ? 0.5 : 1; }).each(function() { aa.select(this).call(_X, e10, r); }).call(gX, e10, r).each(function() { l || aa.select(this).call(xX, e10, a); }), Xr.syncOrAsync([ Ry.previousPromises, function() { return kX(e10, T, S, r); }, function() { var M = n._size, L = r.borderwidth, F = r.xref === "paper", $ = r.yref === "paper"; if (k.text && bX(x, r, L), !l) { var I, O; F ? I = M.l + M.w * r.x - du[bv(r)] * r._width : I = n.width * r.x - du[bv(r)] * r._width, $ ? O = M.t + M.h * (1 - r.y) - du[_v(r)] * r._effHeight : O = n.height * (1 - r.y) - du[_v(r)] * r._effHeight; var G = AX(e10, a, I, O); if (G) return; if (n.margin.autoexpand) { var K = I, V = O; I = F ? Xr.constrain(I, 0, n.width - r._width) : K, O = $ ? Xr.constrain(O, 0, n.height - r._effHeight) : V, I !== K && Xr.log("Constrain " + a + ".x to make legend fit inside graph"), O !== V && Xr.log("Constrain " + a + ".y to make legend fit inside graph"); } nn.setTranslate(m, I, O); } if (_.on(".drag", null), m.on("wheel", null), l || r._height <= r._maxHeight || e10._context.staticPlot) { var z = r._effHeight; l && (z = r._height), y.attr({ width: r._width - L, height: z - L, x: L / 2, y: L / 2 }), nn.setTranslate(w, 0, 0), g.select("rect").attr({ width: r._width - 2 * L, height: z - 2 * L, x: L, y: L }), nn.setClipUrl(w, i, e10), nn.setRect(_, 0, 0, 0, 0), delete r._scrollY; } else { var P = Math.max( fn.scrollBarMinHeight, r._effHeight * r._effHeight / r._height ), R = r._effHeight - P - 2 * fn.scrollBarMargin, H = r._height - r._effHeight, B = R / H, W = Math.min(r._scrollY || 0, H); y.attr({ width: r._width - 2 * L + fn.scrollBarWidth + fn.scrollBarMargin, height: r._effHeight - L, x: L / 2, y: L / 2 }), g.select("rect").attr({ width: r._width - 2 * L + fn.scrollBarWidth + fn.scrollBarMargin, height: r._effHeight - 2 * L, x: L, y: L + W }), nn.setClipUrl(w, i, e10), Z(W, P, B), m.on("wheel", function() { W = Xr.constrain( r._scrollY + aa.event.deltaY / R * H, 0, H ), Z(W, P, B), W !== 0 && W !== H && aa.event.preventDefault(); }); var ee, re, ae, Q = function(ve, me, Le) { var ze = (Le - me) / B + ve; return Xr.constrain(ze, 0, H); }, ue = function(ve, me, Le) { var ze = (me - Le) / B + ve; return Xr.constrain(ze, 0, H); }, j = aa.behavior.drag().on("dragstart", function() { var ve = aa.event.sourceEvent; ve.type === "touchstart" ? ee = ve.changedTouches[0].clientY : ee = ve.clientY, ae = W; }).on("drag", function() { var ve = aa.event.sourceEvent; ve.buttons === 2 || ve.ctrlKey || (ve.type === "touchmove" ? re = ve.changedTouches[0].clientY : re = ve.clientY, W = Q(ae, ee, re), Z(W, P, B)); }); _.call(j); var U = aa.behavior.drag().on("dragstart", function() { var ve = aa.event.sourceEvent; ve.type === "touchstart" && (ee = ve.changedTouches[0].clientY, ae = W); }).on("drag", function() { var ve = aa.event.sourceEvent; ve.type === "touchmove" && (re = ve.changedTouches[0].clientY, W = ue(ae, ee, re), Z(W, P, B)); }); w.call(U); } function Z(ve, me, Le) { r._scrollY = e10._fullLayout[a]._scrollY = ve, nn.setTranslate(w, 0, -ve), nn.setRect( _, r._width, fn.scrollBarMargin + ve * Le, fn.scrollBarWidth, me ), g.select("rect").attr("y", L + ve); } if (e10._context.edits.legendPosition) { var le, J, pe, ge; m.classed("cursor-move", true), Sg.init({ element: m.node(), gd: e10, prepFn: function() { var ve = nn.getTranslate(m); pe = ve.x, ge = ve.y; }, moveFn: function(ve, me) { var Le = pe + ve, ze = ge + me; nn.setTranslate(m, Le, ze), le = Sg.align(Le, r._width, M.l, M.l + M.w, r.xanchor), J = Sg.align(ze + r._height, -r._height, M.t + M.h, M.t, r.yanchor); }, doneFn: function() { if (le !== void 0 && J !== void 0) { var ve = {}; ve[a + ".x"] = le, ve[a + ".y"] = J, Qo.call("_guiRelayout", e10, ve); } }, clickFn: function(ve, me) { var Le = o.selectAll("g.traces").filter(function() { var ze = this.getBoundingClientRect(); return me.clientX >= ze.left && me.clientX <= ze.right && me.clientY >= ze.top && me.clientY <= ze.bottom; }); Le.size() > 0 && lD(e10, m, Le, ve, me); } }); } } ], e10); } } function th(e10, t, r) { var n = e10[0], a = n.width, i = t.entrywidthmode, o = n.trace.legendwidth || t.entrywidth; return i === "fraction" ? t._maxWidth * o : r + (o || a); } function lD(e10, t, r, n, a) { var i = r.data()[0][0].trace, o = { event: a, node: r.node(), curveNumber: i.index, expandedIndex: i._expandedIndex, data: e10.data, layout: e10.layout, frames: e10._transitionData._frames, config: e10._context, fullData: e10._fullData, fullLayout: e10._fullLayout }; i._group && (o.group = i._group), Qo.traceIs(i, "pie-like") && (o.label = r.datum()[0].label); var l = uk.triggerHandler(e10, "plotly_legendclick", o); if (n === 1) { if (l === false) return; t._clickTimeout = setTimeout(function() { e10._fullLayout && fk(r, e10, n); }, e10._context.doubleClickDelay); } else if (n === 2) { t._clickTimeout && clearTimeout(t._clickTimeout), e10._legendMouseDownTime = 0; var s = uk.triggerHandler(e10, "plotly_legenddoubleclick", o); s !== false && l !== false && fk(r, e10, n); } } function _X(e10, t, r) { var n = $p(r), a = e10.data()[0][0], i = a.trace, o = Qo.traceIs(i, "pie-like"), l = !r._inHover && t._context.edits.legendText && !o, s = r._maxNameLength, u, f; a.groupTitle ? (u = a.groupTitle.text, f = a.groupTitle.font) : (f = r.font, r.entries ? u = a.text : (u = o ? a.label : i.name, i._meta && (u = Xr.templateString(u, i._meta)))); var d = Xr.ensureSingle(e10, "text", n + "text"); d.attr("text-anchor", "start").call(nn.font, f).text(l ? pk(u, s) : u); var h = r.itemwidth + fn.itemGap * 2; Ql.positionText(d, h, 0), l ? d.call(Ql.makeEditable, { gd: t, text: u }).call(Hh, e10, t, r).on("edit", function(p) { this.text(pk(p, s)).call(Hh, e10, t, r); var v = a.trace._fullInput || {}, m = {}; if (Qo.hasTransform(v, "groupby")) { var g = Qo.getTransformIndices(v, "groupby"), y = g[g.length - 1], w = Xr.keyedContainer(v, "transforms[" + y + "].styles", "target", "value.name"); w.set(a.trace._group, p), m = w.constructUpdate(); } else m.name = p; return v._isShape ? Qo.call("_guiRelayout", t, "shapes[" + i.index + "].name", m.name) : Qo.call("_guiRestyle", t, m, i.index); }) : Hh(d, e10, t, r); } function pk(e10, t) { var r = Math.max(4, t); if (e10 && e10.trim().length >= r / 2) return e10; e10 = e10 || ""; for (var n = r - e10.length; n > 0; n--) e10 += " "; return e10; } function xX(e10, t, r) { var n = t._context.doubleClickDelay, a, i = 1, o = Xr.ensureSingle(e10, "rect", r + "toggle", function(l) { t._context.staticPlot || l.style("cursor", "pointer").attr("pointer-events", "all"), l.call(Oh.fill, "rgba(0,0,0,0)"); }); t._context.staticPlot || (o.on("mousedown", function() { a = (/* @__PURE__ */ new Date()).getTime(), a - t._legendMouseDownTime < n ? i += 1 : (i = 1, t._legendMouseDownTime = a); }), o.on("mouseup", function() { if (!(t._dragged || t._editing)) { var l = t._fullLayout[r]; (/* @__PURE__ */ new Date()).getTime() - t._legendMouseDownTime > n && (i = Math.max(i - 1, 1)), lD(t, l, e10, i, aa.event); } })); } function Hh(e10, t, r, n, a) { n._inHover && e10.attr("data-notex", true), Ql.convertToTspans(e10, r, function() { wX(t, r, n, a); }); } function wX(e10, t, r, n) { var a = e10.data()[0][0]; if (!r._inHover && a && !a.trace.showlegend) { e10.remove(); return; } var i = e10.select("g[class*=math-group]"), o = i.node(), l = $p(r); r || (r = t._fullLayout[l]); var s = r.borderwidth, u; n === au ? u = r.title.font : a.groupTitle ? u = a.groupTitle.font : u = r.font; var f = u.size * iD, d, h; if (o) { var p = nn.bBox(o); d = p.height, h = p.width, n === au ? nn.setTranslate(i, s, s + d * 0.75) : nn.setTranslate(i, 0, d * 0.25); } else { var v = "." + l + (n === au ? "title" : "") + "text", m = e10.select(v), g = Ql.lineCount(m), y = m.node(); if (d = f * g, h = y ? nn.bBox(y).width : 0, n === au) r.title.side === "left" && (h += fn.itemGap * 2), Ql.positionText( m, s + fn.titlePad, s + f ); else { var w = fn.itemGap * 2 + r.itemwidth; a.groupTitle && (w = fn.itemGap, h -= r.itemwidth), Ql.positionText( m, w, -f * ((g - 1) / 2 - 0.3) ); } } n === au ? (r._titleWidth = h, r._titleHeight = d) : (a.lineHeight = f, a.height = Math.max(d, 16) + 3, a.width = h); } function TX(e10) { var t = 0, r = 0, n = e10.title.side; return n && (n.indexOf("left") !== -1 && (t = e10._titleWidth), n.indexOf("top") !== -1 && (r = e10._titleHeight)), [t, r]; } function kX(e10, t, r, n) { var a = e10._fullLayout, i = $p(n); n || (n = a[i]); var o = a._size, l = hk.isVertical(n), s = hk.isGrouped(n), u = n.entrywidthmode === "fraction", f = n.borderwidth, d = 2 * f, h = fn.itemGap, p = n.itemwidth + h * 2, v = 2 * (f + h), m = _v(n), g = n.y < 0 || n.y === 0 && m === "top", y = n.y > 1 || n.y === 1 && m === "bottom", w = n.tracegroupgap, k = {}; n._maxHeight = Math.max( g || y ? a.height / 2 : o.h, 30 ); var x = 0; n._width = 0, n._height = 0; var _ = TX(n); if (l) r.each(function(ae) { var Q = ae[0].height; nn.setTranslate( this, f + _[0], f + _[1] + n._height + Q / 2 + h ), n._height += Q, n._width = Math.max(n._width, ae[0].width); }), x = p + n._width, n._width += h + p + d, n._height += v, s && (t.each(function(ae, Q) { nn.setTranslate(this, 0, Q * n.tracegroupgap); }), n._height += (n._lgroupsLength - 1) * n.tracegroupgap); else { var T = bv(n), S = n.x < 0 || n.x === 0 && T === "right", M = n.x > 1 || n.x === 1 && T === "left", L = y || g, F = a.width / 2; n._maxWidth = Math.max( S ? L && T === "left" ? o.l + o.w : F : M ? L && T === "right" ? o.r + o.w : F : o.w, 2 * p ); var $ = 0, I = 0; r.each(function(ae) { var Q = th(ae, n, p); $ = Math.max($, Q), I += Q; }), x = null; var O = 0; if (s) { var G = 0, K = 0, V = 0; t.each(function() { var ae = 0, Q = 0; aa.select(this).selectAll("g.traces").each(function(j) { var U = th(j, n, p), Z = j[0].height; nn.setTranslate( this, _[0], _[1] + f + h + Z / 2 + Q ), Q += Z, ae = Math.max(ae, U), k[j[0].trace.legendgroup] = ae; }); var ue = ae + h; K > 0 && // goes beyound limit ue + f + K > n._maxWidth ? (O = Math.max(O, K), K = 0, V += G + w, G = Q) : G = Math.max(G, Q), nn.setTranslate(this, K, V), K += ue; }), n._width = Math.max(O, K) + f, n._height = V + G + v; } else { var z = r.size(), P = I + d + (z - 1) * h < n._maxWidth, R = 0, H = 0, B = 0, W = 0; r.each(function(ae) { var Q = ae[0].height, ue = th(ae, n, p), j = P ? ue : $; u || (j += h), j + f + H - h >= n._maxWidth && (O = Math.max(O, W), H = 0, B += R, n._height += R, R = 0), nn.setTranslate( this, _[0] + f + H, _[1] + f + B + Q / 2 + h ), W = H + ue + h, H += j, R = Math.max(R, Q); }), P ? (n._width = H + d, n._height = R + v) : (n._width = Math.max(O, W) + d, n._height += R + v); } } n._width = Math.ceil( Math.max( n._width + _[0], n._titleWidth + 2 * (f + fn.titlePad) ) ), n._height = Math.ceil( Math.max( n._height + _[1], n._titleHeight + 2 * (f + fn.itemGap) ) ), n._effHeight = Math.min(n._height, n._maxHeight); var ee = e10._context.edits, re = ee.legendText || ee.legendPosition; r.each(function(ae) { var Q = aa.select(this).select("." + i + "toggle"), ue = ae[0].height, j = ae[0].trace.legendgroup, U = th(ae, n, p); s && j !== "" && (U = k[j]); var Z = re ? p : x || U; !l && !u && (Z += h / 2), nn.setRect(Q, 0, -ue / 2, Z, ue); }); } function AX(e10, t, r, n) { var a = e10._fullLayout, i = a[t], o = bv(i), l = _v(i), s = i.xref === "paper", u = i.yref === "paper"; e10._fullLayout._reservedMargin[t] = {}; var f = i.y < 0.5 ? "b" : "t", d = i.x < 0.5 ? "l" : "r", h = { r: a.width - r, l: r + i._width, b: a.height - n, t: n + i._effHeight }; if (s && u) return Ry.autoMargin(e10, t, { x: i.x, y: i.y, l: i._width * du[o], r: i._width * ck[o], b: i._effHeight * ck[l], t: i._effHeight * du[l] }); s ? e10._fullLayout._reservedMargin[t][f] = h[f] : u || i.orientation === "v" ? e10._fullLayout._reservedMargin[t][d] = h[d] : e10._fullLayout._reservedMargin[t][f] = h[f]; } function bv(e10) { return Xr.isRightAnchor(e10) ? "right" : Xr.isCenterAnchor(e10) ? "center" : "left"; } function _v(e10) { return Xr.isBottomAnchor(e10) ? "bottom" : Xr.isMiddleAnchor(e10) ? "middle" : "top"; } function $p(e10) { return e10._id || "legend"; } var Bl = lr; var so = sr; var mk = bi; var Kr = Ue; var Cg = Kr.strTranslate; var MX = Kr.strRotate; var SX = xp; var Ra = Rn; var CX = JY; var $i = Sr; var pn = nr; var rh = Qi; var Yo = Cr; var Pu = Nt; var ii = Do; var us = sp; var LX = rD; var DX = oD; var sD = us.YANGLE; var Lb = Math.PI * sD / 180; var EX = 1 / Math.sin(Lb); var FX = Math.cos(Lb); var RX = Math.sin(Lb); var br = us.HOVERARROWSIZE; var rr = us.HOVERTEXTPAD; var gk = { box: true, ohlc: true, violin: true, candlestick: true }; var PX = { scatter: true, scattergl: true, splom: true }; Pp.hover = function(t, r, n, a) { t = Kr.getGraphDiv(t); var i = r.target; Kr.throttle( t._fullLayout._uid + us.HOVERID, us.HOVERMINTIME, function() { $X(t, r, n, a, i); } ); }; Pp.loneHover = function(t, r) { var n = true; Array.isArray(t) || (n = false, t = [t]); var a = r.gd, i = hD(a), o = vD(a), l = t.map(function(g) { var y = g._x0 || g.x0 || g.x || 0, w = g._x1 || g.x1 || g.x || 0, k = g._y0 || g.y0 || g.y || 0, x = g._y1 || g.y1 || g.y || 0, _ = g.eventData; if (_) { var T = Math.min(y, w), S = Math.max(y, w), M = Math.min(k, x), L = Math.max(k, x), F = g.trace; if (Pu.traceIs(F, "gl3d")) { var $ = a._fullLayout[F.scene]._scene.container, I = $.offsetLeft, O = $.offsetTop; T += I, S += I, M += O, L += O; } _.bbox = { x0: T + o, x1: S + o, y0: M + i, y1: L + i }, r.inOut_bbox && r.inOut_bbox.push(_.bbox); } else _ = false; return { color: g.color || pn.defaultLine, x0: g.x0 || g.x || 0, x1: g.x1 || g.x || 0, y0: g.y0 || g.y || 0, y1: g.y1 || g.y || 0, xLabel: g.xLabel, yLabel: g.yLabel, zLabel: g.zLabel, text: g.text, name: g.name, idealAlign: g.idealAlign, // optional extra bits of styling borderColor: g.borderColor, fontFamily: g.fontFamily, fontSize: g.fontSize, fontColor: g.fontColor, nameLength: g.nameLength, textAlign: g.textAlign, // filler to make createHoverText happy trace: g.trace || { index: 0, hoverinfo: "" }, xa: { _offset: 0 }, ya: { _offset: 0 }, index: 0, hovertemplate: g.hovertemplate || false, hovertemplateLabels: g.hovertemplateLabels || false, eventData: _ }; }), s = false, u = fD(l, { gd: a, hovermode: "closest", rotateLabels: s, bgColor: r.bgColor || pn.background, container: Bl.select(r.container), outerContainer: r.outerContainer || r.container }), f = u.hoverLabels, d = 5, h = 0, p = 0; f.sort(function(g, y) { return g.y0 - y.y0; }).each(function(g, y) { var w = g.y0 - g.by / 2; w - d < h ? g.offset = h - w + d : g.offset = 0, h = w + g.by + g.offset, y === r.anchorIndex && (p = g.offset); }).each(function(g) { g.offset -= p; }); var v = a._fullLayout._invScaleX, m = a._fullLayout._invScaleY; return dD(f, s, v, m), n ? f : f.node(); }; function $X(e10, t, r, n, a) { r || (r = "xy"); var i = Array.isArray(r) ? r : [r], o = e10._fullLayout, l = o._plots || [], s = l[r], u = o._has("cartesian"); if (s) { var f = s.overlays.map(function(ie) { return ie.id; }); i = i.concat(f); } for (var d = i.length, h = new Array(d), p = new Array(d), v = false, m = 0; m < d; m++) { var g = i[m]; if (l[g]) v = true, h[m] = l[g].xaxis, p[m] = l[g].yaxis; else if (o[g] && o[g]._subplot) { var y = o[g]._subplot; h[m] = y.xaxis, p[m] = y.yaxis; } else { Kr.warn("Unrecognized subplot: " + g); return; } } var w = t.hovermode || o.hovermode; if (w && !v && (w = "closest"), ["x", "y", "closest", "x unified", "y unified"].indexOf(w) === -1 || !e10.calcdata || e10.querySelector(".zoombox") || e10._dragging) return rh.unhoverRaw(e10, t); var k = o.hoverdistance; k === -1 && (k = 1 / 0); var x = o.spikedistance; x === -1 && (x = 1 / 0); var _ = [], T = [], S, M, L, F, $, I, O, G, K, V, z, P, R, H = { hLinePoint: null, vLinePoint: null }, B = false; if (Array.isArray(t)) for (w = "array", L = 0; L < t.length; L++) $ = e10.calcdata[t[L].curveNumber || 0], $ && (I = $[0].trace, $[0].trace.hoverinfo !== "skip" && (T.push($), I.orientation === "h" && (B = true))); else { for (F = 0; F < e10.calcdata.length; F++) $ = e10.calcdata[F], I = $[0].trace, I.hoverinfo !== "skip" && ii.isTraceInSubplots(I, i) && (T.push($), I.orientation === "h" && (B = true)); var W = !a, ee, re; if (W) "xpx" in t ? ee = t.xpx : ee = h[0]._length / 2, "ypx" in t ? re = t.ypx : re = p[0]._length / 2; else { if (SX.triggerHandler(e10, "plotly_beforehover", t) === false) return; var ae = a.getBoundingClientRect(); ee = t.clientX - ae.left, re = t.clientY - ae.top, o._calcInverseTransform(e10); var Q = Kr.apply3DTransform(o._invTransform)(ee, re); if (ee = Q[0], re = Q[1], ee < 0 || ee > h[0]._length || re < 0 || re > p[0]._length) return rh.unhoverRaw(e10, t); } if (t.pointerX = ee + h[0]._offset, t.pointerY = re + p[0]._offset, "xval" in t ? S = ii.flat(i, t.xval) : S = ii.p2c(h, ee), "yval" in t ? M = ii.flat(i, t.yval) : M = ii.p2c(p, re), !so(S[0]) || !so(M[0])) return Kr.warn("Fx.hover failed", t, e10), rh.unhoverRaw(e10, t); } var ue = 1 / 0; function j(ie, fe) { for (F = 0; F < T.length; F++) if ($ = T[F], !(!$ || !$[0] || !$[0].trace) && (I = $[0].trace, !(I.visible !== true || I._length === 0) && ["carpet", "contourcarpet"].indexOf(I._module.name) === -1)) { if (I.type === "splom" ? (G = 0, O = i[G]) : (O = ii.getSubplot(I), G = i.indexOf(O)), K = w, ii.isUnifiedHover(K) && (K = K.charAt(0)), P = { // trace properties cd: $, trace: I, xa: h[G], ya: p[G], // max distances for hover and spikes - for points that want to show but do not // want to override other points, set distance/spikeDistance equal to max*Distance // and it will not get filtered out but it will be guaranteed to have a greater // distance than any point that calculated a real distance. maxHoverDistance: k, maxSpikeDistance: x, // point properties - override all of these index: false, // point index in trace - only used by plotly.js hoverdata consumers distance: Math.min(ue, k), // pixel distance or pseudo-distance // distance/pseudo-distance for spikes. This distance should always be calculated // as if in "closest" mode, and should only be set if this point should // generate a spike. spikeDistance: 1 / 0, // in some cases the spikes have different positioning from the hover label // they don't need x0/x1, just one position xSpike: void 0, ySpike: void 0, // where and how to display the hover label color: pn.defaultLine, // trace color name: I.name, x0: void 0, x1: void 0, y0: void 0, y1: void 0, xLabelVal: void 0, yLabelVal: void 0, zLabelVal: void 0, text: void 0 }, o[O] && (P.subplot = o[O]._subplot), o._splomScenes && o._splomScenes[I.uid] && (P.scene = o._splomScenes[I.uid]), R = _.length, K === "array") { var ke = t[F]; "pointNumber" in ke ? (P.index = ke.pointNumber, K = "closest") : (K = "", "xval" in ke && (V = ke.xval, K = "x"), "yval" in ke && (z = ke.yval, K = K ? "closest" : "y")); } else ie !== void 0 && fe !== void 0 ? (V = ie, z = fe) : (V = S[G], z = M[G]); if (k !== 0) if (I._module && I._module.hoverPoints) { var _e = I._module.hoverPoints(P, V, z, K, { finiteRange: true, hoverLayer: o._hoverlayer }); if (_e) for (var Ge, je = 0; je < _e.length; je++) Ge = _e[je], so(Ge.x0) && so(Ge.y0) && _.push(OX(Ge, w)); } else Kr.log("Unrecognized trace type in hover:", I); if (w === "closest" && _.length > R && (_.splice(0, R), ue = _[0].distance), u && x !== 0 && _.length === 0) { P.distance = x, P.index = false; var Ee = I._module.hoverPoints(P, V, z, "closest", { hoverLayer: o._hoverlayer }); if (Ee && (Ee = Ee.filter(function(Pt) { return Pt.spikeDistance <= x; })), Ee && Ee.length) { var oe, Ce = Ee.filter(function(Pt) { return Pt.xa.showspikes && Pt.xa.spikesnap !== "hovered data"; }); if (Ce.length) { var Be = Ce[0]; so(Be.x0) && so(Be.y0) && (oe = Z(Be), (!H.vLinePoint || H.vLinePoint.spikeDistance > oe.spikeDistance) && (H.vLinePoint = oe)); } var Xe = Ee.filter(function(Pt) { return Pt.ya.showspikes && Pt.ya.spikesnap !== "hovered data"; }); if (Xe.length) { var Et = Xe[0]; so(Et.x0) && so(Et.y0) && (oe = Z(Et), (!H.hLinePoint || H.hLinePoint.spikeDistance > oe.spikeDistance) && (H.hLinePoint = oe)); } } } } } j(); function U(ie, fe, ke) { for (var _e = null, Ge = 1 / 0, je, Ee = 0; Ee < ie.length; Ee++) je = ie[Ee].spikeDistance, ke && Ee === 0 && (je = -1 / 0), je <= Ge && je <= fe && (_e = ie[Ee], Ge = je); return _e; } function Z(ie) { return ie ? { xa: ie.xa, ya: ie.ya, x: ie.xSpike !== void 0 ? ie.xSpike : (ie.x0 + ie.x1) / 2, y: ie.ySpike !== void 0 ? ie.ySpike : (ie.y0 + ie.y1) / 2, distance: ie.distance, spikeDistance: ie.spikeDistance, curveNumber: ie.trace.index, color: ie.color, pointNumber: ie.index } : null; } var le = { fullLayout: o, container: o._hoverlayer, event: t }; e10._spikepoints; var J = { vLinePoint: H.vLinePoint, hLinePoint: H.hLinePoint }; e10._spikepoints = J; var pe = function() { _.sort(function(ie, fe) { return ie.distance - fe.distance; }), _ = BX(_, w); }; pe(); var ge = w.charAt(0), ve = (ge === "x" || ge === "y") && _[0] && PX[_[0].trace.type]; if (u && x !== 0 && _.length !== 0) { var me = _.filter(function(ie) { return ie.ya.showspikes; }), Le = U(me, x, ve); H.hLinePoint = Z(Le); var ze = _.filter(function(ie) { return ie.xa.showspikes; }), Fe = U(ze, x, ve); H.vLinePoint = Z(Fe); } if (_.length === 0) { var Oe = rh.unhoverRaw(e10, t); return u && (H.hLinePoint !== null || H.vLinePoint !== null) && _k() && bk(e10, H, le), Oe; } if (u && _k() && bk(e10, H, le), ii.isXYhover(K) && _[0].length !== 0 && _[0].trace.type !== "splom") { var Re = _[0]; gk[Re.trace.type] ? _ = _.filter(function(ie) { return ie.trace.index === Re.trace.index; }) : _ = [Re]; var We = _.length, Me = wk("x", Re, o), Ve = wk("y", Re, o); j(Me, Ve); var qe = [], Qe = {}, ot = 0, ht = function(ie) { var fe = gk[ie.trace.type] ? uD(ie) : ie.trace.index; if (!Qe[fe]) ot++, Qe[fe] = ot, qe.push(ie); else { var ke = Qe[fe] - 1, _e = qe[ke]; ke > 0 && Math.abs(ie.distance) < Math.abs(_e.distance) && (qe[ke] = ie); } }, vt; for (vt = 0; vt < We; vt++) ht(_[vt]); for (vt = _.length - 1; vt > We - 1; vt--) ht(_[vt]); _ = qe, pe(); } var nt = e10._hoverdata, ft = [], Pe = hD(e10), Ie = vD(e10); for (L = 0; L < _.length; L++) { var Ne = _[L], tt = ii.makeEventData(Ne, Ne.trace, Ne.cd); if (Ne.hovertemplate !== false) { var Je = false; Ne.cd[Ne.index] && Ne.cd[Ne.index].ht && (Je = Ne.cd[Ne.index].ht), Ne.hovertemplate = Je || Ne.trace.hovertemplate || false; } if (Ne.xa && Ne.ya) { var it = Ne.x0 + Ne.xa._offset, at = Ne.x1 + Ne.xa._offset, Tt = Ne.y0 + Ne.ya._offset, gt = Ne.y1 + Ne.ya._offset, He = Math.min(it, at), pt = Math.max(it, at), bt = Math.min(Tt, gt), Ke = Math.max(Tt, gt); tt.bbox = { x0: He + Ie, x1: pt + Ie, y0: bt + Pe, y1: Ke + Pe }; } Ne.eventData = [tt], ft.push(tt); } e10._hoverdata = ft; var st = w === "y" && (T.length > 1 || _.length > 1) || w === "closest" && B && _.length > 1, rt = pn.combine( o.plot_bgcolor || pn.background, o.paper_bgcolor ), ct = fD(_, { gd: e10, hovermode: w, rotateLabels: st, bgColor: rt, container: o._hoverlayer, outerContainer: o._paper.node(), commonLabelOpts: o.hoverlabel, hoverdistance: o.hoverdistance }), X = ct.hoverLabels; if (ii.isUnifiedHover(w) || (IX(X, st, o, ct.commonLabelBoundingBox), dD(X, st, o._invScaleX, o._invScaleY)), a && a.tagName) { var se = Pu.getComponentMethod("annotations", "hasClickToShow")(e10, ft); CX(Bl.select(a), se ? "pointer" : ""); } !a || n || !HX(e10, t, nt) || (nt && e10.emit("plotly_unhover", { event: t, points: nt }), e10.emit("plotly_hover", { event: t, points: e10._hoverdata, xaxes: h, yaxes: p, xvals: S, yvals: M })); } function uD(e10) { return [e10.trace.index, e10.index, e10.x0, e10.y0, e10.name, e10.attr, e10.xa ? e10.xa._id : "", e10.ya ? e10.ya._id : ""].join(","); } var zX = /([\s\S]*)<\/extra>/; function fD(e10, t) { var r = t.gd, n = r._fullLayout, a = t.hovermode, i = t.rotateLabels, o = t.bgColor, l = t.container, s = t.outerContainer, u = t.commonLabelOpts || {}; if (e10.length === 0) return [[]]; var f = t.fontFamily || us.HOVERFONT, d = t.fontSize || us.HOVERFONTSIZE, h = e10[0], p = h.xa, v = h.ya, m = a.charAt(0), g = m + "Label", y = h[g]; if (y === void 0 && p.type === "multicategory") for (var w = 0; w < e10.length && (y = e10[w][g], y === void 0); w++) ; var k = Ns(r, s), x = k.top, _ = k.width, T = k.height, S = y !== void 0 && h.distance <= t.hoverdistance && (a === "x" || a === "y"); if (S) { var M = true, L, F; for (L = 0; L < e10.length; L++) if (M && e10[L].zLabel === void 0 && (M = false), F = e10[L].hoverinfo || e10[L].trace.hoverinfo, F) { var $ = Array.isArray(F) ? F : F.split("+"); if ($.indexOf("all") === -1 && $.indexOf(a) === -1) { S = false; break; } } M && (S = false); } var I = l.selectAll("g.axistext").data(S ? [0] : []); I.enter().append("g").classed("axistext", true), I.exit().remove(); var O = { minX: 0, maxX: 0, minY: 0, maxY: 0 }; if (I.each(function() { var Me = Bl.select(this), Ve = Kr.ensureSingle(Me, "path", "", function(Ke) { Ke.style({ "stroke-width": "1px" }); }), qe = Kr.ensureSingle(Me, "text", "", function(Ke) { Ke.attr("data-notex", 1); }), Qe = u.bgcolor || pn.defaultLine, ot = u.bordercolor || pn.contrast(Qe), ht = pn.contrast(Qe), vt = { family: u.font.family || f, size: u.font.size || d, color: u.font.color || ht }; Ve.style({ fill: Qe, stroke: ot }), qe.text(y).call($i.font, vt).call(Ra.positionText, 0, 0).call(Ra.convertToTspans, r), Me.attr("transform", ""); var nt = Ns(r, qe.node()), ft, Pe; if (a === "x") { var Ie = p.side === "top" ? "-" : ""; qe.attr("text-anchor", "middle").call(Ra.positionText, 0, p.side === "top" ? x - nt.bottom - br - rr : x - nt.top + br + rr), ft = p._offset + (h.x0 + h.x1) / 2, Pe = v._offset + (p.side === "top" ? 0 : v._length); var Ne = nt.width / 2 + rr; ft < Ne ? (ft = Ne, Ve.attr("d", "M-" + (Ne - br) + ",0L-" + (Ne - br * 2) + "," + Ie + br + "H" + Ne + "v" + Ie + (rr * 2 + nt.height) + "H-" + Ne + "V" + Ie + br + "Z")) : ft > n.width - Ne ? (ft = n.width - Ne, Ve.attr("d", "M" + (Ne - br) + ",0L" + Ne + "," + Ie + br + "v" + Ie + (rr * 2 + nt.height) + "H-" + Ne + "V" + Ie + br + "H" + (Ne - br * 2) + "Z")) : Ve.attr("d", "M0,0L" + br + "," + Ie + br + "H" + Ne + "v" + Ie + (rr * 2 + nt.height) + "H-" + Ne + "V" + Ie + br + "H-" + br + "Z"), O.minX = ft - Ne, O.maxX = ft + Ne, p.side === "top" ? (O.minY = Pe - (rr * 2 + nt.height), O.maxY = Pe - rr) : (O.minY = Pe + rr, O.maxY = Pe + (rr * 2 + nt.height)); } else { var tt, Je, it; v.side === "right" ? (tt = "start", Je = 1, it = "", ft = p._offset + p._length) : (tt = "end", Je = -1, it = "-", ft = p._offset), Pe = v._offset + (h.y0 + h.y1) / 2, qe.attr("text-anchor", tt), Ve.attr("d", "M0,0L" + it + br + "," + br + "V" + (rr + nt.height / 2) + "h" + it + (rr * 2 + nt.width) + "V-" + (rr + nt.height / 2) + "H" + it + br + "V-" + br + "Z"), O.minY = Pe - (rr + nt.height / 2), O.maxY = Pe + (rr + nt.height / 2), v.side === "right" ? (O.minX = ft + br, O.maxX = ft + br + (rr * 2 + nt.width)) : (O.minX = ft - br - (rr * 2 + nt.width), O.maxX = ft - br); var at = nt.height / 2, Tt = x - nt.top - at, gt = "clip" + n._uid + "commonlabel" + v._id, He; if (ft < nt.width + 2 * rr + br) { He = "M-" + (br + rr) + "-" + at + "h-" + (nt.width - rr) + "V" + at + "h" + (nt.width - rr) + "Z"; var pt = nt.width - ft + rr; Ra.positionText(qe, pt, Tt), tt === "end" && qe.selectAll("tspan").each(function() { var Ke = Bl.select(this), st = $i.tester.append("text").text(Ke.text()).call($i.font, vt), rt = Ns(r, st.node()); Math.round(rt.width) < Math.round(nt.width) && Ke.attr("x", pt - rt.width), st.remove(); }); } else Ra.positionText(qe, Je * (rr + br), Tt), He = null; var bt = n._topclips.selectAll("#" + gt).data(He ? [0] : []); bt.enter().append("clipPath").attr("id", gt).append("path"), bt.exit().remove(), bt.select("path").attr("d", He), $i.setClipUrl(qe, He ? gt : null, r); } Me.attr("transform", Cg(ft, Pe)); }), ii.isUnifiedHover(a)) { l.selectAll("g.hovertext").remove(); var G = e10.filter(function(Me) { return Me.hoverinfo !== "none"; }); if (G.length === 0) return []; var K = n.hoverlabel, V = K.font, z = { showlegend: true, legend: { title: { text: y, font: V }, font: V, bgcolor: K.bgcolor, bordercolor: K.bordercolor, borderwidth: 1, tracegroupgap: 7, traceorder: n.legend ? n.legend.traceorder : void 0, orientation: "v" } }, P = { font: V }; LX(z, P, r._fullData); var R = P.legend; R.entries = []; for (var H = 0; H < G.length; H++) { var B = G[H]; if (B.hoverinfo !== "none") { var W = yk(B, true, a, n, y), ee = W[0], re = W[1]; B.name = re, re !== "" ? B.text = re + " : " + ee : B.text = ee; var ae = B.cd[B.index]; ae && (ae.mc && (B.mc = ae.mc), ae.mcc && (B.mc = ae.mcc), ae.mlc && (B.mlc = ae.mlc), ae.mlcc && (B.mlc = ae.mlcc), ae.mlw && (B.mlw = ae.mlw), ae.mrc && (B.mrc = ae.mrc), ae.dir && (B.dir = ae.dir)), B._distinct = true, R.entries.push([B]); } } R.entries.sort(function(Me, Ve) { return Me[0].trace.index - Ve[0].trace.index; }), R.layer = l, R._inHover = true, R._groupTitleFont = K.grouptitlefont, DX(r, R); var Q = l.select("g.legend"), ue = Ns(r, Q.node()), j = ue.width + 2 * rr, U = ue.height + 2 * rr, Z = G[0], le = (Z.x0 + Z.x1) / 2, J = (Z.y0 + Z.y1) / 2, pe = !(Pu.traceIs(Z.trace, "bar-like") || Pu.traceIs(Z.trace, "box-violin")), ge, ve; m === "y" ? pe ? (ve = J - rr, ge = J + rr) : (ve = Math.min.apply(null, G.map(function(Me) { return Math.min(Me.y0, Me.y1); })), ge = Math.max.apply(null, G.map(function(Me) { return Math.max(Me.y0, Me.y1); }))) : ve = ge = Kr.mean(G.map(function(Me) { return (Me.y0 + Me.y1) / 2; })) - U / 2; var me, Le; m === "x" ? pe ? (me = le + rr, Le = le - rr) : (me = Math.max.apply(null, G.map(function(Me) { return Math.max(Me.x0, Me.x1); })), Le = Math.min.apply(null, G.map(function(Me) { return Math.min(Me.x0, Me.x1); }))) : me = Le = Kr.mean(G.map(function(Me) { return (Me.x0 + Me.x1) / 2; })) - j / 2; var ze = p._offset, Fe = v._offset; ge += Fe, me += ze, Le += ze - j, ve += Fe - U; var Oe, Re; return me + j < _ && me >= 0 ? Oe = me : Le + j < _ && Le >= 0 ? Oe = Le : ze + j < _ ? Oe = ze : me - le < le - Le + j ? Oe = _ - j : Oe = 0, Oe += rr, ge + U < T && ge >= 0 ? Re = ge : ve + U < T && ve >= 0 ? Re = ve : Fe + U < T ? Re = Fe : ge - J < J - ve + U ? Re = T - U : Re = 0, Re += rr, Q.attr("transform", Cg(Oe - 1, Re - 1)), Q; } var We = l.selectAll("g.hovertext").data(e10, function(Me) { return uD(Me); }); return We.enter().append("g").classed("hovertext", true).each(function() { var Me = Bl.select(this); Me.append("rect").call(pn.fill, pn.addOpacity(o, 0.8)), Me.append("text").classed("name", true), Me.append("path").style("stroke-width", "1px"), Me.append("text").classed("nums", true).call($i.font, f, d); }), We.exit().remove(), We.each(function(Me) { var Ve = Bl.select(this).attr("transform", ""), qe = Me.color; Array.isArray(qe) && (qe = qe[Me.eventData[0].pointNumber]); var Qe = Me.bgcolor || qe, ot = pn.combine( pn.opacity(Qe) ? Qe : pn.defaultLine, o ), ht = pn.combine( pn.opacity(qe) ? qe : pn.defaultLine, o ), vt = Me.borderColor || pn.contrast(ot), nt = yk(Me, S, a, n, y, Ve), ft = nt[0], Pe = nt[1], Ie = Ve.select("text.nums").call( $i.font, Me.fontFamily || f, Me.fontSize || d, Me.fontColor || vt ).text(ft).attr("data-notex", 1).call(Ra.positionText, 0, 0).call(Ra.convertToTspans, r), Ne = Ve.select("text.name"), tt = 0, Je = 0; if (Pe && Pe !== ft) { Ne.call( $i.font, Me.fontFamily || f, Me.fontSize || d, ht ).text(Pe).attr("data-notex", 1).call(Ra.positionText, 0, 0).call(Ra.convertToTspans, r); var it = Ns(r, Ne.node()); tt = it.width + 2 * rr, Je = it.height + 2 * rr; } else Ne.remove(), Ve.select("rect").remove(); Ve.select("path").style({ fill: ot, stroke: vt }); var at = Me.xa._offset + (Me.x0 + Me.x1) / 2, Tt = Me.ya._offset + (Me.y0 + Me.y1) / 2, gt = Math.abs(Me.x1 - Me.x0), He = Math.abs(Me.y1 - Me.y0), pt = Ns(r, Ie.node()), bt = pt.width / n._invScaleX, Ke = pt.height / n._invScaleY; Me.ty0 = (x - pt.top) / n._invScaleY, Me.bx = bt + 2 * rr, Me.by = Math.max(Ke + 2 * rr, Je), Me.anchor = "start", Me.txwidth = bt, Me.tx2width = tt, Me.offset = 0; var st = (bt + br + rr + tt) * n._invScaleX, rt, ct; if (i) Me.pos = at, rt = Tt + He / 2 + st <= T, ct = Tt - He / 2 - st >= 0, (Me.idealAlign === "top" || !rt) && ct ? (Tt -= He / 2, Me.anchor = "end") : rt ? (Tt += He / 2, Me.anchor = "start") : Me.anchor = "middle", Me.crossPos = Tt; else { if (Me.pos = Tt, rt = at + gt / 2 + st <= _, ct = at - gt / 2 - st >= 0, (Me.idealAlign === "left" || !rt) && ct) at -= gt / 2, Me.anchor = "end"; else if (rt) at += gt / 2, Me.anchor = "start"; else { Me.anchor = "middle"; var X = st / 2, se = at + X - _, ie = at - X; se > 0 && (at -= se), ie < 0 && (at += -ie); } Me.crossPos = at; } Ie.attr("text-anchor", Me.anchor), tt && Ne.attr("text-anchor", Me.anchor), Ve.attr("transform", Cg(at, Tt) + (i ? MX(sD) : "")); }), { hoverLabels: We, commonLabelBoundingBox: O }; } function yk(e10, t, r, n, a, i) { var o = "", l = ""; e10.nameOverride !== void 0 && (e10.name = e10.nameOverride), e10.name && (e10.trace._meta && (e10.name = Kr.templateString(e10.name, e10.trace._meta)), o = xk(e10.name, e10.nameLength)); var s = r.charAt(0), u = s === "x" ? "y" : "x"; e10.zLabel !== void 0 ? (e10.xLabel !== void 0 && (l += "x: " + e10.xLabel + "
"), e10.yLabel !== void 0 && (l += "y: " + e10.yLabel + "
"), e10.trace.type !== "choropleth" && e10.trace.type !== "choroplethmapbox" && (l += (l ? "z: " : "") + e10.zLabel)) : t && e10[s + "Label"] === a ? l = e10[u + "Label"] || "" : e10.xLabel === void 0 ? e10.yLabel !== void 0 && e10.trace.type !== "scattercarpet" && (l = e10.yLabel) : e10.yLabel === void 0 ? l = e10.xLabel : l = "(" + e10.xLabel + ", " + e10.yLabel + ")", (e10.text || e10.text === 0) && !Array.isArray(e10.text) && (l += (l ? "
" : "") + e10.text), e10.extraText !== void 0 && (l += (l ? "
" : "") + e10.extraText), i && l === "" && !e10.hovertemplate && (o === "" && i.remove(), l = o); var f = e10.hovertemplate || false; if (f) { var d = e10.hovertemplateLabels || e10; e10[s + "Label"] !== a && (d[s + "other"] = d[s + "Val"], d[s + "otherLabel"] = d[s + "Label"]), l = Kr.hovertemplateString( f, d, n._d3locale, e10.eventData[0] || {}, e10.trace._meta ), l = l.replace(zX, function(h, p) { return o = xk(p, e10.nameLength), ""; }); } return [l, o]; } function IX(e10, t, r, n) { var a = t ? "xa" : "ya", i = t ? "ya" : "xa", o = 0, l = 1, s = e10.size(), u = new Array(s), f = 0, d = n.minX, h = n.maxX, p = n.minY, v = n.maxY, m = function(V) { return V * r._invScaleX; }, g = function(V) { return V * r._invScaleY; }; e10.each(function(V) { var z = V[a], P = V[i], R = z._id.charAt(0) === "x", H = z.range; f === 0 && H && H[0] > H[1] !== R && (l = -1); var B = 0, W = R ? r.width : r.height; if (r.hovermode === "x" || r.hovermode === "y") { var ee = cD(V, t), re = V.anchor, ae = re === "end" ? -1 : 1, Q, ue; if (re === "middle") Q = V.crossPos + (R ? g(ee.y - V.by / 2) : m(V.bx / 2 + V.tx2width / 2)), ue = Q + (R ? g(V.by) : m(V.bx)); else if (R) Q = V.crossPos + g(br + ee.y) - g(V.by / 2 - br), ue = Q + g(V.by); else { var j = m(ae * br + ee.x), U = j + m(ae * V.bx); Q = V.crossPos + Math.min(j, U), ue = V.crossPos + Math.max(j, U); } R ? p !== void 0 && v !== void 0 && Math.min(ue, v) - Math.max(Q, p) > 1 && (P.side === "left" ? (B = P._mainLinePosition, W = r.width) : W = P._mainLinePosition) : d !== void 0 && h !== void 0 && Math.min(ue, h) - Math.max(Q, d) > 1 && (P.side === "top" ? (B = P._mainLinePosition, W = r.height) : W = P._mainLinePosition); } u[f++] = [{ datum: V, traceIndex: V.trace.index, dp: 0, pos: V.pos, posref: V.posref, size: V.by * (R ? EX : 1) / 2, pmin: B, pmax: W }]; }), u.sort(function(V, z) { return V[0].posref - z[0].posref || // for equal positions, sort trace indices increasing or decreasing // depending on whether the axis is reversed or not... so stacked // traces will generally keep their order even if one trace adds // nothing to the stack. l * (z[0].traceIndex - V[0].traceIndex); }); var y, w, k, x, _, T, S; function M(V) { var z = V[0], P = V[V.length - 1]; if (w = z.pmin - z.pos - z.dp + z.size, k = P.pos + P.dp + P.size - z.pmax, w > 0.01) { for (_ = V.length - 1; _ >= 0; _--) V[_].dp += w; y = false; } if (!(k < 0.01)) { if (w < -0.01) { for (_ = V.length - 1; _ >= 0; _--) V[_].dp -= k; y = false; } if (y) { var R = 0; for (x = 0; x < V.length; x++) T = V[x], T.pos + T.dp + T.size > z.pmax && R++; for (x = V.length - 1; x >= 0 && !(R <= 0); x--) T = V[x], T.pos > z.pmax - 1 && (T.del = true, R--); for (x = 0; x < V.length && !(R <= 0); x++) if (T = V[x], T.pos < z.pmin + 1) for (T.del = true, R--, k = T.size * 2, _ = V.length - 1; _ >= 0; _--) V[_].dp -= k; for (x = V.length - 1; x >= 0 && !(R <= 0); x--) T = V[x], T.pos + T.dp + T.size > z.pmax && (T.del = true, R--); } } } for (; !y && o <= s; ) { for (o++, y = true, x = 0; x < u.length - 1; ) { var L = u[x], F = u[x + 1], $ = L[L.length - 1], I = F[0]; if (w = $.pos + $.dp + $.size - I.pos - I.dp + I.size, w > 0.01 && $.pmin === I.pmin && $.pmax === I.pmax) { for (_ = F.length - 1; _ >= 0; _--) F[_].dp += w; for (L.push.apply(L, F), u.splice(x + 1, 1), S = 0, _ = L.length - 1; _ >= 0; _--) S += L[_].dp; for (k = S / L.length, _ = L.length - 1; _ >= 0; _--) L[_].dp -= k; y = false; } else x++; } u.forEach(M); } for (x = u.length - 1; x >= 0; x--) { var O = u[x]; for (_ = O.length - 1; _ >= 0; _--) { var G = O[_], K = G.datum; K.offset = G.dp, K.del = G.del; } } } function cD(e10, t) { var r = 0, n = e10.offset; return t && (n *= -RX, r = e10.offset * FX), { x: r, y: n }; } function NX(e10) { var t = { start: 1, end: -1, middle: 0 }[e10.anchor], r = t * (br + rr), n = r + t * (e10.txwidth + rr), a = e10.anchor === "middle"; return a && (r -= e10.tx2width / 2, n += e10.txwidth / 2 + rr), { alignShift: t, textShiftX: r, text2ShiftX: n }; } function dD(e10, t, r, n) { var a = function(o) { return o * r; }, i = function(o) { return o * n; }; e10.each(function(o) { var l = Bl.select(this); if (o.del) return l.remove(); var s = l.select("text.nums"), u = o.anchor, f = u === "end" ? -1 : 1, d = NX(o), h = cD(o, t), p = h.x, v = h.y, m = u === "middle"; l.select("path").attr("d", m ? ( // middle aligned: rect centered on data "M-" + a(o.bx / 2 + o.tx2width / 2) + "," + i(v - o.by / 2) + "h" + a(o.bx) + "v" + i(o.by) + "h-" + a(o.bx) + "Z" ) : ( // left or right aligned: side rect with arrow to data "M0,0L" + a(f * br + p) + "," + i(br + v) + "v" + i(o.by / 2 - br) + "h" + a(f * o.bx) + "v-" + i(o.by) + "H" + a(f * br + p) + "V" + i(v - br) + "Z" )); var g = p + d.textShiftX, y = v + o.ty0 - o.by / 2 + rr, w = o.textAlign || "auto"; w !== "auto" && (w === "left" && u !== "start" ? (s.attr("text-anchor", "start"), g = m ? -o.bx / 2 - o.tx2width / 2 + rr : -o.bx - rr) : w === "right" && u !== "end" && (s.attr("text-anchor", "end"), g = m ? o.bx / 2 - o.tx2width / 2 - rr : o.bx + rr)), s.call(Ra.positionText, a(g), i(y)), o.tx2width && (l.select("text.name").call( Ra.positionText, a(d.text2ShiftX + d.alignShift * rr + p), i(v + o.ty0 - o.by / 2 + rr) ), l.select("rect").call( $i.setRect, a(d.text2ShiftX + (d.alignShift - 1) * o.tx2width / 2 + p), i(v - o.by / 2 - 1), a(o.tx2width), i(o.by + 2) )); }); } function OX(e10, t) { var r = e10.index, n = e10.trace || {}, a = e10.cd[0], i = e10.cd[r] || {}; function o(h) { return h || so(h) && h === 0; } var l = Array.isArray(r) ? function(h, p) { var v = Kr.castOption(a, r, h); return o(v) ? v : Kr.extractOption({}, n, "", p); } : function(h, p) { return Kr.extractOption(i, n, h, p); }; function s(h, p, v) { var m = l(p, v); o(m) && (e10[h] = m); } if (s("hoverinfo", "hi", "hoverinfo"), s("bgcolor", "hbg", "hoverlabel.bgcolor"), s("borderColor", "hbc", "hoverlabel.bordercolor"), s("fontFamily", "htf", "hoverlabel.font.family"), s("fontSize", "hts", "hoverlabel.font.size"), s("fontColor", "htc", "hoverlabel.font.color"), s("nameLength", "hnl", "hoverlabel.namelength"), s("textAlign", "hta", "hoverlabel.align"), e10.posref = t === "y" || t === "closest" && n.orientation === "h" ? e10.xa._offset + (e10.x0 + e10.x1) / 2 : e10.ya._offset + (e10.y0 + e10.y1) / 2, e10.x0 = Kr.constrain(e10.x0, 0, e10.xa._length), e10.x1 = Kr.constrain(e10.x1, 0, e10.xa._length), e10.y0 = Kr.constrain(e10.y0, 0, e10.ya._length), e10.y1 = Kr.constrain(e10.y1, 0, e10.ya._length), e10.xLabelVal !== void 0 && (e10.xLabel = "xLabel" in e10 ? e10.xLabel : Yo.hoverLabelText(e10.xa, e10.xLabelVal, n.xhoverformat), e10.xVal = e10.xa.c2d(e10.xLabelVal)), e10.yLabelVal !== void 0 && (e10.yLabel = "yLabel" in e10 ? e10.yLabel : Yo.hoverLabelText(e10.ya, e10.yLabelVal, n.yhoverformat), e10.yVal = e10.ya.c2d(e10.yLabelVal)), e10.zLabelVal !== void 0 && e10.zLabel === void 0 && (e10.zLabel = String(e10.zLabelVal)), !isNaN(e10.xerr) && !(e10.xa.type === "log" && e10.xerr <= 0)) { var u = Yo.tickText(e10.xa, e10.xa.c2l(e10.xerr), "hover").text; e10.xerrneg !== void 0 ? e10.xLabel += " +" + u + " / -" + Yo.tickText(e10.xa, e10.xa.c2l(e10.xerrneg), "hover").text : e10.xLabel += " ± " + u, t === "x" && (e10.distance += 1); } if (!isNaN(e10.yerr) && !(e10.ya.type === "log" && e10.yerr <= 0)) { var f = Yo.tickText(e10.ya, e10.ya.c2l(e10.yerr), "hover").text; e10.yerrneg !== void 0 ? e10.yLabel += " +" + f + " / -" + Yo.tickText(e10.ya, e10.ya.c2l(e10.yerrneg), "hover").text : e10.yLabel += " ± " + f, t === "y" && (e10.distance += 1); } var d = e10.hoverinfo || e10.trace.hoverinfo; return d && d !== "all" && (d = Array.isArray(d) ? d : d.split("+"), d.indexOf("x") === -1 && (e10.xLabel = void 0), d.indexOf("y") === -1 && (e10.yLabel = void 0), d.indexOf("z") === -1 && (e10.zLabel = void 0), d.indexOf("text") === -1 && (e10.text = void 0), d.indexOf("name") === -1 && (e10.name = void 0)), e10; } function bk(e10, t, r) { var n = r.container, a = r.fullLayout, i = a._size, o = r.event, l = !!t.hLinePoint, s = !!t.vLinePoint, u, f; if (n.selectAll(".spikeline").remove(), !!(s || l)) { var d = pn.combine(a.plot_bgcolor, a.paper_bgcolor); if (l) { var h = t.hLinePoint, p, v; u = h && h.xa, f = h && h.ya; var m = f.spikesnap; m === "cursor" ? (p = o.pointerX, v = o.pointerY) : (p = u._offset + h.x, v = f._offset + h.y); var g = mk.readability(h.color, d) < 1.5 ? pn.contrast(d) : h.color, y = f.spikemode, w = f.spikethickness, k = f.spikecolor || g, x = Yo.getPxPosition(e10, f), _, T; if (y.indexOf("toaxis") !== -1 || y.indexOf("across") !== -1) { if (y.indexOf("toaxis") !== -1 && (_ = x, T = p), y.indexOf("across") !== -1) { var S = f._counterDomainMin, M = f._counterDomainMax; f.anchor === "free" && (S = Math.min(S, f.position), M = Math.max(M, f.position)), _ = i.l + S * i.w, T = i.l + M * i.w; } n.insert("line", ":first-child").attr({ x1: _, x2: T, y1: v, y2: v, "stroke-width": w, stroke: k, "stroke-dasharray": $i.dashStyle(f.spikedash, w) }).classed("spikeline", true).classed("crisp", true), n.insert("line", ":first-child").attr({ x1: _, x2: T, y1: v, y2: v, "stroke-width": w + 2, stroke: d }).classed("spikeline", true).classed("crisp", true); } y.indexOf("marker") !== -1 && n.insert("circle", ":first-child").attr({ cx: x + (f.side !== "right" ? w : -w), cy: v, r: w, fill: k }).classed("spikeline", true); } if (s) { var L = t.vLinePoint, F, $; u = L && L.xa, f = L && L.ya; var I = u.spikesnap; I === "cursor" ? (F = o.pointerX, $ = o.pointerY) : (F = u._offset + L.x, $ = f._offset + L.y); var O = mk.readability(L.color, d) < 1.5 ? pn.contrast(d) : L.color, G = u.spikemode, K = u.spikethickness, V = u.spikecolor || O, z = Yo.getPxPosition(e10, u), P, R; if (G.indexOf("toaxis") !== -1 || G.indexOf("across") !== -1) { if (G.indexOf("toaxis") !== -1 && (P = z, R = $), G.indexOf("across") !== -1) { var H = u._counterDomainMin, B = u._counterDomainMax; u.anchor === "free" && (H = Math.min(H, u.position), B = Math.max(B, u.position)), P = i.t + (1 - B) * i.h, R = i.t + (1 - H) * i.h; } n.insert("line", ":first-child").attr({ x1: F, x2: F, y1: P, y2: R, "stroke-width": K, stroke: V, "stroke-dasharray": $i.dashStyle(u.spikedash, K) }).classed("spikeline", true).classed("crisp", true), n.insert("line", ":first-child").attr({ x1: F, x2: F, y1: P, y2: R, "stroke-width": K + 2, stroke: d }).classed("spikeline", true).classed("crisp", true); } G.indexOf("marker") !== -1 && n.insert("circle", ":first-child").attr({ cx: F, cy: z - (u.side !== "top" ? K : -K), r: K, fill: V }).classed("spikeline", true); } } } function HX(e10, t, r) { if (!r || r.length !== e10._hoverdata.length) return true; for (var n = r.length - 1; n >= 0; n--) { var a = r[n], i = e10._hoverdata[n]; if (a.curveNumber !== i.curveNumber || String(a.pointNumber) !== String(i.pointNumber) || String(a.pointNumbers) !== String(i.pointNumbers)) return true; } return false; } function _k(e10, t) { return true; } function xk(e10, t) { return Ra.plainText(e10 || "", { len: t, allowedTags: ["br", "sub", "sup", "b", "i", "em"] }); } function BX(e10, t) { for (var r = t.charAt(0), n = [], a = [], i = [], o = 0; o < e10.length; o++) { var l = e10[o]; Pu.traceIs(l.trace, "bar-like") || Pu.traceIs(l.trace, "box-violin") ? i.push(l) : l.trace[r + "period"] ? a.push(l) : n.push(l); } return n.concat(a).concat(i); } function wk(e10, t, r) { var n = t[e10 + "a"], a = t[e10 + "Val"], i = t.cd[0]; if (n.type === "category" || n.type === "multicategory") a = n._categoriesMap[a]; else if (n.type === "date") { var o = t.trace[e10 + "periodalignment"]; if (o) { var l = t.cd[t.index], s = l[e10 + "Start"]; s === void 0 && (s = l[e10]); var u = l[e10 + "End"]; u === void 0 && (u = l[e10]); var f = u - s; o === "end" ? a += f : o === "middle" && (a += f / 2); } a = n.d2c(a); } return i && i.t && i.t.posLetter === n._id && (r.boxmode === "group" || r.violinmode === "group") && (a += i.t.dPos), a; } function hD(e10) { return e10.offsetTop + e10.clientTop; } function vD(e10) { return e10.offsetLeft + e10.clientLeft; } function Ns(e10, t) { var r = e10._fullLayout, n = t.getBoundingClientRect(), a = n.left, i = n.top, o = a + n.width, l = i + n.height, s = Kr.apply3DTransform(r._invTransform)(a, i), u = Kr.apply3DTransform(r._invTransform)(o, l), f = s[0], d = s[1], h = u[0], p = u[1]; return { x: f, y: d, width: h - f, height: p - d, top: Math.min(d, p), left: Math.min(f, h), right: Math.max(f, h), bottom: Math.max(d, p) }; } var jX = Ue; var UX = nr; var GX = Do.isUnifiedHover; var Db = function(t, r, n, a) { a = a || {}; var i = r.legend; function o(l) { a.font[l] || (a.font[l] = i ? r.legend.font[l] : r.font[l]); } r && GX(r.hovermode) && (a.font || (a.font = {}), o("size"), o("family"), o("color"), i ? (a.bgcolor || (a.bgcolor = UX.combine(r.legend.bgcolor, r.paper_bgcolor)), a.bordercolor || (a.bordercolor = r.legend.bordercolor)) : a.bgcolor || (a.bgcolor = r.paper_bgcolor)), n("hoverlabel.bgcolor", a.bgcolor), n("hoverlabel.bordercolor", a.bordercolor), n("hoverlabel.namelength", a.namelength), jX.coerceFont(n, "hoverlabel.font", a.font), n("hoverlabel.align", a.align); }; var VX = Ue; var qX = Db; var WX = Zc; var ZX = function(t, r) { function n(a, i) { return VX.coerce(t, r, WX, a, i); } qX(t, r, n); }; var Tk = Ue; var YX = V1; var XX = Db; var KX = function(t, r, n, a) { function i(l, s) { return Tk.coerce(t, r, YX, l, s); } var o = Tk.extendFlat({}, a.hoverlabel); r.hovertemplate && (o.namelength = -1), XX(t, r, i, o); }; var JX = Ue; var QX = Zc; var pD = function(t, r) { function n(a, i) { return r[a] !== void 0 ? r[a] : JX.coerce(t, r, QX, a, i); } return n("clickmode"), n("hovermode"); }; var kk = Ue; var eK = Zc; var tK = pD; var rK = Db; var nK = function(t, r) { function n(u, f) { return kk.coerce(t, r, eK, u, f); } var a = tK(t, r); a && (n("hoverdistance"), n("spikedistance")); var i = n("dragmode"); i === "select" && n("selectdirection"); var o = r._has("mapbox"), l = r._has("geo"), s = r._basePlotModules.length; r.dragmode === "zoom" && ((o || l) && s === 1 || o && l && s === 2) && (r.dragmode = "pan"), rK(t, r, n), kk.coerceFont(n, "hoverlabel.grouptitlefont", r.hoverlabel.font); }; var Py = Ue; var Ak = Nt; var aK = function(t) { var r = t.calcdata, n = t._fullLayout; function a(u) { return function(f) { return Py.coerceHoverinfo({ hoverinfo: f }, { _module: u._module }, n); }; } for (var i = 0; i < r.length; i++) { var o = r[i], l = o[0].trace; if (!Ak.traceIs(l, "pie-like")) { var s = Ak.traceIs(l, "2dMap") ? iK : Py.fillArray; s(l.hoverinfo, o, "hi", a(l)), l.hovertemplate && s(l.hovertemplate, o, "ht"), l.hoverlabel && (s(l.hoverlabel.bgcolor, o, "hbg"), s(l.hoverlabel.bordercolor, o, "hbc"), s(l.hoverlabel.font.size, o, "hts"), s(l.hoverlabel.font.color, o, "htc"), s(l.hoverlabel.font.family, o, "htf"), s(l.hoverlabel.namelength, o, "hnl"), s(l.hoverlabel.align, o, "hta")); } } }; function iK(e10, t, r, n) { n = n || Py.identity, Array.isArray(e10) && (t[0][r] = n(e10)); } var oK = Nt; var lK = Pp.hover; var sK = function(t, r, n) { var a = oK.getComponentMethod("annotations", "onClick")(t, t._hoverdata); n !== void 0 && lK(t, r, n, true); function i() { t.emit("plotly_click", { points: t._hoverdata, event: r }); } t._hoverdata && r && r.target && (a && a.then ? a.then(i) : i(), r.stopImmediatePropagation && r.stopImmediatePropagation()); }; var uK = lr; var xv = Ue; var fK = Qi; var Lf = Do; var Mk = Zc; var Sk = Pp; var Ao = { moduleType: "component", name: "fx", constants: sp, schema: { layout: Mk }, attributes: V1, layoutAttributes: Mk, supplyLayoutGlobalDefaults: ZX, supplyDefaults: KX, supplyLayoutDefaults: nK, calc: aK, getDistanceFunction: Lf.getDistanceFunction, getClosest: Lf.getClosest, inbox: Lf.inbox, quadrature: Lf.quadrature, appendArrayPointValue: Lf.appendArrayPointValue, castHoverOption: dK, castHoverinfo: hK, hover: Sk.hover, unhover: fK.unhover, loneHover: Sk.loneHover, loneUnhover: cK, click: sK }; function cK(e10) { var t = xv.isD3Selection(e10) ? e10 : uK.select(e10); t.selectAll("g.hovertext").remove(), t.selectAll(".spikeline").remove(); } function dK(e10, t, r) { return xv.castOption(e10, t, "hoverlabel." + r); } function hK(e10, t, r) { function n(a) { return xv.coerceHoverinfo({ hoverinfo: a }, { _module: e10._module }, t); } return xv.castOption(e10, r, "hoverinfo", n); } var rf = {}; (function(e10) { e10.selectMode = function(t) { return t === "lasso" || t === "select"; }, e10.drawMode = function(t) { return t === "drawclosedpath" || t === "drawopenpath" || t === "drawline" || t === "drawrect" || t === "drawcircle"; }, e10.openMode = function(t) { return t === "drawline" || t === "drawopenpath"; }, e10.rectMode = function(t) { return t === "select" || t === "drawline" || t === "drawrect" || t === "drawcircle"; }, e10.freeMode = function(t) { return t === "lasso" || t === "drawclosedpath" || t === "drawopenpath"; }, e10.selectingOrDrawing = function(t) { return e10.freeMode(t) || e10.rectMode(t); }; })(rf); var Eb = function(t) { var r = t._fullLayout; r._glcanvas && r._glcanvas.size() && r._glcanvas.each(function(n) { n.regl && n.regl.clear({ color: true, depth: true }); }); }; var zp = {}; var mD = { exports: {} }; var Fb = { undo: { width: 857.1, height: 1e3, path: "m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z", transform: "matrix(1 0 0 -1 0 850)" }, home: { width: 928.6, height: 1e3, path: "m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z", transform: "matrix(1 0 0 -1 0 850)" }, "camera-retro": { width: 1e3, height: 1e3, path: "m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z", transform: "matrix(1 0 0 -1 0 850)" }, zoombox: { width: 1e3, height: 1e3, path: "m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z", transform: "matrix(1 0 0 -1 0 850)" }, pan: { width: 1e3, height: 1e3, path: "m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z", transform: "matrix(1 0 0 -1 0 850)" }, zoom_plus: { width: 875, height: 1e3, path: "m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z", transform: "matrix(1 0 0 -1 0 850)" }, zoom_minus: { width: 875, height: 1e3, path: "m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z", transform: "matrix(1 0 0 -1 0 850)" }, autoscale: { width: 1e3, height: 1e3, path: "m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z", transform: "matrix(1 0 0 -1 0 850)" }, tooltip_basic: { width: 1500, height: 1e3, path: "m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z", transform: "matrix(1 0 0 -1 0 850)" }, tooltip_compare: { width: 1125, height: 1e3, path: "m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z", transform: "matrix(1 0 0 -1 0 850)" }, plotlylogo: { width: 1542, height: 1e3, path: "m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z", transform: "matrix(1 0 0 -1 0 850)" }, "z-axis": { width: 1e3, height: 1e3, path: "m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z", transform: "matrix(1 0 0 -1 0 850)" }, "3d_rotate": { width: 1e3, height: 1e3, path: "m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z", transform: "matrix(1 0 0 -1 0 850)" }, camera: { width: 1e3, height: 1e3, path: "m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z", transform: "matrix(1 0 0 -1 0 850)" }, movie: { width: 1e3, height: 1e3, path: "m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z", transform: "matrix(1 0 0 -1 0 850)" }, question: { width: 857.1, height: 1e3, path: "m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z", transform: "matrix(1 0 0 -1 0 850)" }, disk: { width: 857.1, height: 1e3, path: "m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z", transform: "matrix(1 0 0 -1 0 850)" }, drawopenpath: { width: 70, height: 70, path: "M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z", transform: "matrix(1 0 0 1 -15 -15)" }, drawclosedpath: { width: 90, height: 90, path: "M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z", transform: "matrix(1 0 0 1 -5 -5)" }, lasso: { width: 1031, height: 1e3, path: "m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z", transform: "matrix(1 0 0 -1 0 850)" }, selectbox: { width: 1e3, height: 1e3, path: "m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z", transform: "matrix(1 0 0 -1 0 850)" }, drawline: { width: 70, height: 70, path: "M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z", transform: "matrix(1 0 0 1 -15 -15)" }, drawrect: { width: 80, height: 80, path: "M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z", transform: "matrix(1 0 0 1 -10 -10)" }, drawcircle: { width: 80, height: 80, path: "M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z", transform: "matrix(1 0 0 1 -10 -10)" }, eraseshape: { width: 80, height: 80, path: "M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z", transform: "matrix(1 0 0 1 -10 -10)" }, spikeline: { width: 1e3, height: 1e3, path: "M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z", transform: "matrix(1.5 0 0 -1.5 0 850)" }, pencil: { width: 1792, height: 1792, path: "M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z", transform: "matrix(1 0 0 1 0 1)" }, newplotlylogo: { name: "newplotlylogo", svg: [ "", "", " ", "", " plotly-logomark", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "" ].join("") } }; var _l = {}; var nh = 32; var Rb = { CIRCLE_SIDES: nh, i000: 0, i090: nh / 4, i180: nh / 2, i270: nh / 4 * 3, cos45: Math.cos(Math.PI / 4), sin45: Math.sin(Math.PI / 4), SQRT2: Math.sqrt(2) }; var vK = Ue.strTranslate; function gD(e10, t) { switch (e10.type) { case "log": return e10.p2d(t); case "date": return e10.p2r(t, 0, e10.calendar); default: return e10.p2r(t); } } function pK(e10, t) { switch (e10.type) { case "log": return e10.d2p(t); case "date": return e10.r2p(t, 0, e10.calendar); default: return e10.r2p(t); } } function mK(e10) { var t = e10._id.charAt(0) === "y" ? 1 : 0; return function(r) { return gD(e10, r[t]); }; } function gK(e10) { return vK( e10.xaxis._offset, e10.yaxis._offset ); } var Pb = { p2r: gD, r2p: pK, axValue: mK, getTransform: gK }; (function(e10) { var t = w4, r = Rb, n = r.CIRCLE_SIDES, a = r.SQRT2, i = Pb, o = i.p2r, l = i.r2p, s = [0, 3, 4, 5, 6, 1, 2], u = [0, 3, 4, 1, 2]; e10.writePaths = function(h) { var p = h.length; if (!p) return "M0,0Z"; for (var v = "", m = 0; m < p; m++) for (var g = h[m].length, y = 0; y < g; y++) { var w = h[m][y][0]; if (w === "Z") v += "Z"; else for (var k = h[m][y].length, x = 0; x < k; x++) { var _ = x; w === "Q" || w === "S" ? _ = u[x] : w === "C" && (_ = s[x]), v += h[m][y][_], x > 0 && x < k - 1 && (v += ","); } } return v; }, e10.readPaths = function(h, p, v, m) { var g = t(h), y = [], w = -1, k = function() { w++, y[w] = []; }, x, _ = 0, T = 0, S, M, L = function() { S = _, M = T; }; L(); for (var F = 0; F < g.length; F++) { var $ = [], I, O, G, K, V = g[F][0], z = V; switch (V) { case "M": k(), _ = +g[F][1], T = +g[F][2], $.push([z, _, T]), L(); break; case "Q": case "S": I = +g[F][1], G = +g[F][2], _ = +g[F][3], T = +g[F][4], $.push([z, _, T, I, G]); break; case "C": I = +g[F][1], G = +g[F][2], O = +g[F][3], K = +g[F][4], _ = +g[F][5], T = +g[F][6], $.push([z, _, T, I, G, O, K]); break; case "T": case "L": _ = +g[F][1], T = +g[F][2], $.push([z, _, T]); break; case "H": z = "L", _ = +g[F][1], $.push([z, _, T]); break; case "V": z = "L", T = +g[F][1], $.push([z, _, T]); break; case "A": z = "L"; var P = +g[F][1], R = +g[F][2]; +g[F][4] || (P = -P, R = -R); var H = _ - P, B = T; for (x = 1; x <= n / 2; x++) { var W = 2 * Math.PI * x / n; $.push([ z, H + P * Math.cos(W), B + R * Math.sin(W) ]); } break; case "Z": (_ !== S || T !== M) && (_ = S, T = M, $.push([z, _, T])); break; } for (var ee = (v || {}).domain, re = p._fullLayout._size, ae = v && v.xsizemode === "pixel", Q = v && v.ysizemode === "pixel", ue = m === false, j = 0; j < $.length; j++) { for (x = 0; x + 2 < 7; x += 2) { var U = $[j][x + 1], Z = $[j][x + 2]; U === void 0 || Z === void 0 || (_ = U, T = Z, v && (v.xaxis && v.xaxis.p2r ? (ue && (U -= v.xaxis._offset), ae ? U = l(v.xaxis, v.xanchor) + U : U = o(v.xaxis, U)) : (ue && (U -= re.l), ee ? U = ee.x[0] + U / re.w : U = U / re.w), v.yaxis && v.yaxis.p2r ? (ue && (Z -= v.yaxis._offset), Q ? Z = l(v.yaxis, v.yanchor) - Z : Z = o(v.yaxis, Z)) : (ue && (Z -= re.t), ee ? Z = ee.y[1] - Z / re.h : Z = 1 - Z / re.h)), $[j][x + 1] = U, $[j][x + 2] = Z); } y[w].push( $[j].slice() ); } } return y; }; function f(h, p) { return Math.abs(h - p) <= 1e-6; } function d(h, p) { var v = p[1] - h[1], m = p[2] - h[2]; return Math.sqrt( v * v + m * m ); } e10.pointsOnRectangle = function(h) { var p = h.length; if (p !== 5) return false; for (var v = 1; v < 3; v++) { var m = h[0][v] - h[1][v], g = h[3][v] - h[2][v]; if (!f(m, g)) return false; var y = h[0][v] - h[3][v], w = h[1][v] - h[2][v]; if (!f(y, w)) return false; } return !f(h[0][1], h[1][1]) && !f(h[0][1], h[3][1]) ? false : !!(d(h[0], h[1]) * d(h[0], h[3])); }, e10.pointsOnEllipse = function(h) { var p = h.length; if (p !== n + 1) return false; p = n; for (var v = 0; v < p; v++) { var m = (p * 2 - v) % p, g = (p / 2 + m) % p, y = (p / 2 + v) % p; if (!f( d(h[v], h[y]), d(h[m], h[g]) )) return false; } return true; }, e10.handleEllipse = function(h, p, v) { if (!h) return [p, v]; var m = e10.ellipseOver({ x0: p[0], y0: p[1], x1: v[0], y1: v[1] }), g = (m.x1 + m.x0) / 2, y = (m.y1 + m.y0) / 2, w = (m.x1 - m.x0) / 2, k = (m.y1 - m.y0) / 2; w || (w = k = k / a), k || (k = w = w / a); for (var x = [], _ = 0; _ < n; _++) { var T = _ * 2 * Math.PI / n; x.push([ g + w * Math.cos(T), y + k * Math.sin(T) ]); } return x; }, e10.ellipseOver = function(h) { var p = h.x0, v = h.y0, m = h.x1, g = h.y1, y = m - p, w = g - v; p -= y, v -= w; var k = (p + m) / 2, x = (v + g) / 2, _ = a; return y *= _, w *= _, { x0: k - y, y0: x - w, x1: k + y, y1: x + w }; }, e10.fixDatesForPaths = function(h, p, v) { var m = p.type === "date", g = v.type === "date"; if (!m && !g) return h; for (var y = 0; y < h.length; y++) for (var w = 0; w < h[y].length; w++) for (var k = 0; k + 2 < h[y][w].length; k += 2) m && (h[y][w][k + 1] = h[y][w][k + 1].replace(" ", "_")), g && (h[y][w][k + 2] = h[y][w][k + 2].replace(" ", "_")); return h; }; })(_l); var yD = rf; var yK = yD.drawMode; var bK = yD.openMode; var nf = Rb; var Ck = nf.i000; var Lk = nf.i090; var Dk = nf.i180; var Ek = nf.i270; var _K = nf.cos45; var xK = nf.sin45; var bD = Pb; var ah = bD.p2r; var Ho = bD.r2p; var wK = _s; var TK = wK.clearOutline; var Ip = _l; var kK = Ip.readPaths; var AK = Ip.writePaths; var MK = Ip.ellipseOver; var SK = Ip.fixDatesForPaths; function CK(e10, t) { if (e10.length) { var r = e10[0][0]; if (r) { var n = t.gd, a = t.isActiveShape, i = t.dragmode, o = (n.layout || {}).shapes || []; if (!yK(i) && a !== void 0) { var l = n._fullLayout._activeShapeIndex; if (l < o.length) switch (n._fullLayout.shapes[l].type) { case "rect": i = "drawrect"; break; case "circle": i = "drawcircle"; break; case "line": i = "drawline"; break; case "path": var s = o[l].path || ""; s[s.length - 1] === "Z" ? i = "drawclosedpath" : i = "drawopenpath"; break; } } var u = _D(e10, t, i); TK(n); for (var f = t.editHelpers, d = (f || {}).modifyItem, h = [], p = 0; p < o.length; p++) { var v = n._fullLayout.shapes[p]; if (h[p] = v._input, a !== void 0 && p === n._fullLayout._activeShapeIndex) { var m = u; switch (v.type) { case "line": case "rect": case "circle": d("x0", m.x0), d("x1", m.x1), d("y0", m.y0), d("y1", m.y1); break; case "path": d("path", m.path); break; } } } return a === void 0 ? (h.push(u), h) : f ? f.getUpdateObj() : {}; } } } function _D(e10, t, r) { var n = e10[0][0], a = t.gd, i = n.getAttribute("d"), o = a._fullLayout.newshape, l = t.plotinfo, s = t.isActiveShape, u = l.xaxis, f = l.yaxis, d = !!l.domain || !l.xaxis, h = !!l.domain || !l.yaxis, p = bK(r), v = kK(i, a, l, s), m = { editable: true, visible: o.visible, name: o.name, showlegend: o.showlegend, legend: o.legend, legendwidth: o.legendwidth, legendgroup: o.legendgroup, legendgrouptitle: { text: o.legendgrouptitle.text, font: o.legendgrouptitle.font }, legendrank: o.legendrank, label: o.label, xref: d ? "paper" : u._id, yref: h ? "paper" : f._id, layer: o.layer, opacity: o.opacity, line: { color: o.line.color, width: o.line.width, dash: o.line.dash } }; p || (m.fillcolor = o.fillcolor, m.fillrule = o.fillrule); var g; if (v.length === 1 && (g = v[0]), g && g.length === 5 && // ensure we only have 4 corners for a rect r === "drawrect") m.type = "rect", m.x0 = g[0][1], m.y0 = g[0][2], m.x1 = g[2][1], m.y1 = g[2][2]; else if (g && r === "drawline") m.type = "line", m.x0 = g[0][1], m.y0 = g[0][2], m.x1 = g[1][1], m.y1 = g[1][2]; else if (g && r === "drawcircle") { m.type = "circle"; var y = g[Ck][1], w = g[Lk][1], k = g[Dk][1], x = g[Ek][1], _ = g[Ck][2], T = g[Lk][2], S = g[Dk][2], M = g[Ek][2], L = l.xaxis && (l.xaxis.type === "date" || l.xaxis.type === "log"), F = l.yaxis && (l.yaxis.type === "date" || l.yaxis.type === "log"); L && (y = Ho(l.xaxis, y), w = Ho(l.xaxis, w), k = Ho(l.xaxis, k), x = Ho(l.xaxis, x)), F && (_ = Ho(l.yaxis, _), T = Ho(l.yaxis, T), S = Ho(l.yaxis, S), M = Ho(l.yaxis, M)); var $ = (w + x) / 2, I = (_ + S) / 2, O = (x - w + k - y) / 2, G = (M - T + S - _) / 2, K = MK({ x0: $, y0: I, x1: $ + O * _K, y1: I + G * xK }); L && (K.x0 = ah(l.xaxis, K.x0), K.x1 = ah(l.xaxis, K.x1)), F && (K.y0 = ah(l.yaxis, K.y0), K.y1 = ah(l.yaxis, K.y1)), m.x0 = K.x0, m.y0 = K.y0, m.x1 = K.x1, m.y1 = K.y1; } else m.type = "path", u && f && SK(v, u, f), m.path = AK(v), g = null; return m; } var $b = { newShapes: CK, createShapeObj: _D }; var LK = rf; var DK = LK.selectMode; var EK = _s; var FK = EK.clearOutline; var zb = _l; var RK = zb.readPaths; var PK = zb.writePaths; var $K = zb.fixDatesForPaths; var xD = function(t, r) { if (t.length) { var n = t[0][0]; if (n) { var a = n.getAttribute("d"), i = r.gd, o = i._fullLayout.newselection, l = r.plotinfo, s = l.xaxis, u = l.yaxis, f = r.isActiveSelection, d = r.dragmode, h = (i.layout || {}).selections || []; if (!DK(d) && f !== void 0) { var p = i._fullLayout._activeSelectionIndex; if (p < h.length) switch (i._fullLayout.selections[p].type) { case "rect": d = "select"; break; case "path": d = "lasso"; break; } } var v = RK(a, i, l, f), m = { xref: s._id, yref: u._id, opacity: o.opacity, line: { color: o.line.color, width: o.line.width, dash: o.line.dash } }, g; v.length === 1 && (g = v[0]), g && g.length === 5 && // ensure we only have 4 corners for a rect d === "select" ? (m.type = "rect", m.x0 = g[0][1], m.y0 = g[0][2], m.x1 = g[2][1], m.y1 = g[2][2]) : (m.type = "path", s && u && $K(v, s, u), m.path = PK(v), g = null), FK(i); for (var y = r.editHelpers, w = (y || {}).modifyItem, k = [], x = 0; x < h.length; x++) { var _ = i._fullLayout.selections[x]; if (!_) { k[x] = _; continue; } if (k[x] = _._input, f !== void 0 && x === i._fullLayout._activeSelectionIndex) { var T = m; switch (_.type) { case "rect": w("x0", T.x0), w("x1", T.x1), w("y0", T.y0), w("y1", T.y1); break; case "path": w("path", T.path); break; } } } return f === void 0 ? (k.push(m), k) : y ? y.getUpdateObj() : {}; } } }; var xl = {}; var Np = { segmentRE: /[MLHVQCTSZ][^MLHVQCTSZ]*/g, paramRE: /[^\s,]+/g, // which numbers in each path segment are x (or y) values // drawn is which param is a drawn point, as opposed to a // control point (which doesn't count toward autorange. // TODO: this means curved paths could extend beyond the // autorange bounds. This is a bit tricky to get right // unless we revert to bounding boxes, but perhaps there's // a calculation we could do...) paramIsX: { M: { 0: true, drawn: 0 }, L: { 0: true, drawn: 0 }, H: { 0: true, drawn: 0 }, V: {}, Q: { 0: true, 2: true, drawn: 2 }, C: { 0: true, 2: true, 4: true, drawn: 4 }, T: { 0: true, drawn: 0 }, S: { 0: true, 2: true, drawn: 2 }, // A: {0: true, 5: true}, Z: {} }, paramIsY: { M: { 1: true, drawn: 1 }, L: { 1: true, drawn: 1 }, H: {}, V: { 0: true, drawn: 0 }, Q: { 1: true, 3: true, drawn: 3 }, C: { 1: true, 3: true, 5: true, drawn: 5 }, T: { 1: true, drawn: 1 }, S: { 1: true, 3: true, drawn: 5 }, // A: {1: true, 6: true}, Z: {} }, numParams: { M: 2, L: 2, H: 1, V: 1, Q: 4, C: 6, T: 2, S: 4, // A: 7, Z: 0 } }; (function(e10) { var t = Np, r = Ue, n = Cr; e10.rangeToShapePosition = function(i) { return i.type === "log" ? i.r2d : function(o) { return o; }; }, e10.shapePositionToRange = function(i) { return i.type === "log" ? i.d2r : function(o) { return o; }; }, e10.decodeDate = function(i) { return function(o) { return o.replace && (o = o.replace("_", " ")), i(o); }; }, e10.encodeDate = function(i) { return function(o) { return i(o).replace(" ", "_"); }; }, e10.extractPathCoords = function(i, o, l) { var s = [], u = i.match(t.segmentRE); return u.forEach(function(f) { var d = o[f.charAt(0)].drawn; if (d !== void 0) { var h = f.substr(1).match(t.paramRE); if (!(!h || h.length < d)) { var p = h[d], v = l ? p : r.cleanNumber(p); s.push(v); } } }), s; }, e10.getDataToPixel = function(i, o, l, s) { var u = i._fullLayout._size, f; if (o) if (s === "domain") f = function(h) { return o._length * (l ? 1 - h : h) + o._offset; }; else { var d = e10.shapePositionToRange(o); f = function(h) { return o._offset + o.r2p(d(h, true)); }, o.type === "date" && (f = e10.decodeDate(f)); } else l ? f = function(h) { return u.t + u.h * (1 - h); } : f = function(h) { return u.l + u.w * h; }; return f; }, e10.getPixelToData = function(i, o, l, s) { var u = i._fullLayout._size, f; if (o) if (s === "domain") f = function(h) { var p = (h - o._offset) / o._length; return l ? 1 - p : p; }; else { var d = e10.rangeToShapePosition(o); f = function(h) { return d(o.p2r(h - o._offset)); }; } else l ? f = function(h) { return 1 - (h - u.t) / u.h; } : f = function(h) { return (h - u.l) / u.w; }; return f; }, e10.roundPositionForSharpStrokeRendering = function(i, o) { var l = Math.round(o % 2) === 1, s = Math.round(i); return l ? s + 0.5 : s; }, e10.makeShapesOptionsAndPlotinfo = function(i, o) { var l = i._fullLayout.shapes[o] || {}, s = i._fullLayout._plots[l.xref + l.yref], u = !!s; return u ? s._hadPlotinfo = true : (s = {}, l.xref && l.xref !== "paper" && (s.xaxis = i._fullLayout[l.xref + "axis"]), l.yref && l.yref !== "paper" && (s.yaxis = i._fullLayout[l.yref + "axis"])), s.xsizemode = l.xsizemode, s.ysizemode = l.ysizemode, s.xanchor = l.xanchor, s.yanchor = l.yanchor, { options: l, plotinfo: s }; }, e10.makeSelectionsOptionsAndPlotinfo = function(i, o) { var l = i._fullLayout.selections[o] || {}, s = i._fullLayout._plots[l.xref + l.yref], u = !!s; return u ? s._hadPlotinfo = true : (s = {}, l.xref && (s.xaxis = i._fullLayout[l.xref + "axis"]), l.yref && (s.yaxis = i._fullLayout[l.yref + "axis"])), { options: l, plotinfo: s }; }, e10.getPathString = function(i, o) { var l = o.type, s = n.getRefType(o.xref), u = n.getRefType(o.yref), f = n.getFromId(i, o.xref), d = n.getFromId(i, o.yref), h = i._fullLayout._size, p, v, m, g, y, w, k, x; if (f ? s === "domain" ? v = function(G) { return f._offset + f._length * G; } : (p = e10.shapePositionToRange(f), v = function(G) { return f._offset + f.r2p(p(G, true)); }) : v = function(G) { return h.l + h.w * G; }, d ? u === "domain" ? g = function(G) { return d._offset + d._length * (1 - G); } : (m = e10.shapePositionToRange(d), g = function(G) { return d._offset + d.r2p(m(G, true)); }) : g = function(G) { return h.t + h.h * (1 - G); }, l === "path") return f && f.type === "date" && (v = e10.decodeDate(v)), d && d.type === "date" && (g = e10.decodeDate(g)), a(o, v, g); if (o.xsizemode === "pixel") { var _ = v(o.xanchor); y = _ + o.x0, w = _ + o.x1; } else y = v(o.x0), w = v(o.x1); if (o.ysizemode === "pixel") { var T = g(o.yanchor); k = T - o.y0, x = T - o.y1; } else k = g(o.y0), x = g(o.y1); if (l === "line") return "M" + y + "," + k + "L" + w + "," + x; if (l === "rect") return "M" + y + "," + k + "H" + w + "V" + x + "H" + y + "Z"; var S = (y + w) / 2, M = (k + x) / 2, L = Math.abs(S - y), F = Math.abs(M - k), $ = "A" + L + "," + F, I = S + L + "," + M, O = S + "," + (M - F); return "M" + I + $ + " 0 1,1 " + O + $ + " 0 0,1 " + I + "Z"; }; function a(i, o, l) { var s = i.path, u = i.xsizemode, f = i.ysizemode, d = i.xanchor, h = i.yanchor; return s.replace(t.segmentRE, function(p) { var v = 0, m = p.charAt(0), g = t.paramIsX[m], y = t.paramIsY[m], w = t.numParams[m], k = p.substr(1).replace(t.paramRE, function(x) { return g[v] ? u === "pixel" ? x = o(d) + Number(x) : x = o(x) : y[v] && (f === "pixel" ? x = l(h) - Number(x) : x = l(x)), v++, v > w && (x = "X"), x; }); return v > w && (k = k.replace(/[\s,]*X.*/, ""), r.log("Ignoring extra params in segment " + p)), m + k; }); } })(xl); var zK = Ue; var Os = Cr; var Fk = Rn; var Rk = Sr; var IK = _l.readPaths; var $y = xl; var NK = $y.getPathString; var Pk = K1; var OK = On.FROM_TL; var wD = function(t, r, n, a) { if (a.selectAll(".shape-label").remove(), !!(n.label.text || n.label.texttemplate)) { var i; if (n.label.texttemplate) { var o = {}; if (n.type !== "path") { var l = Os.getFromId(t, n.xref), s = Os.getFromId(t, n.yref); for (var u in Pk) { var f = Pk[u](n, l, s); f !== void 0 && (o[u] = f); } } i = zK.texttemplateStringForShapes( n.label.texttemplate, {}, t._fullLayout._d3locale, o ); } else i = n.label.text; var d = { "data-index": r }, h = n.label.font, p = { "data-notex": 1 }, v = a.append("g").attr(d).classed("shape-label", true), m = v.append("text").attr(p).classed("shape-label-text", true).text(i), g, y, w, k; if (n.path) { var x = NK(t, n), _ = IK(x, t); g = 1 / 0, w = 1 / 0, y = -1 / 0, k = -1 / 0; for (var T = 0; T < _.length; T++) for (var S = 0; S < _[T].length; S++) for (var M = _[T][S], L = 1; L < M.length; L += 2) { var F = M[L], $ = M[L + 1]; g = Math.min(g, F), y = Math.max(y, F), w = Math.min(w, $), k = Math.max(k, $); } } else { var I = Os.getFromId(t, n.xref), O = Os.getRefType(n.xref), G = Os.getFromId(t, n.yref), K = Os.getRefType(n.yref), V = $y.getDataToPixel(t, I, false, O), z = $y.getDataToPixel(t, G, true, K); g = V(n.x0), y = V(n.x1), w = z(n.y0), k = z(n.y1); } var P = n.label.textangle; P === "auto" && (n.type === "line" ? P = HK(g, w, y, k) : P = 0), m.call(function(re) { return re.call(Rk.font, h).attr({}), Fk.convertToTspans(re, t), re; }); var R = Rk.bBox(m.node()), H = BK(g, w, y, k, n, P, R), B = H.textx, W = H.texty, ee = H.xanchor; m.attr({ "text-anchor": { left: "start", center: "middle", right: "end" }[ee], y: W, x: B, transform: "rotate(" + P + "," + B + "," + W + ")" }).call(Fk.positionText, B, W); } }; function HK(e10, t, r, n) { var a, i; return i = Math.abs(r - e10), r >= e10 ? a = t - n : a = n - t, -180 / Math.PI * Math.atan2(a, i); } function BK(e10, t, r, n, a, i, o) { var l = a.label.textposition, s = a.label.textangle, u = a.label.padding, f = a.type, d = Math.PI / 180 * i, h = Math.sin(d), p = Math.cos(d), v = a.label.xanchor, m = a.label.yanchor, g, y, w, k; if (f === "line") { l === "start" ? (g = e10, y = t) : l === "end" ? (g = r, y = n) : (g = (e10 + r) / 2, y = (t + n) / 2), v === "auto" && (l === "start" ? s === "auto" ? r > e10 ? v = "left" : r < e10 ? v = "right" : v = "center" : r > e10 ? v = "right" : r < e10 ? v = "left" : v = "center" : l === "end" ? s === "auto" ? r > e10 ? v = "right" : r < e10 ? v = "left" : v = "center" : r > e10 ? v = "left" : r < e10 ? v = "right" : v = "center" : v = "center"); var x = { left: 1, center: 0, right: -1 }, _ = { bottom: -1, middle: 0, top: 1 }; if (s === "auto") { var T = _[m]; w = -u * h * T, k = u * p * T; } else { var S = x[v], M = _[m]; w = u * S, k = u * M; } g = g + w, y = y + k; } else w = u + 3, l.indexOf("right") !== -1 ? (g = Math.max(e10, r) - w, v === "auto" && (v = "right")) : l.indexOf("left") !== -1 ? (g = Math.min(e10, r) + w, v === "auto" && (v = "left")) : (g = (e10 + r) / 2, v === "auto" && (v = "center")), l.indexOf("top") !== -1 ? y = Math.min(t, n) : l.indexOf("bottom") !== -1 ? y = Math.max(t, n) : y = (t + n) / 2, k = u, m === "bottom" ? y = y - k : m === "top" && (y = y + k); var L = OK[m], F = a.label.font.size, $ = o.height, I = ($ * L - F) * h, O = -($ * L - F) * p; return { textx: g + I, texty: y + O, xanchor: v }; } var jK = Ue; var UK = jK.strTranslate; var $k = Qi; var TD = rf; var GK = TD.drawMode; var kD = TD.selectMode; var AD = Nt; var zk = nr; var Op = Rb; var VK = Op.i000; var qK = Op.i090; var WK = Op.i180; var ZK = Op.i270; var YK = _s; var MD = YK.clearOutlineControllers; var Ib = _l; var ih = Ib.pointsOnRectangle; var Lg = Ib.pointsOnEllipse; var XK = Ib.writePaths; var KK = $b.newShapes; var JK = $b.createShapeObj; var QK = xD; var eJ = wD; var Nb = function e8(t, r, n, a) { a || (a = 0); var i = n.gd; function o() { e8(t, r, n, a++), (Lg(t[0]) || n.hasText) && l({ redrawing: true }); } function l(z) { var P = {}; n.isActiveShape !== void 0 && (n.isActiveShape = false, P = KK(r, n)), n.isActiveSelection !== void 0 && (n.isActiveSelection = false, P = QK(r, n), i._fullLayout._reselect = true), Object.keys(P).length && AD.call((z || {}).redrawing ? "relayout" : "_guiRelayout", i, P); } var s = i._fullLayout, u = s._zoomlayer, f = n.dragmode, d = GK(f), h = kD(f); (d || h) && (i._fullLayout._outlining = true), MD(i), r.attr("d", XK(t)); var p, v, m, g, y; if (!a && (n.isActiveShape || n.isActiveSelection)) { y = tJ([], t); var w = u.append("g").attr("class", "outline-controllers"); F(w), V(); } if (d && n.hasText) { var k = u.select(".label-temp"), x = JK(r, n, n.dragmode); eJ(i, "label-temp", x, k); } function _(z) { m = +z.srcElement.getAttribute("data-i"), g = +z.srcElement.getAttribute("data-j"), p[m][g].moveFn = T; } function T(z, P) { if (t.length) { var R = y[m][g][1], H = y[m][g][2], B = t[m], W = B.length; if (ih(B)) { var ee = z, re = P; if (n.isActiveSelection) { var ae = Ik(B, g); ae[1] === B[g][1] ? re = 0 : ee = 0; } for (var Q = 0; Q < W; Q++) if (Q !== g) { var ue = B[Q]; ue[1] === B[g][1] && (ue[1] = R + ee), ue[2] === B[g][2] && (ue[2] = H + re); } if (B[g][1] = R + ee, B[g][2] = H + re, !ih(B)) for (var j = 0; j < W; j++) for (var U = 0; U < B[j].length; U++) B[j][U] = y[m][j][U]; } else B[g][1] = R + z, B[g][2] = H + P; o(); } } function S() { l(); } function M() { if (t.length && t[m] && t[m].length) { for (var z = [], P = 0; P < t[m].length; P++) P !== g && z.push( t[m][P] ); z.length > 1 && !(z.length === 2 && z[1][0] === "Z") && (g === 0 && (z[0][0] = "M"), t[m] = z, o(), l()); } } function L(z, P) { if (z === 2) { m = +P.srcElement.getAttribute("data-i"), g = +P.srcElement.getAttribute("data-j"); var R = t[m]; !ih(R) && !Lg(R) && M(); } } function F(z) { p = []; for (var P = 0; P < t.length; P++) { var R = t[P], H = ih(R), B = !H && Lg(R); p[P] = []; for (var W = R.length, ee = 0; ee < W; ee++) if (R[ee][0] !== "Z" && !(B && ee !== VK && ee !== qK && ee !== WK && ee !== ZK)) { var re = H && n.isActiveSelection, ae; re && (ae = Ik(R, ee)); var Q = R[ee][1], ue = R[ee][2], j = z.append(re ? "rect" : "circle").attr("data-i", P).attr("data-j", ee).style({ fill: zk.background, stroke: zk.defaultLine, "stroke-width": 1, "shape-rendering": "crispEdges" }); if (re) { var U = ae[1] - Q, Z = ae[2] - ue, le = Z ? 5 : Math.max(Math.min(25, Math.abs(U) - 5), 5), J = U ? 5 : Math.max(Math.min(25, Math.abs(Z) - 5), 5); j.classed(Z ? "cursor-ew-resize" : "cursor-ns-resize", true).attr("width", le).attr("height", J).attr("x", Q - le / 2).attr("y", ue - J / 2).attr("transform", UK(U / 2, Z / 2)); } else j.classed("cursor-grab", true).attr("r", 5).attr("cx", Q).attr("cy", ue); p[P][ee] = { element: j.node(), gd: i, prepFn: _, doneFn: S, clickFn: L }, $k.init(p[P][ee]); } } } function $(z, P) { if (t.length) for (var R = 0; R < t.length; R++) for (var H = 0; H < t[R].length; H++) for (var B = 0; B + 2 < t[R][H].length; B += 2) t[R][H][B + 1] = y[R][H][B + 1] + z, t[R][H][B + 2] = y[R][H][B + 2] + P; } function I(z, P) { $(z, P), o(); } function O(z) { m = +z.srcElement.getAttribute("data-i"), m || (m = 0), v[m].moveFn = I; } function G() { l(); } function K(z) { z === 2 && rJ(i); } function V() { if (v = [], !!t.length) { var z = 0; v[z] = { element: r[0][0], gd: i, prepFn: O, doneFn: G, clickFn: K }, $k.init(v[z]); } } }; function tJ(e10, t) { for (var r = 0; r < t.length; r++) { var n = t[r]; e10[r] = []; for (var a = 0; a < n.length; a++) { e10[r][a] = []; for (var i = 0; i < n[a].length; i++) e10[r][a][i] = n[a][i]; } } return e10; } function Ik(e10, t) { var r = e10[t][1], n = e10[t][2], a = e10.length, i, o, l; return i = (t + 1) % a, o = e10[i][1], l = e10[i][2], o === r && l === n && (i = (t + 2) % a, o = e10[i][1], l = e10[i][2]), [i, o, l]; } function rJ(e10) { if (kD(e10._fullLayout.dragmode)) { MD(e10); var t = e10._fullLayout._activeSelectionIndex, r = (e10.layout || {}).selections || []; if (t < r.length) { for (var n = [], a = 0; a < r.length; a++) a !== t && n.push(r[a]); delete e10._fullLayout._activeSelectionIndex; var i = e10._fullLayout.selections[t]; e10._fullLayout._deselect = { xref: i.xref, yref: i.yref }, AD.call("_guiRelayout", e10, { selections: n }); } } } var nJ = lr; var SD = Nt; var Nk = Ue; var Hs = Cr; var aJ = _l.readPaths; var iJ = Nb; var wv = wD; var CD = _s.clearOutlineControllers; var Dg = nr; var Ob = Sr; var oJ = Mr.arrayEditor; var Ok = Qi; var Hk = xs; var Nl = Np; var na = xl; var zy = na.getPathString; var Hb = { draw: Bb, drawOne: LD, eraseActiveShape: uJ, drawLabel: wv }; function Bb(e10) { var t = e10._fullLayout; t._shapeUpperLayer.selectAll("path").remove(), t._shapeLowerLayer.selectAll("path").remove(), t._shapeUpperLayer.selectAll("text").remove(), t._shapeLowerLayer.selectAll("text").remove(); for (var r in t._plots) { var n = t._plots[r].shapelayer; n && (n.selectAll("path").remove(), n.selectAll("text").remove()); } for (var a = 0; a < t.shapes.length; a++) t.shapes[a].visible === true && LD(e10, a); } function oh(e10) { return !!e10._fullLayout._outlining; } function Hp(e10) { return !e10._context.edits.shapePosition; } function LD(e10, t) { e10._fullLayout._paperdiv.selectAll('.shapelayer [data-index="' + t + '"]').remove(); var r = na.makeShapesOptionsAndPlotinfo(e10, t), n = r.options, a = r.plotinfo; if (!n._input || n.visible !== true) return; if (n.layer !== "below") o(e10._fullLayout._shapeUpperLayer); else if (n.xref === "paper" || n.yref === "paper") o(e10._fullLayout._shapeLowerLayer); else if (a._hadPlotinfo) { var i = a.mainplotinfo || a; o(i.shapelayer); } else o(e10._fullLayout._shapeLowerLayer); function o(l) { var s = zy(e10, n), u = { "data-index": t, "fill-rule": n.fillrule, d: s }, f = n.opacity, d = n.fillcolor, h = n.line.width ? n.line.color : "rgba(0,0,0,0)", p = n.line.width, v = n.line.dash; !p && n.editable === true && (p = 5, v = "solid"); var m = s[s.length - 1] !== "Z", g = Hp(e10) && n.editable && e10._fullLayout._activeShapeIndex === t; g && (d = m ? "rgba(0,0,0,0)" : e10._fullLayout.activeshape.fillcolor, f = e10._fullLayout.activeshape.opacity); var y = l.append("g").classed("shape-group", true).attr({ "data-index": t }), w = y.append("path").attr(u).style("opacity", f).call(Dg.stroke, h).call(Dg.fill, d).call(Ob.dashLine, v, p); DD(y, e10, n), wv(e10, t, n, y); var k; if ((g || e10._context.edits.shapePosition) && (k = oJ(e10.layout, "shapes", n)), g) { w.style({ cursor: "move" }); var x = { element: w.node(), plotinfo: a, gd: e10, editHelpers: k, hasText: n.label.text || n.label.texttemplate, isActiveShape: true // i.e. to enable controllers }, _ = aJ(s, e10); iJ(_, w, x); } else e10._context.edits.shapePosition ? lJ(e10, w, n, t, l, k) : n.editable === true && w.style( "pointer-events", m || Dg.opacity(d) * f <= 0.5 ? "stroke" : "all" ); w.node().addEventListener("click", function() { return sJ(e10, w); }); } } function DD(e10, t, r) { var n = (r.xref + r.yref).replace(/paper/g, "").replace(/[xyz][1-9]* *domain/g, ""); Ob.setClipUrl( e10, n ? "clip" + t._fullLayout._uid + n : null, t ); } function lJ(e10, t, r, n, a, i) { var o = 10, l = 10, s = r.xsizemode === "pixel", u = r.ysizemode === "pixel", f = r.type === "line", d = r.type === "path", h = i.modifyItem, p, v, m, g, y, w, k, x, _, T, S, M, L, F, $, I = nJ.select(t.node().parentNode), O = Hs.getFromId(e10, r.xref), G = Hs.getRefType(r.xref), K = Hs.getFromId(e10, r.yref), V = Hs.getRefType(r.yref), z = na.getDataToPixel(e10, O, false, G), P = na.getDataToPixel(e10, K, true, V), R = na.getPixelToData(e10, O, false, G), H = na.getPixelToData(e10, K, true, V), B = re(), W = { element: B.node(), gd: e10, prepFn: ue, doneFn: j, clickFn: U }, ee; Ok.init(W), B.node().onmousemove = Q; function re() { return f ? ae() : t; } function ae() { var ve = 10, me = Math.max(r.line.width, ve), Le = a.append("g").attr("data-index", n).attr("drag-helper", true); Le.append("path").attr("d", t.attr("d")).style({ cursor: "move", "stroke-width": me, "stroke-opacity": "0" // ensure not visible }); var ze = { "fill-opacity": "0" // ensure not visible }, Fe = Math.max(me / 2, ve); return Le.append("circle").attr({ "data-line-point": "start-point", cx: s ? z(r.xanchor) + r.x0 : z(r.x0), cy: u ? P(r.yanchor) - r.y0 : P(r.y0), r: Fe }).style(ze).classed("cursor-grab", true), Le.append("circle").attr({ "data-line-point": "end-point", cx: s ? z(r.xanchor) + r.x1 : z(r.x1), cy: u ? P(r.yanchor) - r.y1 : P(r.y1), r: Fe }).style(ze).classed("cursor-grab", true), Le; } function Q(ve) { if (oh(e10)) { ee = null; return; } if (f) ve.target.tagName === "path" ? ee = "move" : ee = ve.target.attributes["data-line-point"].value === "start-point" ? "resize-over-start-point" : "resize-over-end-point"; else { var me = W.element.getBoundingClientRect(), Le = me.right - me.left, ze = me.bottom - me.top, Fe = ve.clientX - me.left, Oe = ve.clientY - me.top, Re = !d && Le > o && ze > l && !ve.shiftKey ? Ok.getCursor(Fe / Le, 1 - Oe / ze) : "move"; Hk(t, Re), ee = Re.split("-")[0]; } } function ue(ve) { oh(e10) || (s && (y = z(r.xanchor)), u && (w = P(r.yanchor)), r.type === "path" ? $ = r.path : (p = s ? r.x0 : z(r.x0), v = u ? r.y0 : P(r.y0), m = s ? r.x1 : z(r.x1), g = u ? r.y1 : P(r.y1)), p < m ? (_ = p, L = "x0", T = m, F = "x1") : (_ = m, L = "x1", T = p, F = "x0"), !u && v < g || u && v > g ? (k = v, S = "y0", x = g, M = "y1") : (k = g, S = "y1", x = v, M = "y0"), Q(ve), J(a, r), ge(t, r, e10), W.moveFn = ee === "move" ? Z : le, W.altKey = ve.altKey); } function j() { oh(e10) || (Hk(t), pe(a), DD(t, e10, r), SD.call("_guiRelayout", e10, i.getUpdateObj())); } function U() { oh(e10) || pe(a); } function Z(ve, me) { if (r.type === "path") { var Le = function(Oe) { return Oe; }, ze = Le, Fe = Le; s ? h("xanchor", r.xanchor = R(y + ve)) : (ze = function(Re) { return R(z(Re) + ve); }, O && O.type === "date" && (ze = na.encodeDate(ze))), u ? h("yanchor", r.yanchor = H(w + me)) : (Fe = function(Re) { return H(P(Re) + me); }, K && K.type === "date" && (Fe = na.encodeDate(Fe))), h("path", r.path = Bk($, ze, Fe)); } else s ? h("xanchor", r.xanchor = R(y + ve)) : (h("x0", r.x0 = R(p + ve)), h("x1", r.x1 = R(m + ve))), u ? h("yanchor", r.yanchor = H(w + me)) : (h("y0", r.y0 = H(v + me)), h("y1", r.y1 = H(g + me))); t.attr("d", zy(e10, r)), J(a, r), wv(e10, n, r, I); } function le(ve, me) { if (d) { var Le = function(Ie) { return Ie; }, ze = Le, Fe = Le; s ? h("xanchor", r.xanchor = R(y + ve)) : (ze = function(Ne) { return R(z(Ne) + ve); }, O && O.type === "date" && (ze = na.encodeDate(ze))), u ? h("yanchor", r.yanchor = H(w + me)) : (Fe = function(Ne) { return H(P(Ne) + me); }, K && K.type === "date" && (Fe = na.encodeDate(Fe))), h("path", r.path = Bk($, ze, Fe)); } else if (f) { if (ee === "resize-over-start-point") { var Oe = p + ve, Re = u ? v - me : v + me; h("x0", r.x0 = s ? Oe : R(Oe)), h("y0", r.y0 = u ? Re : H(Re)); } else if (ee === "resize-over-end-point") { var We = m + ve, Me = u ? g - me : g + me; h("x1", r.x1 = s ? We : R(We)), h("y1", r.y1 = u ? Me : H(Me)); } } else { var Ve = function(Ie) { return ee.indexOf(Ie) !== -1; }, qe = Ve("n"), Qe = Ve("s"), ot = Ve("w"), ht = Ve("e"), vt = qe ? k + me : k, nt = Qe ? x + me : x, ft = ot ? _ + ve : _, Pe = ht ? T + ve : T; u && (qe && (vt = k - me), Qe && (nt = x - me)), (!u && nt - vt > l || u && vt - nt > l) && (h(S, r[S] = u ? vt : H(vt)), h(M, r[M] = u ? nt : H(nt))), Pe - ft > o && (h(L, r[L] = s ? ft : R(ft)), h(F, r[F] = s ? Pe : R(Pe))); } t.attr("d", zy(e10, r)), J(a, r), wv(e10, n, r, I); } function J(ve, me) { (s || u) && Le(); function Le() { var ze = me.type !== "path", Fe = ve.selectAll(".visual-cue").data([0]), Oe = 1; Fe.enter().append("path").attr({ fill: "#fff", "fill-rule": "evenodd", stroke: "#000", "stroke-width": Oe }).classed("visual-cue", true); var Re = z( s ? me.xanchor : Nk.midRange( ze ? [me.x0, me.x1] : na.extractPathCoords(me.path, Nl.paramIsX) ) ), We = P( u ? me.yanchor : Nk.midRange( ze ? [me.y0, me.y1] : na.extractPathCoords(me.path, Nl.paramIsY) ) ); if (Re = na.roundPositionForSharpStrokeRendering(Re, Oe), We = na.roundPositionForSharpStrokeRendering(We, Oe), s && u) { var Me = "M" + (Re - 1 - Oe) + "," + (We - 1 - Oe) + "h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z"; Fe.attr("d", Me); } else if (s) { var Ve = "M" + (Re - 1 - Oe) + "," + (We - 9 - Oe) + "v18 h2 v-18 Z"; Fe.attr("d", Ve); } else { var qe = "M" + (Re - 9 - Oe) + "," + (We - 1 - Oe) + "h18 v2 h-18 Z"; Fe.attr("d", qe); } } } function pe(ve) { ve.selectAll(".visual-cue").remove(); } function ge(ve, me, Le) { var ze = me.xref, Fe = me.yref, Oe = Hs.getFromId(Le, ze), Re = Hs.getFromId(Le, Fe), We = ""; ze !== "paper" && !Oe.autorange && (We += ze), Fe !== "paper" && !Re.autorange && (We += Fe), Ob.setClipUrl( ve, We ? "clip" + Le._fullLayout._uid + We : null, Le ); } } function Bk(e10, t, r) { return e10.replace(Nl.segmentRE, function(n) { var a = 0, i = n.charAt(0), o = Nl.paramIsX[i], l = Nl.paramIsY[i], s = Nl.numParams[i], u = n.substr(1).replace(Nl.paramRE, function(f) { return a >= s || (o[a] ? f = t(f) : l[a] && (f = r(f)), a++), f; }); return i + u; }); } function sJ(e10, t) { if (Hp(e10)) { var r = t.node(), n = +r.getAttribute("data-index"); if (n >= 0) { if (n === e10._fullLayout._activeShapeIndex) { jk(e10); return; } e10._fullLayout._activeShapeIndex = n, e10._fullLayout._deactivateShape = jk, Bb(e10); } } } function jk(e10) { if (Hp(e10)) { var t = e10._fullLayout._activeShapeIndex; t >= 0 && (CD(e10), delete e10._fullLayout._activeShapeIndex, Bb(e10)); } } function uJ(e10) { if (Hp(e10)) { CD(e10); var t = e10._fullLayout._activeShapeIndex, r = (e10.layout || {}).shapes || []; if (t < r.length) { for (var n = [], a = 0; a < r.length; a++) a !== t && n.push(r[a]); return delete e10._fullLayout._activeShapeIndex, SD.call("_guiRelayout", e10, { shapes: n }); } } } var Xa = Nt; var ED = Tn; var FD = gn; var vr = Fb; var fJ = Hb.eraseActiveShape; var iu = Ue; var or = iu._; var pr = mD.exports = {}; pr.toImage = { name: "toImage", title: function(e10) { var t = e10._context.toImageButtonOptions || {}, r = t.format || "png"; return r === "png" ? or(e10, "Download plot as a png") : ( // legacy text or(e10, "Download plot") ); }, icon: vr.camera, click: function(e10) { var t = e10._context.toImageButtonOptions, r = { format: t.format || "png" }; iu.notifier(or(e10, "Taking snapshot - this may take a few seconds"), "long"), r.format !== "svg" && iu.isIE() && (iu.notifier(or(e10, "IE only supports svg. Changing format to svg."), "long"), r.format = "svg"), ["filename", "width", "height", "scale"].forEach(function(n) { n in t && (r[n] = t[n]); }), Xa.call("downloadImage", e10, r).then(function(n) { iu.notifier(or(e10, "Snapshot succeeded") + " - " + n, "long"); }).catch(function() { iu.notifier(or(e10, "Sorry, there was a problem downloading your snapshot!"), "long"); }); } }; pr.sendDataToCloud = { name: "sendDataToCloud", title: function(e10) { return or(e10, "Edit in Chart Studio"); }, icon: vr.disk, click: function(e10) { ED.sendDataToCloud(e10); } }; pr.editInChartStudio = { name: "editInChartStudio", title: function(e10) { return or(e10, "Edit in Chart Studio"); }, icon: vr.pencil, click: function(e10) { ED.sendDataToCloud(e10); } }; pr.zoom2d = { name: "zoom2d", _cat: "zoom", title: function(e10) { return or(e10, "Zoom"); }, attr: "dragmode", val: "zoom", icon: vr.zoombox, click: Bn }; pr.pan2d = { name: "pan2d", _cat: "pan", title: function(e10) { return or(e10, "Pan"); }, attr: "dragmode", val: "pan", icon: vr.pan, click: Bn }; pr.select2d = { name: "select2d", _cat: "select", title: function(e10) { return or(e10, "Box Select"); }, attr: "dragmode", val: "select", icon: vr.selectbox, click: Bn }; pr.lasso2d = { name: "lasso2d", _cat: "lasso", title: function(e10) { return or(e10, "Lasso Select"); }, attr: "dragmode", val: "lasso", icon: vr.lasso, click: Bn }; pr.drawclosedpath = { name: "drawclosedpath", title: function(e10) { return or(e10, "Draw closed freeform"); }, attr: "dragmode", val: "drawclosedpath", icon: vr.drawclosedpath, click: Bn }; pr.drawopenpath = { name: "drawopenpath", title: function(e10) { return or(e10, "Draw open freeform"); }, attr: "dragmode", val: "drawopenpath", icon: vr.drawopenpath, click: Bn }; pr.drawline = { name: "drawline", title: function(e10) { return or(e10, "Draw line"); }, attr: "dragmode", val: "drawline", icon: vr.drawline, click: Bn }; pr.drawrect = { name: "drawrect", title: function(e10) { return or(e10, "Draw rectangle"); }, attr: "dragmode", val: "drawrect", icon: vr.drawrect, click: Bn }; pr.drawcircle = { name: "drawcircle", title: function(e10) { return or(e10, "Draw circle"); }, attr: "dragmode", val: "drawcircle", icon: vr.drawcircle, click: Bn }; pr.eraseshape = { name: "eraseshape", title: function(e10) { return or(e10, "Erase active shape"); }, icon: vr.eraseshape, click: fJ }; pr.zoomIn2d = { name: "zoomIn2d", _cat: "zoomin", title: function(e10) { return or(e10, "Zoom in"); }, attr: "zoom", val: "in", icon: vr.zoom_plus, click: Bn }; pr.zoomOut2d = { name: "zoomOut2d", _cat: "zoomout", title: function(e10) { return or(e10, "Zoom out"); }, attr: "zoom", val: "out", icon: vr.zoom_minus, click: Bn }; pr.autoScale2d = { name: "autoScale2d", _cat: "autoscale", title: function(e10) { return or(e10, "Autoscale"); }, attr: "zoom", val: "auto", icon: vr.autoscale, click: Bn }; pr.resetScale2d = { name: "resetScale2d", _cat: "resetscale", title: function(e10) { return or(e10, "Reset axes"); }, attr: "zoom", val: "reset", icon: vr.home, click: Bn }; pr.hoverClosestCartesian = { name: "hoverClosestCartesian", _cat: "hoverclosest", title: function(e10) { return or(e10, "Show closest data on hover"); }, attr: "hovermode", val: "closest", icon: vr.tooltip_basic, gravity: "ne", click: Bn }; pr.hoverCompareCartesian = { name: "hoverCompareCartesian", _cat: "hoverCompare", title: function(e10) { return or(e10, "Compare data on hover"); }, attr: "hovermode", val: function(e10) { return e10._fullLayout._isHoriz ? "y" : "x"; }, icon: vr.tooltip_compare, gravity: "ne", click: Bn }; function Bn(e10, t) { var r = t.currentTarget, n = r.getAttribute("data-attr"), a = r.getAttribute("data-val") || true, i = e10._fullLayout, o = {}, l = FD.list(e10, null, true), s = i._cartesianSpikesEnabled, u, f; if (n === "zoom") { var d = a === "in" ? 0.5 : 2, h = (1 + d) / 2, p = (1 - d) / 2, v; for (f = 0; f < l.length; f++) if (u = l[f], !u.fixedrange) if (v = u._name, a === "auto") o[v + ".autorange"] = true; else if (a === "reset") u._rangeInitial0 === void 0 && u._rangeInitial1 === void 0 ? o[v + ".autorange"] = true : u._rangeInitial0 === void 0 ? (o[v + ".autorange"] = u._autorangeInitial, o[v + ".range"] = [null, u._rangeInitial1]) : u._rangeInitial1 === void 0 ? (o[v + ".range"] = [u._rangeInitial0, null], o[v + ".autorange"] = u._autorangeInitial) : o[v + ".range"] = [u._rangeInitial0, u._rangeInitial1], u._showSpikeInitial !== void 0 && (o[v + ".showspikes"] = u._showSpikeInitial, s === "on" && !u._showSpikeInitial && (s = "off")); else { var m = [ u.r2l(u.range[0]), u.r2l(u.range[1]) ], g = [ h * m[0] + p * m[1], h * m[1] + p * m[0] ]; o[v + ".range[0]"] = u.l2r(g[0]), o[v + ".range[1]"] = u.l2r(g[1]); } } else n === "hovermode" && (a === "x" || a === "y") && (a = i._isHoriz ? "y" : "x", r.setAttribute("data-val", a)), o[n] = a; i._cartesianSpikesEnabled = s, Xa.call("_guiRelayout", e10, o); } pr.zoom3d = { name: "zoom3d", _cat: "zoom", title: function(e10) { return or(e10, "Zoom"); }, attr: "scene.dragmode", val: "zoom", icon: vr.zoombox, click: Bp }; pr.pan3d = { name: "pan3d", _cat: "pan", title: function(e10) { return or(e10, "Pan"); }, attr: "scene.dragmode", val: "pan", icon: vr.pan, click: Bp }; pr.orbitRotation = { name: "orbitRotation", title: function(e10) { return or(e10, "Orbital rotation"); }, attr: "scene.dragmode", val: "orbit", icon: vr["3d_rotate"], click: Bp }; pr.tableRotation = { name: "tableRotation", title: function(e10) { return or(e10, "Turntable rotation"); }, attr: "scene.dragmode", val: "turntable", icon: vr["z-axis"], click: Bp }; function Bp(e10, t) { for (var r = t.currentTarget, n = r.getAttribute("data-attr"), a = r.getAttribute("data-val") || true, i = e10._fullLayout._subplots.gl3d || [], o = {}, l = n.split("."), s = 0; s < i.length; s++) o[i[s] + "." + l[1]] = a; var u = a === "pan" ? a : "zoom"; o.dragmode = u, Xa.call("_guiRelayout", e10, o); } pr.resetCameraDefault3d = { name: "resetCameraDefault3d", _cat: "resetCameraDefault", title: function(e10) { return or(e10, "Reset camera to default"); }, attr: "resetDefault", icon: vr.home, click: jb }; pr.resetCameraLastSave3d = { name: "resetCameraLastSave3d", _cat: "resetCameraLastSave", title: function(e10) { return or(e10, "Reset camera to last save"); }, attr: "resetLastSave", icon: vr.movie, click: jb }; function jb(e10, t) { for (var r = t.currentTarget, n = r.getAttribute("data-attr"), a = n === "resetLastSave", i = n === "resetDefault", o = e10._fullLayout, l = o._subplots.gl3d || [], s = {}, u = 0; u < l.length; u++) { var f = l[u], d = f + ".camera", h = f + ".aspectratio", p = f + ".aspectmode", v = o[f]._scene, m; a ? (s[d + ".up"] = v.viewInitial.up, s[d + ".eye"] = v.viewInitial.eye, s[d + ".center"] = v.viewInitial.center, m = true) : i && (s[d + ".up"] = null, s[d + ".eye"] = null, s[d + ".center"] = null, m = true), m && (s[h + ".x"] = v.viewInitial.aspectratio.x, s[h + ".y"] = v.viewInitial.aspectratio.y, s[h + ".z"] = v.viewInitial.aspectratio.z, s[p] = v.viewInitial.aspectmode); } Xa.call("_guiRelayout", e10, s); } pr.hoverClosest3d = { name: "hoverClosest3d", _cat: "hoverclosest", title: function(e10) { return or(e10, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: true, icon: vr.tooltip_basic, gravity: "ne", click: cJ }; function RD(e10, t) { var r = t.currentTarget, n = r._previousVal, a = e10._fullLayout, i = a._subplots.gl3d || [], o = ["xaxis", "yaxis", "zaxis"], l = {}, s = {}; if (n) s = n, r._previousVal = null; else { for (var u = 0; u < i.length; u++) { var f = i[u], d = a[f], h = f + ".hovermode"; l[h] = d.hovermode, s[h] = false; for (var p = 0; p < 3; p++) { var v = o[p], m = f + "." + v + ".showspikes"; s[m] = false, l[m] = d[v].showspikes; } } r._previousVal = l; } return s; } function cJ(e10, t) { var r = RD(e10, t); Xa.call("_guiRelayout", e10, r); } pr.zoomInGeo = { name: "zoomInGeo", _cat: "zoomin", title: function(e10) { return or(e10, "Zoom in"); }, attr: "zoom", val: "in", icon: vr.zoom_plus, click: Ub }; pr.zoomOutGeo = { name: "zoomOutGeo", _cat: "zoomout", title: function(e10) { return or(e10, "Zoom out"); }, attr: "zoom", val: "out", icon: vr.zoom_minus, click: Ub }; pr.resetGeo = { name: "resetGeo", _cat: "reset", title: function(e10) { return or(e10, "Reset"); }, attr: "reset", val: null, icon: vr.autoscale, click: Ub }; pr.hoverClosestGeo = { name: "hoverClosestGeo", _cat: "hoverclosest", title: function(e10) { return or(e10, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: true, icon: vr.tooltip_basic, gravity: "ne", click: Gb }; function Ub(e10, t) { for (var r = t.currentTarget, n = r.getAttribute("data-attr"), a = r.getAttribute("data-val") || true, i = e10._fullLayout, o = i._subplots.geo || [], l = 0; l < o.length; l++) { var s = o[l], u = i[s]; if (n === "zoom") { var f = u.projection.scale, d = a === "in" ? 2 * f : 0.5 * f; Xa.call("_guiRelayout", e10, s + ".projection.scale", d); } } n === "reset" && Tv(e10, "geo"); } pr.hoverClosestGl2d = { name: "hoverClosestGl2d", _cat: "hoverclosest", title: function(e10) { return or(e10, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: true, icon: vr.tooltip_basic, gravity: "ne", click: Gb }; pr.hoverClosestPie = { name: "hoverClosestPie", _cat: "hoverclosest", title: function(e10) { return or(e10, "Toggle show closest data on hover"); }, attr: "hovermode", val: "closest", icon: vr.tooltip_basic, gravity: "ne", click: Gb }; function PD(e10) { var t = e10._fullLayout; return t.hovermode ? false : t._has("cartesian") ? t._isHoriz ? "y" : "x" : "closest"; } function Gb(e10) { var t = PD(e10); Xa.call("_guiRelayout", e10, "hovermode", t); } pr.resetViewSankey = { name: "resetSankeyGroup", title: function(e10) { return or(e10, "Reset view"); }, icon: vr.home, click: function(e10) { for (var t = { "node.groups": [], "node.x": [], "node.y": [] }, r = 0; r < e10._fullData.length; r++) { var n = e10._fullData[r]._viewInitial; t["node.groups"].push(n.node.groups.slice()), t["node.x"].push(n.node.x.slice()), t["node.y"].push(n.node.y.slice()); } Xa.call("restyle", e10, t); } }; pr.toggleHover = { name: "toggleHover", title: function(e10) { return or(e10, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: true, icon: vr.tooltip_basic, gravity: "ne", click: function(e10, t) { var r = RD(e10, t); r.hovermode = PD(e10), Xa.call("_guiRelayout", e10, r); } }; pr.resetViews = { name: "resetViews", title: function(e10) { return or(e10, "Reset views"); }, icon: vr.home, click: function(e10, t) { var r = t.currentTarget; r.setAttribute("data-attr", "zoom"), r.setAttribute("data-val", "reset"), Bn(e10, t), r.setAttribute("data-attr", "resetLastSave"), jb(e10, t), Tv(e10, "geo"), Tv(e10, "mapbox"); } }; pr.toggleSpikelines = { name: "toggleSpikelines", title: function(e10) { return or(e10, "Toggle Spike Lines"); }, icon: vr.spikeline, attr: "_cartesianSpikesEnabled", val: "on", click: function(e10) { var t = e10._fullLayout, r = t._cartesianSpikesEnabled; t._cartesianSpikesEnabled = r === "on" ? "off" : "on", Xa.call("_guiRelayout", e10, dJ(e10)); } }; function dJ(e10) { for (var t = e10._fullLayout, r = t._cartesianSpikesEnabled === "on", n = FD.list(e10, null, true), a = {}, i = 0; i < n.length; i++) { var o = n[i]; a[o._name + ".showspikes"] = r ? true : o._showSpikeInitial; } return a; } pr.resetViewMapbox = { name: "resetViewMapbox", _cat: "resetView", title: function(e10) { return or(e10, "Reset view"); }, attr: "reset", icon: vr.home, click: function(e10) { Tv(e10, "mapbox"); } }; pr.zoomInMapbox = { name: "zoomInMapbox", _cat: "zoomin", title: function(e10) { return or(e10, "Zoom in"); }, attr: "zoom", val: "in", icon: vr.zoom_plus, click: $D }; pr.zoomOutMapbox = { name: "zoomOutMapbox", _cat: "zoomout", title: function(e10) { return or(e10, "Zoom out"); }, attr: "zoom", val: "out", icon: vr.zoom_minus, click: $D }; function $D(e10, t) { for (var r = t.currentTarget, n = r.getAttribute("data-val"), a = e10._fullLayout, i = a._subplots.mapbox || [], o = 1.05, l = {}, s = 0; s < i.length; s++) { var u = i[s], f = a[u].zoom, d = n === "in" ? o * f : f / o; l[u + ".zoom"] = d; } Xa.call("_guiRelayout", e10, l); } function Tv(e10, t) { for (var r = e10._fullLayout, n = r._subplots[t] || [], a = {}, i = 0; i < n.length; i++) for (var o = n[i], l = r[o]._subplot, s = l.viewInitial, u = Object.keys(s), f = 0; f < u.length; f++) { var d = u[f]; a[o + "." + d] = s[d]; } Xa.call("_guiRelayout", e10, a); } var zD = mD.exports; var ID = zD; var hJ = Object.keys(ID); var ND = [ "drawline", "drawopenpath", "drawclosedpath", "drawcircle", "drawrect", "eraseshape" ]; var OD = [ "v1hovermode", "hoverclosest", "hovercompare", "togglehover", "togglespikelines" ].concat(ND); var hu = []; var vJ = function(e10) { if (OD.indexOf(e10._cat || e10.name) === -1) { var t = e10.name, r = (e10._cat || e10.name).toLowerCase(); hu.indexOf(t) === -1 && hu.push(t), hu.indexOf(r) === -1 && hu.push(r); } }; hJ.forEach(function(e10) { vJ(ID[e10]); }); hu.sort(); var HD = { DRAW_MODES: ND, backButtons: OD, foreButtons: hu }; var Uk = HD; var BD = { editType: "modebar", orientation: { valType: "enumerated", values: ["v", "h"], dflt: "h", editType: "modebar", description: "Sets the orientation of the modebar." }, bgcolor: { valType: "color", editType: "modebar", description: "Sets the background color of the modebar." }, color: { valType: "color", editType: "modebar", description: "Sets the color of the icons in the modebar." }, activecolor: { valType: "color", editType: "modebar", description: "Sets the color of the active or hovered on icons in the modebar." }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes related to the modebar,", "including `hovermode`, `dragmode`, and `showspikes` at both the", "root level and inside subplots. Defaults to `layout.uirevision`." ].join(" ") }, add: { valType: "string", arrayOk: true, dflt: "", editType: "modebar", description: [ "Determines which predefined modebar buttons to add.", "Please note that these buttons will only be shown if they are", "compatible with all trace types used in a graph.", "Similar to `config.modeBarButtonsToAdd` option.", "This may include *" + Uk.backButtons.join("*, *") + "*." ].join(" ") }, remove: { valType: "string", arrayOk: true, dflt: "", editType: "modebar", description: [ "Determines which predefined modebar buttons to remove.", "Similar to `config.modeBarButtonsToRemove` option.", "This may include *" + Uk.foreButtons.join("*, *") + "*." ].join(" ") } }; var pJ = Ue; var Df = nr; var mJ = Mr; var gJ = BD; var yJ = function(t, r) { var n = t.modebar || {}, a = mJ.newContainer(r, "modebar"); function i(l, s) { return pJ.coerce(n, a, gJ, l, s); } i("orientation"), i("bgcolor", Df.addOpacity(r.paper_bgcolor, 0.5)); var o = Df.contrast(Df.rgb(r.modebar.bgcolor)); i("color", Df.addOpacity(o, 0.3)), i("activecolor", Df.addOpacity(o, 0.7)), i("uirevision", r.uirevision), i("add"), i("remove"); }; var Vb = lr; var bJ = sr; var vo = Ue; var jD = Fb; var _J = ap.version; var xJ = new DOMParser(); function UD(e10) { this.container = e10.container, this.element = document.createElement("div"), this.update(e10.graphInfo, e10.buttons), this.container.appendChild(this.element); } var eo = UD.prototype; eo.update = function(e10, t) { this.graphInfo = e10; var r = this.graphInfo._context, n = this.graphInfo._fullLayout, a = "modebar-" + n._uid; this.element.setAttribute("id", a), this._uid = a, this.element.className = "modebar", r.displayModeBar === "hover" && (this.element.className += " modebar--hover ease-bg"), n.modebar.orientation === "v" && (this.element.className += " vertical", t = t.reverse()); var i = n.modebar, o = r.displayModeBar === "hover" ? ".js-plotly-plot .plotly:hover " : ""; vo.deleteRelatedStyleRule(a), vo.addRelatedStyleRule(a, o + "#" + a + " .modebar-group", "background-color: " + i.bgcolor), vo.addRelatedStyleRule(a, "#" + a + " .modebar-btn .icon path", "fill: " + i.color), vo.addRelatedStyleRule(a, "#" + a + " .modebar-btn:hover .icon path", "fill: " + i.activecolor), vo.addRelatedStyleRule(a, "#" + a + " .modebar-btn.active .icon path", "fill: " + i.activecolor); var l = !this.hasButtons(t), s = this.hasLogo !== r.displaylogo, u = this.locale !== r.locale; if (this.locale = r.locale, (l || s || u) && (this.removeAllButtons(), this.updateButtons(t), r.watermark || r.displaylogo)) { var f = this.getLogo(); r.watermark && (f.className = f.className + " watermark"), n.modebar.orientation === "v" ? this.element.insertBefore(f, this.element.childNodes[0]) : this.element.appendChild(f), this.hasLogo = true; } this.updateActiveButton(); }; eo.updateButtons = function(e10) { var t = this; this.buttons = e10, this.buttonElements = [], this.buttonsNames = [], this.buttons.forEach(function(r) { var n = t.createGroup(); r.forEach(function(a) { var i = a.name; if (!i) throw new Error("must provide button 'name' in button config"); if (t.buttonsNames.indexOf(i) !== -1) throw new Error("button name '" + i + "' is taken"); t.buttonsNames.push(i); var o = t.createButton(a); t.buttonElements.push(o), n.appendChild(o); }), t.element.appendChild(n); }); }; eo.createGroup = function() { var e10 = document.createElement("div"); return e10.className = "modebar-group", e10; }; eo.createButton = function(e10) { var t = this, r = document.createElement("a"); r.setAttribute("rel", "tooltip"), r.className = "modebar-btn"; var n = e10.title; n === void 0 ? n = e10.name : typeof n == "function" && (n = n(this.graphInfo)), (n || n === 0) && r.setAttribute("data-title", n), e10.attr !== void 0 && r.setAttribute("data-attr", e10.attr); var a = e10.val; a !== void 0 && (typeof a == "function" && (a = a(this.graphInfo)), r.setAttribute("data-val", a)); var i = e10.click; if (typeof i != "function") throw new Error("must provide button 'click' function in button config"); r.addEventListener("click", function(l) { e10.click(t.graphInfo, l), t.updateActiveButton(l.currentTarget); }), r.setAttribute("data-toggle", e10.toggle || false), e10.toggle && Vb.select(r).classed("active", true); var o = e10.icon; return typeof o == "function" ? r.appendChild(o()) : r.appendChild(this.createIcon(o || jD.question)), r.setAttribute("data-gravity", e10.gravity || "n"), r; }; eo.createIcon = function(e10) { var t = bJ(e10.height) ? Number(e10.height) : e10.ascent - e10.descent, r = "http://www.w3.org/2000/svg", n; if (e10.path) { n = document.createElementNS(r, "svg"), n.setAttribute("viewBox", [0, 0, e10.width, t].join(" ")), n.setAttribute("class", "icon"); var a = document.createElementNS(r, "path"); a.setAttribute("d", e10.path), e10.transform ? a.setAttribute("transform", e10.transform) : e10.ascent !== void 0 && a.setAttribute("transform", "matrix(1 0 0 -1 0 " + e10.ascent + ")"), n.appendChild(a); } if (e10.svg) { var i = xJ.parseFromString(e10.svg, "application/xml"); n = i.childNodes[0]; } return n.setAttribute("height", "1em"), n.setAttribute("width", "1em"), n; }; eo.updateActiveButton = function(e10) { var t = this.graphInfo._fullLayout, r = e10 !== void 0 ? e10.getAttribute("data-attr") : null; this.buttonElements.forEach(function(n) { var a = n.getAttribute("data-val") || true, i = n.getAttribute("data-attr"), o = n.getAttribute("data-toggle") === "true", l = Vb.select(n); if (o) i === r && l.classed("active", !l.classed("active")); else { var s = i === null ? i : vo.nestedProperty(t, i).get(); l.classed("active", s === a); } }); }; eo.hasButtons = function(e10) { var t = this.buttons; if (!t || e10.length !== t.length) return false; for (var r = 0; r < e10.length; ++r) { if (e10[r].length !== t[r].length) return false; for (var n = 0; n < e10[r].length; n++) if (e10[r][n].name !== t[r][n].name) return false; } return true; }; function wJ(e10) { return e10 + " (v" + _J + ")"; } eo.getLogo = function() { var e10 = this.createGroup(), t = document.createElement("a"); return t.href = "https://plotly.com/", t.target = "_blank", t.setAttribute("data-title", wJ(vo._(this.graphInfo, "Produced with Plotly.js"))), t.className = "modebar-btn plotlyjsicon modebar-btn--logo", t.appendChild(this.createIcon(jD.newplotlylogo)), e10.appendChild(t), e10; }; eo.removeAllButtons = function() { for (; this.element.firstChild; ) this.element.removeChild(this.element.firstChild); this.hasLogo = false; }; eo.destroy = function() { vo.removeElement(this.container.querySelector(".modebar")), vo.deleteRelatedStyleRule(this._uid); }; function TJ(e10, t) { var r = e10._fullLayout, n = new UD({ graphInfo: e10, container: r._modebardiv.node(), buttons: t }); return r._privateplot && Vb.select(n.element).append("span").classed("badge-private float--left", true).text("PRIVATE"), n; } var kJ = TJ; var AJ = gn; var Gk = Ya; var Iy = Nt; var MJ = Do.isUnifiedHover; var SJ = kJ; var kv = zD; var CJ = HD.DRAW_MODES; var LJ = Ue.extendDeep; var DJ = function(t) { var r = t._fullLayout, n = t._context, a = r._modeBar; if (!n.displayModeBar && !n.watermark) { a && (a.destroy(), delete r._modeBar); return; } if (!Array.isArray(n.modeBarButtonsToRemove)) throw new Error([ "*modeBarButtonsToRemove* configuration options", "must be an array." ].join(" ")); if (!Array.isArray(n.modeBarButtonsToAdd)) throw new Error([ "*modeBarButtonsToAdd* configuration options", "must be an array." ].join(" ")); var i = n.modeBarButtons, o; Array.isArray(i) && i.length ? o = zJ(i) : !n.displayModeBar && n.watermark ? o = [] : o = EJ(t), a ? a.update(t, o) : r._modeBar = SJ(t, o); }; function EJ(e10) { var t = e10._fullLayout, r = e10._fullData, n = e10._context; function a(P, R) { if (typeof R == "string") { if (R.toLowerCase() === P.toLowerCase()) return true; } else { var H = R.name, B = R._cat || R.name; if (H === P || B === P.toLowerCase()) return true; } return false; } var i = t.modebar.add; typeof i == "string" && (i = [i]); var o = t.modebar.remove; typeof o == "string" && (o = [o]); var l = n.modeBarButtonsToAdd.concat( i.filter(function(P) { for (var R = 0; R < n.modeBarButtonsToRemove.length; R++) if (a(P, n.modeBarButtonsToRemove[R])) return false; return true; }) ), s = n.modeBarButtonsToRemove.concat( o.filter(function(P) { for (var R = 0; R < n.modeBarButtonsToAdd.length; R++) if (a(P, n.modeBarButtonsToAdd[R])) return false; return true; }) ), u = t._has("cartesian"), f = t._has("gl3d"), d = t._has("geo"), h = t._has("pie"), p = t._has("funnelarea"), v = t._has("gl2d"), m = t._has("ternary"), g = t._has("mapbox"), y = t._has("polar"), w = t._has("smith"), k = t._has("sankey"), x = FJ(t), _ = MJ(t.hovermode), T = []; function S(P) { if (P.length) { for (var R = [], H = 0; H < P.length; H++) { for (var B = P[H], W = kv[B], ee = W.name.toLowerCase(), re = (W._cat || W.name).toLowerCase(), ae = false, Q = 0; Q < s.length; Q++) { var ue = s[Q].toLowerCase(); if (ue === ee || ue === re) { ae = true; break; } } ae || R.push(kv[B]); } T.push(R); } } var M = ["toImage"]; n.showEditInChartStudio ? M.push("editInChartStudio") : n.showSendToCloud && M.push("sendDataToCloud"), S(M); var L = [], F = [], $ = [], I = []; (u || v || h || p || m) + d + f + g + y + w > 1 ? (F = ["toggleHover"], $ = ["resetViews"]) : d ? (L = ["zoomInGeo", "zoomOutGeo"], F = ["hoverClosestGeo"], $ = ["resetGeo"]) : f ? (F = ["hoverClosest3d"], $ = ["resetCameraDefault3d", "resetCameraLastSave3d"]) : g ? (L = ["zoomInMapbox", "zoomOutMapbox"], F = ["toggleHover"], $ = ["resetViewMapbox"]) : v ? F = ["hoverClosestGl2d"] : h ? F = ["hoverClosestPie"] : k ? (F = ["hoverClosestCartesian", "hoverCompareCartesian"], $ = ["resetViewSankey"]) : F = ["toggleHover"], u && (F = ["toggleSpikelines", "hoverClosestCartesian", "hoverCompareCartesian"]), (PJ(r) || _) && (F = []), (u || v) && !x && (L = ["zoomIn2d", "zoomOut2d", "autoScale2d"], $[0] !== "resetViews" && ($ = ["resetScale2d"])), f ? I = ["zoom3d", "pan3d", "orbitRotation", "tableRotation"] : (u || v) && !x || m ? I = ["zoom2d", "pan2d"] : g || d ? I = ["pan2d"] : y && (I = ["zoom2d"]), RJ(r) && I.push("select2d", "lasso2d"); var O = [], G = function(P) { O.indexOf(P) === -1 && F.indexOf(P) !== -1 && O.push(P); }; if (Array.isArray(l)) { for (var K = [], V = 0; V < l.length; V++) { var z = l[V]; typeof z == "string" ? (z = z.toLowerCase(), CJ.indexOf(z) !== -1 ? (t._has("mapbox") || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch) t._has("cartesian")) && I.push(z) : z === "togglespikelines" ? G("toggleSpikelines") : z === "togglehover" ? G("toggleHover") : z === "hovercompare" ? G("hoverCompareCartesian") : z === "hoverclosest" ? (G("hoverClosestCartesian"), G("hoverClosestGeo"), G("hoverClosest3d"), G("hoverClosestGl2d"), G("hoverClosestPie")) : z === "v1hovermode" && (G("toggleHover"), G("hoverClosestCartesian"), G("hoverCompareCartesian"), G("hoverClosestGeo"), G("hoverClosest3d"), G("hoverClosestGl2d"), G("hoverClosestPie"))) : K.push(z); } l = K; } return S(I), S(L.concat($)), S(O), $J(T, l); } function FJ(e10) { for (var t = AJ.list({ _fullLayout: e10 }, null, true), r = 0; r < t.length; r++) if (!t[r].fixedrange) return false; return true; } function RJ(e10) { for (var t = false, r = 0; r < e10.length && !t; r++) { var n = e10[r]; !n._module || !n._module.selectPoints || (Iy.traceIs(n, "scatter-like") ? (Gk.hasMarkers(n) || Gk.hasText(n)) && (t = true) : Iy.traceIs(n, "box-violin") ? (n.boxpoints === "all" || n.points === "all") && (t = true) : t = true); } return t; } function PJ(e10) { for (var t = 0; t < e10.length; t++) if (!Iy.traceIs(e10[t], "noHover")) return false; return true; } function $J(e10, t) { if (t.length) if (Array.isArray(t[0])) for (var r = 0; r < t.length; r++) e10.push(t[r]); else e10.push(t); return e10; } function zJ(e10) { for (var t = LJ([], e10), r = 0; r < t.length; r++) for (var n = t[r], a = 0; a < n.length; a++) { var i = n[a]; if (typeof i == "string") if (kv[i] !== void 0) t[r][a] = kv[i]; else throw new Error([ "*modeBarButtons* configuration options", "invalid button name" ].join(" ")); } return t; } var GD = { moduleType: "component", name: "modebar", layoutAttributes: BD, supplyLayoutDefaults: yJ, manage: DJ }; var wl = {}; var IJ = On.FROM_BL; var VD = function(t, r, n) { n === void 0 && (n = IJ[t.constraintoward || "center"]); var a = [t.r2l(t.range[0]), t.r2l(t.range[1])], i = a[0] + (a[1] - a[0]) * n; t.range = t._input.range = [ t.l2r(i + (a[0] - i) * r), t.l2r(i + (a[1] - i) * r) ], t.setScale(); }; var zl = Ue; var Eg = Lp; var li = gn.id2name; var NJ = Ki; var Vk = VD; var OJ = yb; var HJ = Qr.ALMOST_EQUAL; var BJ = On.FROM_BL; wl.handleDefaults = function(e10, t, r) { var n = r.axIds, a = r.axHasImage, i = t._axisConstraintGroups = [], o = t._axisMatchGroups = [], l, s, u, f, d, h, p, v; for (l = 0; l < n.length; l++) f = li(n[l]), d = e10[f], h = t[f], jJ(d, h, { axIds: n, layoutOut: t, hasImage: a[f] }); function m(M, L) { for (l = 0; l < M.length; l++) { s = M[l]; for (u in s) t[li(u)][L] = s; } } for (m(o, "_matchGroup"), l = 0; l < i.length; l++) { s = i[l]; for (u in s) if (h = t[li(u)], h.fixedrange) { for (var g in s) { var y = li(g); (e10[y] || {}).fixedrange === false && zl.warn( "fixedrange was specified as false for axis " + y + " but was overridden because another axis in its constraint group has fixedrange true" ), t[y].fixedrange = true; } break; } } for (l = 0; l < i.length; ) { s = i[l]; for (u in s) { h = t[li(u)], h._matchGroup && Object.keys(h._matchGroup).length === Object.keys(s).length && (i.splice(l, 1), l--); break; } l++; } m(i, "_constraintGroup"); var w = [ "constrain", "range", "autorange", "rangemode", "rangebreaks", "categoryorder", "categoryarray" ], k = false, x = false; function _() { v = h[p], p === "rangebreaks" && (x = h._hasDayOfWeekBreaks); } for (l = 0; l < o.length; l++) { s = o[l]; for (var T = 0; T < w.length; T++) { p = w[T], v = null; var S; for (u in s) if (f = li(u), d = e10[f], h = t[f], p in h) { if (!h.matches && (S = h, p in d)) { _(); break; } v === null && p in d && _(); } if (p === "range" && v && d.range && d.range.length === 2 && d.range[0] !== null && d.range[1] !== null && (k = true), p === "autorange" && v === null && k && (v = false), v === null && p in S && (v = S[p]), v !== null) for (u in s) h = t[li(u)], h[p] = p === "range" ? v.slice() : v, p === "rangebreaks" && (h._hasDayOfWeekBreaks = x, OJ(h, t)); } } }; function jJ(e10, t, r) { var n = r.axIds, a = r.layoutOut, i = r.hasImage, o = a._axisConstraintGroups, l = a._axisMatchGroups, s = t._id, u = s.charAt(0), f = ((a._splomAxes || {})[u] || {})[s] || {}, d = t._id, h = d.charAt(0) === "x"; t._matchGroup = null, t._constraintGroup = null; function p(I, O) { return zl.coerce(e10, t, NJ, I, O); } p("constrain", i ? "domain" : "range"), zl.coerce(e10, t, { constraintoward: { valType: "enumerated", values: h ? ["left", "center", "right"] : ["bottom", "middle", "top"], dflt: h ? "center" : "middle" } }, "constraintoward"); var v = t.type, m, g, y = []; for (m = 0; m < n.length; m++) if (g = n[m], g !== d) { var w = a[li(g)]; w.type === v && y.push(g); } var k = qD(o, d); if (k) { var x = []; for (m = 0; m < y.length; m++) g = y[m], k[g] || x.push(g); y = x; } var _ = y.length, T, S; _ && (e10.matches || f.matches) && (T = zl.coerce(e10, t, { matches: { valType: "enumerated", values: y, dflt: y.indexOf(f.matches) !== -1 ? f.matches : void 0 } }, "matches")); var M = i && !h ? t.anchor : void 0; if (_ && !T && (e10.scaleanchor || M) && (S = zl.coerce(e10, t, { scaleanchor: { valType: "enumerated", values: y.concat([false]) } }, "scaleanchor", M)), T) { t._matchGroup = Fg(l, d, T, 1); var L = a[li(T)], F = qk(a, t) / qk(a, L); h !== (T.charAt(0) === "x") && (F = (h ? "x" : "y") + F), Fg(o, d, T, F); } else e10.matches && n.indexOf(e10.matches) !== -1 && zl.warn("ignored " + t._name + '.matches: "' + e10.matches + '" to avoid an infinite loop'); if (S) { var $ = p("scaleratio"); $ || ($ = t.scaleratio = 1), Fg(o, d, S, $); } else e10.scaleanchor && n.indexOf(e10.scaleanchor) !== -1 && zl.warn("ignored " + t._name + '.scaleanchor: "' + e10.scaleanchor + '" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.'); } function qk(e10, t) { var r = t.domain; return r || (r = e10[li(t.overlaying)].domain), r[1] - r[0]; } function qD(e10, t) { for (var r = 0; r < e10.length; r++) if (e10[r][t]) return e10[r]; return null; } function Fg(e10, t, r, n) { var a, i, o, l, s, u = qD(e10, t); u === null ? (u = {}, u[t] = 1, s = e10.length, e10.push(u)) : s = e10.indexOf(u); var f = Object.keys(u); for (a = 0; a < e10.length; a++) if (o = e10[a], a !== s && o[r]) { var d = o[r]; for (i = 0; i < f.length; i++) l = f[i], o[l] = Rg(d, Rg(n, u[l])); e10.splice(s, 1); return; } if (n !== 1) for (i = 0; i < f.length; i++) { var h = f[i]; u[h] = Rg(n, u[h]); } u[r] = 1; } function Rg(e10, t) { var r = "", n = "", a, i; typeof e10 == "string" && (r = e10.match(/^[xy]*/)[0], a = r.length, e10 = +e10.substr(a)), typeof t == "string" && (n = t.match(/^[xy]*/)[0], i = n.length, t = +t.substr(i)); var o = e10 * t; return !a && !i ? o : !a || !i || r.charAt(0) === n.charAt(0) ? r + n + e10 * t : a === i ? o : (a > i ? r.substr(i) : n.substr(a)) + o; } function UJ(e10, t) { for (var r = t._size, n = r.h / r.w, a = {}, i = Object.keys(e10), o = 0; o < i.length; o++) { var l = i[o], s = e10[l]; if (typeof s == "string") { var u = s.match(/^[xy]*/)[0], f = u.length; s = +s.substr(f); for (var d = u.charAt(0) === "y" ? n : 1 / n, h = 0; h < f; h++) s *= d; } a[l] = s; } return a; } wl.enforce = function(t) { var r = t._fullLayout, n = r._axisConstraintGroups || [], a, i, o, l, s, u, f, d; for (a = 0; a < n.length; a++) { o = UJ(n[a], r); var h = Object.keys(o), p = 1 / 0, v = 0, m = 1 / 0, g = {}, y = {}, w = false; for (i = 0; i < h.length; i++) l = h[i], y[l] = s = r[li(l)], s._inputDomain ? s.domain = s._inputDomain.slice() : s._inputDomain = s.domain.slice(), s._inputRange || (s._inputRange = s.range.slice()), s.setScale(), g[l] = u = Math.abs(s._m) / o[l], p = Math.min(p, u), (s.constrain === "domain" || !s._constraintShrinkable) && (m = Math.min(m, u)), delete s._constraintShrinkable, v = Math.max(v, u), s.constrain === "domain" && (w = true); if (!(p > HJ * v && !w)) { for (i = 0; i < h.length; i++) if (l = h[i], u = g[l], s = y[l], f = s.constrain, u !== m || f === "domain") if (d = u / m, f === "range") Vk(s, d); else { var k = s._inputDomain, x = (s.domain[1] - s.domain[0]) / (k[1] - k[0]), _ = (s.r2l(s.range[1]) - s.r2l(s.range[0])) / (s.r2l(s._inputRange[1]) - s.r2l(s._inputRange[0])); if (d /= x, d * _ < 1) { s.domain = s._input.domain = k.slice(), Vk(s, d); continue; } if (_ < 1 && (s.range = s._input.range = s._inputRange.slice(), d *= _), s.autorange) { var T = s.r2l(s.range[0]), S = s.r2l(s.range[1]), M = (T + S) / 2, L = M, F = M, $ = Math.abs(S - M), I = M - $ * d * 1.0001, O = M + $ * d * 1.0001, G = Eg.makePadFn(r, s, 0), K = Eg.makePadFn(r, s, 1); Wk(s, d); var V = Math.abs(s._m), z = Eg.concatExtremes(t, s), P = z.min, R = z.max, H, B; for (B = 0; B < P.length; B++) H = P[B].val - G(P[B]) / V, H > I && H < L && (L = H); for (B = 0; B < R.length; B++) H = R[B].val + K(R[B]) / V, H < O && H > F && (F = H); var W = (F - L) / (2 * $); d /= W, L = s.l2r(L), F = s.l2r(F), s.range = s._input.range = T < S ? [L, F] : [F, L]; } Wk(s, d); } } } }; wl.getAxisGroup = function(t, r) { for (var n = t._axisMatchGroups, a = 0; a < n.length; a++) { var i = n[a]; if (i[r]) return "g" + a; } return r; }; wl.clean = function(t, r) { if (r._inputDomain) { for (var n = false, a = r._id, i = t._fullLayout._axisConstraintGroups, o = 0; o < i.length; o++) if (i[o][a]) { n = true; break; } (!n || r.constrain !== "domain") && (r._input.domain = r.domain = r._inputDomain, delete r._inputDomain); } }; function Wk(e10, t) { var r = e10._inputDomain, n = BJ[e10.constraintoward], a = r[0] + (r[1] - r[0]) * n; e10.domain = e10._input.domain = [ a + (r[0] - a) / t, a + (r[1] - a) / t ], e10.setScale(); } (function(e10) { var t = lr, r = Nt, n = Tn, a = Ue, i = Rn, o = Eb, l = nr, s = Sr, u = Cp, f = GD, d = Cr, h = On, p = wl, v = p.enforce, m = p.clean, g = Lp.doAutoRange, y = "start", w = "middle", k = "end"; e10.layoutStyles = function(P) { return a.syncOrAsync([n.doAutoMargin, _], P); }; function x(P, R, H) { for (var B = 0; B < H.length; B++) { var W = H[B][0], ee = H[B][1]; if (!(W[0] >= P[1] || W[1] <= P[0]) && ee[0] < R[1] && ee[1] > R[0]) return true; } return false; } function _(P) { var R = P._fullLayout, H = R._size, B = H.p, W = d.list(P, "", true), ee, re, ae, Q, ue, j; if (R._paperdiv.style({ width: P._context.responsive && R.autosize && !P._context._hasZeroWidth && !P.layout.width ? "100%" : R.width + "px", height: P._context.responsive && R.autosize && !P._context._hasZeroHeight && !P.layout.height ? "100%" : R.height + "px" }).selectAll(".main-svg").call(s.setSize, R.width, R.height), P._context.setBackground(P, R.paper_bgcolor), e10.drawMainTitle(P), f.manage(P), !R._has("cartesian")) return n.previousPromises(P); function U(st, rt, ct) { var X = st._lw / 2; if (st._id.charAt(0) === "x") { if (rt) { if (ct === "top") return rt._offset - B - X; } else return H.t + H.h * (1 - (st.position || 0)) + X % 1; return rt._offset + rt._length + B + X; } if (rt) { if (ct === "right") return rt._offset + rt._length + B + X; } else return H.l + H.w * (st.position || 0) + X % 1; return rt._offset - B - X; } for (ee = 0; ee < W.length; ee++) { Q = W[ee]; var Z = Q._anchorAxis; Q._linepositions = {}, Q._lw = s.crispRound(P, Q.linewidth, 1), Q._mainLinePosition = U(Q, Z, Q.side), Q._mainMirrorPosition = Q.mirror && Z ? U( Q, Z, h.OPPOSITE_SIDE[Q.side] ) : null; } var le = [], J = [], pe = [], ge = l.opacity(R.paper_bgcolor) === 1 && l.opacity(R.plot_bgcolor) === 1 && R.paper_bgcolor === R.plot_bgcolor; for (re in R._plots) if (ae = R._plots[re], ae.mainplot) ae.bg && ae.bg.remove(), ae.bg = void 0; else { var ve = ae.xaxis.domain, me = ae.yaxis.domain, Le = ae.plotgroup; if (x(ve, me, pe)) { var ze = Le.node(), Fe = ae.bg = a.ensureSingle(Le, "rect", "bg"); ze.insertBefore(Fe.node(), ze.childNodes[0]), J.push(re); } else Le.select("rect.bg").remove(), pe.push([ve, me]), ge || (le.push(re), J.push(re)); } var Oe = R._bgLayer.selectAll(".bg").data(le); for (Oe.enter().append("rect").classed("bg", true), Oe.exit().remove(), Oe.each(function(st) { R._plots[st].bg = t.select(this); }), ee = 0; ee < J.length; ee++) ae = R._plots[J[ee]], ue = ae.xaxis, j = ae.yaxis, ae.bg && ue._offset !== void 0 && j._offset !== void 0 && ae.bg.call( s.setRect, ue._offset - B, j._offset - B, ue._length + 2 * B, j._length + 2 * B ).call(l.fill, R.plot_bgcolor).style("stroke-width", 0); if (!R._hasOnlyLargeSploms) for (re in R._plots) { ae = R._plots[re], ue = ae.xaxis, j = ae.yaxis; var Re = ae.clipId = "clip" + R._uid + re + "plot", We = a.ensureSingleById(R._clips, "clipPath", Re, function(st) { st.classed("plotclip", true).append("rect"); }); ae.clipRect = We.select("rect").attr({ width: ue._length, height: j._length }), s.setTranslate(ae.plot, ue._offset, j._offset); var Me, Ve; ae._hasClipOnAxisFalse ? (Me = null, Ve = Re) : (Me = Re, Ve = null), s.setClipUrl(ae.plot, Me, P), ae.layerClipId = Ve; } var qe, Qe, ot, ht, vt, nt, ft, Pe, Ie, Ne, tt, Je, it; function at(st) { return "M" + qe + "," + st + "H" + Qe; } function Tt(st) { return "M" + ue._offset + "," + st + "h" + ue._length; } function gt(st) { return "M" + st + "," + Pe + "V" + ft; } function He(st) { return j._shift !== void 0 && (st += j._shift), "M" + st + "," + j._offset + "v" + j._length; } function pt(st, rt, ct) { if (!st.showline || re !== st._mainSubplot) return ""; if (!st._anchorAxis) return ct(st._mainLinePosition); var X = rt(st._mainLinePosition); return st.mirror && (X += rt(st._mainMirrorPosition)), X; } for (re in R._plots) { ae = R._plots[re], ue = ae.xaxis, j = ae.yaxis; var bt = "M0,0"; T(ue, re) && (vt = M(ue, "left", j, W), qe = ue._offset - (vt ? B + vt : 0), nt = M(ue, "right", j, W), Qe = ue._offset + ue._length + (nt ? B + nt : 0), ot = U(ue, j, "bottom"), ht = U(ue, j, "top"), it = !ue._anchorAxis || re !== ue._mainSubplot, it && (ue.mirror === "allticks" || ue.mirror === "all") && (ue._linepositions[re] = [ot, ht]), bt = pt(ue, at, Tt), it && ue.showline && (ue.mirror === "all" || ue.mirror === "allticks") && (bt += at(ot) + at(ht)), ae.xlines.style("stroke-width", ue._lw + "px").call(l.stroke, ue.showline ? ue.linecolor : "rgba(0,0,0,0)")), ae.xlines.attr("d", bt); var Ke = "M0,0"; T(j, re) && (tt = M(j, "bottom", ue, W), ft = j._offset + j._length + (tt ? B : 0), Je = M(j, "top", ue, W), Pe = j._offset - (Je ? B : 0), Ie = U(j, ue, "left"), Ne = U(j, ue, "right"), it = !j._anchorAxis || re !== j._mainSubplot, it && (j.mirror === "allticks" || j.mirror === "all") && (j._linepositions[re] = [Ie, Ne]), Ke = pt(j, gt, He), it && j.showline && (j.mirror === "all" || j.mirror === "allticks") && (Ke += gt(Ie) + gt(Ne)), ae.ylines.style("stroke-width", j._lw + "px").call(l.stroke, j.showline ? j.linecolor : "rgba(0,0,0,0)")), ae.ylines.attr("d", Ke); } return d.makeClipPaths(P), n.previousPromises(P); } function T(P, R) { return (P.ticks || P.showline) && (R === P._mainSubplot || P.mirror === "all" || P.mirror === "allticks"); } function S(P, R, H) { if (!H.showline || !H._lw) return false; if (H.mirror === "all" || H.mirror === "allticks") return true; var B = H._anchorAxis; if (!B) return false; var W = h.FROM_BL[R]; return H.side === R ? B.domain[W] === P.domain[W] : H.mirror && B.domain[1 - W] === P.domain[1 - W]; } function M(P, R, H, B) { if (S(P, R, H)) return H._lw; for (var W = 0; W < B.length; W++) { var ee = B[W]; if (ee._mainAxis === H._mainAxis && S(P, R, ee)) return ee._lw; } return 0; } e10.drawMainTitle = function(P) { var R = P._fullLayout.title, H = P._fullLayout, B = V(H), W = z(H), ee = G(H, W), re = O(H, B); if (u.draw(P, "gtitle", { propContainer: H, propName: "title.text", placeholder: H._dfltTitle.plot, attributes: { x: re, y: ee, "text-anchor": B, dy: W } }), R.text && R.automargin) { var ae = t.selectAll(".gtitle"), Q = s.bBox(ae.node()).height, ue = $(P, R, Q); if (ue > 0) { I(P, ee, ue, Q), ae.attr({ x: re, y: ee, "text-anchor": B, dy: K(R.yanchor) }).call(i.positionText, re, ee); var j = (R.text.match(i.BR_TAG_ALL) || []).length; if (j) { var U = h.LINE_SPACING * j + h.MID_SHIFT; R.y === 0 && (U = -U), ae.selectAll(".line").each(function() { var Z = +this.getAttribute("dy").slice(0, -2) - U + "em"; this.setAttribute("dy", Z); }); } } } }; function L(P, R, H, B, W) { var ee = R.yref === "paper" ? P._fullLayout._size.h : P._fullLayout.height, re = a.isTopAnchor(R) ? B : B - W, ae = H === "b" ? ee - re : re; return a.isTopAnchor(R) && H === "t" || a.isBottomAnchor(R) && H === "b" ? false : ae < W; } function F(P, R, H, B, W) { var ee = 0; return H === "middle" && (ee += W / 2), P === "t" ? (H === "top" && (ee += W), ee += B - R * B) : (H === "bottom" && (ee += W), ee += R * B), ee; } function $(P, R, H) { var B = R.y, W = R.yanchor, ee = B > 0.5 ? "t" : "b", re = P._fullLayout.margin[ee], ae = 0; return R.yref === "paper" ? ae = H + R.pad.t + R.pad.b : R.yref === "container" && (ae = F(ee, B, W, P._fullLayout.height, H) + R.pad.t + R.pad.b), ae > re ? ae : 0; } function I(P, R, H, B) { var W = "title.automargin", ee = P._fullLayout.title, re = ee.y > 0.5 ? "t" : "b", ae = { x: ee.x, y: ee.y, t: 0, b: 0 }, Q = {}; ee.yref === "paper" && L(P, ee, re, R, B) ? ae[re] = H : ee.yref === "container" && (Q[re] = H, P._fullLayout._reservedMargin[W] = Q), n.allowAutoMargin(P, W), n.autoMargin(P, W, ae); } function O(P, R) { var H = P.title, B = P._size, W = 0; switch (R === y ? W = H.pad.l : R === k && (W = -H.pad.r), H.xref) { case "paper": return B.l + B.w * H.x + W; case "container": default: return P.width * H.x + W; } } function G(P, R) { var H = P.title, B = P._size, W = 0; if (R === "0em" || !R ? W = -H.pad.b : R === h.CAP_SHIFT + "em" && (W = H.pad.t), H.y === "auto") return B.t / 2; switch (H.yref) { case "paper": return B.t + B.h - B.h * H.y + W; case "container": default: return P.height - P.height * H.y + W; } } function K(P) { return P === "top" ? h.CAP_SHIFT + 0.3 + "em" : P === "bottom" ? "-0.3em" : h.MID_SHIFT + "em"; } function V(P) { var R = P.title, H = w; return a.isRightAnchor(R) ? H = k : a.isLeftAnchor(R) && (H = y), H; } function z(P) { var R = P.title, H = "0em"; return a.isTopAnchor(R) ? H = h.CAP_SHIFT + "em" : a.isMiddleAnchor(R) && (H = h.MID_SHIFT + "em"), H; } e10.doTraceStyle = function(P) { var R = P.calcdata, H = [], B; for (B = 0; B < R.length; B++) { var W = R[B], ee = W[0] || {}, re = ee.trace || {}, ae = re._module || {}, Q = ae.arraysToCalcdata; Q && Q(W, re); var ue = ae.editStyle; ue && H.push({ fn: ue, cd0: ee }); } if (H.length) { for (B = 0; B < H.length; B++) { var j = H[B]; j.fn(P, j.cd0); } o(P), e10.redrawReglTraces(P); } return n.style(P), r.getComponentMethod("legend", "draw")(P), n.previousPromises(P); }, e10.doColorBars = function(P) { return r.getComponentMethod("colorbar", "draw")(P), n.previousPromises(P); }, e10.layoutReplot = function(P) { var R = P.layout; return P.layout = void 0, r.call("_doPlot", P, "", R); }, e10.doLegend = function(P) { return r.getComponentMethod("legend", "draw")(P), n.previousPromises(P); }, e10.doTicksRelayout = function(P) { return d.draw(P, "redraw"), P._fullLayout._hasOnlyLargeSploms && (r.subplotsRegistry.splom.updateGrid(P), o(P), e10.redrawReglTraces(P)), e10.drawMainTitle(P), n.previousPromises(P); }, e10.doModeBar = function(P) { var R = P._fullLayout; f.manage(P); for (var H = 0; H < R._basePlotModules.length; H++) { var B = R._basePlotModules[H].updateFx; B && B(P); } return n.previousPromises(P); }, e10.doCamera = function(P) { for (var R = P._fullLayout, H = R._subplots.gl3d, B = 0; B < H.length; B++) { var W = R[H[B]], ee = W._scene; ee.setViewport(W); } }, e10.drawData = function(P) { var R = P._fullLayout; o(P); for (var H = R._basePlotModules, B = 0; B < H.length; B++) H[B].plot(P); return e10.redrawReglTraces(P), n.style(P), r.getComponentMethod("selections", "draw")(P), r.getComponentMethod("shapes", "draw")(P), r.getComponentMethod("annotations", "draw")(P), r.getComponentMethod("images", "draw")(P), R._replotting = false, n.previousPromises(P); }, e10.redrawReglTraces = function(P) { var R = P._fullLayout; if (R._has("regl")) { var H = P._fullData, B = [], W = [], ee, re; for (R._hasOnlyLargeSploms && R._splomGrid.draw(), ee = 0; ee < H.length; ee++) { var ae = H[ee]; ae.visible === true && ae._length !== 0 && (ae.type === "splom" ? R._splomScenes[ae.uid].draw() : ae.type === "scattergl" ? a.pushUnique(B, ae.xaxis + ae.yaxis) : ae.type === "scatterpolargl" && a.pushUnique(W, ae.subplot)); } for (ee = 0; ee < B.length; ee++) re = R._plots[B[ee]], re._scene && re._scene.draw(); for (ee = 0; ee < W.length; ee++) re = R[W[ee]]._subplot, re._scene && re._scene.draw(); } }, e10.doAutoRangeAndConstraints = function(P) { for (var R = d.list(P, "", true), H, B = {}, W = 0; W < R.length; W++) if (H = R[W], !B[H._id]) { B[H._id] = 1, m(P, H), g(P, H); var ee = H._matchGroup; if (ee) for (var re in ee) { var ae = d.getFromId(P, re); g(P, ae, H.range), B[re] = 1; } } v(P); }, e10.finalDraw = function(P) { r.getComponentMethod("rangeslider", "draw")(P), r.getComponentMethod("rangeselector", "draw")(P); }, e10.drawMarginPushers = function(P) { r.getComponentMethod("legend", "draw")(P), r.getComponentMethod("rangeselector", "draw")(P), r.getComponentMethod("sliders", "draw")(P), r.getComponentMethod("updatemenus", "draw")(P), r.getComponentMethod("colorbar", "draw")(P); }; })(zp); var GJ = _l.readPaths; var VJ = Nb; var WD = _s.clearOutlineControllers; var Pg = nr; var ZD = Sr; var qJ = Mr.arrayEditor; var YD = xl; var WJ = YD.getPathString; var XD = { draw: jp, drawOne: KD, activateLastSelection: XJ }; function jp(e10) { var t = e10._fullLayout; WD(e10), t._selectionLayer.selectAll("path").remove(); for (var r in t._plots) { var n = t._plots[r].selectionLayer; n && n.selectAll("path").remove(); } for (var a = 0; a < t.selections.length; a++) KD(e10, a); } function Up(e10) { return e10._context.editSelection; } function KD(e10, t) { e10._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="' + t + '"]').remove(); var r = YD.makeSelectionsOptionsAndPlotinfo(e10, t), n = r.options, a = r.plotinfo; if (!n._input) return; i(e10._fullLayout._selectionLayer); function i(o) { var l = WJ(e10, n), s = { "data-index": t, "fill-rule": "evenodd", d: l }, u = n.opacity, f = "rgba(0,0,0,0)", d = n.line.color || Pg.contrast(e10._fullLayout.plot_bgcolor), h = n.line.width, p = n.line.dash; h || (h = 5, p = "solid"); var v = Up(e10) && e10._fullLayout._activeSelectionIndex === t; v && (f = e10._fullLayout.activeselection.fillcolor, u = e10._fullLayout.activeselection.opacity); for (var m = [], g = 1; g >= 0; g--) { var y = o.append("path").attr(s).style("opacity", g ? 0.1 : u).call(Pg.stroke, d).call(Pg.fill, f).call( ZD.dashLine, g ? "solid" : p, g ? 4 + h : h ); if (ZJ(y, e10, n), v) { var w = qJ(e10.layout, "selections", n); y.style({ cursor: "move" }); var k = { element: y.node(), plotinfo: a, gd: e10, editHelpers: w, isActiveSelection: true // i.e. to enable controllers }, x = GJ(l, e10); VJ(x, y, k); } else y.style("pointer-events", g ? "all" : "none"); m[g] = y; } var _ = m[0], T = m[1]; T.node().addEventListener("click", function() { return YJ(e10, _); }); } } function ZJ(e10, t, r) { var n = r.xref + r.yref; ZD.setClipUrl( e10, "clip" + t._fullLayout._uid + n, t ); } function YJ(e10, t) { if (Up(e10)) { var r = t.node(), n = +r.getAttribute("data-index"); if (n >= 0) { if (n === e10._fullLayout._activeSelectionIndex) { Ny(e10); return; } e10._fullLayout._activeSelectionIndex = n, e10._fullLayout._deactivateSelection = Ny, jp(e10); } } } function XJ(e10) { if (Up(e10)) { var t = e10._fullLayout.selections.length - 1; e10._fullLayout._activeSelectionIndex = t, e10._fullLayout._deactivateSelection = Ny, jp(e10); } } function Ny(e10) { if (Up(e10)) { var t = e10._fullLayout._activeSelectionIndex; t >= 0 && (WD(e10), delete e10._fullLayout._activeSelectionIndex, jp(e10)); } } function KJ() { var e10, t = 0, r = false; function n(a, i) { return e10.list.push({ type: a, data: i ? JSON.parse(JSON.stringify(i)) : void 0 }), e10; } return e10 = { list: [], segmentId: function() { return t++; }, checkIntersection: function(a, i) { return n("check", { seg1: a, seg2: i }); }, segmentChop: function(a, i) { return n("div_seg", { seg: a, pt: i }), n("chop", { seg: a, pt: i }); }, statusRemove: function(a) { return n("pop_seg", { seg: a }); }, segmentUpdate: function(a) { return n("seg_update", { seg: a }); }, segmentNew: function(a, i) { return n("new_seg", { seg: a, primary: i }); }, segmentRemove: function(a) { return n("rem_seg", { seg: a }); }, tempStatus: function(a, i, o) { return n("temp_status", { seg: a, above: i, below: o }); }, rewind: function(a) { return n("rewind", { seg: a }); }, status: function(a, i, o) { return n("status", { seg: a, above: i, below: o }); }, vert: function(a) { return a === r ? e10 : (r = a, n("vert", { x: a })); }, log: function(a) { return typeof a != "string" && (a = JSON.stringify(a, false, " ")), n("log", { txt: a }); }, reset: function() { return n("reset"); }, selected: function(a) { return n("selected", { segs: a }); }, chainStart: function(a) { return n("chain_start", { seg: a }); }, chainRemoveHead: function(a, i) { return n("chain_rem_head", { index: a, pt: i }); }, chainRemoveTail: function(a, i) { return n("chain_rem_tail", { index: a, pt: i }); }, chainNew: function(a, i) { return n("chain_new", { pt1: a, pt2: i }); }, chainMatch: function(a) { return n("chain_match", { index: a }); }, chainClose: function(a) { return n("chain_close", { index: a }); }, chainAddHead: function(a, i) { return n("chain_add_head", { index: a, pt: i }); }, chainAddTail: function(a, i) { return n("chain_add_tail", { index: a, pt: i }); }, chainConnect: function(a, i) { return n("chain_con", { index1: a, index2: i }); }, chainReverse: function(a) { return n("chain_rev", { index: a }); }, chainJoin: function(a, i) { return n("chain_join", { index1: a, index2: i }); }, done: function() { return n("done"); } }, e10; } var JJ = KJ; function QJ(e10) { typeof e10 != "number" && (e10 = 1e-10); var t = { epsilon: function(r) { return typeof r == "number" && (e10 = r), e10; }, pointAboveOrOnLine: function(r, n, a) { var i = n[0], o = n[1], l = a[0], s = a[1], u = r[0], f = r[1]; return (l - i) * (f - o) - (s - o) * (u - i) >= -e10; }, pointBetween: function(r, n, a) { var i = r[1] - n[1], o = a[0] - n[0], l = r[0] - n[0], s = a[1] - n[1], u = l * o + i * s; if (u < e10) return false; var f = o * o + s * s; return !(u - f > -e10); }, pointsSameX: function(r, n) { return Math.abs(r[0] - n[0]) < e10; }, pointsSameY: function(r, n) { return Math.abs(r[1] - n[1]) < e10; }, pointsSame: function(r, n) { return t.pointsSameX(r, n) && t.pointsSameY(r, n); }, pointsCompare: function(r, n) { return t.pointsSameX(r, n) ? t.pointsSameY(r, n) ? 0 : r[1] < n[1] ? -1 : 1 : r[0] < n[0] ? -1 : 1; }, pointsCollinear: function(r, n, a) { var i = r[0] - n[0], o = r[1] - n[1], l = n[0] - a[0], s = n[1] - a[1]; return Math.abs(i * s - l * o) < e10; }, linesIntersect: function(r, n, a, i) { var o = n[0] - r[0], l = n[1] - r[1], s = i[0] - a[0], u = i[1] - a[1], f = o * u - l * s; if (Math.abs(f) < e10) return false; var d = r[0] - a[0], h = r[1] - a[1], p = (s * h - u * d) / f, v = (o * h - l * d) / f, m = { alongA: 0, alongB: 0, pt: [ r[0] + p * o, r[1] + p * l ] }; return p <= -e10 ? m.alongA = -2 : p < e10 ? m.alongA = -1 : p - 1 <= -e10 ? m.alongA = 0 : p - 1 < e10 ? m.alongA = 1 : m.alongA = 2, v <= -e10 ? m.alongB = -2 : v < e10 ? m.alongB = -1 : v - 1 <= -e10 ? m.alongB = 0 : v - 1 < e10 ? m.alongB = 1 : m.alongB = 2, m; }, pointInsideRegion: function(r, n) { for (var a = r[0], i = r[1], o = n[n.length - 1][0], l = n[n.length - 1][1], s = false, u = 0; u < n.length; u++) { var f = n[u][0], d = n[u][1]; d - i > e10 != l - i > e10 && (o - f) * (i - d) / (l - d) + f - a > e10 && (s = !s), o = f, l = d; } return s; } }; return t; } var eQ = QJ; var tQ = { create: function() { var e10 = { root: { root: true, next: null }, exists: function(t) { return !(t === null || t === e10.root); }, isEmpty: function() { return e10.root.next === null; }, getHead: function() { return e10.root.next; }, insertBefore: function(t, r) { for (var n = e10.root, a = e10.root.next; a !== null; ) { if (r(a)) { t.prev = a.prev, t.next = a, a.prev.next = t, a.prev = t; return; } n = a, a = a.next; } n.next = t, t.prev = n, t.next = null; }, findTransition: function(t) { for (var r = e10.root, n = e10.root.next; n !== null && !t(n); ) r = n, n = n.next; return { before: r === e10.root ? null : r, after: n, insert: function(a) { return a.prev = r, a.next = n, r.next = a, n !== null && (n.prev = a), a; } }; } }; return e10; }, node: function(e10) { return e10.prev = null, e10.next = null, e10.remove = function() { e10.prev.next = e10.next, e10.next && (e10.next.prev = e10.prev), e10.prev = null, e10.next = null; }, e10; } }; var rQ = tQ; var Ef = rQ; function nQ(e10, t, r) { function n(v, m) { return { id: r ? r.segmentId() : -1, start: v, end: m, myFill: { above: null, // is there fill above us? below: null // is there fill below us? }, otherFill: null }; } function a(v, m, g) { return { id: r ? r.segmentId() : -1, start: v, end: m, myFill: { above: g.myFill.above, below: g.myFill.below }, otherFill: null }; } var i = Ef.create(); function o(v, m, g, y, w, k) { var x = t.pointsCompare(m, w); return x !== 0 ? x : t.pointsSame(g, k) ? 0 : v !== y ? v ? 1 : -1 : t.pointAboveOrOnLine( g, y ? w : k, // order matters y ? k : w ) ? 1 : -1; } function l(v, m) { i.insertBefore(v, function(g) { var y = o( v.isStart, v.pt, m, g.isStart, g.pt, g.other.pt ); return y < 0; }); } function s(v, m) { var g = Ef.node({ isStart: true, pt: v.start, seg: v, primary: m, other: null, status: null }); return l(g, v.end), g; } function u(v, m, g) { var y = Ef.node({ isStart: false, pt: m.end, seg: m, primary: g, other: v, status: null }); v.other = y, l(y, v.pt); } function f(v, m) { var g = s(v, m); return u(g, v, m), g; } function d(v, m) { r && r.segmentChop(v.seg, m), v.other.remove(), v.seg.end = m, v.other.pt = m, l(v.other, v.pt); } function h(v, m) { var g = a(m, v.seg.end, v.seg); return d(v, m), f(g, v.primary); } function p(v, m) { var g = Ef.create(); function y(G, K) { var V = G.seg.start, z = G.seg.end, P = K.seg.start, R = K.seg.end; return t.pointsCollinear(V, P, R) ? t.pointsCollinear(z, P, R) || t.pointAboveOrOnLine(z, P, R) ? 1 : -1 : t.pointAboveOrOnLine(V, P, R) ? 1 : -1; } function w(G) { return g.findTransition(function(K) { var V = y(G, K.ev); return V > 0; }); } function k(G, K) { var V = G.seg, z = K.seg, P = V.start, R = V.end, H = z.start, B = z.end; r && r.checkIntersection(V, z); var W = t.linesIntersect(P, R, H, B); if (W === false) { if (!t.pointsCollinear(P, R, H) || t.pointsSame(P, B) || t.pointsSame(R, H)) return false; var ee = t.pointsSame(P, H), re = t.pointsSame(R, B); if (ee && re) return K; var ae = !ee && t.pointBetween(P, H, B), Q = !re && t.pointBetween(R, H, B); if (ee) return Q ? h(K, R) : h(G, B), K; ae && (re || (Q ? h(K, R) : h(G, B)), h(K, P)); } else W.alongA === 0 && (W.alongB === -1 ? h(G, H) : W.alongB === 0 ? h(G, W.pt) : W.alongB === 1 && h(G, B)), W.alongB === 0 && (W.alongA === -1 ? h(K, P) : W.alongA === 0 ? h(K, W.pt) : W.alongA === 1 && h(K, R)); return false; } for (var x = []; !i.isEmpty(); ) { var _ = i.getHead(); if (r && r.vert(_.pt[0]), _.isStart) { let G = function() { if (S) { var K = k(_, S); if (K) return K; } return M ? k(_, M) : false; }; r && r.segmentNew(_.seg, _.primary); var T = w(_), S = T.before ? T.before.ev : null, M = T.after ? T.after.ev : null; r && r.tempStatus( _.seg, S ? S.seg : false, M ? M.seg : false ); var L = G(); if (L) { if (e10) { var F; _.seg.myFill.below === null ? F = true : F = _.seg.myFill.above !== _.seg.myFill.below, F && (L.seg.myFill.above = !L.seg.myFill.above); } else L.seg.otherFill = _.seg.myFill; r && r.segmentUpdate(L.seg), _.other.remove(), _.remove(); } if (i.getHead() !== _) { r && r.rewind(_.seg); continue; } if (e10) { var F; _.seg.myFill.below === null ? F = true : F = _.seg.myFill.above !== _.seg.myFill.below, M ? _.seg.myFill.below = M.seg.myFill.above : _.seg.myFill.below = v, F ? _.seg.myFill.above = !_.seg.myFill.below : _.seg.myFill.above = _.seg.myFill.below; } else if (_.seg.otherFill === null) { var $; M ? _.primary === M.primary ? $ = M.seg.otherFill.above : $ = M.seg.myFill.above : $ = _.primary ? m : v, _.seg.otherFill = { above: $, below: $ }; } r && r.status( _.seg, S ? S.seg : false, M ? M.seg : false ), _.other.status = T.insert(Ef.node({ ev: _ })); } else { var I = _.status; if (I === null) throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large"); if (g.exists(I.prev) && g.exists(I.next) && k(I.prev.ev, I.next.ev), r && r.statusRemove(I.ev.seg), I.remove(), !_.primary) { var O = _.seg.myFill; _.seg.myFill = _.seg.otherFill, _.seg.otherFill = O; } x.push(_.seg); } i.getHead().remove(); } return r && r.done(), x; } return e10 ? { addRegion: function(v) { for (var m, g = v[v.length - 1], y = 0; y < v.length; y++) { m = g, g = v[y]; var w = t.pointsCompare(m, g); w !== 0 && f( n( w < 0 ? m : g, w < 0 ? g : m ), true ); } }, calculate: function(v) { return p(v, false); } } : { calculate: function(v, m, g, y) { return v.forEach(function(w) { f(a(w.start, w.end, w), true); }), g.forEach(function(w) { f(a(w.start, w.end, w), false); }), p(m, y); } }; } var aQ = nQ; function iQ(e10, t, r) { var n = [], a = []; return e10.forEach(function(i) { var o = i.start, l = i.end; if (t.pointsSame(o, l)) { console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large"); return; } r && r.chainStart(i); var s = { index: 0, matches_head: false, matches_pt1: false }, u = { index: 0, matches_head: false, matches_pt1: false }, f = s; function d(I, O, G) { return f.index = I, f.matches_head = O, f.matches_pt1 = G, f === s ? (f = u, false) : (f = null, true); } for (var h = 0; h < n.length; h++) { var p = n[h], v = p[0]; p[1]; var m = p[p.length - 1]; if (p[p.length - 2], t.pointsSame(v, o)) { if (d(h, true, true)) break; } else if (t.pointsSame(v, l)) { if (d(h, true, false)) break; } else if (t.pointsSame(m, o)) { if (d(h, false, true)) break; } else if (t.pointsSame(m, l) && d(h, false, false)) break; } if (f === s) { n.push([o, l]), r && r.chainNew(o, l); return; } if (f === u) { r && r.chainMatch(s.index); var g = s.index, y = s.matches_pt1 ? l : o, w = s.matches_head, p = n[g], k = w ? p[0] : p[p.length - 1], x = w ? p[1] : p[p.length - 2], _ = w ? p[p.length - 1] : p[0], T = w ? p[p.length - 2] : p[1]; if (t.pointsCollinear(x, k, y) && (w ? (r && r.chainRemoveHead(s.index, y), p.shift()) : (r && r.chainRemoveTail(s.index, y), p.pop()), k = x), t.pointsSame(_, y)) { n.splice(g, 1), t.pointsCollinear(T, _, k) && (w ? (r && r.chainRemoveTail(s.index, k), p.pop()) : (r && r.chainRemoveHead(s.index, k), p.shift())), r && r.chainClose(s.index), a.push(p); return; } w ? (r && r.chainAddHead(s.index, y), p.unshift(y)) : (r && r.chainAddTail(s.index, y), p.push(y)); return; } function S(I) { r && r.chainReverse(I), n[I].reverse(); } function M(I, O) { var G = n[I], K = n[O], V = G[G.length - 1], z = G[G.length - 2], P = K[0], R = K[1]; t.pointsCollinear(z, V, P) && (r && r.chainRemoveTail(I, V), G.pop(), V = z), t.pointsCollinear(V, P, R) && (r && r.chainRemoveHead(O, P), K.shift()), r && r.chainJoin(I, O), n[I] = G.concat(K), n.splice(O, 1); } var L = s.index, F = u.index; r && r.chainConnect(L, F); var $ = n[L].length < n[F].length; s.matches_head ? u.matches_head ? $ ? (S(L), M(L, F)) : (S(F), M(F, L)) : M(F, L) : u.matches_head ? M(L, F) : $ ? (S(L), M(F, L)) : (S(F), M(L, F)); }), a; } var oQ = iQ; function Ff(e10, t, r) { var n = []; return e10.forEach(function(a) { var i = (a.myFill.above ? 8 : 0) + (a.myFill.below ? 4 : 0) + (a.otherFill && a.otherFill.above ? 2 : 0) + (a.otherFill && a.otherFill.below ? 1 : 0); t[i] !== 0 && n.push({ id: r ? r.segmentId() : -1, start: a.start, end: a.end, myFill: { above: t[i] === 1, // 1 if filled above below: t[i] === 2 // 2 if filled below }, otherFill: null }); }), r && r.selected(n), n; } var lQ = { union: function(e10, t) { return Ff(e10, [ 0, 2, 1, 0, 2, 2, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 ], t); }, intersect: function(e10, t) { return Ff(e10, [ 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 1, 1, 0, 2, 1, 0 ], t); }, difference: function(e10, t) { return Ff(e10, [ 0, 0, 0, 0, 2, 0, 2, 0, 1, 1, 0, 0, 0, 1, 2, 0 ], t); }, differenceRev: function(e10, t) { return Ff(e10, [ 0, 2, 1, 0, 0, 0, 1, 1, 0, 2, 0, 2, 0, 0, 0, 0 ], t); }, xor: function(e10, t) { return Ff(e10, [ 0, 2, 1, 0, 2, 0, 0, 1, 1, 0, 0, 2, 0, 1, 2, 0 ], t); } }; var sQ = lQ; var uQ = { // convert a GeoJSON object to a PolyBool polygon toPolygon: function(e10, t) { function r(i) { if (i.length <= 0) return e10.segments({ inverted: false, regions: [] }); function o(u) { var f = u.slice(0, u.length - 1); return e10.segments({ inverted: false, regions: [f] }); } for (var l = o(i[0]), s = 1; s < i.length; s++) l = e10.selectDifference(e10.combine(l, o(i[s]))); return l; } if (t.type === "Polygon") return e10.polygon(r(t.coordinates)); if (t.type === "MultiPolygon") { for (var n = e10.segments({ inverted: false, regions: [] }), a = 0; a < t.coordinates.length; a++) n = e10.selectUnion(e10.combine(n, r(t.coordinates[a]))); return e10.polygon(n); } throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon"); }, // convert a PolyBool polygon to a GeoJSON object fromPolygon: function(e10, t, r) { r = e10.polygon(e10.segments(r)); function n(p, v) { return t.pointInsideRegion([ (p[0][0] + p[1][0]) * 0.5, (p[0][1] + p[1][1]) * 0.5 ], v); } function a(p) { return { region: p, children: [] }; } var i = a(null); function o(p, v) { for (var m = 0; m < p.children.length; m++) { var g = p.children[m]; if (n(v, g.region)) { o(g, v); return; } } for (var y = a(v), m = 0; m < p.children.length; m++) { var g = p.children[m]; n(g.region, v) && (y.children.push(g), p.children.splice(m, 1), m--); } p.children.push(y); } for (var l = 0; l < r.regions.length; l++) { var s = r.regions[l]; s.length < 3 || o(i, s); } function u(p, v) { for (var m = 0, g = p[p.length - 1][0], y = p[p.length - 1][1], w = [], k = 0; k < p.length; k++) { var x = p[k][0], _ = p[k][1]; w.push([x, _]), m += _ * g - x * y, g = x, y = _; } var T = m < 0; return T !== v && w.reverse(), w.push([w[0][0], w[0][1]]), w; } var f = []; function d(p) { var v = [u(p.region, false)]; f.push(v); for (var m = 0; m < p.children.length; m++) v.push(h(p.children[m])); } function h(p) { for (var v = 0; v < p.children.length; v++) d(p.children[v]); return u(p.region, true); } for (var l = 0; l < i.children.length; l++) d(i.children[l]); return f.length <= 0 ? { type: "Polygon", coordinates: [] } : f.length == 1 ? { type: "Polygon", coordinates: f[0] } : { // otherwise, use a GeoJSON MultiPolygon type: "MultiPolygon", coordinates: f }; } }; var fQ = uQ; var cQ = JJ; var dQ = eQ; var Zk = aQ; var hQ = oQ; var Rf = sQ; var Yk = fQ; var Ea = false; var Pf = dQ(); var ia; ia = { // getter/setter for buildLog buildLog: function(e10) { return e10 === true ? Ea = cQ() : e10 === false && (Ea = false), Ea === false ? false : Ea.list; }, // getter/setter for epsilon epsilon: function(e10) { return Pf.epsilon(e10); }, // core API segments: function(e10) { var t = Zk(true, Pf, Ea); return e10.regions.forEach(t.addRegion), { segments: t.calculate(e10.inverted), inverted: e10.inverted }; }, combine: function(e10, t) { var r = Zk(false, Pf, Ea); return { combined: r.calculate( e10.segments, e10.inverted, t.segments, t.inverted ), inverted1: e10.inverted, inverted2: t.inverted }; }, selectUnion: function(e10) { return { segments: Rf.union(e10.combined, Ea), inverted: e10.inverted1 || e10.inverted2 }; }, selectIntersect: function(e10) { return { segments: Rf.intersect(e10.combined, Ea), inverted: e10.inverted1 && e10.inverted2 }; }, selectDifference: function(e10) { return { segments: Rf.difference(e10.combined, Ea), inverted: e10.inverted1 && !e10.inverted2 }; }, selectDifferenceRev: function(e10) { return { segments: Rf.differenceRev(e10.combined, Ea), inverted: !e10.inverted1 && e10.inverted2 }; }, selectXor: function(e10) { return { segments: Rf.xor(e10.combined, Ea), inverted: e10.inverted1 !== e10.inverted2 }; }, polygon: function(e10) { return { regions: hQ(e10.segments, Pf, Ea), inverted: e10.inverted }; }, // GeoJSON converters polygonFromGeoJSON: function(e10) { return Yk.toPolygon(ia, e10); }, polygonToGeoJSON: function(e10) { return Yk.fromPolygon(ia, Pf, e10); }, // helper functions for common operations union: function(e10, t) { return $f(e10, t, ia.selectUnion); }, intersect: function(e10, t) { return $f(e10, t, ia.selectIntersect); }, difference: function(e10, t) { return $f(e10, t, ia.selectDifference); }, differenceRev: function(e10, t) { return $f(e10, t, ia.selectDifferenceRev); }, xor: function(e10, t) { return $f(e10, t, ia.selectXor); } }; function $f(e10, t, r) { var n = ia.segments(e10), a = ia.segments(t), i = ia.combine(n, a), o = r(i); return ia.polygon(o); } typeof window == "object" && (window.PolyBool = ia); var vQ = ia; var pQ = function(t, r, n, a) { var i = t[0], o = t[1], l = false; n === void 0 && (n = 0), a === void 0 && (a = r.length); for (var s = a - n, u = 0, f = s - 1; u < s; f = u++) { var d = r[u + n][0], h = r[u + n][1], p = r[f + n][0], v = r[f + n][1], m = h > o != v > o && i < (p - d) * (o - h) / (v - h) + d; m && (l = !l); } return l; }; var JD = { exports: {} }; var $g = cp.dot; var lh = Qr.BADNUM; var Av = JD.exports = {}; Av.tester = function(t) { var r = t.slice(), n = r[0][0], a = n, i = r[0][1], o = i, l; for ((r[r.length - 1][0] !== r[0][0] || r[r.length - 1][1] !== r[0][1]) && r.push(r[0]), l = 1; l < r.length; l++) n = Math.min(n, r[l][0]), a = Math.max(a, r[l][0]), i = Math.min(i, r[l][1]), o = Math.max(o, r[l][1]); var s = false, u; r.length === 5 && (r[0][0] === r[1][0] ? r[2][0] === r[3][0] && r[0][1] === r[3][1] && r[1][1] === r[2][1] && (s = true, u = function(v) { return v[0] === r[0][0]; }) : r[0][1] === r[1][1] && r[2][1] === r[3][1] && r[0][0] === r[3][0] && r[1][0] === r[2][0] && (s = true, u = function(v) { return v[1] === r[0][1]; })); function f(v, m) { var g = v[0], y = v[1]; return !(g === lh || g < n || g > a || y === lh || y < i || y > o || m && u(v)); } function d(v, m) { var g = v[0], y = v[1]; if (g === lh || g < n || g > a || y === lh || y < i || y > o) return false; var w = r.length, k = r[0][0], x = r[0][1], _ = 0, T, S, M, L, F; for (T = 1; T < w; T++) if (S = k, M = x, k = r[T][0], x = r[T][1], L = Math.min(S, k), !(g < L || g > Math.max(S, k) || y > Math.max(M, x))) if (y < Math.min(M, x)) g !== L && _++; else { if (k === S ? F = y : F = M + (g - S) * (x - M) / (k - S), y === F) return !(T === 1 && m); y <= F && g !== L && _++; } return _ % 2 === 1; } var h = true, p = r[0]; for (l = 1; l < r.length; l++) if (p[0] !== r[l][0] || p[1] !== r[l][1]) { h = false; break; } return { xmin: n, xmax: a, ymin: i, ymax: o, pts: r, contains: s ? f : d, isRect: s, degenerate: h }; }; Av.isSegmentBent = function(t, r, n, a) { var i = t[r], o = [t[n][0] - i[0], t[n][1] - i[1]], l = $g(o, o), s = Math.sqrt(l), u = [-o[1] / s, o[0] / s], f, d, h; for (f = r + 1; f < n; f++) if (d = [t[f][0] - i[0], t[f][1] - i[1]], h = $g(d, o), h < 0 || h > l || Math.abs($g(d, u)) > a) return true; return false; }; Av.filter = function(t, r) { var n = [t[0]], a = 0, i = 0; function o(s) { t.push(s); var u = n.length, f = a; n.splice(i + 1); for (var d = f + 1; d < t.length; d++) (d === t.length - 1 || Av.isSegmentBent(t, f, d + 1, r)) && (n.push(t[d]), n.length < u - 2 && (a = d, i = n.length - 1), f = d); } if (t.length > 1) { var l = t.pop(); o(l); } return { addPt: o, raw: t, filtered: n }; }; var QD = JD.exports; var mQ = { // max pixels off straight before a lasso select line counts as bent BENDPX: 1.5, // smallest dimension allowed for a select box MINSELECT: 12, // throttling limit (ms) for selectPoints calls SELECTDELAY: 100, // cache ID suffix for throttle SELECTID: "-select" }; var Xk = vQ; var gQ = pQ; var Sc = Nt; var yQ = Sr.dashStyle; var zf = nr; var bQ = Ao; var _Q = Do.makeEventData; var ed = rf; var xQ = ed.freeMode; var wQ = ed.rectMode; var Cc = ed.drawMode; var qb = ed.openMode; var Wb = ed.selectMode; var Kk = xl; var Jk = Np; var eE = Nb; var tE = _s.clearOutline; var rE = _l; var zg = rE.handleEllipse; var TQ = rE.readPaths; var kQ = $b.newShapes; var AQ = xD; var MQ = XD.activateLastSelection; var Bh = Ue; var SQ = Bh.sorterAsc; var nE = QD; var If = gp; var Oa = gn.getFromId; var CQ = Eb; var LQ = zp.redrawReglTraces; var jh = mQ; var Li = jh.MINSELECT; var DQ = nE.filter; var Zb = nE.tester; var Yb = Pb; var Qk = Yb.p2r; var EQ = Yb.axValue; var FQ = Yb.getTransform; function Xb(e10) { return e10.subplot !== void 0; } function RQ(e10, t, r, n, a) { var i = !Xb(n), o = xQ(a), l = wQ(a), s = qb(a), u = Cc(a), f = Wb(a), d = a === "drawline", h = a === "drawcircle", p = d || h, v = n.gd, m = v._fullLayout, g = f && m.newselection.mode === "immediate" && i, y = m._zoomlayer, w = n.element.getBoundingClientRect(), k = n.plotinfo, x = FQ(k), _ = t - w.left, T = r - w.top; m._calcInverseTransform(v); var S = Bh.apply3DTransform(m._invTransform)(_, T); _ = S[0], T = S[1]; var M = m._invScaleX, L = m._invScaleY, F = _, $ = T, I = "M" + _ + "," + T, O = n.xaxes[0], G = n.yaxes[0], K = O._length, V = G._length, z = e10.altKey && !(Cc(a) && s), P, R, H, B, W, ee, re; iE(e10, v, n), o && (P = DQ([[_, T]], jh.BENDPX)); var ae = y.selectAll("path.select-outline-" + k.id).data([1]), Q = u ? m.newshape : m.newselection; u && (n.hasText = Q.label.text || Q.label.texttemplate); var ue = u && !s ? Q.fillcolor : "rgba(0,0,0,0)", j = Q.line.color || (i ? zf.contrast(v._fullLayout.plot_bgcolor) : "#7f7f7f"); ae.enter().append("path").attr("class", "select-outline select-outline-" + k.id).style({ opacity: u ? Q.opacity / 2 : 1, "stroke-dasharray": yQ(Q.line.dash, Q.line.width), "stroke-width": Q.line.width + "px", "shape-rendering": "crispEdges" }).call(zf.stroke, j).call(zf.fill, ue).attr("fill-rule", "evenodd").classed("cursor-move", !!u).attr("transform", x).attr("d", I + "Z"); var U = y.append("path").attr("class", "zoombox-corners").style({ fill: zf.background, stroke: zf.defaultLine, "stroke-width": 1 }).attr("transform", x).attr("d", "M0,0Z"); if (u && n.hasText) { var Z = y.select(".label-temp"); Z.empty() && (Z = y.append("g").classed("label-temp", true).classed("select-outline", true).style({ opacity: 0.8 })); } var le = m._uid + jh.SELECTID, J = [], pe = Gp( v, n.xaxes, n.yaxes, n.subplot ); g && !e10.shiftKey && (n._clearSubplotSelections = function() { if (i) { var ve = O._id, me = G._id; fE(v, ve, me, pe); for (var Le = (v.layout || {}).selections || [], ze = [], Fe = false, Oe = 0; Oe < Le.length; Oe++) { var Re = m.selections[Oe]; Re.xref !== ve || Re.yref !== me ? ze.push(Le[Oe]) : Fe = true; } Fe && (v._fullLayout._noEmitSelectedAtStart = true, Sc.call("_guiRelayout", v, { selections: ze })); } }); var ge = WQ(n); n.moveFn = function(ve, me) { n._clearSubplotSelections && (n._clearSubplotSelections(), n._clearSubplotSelections = void 0), F = Math.max(0, Math.min(K, M * ve + _)), $ = Math.max(0, Math.min(V, L * me + T)); var Le = Math.abs(F - _), ze = Math.abs($ - T); if (l) { var Fe, Oe, Re; if (f) { var We = m.selectdirection; switch (We === "any" ? ze < Math.min(Le * 0.6, Li) ? Fe = "h" : Le < Math.min(ze * 0.6, Li) ? Fe = "v" : Fe = "d" : Fe = We, Fe) { case "h": Oe = h ? V / 2 : 0, Re = V; break; case "v": Oe = h ? K / 2 : 0, Re = K; break; } } if (u) switch (m.newshape.drawdirection) { case "vertical": Fe = "h", Oe = h ? V / 2 : 0, Re = V; break; case "horizontal": Fe = "v", Oe = h ? K / 2 : 0, Re = K; break; case "ortho": Le < ze ? (Fe = "h", Oe = T, Re = $) : (Fe = "v", Oe = _, Re = F); break; default: Fe = "d"; } Fe === "h" ? (B = p ? zg(h, [F, Oe], [F, Re]) : ( // using x1 instead of x0 allows adjusting the line while drawing [[_, Oe], [_, Re], [F, Re], [F, Oe]] ), B.xmin = p ? F : Math.min(_, F), B.xmax = p ? F : Math.max(_, F), B.ymin = Math.min(Oe, Re), B.ymax = Math.max(Oe, Re), U.attr("d", "M" + B.xmin + "," + (T - Li) + "h-4v" + 2 * Li + "h4ZM" + (B.xmax - 1) + "," + (T - Li) + "h4v" + 2 * Li + "h-4Z")) : Fe === "v" ? (B = p ? zg(h, [Oe, $], [Re, $]) : ( // using y1 instead of y0 allows adjusting the line while drawing [[Oe, T], [Oe, $], [Re, $], [Re, T]] ), B.xmin = Math.min(Oe, Re), B.xmax = Math.max(Oe, Re), B.ymin = p ? $ : Math.min(T, $), B.ymax = p ? $ : Math.max(T, $), U.attr("d", "M" + (_ - Li) + "," + B.ymin + "v-4h" + 2 * Li + "v4ZM" + (_ - Li) + "," + (B.ymax - 1) + "v4h" + 2 * Li + "v-4Z")) : Fe === "d" && (B = p ? zg(h, [_, T], [F, $]) : [[_, T], [_, $], [F, $], [F, T]], B.xmin = Math.min(_, F), B.xmax = Math.max(_, F), B.ymin = Math.min(T, $), B.ymax = Math.max(T, $), U.attr("d", "M0,0Z")); } else o && (P.addPt([F, $]), B = P.filtered); if (n.selectionDefs && n.selectionDefs.length ? (H = oE(n.mergedPolygons, B, z), B.subtract = z, R = Kb(n.selectionDefs.concat([B]))) : (H = [B], R = Zb(B)), eE(sE(H, s), ae, n), f) { var Me = Oy(v, false), Ve = Me.eventData ? Me.eventData.points.slice() : []; Me = Oy(v, false, R, pe, n), R = Me.selectionTesters, re = Me.eventData; var qe; P ? qe = P.filtered : qe = cE(H), If.throttle( le, jh.SELECTDELAY, function() { J = uE(R, pe); for (var Qe = J.slice(), ot = 0; ot < Ve.length; ot++) { for (var ht = Ve[ot], vt = false, nt = 0; nt < Qe.length; nt++) if (Qe[nt].curveNumber === ht.curveNumber && Qe[nt].pointNumber === ht.pointNumber) { vt = true; break; } vt || Qe.push(ht); } Qe.length && (re || (re = {}), re.points = Qe), ge(re, qe), ZQ(v, re); } ); } }, n.clickFn = function(ve, me) { if (U.remove(), v._fullLayout._activeShapeIndex >= 0) { v._fullLayout._deactivateShape(v); return; } if (!u) { var Le = m.clickmode; If.done(le).then(function() { if (If.clear(le), ve === 2) { for (ae.remove(), W = 0; W < pe.length; W++) ee = pe[W], ee._module.selectPoints(ee, false); if (Dc(v, pe), Lc(n), Qb(v), pe.length) { var ze = pe[0].xaxis, Fe = pe[0].yaxis; if (ze && Fe) { for (var Oe = [], Re = v._fullLayout.selections, We = 0; We < Re.length; We++) { var Me = Re[We]; Me && (Me.xref !== ze._id || Me.yref !== Fe._id) && Oe.push(Me); } Oe.length < Re.length && (v._fullLayout._noEmitSelectedAtStart = true, Sc.call("_guiRelayout", v, { selections: Oe })); } } } else Le.indexOf("select") > -1 && aE( me, v, n.xaxes, n.yaxes, n.subplot, n, ae ), Le === "event" && Ec(v, void 0); bQ.click(v, me, k.id); }).catch(Bh.error); } }, n.doneFn = function() { U.remove(), If.done(le).then(function() { If.clear(le), !g && B && n.selectionDefs && (B.subtract = z, n.selectionDefs.push(B), n.mergedPolygons.length = 0, [].push.apply(n.mergedPolygons, H)), (g || u) && Lc(n, g), n.doneFnCompleted && n.doneFnCompleted(J), f && Ec(v, re); }).catch(Bh.error); }; } function aE(e10, t, r, n, a, i, o) { var l = t._hoverdata, s = t._fullLayout, u = s.clickmode, f = u.indexOf("event") > -1, d = [], h, p, v, m, g, y, w, k, x, _; if (NQ(l)) { iE(e10, t, i), h = Gp(t, r, n, a); var T = OQ(l, h), S = T.pointNumbers.length > 0; if (S ? HQ(h, T) : BQ(h) && (w = tA(T))) { for (o && o.remove(), _ = 0; _ < h.length; _++) p = h[_], p._module.selectPoints(p, false); Dc(t, h), Lc(i), f && Qb(t); } else { k = e10.shiftKey && (w !== void 0 ? w : tA(T)), v = PQ(T.pointNumber, T.searchInfo, k); var M = i.selectionDefs.concat([v]); for (m = Kb(M), _ = 0; _ < h.length; _++) if (g = h[_]._module.selectPoints(h[_], m), y = lE(g, h[_]), d.length) for (var L = 0; L < y.length; L++) d.push(y[L]); else d = y; if (x = { points: d }, Dc(t, h, x), v && i && i.selectionDefs.push(v), o) { var F = i.mergedPolygons, $ = qb(i.dragmode); eE(sE(F, $), o, i); } f && Ec(t, x); } } } function PQ(e10, t, r) { return { pointNumber: e10, searchInfo: t, subtract: !!r }; } function Ig(e10) { return "pointNumber" in e10 && "searchInfo" in e10; } function $Q(e10) { return { xmin: 0, xmax: 0, ymin: 0, ymax: 0, pts: [], contains: function(t, r, n, a) { var i = e10.searchInfo.cd[0].trace._expandedIndex, o = a.cd[0].trace._expandedIndex; return o === i && n === e10.pointNumber; }, isRect: false, degenerate: false, subtract: !!e10.subtract }; } function Kb(e10) { if (!e10.length) return; for (var t = [], r = Ig(e10[0]) ? 0 : e10[0][0][0], n = r, a = Ig(e10[0]) ? 0 : e10[0][0][1], i = a, o = 0; o < e10.length; o++) if (Ig(e10[o])) t.push($Q(e10[o])); else { var l = Zb(e10[o]); l.subtract = !!e10[o].subtract, t.push(l), r = Math.min(r, l.xmin), n = Math.max(n, l.xmax), a = Math.min(a, l.ymin), i = Math.max(i, l.ymax); } function s(u, f, d, h) { for (var p = false, v = 0; v < t.length; v++) t[v].contains(u, f, d, h) && (p = !t[v].subtract); return p; } return { xmin: r, xmax: n, ymin: a, ymax: i, pts: [], contains: s, isRect: false, degenerate: false }; } function iE(e10, t, r) { var n = t._fullLayout, a = r.plotinfo, i = r.dragmode, o = n._lastSelectedSubplot && n._lastSelectedSubplot === a.id, l = (e10.shiftKey || e10.altKey) && !(Cc(i) && qb(i)); o && l && a.selection && a.selection.selectionDefs && !r.selectionDefs ? (r.selectionDefs = a.selection.selectionDefs, r.mergedPolygons = a.selection.mergedPolygons) : (!l || !a.selection) && Lc(r), o || (tE(t), n._lastSelectedSubplot = a.id); } function zQ(e10) { return e10._fullLayout._activeShapeIndex >= 0; } function IQ(e10) { return e10._fullLayout._activeSelectionIndex >= 0; } function Lc(e10, t) { var r = e10.dragmode, n = e10.plotinfo, a = e10.gd; zQ(a) && a._fullLayout._deactivateShape(a), IQ(a) && a._fullLayout._deactivateSelection(a); var i = a._fullLayout, o = i._zoomlayer, l = Cc(r), s = Wb(r); if (l || s) { var u = o.selectAll(".select-outline-" + n.id); if (u && a._fullLayout._outlining) { var f; l && (f = kQ(u, e10)), f && Sc.call("_guiRelayout", a, { shapes: f }); var d; s && !Xb(e10) && (d = AQ(u, e10)), d && (a._fullLayout._noEmitSelectedAtStart = true, Sc.call("_guiRelayout", a, { selections: d }).then(function() { t && MQ(a); })), a._fullLayout._outlining = false; } } n.selection = {}, n.selection.selectionDefs = e10.selectionDefs = [], n.selection.mergedPolygons = e10.mergedPolygons = []; } function eA(e10) { return e10._id; } function Gp(e10, t, r, n) { if (!e10.calcdata) return []; var a = [], i = t.map(eA), o = r.map(eA), l, s, u; for (u = 0; u < e10.calcdata.length; u++) if (l = e10.calcdata[u], s = l[0].trace, !(s.visible !== true || !s._module || !s._module.selectPoints)) if (Xb({ subplot: n }) && (s.subplot === n || s.geo === n)) a.push(sh(s._module, l, t[0], r[0])); else if (s.type === "splom") { if (s._xaxes[i[0]] && s._yaxes[o[0]]) { var f = sh(s._module, l, t[0], r[0]); f.scene = e10._fullLayout._splomScenes[s.uid], a.push(f); } } else if (s.type === "sankey") { var d = sh(s._module, l, t[0], r[0]); a.push(d); } else { if (i.indexOf(s.xaxis) === -1 || o.indexOf(s.yaxis) === -1) continue; a.push(sh( s._module, l, Oa(e10, s.xaxis), Oa(e10, s.yaxis) )); } return a; } function sh(e10, t, r, n) { return { _module: e10, cd: t, xaxis: r, yaxis: n }; } function NQ(e10) { return e10 && Array.isArray(e10) && e10[0].hoverOnBox !== true; } function OQ(e10, t) { var r = e10[0], n = -1, a = [], i, o; for (o = 0; o < t.length; o++) if (i = t[o], r.fullData._expandedIndex === i.cd[0].trace._expandedIndex) { if (r.hoverOnBox === true) break; r.pointNumber !== void 0 ? n = r.pointNumber : r.binNumber !== void 0 && (n = r.binNumber, a = r.pointNumbers); break; } return { pointNumber: n, pointNumbers: a, searchInfo: i }; } function tA(e10) { var t = e10.searchInfo.cd[0].trace, r = e10.pointNumber, n = e10.pointNumbers, a = n.length > 0, i = a ? n[0] : r; return t.selectedpoints ? t.selectedpoints.indexOf(i) > -1 : false; } function HQ(e10, t) { var r = [], n, a, i, o; for (o = 0; o < e10.length; o++) n = e10[o], n.cd[0].trace.selectedpoints && n.cd[0].trace.selectedpoints.length > 0 && r.push(n); if (r.length === 1 && (i = r[0] === t.searchInfo, i && (a = t.searchInfo.cd[0].trace, a.selectedpoints.length === t.pointNumbers.length))) { for (o = 0; o < t.pointNumbers.length; o++) if (a.selectedpoints.indexOf(t.pointNumbers[o]) < 0) return false; return true; } return false; } function BQ(e10) { var t = 0, r, n, a; for (a = 0; a < e10.length; a++) if (r = e10[a], n = r.cd[0].trace, n.selectedpoints && (n.selectedpoints.length > 1 || (t += n.selectedpoints.length, t > 1))) return false; return t === 1; } function Dc(e10, t, r) { var n; for (n = 0; n < t.length; n++) { var a = t[n].cd[0].trace._fullInput, i = e10._fullLayout._tracePreGUI[a.uid] || {}; i.selectedpoints === void 0 && (i.selectedpoints = a._input.selectedpoints || null); } var o; if (r) { var l = r.points || []; for (n = 0; n < t.length; n++) o = t[n].cd[0].trace, o._input.selectedpoints = o._fullInput.selectedpoints = [], o._fullInput !== o && (o.selectedpoints = []); for (var s = 0; s < l.length; s++) { var u = l[s], f = u.data, d = u.fullData, h = u.pointIndex, p = u.pointIndices; p ? ([].push.apply(f.selectedpoints, p), o._fullInput !== o && [].push.apply(d.selectedpoints, p)) : (f.selectedpoints.push(h), o._fullInput !== o && d.selectedpoints.push(h)); } } else for (n = 0; n < t.length; n++) o = t[n].cd[0].trace, delete o.selectedpoints, delete o._input.selectedpoints, o._fullInput !== o && delete o._fullInput.selectedpoints; jQ(e10, t); } function jQ(e10, t) { for (var r = false, n = 0; n < t.length; n++) { var a = t[n], i = a.cd; Sc.traceIs(i[0].trace, "regl") && (r = true); var o = a._module, l = o.styleOnSelect || o.style; l && (l(e10, i, i[0].node3), i[0].nodeRangePlot3 && l(e10, i, i[0].nodeRangePlot3)); } r && (CQ(e10), LQ(e10)); } function oE(e10, t, r) { for (var n = r ? Xk.difference : Xk.union, a = n({ regions: e10 }, { regions: [t] }), i = a.regions.reverse(), o = 0; o < i.length; o++) { var l = i[o]; l.subtract = Jb(l, i.slice(0, o)); } return i; } function lE(e10, t) { if (Array.isArray(e10)) for (var r = t.cd, n = t.cd[0].trace, a = 0; a < e10.length; a++) e10[a] = _Q(e10[a], n, r); return e10; } function sE(e10, t) { for (var r = [], n = 0; n < e10.length; n++) { r[n] = []; for (var a = 0; a < e10[n].length; a++) { r[n][a] = [], r[n][a][0] = a ? "L" : "M"; for (var i = 0; i < e10[n][a].length; i++) r[n][a].push( e10[n][a][i] ); } t || r[n].push([ "Z", r[n][0][1], // initial x r[n][0][2] // initial y ]); } return r; } function uE(e10, t) { for (var r = [], n, a, i = 0; i < t.length; i++) { var o = t[i]; a = o._module.selectPoints(o, e10), n = lE(a, o), r = r.concat(n); } return r; } function Oy(e10, t, r, n, a) { var i = !!n, o, l, s; a && (o = a.plotinfo, l = a.xaxes[0]._id, s = a.yaxes[0]._id); var u = [], f = [], d = rA(e10), h = e10._fullLayout; if (o) { var p = h._zoomlayer, v = h.dragmode, m = Cc(v), g = Wb(v); if (m || g) { var y = Oa(e10, l, "x"), w = Oa(e10, s, "y"); if (y && w) { var k = p.selectAll(".select-outline-" + o.id); if (k && e10._fullLayout._outlining && k.length) { for (var x = k[0][0], _ = x.getAttribute("d"), T = TQ(_, e10, o), S = [], M = 0; M < T.length; M++) { for (var L = T[M], F = [], $ = 0; $ < L.length; $++) F.push([ Xo(y, L[$][1]), Xo(w, L[$][2]) ]); F.xref = l, F.yref = s, F.subtract = Jb(F, S), S.push(F); } d = d.concat(S); } } } } var I = l && s ? [l + s] : h._subplots.cartesian; UQ(e10); for (var O = {}, G = 0; G < I.length; G++) { var K = I[G], V = K.indexOf("y"), z = K.slice(0, V), P = K.slice(V), R = l && s ? r : void 0; if (R = VQ(d, z, P, R), R) { var H = n; if (!i) { var B = Oa(e10, z, "x"), W = Oa(e10, P, "y"); H = Gp( e10, [B], [W], K ); for (var ee = 0; ee < H.length; ee++) { var re = H[ee], ae = re.cd[0], Q = ae.trace; if (re._module.name === "scattergl" && !ae.t.xpx) { var ue = Q.x, j = Q.y, U = Q._length; ae.t.xpx = [], ae.t.ypx = []; for (var Z = 0; Z < U; Z++) ae.t.xpx[Z] = B.c2p(ue[Z]), ae.t.ypx[Z] = W.c2p(j[Z]); } re._module.name === "splom" && (O[Q.uid] || (O[Q.uid] = true)); } } var le = uE(R, H); u = u.concat(le), f = f.concat(H); } } var J = { points: u }; Dc(e10, f, J); var pe = h.clickmode, ge = pe.indexOf("event") > -1 && t; if (!o && // get called from plot_api & plots t) { var ve = rA(e10, true); if (ve.length) { var me = ve[0].xref, Le = ve[0].yref; if (me && Le) { var ze = cE(ve), Fe = dE([ Oa(e10, me, "x"), Oa(e10, Le, "y") ]); Fe(J, ze); } } e10._fullLayout._noEmitSelectedAtStart ? e10._fullLayout._noEmitSelectedAtStart = false : ge && Ec(e10, J), h._reselect = false; } if (!o && // get called from plot_api & plots h._deselect) { var Oe = h._deselect; l = Oe.xref, s = Oe.yref, GQ(l, s, f) || fE(e10, l, s, n), ge && (J.points.length ? Ec(e10, J) : Qb(e10)), h._deselect = false; } return { eventData: J, selectionTesters: r }; } function UQ(e10) { var t = e10.calcdata; if (t) for (var r = 0; r < t.length; r++) { var n = t[r][0], a = n.trace, i = e10._fullLayout._splomScenes; if (i) { var o = i[a.uid]; o && (o.selectBatch = []); } } } function GQ(e10, t, r) { for (var n = 0; n < r.length; n++) { var a = r[n]; if (a.xaxis && a.xaxis._id === e10 && a.yaxis && a.yaxis._id === t) return true; } return false; } function fE(e10, t, r, n) { n = Gp( e10, [Oa(e10, t, "x")], [Oa(e10, r, "y")], t + r ); for (var a = 0; a < n.length; a++) { var i = n[a]; i._module.selectPoints(i, false); } Dc(e10, n); } function VQ(e10, t, r, n) { for (var a, i = 0; i < e10.length; i++) { var o = e10[i]; if (!(t !== o.xref || r !== o.yref)) if (a) { var l = !!o.subtract; a = oE(a, o, l), n = Kb(a); } else a = [o], n = Zb(o); } return n; } function rA(e10, t) { for (var r = [], n = e10._fullLayout, a = n.selections, i = a.length, o = 0; o < i; o++) if (!(t && o !== n._activeSelectionIndex)) { var l = a[o]; if (l) { var s = l.xref, u = l.yref, f = Oa(e10, s, "x"), d = Oa(e10, u, "y"), h, p, v, m, g; if (l.type === "rect") { g = []; var y = Xo(f, l.x0), w = Xo(f, l.x1), k = Xo(d, l.y0), x = Xo(d, l.y1); g = [[y, k], [y, x], [w, x], [w, k]], h = Math.min(y, w), p = Math.max(y, w), v = Math.min(k, x), m = Math.max(k, x), g.xmin = h, g.xmax = p, g.ymin = v, g.ymax = m, g.xref = s, g.yref = u, g.subtract = false, g.isRect = true, r.push(g); } else if (l.type === "path") for (var _ = l.path.split("Z"), T = [], S = 0; S < _.length; S++) { var M = _[S]; if (M) { M += "Z"; var L = Kk.extractPathCoords(M, Jk.paramIsX, "raw"), F = Kk.extractPathCoords(M, Jk.paramIsY, "raw"); h = 1 / 0, p = -1 / 0, v = 1 / 0, m = -1 / 0, g = []; for (var $ = 0; $ < L.length; $++) { var I = Xo(f, L[$]), O = Xo(d, F[$]); g.push([I, O]), h = Math.min(I, h), p = Math.max(I, p), v = Math.min(O, v), m = Math.max(O, m); } g.xmin = h, g.xmax = p, g.ymin = v, g.ymax = m, g.xref = s, g.yref = u, g.subtract = Jb(g, T), T.push(g), r.push(g); } } } } return r; } function Jb(e10, t) { for (var r = false, n = 0; n < t.length; n++) for (var a = t[n], i = 0; i < e10.length; i++) if (gQ(e10[i], a)) { r = !r; break; } return r; } function Xo(e10, t) { return e10.type === "date" && (t = t.replace("_", " ")), e10.type === "log" ? e10.c2p(t) : e10.r2p(t, null, e10.calendar); } function cE(e10) { for (var t = e10.length, r = [], n = 0; n < t; n++) { var a = e10[n]; r = r.concat(a), r = r.concat([a[0]]); } return qQ(r); } function qQ(e10) { return e10.isRect = e10.length === 5 && e10[0][0] === e10[4][0] && e10[0][1] === e10[4][1] && e10[0][0] === e10[1][0] && e10[2][0] === e10[3][0] && e10[0][1] === e10[3][1] && e10[1][1] === e10[2][1] || e10[0][1] === e10[1][1] && e10[2][1] === e10[3][1] && e10[0][0] === e10[3][0] && e10[1][0] === e10[2][0], e10.isRect && (e10.xmin = Math.min(e10[0][0], e10[2][0]), e10.xmax = Math.max(e10[0][0], e10[2][0]), e10.ymin = Math.min(e10[0][1], e10[2][1]), e10.ymax = Math.max(e10[0][1], e10[2][1])), e10; } function dE(e10) { return function(t, r) { for (var n, a, i = 0; i < e10.length; i++) { var o = e10[i], l = o._id, s = l.charAt(0); if (r.isRect) { n || (n = {}); var u = r[s + "min"], f = r[s + "max"]; u !== void 0 && f !== void 0 && (n[l] = [ Qk(o, u), Qk(o, f) ].sort(SQ)); } else a || (a = {}), a[l] = r.map(EQ(o)); } n && (t.range = n), a && (t.lassoPoints = a); }; } function WQ(e10) { var t = e10.plotinfo; return t.fillRangeItems || // allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine dE(e10.xaxes.concat(e10.yaxes)); } function ZQ(e10, t) { e10.emit("plotly_selecting", t); } function Ec(e10, t) { t && (t.selections = (e10.layout || {}).selections || []), e10.emit("plotly_selected", t); } function Qb(e10) { e10.emit("plotly_deselect", null); } var YQ = { reselect: Oy, prepSelect: RQ, clearOutline: tE, clearSelectionsCache: Lc, selectOnClick: aE }; var hE = [ // no arrow { path: "", backoff: 0 }, // wide with flat back { path: "M-2.4,-3V3L0.6,0Z", backoff: 0.6 }, // narrower with flat back { path: "M-3.7,-2.5V2.5L1.3,0Z", backoff: 1.3 }, // barbed { path: "M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z", backoff: 1.55 }, // wide line-drawn { path: "M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z", backoff: 1.6 }, // narrower line-drawn { path: "M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z", backoff: 2 }, // circle { path: "M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z", backoff: 0, noRotate: true }, // square { path: "M2,2V-2H-2V2Z", backoff: 0, noRotate: true } ]; var Vp = { axisRefDescription: function(e10, t, r) { return [ "If set to a", e10, "axis id (e.g. *" + e10 + "* or", "*" + e10 + "2*), the `" + e10 + "` position refers to a", e10, "coordinate. If set to *paper*, the `" + e10 + "`", "position refers to the distance from the", t, "of the plotting", "area in normalized coordinates where *0* (*1*) corresponds to the", t, "(" + r + "). If set to a", e10, "axis ID followed by", "*domain* (separated by a space), the position behaves like for", "*paper*, but refers to the distance in fractions of the domain", "length from the", t, "of the domain of that axis: e.g.,", "*" + e10 + "2 domain* refers to the domain of the second", e10, " axis and a", e10, "position of 0.5 refers to the", "point between the", t, "and the", r, "of the domain of the", "second", e10, "axis." ].join(" "); } }; var nA = hE; var aA = Fn; var uh = Yn; var XQ = Mr.templatedArray; var fh = Vp; function iA(e10) { return [ "In order for absolute positioning of the arrow to work, *a" + e10 + "ref* must be exactly the same as *" + e10 + "ref*, otherwise *a" + e10 + "ref* will revert to *pixel* (explained next).", "For relative positioning, *a" + e10 + "ref* can be set to *pixel*,", "in which case the *a" + e10 + "* value is specified in pixels", "relative to *" + e10 + "*.", "Absolute positioning is useful", "for trendline annotations which should continue to indicate", "the correct trend when zoomed. Relative positioning is useful", "for specifying the text offset for an annotated point." ].join(" "); } function oA(e10, t, r) { return [ "Sets the", e10, "component of the arrow tail about the arrow head.", "If `a" + e10 + "ref` is `pixel`, a positive (negative)", "component corresponds to an arrow pointing", "from", r, "to", t, "(" + t, "to", r + ").", "If `a" + e10 + "ref` is not `pixel` and is exactly the same as `" + e10 + "ref`,", "this is an absolute value on that axis,", "like `" + e10 + "`, specified in the same coordinates as `" + e10 + "ref`." ].join(" "); } var td = XQ("annotation", { visible: { valType: "boolean", dflt: true, editType: "calc+arraydraw", description: [ "Determines whether or not this annotation is visible." ].join(" ") }, text: { valType: "string", editType: "calc+arraydraw", description: [ "Sets the text associated with this annotation.", "Plotly uses a subset of HTML tags to do things like", "newline (
), bold (), italics (),", "hyperlinks (). Tags , , ", " are also supported." ].join(" ") }, textangle: { valType: "angle", dflt: 0, editType: "calc+arraydraw", description: [ "Sets the angle at which the `text` is drawn", "with respect to the horizontal." ].join(" ") }, font: aA({ editType: "calc+arraydraw", colorEditType: "arraydraw", description: "Sets the annotation text font." }), width: { valType: "number", min: 1, dflt: null, editType: "calc+arraydraw", description: [ "Sets an explicit width for the text box. null (default) lets the", "text set the box width. Wider text will be clipped.", "There is no automatic wrapping; use
to start a new line." ].join(" ") }, height: { valType: "number", min: 1, dflt: null, editType: "calc+arraydraw", description: [ "Sets an explicit height for the text box. null (default) lets the", "text set the box height. Taller text will be clipped." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the annotation (text + arrow)." }, align: { valType: "enumerated", values: ["left", "center", "right"], dflt: "center", editType: "arraydraw", description: [ "Sets the horizontal alignment of the `text` within the box.", "Has an effect only if `text` spans two or more lines", "(i.e. `text` contains one or more
HTML tags) or if an", "explicit width is set to override the text width." ].join(" ") }, valign: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "middle", editType: "arraydraw", description: [ "Sets the vertical alignment of the `text` within the box.", "Has an effect only if an explicit height is set to override", "the text height." ].join(" ") }, bgcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: "Sets the background color of the annotation." }, bordercolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: [ "Sets the color of the border enclosing the annotation `text`." ].join(" ") }, borderpad: { valType: "number", min: 0, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the padding (in px) between the `text`", "and the enclosing border." ].join(" ") }, borderwidth: { valType: "number", min: 0, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the width (in px) of the border enclosing", "the annotation `text`." ].join(" ") }, // arrow showarrow: { valType: "boolean", dflt: true, editType: "calc+arraydraw", description: [ "Determines whether or not the annotation is drawn with an arrow.", "If *true*, `text` is placed near the arrow's tail.", "If *false*, `text` lines up with the `x` and `y` provided." ].join(" ") }, arrowcolor: { valType: "color", editType: "arraydraw", description: "Sets the color of the annotation arrow." }, arrowhead: { valType: "integer", min: 0, max: nA.length, dflt: 1, editType: "arraydraw", description: "Sets the end annotation arrow head style." }, startarrowhead: { valType: "integer", min: 0, max: nA.length, dflt: 1, editType: "arraydraw", description: "Sets the start annotation arrow head style." }, arrowside: { valType: "flaglist", flags: ["end", "start"], extras: ["none"], dflt: "end", editType: "arraydraw", description: "Sets the annotation arrow head position." }, arrowsize: { valType: "number", min: 0.3, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the size of the end annotation arrow head, relative to `arrowwidth`.", "A value of 1 (default) gives a head about 3x as wide as the line." ].join(" ") }, startarrowsize: { valType: "number", min: 0.3, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the size of the start annotation arrow head, relative to `arrowwidth`.", "A value of 1 (default) gives a head about 3x as wide as the line." ].join(" ") }, arrowwidth: { valType: "number", min: 0.1, editType: "calc+arraydraw", description: "Sets the width (in px) of annotation arrow line." }, standoff: { valType: "number", min: 0, dflt: 0, editType: "calc+arraydraw", description: [ "Sets a distance, in pixels, to move the end arrowhead away from the", "position it is pointing at, for example to point at the edge of", "a marker independent of zoom. Note that this shortens the arrow", "from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`", "which moves everything by this amount." ].join(" ") }, startstandoff: { valType: "number", min: 0, dflt: 0, editType: "calc+arraydraw", description: [ "Sets a distance, in pixels, to move the start arrowhead away from the", "position it is pointing at, for example to point at the edge of", "a marker independent of zoom. Note that this shortens the arrow", "from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`", "which moves everything by this amount." ].join(" ") }, ax: { valType: "any", editType: "calc+arraydraw", description: [ oA("x", "left", "right") ].join(" ") }, ay: { valType: "any", editType: "calc+arraydraw", description: [ oA("y", "top", "bottom") ].join(" ") }, axref: { valType: "enumerated", dflt: "pixel", values: [ "pixel", uh.idRegex.x.toString() ], editType: "calc", description: [ "Indicates in what coordinates the tail of the", "annotation (ax,ay) is specified.", fh.axisRefDescription("x", "left", "right"), iA("x") ].join(" ") }, ayref: { valType: "enumerated", dflt: "pixel", values: [ "pixel", uh.idRegex.y.toString() ], editType: "calc", description: [ "Indicates in what coordinates the tail of the", "annotation (ax,ay) is specified.", fh.axisRefDescription("y", "bottom", "top"), iA("y") ].join(" ") }, // positioning xref: { valType: "enumerated", values: [ "paper", uh.idRegex.x.toString() ], editType: "calc", description: [ "Sets the annotation's x coordinate axis.", fh.axisRefDescription("x", "left", "right") ].join(" ") }, x: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the annotation's x position.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the text box's horizontal position anchor", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the annotation.", "For example, if `x` is set to 1, `xref` to *paper* and", "`xanchor` to *right* then the right-most portion of the", "annotation lines up with the right-most edge of the", "plotting area.", "If *auto*, the anchor is equivalent to *center* for", "data-referenced annotations or if there is an arrow,", "whereas for paper-referenced with no arrow, the anchor picked", "corresponds to the closest side." ].join(" ") }, xshift: { valType: "number", dflt: 0, editType: "calc+arraydraw", description: [ "Shifts the position of the whole annotation and arrow to the", "right (positive) or left (negative) by this many pixels." ].join(" ") }, yref: { valType: "enumerated", values: [ "paper", uh.idRegex.y.toString() ], editType: "calc", description: [ "Sets the annotation's y coordinate axis.", fh.axisRefDescription("y", "bottom", "top") ].join(" ") }, y: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the annotation's y position.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the text box's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the annotation.", "For example, if `y` is set to 1, `yref` to *paper* and", "`yanchor` to *top* then the top-most portion of the", "annotation lines up with the top-most edge of the", "plotting area.", "If *auto*, the anchor is equivalent to *middle* for", "data-referenced annotations or if there is an arrow,", "whereas for paper-referenced with no arrow, the anchor picked", "corresponds to the closest side." ].join(" ") }, yshift: { valType: "number", dflt: 0, editType: "calc+arraydraw", description: [ "Shifts the position of the whole annotation and arrow up", "(positive) or down (negative) by this many pixels." ].join(" ") }, clicktoshow: { valType: "enumerated", values: [false, "onoff", "onout"], dflt: false, editType: "arraydraw", description: [ "Makes this annotation respond to clicks on the plot.", "If you click a data point that exactly matches the `x` and `y`", "values of this annotation, and it is hidden (visible: false),", "it will appear. In *onoff* mode, you must click the same point", "again to make it disappear, so if you click multiple points,", "you can show multiple annotations. In *onout* mode, a click", "anywhere else in the plot (on another data point or not) will", "hide this annotation.", "If you need to show/hide this annotation in response to different", "`x` or `y` values, you can set `xclick` and/or `yclick`. This is", "useful for example to label the side of a bar. To label markers", "though, `standoff` is preferred over `xclick` and `yclick`." ].join(" ") }, xclick: { valType: "any", editType: "arraydraw", description: [ "Toggle this annotation when clicking a data point whose `x` value", "is `xclick` rather than the annotation's `x` value." ].join(" ") }, yclick: { valType: "any", editType: "arraydraw", description: [ "Toggle this annotation when clicking a data point whose `y` value", "is `yclick` rather than the annotation's `y` value." ].join(" ") }, hovertext: { valType: "string", editType: "arraydraw", description: [ "Sets text to appear when hovering over this annotation.", "If omitted or blank, no hover label will appear." ].join(" ") }, hoverlabel: { bgcolor: { valType: "color", editType: "arraydraw", description: [ "Sets the background color of the hover label.", "By default uses the annotation's `bgcolor` made opaque,", "or white if it was transparent." ].join(" ") }, bordercolor: { valType: "color", editType: "arraydraw", description: [ "Sets the border color of the hover label.", "By default uses either dark grey or white, for maximum", "contrast with `hoverlabel.bgcolor`." ].join(" ") }, font: aA({ editType: "arraydraw", description: [ "Sets the hover label text font.", "By default uses the global hover font and size,", "with color from `hoverlabel.bordercolor`." ].join(" ") }), editType: "arraydraw" }, captureevents: { valType: "boolean", editType: "arraydraw", description: [ "Determines whether the annotation text box captures mouse move", "and click events, or allows those events to pass through to data", "points in the plot that may be behind the annotation. By default", "`captureevents` is *false* unless `hovertext` is provided.", "If you use the event `plotly_clickannotation` without `hovertext`", "you must explicitly enable `captureevents`." ].join(" ") }, editType: "calc", _deprecated: { ref: { valType: "string", editType: "calc", description: [ "Obsolete. Set `xref` and `yref` separately instead." ].join(" ") } } }); var e_ = { PTS_LINESONLY: 20, // fixed parameters of clustering and clipping algorithms // fraction of clustering tolerance "so close we don't even consider it a new point" minTolerance: 0.2, // how fast does clustering tolerance increase as you get away from the visible region toleranceGrowth: 10, // number of viewport sizes away from the visible region // at which we clip all lines to the perimeter maxScreensAway: 20, eventDataKeys: [] }; var lA = kp.axisHoverFormat; var KQ = _i.texttemplateAttrs; var JQ = _i.hovertemplateAttrs; var sA = Jc; var QQ = Fn; var eee = Zi.dash; var tee = Zi.pattern; var ree = Sr; var uA = e_; var Ng = en.extendFlat; function fA(e10) { return { valType: "any", dflt: 0, editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the period positioning in milliseconds or *M* on the " + e10 + " axis.", "Special values in the form of *M* could be used to declare", "the number of months. In this case `n` must be a positive integer." ].join(" ") }; } function cA(e10) { return { valType: "any", editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the base for period positioning in milliseconds or date string on the " + e10 + " axis.", "When `" + e10 + "period` is round number of weeks,", "the `" + e10 + "period0` by default would be on a Sunday i.e. 2000-01-02,", "otherwise it would be at 2000-01-01." ].join(" ") }; } function dA(e10) { return { valType: "enumerated", values: [ "start", "middle", "end" ], dflt: "middle", editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the alignment of data points on the " + e10 + " axis." ].join(" ") }; } var ws = { x: { valType: "data_array", editType: "calc+clearAxisTypes", anim: true, description: "Sets the x coordinates." }, x0: { valType: "any", dflt: 0, editType: "calc+clearAxisTypes", anim: true, description: [ "Alternate to `x`.", "Builds a linear space of x coordinates.", "Use with `dx`", "where `x0` is the starting coordinate and `dx` the step." ].join(" ") }, dx: { valType: "number", dflt: 1, editType: "calc", anim: true, description: [ "Sets the x coordinate step.", "See `x0` for more info." ].join(" ") }, y: { valType: "data_array", editType: "calc+clearAxisTypes", anim: true, description: "Sets the y coordinates." }, y0: { valType: "any", dflt: 0, editType: "calc+clearAxisTypes", anim: true, description: [ "Alternate to `y`.", "Builds a linear space of y coordinates.", "Use with `dy`", "where `y0` is the starting coordinate and `dy` the step." ].join(" ") }, dy: { valType: "number", dflt: 1, editType: "calc", anim: true, description: [ "Sets the y coordinate step.", "See `y0` for more info." ].join(" ") }, xperiod: fA("x"), yperiod: fA("y"), xperiod0: cA("x0"), yperiod0: cA("y0"), xperiodalignment: dA("x"), yperiodalignment: dA("y"), xhoverformat: lA("x"), yhoverformat: lA("y"), offsetgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several traces linked to the same position axis", "or matching axes to the same", "offsetgroup where bars of the same position coordinate will line up." ].join(" ") }, alignmentgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several traces linked to the same position axis", "or matching axes to the same", "alignmentgroup. This controls whether bars compute their positional", "range dependently or independently." ].join(" ") }, stackgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several scatter traces (on the same subplot) to the same", "stackgroup in order to add their y values (or their x values if", "`orientation` is *h*). If blank or omitted this trace will not be", "stacked. Stacking also turns `fill` on by default, using *tonexty*", "(*tonextx*) if `orientation` is *h* (*v*) and sets the default", "`mode` to *lines* irrespective of point count.", "You can only stack on a numeric (linear or log) axis.", "Traces in a `stackgroup` will only fill to (or be filled to) other", "traces in the same group. With multiple `stackgroup`s or some", "traces stacked and some not, if fill-linked traces are not already", "consecutive, the later ones will be pushed down in the drawing order." ].join(" ") }, orientation: { valType: "enumerated", values: ["v", "h"], editType: "calc", description: [ "Only relevant in the following cases:", "1. when `scattermode` is set to *group*.", "2. when `stackgroup` is used, and only the first", "`orientation` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`. Sets the", "stacking direction. With *v* (*h*), the y (x) values of subsequent", "traces are added. Also affects the default value of `fill`." ].join(" ") }, groupnorm: { valType: "enumerated", values: ["", "fraction", "percent"], dflt: "", editType: "calc", description: [ "Only relevant when `stackgroup` is used, and only the first", "`groupnorm` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`.", "Sets the normalization for the sum of this `stackgroup`.", "With *fraction*, the value of each trace at each location is", "divided by the sum of all trace values at that location.", "*percent* is the same but multiplied by 100 to show percentages.", "If there are multiple subplots, or multiple `stackgroup`s on one", "subplot, each will be normalized within its own set." ].join(" ") }, stackgaps: { valType: "enumerated", values: ["infer zero", "interpolate"], dflt: "infer zero", editType: "calc", description: [ "Only relevant when `stackgroup` is used, and only the first", "`stackgaps` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`.", "Determines how we handle locations at which other traces in this", "group have data but this one does not.", "With *infer zero* we insert a zero at these locations.", "With *interpolate* we linearly interpolate between existing", "values, and extrapolate a constant beyond the existing values." // TODO - implement interrupt mode // '*interrupt* omits this trace from the stack at this location by', // 'dropping abruptly, midway between the existing and missing locations.' ].join(" ") }, text: { valType: "string", dflt: "", arrayOk: true, editType: "calc", description: [ "Sets text elements associated with each (x,y) pair.", "If a single string, the same string appears over", "all the data points.", "If an array of string, the items are mapped in order to the", "this trace's (x,y) coordinates.", "If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,", "these elements will be seen in the hover labels." ].join(" ") }, texttemplate: KQ({}, {}), hovertext: { valType: "string", dflt: "", arrayOk: true, editType: "style", description: [ "Sets hover text elements associated with each (x,y) pair.", "If a single string, the same string appears over", "all the data points.", "If an array of string, the items are mapped in order to the", "this trace's (x,y) coordinates.", "To be seen, trace `hoverinfo` must contain a *text* flag." ].join(" ") }, mode: { valType: "flaglist", flags: ["lines", "markers", "text"], extras: ["none"], editType: "calc", description: [ "Determines the drawing mode for this scatter trace.", "If the provided `mode` includes *text* then the `text` elements", "appear at the coordinates. Otherwise, the `text` elements", "appear on hover.", "If there are less than " + uA.PTS_LINESONLY + " points", "and the trace is not stacked", "then the default is *lines+markers*. Otherwise, *lines*." ].join(" ") }, hoveron: { valType: "flaglist", flags: ["points", "fills"], editType: "style", description: [ "Do the hover effects highlight individual points (markers or", "line points) or do they highlight filled regions?", "If the fill is *toself* or *tonext* and there are no markers", "or text, then the default is *fills*, otherwise it is *points*." ].join(" ") }, hovertemplate: JQ({}, { keys: uA.eventDataKeys }), line: { color: { valType: "color", editType: "style", anim: true, description: "Sets the line color." }, width: { valType: "number", min: 0, dflt: 2, editType: "style", anim: true, description: "Sets the line width (in px)." }, shape: { valType: "enumerated", values: ["linear", "spline", "hv", "vh", "hvh", "vhv"], dflt: "linear", editType: "plot", description: [ "Determines the line shape.", "With *spline* the lines are drawn using spline interpolation.", "The other available values correspond to step-wise line shapes." ].join(" ") }, smoothing: { valType: "number", min: 0, max: 1.3, dflt: 1, editType: "plot", description: [ "Has an effect only if `shape` is set to *spline*", "Sets the amount of smoothing.", "*0* corresponds to no smoothing (equivalent to a *linear* shape)." ].join(" ") }, dash: Ng({}, eee, { editType: "style" }), backoff: { // we want to have a similar option for the start of the line valType: "number", min: 0, dflt: "auto", arrayOk: true, editType: "plot", description: [ "Sets the line back off from the end point of the nth line segment (in px).", "This option is useful e.g. to avoid overlap with arrowhead markers.", "With *auto* the lines would trim before markers if `marker.angleref` is set to *previous*." ].join(" ") }, simplify: { valType: "boolean", dflt: true, editType: "plot", description: [ "Simplifies lines by removing nearly-collinear points. When transitioning", "lines, it may be desirable to disable this so that the number of points", "along the resulting SVG path is unaffected." ].join(" ") }, editType: "plot" }, connectgaps: { valType: "boolean", dflt: false, editType: "calc", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the provided data arrays are connected." ].join(" ") }, cliponaxis: { valType: "boolean", dflt: true, editType: "plot", description: [ "Determines whether or not markers and text nodes", "are clipped about the subplot axes.", "To show markers and text nodes above axis lines and tick labels,", "make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*." ].join(" ") }, fill: { valType: "enumerated", values: ["none", "tozeroy", "tozerox", "tonexty", "tonextx", "toself", "tonext"], editType: "calc", description: [ "Sets the area to fill with a solid color.", "Defaults to *none* unless this trace is stacked, then it gets", "*tonexty* (*tonextx*) if `orientation` is *v* (*h*)", "Use with `fillcolor` if not *none*.", "*tozerox* and *tozeroy* fill to x=0 and y=0 respectively.", "*tonextx* and *tonexty* fill between the endpoints of this", "trace and the endpoints of the trace before it, connecting those", "endpoints with straight lines (to make a stacked area graph);", "if there is no trace before it, they behave like *tozerox* and", "*tozeroy*.", "*toself* connects the endpoints of the trace (or each segment", "of the trace if it has gaps) into a closed shape.", "*tonext* fills the space between two traces if one completely", "encloses the other (eg consecutive contour lines), and behaves like", "*toself* if there is no trace before it. *tonext* should not be", "used if one trace does not enclose the other.", "Traces in a `stackgroup` will only fill to (or be filled to) other", "traces in the same group. With multiple `stackgroup`s or some", "traces stacked and some not, if fill-linked traces are not already", "consecutive, the later ones will be pushed down in the drawing order." ].join(" ") }, fillcolor: { valType: "color", editType: "style", anim: true, description: [ "Sets the fill color.", "Defaults to a half-transparent variant of the line color,", "marker color, or marker line color, whichever is available." ].join(" ") }, fillpattern: tee, marker: Ng( { symbol: { valType: "enumerated", values: ree.symbolList, dflt: "circle", arrayOk: true, editType: "style", description: [ "Sets the marker symbol type.", "Adding 100 is equivalent to appending *-open* to a symbol name.", "Adding 200 is equivalent to appending *-dot* to a symbol name.", "Adding 300 is equivalent to appending *-open-dot*", "or *dot-open* to a symbol name." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, arrayOk: true, editType: "style", anim: true, description: "Sets the marker opacity." }, angle: { valType: "angle", dflt: 0, arrayOk: true, editType: "plot", anim: false, // TODO: possibly set to true in future description: [ "Sets the marker angle in respect to `angleref`." ].join(" ") }, angleref: { valType: "enumerated", values: ["previous", "up"], dflt: "up", editType: "plot", anim: false, description: [ "Sets the reference for marker angle.", "With *previous*, angle 0 points along the line from the previous point to this one.", "With *up*, angle 0 points toward the top of the screen." ].join(" ") }, standoff: { valType: "number", min: 0, dflt: 0, arrayOk: true, editType: "plot", anim: true, description: [ "Moves the marker away from the data point in the direction of `angle` (in px).", "This can be useful for example if you have another marker at this", "location and you want to point an arrowhead marker at it." ].join(" ") }, size: { valType: "number", min: 0, dflt: 6, arrayOk: true, editType: "calc", anim: true, description: "Sets the marker size (in px)." }, maxdisplayed: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets a maximum number of points to be drawn on the graph.", "*0* corresponds to no limit." ].join(" ") }, sizeref: { valType: "number", dflt: 1, editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the scale factor used to determine the rendered size of", "marker points. Use with `sizemin` and `sizemode`." ].join(" ") }, sizemin: { valType: "number", min: 0, dflt: 0, editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the minimum size (in px) of the rendered marker points." ].join(" ") }, sizemode: { valType: "enumerated", values: ["diameter", "area"], dflt: "diameter", editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the rule for which the data in `size` is converted", "to pixels." ].join(" ") }, line: Ng( { width: { valType: "number", min: 0, arrayOk: true, editType: "style", anim: true, description: "Sets the width (in px) of the lines bounding the marker points." }, editType: "calc" }, sA("marker.line", { anim: true }) ), gradient: { type: { valType: "enumerated", values: ["radial", "horizontal", "vertical", "none"], arrayOk: true, dflt: "none", editType: "calc", description: [ "Sets the type of gradient used to fill the markers" ].join(" ") }, color: { valType: "color", arrayOk: true, editType: "calc", description: [ "Sets the final color of the gradient fill:", "the center color for radial, the right for horizontal,", "or the bottom for vertical." ].join(" ") }, editType: "calc" }, editType: "calc" }, sA("marker", { anim: true }) ), selected: { marker: { opacity: { valType: "number", min: 0, max: 1, editType: "style", description: "Sets the marker opacity of selected points." }, color: { valType: "color", editType: "style", description: "Sets the marker color of selected points." }, size: { valType: "number", min: 0, editType: "style", description: "Sets the marker size of selected points." }, editType: "style" }, textfont: { color: { valType: "color", editType: "style", description: "Sets the text font color of selected points." }, editType: "style" }, editType: "style" }, unselected: { marker: { opacity: { valType: "number", min: 0, max: 1, editType: "style", description: "Sets the marker opacity of unselected points, applied only when a selection exists." }, color: { valType: "color", editType: "style", description: "Sets the marker color of unselected points, applied only when a selection exists." }, size: { valType: "number", min: 0, editType: "style", description: "Sets the marker size of unselected points, applied only when a selection exists." }, editType: "style" }, textfont: { color: { valType: "color", editType: "style", description: "Sets the text font color of unselected points, applied only when a selection exists." }, editType: "style" }, editType: "style" }, textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right" ], dflt: "middle center", arrayOk: true, editType: "calc", description: [ "Sets the positions of the `text` elements", "with respects to the (x,y) coordinates." ].join(" ") }, textfont: QQ({ editType: "calc", colorEditType: "style", arrayOk: true, description: "Sets the text font." }) }; var hA = td; var vA = ws.line; var nee = Zi.dash; var ch = en.extendFlat; var aee = Lo.overrideAll; var iee = Mr.templatedArray; var pA = Vp; var vE = aee(iee("selection", { type: { valType: "enumerated", values: ["rect", "path"], description: [ "Specifies the selection type to be drawn.", "If *rect*, a rectangle is drawn linking", "(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`) and (`x0`,`y1`).", "If *path*, draw a custom SVG path using `path`." ].join(" ") }, xref: ch({}, hA.xref, { description: [ "Sets the selection's x coordinate axis.", pA.axisRefDescription("x", "left", "right") ].join(" ") }), yref: ch({}, hA.yref, { description: [ "Sets the selection's x coordinate axis.", pA.axisRefDescription("y", "bottom", "top") ].join(" ") }), x0: { valType: "any", description: "Sets the selection's starting x position." }, x1: { valType: "any", description: "Sets the selection's end x position." }, y0: { valType: "any", description: "Sets the selection's starting y position." }, y1: { valType: "any", description: "Sets the selection's end y position." }, path: { valType: "string", editType: "arraydraw", description: [ "For `type` *path* - a valid SVG path similar to `shapes.path` in data coordinates.", "Allowed segments are: M, L and Z." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.7, editType: "arraydraw", description: "Sets the opacity of the selection." }, line: { color: vA.color, width: ch({}, vA.width, { min: 1, dflt: 1 }), dash: ch({}, nee, { dflt: "dot" }) } }), "arraydraw", "from-root"); var mA = Ue; var dh = Cr; var oee = Ji; var lee = vE; var gA = xl; var see = function(t, r) { oee(t, r, { name: "selections", handleItemDefaults: uee }); for (var n = r.selections, a = 0; a < n.length; a++) { var i = n[a]; i && i.path === void 0 && (i.x0 === void 0 || i.x1 === void 0 || i.y0 === void 0 || i.y1 === void 0) && (r.selections[a] = null); } }; function uee(e10, t, r) { function n(T, S) { return mA.coerce(e10, t, lee, T, S); } var a = n("path"), i = a ? "path" : "rect", o = n("type", i), l = o !== "path"; l && delete t.path, n("opacity"), n("line.color"), n("line.width"), n("line.dash"); for (var s = ["x", "y"], u = 0; u < 2; u++) { var f = s[u], d = { _fullLayout: r }, h, p, v, m = dh.coerceRef(e10, t, d, f); if (h = dh.getFromId(d, m), h._selectionIndices.push(t._index), v = gA.rangeToShapePosition(h), p = gA.shapePositionToRange(h), l) { var g = f + "0", y = f + "1", w = e10[g], k = e10[y]; e10[g] = p(e10[g], true), e10[y] = p(e10[y], true), dh.coercePosition(t, d, n, m, g), dh.coercePosition(t, d, n, m, y); var x = t[g], _ = t[y]; x !== void 0 && _ !== void 0 && (t[g] = v(x), t[y] = v(_), e10[g] = w, e10[y] = k); } } l && mA.noneOrAll(e10, t, ["x0", "x1", "y0", "y1"]); } var fee = function(t, r, n) { n("newselection.mode"); var a = n("newselection.line.width"); a && (n("newselection.line.color"), n("newselection.line.dash")), n("activeselection.fillcolor"), n("activeselection.opacity"); }; var cee = Nt; var yA = Ue; var bA = gn; var qp = function(t) { return function(n, a) { var i = n[t]; if (Array.isArray(i)) for (var o = cee.subplotsRegistry.cartesian, l = o.idRegex, s = a._subplots, u = s.xaxis, f = s.yaxis, d = s.cartesian, h = a._has("cartesian") || a._has("gl2d"), p = 0; p < i.length; p++) { var v = i[p]; if (yA.isPlainObject(v)) { var m = bA.cleanId(v.xref, "x", false), g = bA.cleanId(v.yref, "y", false), y = l.x.test(m), w = l.y.test(g); if (y || w) { h || yA.pushUnique(a._basePlotModules, o); var k = false; y && u.indexOf(m) === -1 && (u.push(m), k = true), w && f.indexOf(g) === -1 && (f.push(g), k = true), k && y && w && d.push(m + g); } } } }; }; var _A = XD; var Nf = YQ; var rd = { moduleType: "component", name: "selections", layoutAttributes: vE, supplyLayoutDefaults: see, supplyDrawNewSelectionDefaults: fee, includeBasePlot: qp("selections"), draw: _A.draw, drawOne: _A.drawOne, reselect: Nf.reselect, prepSelect: Nf.prepSelect, clearOutline: Nf.clearOutline, clearSelectionsCache: Nf.clearSelectionsCache, selectOnClick: Nf.selectOnClick }; var t_ = lr; var Ha = Ue; var xA = Ha.numberFormat; var dee = bi; var hee = K4; var hh = Nt; var pE = Ha.strTranslate; var vee = Rn; var wA = nr; var Go = Sr; var pee = Ao; var TA = Cr; var mee = xs; var gee = Qi; var mE = rf; var vh = mE.selectingOrDrawing; var yee = mE.freeMode; var bee = On.FROM_TL; var _ee = Eb; var xee = zp.redrawReglTraces; var wee = Tn; var Hy = gn.getFromId; var Tee = rd.prepSelect; var kee = rd.clearOutline; var Aee = rd.selectOnClick; var Og = VD; var r_ = Yn; var kA = r_.MINDRAG; var Vn = r_.MINZOOM; var AA = true; function Mee(e10, t, r, n, a, i, o, l) { var s = e10._fullLayout._zoomlayer, u = o + l === "nsew", f = (o + l).length === 1, d, h, p, v, m, g, y, w, k, x, _, T, S, M, L, F, $, I, O, G, K, V, z; r += t.yaxis._shift; function P() { if (d = t.xaxis, h = t.yaxis, k = d._length, x = h._length, y = d._offset, w = h._offset, p = {}, p[d._id] = d, v = {}, v[h._id] = h, o && l) for (var Pe = t.overlays, Ie = 0; Ie < Pe.length; Ie++) { var Ne = Pe[Ie].xaxis; p[Ne._id] = Ne; var tt = Pe[Ie].yaxis; v[tt._id] = tt; } m = LA(p), g = LA(v), S = MA(m, l), M = MA(g, o), L = !M && !S, T = CA(e10, e10._fullLayout._axisMatchGroups, p, v), _ = CA(e10, e10._fullLayout._axisConstraintGroups, p, v, T); var Je = _.isSubplotConstrained || T.isSubplotConstrained; F = l || Je, $ = o || Je; var it = e10._fullLayout; I = it._has("scattergl"), O = it._has("splom"), G = it._has("svg"); } P(); var R = Lee(M + S, e10._fullLayout.dragmode, u), H = yE(t, o + l + "drag", R, r, n, a, i); if (L && !u) return H.onmousedown = null, H.style.pointerEvents = "none", H; var B = { element: H, gd: e10, plotinfo: t }; B.prepFn = function(Pe, Ie, Ne) { var tt = B.dragmode, Je = e10._fullLayout.dragmode; Je !== tt && (B.dragmode = Je), P(), V = e10._fullLayout._invScaleX, z = e10._fullLayout._invScaleY, L || (u ? Pe.shiftKey ? Je === "pan" ? Je = "zoom" : vh(Je) || (Je = "pan") : Pe.ctrlKey && (Je = "pan") : Je = "pan"), yee(Je) ? B.minDrag = 1 : B.minDrag = void 0, vh(Je) ? (B.xaxes = m, B.yaxes = g, Tee(Pe, Ie, Ne, B, Je)) : (B.clickFn = ee, vh(tt) && W(), L || (Je === "zoom" ? (B.moveFn = ve, B.doneFn = Le, B.minDrag = 1, ge(Pe, Ie, Ne)) : Je === "pan" && (B.moveFn = Me, B.doneFn = ot))), e10._fullLayout._redrag = function() { var it = e10._dragdata; if (it && it.element === H) { var at = e10._fullLayout.dragmode; vh(at) || (P(), ht([0, 0, k, x]), B.moveFn(it.dx, it.dy)); } }; }; function W() { B.plotinfo.selection = false, kee(e10); } function ee(Pe, Ie) { var Ne = B.gd; if (Ne._fullLayout._activeShapeIndex >= 0) { Ne._fullLayout._deactivateShape(Ne); return; } var tt = Ne._fullLayout.clickmode; if (jy(Ne), Pe === 2 && !f && Qe(), u) tt.indexOf("select") > -1 && Aee(Ie, Ne, m, g, t.id, B), tt.indexOf("event") > -1 && pee.click(Ne, Ie, t.id); else if (Pe === 1 && f) { var Je = o ? h : d, it = o === "s" || l === "w" ? 0 : 1, at = Je._name + ".range[" + it + "]", Tt = See(Je, it), gt = "left", He = "middle"; if (Je.fixedrange) return; o ? (He = o === "n" ? "top" : "bottom", Je.side === "right" && (gt = "right")) : l === "e" && (gt = "right"), Ne._context.showAxisRangeEntryBoxes && t_.select(H).call(vee.makeEditable, { gd: Ne, immediate: true, background: Ne._fullLayout.paper_bgcolor, text: String(Tt), fill: Je.tickfont ? Je.tickfont.color : "#444", horizontalAlign: gt, verticalAlign: He }).on("edit", function(pt) { var bt = Je.d2r(pt); bt !== void 0 && hh.call("_guiRelayout", Ne, at, bt); }); } } gee.init(B); var re, ae, Q, ue, j, U, Z, le, J, pe; function ge(Pe, Ie, Ne) { var tt = H.getBoundingClientRect(); re = Ie - tt.left, ae = Ne - tt.top, e10._fullLayout._calcInverseTransform(e10); var Je = Ha.apply3DTransform(e10._fullLayout._invTransform)(re, ae); re = Je[0], ae = Je[1], Q = { l: re, r: re, w: 0, t: ae, b: ae, h: 0 }, ue = e10._hmpixcount ? e10._hmlumcount / e10._hmpixcount : dee(e10._fullLayout.plot_bgcolor).getLuminance(), j = "M0,0H" + k + "V" + x + "H0V0", U = false, Z = "xy", pe = false, le = bE(s, ue, y, w, j), J = _E(s, y, w); } function ve(Pe, Ie) { if (e10._transitioningWithDuration) return false; var Ne = Math.max(0, Math.min(k, V * Pe + re)), tt = Math.max(0, Math.min(x, z * Ie + ae)), Je = Math.abs(Ne - re), it = Math.abs(tt - ae); Q.l = Math.min(re, Ne), Q.r = Math.max(re, Ne), Q.t = Math.min(ae, tt), Q.b = Math.max(ae, tt); function at() { Z = "", Q.r = Q.l, Q.t = Q.b, J.attr("d", "M0,0Z"); } if (_.isSubplotConstrained) Je > Vn || it > Vn ? (Z = "xy", Je / k > it / x ? (it = Je * x / k, ae > tt ? Q.t = ae - it : Q.b = ae + it) : (Je = it * k / x, re > Ne ? Q.l = re - Je : Q.r = re + Je), J.attr("d", Uh(Q))) : at(); else if (T.isSubplotConstrained) if (Je > Vn || it > Vn) { Z = "xy"; var Tt = Math.min(Q.l / k, (x - Q.b) / x), gt = Math.max(Q.r / k, (x - Q.t) / x); Q.l = Tt * k, Q.r = gt * k, Q.b = (1 - Tt) * x, Q.t = (1 - gt) * x, J.attr("d", Uh(Q)); } else at(); else !M || it < Math.min(Math.max(Je * 0.6, kA), Vn) ? Je < kA || !S ? at() : (Q.t = 0, Q.b = x, Z = "x", J.attr("d", Dee(Q, ae))) : !S || Je < Math.min(it * 0.6, Vn) ? (Q.l = 0, Q.r = k, Z = "y", J.attr("d", Eee(Q, re))) : (Z = "xy", J.attr("d", Uh(Q))); Q.w = Q.r - Q.l, Q.h = Q.b - Q.t, Z && (pe = true), e10._dragged = pe, xE(le, J, Q, j, U, ue), me(), e10.emit("plotly_relayouting", K), U = true; } function me() { K = {}, (Z === "xy" || Z === "x") && (By(m, Q.l / k, Q.r / k, K, _.xaxes), Ve("x", K)), (Z === "xy" || Z === "y") && (By(g, (x - Q.b) / x, (x - Q.t) / x, K, _.yaxes), Ve("y", K)); } function Le() { me(), jy(e10), ot(), TE(e10); } var ze = [0, 0, k, x], Fe = null, Oe = r_.REDRAWDELAY, Re = t.mainplot ? e10._fullLayout._plots[t.mainplot] : t; function We(Pe) { if (!e10._context._scrollZoom.cartesian && !e10._fullLayout._enablescrollzoom) return; if (W(), e10._transitioningWithDuration) { Pe.preventDefault(), Pe.stopPropagation(); return; } P(), clearTimeout(Fe); var Ie = -Pe.deltaY; if (isFinite(Ie) || (Ie = Pe.wheelDelta / 10), !isFinite(Ie)) { Ha.log("Did not find wheel motion attributes: ", Pe); return; } var Ne = Math.exp(-Math.min(Math.max(Ie, -20), 20) / 200), tt = Re.draglayer.select(".nsewdrag").node().getBoundingClientRect(), Je = (Pe.clientX - tt.left) / tt.width, it = (tt.bottom - Pe.clientY) / tt.height, at; function Tt(gt, He, pt) { if (gt.fixedrange) return; var bt = Ha.simpleMap(gt.range, gt.r2l), Ke = bt[0] + (bt[1] - bt[0]) * He; function st(rt) { return gt.l2r(Ke + (rt - Ke) * pt); } gt.range = bt.map(st); } if (F) { for (l || (Je = 0.5), at = 0; at < m.length; at++) Tt(m[at], Je, Ne); Ve("x"), ze[2] *= Ne, ze[0] += ze[2] * Je * (1 / Ne - 1); } if ($) { for (o || (it = 0.5), at = 0; at < g.length; at++) Tt(g[at], it, Ne); Ve("y"), ze[3] *= Ne, ze[1] += ze[3] * (1 - it) * (1 / Ne - 1); } ht(ze), qe(), e10.emit("plotly_relayouting", K), Fe = setTimeout(function() { e10._fullLayout && (ze = [0, 0, k, x], ot()); }, Oe), Pe.preventDefault(); } o.length * l.length !== 1 && kE(H, We); function Me(Pe, Ie) { if (Pe = Pe * V, Ie = Ie * z, e10._transitioningWithDuration) return; if (e10._fullLayout._replotting = true, S === "ew" || M === "ns") { var Ne = S ? -Pe : 0, tt = M ? -Ie : 0; if (T.isSubplotConstrained) { if (S && M) { var Je = (Pe / k - Ie / x) / 2; Pe = Je * k, Ie = -Je * x, Ne = -Pe, tt = -Ie; } M ? Ne = -tt * k / x : tt = -Ne * x / k; } S && (SA(m, Pe), Ve("x")), M && (SA(g, Ie), Ve("y")), ht([Ne, tt, k, x]), qe(), e10.emit("plotly_relayouting", K); return; } function it(st, rt, ct) { for (var X = 1 - rt, se, ie, fe = 0; fe < st.length; fe++) { var ke = st[fe]; if (!ke.fixedrange) { se = ke, ie = ke._rl[X] + (ke._rl[rt] - ke._rl[X]) / Cee(ct / ke._length); var _e = ke.l2r(ie); _e !== false && _e !== void 0 && (ke.range[rt] = _e); } } return se._length * (se._rl[rt] - ie) / (se._rl[rt] - se._rl[X]); } var at = S === "w" == (M === "n") ? 1 : -1; if (S && M && (_.isSubplotConstrained || T.isSubplotConstrained)) { var Tt = (Pe / k + at * Ie / x) / 2; Pe = Tt * k, Ie = at * Tt * x; } var gt, He; if (S === "w" ? Pe = it(m, 0, Pe) : S === "e" ? Pe = it(m, 1, -Pe) : S || (Pe = 0), M === "n" ? Ie = it(g, 1, Ie) : M === "s" ? Ie = it(g, 0, -Ie) : M || (Ie = 0), gt = S === "w" ? Pe : 0, He = M === "n" ? Ie : 0, _.isSubplotConstrained && !T.isSubplotConstrained || // NW or SE on matching axes - create a symmetric zoom T.isSubplotConstrained && S && M && at > 0) { var pt; if (T.isSubplotConstrained || !S && M.length === 1) { for (pt = 0; pt < m.length; pt++) m[pt].range = m[pt]._r.slice(), Og(m[pt], 1 - Ie / x); Pe = Ie * k / x, gt = Pe / 2; } if (T.isSubplotConstrained || !M && S.length === 1) { for (pt = 0; pt < g.length; pt++) g[pt].range = g[pt]._r.slice(), Og(g[pt], 1 - Pe / k); Ie = Pe * x / k, He = Ie / 2; } } (!T.isSubplotConstrained || !M) && Ve("x"), (!T.isSubplotConstrained || !S) && Ve("y"); var bt = k - Pe, Ke = x - Ie; T.isSubplotConstrained && !(S && M) && (S ? (He = gt ? 0 : Pe * x / k, Ke = bt * x / k) : (gt = He ? 0 : Ie * k / x, bt = Ke * k / x)), ht([gt, He, bt, Ke]), qe(), e10.emit("plotly_relayouting", K); } function Ve(Pe, Ie) { for (var Ne = T.isSubplotConstrained ? { x: g, y: m }[Pe] : T[Pe + "axes"], tt = T.isSubplotConstrained ? { x: m, y: g }[Pe] : [], Je = 0; Je < Ne.length; Je++) { var it = Ne[Je], at = it._id, Tt = T.xLinks[at] || T.yLinks[at], gt = tt[0] || p[Tt] || v[Tt]; gt && (Ie ? (Ie[it._name + ".range[0]"] = Ie[gt._name + ".range[0]"], Ie[it._name + ".range[1]"] = Ie[gt._name + ".range[1]"]) : it.range = gt.range.slice()); } } function qe() { var Pe = [], Ie; function Ne(at) { for (Ie = 0; Ie < at.length; Ie++) at[Ie].fixedrange || Pe.push(at[Ie]._id); } function tt(at, Tt) { for (Ie = 0; Ie < at.length; Ie++) { var gt = at[Ie], He = gt[Tt]; !gt.fixedrange && He.tickmode === "sync" && Pe.push(He._id); } } for (F && (Ne(m), Ne(_.xaxes), Ne(T.xaxes), tt(t.overlays, "xaxis")), $ && (Ne(g), Ne(_.yaxes), Ne(T.yaxes), tt(t.overlays, "yaxis")), K = {}, Ie = 0; Ie < Pe.length; Ie++) { var Je = Pe[Ie], it = Hy(e10, Je); TA.drawOne(e10, it, { skipTitle: true }), K[it._name + ".range[0]"] = it.range[0], K[it._name + ".range[1]"] = it.range[1]; } TA.redrawComponents(e10, Pe); } function Qe() { if (!e10._transitioningWithDuration) { var Pe = e10._context.doubleClick, Ie = []; S && (Ie = Ie.concat(m)), M && (Ie = Ie.concat(g)), T.xaxes && (Ie = Ie.concat(T.xaxes)), T.yaxes && (Ie = Ie.concat(T.yaxes)); var Ne = {}, tt, Je; if (Pe === "reset+autosize") for (Pe = "autosize", Je = 0; Je < Ie.length; Je++) { tt = Ie[Je]; var it = tt._rangeInitial0, at = tt._rangeInitial1, Tt = it !== void 0 || at !== void 0; if (Tt && (it !== void 0 && it !== tt.range[0] || at !== void 0 && at !== tt.range[1]) || !Tt && tt.autorange !== true) { Pe = "reset"; break; } } if (Pe === "autosize") for (Je = 0; Je < Ie.length; Je++) tt = Ie[Je], tt.fixedrange || (Ne[tt._name + ".autorange"] = true); else if (Pe === "reset") { for ((S || _.isSubplotConstrained) && (Ie = Ie.concat(_.xaxes)), M && !_.isSubplotConstrained && (Ie = Ie.concat(_.yaxes)), _.isSubplotConstrained && (S ? M || (Ie = Ie.concat(g)) : Ie = Ie.concat(m)), Je = 0; Je < Ie.length; Je++) if (tt = Ie[Je], !tt.fixedrange) { var gt = tt._name, He = tt._autorangeInitial; tt._rangeInitial0 === void 0 && tt._rangeInitial1 === void 0 ? Ne[gt + ".autorange"] = true : tt._rangeInitial0 === void 0 ? (Ne[gt + ".autorange"] = He, Ne[gt + ".range"] = [null, tt._rangeInitial1]) : tt._rangeInitial1 === void 0 ? (Ne[gt + ".range"] = [tt._rangeInitial0, null], Ne[gt + ".autorange"] = He) : Ne[gt + ".range"] = [tt._rangeInitial0, tt._rangeInitial1]; } } e10.emit("plotly_doubleclick", null), hh.call("_guiRelayout", e10, Ne); } } function ot() { ht([0, 0, k, x]), Ha.syncOrAsync([ wee.previousPromises, function() { e10._fullLayout._replotting = false, hh.call("_guiRelayout", e10, K); } ], e10); } function ht(Pe) { var Ie = e10._fullLayout, Ne = Ie._plots, tt = Ie._subplots.cartesian, Je, it, at, Tt; if (O && hh.subplotsRegistry.splom.drag(e10), I) { for (Je = 0; Je < tt.length; Je++) if (it = Ne[tt[Je]], at = it.xaxis, Tt = it.yaxis, it._scene) { var gt = Ha.simpleMap(at.range, at.r2l), He = Ha.simpleMap(Tt.range, Tt.r2l); at.limitRange && at.limitRange(), Tt.limitRange && Tt.limitRange(), gt = at.range, He = Tt.range, it._scene.update({ range: [gt[0], He[0], gt[1], He[1]] }); } } if ((O || I) && (_ee(e10), xee(e10)), G) { var pt = Pe[2] / d._length, bt = Pe[3] / h._length; for (Je = 0; Je < tt.length; Je++) { it = Ne[tt[Je]], at = it.xaxis, Tt = it.yaxis; var Ke = (F || T.isSubplotConstrained) && !at.fixedrange && p[at._id], st = ($ || T.isSubplotConstrained) && !Tt.fixedrange && v[Tt._id], rt, ct, X, se; if (Ke ? (rt = pt, X = l || T.isSubplotConstrained ? Pe[0] : ft(at, rt)) : T.xaHash[at._id] ? (rt = pt, X = Pe[0] * at._length / d._length) : T.yaHash[at._id] ? (rt = bt, X = M === "ns" ? -Pe[1] * at._length / h._length : ft(at, rt, { n: "top", s: "bottom" }[M])) : (rt = vt(at, pt, bt), X = nt(at, rt)), rt > 1 && (at.maxallowed !== void 0 && F === (at.range[0] < at.range[1] ? "e" : "w") || at.minallowed !== void 0 && F === (at.range[0] < at.range[1] ? "w" : "e")) && (rt = 1, X = 0), st ? (ct = bt, se = o || T.isSubplotConstrained ? Pe[1] : ft(Tt, ct)) : T.yaHash[Tt._id] ? (ct = bt, se = Pe[1] * Tt._length / h._length) : T.xaHash[Tt._id] ? (ct = pt, se = S === "ew" ? -Pe[0] * Tt._length / d._length : ft(Tt, ct, { e: "right", w: "left" }[S])) : (ct = vt(Tt, pt, bt), se = nt(Tt, ct)), ct > 1 && (Tt.maxallowed !== void 0 && $ === (Tt.range[0] < Tt.range[1] ? "n" : "s") || Tt.minallowed !== void 0 && $ === (Tt.range[0] < Tt.range[1] ? "s" : "n")) && (ct = 1, se = 0), !(!rt && !ct)) { rt || (rt = 1), ct || (ct = 1); var ie = at._offset - X / rt, fe = Tt._offset - se / ct; it.clipRect.call(Go.setTranslate, X, se).call(Go.setScale, rt, ct), it.plot.call(Go.setTranslate, ie, fe).call(Go.setScale, 1 / rt, 1 / ct), (rt !== it.xScaleFactor || ct !== it.yScaleFactor) && (Go.setPointGroupScale(it.zoomScalePts, rt, ct), Go.setTextPointsScale(it.zoomScaleTxt, rt, ct)), Go.hideOutsideRangePoints(it.clipOnAxisFalseTraces, it), it.xScaleFactor = rt, it.yScaleFactor = ct; } } } } function vt(Pe, Ie, Ne) { return Pe.fixedrange ? 0 : F && _.xaHash[Pe._id] ? Ie : $ && (_.isSubplotConstrained ? _.xaHash : _.yaHash)[Pe._id] ? Ne : 0; } function nt(Pe, Ie) { return Ie ? (Pe.range = Pe._r.slice(), Og(Pe, Ie), ft(Pe, Ie)) : 0; } function ft(Pe, Ie, Ne) { return Pe._length * (1 - Ie) * bee[Ne || Pe.constraintoward || "middle"]; } return H; } function gE(e10, t, r, n) { var a = Ha.ensureSingle(e10.draglayer, t, r, function(i) { i.classed("drag", true).style({ fill: "transparent", "stroke-width": 0 }).attr("data-subplot", e10.id); }); return a.call(mee, n), a.node(); } function yE(e10, t, r, n, a, i, o) { var l = gE(e10, "rect", t, r); return t_.select(l).call(Go.setRect, n, a, i, o), l; } function MA(e10, t) { for (var r = 0; r < e10.length; r++) if (!e10[r].fixedrange) return t; return ""; } function See(e10, t) { var r = e10.range[t], n = Math.abs(r - e10.range[1 - t]), a; return e10.type === "date" ? r : e10.type === "log" ? (a = Math.ceil(Math.max(0, -Math.log(n) / Math.LN10)) + 3, xA("." + a + "g")(Math.pow(10, r))) : (a = Math.floor(Math.log(Math.abs(r)) / Math.LN10) - Math.floor(Math.log(n) / Math.LN10) + 4, xA("." + String(a) + "g")(r)); } function By(e10, t, r, n, a) { for (var i = 0; i < e10.length; i++) { var o = e10[i]; if (!o.fixedrange) if (o.rangebreaks) { var l = o._id.charAt(0) === "y", s = l ? 1 - t : t, u = l ? 1 - r : r; n[o._name + ".range[0]"] = o.l2r(o.p2l(s * o._length)), n[o._name + ".range[1]"] = o.l2r(o.p2l(u * o._length)); } else { var f = o._rl[0], d = o._rl[1] - f; n[o._name + ".range[0]"] = o.l2r(f + d * t), n[o._name + ".range[1]"] = o.l2r(f + d * r); } } if (a && a.length) { var h = (t + (1 - r)) / 2; By(a, h, 1 - h, n, []); } } function SA(e10, t) { for (var r = 0; r < e10.length; r++) { var n = e10[r]; if (!n.fixedrange) { if (n.rangebreaks) { var a = 0, i = n._length, o = n.p2l(a + t) - n.p2l(a), l = n.p2l(i + t) - n.p2l(i), s = (o + l) / 2; n.range = [ n.l2r(n._rl[0] - s), n.l2r(n._rl[1] - s) ]; } else n.range = [ n.l2r(n._rl[0] - t / n._m), n.l2r(n._rl[1] - t / n._m) ]; n.limitRange && n.limitRange(); } } } function Cee(e10) { return 1 - (e10 >= 0 ? Math.min(e10, 0.9) : 1 / (1 / Math.max(e10, -0.3) + 3.222)); } function Lee(e10, t, r) { return e10 ? e10 === "nsew" ? r ? "" : t === "pan" ? "move" : "crosshair" : e10.toLowerCase() + "-resize" : "pointer"; } function bE(e10, t, r, n, a) { return e10.append("path").attr("class", "zoombox").style({ fill: t > 0.2 ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)", "stroke-width": 0 }).attr("transform", pE(r, n)).attr("d", a + "Z"); } function _E(e10, t, r) { return e10.append("path").attr("class", "zoombox-corners").style({ fill: wA.background, stroke: wA.defaultLine, "stroke-width": 1, opacity: 0 }).attr("transform", pE(t, r)).attr("d", "M0,0Z"); } function xE(e10, t, r, n, a, i) { e10.attr( "d", n + "M" + r.l + "," + r.t + "v" + r.h + "h" + r.w + "v-" + r.h + "h-" + r.w + "Z" ), wE(e10, t, a, i); } function wE(e10, t, r, n) { r || (e10.transition().style("fill", n > 0.2 ? "rgba(0,0,0,0.4)" : "rgba(255,255,255,0.3)").duration(200), t.transition().style("opacity", 1).duration(200)); } function jy(e10) { t_.select(e10).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove(); } function TE(e10) { AA && e10.data && e10._context.showTips && (Ha.notifier(Ha._(e10, "Double-click to zoom back out"), "long"), AA = false); } function Dee(e10, t) { return "M" + (e10.l - 0.5) + "," + (t - Vn - 0.5) + "h-3v" + (2 * Vn + 1) + "h3ZM" + (e10.r + 0.5) + "," + (t - Vn - 0.5) + "h3v" + (2 * Vn + 1) + "h-3Z"; } function Eee(e10, t) { return "M" + (t - Vn - 0.5) + "," + (e10.t - 0.5) + "v-3h" + (2 * Vn + 1) + "v3ZM" + (t - Vn - 0.5) + "," + (e10.b + 0.5) + "v3h" + (2 * Vn + 1) + "v-3Z"; } function Uh(e10) { var t = Math.floor(Math.min(e10.b - e10.t, e10.r - e10.l, Vn) / 2); return "M" + (e10.l - 3.5) + "," + (e10.t - 0.5 + t) + "h3v" + -t + "h" + t + "v-3h-" + (t + 3) + "ZM" + (e10.r + 3.5) + "," + (e10.t - 0.5 + t) + "h-3v" + -t + "h" + -t + "v-3h" + (t + 3) + "ZM" + (e10.r + 3.5) + "," + (e10.b + 0.5 - t) + "h-3v" + t + "h" + -t + "v3h" + (t + 3) + "ZM" + (e10.l - 3.5) + "," + (e10.b + 0.5 - t) + "h3v" + t + "h" + t + "v3h-" + (t + 3) + "Z"; } function CA(e10, t, r, n, a) { for (var i = false, o = {}, l = {}, s, u, f, d, h = (a || {}).xaHash, p = (a || {}).yaHash, v = 0; v < t.length; v++) { var m = t[v]; for (s in r) if (m[s]) { for (f in m) !(a && (h[f] || p[f])) && !(f.charAt(0) === "x" ? r : n)[f] && (o[f] = s); for (u in n) !(a && (h[u] || p[u])) && m[u] && (i = true); } for (u in n) if (m[u]) for (d in m) !(a && (h[d] || p[d])) && !(d.charAt(0) === "x" ? r : n)[d] && (l[d] = u); } i && (Ha.extendFlat(o, l), l = {}); var g = {}, y = []; for (f in o) { var w = Hy(e10, f); y.push(w), g[w._id] = w; } var k = {}, x = []; for (d in l) { var _ = Hy(e10, d); x.push(_), k[_._id] = _; } return { xaHash: g, yaHash: k, xaxes: y, yaxes: x, xLinks: o, yLinks: l, isSubplotConstrained: i }; } function kE(e10, t) { if (!hee) e10.onwheel !== void 0 ? e10.onwheel = t : e10.onmousewheel !== void 0 ? e10.onmousewheel = t : e10.isAddedWheelEvent || (e10.isAddedWheelEvent = true, e10.addEventListener("wheel", t, { passive: false })); else { var r = e10.onwheel !== void 0 ? "wheel" : "mousewheel"; e10._onwheel && e10.removeEventListener(r, e10._onwheel), e10._onwheel = t, e10.addEventListener(r, t, { passive: false }); } } function LA(e10) { var t = []; for (var r in e10) t.push(e10[r]); return t; } var Fee = { makeDragBox: Mee, makeDragger: gE, makeRectDragger: yE, makeZoombox: bE, makeCorners: _E, updateZoombox: xE, xyCorners: Uh, transitionZoombox: wE, removeZoombox: jy, showDoubleClickNotifier: TE, attachWheelEventHandler: kE }; (function(e10) { var t = lr, r = Ao, n = Qi, a = xs, i = Fee.makeDragBox, o = Yn.DRAGGERSIZE; e10.initInteractions = function(s) { var u = s._fullLayout; if (s._context.staticPlot) { t.select(s).selectAll(".drag").remove(); return; } if (!(!u._has("cartesian") && !u._has("splom"))) { var f = Object.keys(u._plots || {}).sort(function(h, p) { if ((u._plots[h].mainplot && true) === (u._plots[p].mainplot && true)) { var v = h.split("y"), m = p.split("y"); return v[0] === m[0] ? Number(v[1] || 1) - Number(m[1] || 1) : Number(v[0] || 1) - Number(m[0] || 1); } return u._plots[h].mainplot ? 1 : -1; }); f.forEach(function(h) { var p = u._plots[h], v = p.xaxis, m = p.yaxis; if (!p.mainplot) { var g = i( s, p, v._offset, m._offset, v._length, m._length, "ns", "ew" ); g.onmousemove = function(k) { s._fullLayout._rehover = function() { s._fullLayout._hoversubplot === h && s._fullLayout._plots[h] && r.hover(s, k, h); }, r.hover(s, k, h), s._fullLayout._lasthover = g, s._fullLayout._hoversubplot = h; }, g.onmouseout = function(k) { s._dragging || (s._fullLayout._hoversubplot = null, n.unhover(s, k)); }, s._context.showAxisDragHandles && (i( s, p, v._offset - o, m._offset - o, o, o, "n", "w" ), i( s, p, v._offset + v._length, m._offset - o, o, o, "n", "e" ), i( s, p, v._offset - o, m._offset + m._length, o, o, "s", "w" ), i( s, p, v._offset + v._length, m._offset + m._length, o, o, "s", "e" )); } if (s._context.showAxisDragHandles) { if (h === v._mainSubplot) { var y = v._mainLinePosition; v.side === "top" && (y -= o), i( s, p, v._offset + v._length * 0.1, y, v._length * 0.8, o, "", "ew" ), i( s, p, v._offset, y, v._length * 0.1, o, "", "w" ), i( s, p, v._offset + v._length * 0.9, y, v._length * 0.1, o, "", "e" ); } if (h === m._mainSubplot) { var w = m._mainLinePosition; m.side !== "right" && (w -= o), i( s, p, w, m._offset + m._length * 0.1, o, m._length * 0.8, "ns", "" ), i( s, p, w, m._offset + m._length * 0.9, o, m._length * 0.1, "s", "" ), i( s, p, w, m._offset, o, m._length * 0.1, "n", "" ); } } }); var d = u._hoverlayer.node(); d.onmousemove = function(h) { h.target = s._fullLayout._lasthover, r.hover(s, h, u._hoversubplot); }, d.onclick = function(h) { h.target = s._fullLayout._lasthover, r.click(s, h); }, d.onmousedown = function(h) { s._fullLayout._lasthover.onmousedown(h); }, e10.updateFx(s); } }, e10.updateFx = function(l) { var s = l._fullLayout, u = s.dragmode === "pan" ? "move" : "crosshair"; a(s._draggers, u); }; })(Mb); var nd = {}; var DA = Nt; var Ree = function(t) { for (var r = DA.layoutArrayContainers, n = DA.layoutArrayRegexes, a = t.split("[")[0], i, o, l = 0; l < n.length; l++) if (o = t.match(n[l]), o && o.index === 0) { i = o[0]; break; } if (i || (i = r[r.indexOf(a)]), !i) return false; var s = t.substr(i.length); return s ? (o = s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/), o ? { array: i, index: Number(o[1]), property: o[3] || "" } : false) : { array: i, index: "", property: "" }; }; var Pee = ms; var Hg = Y1; var Of = Xu; var $ee = Q1.sorterAsc; var Bg = Nt; nd.containerArrayMatch = Ree; var zee = nd.isAddVal = function(t) { return t === "add" || Pee(t); }; var EA = nd.isRemoveVal = function(t) { return t === null || t === "remove"; }; nd.applyContainerArrayChanges = function(t, r, n, a, i) { var o = r.astr, l = Bg.getComponentMethod(o, "supplyLayoutDefaults"), s = Bg.getComponentMethod(o, "draw"), u = Bg.getComponentMethod(o, "drawOne"), f = a.replot || a.recalc || l === Hg || s === Hg, d = t.layout, h = t._fullLayout; if (n[""]) { Object.keys(n).length > 1 && Of.warn( "Full array edits are incompatible with other edits", o ); var p = n[""][""]; if (EA(p)) r.set(null); else if (Array.isArray(p)) r.set(p); else return Of.warn("Unrecognized full array edit value", o, p), true; return f ? false : (l(d, h), s(t), true); } var v = Object.keys(n).map(Number).sort($ee), m = r.get(), g = m || [], y = i(h, o).get(), w = [], k = -1, x = g.length, _, T, S, M, L, F, $, I; for (_ = 0; _ < v.length; _++) { if (S = v[_], M = n[S], L = Object.keys(M), F = M[""], $ = zee(F), S < 0 || S > g.length - ($ ? 0 : 1)) { Of.warn("index out of range", o, S); continue; } if (F !== void 0) L.length > 1 && Of.warn( "Insertion & removal are incompatible with edits to the same index.", o, S ), EA(F) ? w.push(S) : $ ? (F === "add" && (F = {}), g.splice(S, 0, F), y && y.splice(S, 0, {})) : Of.warn( "Unrecognized full object edit value", o, S, F ), k === -1 && (k = S); else for (T = 0; T < L.length; T++) I = o + "[" + S + "].", i(g[S], L[T], I).set(M[L[T]]); } for (_ = w.length - 1; _ >= 0; _--) g.splice(w[_], 1), y && y.splice(w[_], 1); if (g.length ? m || r.set(g) : r.set(null), f) return false; if (l(d, h), u !== Hg) { var O; if (k === -1) O = v; else { for (x = Math.max(g.length, x), O = [], _ = 0; _ < v.length && (S = v[_], !(S >= k)); _++) O.push(S); for (_ = k; _ < x; _++) O.push(_); } for (_ = 0; _ < O.length; _++) u(t, O[_]); } else s(t); return true; }; var AE = {}; (function(e10) { var t = sr, r = iL, n = Nt, a = Ue, i = Tn, o = gn, l = nr, s = o.cleanId, u = o.getFromTrace, f = n.traceIs; e10.clearPromiseQueue = function(x) { Array.isArray(x._promises) && x._promises.length > 0 && a.log("Clearing previous rejected promises from queue."), x._promises = []; }, e10.cleanLayout = function(x) { var _, T; x || (x = {}), x.xaxis1 && (x.xaxis || (x.xaxis = x.xaxis1), delete x.xaxis1), x.yaxis1 && (x.yaxis || (x.yaxis = x.yaxis1), delete x.yaxis1), x.scene1 && (x.scene || (x.scene = x.scene1), delete x.scene1); var S = (i.subplotsRegistry.cartesian || {}).attrRegex, M = (i.subplotsRegistry.polar || {}).attrRegex, L = (i.subplotsRegistry.ternary || {}).attrRegex, F = (i.subplotsRegistry.gl3d || {}).attrRegex, $ = Object.keys(x); for (_ = 0; _ < $.length; _++) { var I = $[_]; if (S && S.test(I)) { var O = x[I]; O.anchor && O.anchor !== "free" && (O.anchor = s(O.anchor)), O.overlaying && (O.overlaying = s(O.overlaying)), O.type || (O.isdate ? O.type = "date" : O.islog ? O.type = "log" : O.isdate === false && O.islog === false && (O.type = "linear")), (O.autorange === "withzero" || O.autorange === "tozero") && (O.autorange = true, O.rangemode = "tozero"), O.insiderange && delete O.range, delete O.islog, delete O.isdate, delete O.categories, g(O, "domain") && delete O.domain, O.autotick !== void 0 && (O.tickmode === void 0 && (O.tickmode = O.autotick ? "auto" : "linear"), delete O.autotick), h(O); } else if (M && M.test(I)) { var G = x[I]; h(G.radialaxis); } else if (L && L.test(I)) { var K = x[I]; h(K.aaxis), h(K.baxis), h(K.caxis); } else if (F && F.test(I)) { var V = x[I], z = V.cameraposition; if (Array.isArray(z) && z[0].length === 4) { var P = z[0], R = z[1], H = z[2], B = r([], P), W = []; for (T = 0; T < 3; ++T) W[T] = R[T] + H * B[2 + 4 * T]; V.camera = { eye: { x: W[0], y: W[1], z: W[2] }, center: { x: R[0], y: R[1], z: R[2] }, up: { x: 0, y: 0, z: 1 } // we just ignore calculating camera z up in this case }, delete V.cameraposition; } h(V.xaxis), h(V.yaxis), h(V.zaxis); } } var ee = Array.isArray(x.annotations) ? x.annotations.length : 0; for (_ = 0; _ < ee; _++) { var re = x.annotations[_]; a.isPlainObject(re) && (re.ref && (re.ref === "paper" ? (re.xref = "paper", re.yref = "paper") : re.ref === "data" && (re.xref = "x", re.yref = "y"), delete re.ref), d(re, "xref"), d(re, "yref")); } var ae = Array.isArray(x.shapes) ? x.shapes.length : 0; for (_ = 0; _ < ae; _++) { var Q = x.shapes[_]; a.isPlainObject(Q) && (d(Q, "xref"), d(Q, "yref")); } var ue = Array.isArray(x.images) ? x.images.length : 0; for (_ = 0; _ < ue; _++) { var j = x.images[_]; a.isPlainObject(j) && (d(j, "xref"), d(j, "yref")); } var U = x.legend; return U && (U.x > 3 ? (U.x = 1.02, U.xanchor = "left") : U.x < -2 && (U.x = -0.02, U.xanchor = "right"), U.y > 3 ? (U.y = 1.02, U.yanchor = "bottom") : U.y < -2 && (U.y = -0.02, U.yanchor = "top")), h(x), x.dragmode === "rotate" && (x.dragmode = "orbit"), l.clean(x), x.template && x.template.layout && e10.cleanLayout(x.template.layout), x; }; function d(x, _) { var T = x[_], S = _.charAt(0); T && T !== "paper" && (x[_] = s(T, S, true)); } function h(x) { x && ((typeof x.title == "string" || typeof x.title == "number") && (x.title = { text: x.title }), _("titlefont", "font"), _("titleposition", "position"), _("titleside", "side"), _("titleoffset", "offset")); function _(T, S) { var M = x[T], L = x.title && x.title[S]; M && !L && (x.title || (x.title = {}), x.title[S] = x[T], delete x[T]); } } e10.cleanData = function(x) { for (var _ = 0; _ < x.length; _++) { var T = x[_], S; if (T.type === "histogramy" && "xbins" in T && !("ybins" in T) && (T.ybins = T.xbins, delete T.xbins), T.error_y && "opacity" in T.error_y) { var M = l.defaults, L = T.error_y.color || (f(T, "bar") ? l.defaultLine : M[_ % M.length]); T.error_y.color = l.addOpacity( l.rgb(L), l.opacity(L) * T.error_y.opacity ), delete T.error_y.opacity; } if ("bardir" in T && (T.bardir === "h" && (f(T, "bar") || T.type.substr(0, 9) === "histogram") && (T.orientation = "h", e10.swapXYData(T)), delete T.bardir), T.type === "histogramy" && e10.swapXYData(T), (T.type === "histogramx" || T.type === "histogramy") && (T.type = "histogram"), "scl" in T && !("colorscale" in T) && (T.colorscale = T.scl, delete T.scl), "reversescl" in T && !("reversescale" in T) && (T.reversescale = T.reversescl, delete T.reversescl), T.xaxis && (T.xaxis = s(T.xaxis, "x")), T.yaxis && (T.yaxis = s(T.yaxis, "y")), f(T, "gl3d") && T.scene && (T.scene = i.subplotsRegistry.gl3d.cleanId(T.scene)), !f(T, "pie-like") && !f(T, "bar-like")) if (Array.isArray(T.textposition)) for (S = 0; S < T.textposition.length; S++) T.textposition[S] = m(T.textposition[S]); else T.textposition && (T.textposition = m(T.textposition)); var F = n.getModule(T); if (F && F.colorbar) { var $ = F.colorbar.container, I = $ ? T[$] : T; I && I.colorscale && (I.colorscale === "YIGnBu" && (I.colorscale = "YlGnBu"), I.colorscale === "YIOrRd" && (I.colorscale = "YlOrRd")); } if (T.type === "surface" && a.isPlainObject(T.contours)) { var O = ["x", "y", "z"]; for (S = 0; S < O.length; S++) { var G = T.contours[O[S]]; a.isPlainObject(G) && (G.highlightColor && (G.highlightcolor = G.highlightColor, delete G.highlightColor), G.highlightWidth && (G.highlightwidth = G.highlightWidth, delete G.highlightWidth)); } } if (T.type === "candlestick" || T.type === "ohlc") { var K = (T.increasing || {}).showlegend !== false, V = (T.decreasing || {}).showlegend !== false, z = p(T.increasing), P = p(T.decreasing); if (z !== false && P !== false) { var R = v( z, P, K, V ); R && (T.name = R); } else (z || P) && !T.name && (T.name = z || P); } if (Array.isArray(T.transforms)) { var H = T.transforms; for (S = 0; S < H.length; S++) { var B = H[S]; if (a.isPlainObject(B)) switch (B.type) { case "filter": B.filtersrc && (B.target = B.filtersrc, delete B.filtersrc), B.calendar && (B.valuecalendar || (B.valuecalendar = B.calendar), delete B.calendar); break; case "groupby": if (B.styles = B.styles || B.style, B.styles && !Array.isArray(B.styles)) { var W = B.styles, ee = Object.keys(W); B.styles = []; for (var re = 0; re < ee.length; re++) B.styles.push({ target: ee[re], value: W[ee[re]] }); } break; } } } g(T, "line") && delete T.line, "marker" in T && (g(T.marker, "line") && delete T.marker.line, g(T, "marker") && delete T.marker), l.clean(T), T.autobinx && (delete T.autobinx, delete T.xbins), T.autobiny && (delete T.autobiny, delete T.ybins), h(T), T.colorbar && h(T.colorbar), T.marker && T.marker.colorbar && h(T.marker.colorbar), T.line && T.line.colorbar && h(T.line.colorbar), T.aaxis && h(T.aaxis), T.baxis && h(T.baxis); } }; function p(x) { if (!a.isPlainObject(x)) return false; var _ = x.name; return delete x.name, delete x.showlegend, (typeof _ == "string" || typeof _ == "number") && String(_); } function v(x, _, T, S) { if (T && !S) return x; if (S && !T || !x.trim()) return _; if (!_.trim()) return x; var M = Math.min(x.length, _.length), L; for (L = 0; L < M && x.charAt(L) === _.charAt(L); L++) ; var F = x.substr(0, L); return F.trim(); } function m(x) { var _ = "middle", T = "center"; return typeof x == "string" && (x.indexOf("top") !== -1 ? _ = "top" : x.indexOf("bottom") !== -1 && (_ = "bottom"), x.indexOf("left") !== -1 ? T = "left" : x.indexOf("right") !== -1 && (T = "right")), _ + " " + T; } function g(x, _) { return _ in x && typeof x[_] == "object" && Object.keys(x[_]).length === 0; } e10.swapXYData = function(x) { var _; if (a.swapAttrs(x, ["?", "?0", "d?", "?bins", "nbins?", "autobin?", "?src", "error_?"]), Array.isArray(x.z) && Array.isArray(x.z[0]) && (x.transpose ? delete x.transpose : x.transpose = true), x.error_x && x.error_y) { var T = x.error_y, S = "copy_ystyle" in T ? T.copy_ystyle : !(T.color || T.thickness || T.width); a.swapAttrs(x, ["error_?.copy_ystyle"]), S && a.swapAttrs(x, ["error_?.color", "error_?.thickness", "error_?.width"]); } if (typeof x.hoverinfo == "string") { var M = x.hoverinfo.split("+"); for (_ = 0; _ < M.length; _++) M[_] === "x" ? M[_] = "y" : M[_] === "y" && (M[_] = "x"); x.hoverinfo = M.join("+"); } }, e10.coerceTraceIndices = function(x, _) { if (t(_)) return [_]; if (!Array.isArray(_) || !_.length) return x.data.map(function(M, L) { return L; }); if (Array.isArray(_)) { for (var T = [], S = 0; S < _.length; S++) a.isIndex(_[S], x.data.length) ? T.push(_[S]) : a.warn("trace index (", _[S], ") is not a number or is out of bounds"); return T; } return _; }, e10.manageArrayContainers = function(x, _, T) { var S = x.obj, M = x.parts, L = M.length, F = M[L - 1], $ = t(F); if ($ && _ === null) { var I = M.slice(0, L - 1).join("."), O = a.nestedProperty(S, I).get(); O.splice(F, 1); } else $ && x.get() === void 0 && x.get() === void 0 && (T[x.astr] = null), x.set(_); }; var y = /(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/; function w(x) { var _ = x.search(y); if (_ > 0) return x.substr(0, _); } e10.hasParent = function(x, _) { for (var T = w(_); T; ) { if (T in x) return true; T = w(T); } return false; }; var k = ["x", "y", "z"]; e10.clearAxisTypes = function(x, _, T) { for (var S = 0; S < _.length; S++) for (var M = x._fullData[S], L = 0; L < 3; L++) { var F = u(x, M, k[L]); if (F && F.type !== "log") { var $ = F._name, I = F._id.substr(1); if (I.substr(0, 5) === "scene") { if (T[I] !== void 0) continue; $ = I + "." + $; } var O = $ + ".type"; T[$] === void 0 && T[O] === void 0 && a.nestedProperty(x.layout, O).set(null); } } }; })(AE); (function(e10) { var t = lr, r = sr, n = zL, a = Ue, i = a.nestedProperty, o = xp, l = Fq, s = Nt, u = Qu, f = Tn, d = Cr, h = Y4, p = Ki, v = Sr, m = nr, g = Mb.initInteractions, y = yl, w = rd.clearOutline, k = Yu.dfltConfig, x = nd, _ = AE, T = zp, S = Lo, M = Yn.AX_NAME_PATTERN, L = 0, F = 5; function $(X, se, ie, fe) { var ke; if (X = a.getGraphDiv(X), o.init(X), a.isPlainObject(se)) { var _e = se; se = _e.data, ie = _e.layout, fe = _e.config, ke = _e.frames; } var Ge = o.triggerHandler(X, "plotly_beforeplot", [se, ie, fe]); if (Ge === false) return Promise.reject(); !se && !ie && !a.isPlotDiv(X) && a.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.", X); function je() { if (ke) return e10.addFrames(X, ke); } V(X, fe), ie || (ie = {}), t.select(X).classed("js-plotly-plot", true), v.makeTester(), Array.isArray(X._promises) || (X._promises = []); var Ee = (X.data || []).length === 0 && Array.isArray(se); Array.isArray(se) && (_.cleanData(se), Ee ? X.data = se : X.data.push.apply(X.data, se), X.empty = false), (!X.layout || Ee) && (X.layout = _.cleanLayout(ie)), f.supplyDefaults(X); var oe = X._fullLayout, Ce = oe._has("cartesian"); oe._replotting = true, (Ee || oe._shouldCreateBgLayer) && (ct(X), oe._shouldCreateBgLayer && delete oe._shouldCreateBgLayer), v.initGradients(X), v.initPatterns(X), Ee && d.saveShowSpikeInitial(X); var Be = !X.calcdata || X.calcdata.length !== (X._fullData || []).length; Be && f.doCalcdata(X); for (var Xe = 0; Xe < X.calcdata.length; Xe++) X.calcdata[Xe][0].trace = X._fullData[Xe]; X._context.responsive ? X._responsiveChartHandler || (X._responsiveChartHandler = function() { a.isHidden(X) || f.resize(X); }, window.addEventListener("resize", X._responsiveChartHandler)) : a.clearResponsive(X); var Et = a.extendFlat({}, oe._size), Pt = 0; function It() { for (var zt = oe._basePlotModules, Mt = 0; Mt < zt.length; Mt++) zt[Mt].drawFramework && zt[Mt].drawFramework(X); !oe._glcanvas && oe._has("gl") && (oe._glcanvas = oe._glcontainer.selectAll(".gl-canvas").data([{ key: "contextLayer", context: true, pick: false }, { key: "focusLayer", context: false, pick: false }, { key: "pickLayer", context: false, pick: true }], function(Ct) { return Ct.key; }), oe._glcanvas.enter().append("canvas").attr("class", function(Ct) { return "gl-canvas gl-canvas-" + Ct.key.replace("Layer", ""); }).style({ position: "absolute", top: 0, left: 0, overflow: "visible", "pointer-events": "none" })); var St = X._context.plotGlPixelRatio; if (oe._glcanvas) { oe._glcanvas.attr("width", oe.width * St).attr("height", oe.height * St).style("width", oe.width + "px").style("height", oe.height + "px"); var Ut = oe._glcanvas.data()[0].regl; if (Ut && (Math.floor(oe.width * St) !== Ut._gl.drawingBufferWidth || Math.floor(oe.height * St) !== Ut._gl.drawingBufferHeight)) { var fr = "WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug."; if (Pt) a.error(fr); else return a.log(fr + " Clearing graph and plotting again."), f.cleanPlot([], {}, X._fullData, oe), f.supplyDefaults(X), oe = X._fullLayout, f.doCalcdata(X), Pt++, It(); } } return oe.modebar.orientation === "h" ? oe._modebardiv.style("height", null).style("width", "100%") : oe._modebardiv.style("width", null).style("height", oe.height + "px"), f.previousPromises(X); } function kt() { if (f.clearAutoMarginIds(X), T.drawMarginPushers(X), d.allowAutoMargin(X), X._fullLayout.title.text && X._fullLayout.title.automargin && f.allowAutoMargin(X, "title.automargin"), oe._has("pie")) for (var zt = X._fullData, Mt = 0; Mt < zt.length; Mt++) { var St = zt[Mt]; St.type === "pie" && St.automargin && f.allowAutoMargin(X, "pie." + St.uid + ".automargin"); } return f.doAutoMargin(X), f.previousPromises(X); } function qt() { if (f.didMarginChange(Et, oe._size)) return a.syncOrAsync([ kt, T.layoutStyles ], X); } function Ot() { if (!Be) { wt(); return; } return a.syncOrAsync([ s.getComponentMethod("shapes", "calcAutorange"), s.getComponentMethod("annotations", "calcAutorange"), wt ], X); } function wt() { X._transitioning || (T.doAutoRangeAndConstraints(X), Ee && d.saveRangeInitial(X), s.getComponentMethod("rangeslider", "calcAutorange")(X)); } function Yt() { return d.draw(X, Ee ? "" : "redraw"); } var Kt = [ f.previousPromises, je, It, kt, qt ]; Ce && Kt.push(Ot), Kt.push(T.layoutStyles), Ce && Kt.push( Yt, function(Mt) { var St = Mt._fullLayout._insideTickLabelsUpdaterange; if (St) return Mt._fullLayout._insideTickLabelsUpdaterange = void 0, Fe(Mt, St).then(function() { d.saveRangeInitial(Mt, true); }); } ), Kt.push( T.drawData, T.finalDraw, g, f.addLinks, f.rehover, f.redrag, f.reselect, // TODO: doAutoMargin is only needed here for axis automargin, which // happens outside of marginPushers where all the other automargins are // calculated. Would be much better to separate margin calculations from // component drawing - see https://github.com/plotly/plotly.js/issues/2704 f.doAutoMargin, f.previousPromises ); var $t = a.syncOrAsync(Kt, X); return (!$t || !$t.then) && ($t = Promise.resolve()), $t.then(function() { return I(X), X; }); } function I(X) { var se = X._fullLayout; se._redrawFromAutoMarginCount ? se._redrawFromAutoMarginCount-- : X.emit("plotly_afterplot"); } function O(X) { return a.extendFlat(k, X); } function G(X, se) { try { X._fullLayout._paper.style("background", se); } catch (ie) { a.error(ie); } } function K(X, se) { var ie = m.combine(se, "white"); G(X, ie); } function V(X, se) { if (!X._context) { X._context = a.extendDeep({}, k); var ie = t.select("base"); X._context._baseUrl = ie.size() && ie.attr("href") ? window.location.href.split("#")[0] : ""; } var fe = X._context, ke, _e, Ge; if (se) { for (_e = Object.keys(se), ke = 0; ke < _e.length; ke++) Ge = _e[ke], !(Ge === "editable" || Ge === "edits") && Ge in fe && (Ge === "setBackground" && se[Ge] === "opaque" ? fe[Ge] = K : fe[Ge] = se[Ge]); se.plot3dPixelRatio && !fe.plotGlPixelRatio && (fe.plotGlPixelRatio = fe.plot3dPixelRatio); var je = se.editable; if (je !== void 0) for (fe.editable = je, _e = Object.keys(fe.edits), ke = 0; ke < _e.length; ke++) fe.edits[_e[ke]] = je; if (se.edits) for (_e = Object.keys(se.edits), ke = 0; ke < _e.length; ke++) Ge = _e[ke], Ge in fe.edits && (fe.edits[Ge] = se.edits[Ge]); fe._exportedPlot = se._exportedPlot; } fe.staticPlot && (fe.editable = false, fe.edits = {}, fe.autosizable = false, fe.scrollZoom = false, fe.doubleClick = false, fe.showTips = false, fe.showLink = false, fe.displayModeBar = false), fe.displayModeBar === "hover" && !n && (fe.displayModeBar = true), (fe.setBackground === "transparent" || typeof fe.setBackground != "function") && (fe.setBackground = G), fe._hasZeroHeight = fe._hasZeroHeight || X.clientHeight === 0, fe._hasZeroWidth = fe._hasZeroWidth || X.clientWidth === 0; var Ee = fe.scrollZoom, oe = fe._scrollZoom = {}; if (Ee === true) oe.cartesian = 1, oe.gl3d = 1, oe.geo = 1, oe.mapbox = 1; else if (typeof Ee == "string") { var Ce = Ee.split("+"); for (ke = 0; ke < Ce.length; ke++) oe[Ce[ke]] = 1; } else Ee !== false && (oe.gl3d = 1, oe.geo = 1, oe.mapbox = 1); } function z(X) { if (X = a.getGraphDiv(X), !a.isPlotDiv(X)) throw new Error("This element is not a Plotly plot: " + X); return _.cleanData(X.data), _.cleanLayout(X.layout), X.calcdata = void 0, e10._doPlot(X).then(function() { return X.emit("plotly_redraw"), X; }); } function P(X, se, ie, fe) { return X = a.getGraphDiv(X), f.cleanPlot([], {}, X._fullData || [], X._fullLayout || {}), f.purge(X), e10._doPlot(X, se, ie, fe); } function R(X, se) { var ie = se + 1, fe = [], ke, _e; for (ke = 0; ke < X.length; ke++) _e = X[ke], _e < 0 ? fe.push(ie + _e) : fe.push(_e); return fe; } function H(X, se, ie) { var fe, ke; for (fe = 0; fe < se.length; fe++) { if (ke = se[fe], ke !== parseInt(ke, 10)) throw new Error("all values in " + ie + " must be integers"); if (ke >= X.data.length || ke < -X.data.length) throw new Error(ie + " must be valid indices for gd.data."); if (se.indexOf(ke, fe + 1) > -1 || ke >= 0 && se.indexOf(-X.data.length + ke) > -1 || ke < 0 && se.indexOf(X.data.length + ke) > -1) throw new Error("each index in " + ie + " must be unique."); } } function B(X, se, ie) { if (!Array.isArray(X.data)) throw new Error("gd.data must be an array."); if (typeof se > "u") throw new Error("currentIndices is a required argument."); if (Array.isArray(se) || (se = [se]), H(X, se, "currentIndices"), typeof ie < "u" && !Array.isArray(ie) && (ie = [ie]), typeof ie < "u" && H(X, ie, "newIndices"), typeof ie < "u" && se.length !== ie.length) throw new Error("current and new indices must be of equal length."); } function W(X, se, ie) { var fe, ke; if (!Array.isArray(X.data)) throw new Error("gd.data must be an array."); if (typeof se > "u") throw new Error("traces must be defined."); for (Array.isArray(se) || (se = [se]), fe = 0; fe < se.length; fe++) if (ke = se[fe], typeof ke != "object" || Array.isArray(ke) || ke === null) throw new Error("all values in traces array must be non-array objects"); if (typeof ie < "u" && !Array.isArray(ie) && (ie = [ie]), typeof ie < "u" && ie.length !== se.length) throw new Error( "if indices is specified, traces.length must equal indices.length" ); } function ee(X, se, ie, fe) { var ke = a.isPlainObject(fe); if (!Array.isArray(X.data)) throw new Error("gd.data must be an array"); if (!a.isPlainObject(se)) throw new Error("update must be a key:value object"); if (typeof ie > "u") throw new Error("indices must be an integer or array of integers"); H(X, ie, "indices"); for (var _e in se) { if (!Array.isArray(se[_e]) || se[_e].length !== ie.length) throw new Error("attribute " + _e + " must be an array of length equal to indices array length"); if (ke && (!(_e in fe) || !Array.isArray(fe[_e]) || fe[_e].length !== se[_e].length)) throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object"); } } function re(X, se, ie, fe) { var ke = a.isPlainObject(fe), _e = [], Ge, je, Ee, oe, Ce; Array.isArray(ie) || (ie = [ie]), ie = R(ie, X.data.length - 1); for (var Be in se) for (var Xe = 0; Xe < ie.length; Xe++) { if (Ge = X.data[ie[Xe]], Ee = i(Ge, Be), je = Ee.get(), oe = se[Be][Xe], !a.isArrayOrTypedArray(oe)) throw new Error("attribute: " + Be + " index: " + Xe + " must be an array"); if (!a.isArrayOrTypedArray(je)) throw new Error("cannot extend missing or non-array attribute: " + Be); if (je.constructor !== oe.constructor) throw new Error("cannot extend array with an array of a different type: " + Be); Ce = ke ? fe[Be][Xe] : fe, r(Ce) || (Ce = -1), _e.push({ prop: Ee, target: je, insert: oe, maxp: Math.floor(Ce) }); } return _e; } function ae(X, se, ie, fe, ke) { ee(X, se, ie, fe); for (var _e = re(X, se, ie, fe), Ge = {}, je = {}, Ee = 0; Ee < _e.length; Ee++) { var oe = _e[Ee].prop, Ce = _e[Ee].maxp, Be = ke(_e[Ee].target, _e[Ee].insert, Ce); oe.set(Be[0]), Array.isArray(Ge[oe.astr]) || (Ge[oe.astr] = []), Ge[oe.astr].push(Be[1]), Array.isArray(je[oe.astr]) || (je[oe.astr] = []), je[oe.astr].push(_e[Ee].target.length); } return { update: Ge, maxPoints: je }; } function Q(X, se) { var ie = new X.constructor(X.length + se.length); return ie.set(X), ie.set(se, X.length), ie; } function ue(X, se, ie, fe) { X = a.getGraphDiv(X); function ke(Ee, oe, Ce) { var Be, Xe; if (a.isTypedArray(Ee)) if (Ce < 0) { var Et = new Ee.constructor(0), Pt = Q(Ee, oe); Ce < 0 ? (Be = Pt, Xe = Et) : (Be = Et, Xe = Pt); } else if (Be = new Ee.constructor(Ce), Xe = new Ee.constructor(Ee.length + oe.length - Ce), Ce === oe.length) Be.set(oe), Xe.set(Ee); else if (Ce < oe.length) { var It = oe.length - Ce; Be.set(oe.subarray(It)), Xe.set(Ee), Xe.set(oe.subarray(0, It), Ee.length); } else { var kt = Ce - oe.length, qt = Ee.length - kt; Be.set(Ee.subarray(qt)), Be.set(oe, kt), Xe.set(Ee.subarray(0, qt)); } else Be = Ee.concat(oe), Xe = Ce >= 0 && Ce < Be.length ? Be.splice(0, Be.length - Ce) : []; return [Be, Xe]; } var _e = ae(X, se, ie, fe, ke), Ge = e10.redraw(X), je = [X, _e.update, ie, _e.maxPoints]; return l.add(X, e10.prependTraces, je, ue, arguments), Ge; } function j(X, se, ie, fe) { X = a.getGraphDiv(X); function ke(Ee, oe, Ce) { var Be, Xe; if (a.isTypedArray(Ee)) if (Ce <= 0) { var Et = new Ee.constructor(0), Pt = Q(oe, Ee); Ce < 0 ? (Be = Pt, Xe = Et) : (Be = Et, Xe = Pt); } else if (Be = new Ee.constructor(Ce), Xe = new Ee.constructor(Ee.length + oe.length - Ce), Ce === oe.length) Be.set(oe), Xe.set(Ee); else if (Ce < oe.length) { var It = oe.length - Ce; Be.set(oe.subarray(0, It)), Xe.set(oe.subarray(It)), Xe.set(Ee, It); } else { var kt = Ce - oe.length; Be.set(oe), Be.set(Ee.subarray(0, kt), oe.length), Xe.set(Ee.subarray(kt)); } else Be = oe.concat(Ee), Xe = Ce >= 0 && Ce < Be.length ? Be.splice(Ce, Be.length) : []; return [Be, Xe]; } var _e = ae(X, se, ie, fe, ke), Ge = e10.redraw(X), je = [X, _e.update, ie, _e.maxPoints]; return l.add(X, e10.extendTraces, je, j, arguments), Ge; } function U(X, se, ie) { X = a.getGraphDiv(X); var fe = [], ke = e10.deleteTraces, _e = U, Ge = [X, fe], je = [X, se], Ee, oe; for (W(X, se, ie), Array.isArray(se) || (se = [se]), se = se.map(function(Ce) { return a.extendFlat({}, Ce); }), _.cleanData(se), Ee = 0; Ee < se.length; Ee++) X.data.push(se[Ee]); for (Ee = 0; Ee < se.length; Ee++) fe.push(-se.length + Ee); if (typeof ie > "u") return oe = e10.redraw(X), l.add(X, ke, Ge, _e, je), oe; Array.isArray(ie) || (ie = [ie]); try { B(X, fe, ie); } catch (Ce) { throw X.data.splice(X.data.length - se.length, se.length), Ce; } return l.startSequence(X), l.add(X, ke, Ge, _e, je), oe = e10.moveTraces(X, fe, ie), l.stopSequence(X), oe; } function Z(X, se) { X = a.getGraphDiv(X); var ie = [], fe = e10.addTraces, ke = Z, _e = [X, ie, se], Ge = [X, se], je, Ee; if (typeof se > "u") throw new Error("indices must be an integer or array of integers."); for (Array.isArray(se) || (se = [se]), H(X, se, "indices"), se = R(se, X.data.length - 1), se.sort(a.sorterDes), je = 0; je < se.length; je += 1) Ee = X.data.splice(se[je], 1)[0], ie.push(Ee); var oe = e10.redraw(X); return l.add(X, fe, _e, ke, Ge), oe; } function le(X, se, ie) { X = a.getGraphDiv(X); var fe = [], ke = [], _e = le, Ge = le, je = [X, ie, se], Ee = [X, se, ie], oe; if (B(X, se, ie), se = Array.isArray(se) ? se : [se], typeof ie > "u") for (ie = [], oe = 0; oe < se.length; oe++) ie.push(-se.length + oe); for (ie = Array.isArray(ie) ? ie : [ie], se = R(se, X.data.length - 1), ie = R(ie, X.data.length - 1), oe = 0; oe < X.data.length; oe++) se.indexOf(oe) === -1 && fe.push(X.data[oe]); for (oe = 0; oe < se.length; oe++) ke.push({ newIndex: ie[oe], trace: X.data[se[oe]] }); for (ke.sort(function(Be, Xe) { return Be.newIndex - Xe.newIndex; }), oe = 0; oe < ke.length; oe += 1) fe.splice(ke[oe].newIndex, 0, ke[oe].trace); X.data = fe; var Ce = e10.redraw(X); return l.add(X, _e, je, Ge, Ee), Ce; } function J(X, se, ie, fe) { X = a.getGraphDiv(X), _.clearPromiseQueue(X); var ke = {}; if (typeof se == "string") ke[se] = ie; else if (a.isPlainObject(se)) ke = a.extendFlat({}, se), fe === void 0 && (fe = ie); else return a.warn("Restyle fail.", se, ie, fe), Promise.reject(); Object.keys(ke).length && (X.changed = true); var _e = _.coerceTraceIndices(X, fe), Ge = Le(X, ke, _e), je = Ge.flags; je.calc && (X.calcdata = void 0), je.clearAxisTypes && _.clearAxisTypes(X, _e, {}); var Ee = []; je.fullReplot ? Ee.push(e10._doPlot) : (Ee.push(f.previousPromises), f.supplyDefaults(X), je.markerSize && (f.doCalcdata(X), Re(Ee)), je.style && Ee.push(T.doTraceStyle), je.colorbars && Ee.push(T.doColorBars), Ee.push(I)), Ee.push( f.rehover, f.redrag, f.reselect ), l.add( X, J, [X, Ge.undoit, Ge.traces], J, [X, Ge.redoit, Ge.traces] ); var oe = a.syncOrAsync(Ee, X); return (!oe || !oe.then) && (oe = Promise.resolve()), oe.then(function() { return X.emit("plotly_restyle", Ge.eventData), X; }); } function pe(X) { return X === void 0 ? null : X; } function ge(X, se) { return se ? function(ie, fe, ke) { var _e = i(ie, fe), Ge = _e.set; return _e.set = function(je) { var Ee = (ke || "") + fe; ve(Ee, _e.get(), je, X), Ge(je); }, _e; } : i; } function ve(X, se, ie, fe) { if (Array.isArray(se) || Array.isArray(ie)) for (var ke = Array.isArray(se) ? se : [], _e = Array.isArray(ie) ? ie : [], Ge = Math.max(ke.length, _e.length), je = 0; je < Ge; je++) ve(X + "[" + je + "]", ke[je], _e[je], fe); else if (a.isPlainObject(se) || a.isPlainObject(ie)) { var Ee = a.isPlainObject(se) ? se : {}, oe = a.isPlainObject(ie) ? ie : {}, Ce = a.extendFlat({}, Ee, oe); for (var Be in Ce) ve(X + "." + Be, Ee[Be], oe[Be], fe); } else fe[X] === void 0 && (fe[X] = pe(se)); } function me(X, se, ie) { for (var fe in ie) { var ke = i(X, fe); ve(fe, ke.get(), ie[fe], se); } } function Le(X, se, ie) { var fe = X._fullLayout, ke = X._fullData, _e = X.data, Ge = fe._guiEditing, je = ge(fe._preGUI, Ge), Ee = a.extendDeepAll({}, se), oe; ze(se); var Ce = S.traceFlags(), Be = {}, Xe = {}, Et; function Pt() { return ie.map(function() { }); } function It(zr) { var tn = d.id2name(zr); Et.indexOf(tn) === -1 && Et.push(tn); } function kt(zr) { return "LAYOUT" + zr + ".autorange"; } function qt(zr) { return "LAYOUT" + zr + ".range"; } function Ot(zr) { for (var tn = zr; tn < ke.length; tn++) if (ke[tn]._input === _e[zr]) return ke[tn]; } function wt(zr, tn, Kn) { if (Array.isArray(zr)) { zr.forEach(function(ha) { wt(ha, tn, Kn); }); return; } if (!(zr in se || _.hasParent(se, zr))) { var Ma; if (zr.substr(0, 6) === "LAYOUT") Ma = je(X.layout, zr.replace("LAYOUT", "")); else { var Ti = ie[Kn], Jn = fe._tracePreGUI[Ot(Ti)._fullInput.uid]; Ma = ge(Jn, Ge)(_e[Ti], zr); } zr in Xe || (Xe[zr] = Pt()), Xe[zr][Kn] === void 0 && (Xe[zr][Kn] = pe(Ma.get())), tn !== void 0 && Ma.set(tn); } } function Yt(zr) { return function(tn) { return ke[tn][zr]; }; } function Kt(zr) { return function(tn, Kn) { return tn === false ? ke[ie[Kn]][zr] : null; }; } for (var $t in se) { if (_.hasParent(se, $t)) throw new Error("cannot set " + $t + " and a parent attribute simultaneously"); var zt = se[$t], Mt, St, Ut, fr, Ct, tr; if (($t === "autobinx" || $t === "autobiny") && ($t = $t.charAt($t.length - 1) + "bins", Array.isArray(zt) ? zt = zt.map(Kt($t)) : zt === false ? zt = ie.map(Yt($t)) : zt = null), Be[$t] = zt, $t.substr(0, 6) === "LAYOUT") { Ut = je(X.layout, $t.replace("LAYOUT", "")), Xe[$t] = [pe(Ut.get())], Ut.set(Array.isArray(zt) ? zt[0] : zt), Ce.calc = true; continue; } for (Xe[$t] = Pt(), oe = 0; oe < ie.length; oe++) { Mt = _e[ie[oe]], St = Ot(ie[oe]); var Ht = fe._tracePreGUI[St._fullInput.uid]; if (Ut = ge(Ht, Ge)(Mt, $t), fr = Ut.get(), Ct = Array.isArray(zt) ? zt[oe % zt.length] : zt, Ct !== void 0) { var $r = Ut.parts[Ut.parts.length - 1], ar = $t.substr(0, $t.length - $r.length - 1), Pr = ar ? ar + "." : "", Ur = ar ? i(St, ar).get() : St; if (tr = u.getTraceValObject(St, Ut.parts), tr && tr.impliedEdits && Ct !== null) for (var Pn in tr.impliedEdits) wt(a.relativeAttr($t, Pn), tr.impliedEdits[Pn], oe); else if (($r === "thicknessmode" || $r === "lenmode") && fr !== Ct && (Ct === "fraction" || Ct === "pixels") && Ur) { var hn = fe._size, vn = Ur.orient, Ka = vn === "top" || vn === "bottom"; if ($r === "thicknessmode") { var to = Ka ? hn.h : hn.w; wt(Pr + "thickness", Ur.thickness * (Ct === "fraction" ? 1 / to : to), oe); } else { var ln = Ka ? hn.w : hn.h; wt(Pr + "len", Ur.len * (Ct === "fraction" ? 1 / ln : ln), oe); } } else if ($t === "type" && (Ct === "pie" != (fr === "pie") || Ct === "funnelarea" != (fr === "funnelarea"))) { var Xn = "x", ro = "y"; (Ct === "bar" || fr === "bar") && Mt.orientation === "h" && (Xn = "y", ro = "x"), a.swapAttrs(Mt, ["?", "?src"], "labels", Xn), a.swapAttrs(Mt, ["d?", "?0"], "label", Xn), a.swapAttrs(Mt, ["?", "?src"], "values", ro), fr === "pie" || fr === "funnelarea" ? (i(Mt, "marker.color").set(i(Mt, "marker.colors").get()), fe._pielayer.selectAll("g.trace").remove()) : s.traceIs(Mt, "cartesian") && i(Mt, "marker.colors").set(i(Mt, "marker.color").get()); } Xe[$t][oe] = pe(fr); var ka = [ "swapxy", "swapxyaxes", "orientation", "orientationaxes" ]; if (ka.indexOf($t) !== -1) { if ($t === "orientation") { Ut.set(Ct); var mr = Mt.x && !Mt.y ? "h" : "v"; if ((Ut.get() || mr) === St.orientation) continue; } else $t === "orientationaxes" && (Mt.orientation = { v: "h", h: "v" }[St.orientation]); _.swapXYData(Mt), Ce.calc = Ce.clearAxisTypes = true; } else f.dataArrayContainers.indexOf(Ut.parts[0]) !== -1 ? (_.manageArrayContainers(Ut, Ct, Xe), Ce.calc = true) : (tr ? tr.arrayOk && !s.traceIs(St, "regl") && (a.isArrayOrTypedArray(Ct) || a.isArrayOrTypedArray(fr)) ? Ce.calc = true : S.update(Ce, tr) : Ce.calc = true, Ut.set(Ct)); } } if (["swapxyaxes", "orientationaxes"].indexOf($t) !== -1 && d.swap(X, ie), $t === "orientationaxes") { var Aa = i(X.layout, "hovermode"), Ja = Aa.get(); Ja === "x" ? Aa.set("y") : Ja === "y" ? Aa.set("x") : Ja === "x unified" ? Aa.set("y unified") : Ja === "y unified" && Aa.set("x unified"); } if (["orientation", "type"].indexOf($t) !== -1) { for (Et = [], oe = 0; oe < ie.length; oe++) { var no = _e[ie[oe]]; s.traceIs(no, "cartesian") && (It(no.xaxis || "x"), It(no.yaxis || "y")); } wt(Et.map(kt), true, 0), wt(Et.map(qt), [0, 1], 0); } } return (Ce.calc || Ce.plot) && (Ce.fullReplot = true), { flags: Ce, undoit: Xe, redoit: Be, traces: ie, eventData: a.extendDeepNoArrays([], [Ee, ie]) }; } function ze(X) { var se = a.counterRegex("axis", ".title", false, false), ie = /colorbar\.title$/, fe = Object.keys(X), ke, _e, Ge; for (ke = 0; ke < fe.length; ke++) _e = fe[ke], Ge = X[_e], (_e === "title" || se.test(_e) || ie.test(_e)) && (typeof Ge == "string" || typeof Ge == "number") ? je(_e, _e.replace("title", "title.text")) : _e.indexOf("titlefont") > -1 && _e.indexOf("grouptitlefont") === -1 ? je(_e, _e.replace("titlefont", "title.font")) : _e.indexOf("titleposition") > -1 ? je(_e, _e.replace("titleposition", "title.position")) : _e.indexOf("titleside") > -1 ? je(_e, _e.replace("titleside", "title.side")) : _e.indexOf("titleoffset") > -1 && je(_e, _e.replace("titleoffset", "title.offset")); function je(Ee, oe) { X[oe] = X[Ee], delete X[Ee]; } } function Fe(X, se, ie) { X = a.getGraphDiv(X), _.clearPromiseQueue(X); var fe = {}; if (typeof se == "string") fe[se] = ie; else if (a.isPlainObject(se)) fe = a.extendFlat({}, se); else return a.warn("Relayout fail.", se, ie), Promise.reject(); Object.keys(fe).length && (X.changed = true); var ke = qe(X, fe), _e = ke.flags; _e.calc && (X.calcdata = void 0); var Ge = [f.previousPromises]; _e.layoutReplot ? Ge.push(T.layoutReplot) : Object.keys(fe).length && (Oe(X, _e, ke) || f.supplyDefaults(X), _e.legend && Ge.push(T.doLegend), _e.layoutstyle && Ge.push(T.layoutStyles), _e.axrange && Re(Ge, ke.rangesAltered), _e.ticks && Ge.push(T.doTicksRelayout), _e.modebar && Ge.push(T.doModeBar), _e.camera && Ge.push(T.doCamera), _e.colorbars && Ge.push(T.doColorBars), Ge.push(I)), Ge.push( f.rehover, f.redrag, f.reselect ), l.add( X, Fe, [X, ke.undoit], Fe, [X, ke.redoit] ); var je = a.syncOrAsync(Ge, X); return (!je || !je.then) && (je = Promise.resolve(X)), je.then(function() { return X.emit("plotly_relayout", ke.eventData), X; }); } function Oe(X, se, ie) { var fe = X._fullLayout; if (!se.axrange) return false; for (var ke in se) if (ke !== "axrange" && se[ke]) return false; var _e, Ge, je = function(Et, Pt) { return a.coerce(_e, Ge, p, Et, Pt); }, Ee = {}; for (var oe in ie.rangesAltered) { var Ce = d.id2name(oe); if (_e = X.layout[Ce], Ge = fe[Ce], h(_e, Ge, je, Ee), Ge._matchGroup) { for (var Be in Ge._matchGroup) if (Be !== oe) { var Xe = fe[d.id2name(Be)]; Xe.autorange = Ge.autorange, Xe.range = Ge.range.slice(), Xe._input.range = Ge.range.slice(); } } } return true; } function Re(X, se) { var ie = se ? function(fe) { var ke = [], _e = true; for (var Ge in se) { var je = d.getFromId(fe, Ge); if (ke.push(Ge), (je.ticklabelposition || "").indexOf("inside") !== -1 && je._anchorAxis && ke.push(je._anchorAxis._id), je._matchGroup) for (var Ee in je._matchGroup) se[Ee] || ke.push(Ee); } return d.draw(fe, ke, { skipTitle: _e }); } : function(fe) { return d.draw(fe, "redraw"); }; X.push( w, T.doAutoRangeAndConstraints, ie, T.drawData, T.finalDraw ); } var We = /^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/, Me = /^[xyz]axis[0-9]*\.autorange$/, Ve = /^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/; function qe(X, se) { var ie = X.layout, fe = X._fullLayout, ke = fe._guiEditing, _e = ge(fe._preGUI, ke), Ge = Object.keys(se), je = d.list(X), Ee = a.extendDeepAll({}, se), oe = {}, Ce, Be, Xe; for (ze(se), Ge = Object.keys(se), Be = 0; Be < Ge.length; Be++) if (Ge[Be].indexOf("allaxes") === 0) { for (Xe = 0; Xe < je.length; Xe++) { var Et = je[Xe]._id.substr(1), Pt = Et.indexOf("scene") !== -1 ? Et + "." : "", It = Ge[Be].replace("allaxes", Pt + je[Xe]._name); se[It] || (se[It] = se[Ge[Be]]); } delete se[Ge[Be]]; } var kt = S.layoutFlags(), qt = {}, Ot = {}; function wt(Jn, ha) { if (Array.isArray(Jn)) { Jn.forEach(function(od) { wt(od, ha); }); return; } if (!(Jn in se || _.hasParent(se, Jn))) { var Ts = _e(ie, Jn); Jn in Ot || (Ot[Jn] = pe(Ts.get())), ha !== void 0 && Ts.set(ha); } } var Yt = {}, Kt; function $t(Jn) { var ha = d.name2id(Jn.split(".")[0]); return Yt[ha] = 1, ha; } for (var zt in se) { if (_.hasParent(se, zt)) throw new Error("cannot set " + zt + " and a parent attribute simultaneously"); for (var Mt = _e(ie, zt), St = se[zt], Ut = Mt.parts.length, fr = Ut - 1; fr > 0 && typeof Mt.parts[fr] != "string"; ) fr--; var Ct = Mt.parts[fr], tr = Mt.parts[fr - 1] + "." + Ct, Ht = Mt.parts.slice(0, fr).join("."), $r = i(X.layout, Ht).get(), ar = i(fe, Ht).get(), Pr = Mt.get(); if (St !== void 0) { qt[zt] = St, Ot[zt] = Ct === "reverse" ? St : pe(Pr); var Ur = u.getLayoutValObject(fe, Mt.parts); if (Ur && Ur.impliedEdits && St !== null) for (var Pn in Ur.impliedEdits) wt(a.relativeAttr(zt, Pn), Ur.impliedEdits[Pn]); if (["width", "height"].indexOf(zt) !== -1) if (St) { wt("autosize", null); var hn = zt === "height" ? "width" : "height"; wt(hn, fe[hn]); } else fe[zt] = X._initialAutoSize[zt]; else if (zt === "autosize") wt("width", St ? null : fe.width), wt("height", St ? null : fe.height); else if (tr.match(We)) $t(tr), i(fe, Ht + "._inputRange").set(null); else if (tr.match(Me)) { $t(tr), i(fe, Ht + "._inputRange").set(null); var vn = i(fe, Ht).get(); vn._inputDomain && (vn._input.domain = vn._inputDomain.slice()); } else tr.match(Ve) && i(fe, Ht + "._inputDomain").set(null); if (Ct === "type") { Kt = $r; var Ka = ar.type === "linear" && St === "log", to = ar.type === "log" && St === "linear"; if (Ka || to) { if (!Kt || !Kt.range) wt(Ht + ".autorange", true); else if (ar.autorange) Ka && (Kt.range = Kt.range[1] > Kt.range[0] ? [1, 2] : [2, 1]); else { var ln = Kt.range[0], Xn = Kt.range[1]; Ka ? (ln <= 0 && Xn <= 0 && wt(Ht + ".autorange", true), ln <= 0 ? ln = Xn / 1e6 : Xn <= 0 && (Xn = ln / 1e6), wt(Ht + ".range[0]", Math.log(ln) / Math.LN10), wt(Ht + ".range[1]", Math.log(Xn) / Math.LN10)) : (wt(Ht + ".range[0]", Math.pow(10, ln)), wt(Ht + ".range[1]", Math.pow(10, Xn))); } Array.isArray(fe._subplots.polar) && fe._subplots.polar.length && fe[Mt.parts[0]] && Mt.parts[1] === "radialaxis" && delete fe[Mt.parts[0]]._subplot.viewInitial["radialaxis.range"], s.getComponentMethod("annotations", "convertCoords")(X, ar, St, wt), s.getComponentMethod("images", "convertCoords")(X, ar, St, wt); } else wt(Ht + ".autorange", true), wt(Ht + ".range", null); i(fe, Ht + "._inputRange").set(null); } else if (Ct.match(M)) { var ro = i(fe, zt).get(), ka = (St || {}).type; (!ka || ka === "-") && (ka = "linear"), s.getComponentMethod("annotations", "convertCoords")(X, ro, ka, wt), s.getComponentMethod("images", "convertCoords")(X, ro, ka, wt); } var mr = x.containerArrayMatch(zt); if (mr) { Ce = mr.array, Be = mr.index; var Aa = mr.property, Ja = Ur || { editType: "calc" }; Be !== "" && Aa === "" && (x.isAddVal(St) ? Ot[zt] = null : x.isRemoveVal(St) ? Ot[zt] = (i(ie, Ce).get() || [])[Be] : a.warn("unrecognized full object value", se)), S.update(kt, Ja), oe[Ce] || (oe[Ce] = {}); var no = oe[Ce][Be]; no || (no = oe[Ce][Be] = {}), no[Aa] = St, delete se[zt]; } else Ct === "reverse" ? ($r.range ? $r.range.reverse() : (wt(Ht + ".autorange", true), $r.range = [1, 0]), ar.autorange ? kt.calc = true : kt.plot = true) : (zt === "dragmode" && (St === false && Pr !== false || St !== false && Pr === false) || fe._has("scatter-like") && fe._has("regl") && zt === "dragmode" && (St === "lasso" || St === "select") && !(Pr === "lasso" || Pr === "select") || fe._has("gl2d") ? kt.plot = true : Ur ? S.update(kt, Ur) : kt.calc = true, Mt.set(St)); } } for (Ce in oe) { var zr = x.applyContainerArrayChanges( X, _e(ie, Ce), oe[Ce], kt, _e ); zr || (kt.plot = true); } for (var tn in Yt) { Kt = d.getFromId(X, tn); var Kn = Kt && Kt._constraintGroup; if (Kn) { kt.calc = true; for (var Ma in Kn) Yt[Ma] || (d.getFromId(X, Ma)._constraintShrinkable = true); } } (Qe(X) || se.height || se.width) && (kt.plot = true); var Ti = fe.shapes; for (Be = 0; Be < Ti.length; Be++) if (Ti[Be].showlegend) { kt.calc = true; break; } return (kt.plot || kt.calc) && (kt.layoutReplot = true), { flags: kt, rangesAltered: Yt, undoit: Ot, redoit: qt, eventData: Ee }; } function Qe(X) { var se = X._fullLayout, ie = se.width, fe = se.height; return X.layout.autosize && f.plotAutoSize(X, X.layout, se), se.width !== ie || se.height !== fe; } function ot(X, se, ie, fe) { X = a.getGraphDiv(X), _.clearPromiseQueue(X), a.isPlainObject(se) || (se = {}), a.isPlainObject(ie) || (ie = {}), Object.keys(se).length && (X.changed = true), Object.keys(ie).length && (X.changed = true); var ke = _.coerceTraceIndices(X, fe), _e = Le(X, a.extendFlat({}, se), ke), Ge = _e.flags, je = qe(X, a.extendFlat({}, ie)), Ee = je.flags; (Ge.calc || Ee.calc) && (X.calcdata = void 0), Ge.clearAxisTypes && _.clearAxisTypes(X, ke, ie); var oe = []; Ee.layoutReplot ? oe.push(T.layoutReplot) : Ge.fullReplot ? oe.push(e10._doPlot) : (oe.push(f.previousPromises), Oe(X, Ee, je) || f.supplyDefaults(X), Ge.style && oe.push(T.doTraceStyle), (Ge.colorbars || Ee.colorbars) && oe.push(T.doColorBars), Ee.legend && oe.push(T.doLegend), Ee.layoutstyle && oe.push(T.layoutStyles), Ee.axrange && Re(oe, je.rangesAltered), Ee.ticks && oe.push(T.doTicksRelayout), Ee.modebar && oe.push(T.doModeBar), Ee.camera && oe.push(T.doCamera), oe.push(I)), oe.push( f.rehover, f.redrag, f.reselect ), l.add( X, ot, [X, _e.undoit, je.undoit, _e.traces], ot, [X, _e.redoit, je.redoit, _e.traces] ); var Ce = a.syncOrAsync(oe, X); return (!Ce || !Ce.then) && (Ce = Promise.resolve(X)), Ce.then(function() { return X.emit("plotly_update", { data: _e.eventData, layout: je.eventData }), X; }); } function ht(X) { return function(ie) { ie._fullLayout._guiEditing = true; var fe = X.apply(null, arguments); return ie._fullLayout._guiEditing = false, fe; }; } var vt = [ { pattern: /^hiddenlabels/, attr: "legend.uirevision" }, { pattern: /^((x|y)axis\d*)\.((auto)?range|title\.text)/ }, // showspikes and modes include those nested inside scenes { pattern: /axis\d*\.showspikes$/, attr: "modebar.uirevision" }, { pattern: /(hover|drag)mode$/, attr: "modebar.uirevision" }, { pattern: /^(scene\d*)\.camera/ }, { pattern: /^(geo\d*)\.(projection|center|fitbounds)/ }, { pattern: /^(ternary\d*\.[abc]axis)\.(min|title\.text)$/ }, { pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/ }, { pattern: /^(polar\d*\.angularaxis)\.rotation/ }, { pattern: /^(mapbox\d*)\.(center|zoom|bearing|pitch)/ }, { pattern: /^legend\.(x|y)$/, attr: "editrevision" }, { pattern: /^(shapes|annotations)/, attr: "editrevision" }, { pattern: /^title\.text$/, attr: "editrevision" } ], nt = [ { pattern: /^selectedpoints$/, attr: "selectionrevision" }, // "visible" includes trace.transforms[i].styles[j].value.visible { pattern: /(^|value\.)visible$/, attr: "legend.uirevision" }, { pattern: /^dimensions\[\d+\]\.constraintrange/ }, { pattern: /^node\.(x|y|groups)/ }, // for Sankey nodes { pattern: /^level$/ }, // for Sunburst, Treemap and Icicle traces // below this you must be in editable: true mode // TODO: I still put name and title with `trace.uirevision` // reasonable or should these be `editrevision`? // Also applies to axis titles up in the layout section // "name" also includes transform.styles { pattern: /(^|value\.)name$/ }, // including nested colorbar attributes (ie marker.colorbar) { pattern: /colorbar\.title\.text$/ }, { pattern: /colorbar\.(x|y)$/, attr: "editrevision" } ]; function ft(X, se) { for (var ie = 0; ie < se.length; ie++) { var fe = se[ie], ke = X.match(fe.pattern); if (ke) { var _e = ke[1] || ""; return { head: _e, tail: X.substr(_e.length + 1), attr: fe.attr }; } } } function Pe(X, se) { var ie = i(se, X).get(); if (ie !== void 0) return ie; var fe = X.split("."); for (fe.pop(); fe.length > 1; ) if (fe.pop(), ie = i(se, fe.join(".") + ".uirevision").get(), ie !== void 0) return ie; return se.uirevision; } function Ie(X, se) { for (var ie = 0; ie < se.length; ie++) if (se[ie]._fullInput.uid === X) return ie; return -1; } function Ne(X, se, ie) { for (var fe = 0; fe < se.length; fe++) if (se[fe].uid === X) return fe; return !se[ie] || se[ie].uid ? -1 : ie; } function tt(X, se) { var ie = a.isPlainObject(X), fe = Array.isArray(X); return ie || fe ? (ie && a.isPlainObject(se) || fe && Array.isArray(se)) && JSON.stringify(X) === JSON.stringify(se) : X === se; } function Je(X, se, ie, fe) { var ke = fe._preGUI, _e, Ge, je, Ee, oe, Ce, Be, Xe, Et, Pt, It = [], kt = {}, qt = {}; for (_e in ke) { if (oe = ft(_e, vt), oe) { if (Et = oe.head, Pt = oe.tail, Ge = oe.attr || Et + ".uirevision", je = i(fe, Ge).get(), Ee = je && Pe(Ge, se), Ee && Ee === je) { if (Ce = ke[_e], Ce === null && (Ce = void 0), Be = i(se, _e), Xe = Be.get(), tt(Xe, Ce)) { Xe === void 0 && Pt === "autorange" && It.push(Et), Be.set(pe(i(fe, _e).get())); continue; } else if (Pt === "autorange" || Pt.substr(0, 6) === "range[") { var Ot = ke[Et + ".range[0]"], wt = ke[Et + ".range[1]"], Yt = ke[Et + ".autorange"]; if (Yt || Yt === null && Ot === null && wt === null) { if (!(Et in kt)) { var Kt = i(se, Et).get(); kt[Et] = Kt && (Kt.autorange || Kt.autorange !== false && (!Kt.range || Kt.range.length !== 2)); } if (kt[Et]) { Be.set(pe(i(fe, _e).get())); continue; } } } } } else a.warn("unrecognized GUI edit: " + _e); delete ke[_e], oe && oe.tail.substr(0, 6) === "range[" && (qt[oe.head] = 1); } for (var $t = 0; $t < It.length; $t++) { var zt = It[$t]; if (qt[zt]) { var Mt = i(se, zt).get(); Mt && delete Mt.autorange; } } var St = fe._tracePreGUI; for (var Ut in St) { var fr = St[Ut], Ct = null, tr; for (_e in fr) { if (!Ct) { var Ht = Ie(Ut, ie); if (Ht < 0) { delete St[Ut]; break; } var $r = ie[Ht]; tr = $r._fullInput; var ar = Ne(Ut, X, tr.index); if (ar < 0) { delete St[Ut]; break; } Ct = X[ar]; } if (oe = ft(_e, nt), oe) { if (oe.attr ? (je = i(fe, oe.attr).get(), Ee = je && Pe(oe.attr, se)) : (je = tr.uirevision, Ee = Ct.uirevision, Ee === void 0 && (Ee = se.uirevision)), Ee && Ee === je && (Ce = fr[_e], Ce === null && (Ce = void 0), Be = i(Ct, _e), Xe = Be.get(), tt(Xe, Ce))) { Be.set(pe(i(tr, _e).get())); continue; } } else a.warn("unrecognized GUI edit: " + _e + " in trace uid " + Ut); delete fr[_e]; } } } function it(X, se, ie, fe) { var ke, _e; function Ge() { return e10.addFrames(X, ke); } X = a.getGraphDiv(X), _.clearPromiseQueue(X); var je = X._fullData, Ee = X._fullLayout; if (!a.isPlotDiv(X) || !je || !Ee) _e = e10.newPlot(X, se, ie, fe); else { if (a.isPlainObject(se)) { var oe = se; se = oe.data, ie = oe.layout, fe = oe.config, ke = oe.frames; } var Ce = false; if (fe) { var Be = a.extendDeep({}, X._context); X._context = void 0, V(X, fe), Ce = He(Be, X._context); } X.data = se || [], _.cleanData(X.data), X.layout = ie || {}, _.cleanLayout(X.layout), Je(X.data, X.layout, je, Ee), f.supplyDefaults(X, { skipUpdateCalc: true }); var Xe = X._fullData, Et = X._fullLayout, Pt = Et.datarevision === void 0, It = Et.transition, kt = Tt(X, Ee, Et, Pt, It), qt = kt.newDataRevision, Ot = at(X, je, Xe, Pt, It, qt); if (Qe(X) && (kt.layoutReplot = true), Ot.calc || kt.calc) { X.calcdata = void 0; for (var wt = Object.getOwnPropertyNames(Et), Yt = 0; Yt < wt.length; Yt++) { var Kt = wt[Yt], $t = Kt.substring(0, 5); if ($t === "xaxis" || $t === "yaxis") { var zt = Et[Kt]._emptyCategories; zt && zt(); } } } else f.supplyDefaultsUpdateCalc(X.calcdata, Xe); var Mt = []; if (ke && (X._transitionData = {}, f.createTransitionData(X), Mt.push(Ge)), Et.transition && !Ce && (Ot.anim || kt.anim)) kt.ticks && Mt.push(T.doTicksRelayout), f.doCalcdata(X), T.doAutoRangeAndConstraints(X), Mt.push(function() { return f.transitionFromReact(X, Ot, kt, Ee); }); else if (Ot.fullReplot || kt.layoutReplot || Ce) X._fullLayout._skipDefaults = true, Mt.push(e10._doPlot); else { for (var St in kt.arrays) { var Ut = kt.arrays[St]; if (Ut.length) { var fr = s.getComponentMethod(St, "drawOne"); if (fr !== a.noop) for (var Ct = 0; Ct < Ut.length; Ct++) fr(X, Ut[Ct]); else { var tr = s.getComponentMethod(St, "draw"); if (tr === a.noop) throw new Error("cannot draw components: " + St); tr(X); } } } Mt.push(f.previousPromises), Ot.style && Mt.push(T.doTraceStyle), (Ot.colorbars || kt.colorbars) && Mt.push(T.doColorBars), kt.legend && Mt.push(T.doLegend), kt.layoutstyle && Mt.push(T.layoutStyles), kt.axrange && Re(Mt), kt.ticks && Mt.push(T.doTicksRelayout), kt.modebar && Mt.push(T.doModeBar), kt.camera && Mt.push(T.doCamera), Mt.push(I); } Mt.push( f.rehover, f.redrag, f.reselect ), _e = a.syncOrAsync(Mt, X), (!_e || !_e.then) && (_e = Promise.resolve(X)); } return _e.then(function() { return X.emit("plotly_react", { data: se, layout: ie }), X; }); } function at(X, se, ie, fe, ke, _e) { var Ge = se.length === ie.length; if (!ke && !Ge) return { fullReplot: true, calc: true }; var je = S.traceFlags(); je.arrays = {}, je.nChanges = 0, je.nChangesAnim = 0; var Ee, oe; function Ce(Et) { var Pt = u.getTraceValObject(oe, Et); return !oe._module.animatable && Pt.anim && (Pt.anim = false), Pt; } var Be = { getValObject: Ce, flags: je, immutable: fe, transition: ke, newDataRevision: _e, gd: X }, Xe = {}; for (Ee = 0; Ee < se.length; Ee++) if (ie[Ee]) { if (oe = ie[Ee]._fullInput, f.hasMakesDataTransform(oe) && (oe = ie[Ee]), Xe[oe.uid]) continue; Xe[oe.uid] = 1, gt(se[Ee]._fullInput, oe, [], Be); } return (je.calc || je.plot) && (je.fullReplot = true), ke && je.nChanges && je.nChangesAnim && (je.anim = je.nChanges === je.nChangesAnim && Ge ? "all" : "some"), je; } function Tt(X, se, ie, fe, ke) { var _e = S.layoutFlags(); _e.arrays = {}, _e.rangesAltered = {}, _e.nChanges = 0, _e.nChangesAnim = 0; function Ge(Ee) { return u.getLayoutValObject(ie, Ee); } var je = { getValObject: Ge, flags: _e, immutable: fe, transition: ke, gd: X }; return gt(se, ie, [], je), (_e.plot || _e.calc) && (_e.layoutReplot = true), ke && _e.nChanges && _e.nChangesAnim && (_e.anim = _e.nChanges === _e.nChangesAnim ? "all" : "some"), _e; } function gt(X, se, ie, fe) { var ke, _e, Ge, je = fe.getValObject, Ee = fe.flags, oe = fe.immutable, Ce = fe.inArray, Be = fe.arrayIndex; function Xe() { var Ht = ke.editType; if (Ce && Ht.indexOf("arraydraw") !== -1) { a.pushUnique(Ee.arrays[Ce], Be); return; } S.update(Ee, ke), Ht !== "none" && Ee.nChanges++, fe.transition && ke.anim && Ee.nChangesAnim++, (We.test(Ge) || Me.test(Ge)) && (Ee.rangesAltered[ie[0]] = 1), Ve.test(Ge) && i(se, "_inputDomain").set(null), _e === "datarevision" && (Ee.newDataRevision = 1); } function Et(Ht) { return Ht.valType === "data_array" || Ht.arrayOk; } for (_e in X) { if (Ee.calc && !fe.transition) return; var Pt = X[_e], It = se[_e], kt = ie.concat(_e); if (Ge = kt.join("."), !(_e.charAt(0) === "_" || typeof Pt == "function" || Pt === It)) { if ((_e === "tick0" || _e === "dtick") && ie[0] !== "geo") { var qt = se.tickmode; if (qt === "auto" || qt === "array" || !qt) continue; } if (!(_e === "range" && se.autorange) && !((_e === "zmin" || _e === "zmax") && se.type === "contourcarpet") && (ke = je(kt), !!ke && !(ke._compareAsJSON && JSON.stringify(Pt) === JSON.stringify(It)))) { var Ot = ke.valType, wt, Yt = Et(ke), Kt = Array.isArray(Pt), $t = Array.isArray(It); if (Kt && $t) { var zt = "_input_" + _e, Mt = X[zt], St = se[zt]; if (Array.isArray(Mt) && Mt === St) continue; } if (It === void 0) Yt && Kt ? Ee.calc = true : Xe(); else if (ke._isLinkedToArray) { var Ut = [], fr = false; Ce || (Ee.arrays[_e] = Ut); var Ct = Math.min(Pt.length, It.length), tr = Math.max(Pt.length, It.length); if (Ct !== tr) if (ke.editType === "arraydraw") fr = true; else { Xe(); continue; } for (wt = 0; wt < Ct; wt++) gt( Pt[wt], It[wt], kt.concat(wt), // add array indices, but not if we're already in an array a.extendFlat({ inArray: _e, arrayIndex: wt }, fe) ); if (fr) for (wt = Ct; wt < tr; wt++) Ut.push(wt); } else !Ot && a.isPlainObject(Pt) ? gt(Pt, It, kt, fe) : Yt ? Kt && $t ? (oe && (Ee.calc = true), (oe || fe.newDataRevision) && Xe()) : Kt !== $t ? Ee.calc = true : Xe() : Kt && $t ? (Pt.length !== It.length || String(Pt) !== String(It)) && Xe() : Xe(); } } } for (_e in se) if (!(_e in X || _e.charAt(0) === "_" || typeof se[_e] == "function")) if (ke = je(ie.concat(_e)), Et(ke) && Array.isArray(se[_e])) { Ee.calc = true; return; } else Xe(); } function He(X, se) { var ie; for (ie in X) if (ie.charAt(0) !== "_") { var fe = X[ie], ke = se[ie]; if (fe !== ke) if (a.isPlainObject(fe) && a.isPlainObject(ke)) { if (He(fe, ke)) return true; } else if (Array.isArray(fe) && Array.isArray(ke)) { if (fe.length !== ke.length) return true; for (var _e = 0; _e < fe.length; _e++) if (fe[_e] !== ke[_e]) if (a.isPlainObject(fe[_e]) && a.isPlainObject(ke[_e])) { if (He(fe[_e], ke[_e])) return true; } else return true; } else return true; } } function pt(X, se, ie) { if (X = a.getGraphDiv(X), !a.isPlotDiv(X)) throw new Error( "This element is not a Plotly plot: " + X + ". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/" ); var fe = X._transitionData; fe._frameQueue || (fe._frameQueue = []), ie = f.supplyAnimationDefaults(ie); var ke = ie.transition, _e = ie.frame; fe._frameWaitingCnt === void 0 && (fe._frameWaitingCnt = 0); function Ge(oe) { return Array.isArray(ke) ? oe >= ke.length ? ke[0] : ke[oe] : ke; } function je(oe) { return Array.isArray(_e) ? oe >= _e.length ? _e[0] : _e[oe] : _e; } function Ee(oe, Ce) { var Be = 0; return function() { if (oe && ++Be === Ce) return oe(); }; } return new Promise(function(oe, Ce) { function Be() { if (fe._frameQueue.length !== 0) { for (; fe._frameQueue.length; ) { var Ct = fe._frameQueue.pop(); Ct.onInterrupt && Ct.onInterrupt(); } X.emit("plotly_animationinterrupted", []); } } function Xe(Ct) { if (Ct.length !== 0) { for (var tr = 0; tr < Ct.length; tr++) { var Ht; Ct[tr].type === "byname" ? Ht = f.computeFrame(X, Ct[tr].name) : Ht = Ct[tr].data; var $r = je(tr), ar = Ge(tr); ar.duration = Math.min(ar.duration, $r.duration); var Pr = { frame: Ht, name: Ct[tr].name, frameOpts: $r, transitionOpts: ar }; tr === Ct.length - 1 && (Pr.onComplete = Ee(oe, 2), Pr.onInterrupt = Ce), fe._frameQueue.push(Pr); } ie.mode === "immediate" && (fe._lastFrameAt = -1 / 0), fe._animationRaf || It(); } } function Et() { X.emit("plotly_animated"), window.cancelAnimationFrame(fe._animationRaf), fe._animationRaf = null; } function Pt() { fe._currentFrame && fe._currentFrame.onComplete && fe._currentFrame.onComplete(); var Ct = fe._currentFrame = fe._frameQueue.shift(); if (Ct) { var tr = Ct.name ? Ct.name.toString() : null; X._fullLayout._currentFrame = tr, fe._lastFrameAt = Date.now(), fe._timeToNext = Ct.frameOpts.duration, f.transition( X, Ct.frame.data, Ct.frame.layout, _.coerceTraceIndices(X, Ct.frame.traces), Ct.frameOpts, Ct.transitionOpts ).then(function() { Ct.onComplete && Ct.onComplete(); }), X.emit("plotly_animatingframe", { name: tr, frame: Ct.frame, animation: { frame: Ct.frameOpts, transition: Ct.transitionOpts } }); } else Et(); } function It() { X.emit("plotly_animating"), fe._lastFrameAt = -1 / 0, fe._timeToNext = 0, fe._runningTransitions = 0, fe._currentFrame = null; var Ct = function() { fe._animationRaf = window.requestAnimationFrame(Ct), Date.now() - fe._lastFrameAt > fe._timeToNext && Pt(); }; Ct(); } var kt = 0; function qt(Ct) { return Array.isArray(ke) ? kt >= ke.length ? Ct.transitionOpts = ke[kt] : Ct.transitionOpts = ke[0] : Ct.transitionOpts = ke, kt++, Ct; } var Ot, wt, Yt = [], Kt = se == null, $t = Array.isArray(se), zt = !Kt && !$t && a.isPlainObject(se); if (zt) Yt.push({ type: "object", data: qt(a.extendFlat({}, se)) }); else if (Kt || ["string", "number"].indexOf(typeof se) !== -1) for (Ot = 0; Ot < fe._frames.length; Ot++) wt = fe._frames[Ot], wt && (Kt || String(wt.group) === String(se)) && Yt.push({ type: "byname", name: String(wt.name), data: qt({ name: wt.name }) }); else if ($t) for (Ot = 0; Ot < se.length; Ot++) { var Mt = se[Ot]; ["number", "string"].indexOf(typeof Mt) !== -1 ? (Mt = String(Mt), Yt.push({ type: "byname", name: Mt, data: qt({ name: Mt }) })) : a.isPlainObject(Mt) && Yt.push({ type: "object", data: qt(a.extendFlat({}, Mt)) }); } for (Ot = 0; Ot < Yt.length; Ot++) if (wt = Yt[Ot], wt.type === "byname" && !fe._frameHash[wt.data.name]) { a.warn('animate failure: frame not found: "' + wt.data.name + '"'), Ce(); return; } ["next", "immediate"].indexOf(ie.mode) !== -1 && Be(), ie.direction === "reverse" && Yt.reverse(); var St = X._fullLayout._currentFrame; if (St && ie.fromcurrent) { var Ut = -1; for (Ot = 0; Ot < Yt.length; Ot++) if (wt = Yt[Ot], wt.type === "byname" && wt.name === St) { Ut = Ot; break; } if (Ut > 0 && Ut < Yt.length - 1) { var fr = []; for (Ot = 0; Ot < Yt.length; Ot++) wt = Yt[Ot], (Yt[Ot].type !== "byname" || Ot > Ut) && fr.push(wt); Yt = fr; } } Yt.length > 0 ? Xe(Yt) : (X.emit("plotly_animated"), oe()); }); } function bt(X, se, ie) { if (X = a.getGraphDiv(X), se == null) return Promise.resolve(); if (!a.isPlotDiv(X)) throw new Error( "This element is not a Plotly plot: " + X + ". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/" ); var fe, ke, _e, Ge, je = X._transitionData._frames, Ee = X._transitionData._frameHash; if (!Array.isArray(se)) throw new Error("addFrames failure: frameList must be an Array of frame definitions" + se); var oe = je.length + se.length * 2, Ce = [], Be = {}; for (fe = se.length - 1; fe >= 0; fe--) if (a.isPlainObject(se[fe])) { var Xe = se[fe].name, Et = (Ee[Xe] || Be[Xe] || {}).name, Pt = se[fe].name, It = Ee[Et] || Be[Et]; Et && Pt && typeof Pt == "number" && It && L < F && (L++, a.warn('addFrames: overwriting frame "' + (Ee[Et] || Be[Et]).name + '" with a frame whose name of type "number" also equates to "' + Et + '". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'), L === F && a.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")), Be[Xe] = { name: Xe }, Ce.push({ frame: f.supplyFrameDefaults(se[fe]), index: ie && ie[fe] !== void 0 && ie[fe] !== null ? ie[fe] : oe + fe }); } Ce.sort(function(zt, Mt) { return zt.index > Mt.index ? -1 : zt.index < Mt.index ? 1 : 0; }); var kt = [], qt = [], Ot = je.length; for (fe = Ce.length - 1; fe >= 0; fe--) { if (ke = Ce[fe].frame, typeof ke.name == "number" && a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"), !ke.name) for (; Ee[ke.name = "frame " + X._transitionData._counter++]; ) ; if (Ee[ke.name]) { for (_e = 0; _e < je.length && (je[_e] || {}).name !== ke.name; _e++) ; kt.push({ type: "replace", index: _e, value: ke }), qt.unshift({ type: "replace", index: _e, value: je[_e] }); } else Ge = Math.max(0, Math.min(Ce[fe].index, Ot)), kt.push({ type: "insert", index: Ge, value: ke }), qt.unshift({ type: "delete", index: Ge }), Ot++; } var wt = f.modifyFrames, Yt = f.modifyFrames, Kt = [X, qt], $t = [X, kt]; return l && l.add(X, wt, Kt, Yt, $t), f.modifyFrames(X, kt); } function Ke(X, se) { if (X = a.getGraphDiv(X), !a.isPlotDiv(X)) throw new Error("This element is not a Plotly plot: " + X); var ie, fe, ke = X._transitionData._frames, _e = [], Ge = []; if (!se) for (se = [], ie = 0; ie < ke.length; ie++) se.push(ie); for (se = se.slice(), se.sort(), ie = se.length - 1; ie >= 0; ie--) fe = se[ie], _e.push({ type: "delete", index: fe }), Ge.unshift({ type: "insert", index: fe, value: ke[fe] }); var je = f.modifyFrames, Ee = f.modifyFrames, oe = [X, Ge], Ce = [X, _e]; return l && l.add(X, je, oe, Ee, Ce), f.modifyFrames(X, _e); } function st(X) { X = a.getGraphDiv(X); var se = X._fullLayout || {}, ie = X._fullData || []; return f.cleanPlot([], {}, ie, se), f.purge(X), o.purge(X), se._container && se._container.remove(), delete X._context, X; } function rt(X) { var se = X._fullLayout, ie = X.getBoundingClientRect(); if (!a.equalDomRects(ie, se._lastBBox)) { var fe = se._invTransform = a.inverseTransformMatrix(a.getFullTransformMatrix(X)); se._invScaleX = Math.sqrt(fe[0][0] * fe[0][0] + fe[0][1] * fe[0][1] + fe[0][2] * fe[0][2]), se._invScaleY = Math.sqrt(fe[1][0] * fe[1][0] + fe[1][1] * fe[1][1] + fe[1][2] * fe[1][2]), se._lastBBox = ie; } } function ct(X) { var se = t.select(X), ie = X._fullLayout; if (ie._calcInverseTransform = rt, ie._calcInverseTransform(X), ie._container = se.selectAll(".plot-container").data([0]), ie._container.enter().insert("div", ":first-child").classed("plot-container", true).classed("plotly", true), ie._paperdiv = ie._container.selectAll(".svg-container").data([0]), ie._paperdiv.enter().append("div").classed("user-select-none", true).classed("svg-container", true).style("position", "relative"), ie._glcontainer = ie._paperdiv.selectAll(".gl-container").data([{}]), ie._glcontainer.enter().append("div").classed("gl-container", true), ie._paperdiv.selectAll(".main-svg").remove(), ie._paperdiv.select(".modebar-container").remove(), ie._paper = ie._paperdiv.insert("svg", ":first-child").classed("main-svg", true), ie._toppaper = ie._paperdiv.append("svg").classed("main-svg", true), ie._modebardiv = ie._paperdiv.append("div"), delete ie._modeBar, ie._hoverpaper = ie._paperdiv.append("svg").classed("main-svg", true), !ie._uid) { var fe = {}; t.selectAll("defs").each(function() { this.id && (fe[this.id.split("-")[1]] = 1); }), ie._uid = a.randstr(fe); } ie._paperdiv.selectAll(".main-svg").attr(y.svgAttrs), ie._defs = ie._paper.append("defs").attr("id", "defs-" + ie._uid), ie._clips = ie._defs.append("g").classed("clips", true), ie._topdefs = ie._toppaper.append("defs").attr("id", "topdefs-" + ie._uid), ie._topclips = ie._topdefs.append("g").classed("clips", true), ie._bgLayer = ie._paper.append("g").classed("bglayer", true), ie._draggers = ie._paper.append("g").classed("draglayer", true); var ke = ie._paper.append("g").classed("layer-below", true); ie._imageLowerLayer = ke.append("g").classed("imagelayer", true), ie._shapeLowerLayer = ke.append("g").classed("shapelayer", true), ie._cartesianlayer = ie._paper.append("g").classed("cartesianlayer", true), ie._polarlayer = ie._paper.append("g").classed("polarlayer", true), ie._smithlayer = ie._paper.append("g").classed("smithlayer", true), ie._ternarylayer = ie._paper.append("g").classed("ternarylayer", true), ie._geolayer = ie._paper.append("g").classed("geolayer", true), ie._funnelarealayer = ie._paper.append("g").classed("funnelarealayer", true), ie._pielayer = ie._paper.append("g").classed("pielayer", true), ie._iciclelayer = ie._paper.append("g").classed("iciclelayer", true), ie._treemaplayer = ie._paper.append("g").classed("treemaplayer", true), ie._sunburstlayer = ie._paper.append("g").classed("sunburstlayer", true), ie._indicatorlayer = ie._toppaper.append("g").classed("indicatorlayer", true), ie._glimages = ie._paper.append("g").classed("glimages", true); var _e = ie._toppaper.append("g").classed("layer-above", true); ie._imageUpperLayer = _e.append("g").classed("imagelayer", true), ie._shapeUpperLayer = _e.append("g").classed("shapelayer", true), ie._selectionLayer = ie._toppaper.append("g").classed("selectionlayer", true), ie._infolayer = ie._toppaper.append("g").classed("infolayer", true), ie._menulayer = ie._toppaper.append("g").classed("menulayer", true), ie._zoomlayer = ie._toppaper.append("g").classed("zoomlayer", true), ie._hoverlayer = ie._hoverpaper.append("g").classed("hoverlayer", true), ie._modebardiv.classed("modebar-container", true).style("position", "absolute").style("top", "0px").style("right", "0px"), X.emit("plotly_framework"); } e10.animate = pt, e10.addFrames = bt, e10.deleteFrames = Ke, e10.addTraces = U, e10.deleteTraces = Z, e10.extendTraces = ue, e10.moveTraces = le, e10.prependTraces = j, e10.newPlot = P, e10._doPlot = $, e10.purge = st, e10.react = it, e10.redraw = z, e10.relayout = Fe, e10.restyle = J, e10.setPlotConfig = O, e10.update = ot, e10._guiRelayout = ht(Fe), e10._guiRestyle = ht(J), e10._guiUpdate = ht(ot), e10._storeDirectGUIEdit = me; })(ob); var jn = {}; var Iee = Nt; jn.getDelay = function(e10) { return e10._has && (e10._has("gl3d") || e10._has("gl2d") || e10._has("mapbox")) ? 500 : 0; }; jn.getRedrawFunc = function(e10) { return function() { Iee.getComponentMethod("colorbar", "draw")(e10); }; }; jn.encodeSVG = function(e10) { return "data:image/svg+xml," + encodeURIComponent(e10); }; jn.encodeJSON = function(e10) { return "data:application/json," + encodeURIComponent(e10); }; var ME = window.URL || window.webkitURL; jn.createObjectURL = function(e10) { return ME.createObjectURL(e10); }; jn.revokeObjectURL = function(e10) { return ME.revokeObjectURL(e10); }; jn.createBlob = function(e10, t) { if (t === "svg") return new window.Blob([e10], { type: "image/svg+xml;charset=utf-8" }); if (t === "full-json") return new window.Blob([e10], { type: "application/json;charset=utf-8" }); var r = Nee(window.atob(e10)); return new window.Blob([r], { type: "image/" + t }); }; jn.octetStream = function(e10) { document.location.href = "data:application/octet-stream" + e10; }; function Nee(e10) { for (var t = e10.length, r = new ArrayBuffer(t), n = new Uint8Array(r), a = 0; a < t; a++) n[a] = e10.charCodeAt(a); return r; } jn.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; jn.MSG_IE_BAD_FORMAT = "Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."; var Uy = lr; var Oee = Ue; var Hee = Sr; var Bee = nr; var ph = yl; var jg = /"/g; var ac = "TOBESTRIPPED"; var jee = new RegExp('("' + ac + ")|(" + ac + '")', "g"); function Uee(e10) { var t = Uy.select("body").append("div").style({ display: "none" }).html(""), r = e10.replace(/(&[^;]*;)/gi, function(n) { return n === "<" ? "<" : n === "&rt;" ? ">" : n.indexOf("<") !== -1 || n.indexOf(">") !== -1 ? "" : t.html(n).text(); }); return t.remove(), r; } function Gee(e10) { return e10.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g, "&"); } var n_ = function(t, r, n) { var a = t._fullLayout, i = a._paper, o = a._toppaper, l = a.width, s = a.height, u; i.insert("rect", ":first-child").call(Hee.setRect, 0, 0, l, s).call(Bee.fill, a.paper_bgcolor); var f = a._basePlotModules || []; for (u = 0; u < f.length; u++) { var d = f[u]; d.toSVG && d.toSVG(t); } if (o) { var h = o.node().childNodes, p = Array.prototype.slice.call(h); for (u = 0; u < p.length; u++) { var v = p[u]; v.childNodes.length && i.node().appendChild(v); } } a._draggers && a._draggers.remove(), i.node().style.background = "", i.selectAll("text").attr({ "data-unformatted": null, "data-math": null }).each(function() { var g = Uy.select(this); if (this.style.visibility === "hidden" || this.style.display === "none") { g.remove(); return; } else g.style({ visibility: null, display: null }); var y = this.style.fontFamily; y && y.indexOf('"') !== -1 && g.style("font-family", y.replace(jg, ac)); }), i.selectAll(".gradient_filled,.pattern_filled").each(function() { var g = Uy.select(this), y = this.style.fill; y && y.indexOf("url(") !== -1 && g.style("fill", y.replace(jg, ac)); var w = this.style.stroke; w && w.indexOf("url(") !== -1 && g.style("stroke", w.replace(jg, ac)); }), (r === "pdf" || r === "eps") && i.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width", 0), i.node().setAttributeNS(ph.xmlns, "xmlns", ph.svg), i.node().setAttributeNS(ph.xmlns, "xmlns:xlink", ph.xlink), r === "svg" && n && (i.attr("width", n * l), i.attr("height", n * s), i.attr("viewBox", "0 0 " + l + " " + s)); var m = new window.XMLSerializer().serializeToString(i.node()); return m = Uee(m), m = Gee(m), m = m.replace(jee, "'"), Oee.isIE() && (m = m.replace(/"/gi, "'"), m = m.replace(/(\('#)([^']*)('\))/gi, '("#$2")'), m = m.replace(/(\\')/gi, '"')), m; }; var FA = Ue; var Vee = sb.EventEmitter; var Bs = jn; function qee(e10) { var t = e10.emitter || new Vee(), r = new Promise(function(n, a) { var i = window.Image, o = e10.svg, l = e10.format || "png"; if (FA.isIE() && l !== "svg") { var s = new Error(Bs.MSG_IE_BAD_FORMAT); return a(s), e10.promise ? r : t.emit("error", s); } var u = e10.canvas, f = e10.scale || 1, d = e10.width || 300, h = e10.height || 150, p = f * d, v = f * h, m = u.getContext("2d", { willReadFrequently: true }), g = new i(), y, w; l === "svg" || FA.isSafari() ? w = Bs.encodeSVG(o) : (y = Bs.createBlob(o, "svg"), w = Bs.createObjectURL(y)), u.width = p, u.height = v, g.onload = function() { var k; switch (y = null, Bs.revokeObjectURL(w), l !== "svg" && m.drawImage(g, 0, 0, p, v), l) { case "jpeg": k = u.toDataURL("image/jpeg"); break; case "png": k = u.toDataURL("image/png"); break; case "webp": k = u.toDataURL("image/webp"); break; case "svg": k = w; break; default: var x = "Image format is not jpeg, png, svg or webp."; if (a(new Error(x)), !e10.promise) return t.emit("error", x); } n(k), e10.promise || t.emit("success", k); }, g.onerror = function(k) { if (y = null, Bs.revokeObjectURL(w), a(k), !e10.promise) return t.emit("error", k); }, g.src = w; }); return e10.promise ? r : t; } var a_ = qee; var RA = sr; var PA = ob; var Wee = Tn; var Di = Ue; var Hf = jn; var Zee = n_; var Yee = a_; var Xee = ap.version; var Ug = { format: { valType: "enumerated", values: ["png", "jpeg", "webp", "svg", "full-json"], dflt: "png", description: "Sets the format of exported image." }, width: { valType: "number", min: 1, description: [ "Sets the exported image width.", "Defaults to the value found in `layout.width`", "If set to *null*, the exported image width will match the current graph width." ].join(" ") }, height: { valType: "number", min: 1, description: [ "Sets the exported image height.", "Defaults to the value found in `layout.height`", "If set to *null*, the exported image height will match the current graph height." ].join(" ") }, scale: { valType: "number", min: 0, dflt: 1, description: [ "Sets a scaling for the generated image.", "If set, all features of a graphs (e.g. text, line width)", "are scaled, unlike simply setting", "a bigger *width* and *height*." ].join(" ") }, setBackground: { valType: "any", dflt: false, description: [ "Sets the image background mode.", "By default, the image background is determined by `layout.paper_bgcolor`,", "the *transparent* mode.", "One might consider setting `setBackground` to *opaque*", "when exporting a *jpeg* image as JPEGs do not support opacity." ].join(" ") }, imageDataOnly: { valType: "boolean", dflt: false, description: [ "Determines whether or not the return value is prefixed by", "the image format's corresponding 'data:image;' spec." ].join(" ") } }; function Kee(e10, t) { t = t || {}; var r, n, a, i; Di.isPlainObject(e10) ? (r = e10.data || [], n = e10.layout || {}, a = e10.config || {}, i = {}) : (e10 = Di.getGraphDiv(e10), r = Di.extendDeep([], e10.data), n = Di.extendDeep({}, e10.layout), a = e10._context, i = e10._fullLayout || {}); function o(T) { return !(T in t) || Di.validate(t[T], Ug[T]); } if (!o("width") && t.width !== null || !o("height") && t.height !== null) throw new Error("Height and width should be pixel values."); if (!o("format")) throw new Error("Export format is not " + Di.join2(Ug.format.values, ", ", " or ") + "."); var l = {}; function s(T, S) { return Di.coerce(t, l, Ug, T, S); } var u = s("format"), f = s("width"), d = s("height"), h = s("scale"), p = s("setBackground"), v = s("imageDataOnly"), m = document.createElement("div"); m.style.position = "absolute", m.style.left = "-5000px", document.body.appendChild(m); var g = Di.extendFlat({}, n); f ? g.width = f : t.width === null && RA(i.width) && (g.width = i.width), d ? g.height = d : t.height === null && RA(i.height) && (g.height = i.height); var y = Di.extendFlat({}, a, { _exportedPlot: true, staticPlot: true, setBackground: p }), w = Hf.getRedrawFunc(m); function k() { return new Promise(function(T) { setTimeout(T, Hf.getDelay(m._fullLayout)); }); } function x() { return new Promise(function(T, S) { var M = Zee(m, u, h), L = m._fullLayout.width, F = m._fullLayout.height; function $() { PA.purge(m), document.body.removeChild(m); } if (u === "full-json") { var I = Wee.graphJson(m, false, "keepdata", "object", true, true); return I.version = Xee, I = JSON.stringify(I), $(), T(v ? I : Hf.encodeJSON(I)); } if ($(), u === "svg") return T(v ? M : Hf.encodeSVG(M)); var O = document.createElement("canvas"); O.id = Di.randstr(), Yee({ format: u, width: L, height: F, scale: h, canvas: O, svg: M, // ask svgToImg to return a Promise // rather than EventEmitter // leave EventEmitter for backward // compatibility promise: true }).then(T).catch(S); }); } function _(T) { return v ? T.replace(Hf.IMAGE_URL_PREFIX, "") : T; } return new Promise(function(T, S) { PA.newPlot(m, r, g, y).then(w).then(k).then(x).then(function(M) { T(_(M)); }).catch(function(M) { S(M); }); }); } var SE = Kee; var qa = Ue; var Jee = Tn; var Qee = Qu; var ete = Yu.dfltConfig; var Pa = qa.isPlainObject; var ol = Array.isArray; var $A = qa.isArrayOrTypedArray; var tte = function(t, r) { t === void 0 && (t = []), r === void 0 && (r = {}); var n = Qee.get(), a = [], i = { _context: qa.extendFlat({}, ete) }, o, l; ol(t) ? (i.data = qa.extendDeep([], t), o = t) : (i.data = [], o = [], a.push(rn("array", "data"))), Pa(r) ? (i.layout = qa.extendDeep({}, r), l = r) : (i.layout = {}, l = {}, arguments.length > 1 && a.push(rn("object", "layout"))), Jee.supplyDefaults(i); for (var s = i._fullData, u = o.length, f = 0; f < u; f++) { var d = o[f], h = ["data", f]; if (!Pa(d)) { a.push(rn("object", h)); continue; } var p = s[f], v = p.type, m = n.traces[v].attributes; m.type = { valType: "enumerated", values: [v] }, p.visible === false && d.visible !== false && a.push(rn("invisible", h)), ic(d, p, m, a, h); var g = d.transforms, y = p.transforms; if (g) { ol(g) || a.push(rn("array", h, ["transforms"])), h.push("transforms"); for (var w = 0; w < g.length; w++) { var k = ["transforms", w], x = g[w].type; if (!Pa(g[w])) { a.push(rn("object", h, k)); continue; } var _ = n.transforms[x] ? n.transforms[x].attributes : {}; _.type = { valType: "enumerated", values: Object.keys(n.transforms) }, ic(g[w], y[w], _, a, h, k); } } } var T = i._fullLayout, S = rte(n, s); return ic(l, T, S, a, "layout"), a.length === 0 ? void 0 : a; }; function ic(e10, t, r, n, a, i) { i = i || []; for (var o = Object.keys(e10), l = 0; l < o.length; l++) { var s = o[l]; if (s !== "transforms") { var u = i.slice(); u.push(s); var f = e10[s], d = t[s], h = ite(r, s), p = (h || {}).valType, v = p === "info_array", m = p === "colorscale", g = (h || {}).items; if (!ate(r, s)) n.push(rn("schema", a, u)); else if (Pa(f) && Pa(d) && p !== "any") ic(f, d, h, n, a, u); else if (v && ol(f)) { f.length > d.length && n.push(rn("unused", a, u.concat(d.length))); var y = d.length, w = Array.isArray(g); w && (y = Math.min(y, g.length)); var k, x, _, T, S; if (h.dimensions === 2) for (x = 0; x < y; x++) if (ol(f[x])) { f[x].length > d[x].length && n.push(rn("unused", a, u.concat(x, d[x].length))); var M = d[x].length; for (k = 0; k < (w ? Math.min(M, g[x].length) : M); k++) _ = w ? g[x][k] : g, T = f[x][k], S = d[x][k], qa.validate(T, _) ? S !== T && S !== +T && n.push(rn("dynamic", a, u.concat(x, k), T, S)) : n.push(rn("value", a, u.concat(x, k), T)); } else n.push(rn("array", a, u.concat(x), f[x])); else for (x = 0; x < y; x++) _ = w ? g[x] : g, T = f[x], S = d[x], qa.validate(T, _) ? S !== T && S !== +T && n.push(rn("dynamic", a, u.concat(x), T, S)) : n.push(rn("value", a, u.concat(x), T)); } else if (h.items && !v && ol(f)) { var L = g[Object.keys(g)[0]], F = [], $, I; for ($ = 0; $ < d.length; $++) { var O = d[$]._index || $; if (I = u.slice(), I.push(O), Pa(f[O]) && Pa(d[$])) { F.push(O); var G = f[O], K = d[$]; Pa(G) && G.visible !== false && K.visible === false ? n.push(rn("invisible", a, I)) : ic(G, K, L, n, a, I); } } for ($ = 0; $ < f.length; $++) I = u.slice(), I.push($), Pa(f[$]) ? F.indexOf($) === -1 && n.push(rn("unused", a, I)) : n.push(rn("object", a, I, f[$])); } else !Pa(f) && Pa(d) ? n.push(rn("object", a, u, f)) : !$A(f) && $A(d) && !v && !m ? n.push(rn("array", a, u, f)) : s in t ? qa.validate(f, h) ? h.valType === "enumerated" && (h.coerceNumber && f !== +d || f !== d) && n.push(rn("dynamic", a, u, f, d)) : n.push(rn("value", a, u, f)) : n.push(rn("unused", a, u, f)); } } return n; } function rte(e10, t) { for (var r = e10.layout.layoutAttributes, n = 0; n < t.length; n++) { var a = t[n], i = e10.traces[a.type], o = i.layoutAttributes; o && (a.subplot ? qa.extendFlat(r[i.attributes.subplot.dflt], o) : qa.extendFlat(r, o)); } return r; } var nte = { object: function(e10, t) { var r; return e10 === "layout" && t === "" ? r = "The layout argument" : e10[0] === "data" && t === "" ? r = "Trace " + e10[1] + " in the data argument" : r = Fl(e10) + "key " + t, r + " must be linked to an object container"; }, array: function(e10, t) { var r; return e10 === "data" ? r = "The data argument" : r = Fl(e10) + "key " + t, r + " must be linked to an array container"; }, schema: function(e10, t) { return Fl(e10) + "key " + t + " is not part of the schema"; }, unused: function(e10, t, r) { var n = Pa(r) ? "container" : "key"; return Fl(e10) + n + " " + t + " did not get coerced"; }, dynamic: function(e10, t, r, n) { return [ Fl(e10) + "key", t, "(set to '" + r + "')", "got reset to", "'" + n + "'", "during defaults." ].join(" "); }, invisible: function(e10, t) { return (t ? Fl(e10) + "item " + t : "Trace " + e10[1]) + " got defaulted to be not visible"; }, value: function(e10, t, r) { return [ Fl(e10) + "key " + t, "is set to an invalid value (" + r + ")" ].join(" "); } }; function Fl(e10) { return ol(e10) ? "In data trace " + e10[1] + ", " : "In " + e10 + ", "; } function rn(e10, t, r, n, a) { r = r || ""; var i, o; ol(t) ? (i = t[0], o = t[1]) : (i = t, o = null); var l = lte(r), s = nte[e10](t, l, n, a); return qa.log(s), { code: e10, container: i, trace: o, path: r, astr: l, msg: s }; } function ate(e10, t) { var r = CE(t), n = r.keyMinusId, a = r.id; return n in e10 && e10[n]._isSubplotObj && a ? true : t in e10; } function ite(e10, t) { if (t in e10) return e10[t]; var r = CE(t); return e10[r.keyMinusId]; } var ote = qa.counterRegex("([a-z]+)"); function CE(e10) { var t = e10.match(ote); return { keyMinusId: t && t[1], id: t && t[2] }; } function lte(e10) { if (!ol(e10)) return String(e10); for (var t = "", r = 0; r < e10.length; r++) { var n = e10[r]; typeof n == "number" ? t = t.substr(0, t.length - 1) + "[" + n + "]" : t += n, r < e10.length - 1 && (t += "."); } return t; } var zA = Ue; var Bf = jn; function ste(e10, t, r) { var n = document.createElement("a"), a = "download" in n, i = new Promise(function(o, l) { var s, u; if (zA.isIE()) return s = Bf.createBlob(e10, "svg"), window.navigator.msSaveBlob(s, t), s = null, o(t); if (a) return s = Bf.createBlob(e10, r), u = Bf.createObjectURL(s), n.href = u, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n), Bf.revokeObjectURL(u), s = null, o(t); if (zA.isSafari()) { var f = r === "svg" ? "," : ";base64,"; return Bf.octetStream(f + encodeURIComponent(e10)), o(t); } l(new Error("download error")); }); return i; } var ute = ste; var Gg = Ue; var fte = SE; var cte = ute; var dte = jn; function hte(e10, t) { var r; return Gg.isPlainObject(e10) || (r = Gg.getGraphDiv(e10)), t = t || {}, t.format = t.format || "png", t.width = t.width || null, t.height = t.height || null, t.imageDataOnly = true, new Promise(function(n, a) { r && r._snapshotInProgress && a(new Error("Snapshotting already in progress.")), Gg.isIE() && t.format !== "svg" && a(new Error(dte.MSG_IE_BAD_FORMAT)), r && (r._snapshotInProgress = true); var i = fte(e10, t), o = t.filename || e10.fn || "newplot"; o += "." + t.format.replace("-", "."), i.then(function(l) { return r && (r._snapshotInProgress = false), cte(l, o, t.format); }).then(function(l) { n(l); }).catch(function(l) { r && (r._snapshotInProgress = false), a(l); }); }); } var LE = hte; var i_ = {}; var la = Ue; var sa = la.isPlainObject; var DE = Qu; var EE = Tn; var vte = Wi; var FE = Mr; var RE = Yu.dfltConfig; i_.makeTemplate = function(e10) { e10 = la.isPlainObject(e10) ? e10 : la.getGraphDiv(e10), e10 = la.extendDeep({ _context: RE }, { data: e10.data, layout: e10.layout }), EE.supplyDefaults(e10); var t = e10.data || [], r = e10.layout || {}; r._basePlotModules = e10._fullLayout._basePlotModules, r._modules = e10._fullLayout._modules; var n = { data: {}, layout: {} }; t.forEach(function(p) { var v = {}; oc(p, v, mte.bind(null, p)); var m = la.coerce(p, {}, vte, "type"), g = n.data[m]; g || (g = n.data[m] = []), g.push(v); }), oc(r, n.layout, pte.bind(null, r)), delete n.layout.template; var a = r.template; if (sa(a)) { var i = a.layout, o, l, s, u, f, d; sa(i) && Mv(i, n.layout); var h = a.data; if (sa(h)) { for (l in n.data) if (s = h[l], Array.isArray(s)) { for (f = n.data[l], d = f.length, u = s.length, o = 0; o < d; o++) Mv(s[o % u], f[o]); for (o = d; o < u; o++) f.push(la.extendDeep({}, s[o])); } for (l in h) l in n.data || (n.data[l] = la.extendDeep([], h[l])); } } return n; }; function Mv(e10, t) { e10 = la.extendDeep({}, e10); var r = Object.keys(e10).sort(), n, a; function i(f, d, h) { if (sa(d) && sa(f)) Mv(f, d); else if (Array.isArray(d) && Array.isArray(f)) { var p = FE.arrayTemplater({ _template: e10 }, h); for (a = 0; a < d.length; a++) { var v = d[a], m = p.newItem(v)._template; m && Mv(m, v); } var g = p.defaultItems(); for (a = 0; a < g.length; a++) d.push(g[a]._template); for (a = 0; a < d.length; a++) delete d[a].templateitemname; } } for (n = 0; n < r.length; n++) { var o = r[n], l = e10[o]; if (o in t ? i(l, t[o], o) : t[o] = l, Sv(o) === o) for (var s in t) { var u = Sv(s); s !== u && u === o && !(s in e10) && i(l, t[s], o); } } } function Sv(e10) { return e10.replace(/[0-9]+$/, ""); } function oc(e10, t, r, n, a) { var i = a && r(a); for (var o in e10) { var l = e10[o], s = $a(e10, o, n), u = $a(e10, o, a), f = r(u); if (!f) { var d = Sv(o); d !== o && (u = $a(e10, d, a), f = r(u)); } if (!(i && i === f) && !(!f || f._noTemplating || f.valType === "data_array" || f.arrayOk && Array.isArray(l))) if (!f.valType && sa(l)) oc(l, t, r, s, u); else if (f._isLinkedToArray && Array.isArray(l)) for (var h = false, p = 0, v = {}, m = 0; m < l.length; m++) { var g = l[m]; if (sa(g)) { var y = g.name; if (y) v[y] || (oc( g, t, r, $a(l, p, s), $a(l, p, u) ), p++, v[y] = 1); else if (!h) { var w = FE.arrayDefaultKey(o), k = $a(e10, w, n), x = $a(l, p, s); oc( g, t, r, x, $a(l, p, u) ); var _ = la.nestedProperty(t, x), T = la.nestedProperty(t, k); T.set(_.get()), _.set(null), h = true; } } } else { var S = la.nestedProperty(t, s); S.set(l); } } } function pte(e10, t) { return DE.getLayoutValObject( e10, la.nestedProperty({}, t).parts ); } function mte(e10, t) { return DE.getTraceValObject( e10, la.nestedProperty({}, t).parts ); } function $a(e10, t, r) { var n; return r ? Array.isArray(e10) ? n = r + "[" + t + "]" : n = r + "." + t : n = t, n; } i_.validateTemplate = function(e10, t) { var r = la.extendDeep({}, { _context: RE, data: e10.data, layout: e10.layout }), n = r.layout || {}; sa(t) || (t = n.template || {}); var a = t.layout, i = t.data, o = []; r.layout = n, r.layout.template = t, EE.supplyDefaults(r); var l = r._fullLayout, s = r._fullData, u = {}; function f(k, x) { for (var _ in k) if (_.charAt(0) !== "_" && sa(k[_])) { var T = Sv(_), S = [], M; for (M = 0; M < x.length; M++) S.push($a(k, _, x[M])), T !== _ && S.push($a(k, T, x[M])); for (M = 0; M < S.length; M++) u[S[M]] = 1; f(k[_], S); } } function d(k, x) { for (var _ in k) if (_.indexOf("defaults") === -1 && sa(k[_])) { var T = $a(k, _, x); u[T] ? d(k[_], T) : o.push({ code: "unused", path: T }); } } if (sa(a) ? (f(l, ["layout"]), d(a, "layout")) : o.push({ code: "layout" }), !sa(i)) o.push({ code: "data" }); else { for (var h = {}, p, v = 0; v < s.length; v++) { var m = s[v]; p = m.type, h[p] = (h[p] || 0) + 1, m._fullInput._template || o.push({ code: "missing", index: m._fullInput.index, traceType: p }); } for (p in i) { var g = i[p].length, y = h[p] || 0; g > y ? o.push({ code: "unused", traceType: p, templateCount: g, dataCount: y }) : y > g && o.push({ code: "reused", traceType: p, templateCount: g, dataCount: y }); } } function w(k, x) { for (var _ in k) if (_.charAt(0) !== "_") { var T = k[_], S = $a(k, _, x); sa(T) ? (Array.isArray(k) && T._template === false && T.templateitemname && o.push({ code: "missing", path: S, templateitemname: T.templateitemname }), w(T, S)) : Array.isArray(T) && gte(T) && w(T, S); } } if (w({ data: s, layout: l }, ""), o.length) return o.map(yte); }; function gte(e10) { for (var t = 0; t < e10.length; t++) if (sa(e10[t])) return true; } function yte(e10) { var t; switch (e10.code) { case "data": t = "The template has no key data."; break; case "layout": t = "The template has no key layout."; break; case "missing": e10.path ? t = "There are no templates for item " + e10.path + " with name " + e10.templateitemname : t = "There are no templates for trace " + e10.index + ", of type " + e10.traceType + "."; break; case "unused": e10.path ? t = "The template item at " + e10.path + " was not used in constructing the plot." : e10.dataCount ? t = "Some of the templates of type " + e10.traceType + " were not used. The template has " + e10.templateCount + " traces, the data only has " + e10.dataCount + " of this type." : t = "The template has " + e10.templateCount + " traces of type " + e10.traceType + " but there are none in the data."; break; case "reused": t = "Some of the templates of type " + e10.traceType + " were used more than once. The template has " + e10.templateCount + " traces, the data has " + e10.dataCount + " of this type."; break; } return e10.msg = t, e10; } var dn = ob; Or._doPlot = dn._doPlot; Or.newPlot = dn.newPlot; Or.restyle = dn.restyle; Or.relayout = dn.relayout; Or.redraw = dn.redraw; Or.update = dn.update; Or._guiRestyle = dn._guiRestyle; Or._guiRelayout = dn._guiRelayout; Or._guiUpdate = dn._guiUpdate; Or._storeDirectGUIEdit = dn._storeDirectGUIEdit; Or.react = dn.react; Or.extendTraces = dn.extendTraces; Or.prependTraces = dn.prependTraces; Or.addTraces = dn.addTraces; Or.deleteTraces = dn.deleteTraces; Or.moveTraces = dn.moveTraces; Or.purge = dn.purge; Or.addFrames = dn.addFrames; Or.deleteFrames = dn.deleteFrames; Or.animate = dn.animate; Or.setPlotConfig = dn.setPlotConfig; var bte = dp.getGraphDiv; var _te = Hb.eraseActiveShape; Or.deleteActiveShape = function(e10) { return _te(bte(e10)); }; Or.toImage = SE; Or.validate = tte; Or.downloadImage = LE; var PE = i_; Or.makeTemplate = PE.makeTemplate; Or.validateTemplate = PE.validateTemplate; var Vg = Ue; var xte = Nt; var $E = function(t, r, n, a) { var i = a("x"), o = a("y"), l, s = xte.getComponentMethod("calendars", "handleTraceDefaults"); if (s(t, r, ["x", "y"], n), i) { var u = Vg.minRowLength(i); o ? l = Math.min(u, Vg.minRowLength(o)) : (l = u, a("y0"), a("dy")); } else { if (!o) return 0; l = Vg.minRowLength(o), a("x0"), a("dx"); } return r._length = l, l; }; var IA = Ue.dateTick0; var wte = Qr; var Tte = wte.ONEWEEK; function NA(e10, t) { return e10 % Tte === 0 ? IA(t, 1) : IA(t, 0); } var o_ = function(t, r, n, a, i) { if (i || (i = { x: true, y: true }), i.x) { var o = a("xperiod"); o && (a("xperiod0", NA(o, r.xcalendar)), a("xperiodalignment")); } if (i.y) { var l = a("yperiod"); l && (a("yperiod0", NA(l, r.ycalendar)), a("yperiodalignment")); } }; var OA = ["orientation", "groupnorm", "stackgaps"]; var kte = function(t, r, n, a) { var i = n._scatterStackOpts, o = a("stackgroup"); if (o) { var l = r.xaxis + r.yaxis, s = i[l]; s || (s = i[l] = {}); var u = s[o], f = false; u ? u.traces.push(r) : (u = s[o] = { // keep track of trace indices for use during stacking calculations // this will be filled in during `calc` and used during `crossTraceCalc` // so it's OK if we don't recreate it during a non-calc edit traceIndices: [], // Hold on to the whole set of prior traces // First one is most important, so we can clear defaults // there if we find explicit values only in later traces. // We're only going to *use* the values stored in groupOpts, // but for the editor and validate we want things self-consistent // The full set of traces is used only to fix `fill` default if // we find `orientation: 'h'` beyond the first trace traces: [r] }, f = true); for (var d = { orientation: r.x && !r.y ? "h" : "v" }, h = 0; h < OA.length; h++) { var p = OA[h], v = p + "Found"; if (!u[v]) { var m = t[p] !== void 0, g = p === "orientation"; if ((m || f) && (u[p] = a(p, d[p]), g && (u.fillDflt = u[p] === "h" ? "tonextx" : "tonexty"), m && (u[v] = true, !f && (delete u.traces[0][p], g)))) for (var y = 0; y < u.traces.length - 1; y++) { var w = u.traces[y]; w._input.fill !== w.fill && (w.fill = u.fillDflt); } } } return u; } }; var HA = nr; var BA = wi.hasColorscale; var jA = ef; var Ate = Ya; var Mte = function(t, r, n, a, i, o) { var l = Ate.isBubble(t), s = (t.line || {}).color, u; if (o = o || {}, s && (n = s), i("marker.symbol"), i("marker.opacity", l ? 0.7 : 1), i("marker.size"), o.noAngle || (i("marker.angle"), o.noAngleRef || i("marker.angleref"), o.noStandOff || i("marker.standoff")), i("marker.color", n), BA(t, "marker") && jA(t, r, a, i, { prefix: "marker.", cLetter: "c" }), o.noSelect || (i("selected.marker.color"), i("unselected.marker.color"), i("selected.marker.size"), i("unselected.marker.size")), o.noLine || (s && !Array.isArray(s) && r.marker.color !== s ? u = s : l ? u = HA.background : u = HA.defaultLine, i("marker.line.color", u), BA(t, "marker.line") && jA(t, r, a, i, { prefix: "marker.line.", cLetter: "c" }), i("marker.line.width", l ? 1 : 0)), l && (i("marker.sizeref"), i("marker.sizemin"), i("marker.sizemode")), o.gradient) { var f = i("marker.gradient.type"); f !== "none" && i("marker.gradient.color"); } }; var Ste = Ue.isArrayOrTypedArray; var Cte = wi.hasColorscale; var Lte = ef; var Dte = function(t, r, n, a, i, o) { o || (o = {}); var l = (t.marker || {}).color; if (l && l._inputArray && (l = l._inputArray), i("line.color", n), Cte(t, "line")) Lte(t, r, a, i, { prefix: "line.", cLetter: "c" }); else { var s = (Ste(l) ? false : l) || n; i("line.color", s); } i("line.width"), o.noDash || i("line.dash"), o.backoff && i("line.backoff"); }; var Ete = function(t, r, n) { var a = n("line.shape"); a === "spline" && n("line.smoothing"); }; var Fte = Ue; var Rte = function(e10, t, r, n, a) { a = a || {}, n("textposition"), Fte.coerceFont(n, "textfont", a.font || r.font), a.noSelect || (n("selected.textfont.color"), n("unselected.textfont.color")); }; var Pte = nr; var UA = Ue.isArrayOrTypedArray; var $te = function(t, r, n, a) { var i = false; if (r.marker) { var o = r.marker.color, l = (r.marker.line || {}).color; o && !UA(o) ? i = o : l && !UA(l) && (i = l); } a("fillcolor", Pte.addOpacity( (r.line || {}).color || i || n, 0.5 )); }; var GA = Ue; var zte = Nt; var Ite = ws; var Nte = e_; var js = Ya; var Ote = $E; var Hte = o_; var Bte = kte; var jte = Mte; var Ute = Dte; var VA = Ete; var Gte = Rte; var Vte = $te; var qte = Ue.coercePattern; var Wte = function(t, r, n, a) { function i(p, v) { return GA.coerce(t, r, Ite, p, v); } var o = Ote(t, r, a, i); if (o || (r.visible = false), !!r.visible) { Hte(t, r, a, i), i("xhoverformat"), i("yhoverformat"); var l = Bte(t, r, a, i); a.scattermode === "group" && r.orientation === void 0 && i("orientation", "v"); var s = !l && o < Nte.PTS_LINESONLY ? "lines+markers" : "lines"; i("text"), i("hovertext"), i("mode", s), js.hasMarkers(r) && jte(t, r, n, a, i, { gradient: true }), js.hasLines(r) && (Ute(t, r, n, a, i, { backoff: true }), VA(t, r, i), i("connectgaps"), i("line.simplify")), js.hasText(r) && (i("texttemplate"), Gte(t, r, a, i)); var u = []; (js.hasMarkers(r) || js.hasText(r)) && (i("cliponaxis"), i("marker.maxdisplayed"), u.push("points")), i("fill", l ? l.fillDflt : "none"), r.fill !== "none" && (Vte(t, r, n, i), js.hasLines(r) || VA(t, r, i), qte(i, "fillpattern", r.fillcolor, false)); var f = (r.line || {}).color, d = (r.marker || {}).color; (r.fill === "tonext" || r.fill === "toself") && u.push("fills"), i("hoveron", u.join("+") || "points"), r.hoveron !== "fills" && i("hovertemplate"); var h = zte.getComponentMethod("errorbars", "supplyDefaults"); h(t, r, f || d || n, { axis: "y" }), h(t, r, f || d || n, { axis: "x", inherit: "y" }), GA.coerceSelectionMarkerOpacity(r, i); } }; var Zte = wl.getAxisGroup; var zE = function(t, r, n, a) { var i = r.orientation, o = r[{ v: "x", h: "y" }[i] + "axis"], l = Zte(n, o) + i, s = n._alignmentOpts || {}, u = a("alignmentgroup"), f = s[l]; f || (f = s[l] = {}); var d = f[u]; d ? d.traces.push(r) : d = f[u] = { traces: [r], alignmentIndex: Object.keys(f).length, offsetGroups: {} }; var h = a("offsetgroup"), p = d.offsetGroups, v = p[h]; h && (v || (v = p[h] = { offsetIndex: Object.keys(p).length }), r._offsetIndex = v.offsetIndex); }; var Yte = Ue; var Xte = zE; var Kte = ws; var Jte = function(t, r) { var n, a, i; function o(d) { return Yte.coerce(a._input, a, Kte, d); } if (r.scattermode === "group") for (i = 0; i < t.length; i++) a = t[i], a.type === "scatter" && (n = a._input, Xte(n, a, r, o)); for (i = 0; i < t.length; i++) { var l = t[i]; if (l.type === "scatter") { var s = l.fill; if (!(s === "none" || s === "toself") && (l.opacity = void 0, s === "tonexty" || s === "tonextx")) for (var u = i - 1; u >= 0; u--) { var f = t[u]; if (f.type === "scatter" && f.xaxis === l.xaxis && f.yaxis === l.yaxis) { f.opacity = void 0; break; } } } } }; var Qte = Ue; var ere = ub; var tre = function(e10, t) { function r(a, i) { return Qte.coerce(e10, t, ere, a, i); } var n = t.barmode === "group"; t.scattermode === "group" && r("scattergap", n ? t.bargap : 0.2); }; var rre = sr; var IE = Ue; var nre = IE.dateTime2ms; var mh = IE.incrementMonth; var are = Qr; var ire = are.ONEAVGMONTH; var Wp = function(t, r, n, a) { if (r.type !== "date") return { vals: a }; var i = t[n + "periodalignment"]; if (!i) return { vals: a }; var o = t[n + "period"], l; if (rre(o)) { if (o = +o, o <= 0) return { vals: a }; } else if (typeof o == "string" && o.charAt(0) === "M") { var s = +o.substring(1); if (s > 0 && Math.round(s) === s) l = s; else return { vals: a }; } for (var u = r.calendar, f = i === "start", d = i === "end", h = t[n + "period0"], p = nre(h, u) || 0, v = [], m = [], g = [], y = a.length, w = 0; w < y; w++) { var k = a[w], x, _, T; if (l) { for (x = Math.round((k - p) / (l * ire)), T = mh(p, l * x, u); T > k; ) T = mh(T, -l, u); for (; T <= k; ) T = mh(T, l, u); _ = mh(T, -l, u); } else { for (x = Math.round((k - p) / o), T = p + x * o; T > k; ) T -= o; for (; T <= k; ) T += o; _ = T - o; } v[w] = f ? _ : d ? T : (_ + T) / 2, m[w] = _, g[w] = T; } return { vals: v, starts: m, ends: g }; }; var qg = wi.hasColorscale; var Wg = Mp; var qA = Ya; var ore = function(t, r) { qA.hasLines(r) && qg(r, "line") && Wg(t, r, { vals: r.line.color, containerStr: "line", cLetter: "c" }), qA.hasMarkers(r) && (qg(r, "marker") && Wg(t, r, { vals: r.marker.color, containerStr: "marker", cLetter: "c" }), qg(r, "marker.line") && Wg(t, r, { vals: r.marker.line.color, containerStr: "marker.line", cLetter: "c" })); }; var Mn = Ue; var NE = function(t, r) { for (var n = 0; n < t.length; n++) t[n].i = n; Mn.mergeArray(r.text, t, "tx"), Mn.mergeArray(r.texttemplate, t, "txt"), Mn.mergeArray(r.hovertext, t, "htx"), Mn.mergeArray(r.customdata, t, "data"), Mn.mergeArray(r.textposition, t, "tp"), r.textfont && (Mn.mergeArrayCastPositive(r.textfont.size, t, "ts"), Mn.mergeArray(r.textfont.color, t, "tc"), Mn.mergeArray(r.textfont.family, t, "tf")); var a = r.marker; if (a) { Mn.mergeArrayCastPositive(a.size, t, "ms"), Mn.mergeArrayCastPositive(a.opacity, t, "mo"), Mn.mergeArray(a.symbol, t, "mx"), Mn.mergeArray(a.angle, t, "ma"), Mn.mergeArray(a.standoff, t, "mf"), Mn.mergeArray(a.color, t, "mc"); var i = a.line; a.line && (Mn.mergeArray(i.color, t, "mlc"), Mn.mergeArrayCastPositive(i.width, t, "mlw")); var o = a.gradient; o && o.type !== "none" && (Mn.mergeArray(o.type, t, "mgt"), Mn.mergeArray(o.color, t, "mgc")); } }; var WA = Ue; var OE = function(t, r) { WA.isArrayOrTypedArray(r.selectedpoints) && WA.tagSelected(t, r); }; var ZA = sr; var Gy = Ue; var Fc = Cr; var YA = Wp; var Zg = Qr.BADNUM; var Vy = Ya; var lre = ore; var sre = NE; var ure = OE; function fre(e10, t) { var r = e10._fullLayout, n = t._xA = Fc.getFromId(e10, t.xaxis || "x", "x"), a = t._yA = Fc.getFromId(e10, t.yaxis || "y", "y"), i = n.makeCalcdata(t, "x"), o = a.makeCalcdata(t, "y"), l = YA(t, n, "x", i), s = YA(t, a, "y", o), u = l.vals, f = s.vals, d = t._length, h = new Array(d), p = t.ids, v = l_(t, r, n, a), m = false, g, y, w, k, x, _; jE(r, t); var T = "x", S = "y", M; if (v) Gy.pushUnique(v.traceIndices, t._expandedIndex), g = v.orientation === "v", g ? (S = "s", M = "x") : (T = "s", M = "y"), x = v.stackgaps === "interpolate"; else { var L = BE(t, d); HE(e10, t, n, a, u, f, L); } var F = !!t.xperiodalignment, $ = !!t.yperiodalignment; for (y = 0; y < d; y++) { var I = h[y] = {}, O = ZA(u[y]), G = ZA(f[y]); O && G ? (I[T] = u[y], I[S] = f[y], F && (I.orig_x = i[y], I.xEnd = l.ends[y], I.xStart = l.starts[y]), $ && (I.orig_y = o[y], I.yEnd = s.ends[y], I.yStart = s.starts[y])) : v && (g ? O : G) ? (I[M] = g ? u[y] : f[y], I.gap = true, x ? (I.s = Zg, m = true) : I.s = 0) : I[T] = I[S] = Zg, p && (I.id = String(p[y])); } if (sre(h, t), lre(e10, t), ure(h, t), v) { for (y = 0; y < h.length; ) h[y][M] === Zg ? h.splice(y, 1) : y++; if (Gy.sort(h, function(P, R) { return P[M] - R[M] || P.i - R.i; }), m) { for (y = 0; y < h.length - 1 && h[y].gap; ) y++; for (_ = h[y].s, _ || (_ = h[y].s = 0), w = 0; w < y; w++) h[w].s = _; for (k = h.length - 1; k > y && h[k].gap; ) k--; for (_ = h[k].s, w = h.length - 1; w > k; w--) h[w].s = _; for (; y < k; ) if (y++, h[y].gap) { for (w = y + 1; h[w].gap; ) w++; for (var K = h[y - 1][M], V = h[y - 1].s, z = (h[w].s - V) / (h[w][M] - K); y < w; ) h[y].s = V + (h[y][M] - K) * z, y++; } } } return h; } function HE(e10, t, r, n, a, i, o) { var l = t._length, s = e10._fullLayout, u = r._id, f = n._id, d = s._firstScatter[UE(t)] === t.uid, h = (l_(t, s, r, n) || {}).orientation, p = t.fill; r._minDtick = 0, n._minDtick = 0; var v = { padded: true }, m = { padded: true }; o && (v.ppad = m.ppad = o); var g = l < 2 || a[0] !== a[l - 1] || i[0] !== i[l - 1]; g && (p === "tozerox" || p === "tonextx" && (d || h === "h")) ? v.tozero = true : !(t.error_y || {}).visible && // if no error bars, markers or text, or fill to y=0 remove x padding (p === "tonexty" || p === "tozeroy" || !Vy.hasMarkers(t) && !Vy.hasText(t)) && (v.padded = false, v.ppad = 0), g && (p === "tozeroy" || p === "tonexty" && (d || h === "v")) ? m.tozero = true : (p === "tonextx" || p === "tozerox") && (m.padded = false), u && (t._extremes[u] = Fc.findExtremes(r, a, v)), f && (t._extremes[f] = Fc.findExtremes(n, i, m)); } function BE(e10, t) { if (Vy.hasMarkers(e10)) { var r = e10.marker, n = 1.6 * (e10.marker.sizeref || 1), a; if (e10.marker.sizemode === "area" ? a = function(u) { return Math.max(Math.sqrt((u || 0) / n), 3); } : a = function(u) { return Math.max((u || 0) / n, 3); }, Gy.isArrayOrTypedArray(r.size)) { var i = { type: "linear" }; Fc.setConvert(i); for (var o = i.makeCalcdata(e10.marker, "size"), l = new Array(t), s = 0; s < t; s++) l[s] = a(o[s]); return l; } else return a(r.size); } } function jE(e10, t) { var r = UE(t), n = e10._firstScatter; n[r] || (n[r] = t.uid); } function UE(e10) { var t = e10.stackgroup; return e10.xaxis + e10.yaxis + e10.type + (t ? "-" + t : ""); } function l_(e10, t, r, n) { var a = e10.stackgroup; if (a) { var i = t._scatterStackOpts[r._id + n._id][a], o = i.orientation === "v" ? n : r; if (o.type === "linear" || o.type === "log") return i; } } var GE = { calc: fre, calcMarkerSize: BE, calcAxisExpansion: HE, setFirstScatter: jE, getStackOpts: l_ }; var cre = Zp; var dre = Ue.distinctVals; function Zp(e10, t) { this.traces = e10, this.sepNegVal = t.sepNegVal, this.overlapNoMerge = t.overlapNoMerge; for (var r = 1 / 0, n = t.posAxis._id.charAt(0), a = [], i = 0; i < e10.length; i++) { for (var o = e10[i], l = 0; l < o.length; l++) { var s = o[l], u = s.p; u === void 0 && (u = s[n]), u !== void 0 && a.push(u); } o[0] && o[0].width1 && (r = Math.min(o[0].width1, r)); } this.positions = a; var f = dre(a); this.distinctPositions = f.vals, f.vals.length === 1 && r !== 1 / 0 ? this.minDiff = r : this.minDiff = Math.min(f.minDiff, r); var d = (t.posAxis || {}).type; (d === "category" || d === "multicategory") && (this.minDiff = 1), this.binWidth = this.minDiff, this.bins = {}; } Zp.prototype.put = function(t, r) { var n = this.getLabel(t, r), a = this.bins[n] || 0; return this.bins[n] = a + r, a; }; Zp.prototype.get = function(t, r) { var n = this.getLabel(t, r); return this.bins[n] || 0; }; Zp.prototype.getLabel = function(t, r) { var n = r < 0 && this.sepNegVal ? "v" : "^", a = this.overlapNoMerge ? t : Math.round(t / this.binWidth); return n + a; }; var cl = sr; var dl = Ue.isArrayOrTypedArray; var $u = Qr.BADNUM; var hre = Nt; var Rc = Cr; var vre = wl.getAxisGroup; var Yp = cre; function pre(e10, t) { for (var r = t.xaxis, n = t.yaxis, a = e10._fullLayout, i = e10._fullData, o = e10.calcdata, l = [], s = [], u = 0; u < i.length; u++) { var f = i[u]; if (f.visible === true && hre.traceIs(f, "bar") && f.xaxis === r._id && f.yaxis === n._id && (f.orientation === "h" ? l.push(o[u]) : s.push(o[u]), f._computePh)) for (var d = e10.calcdata[u], h = 0; h < d.length; h++) typeof d[h].ph0 == "function" && (d[h].ph0 = d[h].ph0()), typeof d[h].ph1 == "function" && (d[h].ph1 = d[h].ph1()); } var p = { xCat: r.type === "category" || r.type === "multicategory", yCat: n.type === "category" || n.type === "multicategory", mode: a.barmode, norm: a.barnorm, gap: a.bargap, groupgap: a.bargroupgap }; qy(e10, r, n, s, p), qy(e10, n, r, l, p); } function qy(e10, t, r, n, a) { if (n.length) { var i, o, l, s, u; switch (mre(r, n), a.mode) { case "overlay": Yg(t, r, n, a); break; case "group": for (i = [], o = [], l = 0; l < n.length; l++) s = n[l], u = s[0].trace, u.offset === void 0 ? o.push(s) : i.push(s); o.length && gre(e10, t, r, o, a), i.length && Yg(t, r, i, a); break; case "stack": case "relative": for (i = [], o = [], l = 0; l < n.length; l++) s = n[l], u = s[0].trace, u.base === void 0 ? o.push(s) : i.push(s); o.length && yre(e10, t, r, o, a), i.length && Yg(t, r, i, a); break; } wre(n, t); } } function mre(e10, t) { var r, n; for (r = 0; r < t.length; r++) { var a = t[r], i = a[0].trace, o = i.type === "funnel" ? i._base : i.base, l, s = i.orientation === "h" ? i.xcalendar : i.ycalendar, u = e10.type === "category" || e10.type === "multicategory" ? function() { return null; } : e10.d2c; if (dl(o)) { for (n = 0; n < Math.min(o.length, a.length); n++) l = u(o[n], 0, s), cl(l) ? (a[n].b = +l, a[n].hasB = 1) : a[n].b = 0; for (; n < a.length; n++) a[n].b = 0; } else { l = u(o, 0, s); var f = cl(l); for (l = f ? l : 0, n = 0; n < a.length; n++) a[n].b = l, f && (a[n].hasB = 1); } } } function Yg(e10, t, r, n) { for (var a = 0; a < r.length; a++) { var i = r[a], o = new Yp([i], { posAxis: e10, sepNegVal: false, overlapNoMerge: !n.norm }); VE(e10, o, n), n.norm ? (XE(o), s_(t, o, n)) : YE(t, o); } } function gre(e10, t, r, n, a) { var i = new Yp(n, { posAxis: t, sepNegVal: false, overlapNoMerge: !a.norm }); bre(e10, t, i, a), xre(i, t), a.norm ? (XE(i), s_(r, i, a)) : YE(r, i); } function yre(e10, t, r, n, a) { var i = new Yp(n, { posAxis: t, sepNegVal: a.mode === "relative", overlapNoMerge: !(a.norm || a.mode === "stack" || a.mode === "relative") }); VE(t, i, a), _re(r, i, a); for (var o = 0; o < n.length; o++) for (var l = n[o], s = 0; s < l.length; s++) { var u = l[s]; if (u.s !== $u) { var f = u.b + u.s === i.get(u.p, u.s); f && (u._outmost = true); } } a.norm && s_(r, i, a); } function VE(e10, t, r) { for (var n = t.minDiff, a = t.traces, i = n * (1 - r.gap), o = i, l = o * (1 - (r.groupgap || 0)), s = -l / 2, u = 0; u < a.length; u++) { var f = a[u], d = f[0].t; d.barwidth = l, d.poffset = s, d.bargroupwidth = i, d.bardelta = n; } t.binWidth = a[0][0].t.barwidth / 100, qE(t), WE(e10, t), ZE(e10, t); } function bre(e10, t, r, n) { for (var a = e10._fullLayout, i = r.positions, o = r.distinctPositions, l = r.minDiff, s = r.traces, u = s.length, f = i.length !== o.length, d = l * (1 - n.gap), h = vre(a, t._id) + s[0][0].trace.orientation, p = a._alignmentOpts[h] || {}, v = 0; v < u; v++) { var m = s[v], g = m[0].trace, y = p[g.alignmentgroup] || {}, w = Object.keys(y.offsetGroups || {}).length, k; w ? k = d / w : k = f ? d / u : d; var x = k * (1 - (n.groupgap || 0)), _; w ? _ = ((2 * g._offsetIndex + 1 - w) * k - x) / 2 : _ = f ? ((2 * v + 1 - u) * k - x) / 2 : -x / 2; var T = m[0].t; T.barwidth = x, T.poffset = _, T.bargroupwidth = d, T.bardelta = l; } r.binWidth = s[0][0].t.barwidth / 100, qE(r), WE(t, r), ZE(t, r, f); } function qE(e10) { var t = e10.traces, r, n; for (r = 0; r < t.length; r++) { var a = t[r], i = a[0], o = i.trace, l = i.t, s = o._offset || o.offset, u = l.poffset, f; if (dl(s)) { for (f = Array.prototype.slice.call(s, 0, a.length), n = 0; n < f.length; n++) cl(f[n]) || (f[n] = u); for (n = f.length; n < a.length; n++) f.push(u); l.poffset = f; } else s !== void 0 && (l.poffset = s); var d = o._width || o.width, h = l.barwidth; if (dl(d)) { var p = Array.prototype.slice.call(d, 0, a.length); for (n = 0; n < p.length; n++) cl(p[n]) || (p[n] = h); for (n = p.length; n < a.length; n++) p.push(h); if (l.barwidth = p, s === void 0) { for (f = [], n = 0; n < a.length; n++) f.push( u + (h - p[n]) / 2 ); l.poffset = f; } } else d !== void 0 && (l.barwidth = d, s === void 0 && (l.poffset = u + (h - d) / 2)); } } function WE(e10, t) { for (var r = t.traces, n = ad(e10), a = 0; a < r.length; a++) for (var i = r[a], o = i[0].t, l = o.poffset, s = dl(l), u = o.barwidth, f = dl(u), d = 0; d < i.length; d++) { var h = i[d], p = h.w = f ? u[d] : u; h.p === void 0 && (h.p = h[n], h["orig_" + n] = h[n]); var v = (s ? l[d] : l) + p / 2; h[n] = h.p + v; } } function ZE(e10, t, r) { var n = t.traces, a = t.minDiff, i = a / 2; Rc.minDtick(e10, t.minDiff, t.distinctPositions[0], r); for (var o = 0; o < n.length; o++) { var l = n[o], s = l[0], u = s.trace, f = [], d, h, p, v; for (v = 0; v < l.length; v++) d = l[v], h = d.p - i, p = d.p + i, f.push(h, p); if (u.width || u.offset) { var m = s.t, g = m.poffset, y = m.barwidth, w = dl(g), k = dl(y); for (v = 0; v < l.length; v++) { d = l[v]; var x = w ? g[v] : g, _ = k ? y[v] : y; h = d.p + x, p = h + _, f.push(h, p); } } u._extremes[e10._id] = Rc.findExtremes(e10, f, { padded: false }); } } function YE(e10, t) { for (var r = t.traces, n = ad(e10), a = 0; a < r.length; a++) { for (var i = r[a], o = i[0].trace, l = o.type === "scatter", s = o.orientation === "v", u = [], f = false, d = 0; d < i.length; d++) { var h = i[d], p = l ? 0 : h.b, v = l ? s ? h.y : h.x : p + h.s; h[n] = v, u.push(v), h.hasB && u.push(p), (!h.hasB || !h.b) && (f = true); } o._extremes[e10._id] = Rc.findExtremes(e10, u, { tozero: f, padded: true }); } } function _re(e10, t, r) { var n = ad(e10), a = t.traces, i, o, l, s, u, f; for (s = 0; s < a.length; s++) if (i = a[s], o = i[0].trace, o.type === "funnel") for (u = 0; u < i.length; u++) f = i[u], f.s !== $u && t.put(f.p, -0.5 * f.s); for (s = 0; s < a.length; s++) { i = a[s], o = i[0].trace, l = o.type === "funnel"; var d = []; for (u = 0; u < i.length; u++) if (f = i[u], f.s !== $u) { var h; l ? h = f.s : h = f.s + f.b; var p = t.put(f.p, h), v = p + h; f.b = p, f[n] = v, r.norm || (d.push(v), f.hasB && d.push(p)); } r.norm || (o._extremes[e10._id] = Rc.findExtremes(e10, d, { // N.B. we don't stack base with 'base', // so set tozero:true always! tozero: true, padded: true })); } } function XE(e10) { for (var t = e10.traces, r = 0; r < t.length; r++) for (var n = t[r], a = 0; a < n.length; a++) { var i = n[a]; i.s !== $u && e10.put(i.p, i.b + i.s); } } function xre(e10, t) { for (var r = e10.traces, n = 0; n < r.length; n++) { var a = r[n], i = a[0].trace; if (i.base === void 0) for (var o = new Yp([a], { posAxis: t, sepNegVal: true, overlapNoMerge: true }), l = 0; l < a.length; l++) { var s = a[l]; if (s.p !== $u) { var u = o.put(s.p, s.b + s.s); u && (s.b = u); } } } } function s_(e10, t, r) { var n = t.traces, a = ad(e10), i = r.norm === "fraction" ? 1 : 100, o = i / 1e9, l = e10.l2c(e10.c2l(0)), s = r.mode === "stack" ? i : l; function u(_) { return cl(e10.c2l(_)) && (_ < l - o || _ > s + o || !cl(l)); } for (var f = 0; f < n.length; f++) { for (var d = n[f], h = d[0].trace, p = [], v = false, m = false, g = 0; g < d.length; g++) { var y = d[g]; if (y.s !== $u) { var w = Math.abs(i / t.get(y.p, y.s)); y.b *= w, y.s *= w; var k = y.b, x = k + y.s; y[a] = x, p.push(x), m = m || u(x), y.hasB && (p.push(k), m = m || u(k)), (!y.hasB || !y.b) && (v = true); } } h._extremes[e10._id] = Rc.findExtremes(e10, p, { tozero: v, padded: m }); } } function wre(e10, t) { var r = ad(t), n = {}, a, i, o, l = 1 / 0, s = -1 / 0; for (a = 0; a < e10.length; a++) for (o = e10[a], i = 0; i < o.length; i++) { var u = o[i].p; cl(u) && (l = Math.min(l, u), s = Math.max(s, u)); } var f = 1e4 / (s - l), d = n.round = function(w) { return String(Math.round(f * (w - l))); }; for (a = 0; a < e10.length; a++) { o = e10[a], o[0].t.extents = n; var h = o[0].t.poffset, p = dl(h); for (i = 0; i < o.length; i++) { var v = o[i], m = v[r] - v.w / 2; if (cl(m)) { var g = v[r] + v.w / 2, y = d(v.p); n[y] ? n[y] = [Math.min(m, n[y][0]), Math.max(g, n[y][1])] : n[y] = [m, g]; } v.p0 = v.p + (p ? h[i] : h), v.p1 = v.p0 + v.w, v.s0 = v.b, v.s1 = v.s0 + v.s; } } } function ad(e10) { return e10._id.charAt(0); } var KE = { crossTraceCalc: pre, setGroupPositions: qy }; var XA = GE; var KA = KE.setGroupPositions; function Tre(e10, t) { for (var r = t.xaxis, n = t.yaxis, a = e10._fullLayout, i = e10._fullData, o = e10.calcdata, l = [], s = [], u = 0; u < i.length; u++) { var f = i[u]; f.visible === true && f.type === "scatter" && f.xaxis === r._id && f.yaxis === n._id && (f.orientation === "h" ? l.push(o[u]) : f.orientation === "v" && s.push(o[u])); } var d = { mode: a.scattermode, gap: a.scattergap }; KA(e10, r, n, s, d), KA(e10, n, r, l, d); } var kre = function(t, r) { t._fullLayout.scattermode === "group" && Tre(t, r); var n = r.xaxis, a = r.yaxis, i = n._id + a._id, o = t._fullLayout._scatterStackOpts[i]; if (o) { var l = t.calcdata, s, u, f, d, h, p, v, m, g, y, w, k, x, _, T; for (var S in o) { y = o[S]; var M = y.traceIndices; if (M.length) { for (w = y.stackgaps === "interpolate", k = y.groupnorm, y.orientation === "v" ? (x = "x", _ = "y") : (x = "y", _ = "x"), T = new Array(M.length), s = 0; s < T.length; s++) T[s] = false; p = l[M[0]]; var L = new Array(p.length); for (s = 0; s < p.length; s++) L[s] = p[s][x]; for (s = 1; s < M.length; s++) { for (h = l[M[s]], u = f = 0; u < h.length; u++) { for (v = h[u][x]; v > L[f] && f < L.length; f++) Xg(h, u, L[f], s, T, w, x), u++; if (v !== L[f]) { for (d = 0; d < s; d++) Xg(l[M[d]], f, v, d, T, w, x); L.splice(f, 0, v); } f++; } for (; f < L.length; f++) Xg(h, u, L[f], s, T, w, x), u++; } var F = L.length; for (u = 0; u < p.length; u++) { for (m = p[u][_] = p[u].s, s = 1; s < M.length; s++) h = l[M[s]], h[0].trace._rawLength = h[0].trace._length, h[0].trace._length = F, m += h[u].s, h[u][_] = m; if (k) for (g = (k === "fraction" ? m : m / 100) || 1, s = 0; s < M.length; s++) { var $ = l[M[s]][u]; $[_] /= g, $.sNorm = $.s / g; } } for (s = 0; s < M.length; s++) { h = l[M[s]]; var I = h[0].trace, O = XA.calcMarkerSize(I, I._rawLength), G = Array.isArray(O); if (O && T[s] || G) { var K = O; for (O = new Array(F), u = 0; u < F; u++) O[u] = h[u].gap ? 0 : G ? K[h[u].i] : K; } var V = new Array(F), z = new Array(F); for (u = 0; u < F; u++) V[u] = h[u].x, z[u] = h[u].y; XA.calcAxisExpansion(t, I, n, a, V, z, O), h[0].t.orientation = y.orientation; } } } } }; function Xg(e10, t, r, n, a, i, o) { a[n] = true; var l = { i: null, gap: true, s: 0 }; if (l[o] = r, e10.splice(t, 0, l), t && r === e10[t - 1][o]) { var s = e10[t - 1]; l.s = s.s, l.i = s.i, l.gap = s.gap; } else i && (l.s = Are(e10, t, r, o)); t || (e10[0].t = e10[1].t, e10[0].trace = e10[1].trace, delete e10[1].t, delete e10[1].trace); } function Are(e10, t, r, n) { var a = e10[t - 1], i = e10[t + 1]; return i ? a ? a.s + (i.s - a.s) * (r - a[n]) / (i[n] - a[n]) : i.s : a.s; } var Mre = Sr; var JE = Qr; var jf = JE.BADNUM; var QE = JE.LOG_CLIP; var JA = QE + 0.5; var QA = QE - 0.5; var Cv = Ue; var Sre = Cv.segmentsIntersect; var eM = Cv.constrain; var Kg = e_; var Cre = function(t, r) { var n = r.trace || {}, a = r.xaxis, i = r.yaxis, o = a.type === "log", l = i.type === "log", s = a._length, u = i._length, f = r.backoff, d = n.marker, h = r.connectGaps, p = r.baseTolerance, v = r.shape, m = v === "linear", g = n.fill && n.fill !== "none", y = [], w = Kg.minTolerance, k = t.length, x = new Array(k), _ = 0, T, S, M, L, F, $, I, O, G, K, V, z, P, R, H, B; function W(He) { var pt = t[He]; if (!pt) return false; var bt = r.linearized ? a.l2p(pt.x) : a.c2p(pt.x), Ke = r.linearized ? i.l2p(pt.y) : i.c2p(pt.y); if (bt === jf) { if (o && (bt = a.c2p(pt.x, true)), bt === jf) return false; l && Ke === jf && (bt *= Math.abs(a._m * u * (a._m > 0 ? JA : QA) / (i._m * s * (i._m > 0 ? JA : QA)))), bt *= 1e3; } if (Ke === jf) { if (l && (Ke = i.c2p(pt.y, true)), Ke === jf) return false; Ke *= 1e3; } return [bt, Ke]; } function ee(He, pt, bt, Ke) { var st = bt - He, rt = Ke - pt, ct = 0.5 - He, X = 0.5 - pt, se = st * st + rt * rt, ie = st * ct + rt * X; if (ie > 0 && ie < se) { var fe = ct * rt - X * st; if (fe * fe < se) return true; } } var re, ae; function Q(He, pt) { var bt = He[0] / s, Ke = He[1] / u, st = Math.max(0, -bt, bt - 1, -Ke, Ke - 1); return st && re !== void 0 && ee(bt, Ke, re, ae) && (st = 0), st && pt && ee(bt, Ke, pt[0] / s, pt[1] / u) && (st = 0), (1 + Kg.toleranceGrowth * st) * p; } function ue(He, pt) { var bt = He[0] - pt[0], Ke = He[1] - pt[1]; return Math.sqrt(bt * bt + Ke * Ke); } var j = Kg.maxScreensAway, U = -s * j, Z = s * (1 + j), le = -u * j, J = u * (1 + j), pe = [ [U, le, Z, le], [Z, le, Z, J], [Z, J, U, J], [U, J, U, le] ], ge, ve, me, Le, ze, Fe; function Oe(He, pt) { for (var bt = [], Ke = 0, st = 0; st < 4; st++) { var rt = pe[st], ct = Sre( He[0], He[1], pt[0], pt[1], rt[0], rt[1], rt[2], rt[3] ); ct && (!Ke || Math.abs(ct.x - bt[0][0]) > 1 || Math.abs(ct.y - bt[0][1]) > 1) && (ct = [ct.x, ct.y], Ke && ue(ct, He) < ue(bt[0], He) ? bt.unshift(ct) : bt.push(ct), Ke++); } return bt; } function Re(He) { if (He[0] < U || He[0] > Z || He[1] < le || He[1] > J) return [eM(He[0], U, Z), eM(He[1], le, J)]; } function We(He, pt) { if (He[0] === pt[0] && (He[0] === U || He[0] === Z) || He[1] === pt[1] && (He[1] === le || He[1] === J)) return true; } function Me(He, pt) { var bt = [], Ke = Re(He), st = Re(pt); return Ke && st && We(Ke, st) || (Ke && bt.push(Ke), st && bt.push(st)), bt; } function Ve(He, pt, bt) { return function(Ke, st) { var rt = Re(Ke), ct = Re(st), X = []; if (rt && ct && We(rt, ct)) return X; rt && X.push(rt), ct && X.push(ct); var se = 2 * Cv.constrain((Ke[He] + st[He]) / 2, pt, bt) - ((rt || Ke)[He] + (ct || st)[He]); if (se) { var ie; rt && ct ? ie = se > 0 == rt[He] > ct[He] ? rt : ct : ie = rt || ct, ie[He] += se; } return X; }; } var qe; v === "linear" || v === "spline" ? qe = Oe : v === "hv" || v === "vh" ? qe = Me : v === "hvh" ? qe = Ve(0, U, Z) : v === "vhv" && (qe = Ve(1, le, J)); function Qe(He, pt) { var bt = pt[0] - He[0], Ke = (pt[1] - He[1]) / bt, st = (He[1] * pt[0] - pt[1] * He[0]) / bt; return st > 0 ? [Ke > 0 ? U : Z, J] : [Ke > 0 ? Z : U, le]; } function ot(He) { var pt = He[0], bt = He[1], Ke = pt === x[_ - 1][0], st = bt === x[_ - 1][1]; if (!(Ke && st)) if (_ > 1) { var rt = pt === x[_ - 2][0], ct = bt === x[_ - 2][1]; Ke && (pt === U || pt === Z) && rt ? ct ? _-- : x[_ - 1] = He : st && (bt === le || bt === J) && ct ? rt ? _-- : x[_ - 1] = He : x[_++] = He; } else x[_++] = He; } function ht(He) { x[_ - 1][0] !== He[0] && x[_ - 1][1] !== He[1] && ot([me, Le]), ot(He), ze = null, me = Le = 0; } var vt = Cv.isArrayOrTypedArray(d); function nt(He) { if (He && f && (He.i = T, He.d = t, He.trace = n, He.marker = vt ? d[He.i] : d, He.backoff = f), re = He[0] / s, ae = He[1] / u, ge = He[0] < U ? U : He[0] > Z ? Z : 0, ve = He[1] < le ? le : He[1] > J ? J : 0, ge || ve) { if (!_) x[_++] = [ge || He[0], ve || He[1]]; else if (ze) { var pt = qe(ze, He); pt.length > 1 && (ht(pt[0]), x[_++] = pt[1]); } else Fe = qe(x[_ - 1], He)[0], x[_++] = Fe; var bt = x[_ - 1]; ge && ve && (bt[0] !== ge || bt[1] !== ve) ? (ze && (me !== ge && Le !== ve ? ot(me && Le ? Qe(ze, He) : [me || ge, Le || ve]) : me && Le && ot([me, Le])), ot([ge, ve])) : me - ge && Le - ve && ot([ge || me, ve || Le]), ze = He, me = ge, Le = ve; } else ze && ht(qe(ze, He)[0]), x[_++] = He; } for (T = 0; T < k; T++) if (S = W(T), !!S) { for (_ = 0, ze = null, nt(S), T++; T < k; T++) { if (L = W(T), !L) { if (h) continue; break; } if (!m || !r.simplify) { nt(L); continue; } var ft = W(T + 1); if (K = ue(L, S), !(!(g && (_ === 0 || _ === k - 1)) && K < Q(L, ft) * w)) { for (O = [ (L[0] - S[0]) / K, (L[1] - S[1]) / K ], F = S, V = K, z = R = H = 0, I = false, M = L, T++; T < t.length; T++) { if ($ = ft, ft = W(T + 1), !$) { if (h) continue; break; } if (G = [ $[0] - S[0], $[1] - S[1] ], B = G[0] * O[1] - G[1] * O[0], R = Math.min(R, B), H = Math.max(H, B), H - R > Q($, ft)) break; M = $, P = G[0] * O[0] + G[1] * O[1], P > V ? (V = P, L = $, I = false) : P < z && (z = P, F = $, I = true); } if (I ? (nt(L), M !== F && nt(F)) : (F !== S && nt(F), M !== L && nt(L)), nt(M), T >= t.length || !$) break; nt($), S = $; } } ze && ot([me || ze[0], Le || ze[1]]), y.push(x.slice(0, _)); } var Pe = v.slice(v.length - 1); if (f && Pe !== "h" && Pe !== "v") { for (var Ie = false, Ne = -1, tt = [], Je = 0; Je < y.length; Je++) for (var it = 0; it < y[Je].length - 1; it++) { var at = y[Je][it], Tt = y[Je][it + 1], gt = Mre.applyBackoff(Tt, at); (gt[0] !== Tt[0] || gt[1] !== Tt[1]) && (Ie = true), tt[Ne + 1] || (Ne++, tt[Ne] = [ at, [gt[0], gt[1]] ]); } return Ie ? tt : y; } return y; }; var tM = { tonextx: 1, tonexty: 1, tonext: 1 }; var Lre = function(t, r, n) { var a, i, o, l, s, u = {}, f = false, d = -1, h = 0, p = -1; for (i = 0; i < n.length; i++) a = n[i][0].trace, o = a.stackgroup || "", o ? o in u ? s = u[o] : (s = u[o] = h, h++) : a.fill in tM && p >= 0 ? s = p : (s = p = h, h++), s < d && (f = true), a._groupIndex = d = s; var v = n.slice(); f && v.sort(function(g, y) { var w = g[0].trace, k = y[0].trace; return w._groupIndex - k._groupIndex || w.index - k.index; }); var m = {}; for (i = 0; i < v.length; i++) a = v[i][0].trace, o = a.stackgroup || "", a.visible === true ? (a._nexttrace = null, a.fill in tM && (l = m[o], a._prevtrace = l || null, l && (l._nexttrace = a)), a._ownfill = a.fill && (a.fill.substr(0, 6) === "tozero" || a.fill === "toself" || a.fill.substr(0, 2) === "to" && !a._prevtrace), m[o] = a) : a._prevtrace = a._nexttrace = a._ownfill = null; return v; }; var si = lr; var Dre = Nt; var Pc = Ue; var vu = Pc.ensureSingle; var e62 = Pc.identity; var Wr = Sr; var pu = Ya; var Ere = Cre; var Fre = Lre; var Rre = QD.tester; var Pre = function(t, r, n, a, i, o) { var l, s, u = !i, f = !!i && i.duration > 0, d = Fre(t, r, n); if (l = a.selectAll("g.trace").data(d, function(p) { return p[0].trace.uid; }), l.enter().append("g").attr("class", function(p) { return "trace scatter trace" + p[0].trace.uid; }).style("stroke-miterlimit", 2), l.order(), $re(t, l, r), f) { o && (s = o()); var h = si.transition().duration(i.duration).ease(i.easing).each("end", function() { s && s(); }).each("interrupt", function() { s && s(); }); h.each(function() { a.selectAll("g.trace").each(function(p, v) { rM(t, v, r, p, d, this, i); }); }); } else l.each(function(p, v) { rM(t, v, r, p, d, this, i); }); u && l.exit().remove(), a.selectAll("path:not([d])").remove(); }; function $re(e10, t, r) { t.each(function(n) { var a = vu(si.select(this), "g", "fills"); Wr.setClipUrl(a, r.layerClipId, e10); var i = n[0].trace, o = []; i._ownfill && o.push("_ownFill"), i._nexttrace && o.push("_nextFill"); var l = a.selectAll("g").data(o, e62); l.enter().append("g"), l.exit().each(function(s) { i[s] = null; }).remove(), l.order().each(function(s) { i[s] = vu(si.select(this), "path", "js-fill"); }); }); } function rM(e10, t, r, n, a, i, o) { var l = e10._context.staticPlot, s; zre(e10, t, r, n, a); var u = !!o && o.duration > 0; function f(ge) { return u ? ge.transition() : ge; } var d = r.xaxis, h = r.yaxis, p = n[0].trace, v = p.line, m = si.select(i), g = vu(m, "g", "errorbars"), y = vu(m, "g", "lines"), w = vu(m, "g", "points"), k = vu(m, "g", "text"); if (Dre.getComponentMethod("errorbars", "plot")(e10, g, r, o), p.visible !== true) return; f(m).style("opacity", p.opacity); var x, _, T = p.fill.charAt(p.fill.length - 1); T !== "x" && T !== "y" && (T = ""), n[0][r.isRangePlot ? "nodeRangePlot3" : "node3"] = m; var S = "", M = [], L = p._prevtrace; L && (S = L._prevRevpath || "", _ = L._nextFill, M = L._polygons); var F, $, I = "", O = "", G, K, V, z, P, R, H, B = [], W = Pc.noop; if (x = p._ownFill, pu.hasLines(p) || p.fill !== "none") { for (_ && _.datum(n), ["hv", "vh", "hvh", "vhv"].indexOf(v.shape) !== -1 ? (G = Wr.steps(v.shape), K = Wr.steps( v.shape.split("").reverse().join("") )) : v.shape === "spline" ? G = K = function(ge) { var ve = ge[ge.length - 1]; return ge.length > 1 && ge[0][0] === ve[0] && ge[0][1] === ve[1] ? Wr.smoothclosed(ge.slice(1), v.smoothing) : Wr.smoothopen(ge, v.smoothing); } : G = K = function(ge) { return "M" + ge.join("L"); }, V = function(ge) { return K(ge.reverse()); }, B = Ere(n, { xaxis: d, yaxis: h, trace: p, connectGaps: p.connectgaps, baseTolerance: Math.max(v.width || 1, 3) / 4, shape: v.shape, backoff: v.backoff, simplify: v.simplify, fill: p.fill }), H = p._polygons = new Array(B.length), s = 0; s < B.length; s++) p._polygons[s] = Rre(B[s]); B.length && (z = B[0][0], P = B[B.length - 1], R = P[P.length - 1]), W = function(ge) { return function(ve) { if (F = G(ve), $ = V(ve), I ? T ? (I += "L" + F.substr(1), O = $ + ("L" + O.substr(1))) : (I += "Z" + F, O = $ + "Z" + O) : (I = F, O = $), pu.hasLines(p)) { var me = si.select(this); if (me.datum(n), ge) f(me.style("opacity", 0).attr("d", F).call(Wr.lineGroupStyle)).style("opacity", 1); else { var Le = f(me); Le.attr("d", F), Wr.singleLineStyle(n, Le); } } }; }; } var ee = y.selectAll(".js-line").data(B); f(ee.exit()).style("opacity", 0).remove(), ee.each(W(false)), ee.enter().append("path").classed("js-line", true).style("vector-effect", l ? "none" : "non-scaling-stroke").call(Wr.lineGroupStyle).each(W(true)), Wr.setClipUrl(ee, r.layerClipId, e10); function re(ge) { f(ge).attr("d", "M0,0Z"); } B.length ? (x ? (x.datum(n), z && R && (T ? (T === "y" ? z[1] = R[1] = h.c2p(0, true) : T === "x" && (z[0] = R[0] = d.c2p(0, true)), f(x).attr("d", "M" + R + "L" + z + "L" + I.substr(1)).call(Wr.singleFillStyle, e10)) : f(x).attr("d", I + "Z").call(Wr.singleFillStyle, e10))) : _ && (p.fill.substr(0, 6) === "tonext" && I && S ? (p.fill === "tonext" ? f(_).attr("d", I + "Z" + S + "Z").call(Wr.singleFillStyle, e10) : f(_).attr("d", I + "L" + S.substr(1) + "Z").call(Wr.singleFillStyle, e10), p._polygons = p._polygons.concat(M)) : (re(_), p._polygons = null)), p._prevRevpath = O, p._prevPolygons = H) : (x ? re(x) : _ && re(_), p._polygons = p._prevRevpath = p._prevPolygons = null); function ae(ge) { return ge.filter(function(ve) { return !ve.gap && ve.vis; }); } function Q(ge) { return ge.filter(function(ve) { return ve.vis; }); } function ue(ge) { return ge.filter(function(ve) { return !ve.gap; }); } function j(ge) { return ge.id; } function U(ge) { if (ge.ids) return j; } function Z() { return false; } function le(ge, ve, me) { var Le, ze, Fe, Oe = me[0].trace, Re = pu.hasMarkers(Oe), We = pu.hasText(Oe), Me = U(Oe), Ve = Z, qe = Z; if (Re || We) { var Qe = e62, ot = Oe.stackgroup, ht = ot && e10._fullLayout._scatterStackOpts[d._id + h._id][ot].stackgaps === "infer zero"; Oe.marker.maxdisplayed || Oe._needsCull ? Qe = ht ? Q : ae : ot && !ht && (Qe = ue), Re && (Ve = Qe), We && (qe = Qe); } ze = ge.selectAll("path.point"), Le = ze.data(Ve, Me); var vt = Le.enter().append("path").classed("point", true); u && vt.call(Wr.pointStyle, Oe, e10).call(Wr.translatePoints, d, h).style("opacity", 0).transition().style("opacity", 1), Le.order(); var nt; Re && (nt = Wr.makePointStyleFns(Oe)), Le.each(function(ft) { var Pe = si.select(this), Ie = f(Pe); Fe = Wr.translatePoint(ft, Ie, d, h), Fe ? (Wr.singlePointStyle(ft, Ie, Oe, nt, e10), r.layerClipId && Wr.hideOutsideRangePoint(ft, Ie, d, h, Oe.xcalendar, Oe.ycalendar), Oe.customdata && Pe.classed("plotly-customdata", ft.data !== null && ft.data !== void 0)) : Ie.remove(); }), u ? Le.exit().transition().style("opacity", 0).remove() : Le.exit().remove(), ze = ve.selectAll("g"), Le = ze.data(qe, Me), Le.enter().append("g").classed("textpoint", true).append("text"), Le.order(), Le.each(function(ft) { var Pe = si.select(this), Ie = f(Pe.select("text")); Fe = Wr.translatePoint(ft, Ie, d, h), Fe ? r.layerClipId && Wr.hideOutsideRangePoint(ft, Pe, d, h, Oe.xcalendar, Oe.ycalendar) : Pe.remove(); }), Le.selectAll("text").call(Wr.textPointStyle, Oe, e10).each(function(ft) { var Pe = d.c2p(ft.x), Ie = h.c2p(ft.y); si.select(this).selectAll("tspan.line").each(function() { f(si.select(this)).attr({ x: Pe, y: Ie }); }); }), Le.exit().remove(); } w.datum(n), k.datum(n), le(w, k, n); var J = p.cliponaxis === false, pe = J ? null : r.layerClipId; Wr.setClipUrl(w, pe, e10), Wr.setClipUrl(k, pe, e10); } function zre(e10, t, r, n, a) { var i = r.xaxis, o = r.yaxis, l = si.extent(Pc.simpleMap(i.range, i.r2c)), s = si.extent(Pc.simpleMap(o.range, o.r2c)), u = n[0].trace; if (pu.hasMarkers(u)) { var f = u.marker.maxdisplayed; if (f !== 0) { var d = n.filter(function(m) { return m.x >= l[0] && m.x <= l[1] && m.y >= s[0] && m.y <= s[1]; }), h = Math.ceil(d.length / f), p = 0; a.forEach(function(m, g) { var y = m[0].trace; pu.hasMarkers(y) && y.marker.maxdisplayed > 0 && g < t && p++; }); var v = Math.round(p * h / 3 + Math.floor(p / 3) * h / 7.1); n.forEach(function(m) { delete m.vis; }), d.forEach(function(m, g) { Math.round((g + v) % h) === 0 && (m.vis = true); }); } } } var t6 = { container: "marker", min: "cmin", max: "cmax" }; var gh = Cr; var r6 = function(t, r, n) { var a = {}, i = { _fullLayout: n }, o = gh.getFromTrace(i, r, "x"), l = gh.getFromTrace(i, r, "y"), s = t.orig_x; s === void 0 && (s = t.x); var u = t.orig_y; return u === void 0 && (u = t.y), a.xLabel = gh.tickText(o, o.c2l(s), true).text, a.yLabel = gh.tickText(l, l.c2l(u), true).text, a; }; var Jg = lr; var zu = Sr; var Ire = Nt; function Nre(e10) { var t = Jg.select(e10).selectAll("g.trace.scatter"); t.style("opacity", function(r) { return r[0].trace.opacity; }), t.selectAll("g.points").each(function(r) { var n = Jg.select(this), a = r.trace || r[0].trace; u_(n, a, e10); }), t.selectAll("g.text").each(function(r) { var n = Jg.select(this), a = r.trace || r[0].trace; f_(n, a, e10); }), t.selectAll("g.trace path.js-line").call(zu.lineGroupStyle), t.selectAll("g.trace path.js-fill").call(zu.fillGroupStyle, e10), Ire.getComponentMethod("errorbars", "style")(t); } function u_(e10, t, r) { zu.pointStyle(e10.selectAll("path.point"), t, r); } function f_(e10, t, r) { zu.textPointStyle(e10.selectAll("text"), t, r); } function Ore(e10, t, r) { var n = t[0].trace; n.selectedpoints ? (zu.selectedPointStyle(r.selectAll("path.point"), n), zu.selectedTextStyle(r.selectAll("text"), n)) : (u_(r, n, e10), f_(r, n, e10)); } var nM = { style: Nre, stylePoints: u_, styleText: f_, styleOnSelect: Ore }; var Us = nr; var Hre = Ya; var Bre = function(t, r) { var n, a; if (t.mode === "lines") return n = t.line.color, n && Us.opacity(n) ? n : t.fillcolor; if (t.mode === "none") return t.fill ? t.fillcolor : ""; var i = r.mcc || (t.marker || {}).color, o = r.mlcc || ((t.marker || {}).line || {}).color; return a = i && Us.opacity(i) ? i : o && Us.opacity(o) && (r.mlw || ((t.marker || {}).line || {}).width) ? o : "", a ? Us.opacity(a) < 0.3 ? Us.addOpacity(a, 0.3) : a : (n = (t.line || {}).color, n && Us.opacity(n) && Hre.hasLines(t) && t.line.width ? n : t.fillcolor); }; var Gh = Ue; var aM = Ao; var jre = Nt; var Ure = Bre; var Qg = nr; var Gre = Gh.fillText; var Vre = function(t, r, n, a) { var i = t.cd, o = i[0].trace, l = t.xa, s = t.ya, u = l.c2p(r), f = s.c2p(n), d = [u, f], h = o.hoveron || "", p = o.mode.indexOf("markers") !== -1 ? 3 : 0.5, v = !!o.xperiodalignment, m = !!o.yperiodalignment; if (h.indexOf("points") !== -1) { var g = function(Z) { if (v) { var le = l.c2p(Z.xStart), J = l.c2p(Z.xEnd); return u >= Math.min(le, J) && u <= Math.max(le, J) ? 0 : 1 / 0; } var pe = Math.max(3, Z.mrc || 0), ge = 1 - 1 / pe, ve = Math.abs(l.c2p(Z.x) - u); return ve < pe ? ge * ve / pe : ve - pe + ge; }, y = function(Z) { if (m) { var le = s.c2p(Z.yStart), J = s.c2p(Z.yEnd); return f >= Math.min(le, J) && f <= Math.max(le, J) ? 0 : 1 / 0; } var pe = Math.max(3, Z.mrc || 0), ge = 1 - 1 / pe, ve = Math.abs(s.c2p(Z.y) - f); return ve < pe ? ge * ve / pe : ve - pe + ge; }, w = function(Z) { var le = Math.max(p, Z.mrc || 0), J = l.c2p(Z.x) - u, pe = s.c2p(Z.y) - f; return Math.max(Math.sqrt(J * J + pe * pe) - le, 1 - p / le); }, k = aM.getDistanceFunction(a, g, y, w); if (aM.getClosest(i, k, t), t.index !== false) { var x = i[t.index], _ = l.c2p(x.x, true), T = s.c2p(x.y, true), S = x.mrc || 1; t.index = x.i; var M = i[0].t.orientation, L = M && (x.sNorm || x.s), F = M === "h" ? L : x.orig_x !== void 0 ? x.orig_x : x.x, $ = M === "v" ? L : x.orig_y !== void 0 ? x.orig_y : x.y; return Gh.extendFlat(t, { color: Ure(o, x), x0: _ - S, x1: _ + S, xLabelVal: F, y0: T - S, y1: T + S, yLabelVal: $, spikeDistance: w(x), hovertemplate: o.hovertemplate }), Gre(x, o, t), jre.getComponentMethod("errorbars", "hoverInfo")(x, o, t), [t]; } } if (h.indexOf("fills") !== -1 && o._polygons) { var I = o._polygons, O = [], G = false, K = 1 / 0, V = -1 / 0, z = 1 / 0, P = -1 / 0, R, H, B, W, ee, re, ae, Q, ue; for (R = 0; R < I.length; R++) B = I[R], B.contains(d) && (G = !G, O.push(B), z = Math.min(z, B.ymin), P = Math.max(P, B.ymax)); if (G) { z = Math.max(z, 0), P = Math.min(P, s._length); var j = (z + P) / 2; for (R = 0; R < O.length; R++) for (W = O[R].pts, H = 1; H < W.length; H++) Q = W[H - 1][1], ue = W[H][1], Q > j != ue >= j && (re = W[H - 1][0], ae = W[H][0], ue - Q && (ee = re + (ae - re) * (j - Q) / (ue - Q), K = Math.min(K, ee), V = Math.max(V, ee))); K = Math.max(K, 0), V = Math.min(V, l._length); var U = Qg.defaultLine; return Qg.opacity(o.fillcolor) ? U = o.fillcolor : Qg.opacity((o.line || {}).color) && (U = o.line.color), Gh.extendFlat(t, { // never let a 2D override 1D type as closest point // also: no spikeDistance, it's not allowed for fills distance: t.maxHoverDistance, x0: K, x1: V, y0: j, y1: j, color: U, hovertemplate: false }), delete t.index, o.text && !Gh.isArrayOrTypedArray(o.text) ? t.text = String(o.text) : t.text = o.name, [t]; } } }; var iM = Ya; var qre = function(t, r) { var n = t.cd, a = t.xaxis, i = t.yaxis, o = [], l = n[0].trace, s, u, f, d, h = !iM.hasMarkers(l) && !iM.hasText(l); if (h) return []; if (r === false) for (s = 0; s < n.length; s++) n[s].selected = 0; else for (s = 0; s < n.length; s++) u = n[s], f = a.c2p(u.x), d = i.c2p(u.y), u.i !== null && r.contains([f, d], false, s, t) ? (o.push({ pointNumber: u.i, x: a.c2d(u.x), y: i.c2d(u.y) }), u.selected = 1) : u.selected = 0; return o; }; var yn = {}; var e0; var oM; function Wre() { return oM || (oM = 1, e0 = { xaxis: { valType: "subplotid", dflt: "x", editType: "calc+clearAxisTypes", description: [ "Sets a reference between this trace's x coordinates and", "a 2D cartesian x axis.", "If *x* (the default value), the x coordinates refer to", "`layout.xaxis`.", "If *x2*, the x coordinates refer to `layout.xaxis2`, and so on." ].join(" ") }, yaxis: { valType: "subplotid", dflt: "y", editType: "calc+clearAxisTypes", description: [ "Sets a reference between this trace's y coordinates and", "a 2D cartesian y axis.", "If *y* (the default value), the y coordinates refer to", "`layout.yaxis`.", "If *y2*, the y coordinates refer to `layout.yaxis2`, and so on." ].join(" ") } }), e0; } var t0; var lM; function Zre() { if (lM) return t0; lM = 1; var e10 = Nt.traceIs, t = P4; t0 = function(l, s, u, f) { u("autotypenumbers", f.autotypenumbersDflt); var d = u("type", (f.splomStash || {}).type); d === "-" && (r(s, f.data), s.type === "-" ? s.type = "linear" : l.type = s.type); }; function r(o, l) { if (o.type === "-") { var s = o._id, u = s.charAt(0), f; s.indexOf("scene") !== -1 && (s = u); var d = n(l, s, u); if (d) { if (d.type === "histogram" && u === { v: "y", h: "x" }[d.orientation || "v"]) { o.type = "linear"; return; } var h = u + "calendar", p = d[h], v = { noMultiCategory: !e10(d, "cartesian") || e10(d, "noMultiCategory") }; if (d.type === "box" && d._hasPreCompStats && u === { h: "x", v: "y" }[d.orientation || "v"] && (v.noMultiCategory = true), v.autotypenumbers = o.autotypenumbers, i(d, u)) { var m = a(d), g = []; for (f = 0; f < l.length; f++) { var y = l[f]; !e10(y, "box-violin") || (y[u + "axis"] || u) !== s || (y[m] !== void 0 ? g.push(y[m][0]) : y.name !== void 0 ? g.push(y.name) : g.push("text"), y[h] !== p && (p = void 0)); } o.type = t(g, p, v); } else if (d.type === "splom") { var w = d.dimensions, k = w[d._axesDim[s]]; k.visible && (o.type = t(k.values, p, v)); } else o.type = t(d[u] || [d[u + "0"]], p, v); } } } function n(o, l, s) { for (var u = 0; u < o.length; u++) { var f = o[u]; if (f.type === "splom" && f._length > 0 && (f["_" + s + "axes"] || {})[l]) return f; if ((f[s + "axis"] || s) === l) { if (i(f, s)) return f; if ((f[s] || []).length || f[s + "0"]) return f; } } } function a(o) { return { v: "x", h: "y" }[o.orientation || "v"]; } function i(o, l) { var s = a(o), u = e10(o, "box-violin"), f = e10(o._fullInput || {}, "candlestick"); return u && !f && l === s && o[s] === void 0 && o[s + "0"] === void 0; } return t0; } var Yre = an.isTypedArraySpec; function Xre(e10, t) { var r = t.dataAttr || e10._id.charAt(0), n = {}, a, i, o; if (t.axData) a = t.axData; else for (a = [], i = 0; i < t.data.length; i++) { var l = t.data[i]; l[r + "axis"] === e10._id && a.push(l); } for (i = 0; i < a.length; i++) { var s = a[i][r]; for (o = 0; o < s.length; o++) { var u = s[o]; u != null && (n[u] = 1); } } return Object.keys(n); } var Kre = function(t, r, n, a) { if (r.type === "category") { var i = t.categoryarray, o = Array.isArray(i) && i.length > 0 || Yre(i), l; o && (l = "array"); var s = n("categoryorder", l), u; s === "array" && (u = n("categoryarray")), !o && s === "array" && (s = r.categoryorder = "trace"), s === "trace" ? r._initialCategories = [] : s === "array" ? r._initialCategories = u.slice() : (u = Xre(r, a).sort(), s === "category ascending" ? r._initialCategories = u : s === "category descending" && (r._initialCategories = u.reverse())); } }; var sM = bi.mix; var Jre = da; var Qre = Ue; var ene = function(t, r, n, a) { a = a || {}; var i = a.dfltColor; function o(S, M) { return Qre.coerce2(t, r, a.attributes, S, M); } var l = o("linecolor", i), s = o("linewidth"), u = n("showline", a.showLine || !!l || !!s); u || (delete r.linecolor, delete r.linewidth); var f = sM(i, a.bgColor, a.blend || Jre.lightFraction).toRgbString(), d = o("gridcolor", f), h = o("gridwidth"), p = o("griddash"), v = n( "showgrid", a.showGrid || !!d || !!h || !!p ); if (v || (delete r.gridcolor, delete r.gridwidth, delete r.griddash), a.hasMinor) { var m = sM(r.gridcolor, a.bgColor, 67).toRgbString(), g = o("minor.gridcolor", m), y = o("minor.gridwidth", r.gridwidth || 1), w = o("minor.griddash", r.griddash || "solid"), k = n( "minor.showgrid", !!g || !!y || !!w ); k || (delete r.minor.gridcolor, delete r.minor.gridwidth, delete r.minor.griddash); } if (!a.noZeroLine) { var x = o("zerolinecolor", i), _ = o("zerolinewidth"), T = n("zeroline", a.showGrid || !!x || !!_); T || (delete r.zerolinecolor, delete r.zerolinewidth); } }; var uM = sr; var tne = Nt; var Xf = Ue; var rne = Mr; var nne = Ji; var Wy = Ki; var fM = p4; var cM = m4; var ane = b4; var ine = _4; var one = Kre; var lne = ene; var sne = Y4; var dM = yb; var Vh = Yn.WEEKDAY_PATTERN; var une = Yn.HOUR_PATTERN; var n6 = function(t, r, n, a, i) { var o = a.letter, l = a.font || {}, s = a.splomStash || {}, u = n("visible", !a.visibleDflt), f = r._template || {}, d = r.type || f.type || "-", h; if (d === "date") { var p = tne.getComponentMethod("calendars", "handleDefaults"); p(t, r, "calendar", a.calendar), a.noTicklabelmode || (h = n("ticklabelmode")); } var v = ""; (!a.noTicklabelposition || d === "multicategory") && (v = Xf.coerce(t, r, { ticklabelposition: { valType: "enumerated", dflt: "outside", values: h === "period" ? ["outside", "inside"] : o === "x" ? [ "outside", "inside", "outside left", "inside left", "outside right", "inside right" ] : [ "outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom" ] } }, "ticklabelposition")), a.noTicklabeloverflow || n( "ticklabeloverflow", v.indexOf("inside") !== -1 ? "hide past domain" : d === "category" || d === "multicategory" ? "allow" : "hide past div" ), dM(r, i), sne(t, r, n, a), one(t, r, n, a), d !== "category" && !a.noHover && n("hoverformat"); var m = n("color"), g = m !== Wy.color.dflt ? m : l.color, y = s.label || i._dfltTitle[o]; if (ine(t, r, n, d, a), !u) return r; n("title.text", y), Xf.coerceFont(n, "title.font", { family: l.family, size: Xf.bigFont(l.size), color: g }), fM(t, r, n, d); var w = a.hasMinor; if (w && (rne.newContainer(r, "minor"), fM(t, r, n, d, { isMinor: true })), ane(t, r, n, d, a), cM(t, r, n, a), w) { var k = a.isMinor; a.isMinor = true, cM(t, r, n, a), a.isMinor = k; } lne(t, r, n, { dfltColor: m, bgColor: a.bgColor, showGrid: a.showGrid, hasMinor: w, attributes: Wy }), w && !r.minor.ticks && !r.minor.showgrid && delete r.minor, (r.showline || r.ticks) && n("mirror"); var x = d === "multicategory"; if (!a.noTickson && (d === "category" || x) && (r.ticks || r.showgrid)) { var _; x && (_ = "boundaries"); var T = n("tickson", _); T === "boundaries" && delete r.ticklabelposition; } if (x) { var S = n("showdividers"); S && (n("dividercolor"), n("dividerwidth")); } if (d === "date") if (nne(t, r, { name: "rangebreaks", inclusionAttr: "enabled", handleItemDefaults: fne }), !r.rangebreaks.length) delete r.rangebreaks; else { for (var M = 0; M < r.rangebreaks.length; M++) if (r.rangebreaks[M].pattern === Vh) { r._hasDayOfWeekBreaks = true; break; } if (dM(r, i), i._has("scattergl") || i._has("splom")) for (var L = 0; L < a.data.length; L++) { var F = a.data[L]; (F.type === "scattergl" || F.type === "splom") && (F.visible = false, Xf.warn(F.type + " traces do not work on axes with rangebreaks. Setting trace " + F.index + " to `visible: false`.")); } } return r; }; function fne(e10, t, r) { function n(h, p) { return Xf.coerce(e10, t, Wy.rangebreaks, h, p); } var a = n("enabled"); if (a) { var i = n("bounds"); if (i && i.length >= 2) { var o = "", l, s; if (i.length === 2) { for (l = 0; l < 2; l++) if (s = hM(i[l]), s) { o = Vh; break; } } var u = n("pattern", o); if (u === Vh) for (l = 0; l < 2; l++) s = hM(i[l]), s && (t.bounds[l] = i[l] = s - 1); if (u) for (l = 0; l < 2; l++) switch (s = i[l], u) { case Vh: if (!uM(s)) { t.enabled = false; return; } if (s = +s, s !== Math.floor(s) || // don't accept fractional days for mow s < 0 || s >= 7) { t.enabled = false; return; } t.bounds[l] = i[l] = s; break; case une: if (!uM(s)) { t.enabled = false; return; } if (s = +s, s < 0 || s > 24) { t.enabled = false; return; } t.bounds[l] = i[l] = s; break; } if (r.autorange === false) { var f = r.range; if (f[0] < f[1]) { if (i[0] < f[0] && i[1] > f[1]) { t.enabled = false; return; } } else if (i[0] > f[0] && i[1] < f[1]) { t.enabled = false; return; } } } else { var d = n("values"); if (d && d.length) n("dvalue"); else { t.enabled = false; return; } } } } var cne = { sun: 1, mon: 2, tue: 3, wed: 4, thu: 5, fri: 6, sat: 7 }; function hM(e10) { if (typeof e10 == "string") return cne[e10.substr(0, 3).toLowerCase()]; } var dne = sr; var yh = Ue; var a6 = function(t, r, n, a) { var i = a.counterAxes || [], o = a.overlayableAxes || [], l = a.letter, s = a.grid, u = a.overlayingDomain, f, d, h, p, v, m; s && (d = s._domains[l][s._axisMap[r._id]], f = s._anchors[r._id], d && (h = s[l + "side"].split(" ")[0], p = s.domain[l][h === "right" || h === "top" ? 1 : 0])), d = d || [0, 1], f = f || (dne(t.position) ? "free" : i[0] || "free"), h = h || (l === "x" ? "bottom" : "left"), p = p || 0, v = 0, m = false; var g = yh.coerce(t, r, { anchor: { valType: "enumerated", values: ["free"].concat(i), dflt: f } }, "anchor"), y = yh.coerce(t, r, { side: { valType: "enumerated", values: l === "x" ? ["bottom", "top"] : ["left", "right"], dflt: h } }, "side"); if (g === "free") { if (l === "y") { var w = n("autoshift"); w && (p = y === "left" ? u[0] : u[1], m = r.automargin ? r.automargin : true, v = y === "left" ? -3 : 3), n("shift", v); } n("position", p); } n("automargin", m); var k = false; if (o.length && (k = yh.coerce(t, r, { overlaying: { valType: "enumerated", values: [false].concat(o), dflt: false } }, "overlaying")), !k) { var x = n("domain", d); x[0] > x[1] - 1 / 4096 && (r.domain = d), yh.noneOrAll(t.domain, r.domain, d), r.tickmode === "sync" && (r.tickmode = "auto"); } return n("layer"), r; }; var r0; var vM; function hne() { if (vM) return r0; vM = 1; var e10 = Ue, t = nr, r = Do.isUnifiedHover, n = pD, a = Mr, i = Xc, o = Ki, l = Zre(), s = n6, u = wl, f = a6, d = gn, h = d.id2name, p = d.name2id, v = Yn.AX_ID_PATTERN, m = Nt, g = m.traceIs, y = m.getComponentMethod; function w(k, x, _) { Array.isArray(k[x]) ? k[x].push(_) : k[x] = [_]; } return r0 = function(x, _, T) { var S = _.autotypenumbers, M = {}, L = {}, F = {}, $ = {}, I = {}, O = {}, G = {}, K = {}, V = {}, z = {}, P, R; for (P = 0; P < T.length; P++) { var H = T[P]; if (!(!g(H, "cartesian") && !g(H, "gl2d"))) { var B; if (H.xaxis) B = h(H.xaxis), w(M, B, H); else if (H.xaxes) for (R = 0; R < H.xaxes.length; R++) w(M, h(H.xaxes[R]), H); var W; if (H.yaxis) W = h(H.yaxis), w(M, W, H); else if (H.yaxes) for (R = 0; R < H.yaxes.length; R++) w(M, h(H.yaxes[R]), H); if (H.type === "funnel" ? H.orientation === "h" ? (B && (L[B] = true), W && (G[W] = true)) : W && (F[W] = true) : H.type === "image" ? (W && (K[W] = true), B && (K[B] = true)) : (W && (I[W] = true, O[W] = true), (!g(H, "carpet") || H.type === "carpet" && !H._cheater) && B && ($[B] = true)), H.type === "carpet" && H._cheater && B && (L[B] = true), g(H, "2dMap") && (V[B] = true, V[W] = true), g(H, "oriented")) { var ee = H.orientation === "h" ? W : B; z[ee] = true; } } } var re = _._subplots, ae = re.xaxis, Q = re.yaxis, ue = e10.simpleMap(ae, h), j = e10.simpleMap(Q, h), U = ue.concat(j), Z = t.background; ae.length && Q.length && (Z = e10.coerce(x, _, i, "plot_bgcolor")); var le = t.combine(Z, _.paper_bgcolor), J, pe, ge, ve, me; function Le() { var ct = M[J] || []; me._traceIndices = ct.map(function(X) { return X._expandedIndex; }), me._annIndices = [], me._shapeIndices = [], me._selectionIndices = [], me._imgIndices = [], me._subplotsWith = [], me._counterAxes = [], me._name = me._attr = J, me._id = pe; } function ze(ct, X) { return e10.coerce(ve, me, o, ct, X); } function Fe(ct, X) { return e10.coerce2(ve, me, o, ct, X); } function Oe(ct) { return ct === "x" ? Q : ae; } function Re(ct, X) { for (var se = ct === "x" ? ue : j, ie = [], fe = 0; fe < se.length; fe++) { var ke = se[fe]; ke !== X && !(x[ke] || {}).overlaying && ie.push(p(ke)); } return ie; } var We = { x: Oe("x"), y: Oe("y") }, Me = We.x.concat(We.y), Ve = {}, qe = []; function Qe() { var ct = ve.matches; v.test(ct) && Me.indexOf(ct) === -1 && (Ve[ct] = ve.type, qe = Object.keys(Ve)); } var ot = n(x, _), ht = r(ot); for (P = 0; P < U.length; P++) { J = U[P], pe = p(J), ge = J.charAt(0), e10.isPlainObject(x[J]) || (x[J] = {}), ve = x[J], me = a.newContainer(_, J, ge + "axis"), Le(); var vt = ge === "x" && !$[J] && L[J] || ge === "y" && !I[J] && F[J], nt = ge === "y" && (!O[J] && G[J] || K[J]), ft = { hasMinor: true, letter: ge, font: _.font, outerTicks: V[J], showGrid: !z[J], data: M[J] || [], bgColor: le, calendar: _.calendar, automargin: true, visibleDflt: vt, reverseDflt: nt, autotypenumbersDflt: S, splomStash: ((_._splomAxes || {})[ge] || {})[pe] }; ze("uirevision", _.uirevision), l(ve, me, ze, ft), s(ve, me, ze, ft, _); var Pe = ht && ge === ot.charAt(0), Ie = Fe("spikecolor", ht ? me.color : void 0), Ne = Fe("spikethickness", ht ? 1.5 : void 0), tt = Fe("spikedash", ht ? "dot" : void 0), Je = Fe("spikemode", ht ? "across" : void 0), it = Fe("spikesnap"), at = ze("showspikes", !!Pe || !!Ie || !!Ne || !!tt || !!Je || !!it); at || (delete me.spikecolor, delete me.spikethickness, delete me.spikedash, delete me.spikemode, delete me.spikesnap); var Tt = h(ve.overlaying), gt = [0, 1]; if (_[Tt] !== void 0) { var He = h(_[Tt].anchor); _[He] !== void 0 && (gt = _[He].domain); } f(ve, me, ze, { letter: ge, counterAxes: We[ge], overlayableAxes: Re(ge, J), grid: _.grid, overlayingDomain: gt }), ze("title.standoff"), Qe(), me._input = ve; } for (P = 0; P < qe.length; ) { pe = qe[P++], J = h(pe), ge = J.charAt(0), e10.isPlainObject(x[J]) || (x[J] = {}), ve = x[J], me = a.newContainer(_, J, ge + "axis"), Le(); var pt = { letter: ge, font: _.font, outerTicks: V[J], showGrid: !z[J], data: [], bgColor: le, calendar: _.calendar, automargin: true, visibleDflt: false, reverseDflt: false, autotypenumbersDflt: S, splomStash: ((_._splomAxes || {})[ge] || {})[pe] }; ze("uirevision", _.uirevision), me.type = Ve[pe] || "linear", s(ve, me, ze, pt, _), f(ve, me, ze, { letter: ge, counterAxes: We[ge], overlayableAxes: Re(ge, J), grid: _.grid }), ze("fixedrange"), Qe(), me._input = ve; } var bt = y("rangeslider", "handleDefaults"), Ke = y("rangeselector", "handleDefaults"); for (P = 0; P < ue.length; P++) J = ue[P], ve = x[J], me = _[J], bt(x, _, J), me.type === "date" && Ke( ve, me, _, j, me.calendar ), ze("fixedrange"); for (P = 0; P < j.length; P++) { J = j[P], ve = x[J], me = _[J]; var st = _[h(me.anchor)], rt = y("rangeslider", "isVisible")(st); ze("fixedrange", rt); } u.handleDefaults(x, _, { axIds: Me.concat(qe).sort(d.idSort), axHasImage: K }); }, r0; } var n0; var pM; function vne() { if (pM) return n0; pM = 1; var e10 = lr, t = Nt, r = Ue, n = Sr, a = Cr; return n0 = function(o, l, s, u) { var f = o._fullLayout; if (l.length === 0) { a.redrawComponents(o); return; } function d(_) { var T = _.xaxis, S = _.yaxis; f._defs.select("#" + _.clipId + "> rect").call(n.setTranslate, 0, 0).call(n.setScale, 1, 1), _.plot.call(n.setTranslate, T._offset, S._offset).call(n.setScale, 1, 1); var M = _.plot.selectAll(".scatterlayer .trace"); M.selectAll(".point").call(n.setPointGroupScale, 1, 1), M.selectAll(".textpoint").call(n.setTextPointsScale, 1, 1), M.call(n.hideOutsideRangePoints, _); } function h(_, T) { var S = _.plotinfo, M = S.xaxis, L = S.yaxis, F = M._length, $ = L._length, I = !!_.xr1, O = !!_.yr1, G = []; if (I) { var K = r.simpleMap(_.xr0, M.r2l), V = r.simpleMap(_.xr1, M.r2l), z = K[1] - K[0], P = V[1] - V[0]; G[0] = (K[0] * (1 - T) + T * V[0] - K[0]) / (K[1] - K[0]) * F, G[2] = F * (1 - T + T * P / z), M.range[0] = M.l2r(K[0] * (1 - T) + T * V[0]), M.range[1] = M.l2r(K[1] * (1 - T) + T * V[1]); } else G[0] = 0, G[2] = F; if (O) { var R = r.simpleMap(_.yr0, L.r2l), H = r.simpleMap(_.yr1, L.r2l), B = R[1] - R[0], W = H[1] - H[0]; G[1] = (R[1] * (1 - T) + T * H[1] - R[1]) / (R[0] - R[1]) * $, G[3] = $ * (1 - T + T * W / B), L.range[0] = M.l2r(R[0] * (1 - T) + T * H[0]), L.range[1] = L.l2r(R[1] * (1 - T) + T * H[1]); } else G[1] = 0, G[3] = $; a.drawOne(o, M, { skipTitle: true }), a.drawOne(o, L, { skipTitle: true }), a.redrawComponents(o, [M._id, L._id]); var ee = I ? F / G[2] : 1, re = O ? $ / G[3] : 1, ae = I ? G[0] : 0, Q = O ? G[1] : 0, ue = I ? G[0] / G[2] * F : 0, j = O ? G[1] / G[3] * $ : 0, U = M._offset - ue, Z = L._offset - j; S.clipRect.call(n.setTranslate, ae, Q).call(n.setScale, 1 / ee, 1 / re), S.plot.call(n.setTranslate, U, Z).call(n.setScale, ee, re), n.setPointGroupScale(S.zoomScalePts, 1 / ee, 1 / re), n.setTextPointsScale(S.zoomScaleTxt, 1 / ee, 1 / re); } var p; u && (p = u()); function v() { for (var _ = {}, T = 0; T < l.length; T++) { var S = l[T], M = S.plotinfo.xaxis, L = S.plotinfo.yaxis; S.xr1 && (_[M._name + ".range"] = S.xr1.slice()), S.yr1 && (_[L._name + ".range"] = S.yr1.slice()); } return p && p(), t.call("relayout", o, _).then(function() { for (var F = 0; F < l.length; F++) d(l[F].plotinfo); }); } function m() { for (var _ = {}, T = 0; T < l.length; T++) { var S = l[T], M = S.plotinfo.xaxis, L = S.plotinfo.yaxis; S.xr0 && (_[M._name + ".range"] = S.xr0.slice()), S.yr0 && (_[L._name + ".range"] = S.yr0.slice()); } return t.call("relayout", o, _).then(function() { for (var F = 0; F < l.length; F++) d(l[F].plotinfo); }); } var g, y, w, k = e10.ease(s.easing); o._transitionData._interruptCallbacks.push(function() { return window.cancelAnimationFrame(w), w = null, m(); }); function x() { y = Date.now(); for (var _ = Math.min(1, (y - g) / s.duration), T = k(_), S = 0; S < l.length; S++) h(l[S], T); y - g > s.duration ? (v(), w = window.cancelAnimationFrame(x)) : w = window.requestAnimationFrame(x); } return g = Date.now(), w = window.requestAnimationFrame(x), Promise.resolve(); }, n0; } var Xp = lr; var mM = Nt; var Lv = Ue; var pne = Tn; var mne = Sr; var gM = Kc.getModuleCalcData; var nl = gn; var ji = Yn; var gne = yl; var wr = Lv.ensureSingle; function bh(e10, t, r) { return Lv.ensureSingle(e10, t, r, function(n) { n.datum(r); }); } yn.name = "cartesian"; yn.attr = ["xaxis", "yaxis"]; yn.idRoot = ["x", "y"]; yn.idRegex = ji.idRegex; yn.attrRegex = ji.attrRegex; yn.attributes = Wre(); yn.layoutAttributes = Ki; yn.supplyLayoutDefaults = hne(); yn.transitionAxes = vne(); yn.finalizeSubplots = function(e10, t) { var r = t._subplots, n = r.xaxis, a = r.yaxis, i = r.cartesian, o = i.concat(r.gl2d || []), l = {}, s = {}, u, f, d; for (u = 0; u < o.length; u++) { var h = o[u].split("y"); l[h[0]] = 1, s["y" + h[1]] = 1; } for (u = 0; u < n.length; u++) f = n[u], l[f] || (d = (e10[nl.id2name(f)] || {}).anchor, ji.idRegex.y.test(d) || (d = "y"), i.push(f + d), o.push(f + d), s[d] || (s[d] = 1, Lv.pushUnique(a, d))); for (u = 0; u < a.length; u++) d = a[u], s[d] || (f = (e10[nl.id2name(d)] || {}).anchor, ji.idRegex.x.test(f) || (f = "x"), i.push(f + d), o.push(f + d), l[f] || (l[f] = 1, Lv.pushUnique(n, f))); if (!o.length) { f = "", d = ""; for (var p in e10) if (ji.attrRegex.test(p)) { var v = p.charAt(0); v === "x" ? (!f || +p.substr(5) < +f.substr(5)) && (f = p) : (!d || +p.substr(5) < +d.substr(5)) && (d = p); } f = f ? nl.name2id(f) : "x", d = d ? nl.name2id(d) : "y", n.push(f), a.push(d), i.push(f + d); } }; yn.plot = function(e10, t, r, n) { var a = e10._fullLayout, i = a._subplots.cartesian, o = e10.calcdata, l; if (!Array.isArray(t)) for (t = [], l = 0; l < o.length; l++) t.push(l); for (l = 0; l < i.length; l++) { for (var s = i[l], u = a._plots[s], f = [], d, h = 0; h < o.length; h++) { var p = o[h], v = p[0].trace; v.xaxis + v.yaxis === s && ((t.indexOf(v.index) !== -1 || v.carpet) && (d && d[0].trace.xaxis + d[0].trace.yaxis === s && ["tonextx", "tonexty", "tonext"].indexOf(v.fill) !== -1 && f.indexOf(d) === -1 && f.push(d), f.push(p)), d = p); } i6(e10, u, f, r, n); } }; function i6(e10, t, r, n, a) { for (var i = ji.traceLayerClasses, o = e10._fullLayout, l = o._modules, s, u, f, d = [], h = [], p = 0; p < l.length; p++) { s = l[p]; var v = s.name, m = mM.modules[v].categories; if (m.svg) { var g = s.layerName || v + "layer", y = s.plot; u = gM(r, y), f = u[0], r = u[1], f.length && d.push({ i: i.indexOf(g), className: g, plotMethod: y, cdModule: f }), m.zoomScale && h.push("." + g); } } d.sort(function(x, _) { return x.i - _.i; }); var w = t.plot.selectAll("g.mlayer").data(d, function(x) { return x.className; }); if (w.enter().append("g").attr("class", function(x) { return x.className; }).classed("mlayer", true).classed("rangeplot", t.isRangePlot), w.exit().remove(), w.order(), w.each(function(x) { var _ = Xp.select(this), T = x.className; x.plotMethod( e10, t, x.cdModule, _, n, a ), ji.clipOnAxisFalseQuery.indexOf("." + T) === -1 && mne.setClipUrl(_, t.layerClipId, e10); }), o._has("scattergl") && (s = mM.getModule("scattergl"), f = gM(r, s)[0], s.plot(e10, t, f)), !e10._context.staticPlot && (t._hasClipOnAxisFalse && (t.clipOnAxisFalseTraces = t.plot.selectAll(ji.clipOnAxisFalseQuery.join(",")).selectAll(".trace")), h.length)) { var k = t.plot.selectAll(h.join(",")).selectAll(".trace"); t.zoomScalePts = k.selectAll("path.point"), t.zoomScaleTxt = k.selectAll(".textpoint"); } } yn.clean = function(e10, t, r, n) { var a = n._plots || {}, i = t._plots || {}, o = n._subplots || {}, l, s, u; if (n._hasOnlyLargeSploms && !t._hasOnlyLargeSploms) for (u in a) l = a[u], l.plotgroup && l.plotgroup.remove(); var f = n._has && n._has("gl"), d = t._has && t._has("gl"); if (f && !d) for (u in a) l = a[u], l._scene && l._scene.destroy(); if (o.xaxis && o.yaxis) { var h = nl.listIds({ _fullLayout: n }); for (s = 0; s < h.length; s++) { var p = h[s]; t[nl.id2name(p)] || n._infolayer.selectAll(".g-" + p + "title").remove(); } } var v = n._has && n._has("cartesian"), m = t._has && t._has("cartesian"); if (v && !m) l6(n._cartesianlayer.selectAll(".subplot"), n), n._defs.selectAll(".axesclip").remove(), delete n._axisConstraintGroups, delete n._axisMatchGroups; else if (o.cartesian) for (s = 0; s < o.cartesian.length; s++) { var g = o.cartesian[s]; if (!i[g]) { var y = "." + g + ",." + g + "-x,." + g + "-y"; n._cartesianlayer.selectAll(y).remove(), s6(g, n); } } }; yn.drawFramework = function(e10) { var t = e10._fullLayout, r = yne(e10), n = t._cartesianlayer.selectAll(".subplot").data(r, String); n.enter().append("g").attr("class", function(a) { return "subplot " + a[0]; }), n.order(), n.exit().call(l6, t), n.each(function(a) { var i = a[0], o = t._plots[i]; o.plotgroup = Xp.select(this), o6(e10, o), o.draglayer = wr(t._draggers, "g", i); }); }; yn.rangePlot = function(e10, t, r) { o6(e10, t), i6(e10, t, r), pne.style(e10); }; function yne(e10) { var t = e10._fullLayout, r = t._subplots.cartesian, n = r.length, a, i, o, l, s, u, f = [], d = []; for (a = 0; a < n; a++) { o = r[a], l = t._plots[o], s = l.xaxis, u = l.yaxis; var h = s._mainAxis, p = u._mainAxis, v = h._id + p._id, m = t._plots[v]; l.overlays = [], v !== o && m ? (l.mainplot = v, l.mainplotinfo = m, d.push(o)) : (l.mainplot = void 0, l.mainplotinfo = void 0, f.push(o)); } for (a = 0; a < d.length; a++) o = d[a], l = t._plots[o], l.mainplotinfo.overlays.push(l); var g = f.concat(d), y = new Array(n); for (a = 0; a < n; a++) { o = g[a], l = t._plots[o], s = l.xaxis, u = l.yaxis; var w = [o, s.layer, u.layer, s.overlaying || "", u.overlaying || ""]; for (i = 0; i < l.overlays.length; i++) w.push(l.overlays[i].id); y[a] = w; } return y; } function o6(e10, t) { var r = t.plotgroup, n = t.id, a = ji.layerValue2layerClass[t.xaxis.layer], i = ji.layerValue2layerClass[t.yaxis.layer], o = e10._fullLayout._hasOnlyLargeSploms; if (t.mainplot) { var s = t.mainplotinfo, u = s.plotgroup, f = n + "-x", d = n + "-y"; t.minorGridlayer = s.minorGridlayer, t.gridlayer = s.gridlayer, t.zerolinelayer = s.zerolinelayer, wr(s.overlinesBelow, "path", f), wr(s.overlinesBelow, "path", d), wr(s.overaxesBelow, "g", f), wr(s.overaxesBelow, "g", d), t.plot = wr(s.overplot, "g", n), wr(s.overlinesAbove, "path", f), wr(s.overlinesAbove, "path", d), wr(s.overaxesAbove, "g", f), wr(s.overaxesAbove, "g", d), t.xlines = u.select(".overlines-" + a).select("." + f), t.ylines = u.select(".overlines-" + i).select("." + d), t.xaxislayer = u.select(".overaxes-" + a).select("." + f), t.yaxislayer = u.select(".overaxes-" + i).select("." + d); } else if (o) t.xlines = wr(r, "path", "xlines-above"), t.ylines = wr(r, "path", "ylines-above"), t.xaxislayer = wr(r, "g", "xaxislayer-above"), t.yaxislayer = wr(r, "g", "yaxislayer-above"); else { var l = wr(r, "g", "layer-subplot"); t.shapelayer = wr(l, "g", "shapelayer"), t.imagelayer = wr(l, "g", "imagelayer"), t.minorGridlayer = wr(r, "g", "minor-gridlayer"), t.gridlayer = wr(r, "g", "gridlayer"), t.zerolinelayer = wr(r, "g", "zerolinelayer"), wr(r, "path", "xlines-below"), wr(r, "path", "ylines-below"), t.overlinesBelow = wr(r, "g", "overlines-below"), wr(r, "g", "xaxislayer-below"), wr(r, "g", "yaxislayer-below"), t.overaxesBelow = wr(r, "g", "overaxes-below"), t.plot = wr(r, "g", "plot"), t.overplot = wr(r, "g", "overplot"), t.xlines = wr(r, "path", "xlines-above"), t.ylines = wr(r, "path", "ylines-above"), t.overlinesAbove = wr(r, "g", "overlines-above"), wr(r, "g", "xaxislayer-above"), wr(r, "g", "yaxislayer-above"), t.overaxesAbove = wr(r, "g", "overaxes-above"), t.xlines = r.select(".xlines-" + a), t.ylines = r.select(".ylines-" + i), t.xaxislayer = r.select(".xaxislayer-" + a), t.yaxislayer = r.select(".yaxislayer-" + i); } o || (bh(t.minorGridlayer, "g", t.xaxis._id), bh(t.minorGridlayer, "g", t.yaxis._id), t.minorGridlayer.selectAll("g").map(function(h) { return h[0]; }).sort(nl.idSort), bh(t.gridlayer, "g", t.xaxis._id), bh(t.gridlayer, "g", t.yaxis._id), t.gridlayer.selectAll("g").map(function(h) { return h[0]; }).sort(nl.idSort)), t.xlines.style("fill", "none").classed("crisp", true), t.ylines.style("fill", "none").classed("crisp", true); } function l6(e10, t) { if (e10) { var r = {}; e10.each(function(s) { var u = s[0], f = Xp.select(this); f.remove(), s6(u, t), r[u] = true; }); for (var n in t._plots) for (var a = t._plots[n], i = a.overlays || [], o = 0; o < i.length; o++) { var l = i[o]; r[l.id] && l.plot.selectAll(".trace").remove(); } } } function s6(e10, t) { t._draggers.selectAll("g." + e10).remove(), t._defs.select("#clip" + t._uid + e10 + "plot").remove(); } yn.toSVG = function(e10) { var t = e10._fullLayout._glimages, r = Xp.select(e10).selectAll(".svg-container"), n = r.filter(function(i, o) { return o === r.size() - 1; }).selectAll(".gl-canvas-context, .gl-canvas-focus"); function a() { var i = this, o = i.toDataURL("image/png"), l = t.append("svg:image"); l.attr({ xmlns: gne.svg, "xlink:href": o, preserveAspectRatio: "none", x: 0, y: 0, width: i.style.width, height: i.style.height }); } n.each(a); }; yn.updateFx = Mb.updateFx; var _h = Ya; var u6 = { hasLines: _h.hasLines, hasMarkers: _h.hasMarkers, hasText: _h.hasText, isBubble: _h.isBubble, attributes: ws, layoutAttributes: ub, supplyDefaults: Wte, crossTraceDefaults: Jte, supplyLayoutDefaults: tre, calc: GE.calc, crossTraceCalc: kre, arraysToCalcdata: NE, plot: Pre, colorbar: t6, formatLabels: r6, style: nM.style, styleOnSelect: nM.styleOnSelect, hoverPoints: Vre, selectPoints: qre, animatable: true, moduleType: "trace", name: "scatter", basePlotModule: yn, categories: [ "cartesian", "svg", "symbols", "errorBarsOK", "showLegend", "scatter-like", "zoomScale" ], meta: { description: [ "The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.", "The data visualized as scatter point or lines is set in `x` and `y`.", "Text (appearing either on the chart or on hover only) is via `text`.", "Bubble charts are achieved by setting `marker.size` and/or `marker.color`", "to numerical arrays." ].join(" ") } }; var bne = lr; var _ne = nr; var yM = hE; var c_ = Ue; var xne = c_.strScale; var wne = c_.strRotate; var Tne = c_.strTranslate; var kne = function(t, r, n) { var a = t.node(), i = yM[n.arrowhead || 0], o = yM[n.startarrowhead || 0], l = (n.arrowwidth || 1) * (n.arrowsize || 1), s = (n.arrowwidth || 1) * (n.startarrowsize || 1), u = r.indexOf("start") >= 0, f = r.indexOf("end") >= 0, d = i.backoff * l + n.standoff, h = o.backoff * s + n.startstandoff, p, v, m, g; if (a.nodeName === "line") { p = { x: +t.attr("x1"), y: +t.attr("y1") }, v = { x: +t.attr("x2"), y: +t.attr("y2") }; var y = p.x - v.x, w = p.y - v.y; if (m = Math.atan2(w, y), g = m + Math.PI, d && h && d + h > Math.sqrt(y * y + w * w)) { G(); return; } if (d) { if (d * d > y * y + w * w) { G(); return; } var k = d * Math.cos(m), x = d * Math.sin(m); v.x += k, v.y += x, t.attr({ x2: v.x, y2: v.y }); } if (h) { if (h * h > y * y + w * w) { G(); return; } var _ = h * Math.cos(m), T = h * Math.sin(m); p.x -= _, p.y -= T, t.attr({ x1: p.x, y1: p.y }); } } else if (a.nodeName === "path") { var S = a.getTotalLength(), M = ""; if (S < d + h) { G(); return; } var L = a.getPointAtLength(0), F = a.getPointAtLength(0.1); m = Math.atan2(L.y - F.y, L.x - F.x), p = a.getPointAtLength(Math.min(h, S)), M = "0px," + h + "px,"; var $ = a.getPointAtLength(S), I = a.getPointAtLength(S - 0.1); g = Math.atan2($.y - I.y, $.x - I.x), v = a.getPointAtLength(Math.max(0, S - d)); var O = M ? h + d : d; M += S - O + "px," + S + "px", t.style("stroke-dasharray", M); } function G() { t.style("stroke-dasharray", "0px,100px"); } function K(V, z, P, R) { V.path && (V.noRotate && (P = 0), bne.select(a.parentNode).append("path").attr({ class: t.attr("class"), d: V.path, transform: Tne(z.x, z.y) + wne(P * 180 / Math.PI) + xne(R) }).style({ fill: _ne.rgb(n.arrowcolor), "stroke-width": 0 })); } u && K(o, p, m, s), f && K(i, v, g, l); }; var bM = lr; var a0 = Nt; var Ane = Tn; var Vo = Ue; var i0 = Vo.strTranslate; var $c = Cr; var Rl = nr; var oo = Sr; var _M = Ao; var o0 = Rn; var l0 = xs; var Uf = Qi; var Mne = Mr.arrayEditor; var Sne = kne; var d_ = { draw: Cne, drawOne: f6, drawRaw: c6 }; function Cne(e10) { var t = e10._fullLayout; t._infolayer.selectAll(".annotation").remove(); for (var r = 0; r < t.annotations.length; r++) t.annotations[r].visible && f6(e10, r); return Ane.previousPromises(e10); } function f6(e10, t) { var r = e10._fullLayout, n = r.annotations[t] || {}, a = $c.getFromId(e10, n.xref), i = $c.getFromId(e10, n.yref); a && a.setScale(), i && i.setScale(), c6(e10, n, t, false, a, i); } function Bo(e10, t, r, n, a) { var i = a[r], o = a[r + "ref"], l = r.indexOf("y") !== -1, s = $c.getRefType(o) === "domain", u = l ? n.h : n.w; return e10 ? s ? i + (l ? -t : t) / e10._length : e10.p2r(e10.r2p(i) + t) : i + (l ? -t : t) / u; } function c6(e10, t, r, n, a, i) { var o = e10._fullLayout, l = e10._fullLayout._size, s = e10._context.edits, u, f; n ? (u = "annotation-" + n, f = n + ".annotations") : (u = "annotation", f = "annotations"); var d = Mne(e10.layout, f, t), h = d.modifyBase, p = d.modifyItem, v = d.getUpdateObj; o._infolayer.selectAll("." + u + '[data-index="' + r + '"]').remove(); var m = "clip" + o._uid + "_ann" + r; if (!t._input || t.visible === false) { bM.selectAll("#" + m).remove(); return; } var g = { x: {}, y: {} }, y = +t.textangle || 0, w = o._infolayer.append("g").classed(u, true).attr("data-index", String(r)).style("opacity", t.opacity), k = w.append("g").classed("annotation-text-g", true), x = s[t.showarrow ? "annotationTail" : "annotationPosition"], _ = t.captureevents || s.annotationText || x; function T(R) { var H = { index: r, annotation: t._input, fullAnnotation: t, event: R }; return n && (H.subplotId = n), H; } var S = k.append("g").style("pointer-events", _ ? "all" : null).call(l0, "pointer").on("click", function() { e10._dragging = false, e10.emit("plotly_clickannotation", T(bM.event)); }); t.hovertext && S.on("mouseover", function() { var R = t.hoverlabel, H = R.font, B = this.getBoundingClientRect(), W = e10.getBoundingClientRect(); _M.loneHover({ x0: B.left - W.left, x1: B.right - W.left, y: (B.top + B.bottom) / 2 - W.top, text: t.hovertext, color: R.bgcolor, borderColor: R.bordercolor, fontFamily: H.family, fontSize: H.size, fontColor: H.color }, { container: o._hoverlayer.node(), outerContainer: o._paper.node(), gd: e10 }); }).on("mouseout", function() { _M.loneUnhover(o._hoverlayer.node()); }); var M = t.borderwidth, L = t.borderpad, F = M + L, $ = S.append("rect").attr("class", "bg").style("stroke-width", M + "px").call(Rl.stroke, t.bordercolor).call(Rl.fill, t.bgcolor), I = t.width || t.height, O = o._topclips.selectAll("#" + m).data(I ? [0] : []); O.enter().append("clipPath").classed("annclip", true).attr("id", m).append("rect"), O.exit().remove(); var G = t.font, K = o._meta ? Vo.templateString(t.text, o._meta) : t.text, V = S.append("text").classed("annotation-text", true).text(K); function z(R) { return R.call(oo.font, G).attr({ "text-anchor": { left: "start", right: "end" }[t.align] || "middle" }), o0.convertToTspans(R, e10, P), R; } function P() { var R = V.selectAll("a"); if (R.size() === 1 && R.text() === V.text()) { var H = S.insert("a", ":first-child").attr({ "xlink:xlink:href": R.attr("xlink:href"), "xlink:xlink:show": R.attr("xlink:show") }).style({ cursor: "pointer" }); H.node().appendChild($.node()); } var B = S.select(".annotation-text-math-group"), W = !B.empty(), ee = oo.bBox( (W ? B : V).node() ), re = ee.width, ae = ee.height, Q = t.width || re, ue = t.height || ae, j = Math.round(Q + 2 * F), U = Math.round(ue + 2 * F); function Z(Ke, st) { return st === "auto" && (Ke < 1 / 3 ? st = "left" : Ke > 2 / 3 ? st = "right" : st = "center"), { center: 0, middle: 0, left: 0.5, bottom: -0.5, right: -0.5, top: 0.5 }[st]; } for (var le = false, J = ["x", "y"], pe = 0; pe < J.length; pe++) { var ge = J[pe], ve = t[ge + "ref"] || ge, me = t["a" + ge + "ref"], Le = { x: a, y: i }[ge], ze = (y + (ge === "x" ? 0 : -90)) * Math.PI / 180, Fe = j * Math.cos(ze), Oe = U * Math.sin(ze), Re = Math.abs(Fe) + Math.abs(Oe), We = t[ge + "anchor"], Me = t[ge + "shift"] * (ge === "x" ? 1 : -1), Ve = g[ge], qe, Qe, ot, ht, vt, nt = $c.getRefType(ve); if (Le && nt !== "domain") { var ft = Le.r2fraction(t[ge]); (ft < 0 || ft > 1) && (me === ve ? (ft = Le.r2fraction(t["a" + ge]), (ft < 0 || ft > 1) && (le = true)) : le = true), qe = Le._offset + Le.r2p(t[ge]), ht = 0.5; } else { var Pe = nt === "domain"; ge === "x" ? (ot = t[ge], qe = Pe ? Le._offset + Le._length * ot : qe = l.l + l.w * ot) : (ot = 1 - t[ge], qe = Pe ? Le._offset + Le._length * ot : qe = l.t + l.h * ot), ht = t.showarrow ? 0.5 : ot; } if (t.showarrow) { Ve.head = qe; var Ie = t["a" + ge]; if (vt = Fe * Z(0.5, t.xanchor) - Oe * Z(0.5, t.yanchor), me === ve) { var Ne = $c.getRefType(me); Ne === "domain" ? (ge === "y" && (Ie = 1 - Ie), Ve.tail = Le._offset + Le._length * Ie) : Ne === "paper" ? ge === "y" ? (Ie = 1 - Ie, Ve.tail = l.t + l.h * Ie) : Ve.tail = l.l + l.w * Ie : Ve.tail = Le._offset + Le.r2p(Ie), Qe = vt; } else Ve.tail = qe + Ie, Qe = vt + Ie; Ve.text = Ve.tail + vt; var tt = o[ge === "x" ? "width" : "height"]; if (ve === "paper" && (Ve.head = Vo.constrain(Ve.head, 1, tt - 1)), me === "pixel") { var Je = -Math.max(Ve.tail - 3, Ve.text), it = Math.min(Ve.tail + 3, Ve.text) - tt; Je > 0 ? (Ve.tail += Je, Ve.text += Je) : it > 0 && (Ve.tail -= it, Ve.text -= it); } Ve.tail += Me, Ve.head += Me; } else vt = Re * Z(ht, We), Qe = vt, Ve.text = qe + vt; Ve.text += Me, vt += Me, Qe += Me, t["_" + ge + "padplus"] = Re / 2 + Qe, t["_" + ge + "padminus"] = Re / 2 - Qe, t["_" + ge + "size"] = Re, t["_" + ge + "shift"] = vt; } if (le) { S.remove(); return; } var at = 0, Tt = 0; if (t.align !== "left" && (at = (Q - re) * (t.align === "center" ? 0.5 : 1)), t.valign !== "top" && (Tt = (ue - ae) * (t.valign === "middle" ? 0.5 : 1)), W) B.select("svg").attr({ x: F + at - 1, y: F + Tt }).call(oo.setClipUrl, I ? m : null, e10); else { var gt = F + Tt - ee.top, He = F + at - ee.left; V.call(o0.positionText, He, gt).call(oo.setClipUrl, I ? m : null, e10); } O.select("rect").call( oo.setRect, F, F, Q, ue ), $.call( oo.setRect, M / 2, M / 2, j - M, U - M ), S.call( oo.setTranslate, Math.round(g.x.text - j / 2), Math.round(g.y.text - U / 2) ), k.attr({ transform: "rotate(" + y + "," + g.x.text + "," + g.y.text + ")" }); var pt = function(Ke, st) { w.selectAll(".annotation-arrow-g").remove(); var rt = g.x.head, ct = g.y.head, X = g.x.tail + Ke, se = g.y.tail + st, ie = g.x.text + Ke, fe = g.y.text + st, ke = Vo.rotationXYMatrix(y, ie, fe), _e = Vo.apply2DTransform(ke), Ge = Vo.apply2DTransform2(ke), je = +$.attr("width"), Ee = +$.attr("height"), oe = ie - 0.5 * je, Ce = oe + je, Be = fe - 0.5 * Ee, Xe = Be + Ee, Et = [ [oe, Be, oe, Xe], [oe, Xe, Ce, Xe], [Ce, Xe, Ce, Be], [Ce, Be, oe, Be] ].map(Ge); if (!Et.reduce(function(St, Ut) { return St ^ !!Vo.segmentsIntersect( rt, ct, rt + 1e6, ct + 1e6, Ut[0], Ut[1], Ut[2], Ut[3] ); }, false)) { Et.forEach(function(St) { var Ut = Vo.segmentsIntersect( X, se, rt, ct, St[0], St[1], St[2], St[3] ); Ut && (X = Ut.x, se = Ut.y); }); var Pt = t.arrowwidth, It = t.arrowcolor, kt = t.arrowside, qt = w.append("g").style({ opacity: Rl.opacity(It) }).classed("annotation-arrow-g", true), Ot = qt.append("path").attr("d", "M" + X + "," + se + "L" + rt + "," + ct).style("stroke-width", Pt + "px").call(Rl.stroke, Rl.rgb(It)); if (Sne(Ot, kt, t), s.annotationPosition && Ot.node().parentNode && !n) { var wt = rt, Yt = ct; if (t.standoff) { var Kt = Math.sqrt(Math.pow(rt - X, 2) + Math.pow(ct - se, 2)); wt += t.standoff * (X - rt) / Kt, Yt += t.standoff * (se - ct) / Kt; } var $t = qt.append("path").classed("annotation-arrow", true).classed("anndrag", true).classed("cursor-move", true).attr({ d: "M3,3H-3V-3H3ZM0,0L" + (X - wt) + "," + (se - Yt), transform: i0(wt, Yt) }).style("stroke-width", Pt + 6 + "px").call(Rl.stroke, "rgba(0,0,0,0)").call(Rl.fill, "rgba(0,0,0,0)"), zt, Mt; Uf.init({ element: $t.node(), gd: e10, prepFn: function() { var St = oo.getTranslate(S); zt = St.x, Mt = St.y, a && a.autorange && h(a._name + ".autorange", true), i && i.autorange && h(i._name + ".autorange", true); }, moveFn: function(St, Ut) { var fr = _e(zt, Mt), Ct = fr[0] + St, tr = fr[1] + Ut; S.call(oo.setTranslate, Ct, tr), p( "x", Bo(a, St, "x", l, t) ), p( "y", Bo(i, Ut, "y", l, t) ), t.axref === t.xref && p("ax", Bo(a, St, "ax", l, t)), t.ayref === t.yref && p("ay", Bo(i, Ut, "ay", l, t)), qt.attr("transform", i0(St, Ut)), k.attr({ transform: "rotate(" + y + "," + Ct + "," + tr + ")" }); }, doneFn: function() { a0.call("_guiRelayout", e10, v()); var St = document.querySelector(".js-notes-box-panel"); St && St.redraw(St.selectedObj); } }); } } }; if (t.showarrow && pt(0, 0), x) { var bt; Uf.init({ element: S.node(), gd: e10, prepFn: function() { bt = k.attr("transform"); }, moveFn: function(Ke, st) { var rt = "pointer"; if (t.showarrow) t.axref === t.xref ? p("ax", Bo(a, Ke, "ax", l, t)) : p("ax", t.ax + Ke), t.ayref === t.yref ? p("ay", Bo(i, st, "ay", l.w, t)) : p("ay", t.ay + st), pt(Ke, st); else { if (n) return; var ct, X; if (a) ct = Bo(a, Ke, "x", l, t); else { var se = t._xsize / l.w, ie = t.x + (t._xshift - t.xshift) / l.w - se / 2; ct = Uf.align( ie + Ke / l.w, se, 0, 1, t.xanchor ); } if (i) X = Bo(i, st, "y", l, t); else { var fe = t._ysize / l.h, ke = t.y - (t._yshift + t.yshift) / l.h - fe / 2; X = Uf.align( ke - st / l.h, fe, 0, 1, t.yanchor ); } p("x", ct), p("y", X), (!a || !i) && (rt = Uf.getCursor( a ? 0.5 : ct, i ? 0.5 : X, t.xanchor, t.yanchor )); } k.attr({ transform: i0(Ke, st) + bt }), l0(S, rt); }, clickFn: function(Ke, st) { t.captureevents && e10.emit("plotly_clickannotation", T(st)); }, doneFn: function() { l0(S), a0.call("_guiRelayout", e10, v()); var Ke = document.querySelector(".js-notes-box-panel"); Ke && Ke.redraw(Ke.selectedObj); } }); } } s.annotationText ? V.call(o0.makeEditable, { delegate: S, gd: e10 }).call(z).on("edit", function(R) { t.text = R, this.call(z), p("text", R), a && a.autorange && h(a._name + ".autorange", true), i && i.autorange && h(i._name + ".autorange", true), a0.call("_guiRelayout", e10, v()); }) : V.call(z); } var xM = Ue; var Lne = Nt; var wM = Mr.arrayEditor; var Dne = { hasClickToShow: Ene, onClick: Fne }; function Ene(e10, t) { var r = d6(e10, t); return r.on.length > 0 || r.explicitOff.length > 0; } function Fne(e10, t) { var r = d6(e10, t), n = r.on, a = r.off.concat(r.explicitOff), i = {}, o = e10._fullLayout.annotations, l, s; if (n.length || a.length) { for (l = 0; l < n.length; l++) s = wM(e10.layout, "annotations", o[n[l]]), s.modifyItem("visible", true), xM.extendFlat(i, s.getUpdateObj()); for (l = 0; l < a.length; l++) s = wM(e10.layout, "annotations", o[a[l]]), s.modifyItem("visible", false), xM.extendFlat(i, s.getUpdateObj()); return Lne.call("update", e10, {}, i); } } function d6(e10, t) { var r = e10._fullLayout.annotations, n = [], a = [], i = [], o = (t || []).length, l, s, u, f, d, h, p, v; for (l = 0; l < r.length; l++) if (u = r[l], f = u.clicktoshow, f) { for (s = 0; s < o; s++) if (d = t[s], h = d.xaxis, p = d.yaxis, h._id === u.xref && p._id === u.yref && h.d2r(d.x) === TM(u._xclick, h) && p.d2r(d.y) === TM(u._yclick, p)) { u.visible ? f === "onout" ? v = a : v = i : v = n, v.push(l); break; } s === o && u.visible && f === "onout" && a.push(l); } return { on: n, off: a, explicitOff: i }; } function TM(e10, t) { return t.type === "log" ? t.l2r(e10) : t.d2r(e10); } var kM = Ue; var Gs = nr; var h6 = function(t, r, n, a) { a("opacity"); var i = a("bgcolor"), o = a("bordercolor"), l = Gs.opacity(o); a("borderpad"); var s = a("borderwidth"), u = a("showarrow"); a("text", u ? " " : n._dfltTitle.annotation), a("textangle"), kM.coerceFont(a, "font", n.font), a("width"), a("align"); var f = a("height"); if (f && a("valign"), u) { var d = a("arrowside"), h, p; d.indexOf("end") !== -1 && (h = a("arrowhead"), p = a("arrowsize")), d.indexOf("start") !== -1 && (a("startarrowhead", h), a("startarrowsize", p)), a("arrowcolor", l ? r.bordercolor : Gs.defaultLine), a("arrowwidth", (l && s || 1) * 2), a("standoff"), a("startstandoff"); } var v = a("hovertext"), m = n.hoverlabel || {}; if (v) { var g = a( "hoverlabel.bgcolor", m.bgcolor || (Gs.opacity(i) ? Gs.rgb(i) : Gs.defaultLine) ), y = a( "hoverlabel.bordercolor", m.bordercolor || Gs.contrast(g) ); kM.coerceFont(a, "hoverlabel.font", { family: m.font.family, size: m.font.size, color: m.font.color || y }); } a("captureevents", !!v); }; var s0 = Ue; var Pl = Cr; var Rne = Ji; var Pne = h6; var $ne = td; var zne = function(t, r) { Rne(t, r, { name: "annotations", handleItemDefaults: Ine }); }; function Ine(e10, t, r) { function n(k, x) { return s0.coerce(e10, t, $ne, k, x); } var a = n("visible"), i = n("clicktoshow"); if (a || i) { Pne(e10, t, r, n); for (var o = t.showarrow, l = ["x", "y"], s = [-10, -30], u = { _fullLayout: r }, f = 0; f < 2; f++) { var d = l[f], h = Pl.coerceRef(e10, t, u, d, "", "paper"); if (h !== "paper") { var p = Pl.getFromId(u, h); p._annIndices.push(t._index); } if (Pl.coercePosition(t, u, n, h, d, 0.5), o) { var v = "a" + d, m = Pl.coerceRef( e10, t, u, v, "pixel", ["pixel", "paper"] ); m !== "pixel" && m !== h && (m = t[v] = "pixel"); var g = m === "pixel" ? s[f] : 0.4; Pl.coercePosition(t, u, n, m, v, g); } n(d + "anchor"), n(d + "shift"); } if (s0.noneOrAll(e10, t, ["x", "y"]), o && s0.noneOrAll(e10, t, ["ax", "ay"]), i) { var y = n("xclick"), w = n("yclick"); t._xclick = y === void 0 ? t.x : Pl.cleanPosition(y, u, t.xref), t._yclick = w === void 0 ? t.y : Pl.cleanPosition(w, u, t.yref); } } } var Zy = Ue; var jl = Cr; var Nne = d_.draw; var One = function(t) { var r = t._fullLayout, n = Zy.filterVisible(r.annotations); if (n.length && t._fullData.length) return Zy.syncOrAsync([Nne, Hne], t); }; function Hne(e10) { var t = e10._fullLayout; Zy.filterVisible(t.annotations).forEach(function(r) { var n = jl.getFromId(e10, r.xref), a = jl.getFromId(e10, r.yref), i = jl.getRefType(r.xref), o = jl.getRefType(r.yref); r._extremes = {}, i === "range" && AM(r, n), o === "range" && AM(r, a); }); } function AM(e10, t) { var r = t._id, n = r.charAt(0), a = e10[n], i = e10["a" + n], o = e10[n + "ref"], l = e10["a" + n + "ref"], s = e10["_" + n + "padplus"], u = e10["_" + n + "padminus"], f = { x: 1, y: -1 }[n] * e10[n + "shift"], d = 3 * e10.arrowsize * e10.arrowwidth || 0, h = d + f, p = d - f, v = 3 * e10.startarrowsize * e10.arrowwidth || 0, m = v + f, g = v - f, y; if (l === o) { var w = jl.findExtremes(t, [t.r2c(a)], { ppadplus: h, ppadminus: p }), k = jl.findExtremes(t, [t.r2c(i)], { ppadplus: Math.max(s, m), ppadminus: Math.max(u, g) }); y = { min: [w.min[0], k.min[0]], max: [w.max[0], k.max[0]] }; } else m = i ? m + i : m, g = i ? g - i : g, y = jl.findExtremes(t, [t.r2c(a)], { ppadplus: Math.max(s, h, m), ppadminus: Math.max(u, p, g) }); e10._extremes[r] = y; } var Bne = sr; var jne = U1; var Une = function(t, r, n, a) { r = r || {}; var i = n === "log" && r.type === "linear", o = n === "linear" && r.type === "log"; if (!(i || o)) return; var l = t._fullLayout.annotations, s = r._id.charAt(0), u, f; function d(p) { var v = u[p], m = null; i ? m = jne(v, r.range) : m = Math.pow(10, v), Bne(m) || (m = null), a(f + p, m); } for (var h = 0; h < l.length; h++) u = l[h], f = "annotations[" + h + "].", u[s + "ref"] === r._id && d(s), u["a" + s + "ref"] === r._id && d("a" + s); }; var u0 = d_; var MM = Dne; var Gne = { moduleType: "component", name: "annotations", layoutAttributes: td, supplyLayoutDefaults: zne, includeBasePlot: qp("annotations"), calcAutorange: One, draw: u0.draw, drawOne: u0.drawOne, drawRaw: u0.drawRaw, hasClickToShow: MM.hasClickToShow, onClick: MM.onClick, convertCoords: Une }; var Er = td; var Vne = Lo.overrideAll; var qne = Mr.templatedArray; var Yy = Vne(qne("annotation", { visible: Er.visible, x: { valType: "any", description: [ "Sets the annotation's x position." ].join(" ") }, y: { valType: "any", description: [ "Sets the annotation's y position." ].join(" ") }, z: { valType: "any", description: [ "Sets the annotation's z position." ].join(" ") }, ax: { valType: "number", description: [ "Sets the x component of the arrow tail about the arrow head (in pixels)." ].join(" ") }, ay: { valType: "number", description: [ "Sets the y component of the arrow tail about the arrow head (in pixels)." ].join(" ") }, xanchor: Er.xanchor, xshift: Er.xshift, yanchor: Er.yanchor, yshift: Er.yshift, text: Er.text, textangle: Er.textangle, font: Er.font, width: Er.width, height: Er.height, opacity: Er.opacity, align: Er.align, valign: Er.valign, bgcolor: Er.bgcolor, bordercolor: Er.bordercolor, borderpad: Er.borderpad, borderwidth: Er.borderwidth, showarrow: Er.showarrow, arrowcolor: Er.arrowcolor, arrowhead: Er.arrowhead, startarrowhead: Er.startarrowhead, arrowside: Er.arrowside, arrowsize: Er.arrowsize, startarrowsize: Er.startarrowsize, arrowwidth: Er.arrowwidth, standoff: Er.standoff, startstandoff: Er.startstandoff, hovertext: Er.hovertext, hoverlabel: Er.hoverlabel, captureevents: Er.captureevents // maybes later? // clicktoshow: annAttrs.clicktoshow, // xclick: annAttrs.xclick, // yclick: annAttrs.yclick, // not needed! // axref: 'pixel' // ayref: 'pixel' // xref: 'x' // yref: 'y // zref: 'z' }), "calc", "from-root"); var f0 = Ue; var Wne = Cr; var Zne = Ji; var Yne = h6; var Xne = Yy; var Kne = function(t, r, n) { Zne(t, r, { name: "annotations", handleItemDefaults: Jne, fullLayout: n.fullLayout }); }; function Jne(e10, t, r, n) { function a(l, s) { return f0.coerce(e10, t, Xne, l, s); } function i(l) { var s = l + "axis", u = { _fullLayout: {} }; return u._fullLayout[s] = r[s], Wne.coercePosition(t, u, a, l, l, 0.5); } var o = a("visible"); o && (Yne(e10, t, n.fullLayout, a), i("x"), i("y"), i("z"), f0.noneOrAll(e10, t, ["x", "y", "z"]), t.xref = "x", t.yref = "y", t.zref = "z", a("xanchor"), a("yanchor"), a("xshift"), a("yshift"), t.showarrow && (t.axref = "pixel", t.ayref = "pixel", a("ax", -10), a("ay", -30), f0.noneOrAll(e10, t, ["ax", "ay"]))); } var SM = Ue; var CM = Cr; var Qne = function(t) { for (var r = t.fullSceneLayout, n = r.annotations, a = 0; a < n.length; a++) eae(n[a], t); t.fullLayout._infolayer.selectAll(".annotation-" + t.id).remove(); }; function eae(e10, t) { var r = t.fullSceneLayout, n = r.domain, a = t.fullLayout._size, i = { // this gets fill in on render pdata: null, // to get setConvert to not execute cleanly type: "linear", // don't try to update them on `editable: true` autorange: false, // set infinite range so that annotation draw routine // does not try to remove 'outside-range' annotations, // this case is handled in the render loop range: [-1 / 0, 1 / 0] }; e10._xa = {}, SM.extendFlat(e10._xa, i), CM.setConvert(e10._xa), e10._xa._offset = a.l + n.x[0] * a.w, e10._xa.l2p = function() { return 0.5 * (1 + e10._pdata[0] / e10._pdata[3]) * a.w * (n.x[1] - n.x[0]); }, e10._ya = {}, SM.extendFlat(e10._ya, i), CM.setConvert(e10._ya), e10._ya._offset = a.t + (1 - n.y[1]) * a.h, e10._ya.l2p = function() { return 0.5 * (1 - e10._pdata[1] / e10._pdata[3]) * a.h * (n.y[1] - n.y[0]); }; } function c0(e10, t) { var r = [0, 0, 0, 0], n, a; for (n = 0; n < 4; ++n) for (a = 0; a < 4; ++a) r[a] += e10[4 * n + a] * t[n]; return r; } function tae(e10, t) { var r = c0( e10.projection, c0( e10.view, c0(e10.model, [t[0], t[1], t[2], 1]) ) ); return r; } var rae = tae; var nae = d_.drawRaw; var aae = rae; var iae = ["x", "y", "z"]; var oae = function(t) { for (var r = t.fullSceneLayout, n = t.dataScale, a = r.annotations, i = 0; i < a.length; i++) { for (var o = a[i], l = false, s = 0; s < 3; s++) { var u = iae[s], f = o[u], d = r[u + "axis"], h = d.r2fraction(f); if (h < 0 || h > 1) { l = true; break; } } l ? t.fullLayout._infolayer.select(".annotation-" + t.id + '[data-index="' + i + '"]').remove() : (o._pdata = aae(t.glplot.cameraParams, [ r.xaxis.r2l(o.x) * n[0], r.yaxis.r2l(o.y) * n[1], r.zaxis.r2l(o.z) * n[2] ]), nae(t.graphDiv, o, i, t.id, o._xa, o._ya)); } }; var lae = Nt; var LM = Ue; var sae = { moduleType: "component", name: "annotations3d", schema: { subplots: { scene: { annotations: Yy } } }, layoutAttributes: Yy, handleDefaults: Kne, includeBasePlot: uae, convert: Qne, draw: oae }; function uae(e10, t) { var r = lae.subplotsRegistry.gl3d; if (r) for (var n = r.attrRegex, a = Object.keys(e10), i = 0; i < a.length; i++) { var o = a[i]; n.test(o) && (e10[o].annotations || []).length && (LM.pushUnique(t._basePlotModules, r), LM.pushUnique(t._subplots.gl3d, o)); } } var DM = td; var EM = Fn; var FM = ws.line; var fae = Zi.dash; var ri = en.extendFlat; var cae = Mr.templatedArray; var RM = Vp; var Vs = Wi; var dae = _i.shapeTexttemplateAttrs; var hae = K1; var v6 = cae("shape", { visible: ri({}, Vs.visible, { editType: "calc+arraydraw", description: [ "Determines whether or not this shape is visible.", "If *legendonly*, the shape is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }), showlegend: { valType: "boolean", dflt: false, editType: "calc+arraydraw", description: [ "Determines whether or not this", "shape is shown in the legend." ].join(" ") }, legend: ri({}, Vs.legend, { editType: "calc+arraydraw", description: [ "Sets the reference to a legend to show this shape in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }), legendgroup: ri({}, Vs.legendgroup, { editType: "calc+arraydraw", description: [ "Sets the legend group for this shape.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }), legendgrouptitle: { text: ri({}, Vs.legendgrouptitle.text, { editType: "calc+arraydraw" }), font: EM({ editType: "calc+arraydraw", description: [ "Sets this legend group's title font." ].join(" ") }), editType: "calc+arraydraw" }, legendrank: ri({}, Vs.legendrank, { editType: "calc+arraydraw", description: [ "Sets the legend rank for this shape.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items.", "When having unranked or equal rank items shapes would be displayed after traces", "i.e. according to their order in data and layout." ].join(" ") }), legendwidth: ri({}, Vs.legendwidth, { editType: "calc+arraydraw", description: "Sets the width (in px or fraction) of the legend for this shape." }), type: { valType: "enumerated", values: ["circle", "rect", "path", "line"], editType: "calc+arraydraw", description: [ "Specifies the shape type to be drawn.", "If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)", "with respect to the axes' sizing mode.", "If *circle*, a circle is drawn from", "((`x0`+`x1`)/2, (`y0`+`y1`)/2))", "with radius", "(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)", "with respect to the axes' sizing mode.", "If *rect*, a rectangle is drawn linking", "(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)", "with respect to the axes' sizing mode.", "If *path*, draw a custom SVG path using `path`.", "with respect to the axes' sizing mode." ].join(" ") }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", editType: "arraydraw", description: "Specifies whether shapes are drawn below or above traces." }, xref: ri({}, DM.xref, { description: [ "Sets the shape's x coordinate axis.", RM.axisRefDescription("x", "left", "right") ].join(" ") }), xsizemode: { valType: "enumerated", values: ["scaled", "pixel"], dflt: "scaled", editType: "calc+arraydraw", description: [ "Sets the shapes's sizing mode along the x axis.", "If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to", "data values on the x axis or a fraction of the plot area's width", "(`xref` set to *paper*).", "If set to *pixel*, `xanchor` specifies the x position in terms", "of data or plot fraction but `x0`, `x1` and x coordinates within `path`", "are pixels relative to `xanchor`. This way, the shape can have", "a fixed width while maintaining a position relative to data or", "plot fraction." ].join(" ") }, xanchor: { valType: "any", editType: "calc+arraydraw", description: [ "Only relevant in conjunction with `xsizemode` set to *pixel*.", "Specifies the anchor point on the x axis to which `x0`, `x1`", "and x coordinates within `path` are relative to.", "E.g. useful to attach a pixel sized shape to a certain data value.", "No effect when `xsizemode` not set to *pixel*." ].join(" ") }, x0: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's starting x position.", "See `type` and `xsizemode` for more info." ].join(" ") }, x1: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's end x position.", "See `type` and `xsizemode` for more info." ].join(" ") }, yref: ri({}, DM.yref, { description: [ "Sets the shape's y coordinate axis.", RM.axisRefDescription("y", "bottom", "top") ].join(" ") }), ysizemode: { valType: "enumerated", values: ["scaled", "pixel"], dflt: "scaled", editType: "calc+arraydraw", description: [ "Sets the shapes's sizing mode along the y axis.", "If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to", "data values on the y axis or a fraction of the plot area's height", "(`yref` set to *paper*).", "If set to *pixel*, `yanchor` specifies the y position in terms", "of data or plot fraction but `y0`, `y1` and y coordinates within `path`", "are pixels relative to `yanchor`. This way, the shape can have", "a fixed height while maintaining a position relative to data or", "plot fraction." ].join(" ") }, yanchor: { valType: "any", editType: "calc+arraydraw", description: [ "Only relevant in conjunction with `ysizemode` set to *pixel*.", "Specifies the anchor point on the y axis to which `y0`, `y1`", "and y coordinates within `path` are relative to.", "E.g. useful to attach a pixel sized shape to a certain data value.", "No effect when `ysizemode` not set to *pixel*." ].join(" ") }, y0: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's starting y position.", "See `type` and `ysizemode` for more info." ].join(" ") }, y1: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's end y position.", "See `type` and `ysizemode` for more info." ].join(" ") }, path: { valType: "string", editType: "calc+arraydraw", description: [ "For `type` *path* - a valid SVG path with the pixel values", "replaced by data values in `xsizemode`/`ysizemode` being *scaled*", "and taken unmodified as pixels relative to `xanchor` and `yanchor`", "in case of *pixel* size mode.", "There are a few restrictions / quirks", "only absolute instructions, not relative. So the allowed segments", "are: M, L, H, V, Q, C, T, S, and Z", "arcs (A) are not allowed because radius rx and ry are relative.", "In the future we could consider supporting relative commands,", "but we would have to decide on how to handle date and log axes.", "Note that even as is, Q and C Bezier paths that are smooth on", "linear axes may not be smooth on log, and vice versa.", 'no chained "polybezier" commands - specify the segment type for', "each one.", "On category axes, values are numbers scaled to the serial numbers", "of categories because using the categories themselves there would", "be no way to describe fractional positions", "On data axes: because space and T are both normal components of path", "strings, we can't use either to separate date from time parts.", "Therefore we'll use underscore for this purpose:", "2015-02-21_13:45:56.789" ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the shape." }, line: { color: ri({}, FM.color, { editType: "arraydraw" }), width: ri({}, FM.width, { editType: "calc+arraydraw" }), dash: ri({}, fae, { editType: "arraydraw" }), editType: "calc+arraydraw" }, fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: [ "Sets the color filling the shape's interior. Only applies to closed shapes." ].join(" ") }, fillrule: { valType: "enumerated", values: ["evenodd", "nonzero"], dflt: "evenodd", editType: "arraydraw", description: [ "Determines which regions of complex paths constitute the interior.", "For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule" ].join(" ") }, editable: { valType: "boolean", dflt: false, editType: "calc+arraydraw", description: [ "Determines whether the shape could be activated for edit or not.", "Has no effect when the older editable shapes mode is enabled via", "`config.editable` or `config.edits.shapePosition`." ].join(" ") }, label: { text: { valType: "string", dflt: "", editType: "arraydraw", description: [ "Sets the text to display with shape.", "It is also used for legend item if `name` is not provided." ].join(" ") }, texttemplate: dae({}, { keys: Object.keys(hae) }), font: EM({ editType: "calc+arraydraw", colorEditType: "arraydraw", description: "Sets the shape label text font." }), textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end" ], editType: "arraydraw", description: [ "Sets the position of the label text relative to the shape.", "Supported values for rectangles, circles and paths are", "*top left*, *top center*, *top right*, *middle left*,", "*middle center*, *middle right*, *bottom left*, *bottom center*,", "and *bottom right*.", "Supported values for lines are *start*, *middle*, and *end*.", "Default: *middle center* for rectangles, circles, and paths; *middle* for lines." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the angle at which the label text is drawn", "with respect to the horizontal. For lines, angle *auto*", "is the same angle as the line. For all other shapes,", "angle *auto* is horizontal." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the label's horizontal position anchor", "This anchor binds the specified `textposition` to the *left*, *center*", "or *right* of the label text.", "For example, if `textposition` is set to *top right* and", "`xanchor` to *right* then the right-most portion of the", "label text lines up with the right-most edge of the", "shape." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], editType: "calc+arraydraw", description: [ "Sets the label's vertical position anchor", "This anchor binds the specified `textposition` to the *top*, *middle*", "or *bottom* of the label text.", "For example, if `textposition` is set to *top right* and", "`yanchor` to *top* then the top-most portion of the", "label text lines up with the top-most edge of the", "shape." ].join(" ") }, padding: { valType: "number", dflt: 3, min: 0, editType: "arraydraw", description: "Sets padding (in px) between edge of label and edge of shape." }, editType: "arraydraw" }, editType: "arraydraw" }); var Gf = Ue; var qs = Cr; var vae = Ji; var pae = v6; var PM = xl; var mae = function(t, r) { vae(t, r, { name: "shapes", handleItemDefaults: yae }); }; function gae(e10, t) { return e10 ? "bottom" : t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle"; } function yae(e10, t, r) { function n(R, H) { return Gf.coerce(e10, t, pae, R, H); } t._isShape = true; var a = n("visible"); if (a) { var i = n("showlegend"); i && (n("legend"), n("legendwidth"), n("legendgroup"), n("legendgrouptitle.text"), Gf.coerceFont(n, "legendgrouptitle.font"), n("legendrank")); var o = n("path"), l = o ? "path" : "rect", s = n("type", l), u = s !== "path"; u && delete t.path, n("editable"), n("layer"), n("opacity"), n("fillcolor"), n("fillrule"); var f = n("line.width"); f && (n("line.color"), n("line.dash")); for (var d = n("xsizemode"), h = n("ysizemode"), p = ["x", "y"], v = 0; v < 2; v++) { var m = p[v], g = m + "anchor", y = m === "x" ? d : h, w = { _fullLayout: r }, k, x, _, T = qs.coerceRef( e10, t, w, m, void 0, "paper" ), S = qs.getRefType(T); if (S === "range" ? (k = qs.getFromId(w, T), k._shapeIndices.push(t._index), _ = PM.rangeToShapePosition(k), x = PM.shapePositionToRange(k)) : x = _ = Gf.identity, u) { var M = 0.25, L = 0.75, F = m + "0", $ = m + "1", I = e10[F], O = e10[$]; e10[F] = x(e10[F], true), e10[$] = x(e10[$], true), y === "pixel" ? (n(F, 0), n($, 10)) : (qs.coercePosition(t, w, n, T, F, M), qs.coercePosition(t, w, n, T, $, L)), t[F] = _(t[F]), t[$] = _(t[$]), e10[F] = I, e10[$] = O; } if (y === "pixel") { var G = e10[g]; e10[g] = x(e10[g], true), qs.coercePosition(t, w, n, T, g, 0.25), t[g] = _(t[g]), e10[g] = G; } } u && Gf.noneOrAll(e10, t, ["x0", "x1", "y0", "y1"]); var K = s === "line", V, z; if (u && (V = n("label.texttemplate")), V || (z = n("label.text")), z || V) { n("label.textangle"); var P = n("label.textposition", K ? "middle" : "middle center"); n("label.xanchor"), n("label.yanchor", gae(K, P)), n("label.padding"), Gf.coerceFont(n, "label.font", r.font); } } } var bae = nr; var $M = Ue; function _ae(e10, t) { return e10 ? "bottom" : t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle"; } var xae = function(t, r, n) { n("newshape.visible"), n("newshape.name"), n("newshape.showlegend"), n("newshape.legend"), n("newshape.legendwidth"), n("newshape.legendgroup"), n("newshape.legendgrouptitle.text"), $M.coerceFont(n, "newshape.legendgrouptitle.font"), n("newshape.legendrank"), n("newshape.drawdirection"), n("newshape.layer"), n("newshape.fillcolor"), n("newshape.fillrule"), n("newshape.opacity"); var a = n("newshape.line.width"); if (a) { var i = (t || {}).plot_bgcolor || "#FFF"; n("newshape.line.color", bae.contrast(i)), n("newshape.line.dash"); } var o = t.dragmode === "drawline", l = n("newshape.label.text"), s = n("newshape.label.texttemplate"); if (l || s) { n("newshape.label.textangle"); var u = n("newshape.label.textposition", o ? "middle" : "middle center"); n("newshape.label.xanchor"), n("newshape.label.yanchor", _ae(o, u)), n("newshape.label.padding"), $M.coerceFont(n, "newshape.label.font", r.font); } n("activeshape.fillcolor"), n("activeshape.opacity"); }; var Xy = Ue; var Ws = Cr; var Iu = Np; var p6 = xl; var wae = function(t) { var r = t._fullLayout, n = Xy.filterVisible(r.shapes); if (!(!n.length || !t._fullData.length)) for (var a = 0; a < n.length; a++) { var i = n[a]; i._extremes = {}; var o, l, s = Ws.getRefType(i.xref), u = Ws.getRefType(i.yref); if (i.xref !== "paper" && s !== "domain") { var f = i.xsizemode === "pixel" ? i.xanchor : i.x0, d = i.xsizemode === "pixel" ? i.xanchor : i.x1; o = Ws.getFromId(t, i.xref), l = zM(o, f, d, i.path, Iu.paramIsX), l && (i._extremes[o._id] = Ws.findExtremes(o, l, Tae(i))); } if (i.yref !== "paper" && u !== "domain") { var h = i.ysizemode === "pixel" ? i.yanchor : i.y0, p = i.ysizemode === "pixel" ? i.yanchor : i.y1; o = Ws.getFromId(t, i.yref), l = zM(o, h, p, i.path, Iu.paramIsY), l && (i._extremes[o._id] = Ws.findExtremes(o, l, kae(i))); } } }; function Tae(e10) { return m6(e10.line.width, e10.xsizemode, e10.x0, e10.x1, e10.path, false); } function kae(e10) { return m6(e10.line.width, e10.ysizemode, e10.y0, e10.y1, e10.path, true); } function m6(e10, t, r, n, a, i) { var o = e10 / 2, l = i; if (t === "pixel") { var s = a ? p6.extractPathCoords(a, i ? Iu.paramIsY : Iu.paramIsX) : [r, n], u = Xy.aggNums(Math.max, null, s), f = Xy.aggNums(Math.min, null, s), d = f < 0 ? Math.abs(f) + o : o, h = u > 0 ? u + o : o; return { ppad: o, ppadplus: l ? d : h, ppadminus: l ? h : d }; } else return { ppad: o }; } function zM(e10, t, r, n, a) { var i = e10.type === "category" || e10.type === "multicategory" ? e10.r2c : e10.d2c; if (t !== void 0) return [i(t), i(r)]; if (n) { var o = 1 / 0, l = -1 / 0, s = n.match(Iu.segmentRE), u, f, d, h, p; for (e10.type === "date" && (i = p6.decodeDate(i)), u = 0; u < s.length; u++) f = s[u], d = a[f.charAt(0)].drawn, d !== void 0 && (h = s[u].substr(1).match(Iu.paramRE), !(!h || h.length < d) && (p = i(h[d]), p < o && (o = p), p > l && (l = p))); if (l >= o) return [o, l]; } } var IM = Hb; var Aae = { moduleType: "component", name: "shapes", layoutAttributes: v6, supplyLayoutDefaults: mae, supplyDrawNewShapeDefaults: xae, includeBasePlot: qp("shapes"), calcAutorange: wae, draw: IM.draw, drawOne: IM.drawOne }; var NM = Yn; var Mae = Mr.templatedArray; var OM = Vp; var g6 = Mae("image", { visible: { valType: "boolean", dflt: true, editType: "arraydraw", description: [ "Determines whether or not this image is visible." ].join(" ") }, source: { valType: "string", editType: "arraydraw", description: [ "Specifies the URL of the image to be used.", "The URL must be accessible from the domain where the", "plot code is run, and can be either relative or absolute." ].join(" ") }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", editType: "arraydraw", description: [ "Specifies whether images are drawn below or above traces.", "When `xref` and `yref` are both set to `paper`,", "image is drawn below the entire plot area." ].join(" ") }, sizex: { valType: "number", dflt: 0, editType: "arraydraw", description: [ "Sets the image container size horizontally.", "The image will be sized based on the `position` value.", "When `xref` is set to `paper`, units are sized relative", "to the plot width.", "When `xref` ends with ` domain`, units are sized relative", "to the axis width." ].join(" ") }, sizey: { valType: "number", dflt: 0, editType: "arraydraw", description: [ "Sets the image container size vertically.", "The image will be sized based on the `position` value.", "When `yref` is set to `paper`, units are sized relative", "to the plot height.", "When `yref` ends with ` domain`, units are sized relative", "to the axis height." ].join(" ") }, sizing: { valType: "enumerated", values: ["fill", "contain", "stretch"], dflt: "contain", editType: "arraydraw", description: [ "Specifies which dimension of the image to constrain." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the image." }, x: { valType: "any", dflt: 0, editType: "arraydraw", description: [ "Sets the image's x position.", "When `xref` is set to `paper`, units are sized relative", "to the plot height.", "See `xref` for more info" ].join(" ") }, y: { valType: "any", dflt: 0, editType: "arraydraw", description: [ "Sets the image's y position.", "When `yref` is set to `paper`, units are sized relative", "to the plot height.", "See `yref` for more info" ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], dflt: "left", editType: "arraydraw", description: "Sets the anchor for the x position" }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "top", editType: "arraydraw", description: "Sets the anchor for the y position." }, xref: { valType: "enumerated", values: [ "paper", NM.idRegex.x.toString() ], dflt: "paper", editType: "arraydraw", description: [ "Sets the images's x coordinate axis.", OM.axisRefDescription("x", "left", "right") ].join(" ") }, yref: { valType: "enumerated", values: [ "paper", NM.idRegex.y.toString() ], dflt: "paper", editType: "arraydraw", description: [ "Sets the images's y coordinate axis.", OM.axisRefDescription("y", "bottom", "top") ].join(" ") }, editType: "arraydraw" }); var Sae = Ue; var d0 = Cr; var Cae = Ji; var Lae = g6; var Dae = "images"; var Eae = function(t, r) { var n = { name: Dae, handleItemDefaults: Fae }; Cae(t, r, n); }; function Fae(e10, t, r) { function n(h, p) { return Sae.coerce(e10, t, Lae, h, p); } var a = n("source"), i = n("visible", !!a); if (!i) return t; n("layer"), n("xanchor"), n("yanchor"), n("sizex"), n("sizey"), n("sizing"), n("opacity"); for (var o = { _fullLayout: r }, l = ["x", "y"], s = 0; s < 2; s++) { var u = l[s], f = d0.coerceRef(e10, t, o, u, "paper", void 0); if (f !== "paper") { var d = d0.getFromId(o, f); d._imgIndices.push(t._index); } d0.coercePosition(t, o, n, f, u, 0); } return t; } var HM = lr; var Rae = Sr; var Zs = Cr; var BM = gn; var Pae = yl; var $ae = function(t) { var r = t._fullLayout, n = [], a = {}, i = [], o, l; for (l = 0; l < r.images.length; l++) { var s = r.images[l]; if (s.visible) if (s.layer === "below" && s.xref !== "paper" && s.yref !== "paper") { o = BM.ref2id(s.xref) + BM.ref2id(s.yref); var u = r._plots[o]; if (!u) { i.push(s); continue; } u.mainplot && (o = u.mainplot.id), a[o] || (a[o] = []), a[o].push(s); } else s.layer === "above" ? n.push(s) : i.push(s); } var f = { x: { left: { sizing: "xMin", offset: 0 }, center: { sizing: "xMid", offset: -1 / 2 }, right: { sizing: "xMax", offset: -1 } }, y: { top: { sizing: "YMin", offset: 0 }, middle: { sizing: "YMid", offset: -1 / 2 }, bottom: { sizing: "YMax", offset: -1 } } }; function d(w) { var k = HM.select(this); if (this._imgSrc !== w.source) if (k.attr("xmlns", Pae.svg), w.source && w.source.slice(0, 5) === "data:") k.attr("xlink:href", w.source), this._imgSrc = w.source; else { var x = new Promise((function(_) { var T = new Image(); this.img = T, T.setAttribute("crossOrigin", "anonymous"), T.onerror = S, T.onload = function() { var M = document.createElement("canvas"); M.width = this.width, M.height = this.height; var L = M.getContext("2d", { willReadFrequently: true }); L.drawImage(this, 0, 0); var F = M.toDataURL("image/png"); k.attr("xlink:href", F), _(); }, k.on("error", S), T.src = w.source, this._imgSrc = w.source; function S() { k.remove(), _(); } }).bind(this)); t._promises.push(x); } } function h(w) { var k = HM.select(this), x = Zs.getFromId(t, w.xref), _ = Zs.getFromId(t, w.yref), T = Zs.getRefType(w.xref) === "domain", S = Zs.getRefType(w.yref) === "domain", M = r._size, L, F; x !== void 0 ? L = typeof w.xref == "string" && T ? x._length * w.sizex : Math.abs(x.l2p(w.sizex) - x.l2p(0)) : L = w.sizex * M.w, _ !== void 0 ? F = typeof w.yref == "string" && S ? _._length * w.sizey : Math.abs(_.l2p(w.sizey) - _.l2p(0)) : F = w.sizey * M.h; var $ = L * f.x[w.xanchor].offset, I = F * f.y[w.yanchor].offset, O = f.x[w.xanchor].sizing + f.y[w.yanchor].sizing, G, K; switch (x !== void 0 ? G = typeof w.xref == "string" && T ? x._length * w.x + x._offset : x.r2p(w.x) + x._offset : G = w.x * M.w + M.l, G += $, _ !== void 0 ? K = typeof w.yref == "string" && S ? ( // consistent with "paper" yref value, where positive values // move up the page _._length * (1 - w.y) + _._offset ) : _.r2p(w.y) + _._offset : K = M.h - w.y * M.h + M.t, K += I, w.sizing) { case "fill": O += " slice"; break; case "stretch": O = "none"; break; } k.attr({ x: G, y: K, width: L, height: F, preserveAspectRatio: O, opacity: w.opacity }); var V = x && Zs.getRefType(w.xref) !== "domain" ? x._id : "", z = _ && Zs.getRefType(w.yref) !== "domain" ? _._id : "", P = V + z; Rae.setClipUrl( k, P ? "clip" + r._uid + P : null, t ); } var p = r._imageLowerLayer.selectAll("image").data(i), v = r._imageUpperLayer.selectAll("image").data(n); p.enter().append("image"), v.enter().append("image"), p.exit().remove(), v.exit().remove(), p.each(function(w) { d.bind(this)(w), h.bind(this)(w); }), v.each(function(w) { d.bind(this)(w), h.bind(this)(w); }); var m = Object.keys(r._plots); for (l = 0; l < m.length; l++) { o = m[l]; var g = r._plots[o]; if (g.imagelayer) { var y = g.imagelayer.selectAll("image").data(a[o] || []); y.enter().append("image"), y.exit().remove(), y.each(function(w) { d.bind(this)(w), h.bind(this)(w); }); } } }; var jM = sr; var zae = U1; var Iae = function(t, r, n, a) { r = r || {}; var i = n === "log" && r.type === "linear", o = n === "linear" && r.type === "log"; if (i || o) { for (var l = t._fullLayout.images, s = r._id.charAt(0), u, f, d = 0; d < l.length; d++) if (u = l[d], f = "images[" + d + "].", u[s + "ref"] === r._id) { var h = u[s], p = u["size" + s], v = null, m = null; if (i) { v = zae(h, r.range); var g = p / Math.pow(10, v) / 2; m = 2 * Math.log(g + Math.sqrt(1 + g * g)) / Math.LN10; } else v = Math.pow(10, h), m = v * (Math.pow(10, p / 2) - Math.pow(10, -p / 2)); jM(v) ? jM(m) || (m = null) : (v = null, m = null), a(f + s, v), a(f + "size" + s, m); } } }; var Nae = { moduleType: "component", name: "images", layoutAttributes: g6, supplyLayoutDefaults: Eae, includeBasePlot: qp("images"), draw: $ae, convertCoords: Iae }; var h_ = { // layout attribute name name: "updatemenus", // class names containerClassName: "updatemenu-container", headerGroupClassName: "updatemenu-header-group", headerClassName: "updatemenu-header", headerArrowClassName: "updatemenu-header-arrow", dropdownButtonGroupClassName: "updatemenu-dropdown-button-group", dropdownButtonClassName: "updatemenu-dropdown-button", buttonClassName: "updatemenu-button", itemRectClassName: "updatemenu-item-rect", itemTextClassName: "updatemenu-item-text", // DOM attribute name in button group keeping track // of active update menu menuIndexAttrName: "updatemenu-active-index", // id root pass to Plots.autoMargin autoMarginIdRoot: "updatemenu-", // options when 'active: -1' blankHeaderOpts: { label: " " }, // min item width / height minWidth: 30, minHeight: 30, // padding around item text textPadX: 24, arrowPadX: 16, // item rect radii rx: 2, ry: 2, // item text x offset off left edge textOffsetX: 12, // item text y offset (w.r.t. middle) textOffsetY: 3, // arrow offset off right edge arrowOffsetX: 4, // gap between header and buttons gapButtonHeader: 5, // gap between between buttons gapButton: 2, // color given to active buttons activeColor: "#F4FAFF", // color given to hovered buttons hoverColor: "#F4FAFF", // symbol for menu open arrow arrowSymbol: { left: "◄", right: "►", up: "▲", down: "▼" } }; var Oae = Fn; var Hae = da; var Bae = en.extendFlat; var jae = Lo.overrideAll; var Uae = J1; var y6 = Mr.templatedArray; var Gae = y6("button", { visible: { valType: "boolean", description: "Determines whether or not this button is visible." }, method: { valType: "enumerated", values: ["restyle", "relayout", "animate", "update", "skip"], dflt: "restyle", description: [ "Sets the Plotly method to be called on click.", "If the `skip` method is used, the API updatemenu will function as normal", "but will perform no API calls and will not bind automatically to state", "updates. This may be used to create a component interface and attach to", "updatemenu events manually via JavaScript." ].join(" ") }, args: { valType: "info_array", freeLength: true, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets the arguments values to be passed to the Plotly", "method set in `method` on click." ].join(" ") }, args2: { valType: "info_array", freeLength: true, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets a 2nd set of `args`,", "these arguments values are passed to the Plotly", "method set in `method` when clicking this button while in the active state.", "Use this to create toggle buttons." ].join(" ") }, label: { valType: "string", dflt: "", description: "Sets the text label to appear on the button." }, execute: { valType: "boolean", dflt: true, description: [ "When true, the API method is executed. When false, all other behaviors are the same", "and command execution is skipped. This may be useful when hooking into, for example,", "the `plotly_buttonclicked` method and executing the API command manually without losing", "the benefit of the updatemenu automatically binding to the state of the plot through the", "specification of `method` and `args`." ].join(" ") } }); var b6 = jae(y6("updatemenu", { _arrayAttrRegexps: [/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/], visible: { valType: "boolean", description: [ "Determines whether or not the update menu is visible." ].join(" ") }, type: { valType: "enumerated", values: ["dropdown", "buttons"], dflt: "dropdown", description: [ "Determines whether the buttons are accessible via a dropdown menu", "or whether the buttons are stacked horizontally or vertically" ].join(" ") }, direction: { valType: "enumerated", values: ["left", "right", "up", "down"], dflt: "down", description: [ "Determines the direction in which the buttons are laid out, whether", "in a dropdown menu or a row/column of buttons. For `left` and `up`,", "the buttons will still appear in left-to-right or top-to-bottom order", "respectively." ].join(" ") }, active: { valType: "integer", min: -1, dflt: 0, description: [ "Determines which button (by index starting from 0) is", "considered active." ].join(" ") }, showactive: { valType: "boolean", dflt: true, description: "Highlights active dropdown item or active button if true." }, buttons: Gae, x: { valType: "number", min: -2, max: 3, dflt: -0.05, description: "Sets the x position (in normalized coordinates) of the update menu." }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "right", description: [ "Sets the update menu's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, dflt: 1, description: "Sets the y position (in normalized coordinates) of the update menu." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "top", description: [ "Sets the update menu's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, pad: Bae(Uae({ editType: "arraydraw" }), { description: "Sets the padding around the buttons or dropdown menu." }), font: Oae({ description: "Sets the font of the update menu button text." }), bgcolor: { valType: "color", description: "Sets the background color of the update menu buttons." }, bordercolor: { valType: "color", dflt: Hae.borderLine, description: "Sets the color of the border enclosing the update menu." }, borderwidth: { valType: "number", min: 0, dflt: 1, editType: "arraydraw", description: "Sets the width (in px) of the border enclosing the update menu." } }), "arraydraw", "from-root"); var qh = Ue; var _6 = Ji; var x6 = b6; var Vae = h_; var qae = Vae.name; var Wae = x6.buttons; var Zae = function(t, r) { var n = { name: qae, handleItemDefaults: Yae }; _6(t, r, n); }; function Yae(e10, t, r) { function n(o, l) { return qh.coerce(e10, t, x6, o, l); } var a = _6(e10, t, { name: "buttons", handleItemDefaults: Xae }), i = n("visible", a.length > 0); i && (n("active"), n("direction"), n("type"), n("showactive"), n("x"), n("y"), qh.noneOrAll(e10, t, ["x", "y"]), n("xanchor"), n("yanchor"), n("pad.t"), n("pad.r"), n("pad.b"), n("pad.l"), qh.coerceFont(n, "font", r.font), n("bgcolor", r.paper_bgcolor), n("bordercolor"), n("borderwidth")); } function Xae(e10, t) { function r(a, i) { return qh.coerce(e10, t, Wae, a, i); } var n = r( "visible", e10.method === "skip" || Array.isArray(e10.args) ); n && (r("method"), r("args"), r("args2"), r("label"), r("execute")); } var Kae = Br; var fi = lr; var UM = nr; var _u = Sr; var Dv = Ue; function Br(e10, t, r) { this.gd = e10, this.container = t, this.id = r, this.position = null, this.translateX = null, this.translateY = null, this.hbar = null, this.vbar = null, this.bg = this.container.selectAll("rect.scrollbox-bg").data([0]), this.bg.exit().on(".drag", null).on("wheel", null).remove(), this.bg.enter().append("rect").classed("scrollbox-bg", true).style("pointer-events", "all").attr({ opacity: 0, x: 0, y: 0, width: 0, height: 0 }); } Br.barWidth = 2; Br.barLength = 20; Br.barRadius = 2; Br.barPad = 1; Br.barColor = "#808BA4"; Br.prototype.enable = function(t, r, n) { var a = this.gd._fullLayout, i = a.width, o = a.height; this.position = t; var l = this.position.l, s = this.position.w, u = this.position.t, f = this.position.h, d = this.position.direction, h = d === "down", p = d === "left", v = d === "right", m = d === "up", g = s, y = f, w, k, x, _; !h && !p && !v && !m && (this.position.direction = "down", h = true); var T = h || m; T ? (w = l, k = w + g, h ? (x = u, _ = Math.min(x + y, o), y = _ - x) : (_ = u + y, x = Math.max(_ - y, 0), y = _ - x)) : (x = u, _ = x + y, p ? (k = l + g, w = Math.max(k - g, 0), g = k - w) : (w = l, k = Math.min(w + g, i), g = k - w)), this._box = { l: w, t: x, w: g, h: y }; var S = s > g, M = Br.barLength + 2 * Br.barPad, L = Br.barWidth + 2 * Br.barPad, F = l, $ = u + f; $ + L > o && ($ = o - L); var I = this.container.selectAll("rect.scrollbar-horizontal").data( S ? [0] : [] ); I.exit().on(".drag", null).remove(), I.enter().append("rect").classed("scrollbar-horizontal", true).call(UM.fill, Br.barColor), S ? (this.hbar = I.attr({ rx: Br.barRadius, ry: Br.barRadius, x: F, y: $, width: M, height: L }), this._hbarXMin = F + M / 2, this._hbarTranslateMax = g - M) : (delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax); var O = f > y, G = Br.barWidth + 2 * Br.barPad, K = Br.barLength + 2 * Br.barPad, V = l + s, z = u; V + G > i && (V = i - G); var P = this.container.selectAll("rect.scrollbar-vertical").data( O ? [0] : [] ); P.exit().on(".drag", null).remove(), P.enter().append("rect").classed("scrollbar-vertical", true).call(UM.fill, Br.barColor), O ? (this.vbar = P.attr({ rx: Br.barRadius, ry: Br.barRadius, x: V, y: z, width: G, height: K }), this._vbarYMin = z + K / 2, this._vbarTranslateMax = y - K) : (delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax); var R = this.id, H = w - 0.5, B = O ? k + G + 0.5 : k + 0.5, W = x - 0.5, ee = S ? _ + L + 0.5 : _ + 0.5, re = a._topdefs.selectAll("#" + R).data(S || O ? [0] : []); if (re.exit().remove(), re.enter().append("clipPath").attr("id", R).append("rect"), S || O ? (this._clipRect = re.select("rect").attr({ x: Math.floor(H), y: Math.floor(W), width: Math.ceil(B) - Math.floor(H), height: Math.ceil(ee) - Math.floor(W) }), this.container.call(_u.setClipUrl, R, this.gd), this.bg.attr({ x: l, y: u, width: s, height: f })) : (this.bg.attr({ width: 0, height: 0 }), this.container.on("wheel", null).on(".drag", null).call(_u.setClipUrl, null), delete this._clipRect), S || O) { var ae = fi.behavior.drag().on("dragstart", function() { fi.event.sourceEvent.preventDefault(); }).on("drag", this._onBoxDrag.bind(this)); this.container.on("wheel", null).on("wheel", this._onBoxWheel.bind(this)).on(".drag", null).call(ae); var Q = fi.behavior.drag().on("dragstart", function() { fi.event.sourceEvent.preventDefault(), fi.event.sourceEvent.stopPropagation(); }).on("drag", this._onBarDrag.bind(this)); S && this.hbar.on(".drag", null).call(Q), O && this.vbar.on(".drag", null).call(Q); } this.setTranslate(r, n); }; Br.prototype.disable = function() { (this.hbar || this.vbar) && (this.bg.attr({ width: 0, height: 0 }), this.container.on("wheel", null).on(".drag", null).call(_u.setClipUrl, null), delete this._clipRect), this.hbar && (this.hbar.on(".drag", null), this.hbar.remove(), delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax), this.vbar && (this.vbar.on(".drag", null), this.vbar.remove(), delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax); }; Br.prototype._onBoxDrag = function() { var t = this.translateX, r = this.translateY; this.hbar && (t -= fi.event.dx), this.vbar && (r -= fi.event.dy), this.setTranslate(t, r); }; Br.prototype._onBoxWheel = function() { var t = this.translateX, r = this.translateY; this.hbar && (t += fi.event.deltaY), this.vbar && (r += fi.event.deltaY), this.setTranslate(t, r); }; Br.prototype._onBarDrag = function() { var t = this.translateX, r = this.translateY; if (this.hbar) { var n = t + this._hbarXMin, a = n + this._hbarTranslateMax, i = Dv.constrain(fi.event.x, n, a), o = (i - n) / (a - n), l = this.position.w - this._box.w; t = o * l; } if (this.vbar) { var s = r + this._vbarYMin, u = s + this._vbarTranslateMax, f = Dv.constrain(fi.event.y, s, u), d = (f - s) / (u - s), h = this.position.h - this._box.h; r = d * h; } this.setTranslate(t, r); }; Br.prototype.setTranslate = function(t, r) { var n = this.position.w - this._box.w, a = this.position.h - this._box.h; if (t = Dv.constrain(t || 0, 0, n), r = Dv.constrain(r || 0, 0, a), this.translateX = t, this.translateY = r, this.container.call( _u.setTranslate, this._box.l - this.position.l - t, this._box.t - this.position.t - r ), this._clipRect && this._clipRect.attr({ x: Math.floor(this.position.l + t - 0.5), y: Math.floor(this.position.t + r - 0.5) }), this.hbar) { var i = t / n; this.hbar.call( _u.setTranslate, t + i * this._hbarTranslateMax, r ); } if (this.vbar) { var o = r / a; this.vbar.call( _u.setTranslate, t, r + o * this._vbarTranslateMax ); } }; var Nu = lr; var zc = Tn; var Ic = nr; var Ou = Sr; var ba = Ue; var Ev = Rn; var Jae = Mr.arrayEditor; var w6 = On.LINE_SPACING; var Bt = h_; var Qae = Kae; var eie = function(t) { var r = t._fullLayout, n = ba.filterVisible(r[Bt.name]); function a(h) { zc.autoMargin(t, S6(h)); } var i = r._menulayer.selectAll("g." + Bt.containerClassName).data(n.length > 0 ? [0] : []); if (i.enter().append("g").classed(Bt.containerClassName, true).style("cursor", "pointer"), i.exit().each(function() { Nu.select(this).selectAll("g." + Bt.headerGroupClassName).each(a); }).remove(), n.length !== 0) { var o = i.selectAll("g." + Bt.headerGroupClassName).data(n, tie); o.enter().append("g").classed(Bt.headerGroupClassName, true); for (var l = ba.ensureSingle(i, "g", Bt.dropdownButtonGroupClassName, function(h) { h.style("pointer-events", "all"); }), s = 0; s < n.length; s++) { var u = n[s]; lie(t, u); } var f = "updatemenus" + r._uid, d = new Qae(t, l, f); o.enter().size() && (l.node().parentNode.appendChild(l.node()), l.call(Jy)), o.exit().each(function(h) { l.call(Jy), a(h); }).remove(), o.each(function(h) { var p = Nu.select(this), v = h.type === "dropdown" ? l : null; zc.manageCommandObserver(t, h, h.buttons, function(m) { Ky(t, h, h.buttons[m.index], p, v, d, m.index, true); }), h.type === "dropdown" ? (k6(t, p, l, d, h), T6(l, h) && Nc(t, p, l, d, h)) : Nc(t, p, null, null, h); }); } }; function tie(e10) { return e10._index; } function rie(e10) { return +e10.attr(Bt.menuIndexAttrName) == -1; } function T6(e10, t) { return +e10.attr(Bt.menuIndexAttrName) === t._index; } function Ky(e10, t, r, n, a, i, o, l) { t.active = o, Jae(e10.layout, Bt.name, t).applyUpdate("active", o), t.type === "buttons" ? Nc(e10, n, null, null, t) : t.type === "dropdown" && (a.attr(Bt.menuIndexAttrName, "-1"), k6(e10, n, a, i, t), l || Nc(e10, n, a, i, t)); } function k6(e10, t, r, n, a) { var i = ba.ensureSingle(t, "g", Bt.headerClassName, function(h) { h.style("pointer-events", "all"); }), o = a._dims, l = a.active, s = a.buttons[l] || Bt.blankHeaderOpts, u = { y: a.pad.t, yPad: 0, x: a.pad.l, xPad: 0, index: 0 }, f = { width: o.headerWidth, height: o.headerHeight }; i.call(v_, a, s, e10).call(C6, a, u, f); var d = ba.ensureSingle(t, "text", Bt.headerArrowClassName, function(h) { h.attr("text-anchor", "end").call(Ou.font, a.font).text(Bt.arrowSymbol[a.direction]); }); d.attr({ x: o.headerWidth - Bt.arrowOffsetX + a.pad.l, y: o.headerHeight / 2 + Bt.textOffsetY + a.pad.t }), i.on("click", function() { r.call( Jy, String(T6(r, a) ? -1 : a._index) ), Nc(e10, t, r, n, a); }), i.on("mouseover", function() { i.call(A6); }), i.on("mouseout", function() { i.call(M6, a); }), Ou.setTranslate(t, o.lx, o.ly); } function Nc(e10, t, r, n, a) { r || (r = t, r.attr("pointer-events", "all")); var i = !rie(r) || a.type === "buttons" ? a.buttons : [], o = a.type === "dropdown" ? Bt.dropdownButtonClassName : Bt.buttonClassName, l = r.selectAll("g." + o).data(ba.filterVisible(i)), s = l.enter().append("g").classed(o, true), u = l.exit(); a.type === "dropdown" ? (s.attr("opacity", "0").transition().attr("opacity", "1"), u.transition().attr("opacity", "0").remove()) : u.remove(); var f = 0, d = 0, h = a._dims, p = ["up", "down"].indexOf(a.direction) !== -1; a.type === "dropdown" && (p ? d = h.headerHeight + Bt.gapButtonHeader : f = h.headerWidth + Bt.gapButtonHeader), a.type === "dropdown" && a.direction === "up" && (d = -Bt.gapButtonHeader + Bt.gapButton - h.openHeight), a.type === "dropdown" && a.direction === "left" && (f = -Bt.gapButtonHeader + Bt.gapButton - h.openWidth); var v = { x: h.lx + f + a.pad.l, y: h.ly + d + a.pad.t, yPad: Bt.gapButton, xPad: Bt.gapButton, index: 0 }, m = { l: v.x + a.borderwidth, t: v.y + a.borderwidth }; l.each(function(g, y) { var w = Nu.select(this); w.call(v_, a, g, e10).call(C6, a, v), w.on("click", function() { Nu.event.defaultPrevented || (g.execute && (g.args2 && a.active === y ? (Ky(e10, a, g, t, r, n, -1), zc.executeAPICommand(e10, g.method, g.args2)) : (Ky(e10, a, g, t, r, n, y), zc.executeAPICommand(e10, g.method, g.args))), e10.emit("plotly_buttonclicked", { menu: a, button: g, active: a.active })); }), w.on("mouseover", function() { w.call(A6); }), w.on("mouseout", function() { w.call(M6, a), l.call(GM, a); }); }), l.call(GM, a), p ? (m.w = Math.max(h.openWidth, h.headerWidth), m.h = v.y - m.t) : (m.w = v.x - m.l, m.h = Math.max(h.openHeight, h.headerHeight)), m.direction = a.direction, n && (l.size() ? nie(e10, t, r, n, a, m) : aie(n)); } function nie(e10, t, r, n, a, i) { var o = a.direction, l = o === "up" || o === "down", s = a._dims, u = a.active, f, d, h; if (l) for (d = 0, h = 0; h < u; h++) d += s.heights[h] + Bt.gapButton; else for (f = 0, h = 0; h < u; h++) f += s.widths[h] + Bt.gapButton; n.enable(i, f, d), n.hbar && n.hbar.attr("opacity", "0").transition().attr("opacity", "1"), n.vbar && n.vbar.attr("opacity", "0").transition().attr("opacity", "1"); } function aie(e10) { var t = !!e10.hbar, r = !!e10.vbar; t && e10.hbar.transition().attr("opacity", "0").each("end", function() { t = false, r || e10.disable(); }), r && e10.vbar.transition().attr("opacity", "0").each("end", function() { r = false, t || e10.disable(); }); } function v_(e10, t, r, n) { e10.call(iie, t).call(oie, t, r, n); } function iie(e10, t) { var r = ba.ensureSingle(e10, "rect", Bt.itemRectClassName, function(n) { n.attr({ rx: Bt.rx, ry: Bt.ry, "shape-rendering": "crispEdges" }); }); r.call(Ic.stroke, t.bordercolor).call(Ic.fill, t.bgcolor).style("stroke-width", t.borderwidth + "px"); } function oie(e10, t, r, n) { var a = ba.ensureSingle(e10, "text", Bt.itemTextClassName, function(l) { l.attr({ "text-anchor": "start", "data-notex": 1 }); }), i = r.label, o = n._fullLayout._meta; o && (i = ba.templateString(i, o)), a.call(Ou.font, t.font).text(i).call(Ev.convertToTspans, n); } function GM(e10, t) { var r = t.active; e10.each(function(n, a) { var i = Nu.select(this); a === r && t.showactive && i.select("rect." + Bt.itemRectClassName).call(Ic.fill, Bt.activeColor); }); } function A6(e10) { e10.select("rect." + Bt.itemRectClassName).call(Ic.fill, Bt.hoverColor); } function M6(e10, t) { e10.select("rect." + Bt.itemRectClassName).call(Ic.fill, t.bgcolor); } function lie(e10, t) { var r = t._dims = { width1: 0, height1: 0, heights: [], widths: [], totalWidth: 0, totalHeight: 0, openWidth: 0, openHeight: 0, lx: 0, ly: 0 }, n = Ou.tester.selectAll("g." + Bt.dropdownButtonClassName).data(ba.filterVisible(t.buttons)); n.enter().append("g").classed(Bt.dropdownButtonClassName, true); var a = ["up", "down"].indexOf(t.direction) !== -1; n.each(function(f, d) { var h = Nu.select(this); h.call(v_, t, f, e10); var p = h.select("." + Bt.itemTextClassName), v = p.node() && Ou.bBox(p.node()).width, m = Math.max(v + Bt.textPadX, Bt.minWidth), g = t.font.size * w6, y = Ev.lineCount(p), w = Math.max(g * y, Bt.minHeight) + Bt.textOffsetY; w = Math.ceil(w), m = Math.ceil(m), r.widths[d] = m, r.heights[d] = w, r.height1 = Math.max(r.height1, w), r.width1 = Math.max(r.width1, m), a ? (r.totalWidth = Math.max(r.totalWidth, m), r.openWidth = r.totalWidth, r.totalHeight += w + Bt.gapButton, r.openHeight += w + Bt.gapButton) : (r.totalWidth += m + Bt.gapButton, r.openWidth += m + Bt.gapButton, r.totalHeight = Math.max(r.totalHeight, w), r.openHeight = r.totalHeight); }), a ? r.totalHeight -= Bt.gapButton : r.totalWidth -= Bt.gapButton, r.headerWidth = r.width1 + Bt.arrowPadX, r.headerHeight = r.height1, t.type === "dropdown" && (a ? (r.width1 += Bt.arrowPadX, r.totalHeight = r.height1) : r.totalWidth = r.width1, r.totalWidth += Bt.arrowPadX), n.remove(); var i = r.totalWidth + t.pad.l + t.pad.r, o = r.totalHeight + t.pad.t + t.pad.b, l = e10._fullLayout._size; r.lx = l.l + l.w * t.x, r.ly = l.t + l.h * (1 - t.y); var s = "left"; ba.isRightAnchor(t) && (r.lx -= i, s = "right"), ba.isCenterAnchor(t) && (r.lx -= i / 2, s = "center"); var u = "top"; ba.isBottomAnchor(t) && (r.ly -= o, u = "bottom"), ba.isMiddleAnchor(t) && (r.ly -= o / 2, u = "middle"), r.totalWidth = Math.ceil(r.totalWidth), r.totalHeight = Math.ceil(r.totalHeight), r.lx = Math.round(r.lx), r.ly = Math.round(r.ly), zc.autoMargin(e10, S6(t), { x: t.x, y: t.y, l: i * ({ right: 1, center: 0.5 }[s] || 0), r: i * ({ left: 1, center: 0.5 }[s] || 0), b: o * ({ top: 1, middle: 0.5 }[u] || 0), t: o * ({ bottom: 1, middle: 0.5 }[u] || 0) }); } function S6(e10) { return Bt.autoMarginIdRoot + e10._index; } function C6(e10, t, r, n) { n = n || {}; var a = e10.select("." + Bt.itemRectClassName), i = e10.select("." + Bt.itemTextClassName), o = t.borderwidth, l = r.index, s = t._dims; Ou.setTranslate(e10, o + r.x, o + r.y); var u = ["up", "down"].indexOf(t.direction) !== -1, f = n.height || (u ? s.heights[l] : s.height1); a.attr({ x: 0, y: 0, width: n.width || (u ? s.width1 : s.widths[l]), height: f }); var d = t.font.size * w6, h = Ev.lineCount(i), p = (h - 1) * d / 2; Ev.positionText( i, Bt.textOffsetX, f / 2 - p + Bt.textOffsetY ), u ? r.y += s.heights[l] + r.yPad : r.x += s.widths[l] + r.xPad, r.index++; } function Jy(e10, t) { e10.attr(Bt.menuIndexAttrName, t || "-1").selectAll("g." + Bt.dropdownButtonClassName).remove(); } var sie = h_; var uie = { moduleType: "component", name: sie.name, layoutAttributes: b6, supplyLayoutDefaults: Zae, draw: eie }; var Kp = { // layout attribute name name: "sliders", // class names containerClassName: "slider-container", groupClassName: "slider-group", inputAreaClass: "slider-input-area", railRectClass: "slider-rail-rect", railTouchRectClass: "slider-rail-touch-rect", gripRectClass: "slider-grip-rect", tickRectClass: "slider-tick-rect", inputProxyClass: "slider-input-proxy", labelsClass: "slider-labels", labelGroupClass: "slider-label-group", labelClass: "slider-label", currentValueClass: "slider-current-value", railHeight: 5, // DOM attribute name in button group keeping track // of active update menu menuIndexAttrName: "slider-active-index", // id root pass to Plots.autoMargin autoMarginIdRoot: "slider-", // min item width / height minWidth: 30, minHeight: 30, // padding around item text textPadX: 40, // arrow offset off right edge arrowOffsetX: 4, railRadius: 2, railWidth: 5, railBorder: 4, railBorderWidth: 1, railBorderColor: "#bec8d9", railBgColor: "#f8fafc", // The distance of the rail from the edge of the touchable area // Slightly less than the step inset because of the curved edges // of the rail railInset: 8, // The distance from the extremal tick marks to the edge of the // touchable area. This is basically the same as the grip radius, // but for other styles it wouldn't really need to be. stepInset: 10, gripRadius: 10, gripWidth: 20, gripHeight: 20, gripBorder: 20, gripBorderWidth: 1, gripBorderColor: "#bec8d9", gripBgColor: "#f6f8fa", gripBgActiveColor: "#dbdde0", labelPadding: 8, labelOffset: 0, tickWidth: 1, tickColor: "#333", tickOffset: 25, tickLength: 7, minorTickOffset: 25, minorTickColor: "#333", minorTickLength: 4, // Extra space below the current value label: currentValuePadding: 8, currentValueInset: 0 }; var VM = Fn; var fie = J1; var cie = en.extendDeepAll; var die = Lo.overrideAll; var hie = hp; var L6 = Mr.templatedArray; var $l = Kp; var vie = L6("step", { visible: { valType: "boolean", dflt: true, description: [ "Determines whether or not this step is included in the slider." ].join(" ") }, method: { valType: "enumerated", values: ["restyle", "relayout", "animate", "update", "skip"], dflt: "restyle", description: [ "Sets the Plotly method to be called when the slider value is changed.", "If the `skip` method is used, the API slider will function as normal", "but will perform no API calls and will not bind automatically to state", "updates. This may be used to create a component interface and attach to", "slider events manually via JavaScript." ].join(" ") }, args: { valType: "info_array", freeLength: true, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets the arguments values to be passed to the Plotly", "method set in `method` on slide." ].join(" ") }, label: { valType: "string", description: "Sets the text label to appear on the slider" }, value: { valType: "string", description: [ "Sets the value of the slider step, used to refer to the step programatically.", "Defaults to the slider label if not provided." ].join(" ") }, execute: { valType: "boolean", dflt: true, description: [ "When true, the API method is executed. When false, all other behaviors are the same", "and command execution is skipped. This may be useful when hooking into, for example,", "the `plotly_sliderchange` method and executing the API command manually without losing", "the benefit of the slider automatically binding to the state of the plot through the", "specification of `method` and `args`." ].join(" ") } }); var D6 = die(L6("slider", { visible: { valType: "boolean", dflt: true, description: [ "Determines whether or not the slider is visible." ].join(" ") }, active: { valType: "number", min: 0, dflt: 0, description: [ "Determines which button (by index starting from 0) is", "considered active." ].join(" ") }, steps: vie, lenmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "fraction", description: [ "Determines whether this slider length", "is set in units of plot *fraction* or in *pixels.", "Use `len` to set the value." ].join(" ") }, len: { valType: "number", min: 0, dflt: 1, description: [ "Sets the length of the slider", "This measure excludes the padding of both ends.", "That is, the slider's length is this length minus the", "padding on both ends." ].join(" ") }, x: { valType: "number", min: -2, max: 3, dflt: 0, description: "Sets the x position (in normalized coordinates) of the slider." }, pad: cie(fie({ editType: "arraydraw" }), { description: "Set the padding of the slider component along each side." }, { t: { dflt: 20 } }), xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", description: [ "Sets the slider's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, dflt: 0, description: "Sets the y position (in normalized coordinates) of the slider." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "top", description: [ "Sets the slider's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, transition: { duration: { valType: "number", min: 0, dflt: 150, description: "Sets the duration of the slider transition" }, easing: { valType: "enumerated", values: hie.transition.easing.values, dflt: "cubic-in-out", description: "Sets the easing function of the slider transition" } }, currentvalue: { visible: { valType: "boolean", dflt: true, description: [ "Shows the currently-selected value above the slider." ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], dflt: "left", description: [ "The alignment of the value readout relative to the length of the slider." ].join(" ") }, offset: { valType: "number", dflt: 10, description: [ "The amount of space, in pixels, between the current value label", "and the slider." ].join(" ") }, prefix: { valType: "string", description: "When currentvalue.visible is true, this sets the prefix of the label." }, suffix: { valType: "string", description: "When currentvalue.visible is true, this sets the suffix of the label." }, font: VM({ description: "Sets the font of the current value label text." }) }, font: VM({ description: "Sets the font of the slider step labels." }), activebgcolor: { valType: "color", dflt: $l.gripBgActiveColor, description: [ "Sets the background color of the slider grip", "while dragging." ].join(" ") }, bgcolor: { valType: "color", dflt: $l.railBgColor, description: "Sets the background color of the slider." }, bordercolor: { valType: "color", dflt: $l.railBorderColor, description: "Sets the color of the border enclosing the slider." }, borderwidth: { valType: "number", min: 0, dflt: $l.railBorderWidth, description: "Sets the width (in px) of the border enclosing the slider." }, ticklen: { valType: "number", min: 0, dflt: $l.tickLength, description: "Sets the length in pixels of step tick marks" }, tickcolor: { valType: "color", dflt: $l.tickColor, description: "Sets the color of the border enclosing the slider." }, tickwidth: { valType: "number", min: 0, dflt: 1, description: "Sets the tick width (in px)." }, minorticklen: { valType: "number", min: 0, dflt: $l.minorTickLength, description: "Sets the length in pixels of minor step tick marks" } }), "arraydraw", "from-root"); var ou = Ue; var E6 = Ji; var F6 = D6; var pie = Kp; var mie = pie.name; var gie = F6.steps; var yie = function(t, r) { E6(t, r, { name: mie, handleItemDefaults: bie }); }; function bie(e10, t, r) { function n(d, h) { return ou.coerce(e10, t, F6, d, h); } for (var a = E6(e10, t, { name: "steps", handleItemDefaults: _ie }), i = 0, o = 0; o < a.length; o++) a[o].visible && i++; var l; if (i < 2 ? l = t.visible = false : l = n("visible"), !!l) { t._stepCount = i; var s = t._visibleSteps = ou.filterVisible(a), u = n("active"); (a[u] || {}).visible || (t.active = s[0]._index), n("x"), n("y"), ou.noneOrAll(e10, t, ["x", "y"]), n("xanchor"), n("yanchor"), n("len"), n("lenmode"), n("pad.t"), n("pad.r"), n("pad.b"), n("pad.l"), ou.coerceFont(n, "font", r.font); var f = n("currentvalue.visible"); f && (n("currentvalue.xanchor"), n("currentvalue.prefix"), n("currentvalue.suffix"), n("currentvalue.offset"), ou.coerceFont(n, "currentvalue.font", t.font)), n("transition.duration"), n("transition.easing"), n("bgcolor"), n("activebgcolor"), n("bordercolor"), n("borderwidth"), n("ticklen"), n("tickwidth"), n("tickcolor"), n("minorticklen"); } } function _ie(e10, t) { function r(i, o) { return ou.coerce(e10, t, gie, i, o); } var n; if (e10.method !== "skip" && !Array.isArray(e10.args) ? n = t.visible = false : n = r("visible"), n) { r("method"), r("args"); var a = r("label", "step-" + t._index); r("value", a), r("execute"); } } var ci = lr; var Fv = Tn; var hl = nr; var vi = Sr; var _a = Ue; var xie = _a.strTranslate; var lc = Rn; var wie = Mr.arrayEditor; var Qt = Kp; var p_ = On; var R6 = p_.LINE_SPACING; var h0 = p_.FROM_TL; var v0 = p_.FROM_BR; var Tie = function(t) { var r = t._context.staticPlot, n = t._fullLayout, a = kie(n, t), i = n._infolayer.selectAll("g." + Qt.containerClassName).data(a.length > 0 ? [0] : []); i.enter().append("g").classed(Qt.containerClassName, true).style("cursor", r ? null : "ew-resize"); function o(f) { f._commandObserver && (f._commandObserver.remove(), delete f._commandObserver), Fv.autoMargin(t, P6(f)); } if (i.exit().each(function() { ci.select(this).selectAll("g." + Qt.groupClassName).each(o); }).remove(), a.length !== 0) { var l = i.selectAll("g." + Qt.groupClassName).data(a, Aie); l.enter().append("g").classed(Qt.groupClassName, true), l.exit().each(o).remove(); for (var s = 0; s < a.length; s++) { var u = a[s]; Mie(t, u); } l.each(function(f) { var d = ci.select(this); Eie(f), Fv.manageCommandObserver(t, f, f._visibleSteps, function(h) { var p = d.data()[0]; p.active !== h.index && (p._dragging || z6(t, d, p, h.index, false, true)); }), Sie(t, ci.select(this), f); }); } }; function P6(e10) { return Qt.autoMarginIdRoot + e10._index; } function kie(e10, t) { for (var r = e10[Qt.name], n = [], a = 0; a < r.length; a++) { var i = r[a]; i.visible && (i._gd = t, n.push(i)); } return n; } function Aie(e10) { return e10._index; } function Mie(e10, t) { var r = vi.tester.selectAll("g." + Qt.labelGroupClass).data(t._visibleSteps); r.enter().append("g").classed(Qt.labelGroupClass, true); var n = 0, a = 0; r.each(function(v) { var m = ci.select(this), g = $6(m, { step: v }, t), y = g.node(); if (y) { var w = vi.bBox(y); a = Math.max(a, w.height), n = Math.max(n, w.width); } }), r.remove(); var i = t._dims = {}; i.inputAreaWidth = Math.max( Qt.railWidth, Qt.gripHeight ); var o = e10._fullLayout._size; i.lx = o.l + o.w * t.x, i.ly = o.t + o.h * (1 - t.y), t.lenmode === "fraction" ? i.outerLength = Math.round(o.w * t.len) : i.outerLength = t.len, i.inputAreaStart = 0, i.inputAreaLength = Math.round(i.outerLength - t.pad.l - t.pad.r); var l = i.inputAreaLength - 2 * Qt.stepInset, s = l / (t._stepCount - 1), u = n + Qt.labelPadding; if (i.labelStride = Math.max(1, Math.ceil(u / s)), i.labelHeight = a, i.currentValueMaxWidth = 0, i.currentValueHeight = 0, i.currentValueTotalHeight = 0, i.currentValueMaxLines = 1, t.currentvalue.visible) { var f = vi.tester.append("g"); r.each(function(v) { var m = Rv(f, t, v.label), g = m.node() && vi.bBox(m.node()) || { width: 0, height: 0 }, y = lc.lineCount(m); i.currentValueMaxWidth = Math.max(i.currentValueMaxWidth, Math.ceil(g.width)), i.currentValueHeight = Math.max(i.currentValueHeight, Math.ceil(g.height)), i.currentValueMaxLines = Math.max(i.currentValueMaxLines, y); }), i.currentValueTotalHeight = i.currentValueHeight + t.currentvalue.offset, f.remove(); } i.height = i.currentValueTotalHeight + Qt.tickOffset + t.ticklen + Qt.labelOffset + i.labelHeight + t.pad.t + t.pad.b; var d = "left"; _a.isRightAnchor(t) && (i.lx -= i.outerLength, d = "right"), _a.isCenterAnchor(t) && (i.lx -= i.outerLength / 2, d = "center"); var h = "top"; _a.isBottomAnchor(t) && (i.ly -= i.height, h = "bottom"), _a.isMiddleAnchor(t) && (i.ly -= i.height / 2, h = "middle"), i.outerLength = Math.ceil(i.outerLength), i.height = Math.ceil(i.height), i.lx = Math.round(i.lx), i.ly = Math.round(i.ly); var p = { y: t.y, b: i.height * v0[h], t: i.height * h0[h] }; t.lenmode === "fraction" ? (p.l = 0, p.xl = t.x - t.len * h0[d], p.r = 0, p.xr = t.x + t.len * v0[d]) : (p.x = t.x, p.l = i.outerLength * h0[d], p.r = i.outerLength * v0[d]), Fv.autoMargin(e10, P6(t), p); } function Sie(e10, t, r) { (r.steps[r.active] || {}).visible || (r.active = r._visibleSteps[0]._index), t.call(Rv, r).call(Rie, r).call(Lie, r).call(Die, r).call(Fie, e10, r).call(Cie, e10, r); var n = r._dims; vi.setTranslate(t, n.lx + r.pad.l, n.ly + r.pad.t), t.call(N6, r, false), t.call(Rv, r); } function Rv(e10, t, r) { if (t.currentvalue.visible) { var n = t._dims, a, i; switch (t.currentvalue.xanchor) { case "right": a = n.inputAreaLength - Qt.currentValueInset - n.currentValueMaxWidth, i = "left"; break; case "center": a = n.inputAreaLength * 0.5, i = "middle"; break; default: a = Qt.currentValueInset, i = "left"; } var o = _a.ensureSingle(e10, "text", Qt.labelClass, function(h) { h.attr({ "text-anchor": i, "data-notex": 1 }); }), l = t.currentvalue.prefix ? t.currentvalue.prefix : ""; if (typeof r == "string") l += r; else { var s = t.steps[t.active].label, u = t._gd._fullLayout._meta; u && (s = _a.templateString(s, u)), l += s; } t.currentvalue.suffix && (l += t.currentvalue.suffix), o.call(vi.font, t.currentvalue.font).text(l).call(lc.convertToTspans, t._gd); var f = lc.lineCount(o), d = (n.currentValueMaxLines + 1 - f) * t.currentvalue.font.size * R6; return lc.positionText(o, a, d), o; } } function Cie(e10, t, r) { var n = _a.ensureSingle(e10, "rect", Qt.gripRectClass, function(a) { a.call(I6, t, e10, r).style("pointer-events", "all"); }); n.attr({ width: Qt.gripWidth, height: Qt.gripHeight, rx: Qt.gripRadius, ry: Qt.gripRadius }).call(hl.stroke, r.bordercolor).call(hl.fill, r.bgcolor).style("stroke-width", r.borderwidth + "px"); } function $6(e10, t, r) { var n = _a.ensureSingle(e10, "text", Qt.labelClass, function(o) { o.attr({ "text-anchor": "middle", "data-notex": 1 }); }), a = t.step.label, i = r._gd._fullLayout._meta; return i && (a = _a.templateString(a, i)), n.call(vi.font, r.font).text(a).call(lc.convertToTspans, r._gd), n; } function Lie(e10, t) { var r = _a.ensureSingle(e10, "g", Qt.labelsClass), n = t._dims, a = r.selectAll("g." + Qt.labelGroupClass).data(n.labelSteps); a.enter().append("g").classed(Qt.labelGroupClass, true), a.exit().remove(), a.each(function(i) { var o = ci.select(this); o.call($6, i, t), vi.setTranslate( o, m_(t, i.fraction), Qt.tickOffset + t.ticklen + // position is the baseline of the top line of text only, even // if the label spans multiple lines t.font.size * R6 + Qt.labelOffset + n.currentValueTotalHeight ); }); } function qM(e10, t, r, n, a) { var i = Math.round(n * (r._stepCount - 1)), o = r._visibleSteps[i]._index; o !== r.active && z6(e10, t, r, o, true, a); } function z6(e10, t, r, n, a, i) { var o = r.active; r.active = n, wie(e10.layout, Qt.name, r).applyUpdate("active", n); var l = r.steps[r.active]; t.call(N6, r, i), t.call(Rv, r), e10.emit("plotly_sliderchange", { slider: r, step: r.steps[r.active], interaction: a, previousActive: o }), l && l.method && a && (t._nextMethod ? (t._nextMethod.step = l, t._nextMethod.doCallback = a, t._nextMethod.doTransition = i) : (t._nextMethod = { step: l, doCallback: a, doTransition: i }, t._nextMethodRaf = window.requestAnimationFrame(function() { var s = t._nextMethod.step; s.method && (s.execute && Fv.executeAPICommand(e10, s.method, s.args), t._nextMethod = null, t._nextMethodRaf = null); }))); } function I6(e10, t, r) { if (t._context.staticPlot) return; var n = r.node(), a = ci.select(t); function i() { return r.data()[0]; } function o() { var l = i(); t.emit("plotly_sliderstart", { slider: l }); var s = r.select("." + Qt.gripRectClass); ci.event.stopPropagation(), ci.event.preventDefault(), s.call(hl.fill, l.activebgcolor); var u = WM(l, ci.mouse(n)[0]); qM(t, r, l, u, true), l._dragging = true; function f() { var h = i(), p = WM(h, ci.mouse(n)[0]); qM(t, r, h, p, false); } a.on("mousemove", f), a.on("touchmove", f); function d() { var h = i(); h._dragging = false, s.call(hl.fill, h.bgcolor), a.on("mouseup", null), a.on("mousemove", null), a.on("touchend", null), a.on("touchmove", null), t.emit("plotly_sliderend", { slider: h, step: h.steps[h.active] }); } a.on("mouseup", d), a.on("touchend", d); } e10.on("mousedown", o), e10.on("touchstart", o); } function Die(e10, t) { var r = e10.selectAll("rect." + Qt.tickRectClass).data(t._visibleSteps), n = t._dims; r.enter().append("rect").classed(Qt.tickRectClass, true), r.exit().remove(), r.attr({ width: t.tickwidth + "px", "shape-rendering": "crispEdges" }), r.each(function(a, i) { var o = i % n.labelStride === 0, l = ci.select(this); l.attr({ height: o ? t.ticklen : t.minorticklen }).call(hl.fill, t.tickcolor), vi.setTranslate( l, m_(t, i / (t._stepCount - 1)) - 0.5 * t.tickwidth, (o ? Qt.tickOffset : Qt.minorTickOffset) + n.currentValueTotalHeight ); }); } function Eie(e10) { var t = e10._dims; t.labelSteps = []; for (var r = e10._stepCount, n = 0; n < r; n += t.labelStride) t.labelSteps.push({ fraction: n / (r - 1), step: e10._visibleSteps[n] }); } function N6(e10, t, r) { for (var n = e10.select("rect." + Qt.gripRectClass), a = 0, i = 0; i < t._stepCount; i++) if (t._visibleSteps[i]._index === t.active) { a = i; break; } var o = m_(t, a / (t._stepCount - 1)); if (!t._invokingCommand) { var l = n; r && t.transition.duration > 0 && (l = l.transition().duration(t.transition.duration).ease(t.transition.easing)), l.attr("transform", xie(o - Qt.gripWidth * 0.5, t._dims.currentValueTotalHeight)); } } function m_(e10, t) { var r = e10._dims; return r.inputAreaStart + Qt.stepInset + (r.inputAreaLength - 2 * Qt.stepInset) * Math.min(1, Math.max(0, t)); } function WM(e10, t) { var r = e10._dims; return Math.min(1, Math.max(0, (t - Qt.stepInset - r.inputAreaStart) / (r.inputAreaLength - 2 * Qt.stepInset - 2 * r.inputAreaStart))); } function Fie(e10, t, r) { var n = r._dims, a = _a.ensureSingle(e10, "rect", Qt.railTouchRectClass, function(i) { i.call(I6, t, e10, r).style("pointer-events", "all"); }); a.attr({ width: n.inputAreaLength, height: Math.max(n.inputAreaWidth, Qt.tickOffset + r.ticklen + n.labelHeight) }).call(hl.fill, r.bgcolor).attr("opacity", 0), vi.setTranslate(a, 0, n.currentValueTotalHeight); } function Rie(e10, t) { var r = t._dims, n = r.inputAreaLength - Qt.railInset * 2, a = _a.ensureSingle(e10, "rect", Qt.railRectClass); a.attr({ width: n, height: Qt.railWidth, rx: Qt.railRadius, ry: Qt.railRadius, "shape-rendering": "crispEdges" }).call(hl.stroke, t.bordercolor).call(hl.fill, t.bgcolor).style("stroke-width", t.borderwidth + "px"), vi.setTranslate( a, Qt.railInset, (r.inputAreaWidth - Qt.railWidth) * 0.5 + r.currentValueTotalHeight ); } var Pie = Kp; var $ie = { moduleType: "component", name: Pie.name, layoutAttributes: D6, supplyLayoutDefaults: yie, draw: Tie }; var ZM = da; var g_ = { bgcolor: { valType: "color", dflt: ZM.background, editType: "plot", description: "Sets the background color of the range slider." }, bordercolor: { valType: "color", dflt: ZM.defaultLine, editType: "plot", description: "Sets the border color of the range slider." }, borderwidth: { valType: "integer", dflt: 0, min: 0, editType: "plot", description: "Sets the border width of the range slider." }, autorange: { valType: "boolean", dflt: true, editType: "calc", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Determines whether or not the range slider range is", "computed in relation to the input data.", "If `range` is provided, then `autorange` is set to *false*." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "calc", impliedEdits: { "^autorange": false } }, { valType: "any", editType: "calc", impliedEdits: { "^autorange": false } } ], editType: "calc", impliedEdits: { autorange: false }, description: [ "Sets the range of the range slider.", "If not set, defaults to the full xaxis range.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, thickness: { valType: "number", dflt: 0.15, min: 0, max: 1, editType: "plot", description: [ "The height of the range slider as a fraction of the", "total plot area height." ].join(" ") }, visible: { valType: "boolean", dflt: true, editType: "calc", description: [ "Determines whether or not the range slider will be visible.", "If visible, perpendicular axes will be set to `fixedrange`" ].join(" ") }, editType: "calc" }; var O6 = { // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: true, rangemode: { valType: "enumerated", values: ["auto", "fixed", "match"], dflt: "match", editType: "calc", description: [ "Determines whether or not the range of this axis in", "the rangeslider use the same value than in the main plot", "when zooming in/out.", "If *auto*, the autorange will be used.", "If *fixed*, the `range` is used.", "If *match*, the current range of the corresponding y-axis on the main subplot is used." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "plot" }, { valType: "any", editType: "plot" } ], editType: "plot", description: [ "Sets the range of this axis for the rangeslider." ].join(" ") }, editType: "calc" }; var Jp = {}; var y_ = { // attribute container name name: "rangeslider", // class names containerClassName: "rangeslider-container", bgClassName: "rangeslider-bg", rangePlotClassName: "rangeslider-rangeplot", maskMinClassName: "rangeslider-mask-min", maskMaxClassName: "rangeslider-mask-max", slideBoxClassName: "rangeslider-slidebox", grabberMinClassName: "rangeslider-grabber-min", grabAreaMinClassName: "rangeslider-grabarea-min", handleMinClassName: "rangeslider-handle-min", grabberMaxClassName: "rangeslider-grabber-max", grabAreaMaxClassName: "rangeslider-grabarea-max", handleMaxClassName: "rangeslider-handle-max", maskMinOppAxisClassName: "rangeslider-mask-min-opp-axis", maskMaxOppAxisClassName: "rangeslider-mask-max-opp-axis", // style constants maskColor: "rgba(0,0,0,0.4)", maskOppAxisColor: "rgba(0,0,0,0.2)", slideBoxFill: "transparent", slideBoxCursor: "ew-resize", grabAreaFill: "transparent", grabAreaCursor: "col-resize", grabAreaWidth: 10, handleWidth: 4, handleRadius: 1, handleStrokeWidth: 1, extraPad: 15 }; var zie = gn; var Iie = Rn; var H6 = y_; var Nie = On.LINE_SPACING; var Pv = H6.name; function B6(e10) { var t = e10 && e10[Pv]; return t && t.visible; } Jp.isVisible = B6; Jp.makeData = function(e10) { var t = zie.list({ _fullLayout: e10 }, "x", true), r = e10.margin, n = []; if (!e10._has("gl2d")) for (var a = 0; a < t.length; a++) { var i = t[a]; if (B6(i)) { n.push(i); var o = i[Pv]; o._id = Pv + i._id, o._height = (e10.height - r.b - r.t) * o.thickness, o._offsetShift = Math.floor(o.borderwidth / 2); } } e10._rangeSliderData = n; }; Jp.autoMarginOpts = function(e10, t) { var r = e10._fullLayout, n = t[Pv], a = t._id.charAt(0), i = 0, o = 0; if (t.side === "bottom" && (i = t._depth, t.title.text !== r._dfltTitle[a])) { o = 1.5 * t.title.font.size + 10 + n._offsetShift; var l = (t.title.text.match(Iie.BR_TAG_ALL) || []).length; o += l * t.title.font.size * Nie; } return { x: 0, y: t._counterDomainMin, l: 0, r: 0, t: 0, b: n._height + i + Math.max(r.margin.b, o), pad: H6.extraPad + n._offsetShift * 2 }; }; var p0; var YM; function Oie() { if (YM) return p0; YM = 1; var e10 = Ue, t = Mr, r = gn, n = g_, a = O6; return p0 = function(o, l, s) { var u = o[s], f = l[s]; if (!(u.rangeslider || l._requestRangeslider[f._id])) return; e10.isPlainObject(u.rangeslider) || (u.rangeslider = {}); var d = u.rangeslider, h = t.newContainer(f, "rangeslider"); function p(F, $) { return e10.coerce(d, h, n, F, $); } var v, m; function g(F, $) { return e10.coerce(v, m, a, F, $); } var y = p("visible"); if (y) { p("bgcolor", l.plot_bgcolor), p("bordercolor"), p("borderwidth"), p("thickness"), p("autorange", !f.isValidRange(d.range)), p("range"); var w = l._subplots; if (w) for (var k = w.cartesian.filter(function(F) { return F.substr(0, F.indexOf("y")) === r.name2id(s); }).map(function(F) { return F.substr(F.indexOf("y"), F.length); }), x = e10.simpleMap(k, r.id2name), _ = 0; _ < x.length; _++) { var T = x[_]; v = d[T] || {}, m = t.newContainer(h, T, "yaxis"); var S = l[T], M; v.range && S.isValidRange(v.range) && (M = "fixed"); var L = g("rangemode", M); L !== "match" && g("range", S.range.slice()); } h._input = d; } }, p0; } var m0; var XM; function Hie() { if (XM) return m0; XM = 1; var e10 = gn.list, t = Lp.getAutoRange, r = y_; return m0 = function(a) { for (var i = e10(a, "x", true), o = 0; o < i.length; o++) { var l = i[o], s = l[r.name]; s && s.visible && s.autorange && (s._input.autorange = true, s._input.range = s.range = t(a, l)); } }, m0; } var g0; var KM; function Bie() { if (KM) return g0; KM = 1; var e10 = lr, t = Nt, r = Tn, n = Ue, a = n.strTranslate, i = Sr, o = nr, l = Cp, s = yn, u = gn, f = Qi, d = xs, h = y_; g0 = function(M) { for (var L = M._fullLayout, F = L._rangeSliderData, $ = 0; $ < F.length; $++) { var I = F[$][h.name]; I._clipId = I._id + "-" + L._uid; } function O(K) { return K._name; } var G = L._infolayer.selectAll("g." + h.containerClassName).data(F, O); G.exit().each(function(K) { var V = K[h.name]; L._topdefs.select("#" + V._clipId).remove(); }).remove(), F.length !== 0 && (G.enter().append("g").classed(h.containerClassName, true).attr("pointer-events", "all"), G.each(function(K) { var V = e10.select(this), z = K[h.name], P = L[u.id2name(K.anchor)], R = z[u.id2name(K.anchor)]; if (z.range) { var H = n.simpleMap(z.range, K.r2l), B = n.simpleMap(K.range, K.r2l), W; B[0] < B[1] ? W = [ Math.min(H[0], B[0]), Math.max(H[1], B[1]) ] : W = [ Math.max(H[0], B[0]), Math.min(H[1], B[1]) ], z.range = z._input.range = n.simpleMap(W, K.l2r); } K.cleanRange("rangeslider.range"); var ee = L._size, re = K.domain; z._width = ee.w * (re[1] - re[0]); var ae = Math.round(ee.l + ee.w * re[0]), Q = Math.round( ee.t + ee.h * (1 - K._counterDomainMin) + (K.side === "bottom" ? K._depth : 0) + z._offsetShift + h.extraPad ); V.attr("transform", a(ae, Q)), z._rl = n.simpleMap(z.range, K.r2l); var ue = z._rl[0], j = z._rl[1], U = j - ue; if (z.p2d = function(Fe) { return Fe / z._width * U + ue; }, z.d2p = function(Fe) { return (Fe - ue) / U * z._width; }, K.rangebreaks) { var Z = K.locateBreaks(ue, j); if (Z.length) { var le, J, pe = 0; for (le = 0; le < Z.length; le++) J = Z[le], pe += J.max - J.min; var ge = z._width / (j - ue - pe), ve = [-ge * ue]; for (le = 0; le < Z.length; le++) J = Z[le], ve.push(ve[ve.length - 1] - ge * (J.max - J.min)); for (z.d2p = function(Fe) { for (var Oe = ve[0], Re = 0; Re < Z.length; Re++) { var We = Z[Re]; if (Fe >= We.max) Oe = ve[Re + 1]; else if (Fe < We.min) break; } return Oe + ge * Fe; }, le = 0; le < Z.length; le++) J = Z[le], J.pmin = z.d2p(J.min), J.pmax = z.d2p(J.max); z.p2d = function(Fe) { for (var Oe = ve[0], Re = 0; Re < Z.length; Re++) { var We = Z[Re]; if (Fe >= We.pmax) Oe = ve[Re + 1]; else if (Fe < We.pmin) break; } return (Fe - Oe) / ge; }; } } if (R.rangemode !== "match") { var me = P.r2l(R.range[0]), Le = P.r2l(R.range[1]), ze = Le - me; z.d2pOppAxis = function(Fe) { return (Fe - me) / ze * z._height; }; } V.call(y, M, K, z).call(w, M, K, z).call(k, M, K, z).call(_, M, K, z, R).call(T, M, K, z).call(S, M, K, z), v(V, M, K, z), g(V, M, K, z, P, R), K.side === "bottom" && l.draw(M, K._id + "title", { propContainer: K, propName: K._name + ".title", placeholder: L._dfltTitle.x, attributes: { x: K._offset + K._length / 2, y: Q + z._height + z._offsetShift + 10 + 1.5 * K.title.font.size, "text-anchor": "middle" } }); })); }; function p(M) { return typeof M.clientX == "number" ? M.clientX : M.touches && M.touches.length > 0 ? M.touches[0].clientX : 0; } function v(M, L, F, $) { if (L._context.staticPlot) return; var I = M.select("rect." + h.slideBoxClassName).node(), O = M.select("rect." + h.grabAreaMinClassName).node(), G = M.select("rect." + h.grabAreaMaxClassName).node(); function K() { var V = e10.event, z = V.target, P = p(V), R = P - M.node().getBoundingClientRect().left, H = $.d2p(F._rl[0]), B = $.d2p(F._rl[1]), W = f.coverSlip(); this.addEventListener("touchmove", ee), this.addEventListener("touchend", re), W.addEventListener("mousemove", ee), W.addEventListener("mouseup", re); function ee(ae) { var Q = p(ae), ue = +Q - P, j, U, Z; switch (z) { case I: if (Z = "ew-resize", H + ue > F._length || B + ue < 0) return; j = H + ue, U = B + ue; break; case O: if (Z = "col-resize", H + ue > F._length) return; j = H + ue, U = B; break; case G: if (Z = "col-resize", B + ue < 0) return; j = H, U = B + ue; break; default: Z = "ew-resize", j = R, U = R + ue; break; } if (U < j) { var le = U; U = j, j = le; } $._pixelMin = j, $._pixelMax = U, d(e10.select(W), Z), m(M, L, F, $); } function re() { W.removeEventListener("mousemove", ee), W.removeEventListener("mouseup", re), this.removeEventListener("touchmove", ee), this.removeEventListener("touchend", re), n.removeElement(W); } } M.on("mousedown", K), M.on("touchstart", K); } function m(M, L, F, $) { function I(K) { return F.l2r(n.constrain(K, $._rl[0], $._rl[1])); } var O = I($.p2d($._pixelMin)), G = I($.p2d($._pixelMax)); window.requestAnimationFrame(function() { t.call("_guiRelayout", L, F._name + ".range", [O, G]); }); } function g(M, L, F, $, I, O) { var G = h.handleWidth / 2; function K(ae) { return n.constrain(ae, 0, $._width); } function V(ae) { return n.constrain(ae, 0, $._height); } function z(ae) { return n.constrain(ae, -G, $._width + G); } var P = K($.d2p(F._rl[0])), R = K($.d2p(F._rl[1])); if (M.select("rect." + h.slideBoxClassName).attr("x", P).attr("width", R - P), M.select("rect." + h.maskMinClassName).attr("width", P), M.select("rect." + h.maskMaxClassName).attr("x", R).attr("width", $._width - R), O.rangemode !== "match") { var H = $._height - V($.d2pOppAxis(I._rl[1])), B = $._height - V($.d2pOppAxis(I._rl[0])); M.select("rect." + h.maskMinOppAxisClassName).attr("x", P).attr("height", H).attr("width", R - P), M.select("rect." + h.maskMaxOppAxisClassName).attr("x", P).attr("y", B).attr("height", $._height - B).attr("width", R - P), M.select("rect." + h.slideBoxClassName).attr("y", H).attr("height", B - H); } var W = 0.5, ee = Math.round(z(P - G)) - W, re = Math.round(z(R - G)) + W; M.select("g." + h.grabberMinClassName).attr("transform", a(ee, W)), M.select("g." + h.grabberMaxClassName).attr("transform", a(re, W)); } function y(M, L, F, $) { var I = n.ensureSingle(M, "rect", h.bgClassName, function(V) { V.attr({ x: 0, y: 0, "shape-rendering": "crispEdges" }); }), O = $.borderwidth % 2 === 0 ? $.borderwidth : $.borderwidth - 1, G = -$._offsetShift, K = i.crispRound(L, $.borderwidth); I.attr({ width: $._width + O, height: $._height + O, transform: a(G, G), "stroke-width": K }).call(o.stroke, $.bordercolor).call(o.fill, $.bgcolor); } function w(M, L, F, $) { var I = L._fullLayout, O = n.ensureSingleById(I._topdefs, "clipPath", $._clipId, function(G) { G.append("rect").attr({ x: 0, y: 0 }); }); O.select("rect").attr({ width: $._width, height: $._height }); } function k(M, L, F, $) { var I = L.calcdata, O = M.selectAll("g." + h.rangePlotClassName).data(F._subplotsWith, n.identity); O.enter().append("g").attr("class", function(K) { return h.rangePlotClassName + " " + K; }).call(i.setClipUrl, $._clipId, L), O.order(), O.exit().remove(); var G; O.each(function(K, V) { var z = e10.select(this), P = V === 0, R = u.getFromId(L, K, "y"), H = R._name, B = $[H], W = { data: [], layout: { xaxis: { type: F.type, domain: [0, 1], range: $.range.slice(), calendar: F.calendar }, width: $._width, height: $._height, margin: { t: 0, b: 0, l: 0, r: 0 } }, _context: L._context }; F.rangebreaks && (W.layout.xaxis.rangebreaks = F.rangebreaks), W.layout[H] = { type: R.type, domain: [0, 1], range: B.rangemode !== "match" ? B.range.slice() : R.range.slice(), calendar: R.calendar }, R.rangebreaks && (W.layout[H].rangebreaks = R.rangebreaks), r.supplyDefaults(W); var ee = W._fullLayout.xaxis, re = W._fullLayout[H]; ee.clearCalc(), ee.setScale(), re.clearCalc(), re.setScale(); var ae = { id: K, plotgroup: z, xaxis: ee, yaxis: re, isRangePlot: true }; P ? G = ae : (ae.mainplot = "xy", ae.mainplotinfo = G), s.rangePlot(L, ae, x(I, K)); }); } function x(M, L) { for (var F = [], $ = 0; $ < M.length; $++) { var I = M[$], O = I[0].trace; O.xaxis + O.yaxis === L && F.push(I); } return F; } function _(M, L, F, $, I) { var O = n.ensureSingle(M, "rect", h.maskMinClassName, function(z) { z.attr({ x: 0, y: 0, "shape-rendering": "crispEdges" }); }); O.attr("height", $._height).call(o.fill, h.maskColor); var G = n.ensureSingle(M, "rect", h.maskMaxClassName, function(z) { z.attr({ y: 0, "shape-rendering": "crispEdges" }); }); if (G.attr("height", $._height).call(o.fill, h.maskColor), I.rangemode !== "match") { var K = n.ensureSingle(M, "rect", h.maskMinOppAxisClassName, function(z) { z.attr({ y: 0, "shape-rendering": "crispEdges" }); }); K.attr("width", $._width).call(o.fill, h.maskOppAxisColor); var V = n.ensureSingle(M, "rect", h.maskMaxOppAxisClassName, function(z) { z.attr({ y: 0, "shape-rendering": "crispEdges" }); }); V.attr("width", $._width).style("border-top", h.maskOppBorder).call(o.fill, h.maskOppAxisColor); } } function T(M, L, F, $) { if (!L._context.staticPlot) { var I = n.ensureSingle(M, "rect", h.slideBoxClassName, function(O) { O.attr({ y: 0, cursor: h.slideBoxCursor, "shape-rendering": "crispEdges" }); }); I.attr({ height: $._height, fill: h.slideBoxFill }); } } function S(M, L, F, $) { var I = n.ensureSingle(M, "g", h.grabberMinClassName), O = n.ensureSingle(M, "g", h.grabberMaxClassName), G = { x: 0, width: h.handleWidth, rx: h.handleRadius, fill: o.background, stroke: o.defaultLine, "stroke-width": h.handleStrokeWidth, "shape-rendering": "crispEdges" }, K = { y: Math.round($._height / 4), height: Math.round($._height / 2) }, V = n.ensureSingle(I, "rect", h.handleMinClassName, function(B) { B.attr(G); }); V.attr(K); var z = n.ensureSingle(O, "rect", h.handleMaxClassName, function(B) { B.attr(G); }); z.attr(K); var P = { width: h.grabAreaWidth, x: 0, y: 0, fill: h.grabAreaFill, cursor: L._context.staticPlot ? void 0 : h.grabAreaCursor }, R = n.ensureSingle(I, "rect", h.grabAreaMinClassName, function(B) { B.attr(P); }); R.attr("height", $._height); var H = n.ensureSingle(O, "rect", h.grabAreaMaxClassName, function(B) { B.attr(P); }); H.attr("height", $._height); } return g0; } var jie = Ue; var Uie = g_; var Gie = O6; var y0 = Jp; var Vie = { moduleType: "component", name: "rangeslider", schema: { subplots: { xaxis: { rangeslider: jie.extendFlat({}, Uie, { yaxis: Gie }) } } }, layoutAttributes: g_, handleDefaults: Oie(), calcAutorange: Hie(), draw: Bie(), isVisible: y0.isVisible, makeData: y0.makeData, autoMarginOpts: y0.autoMarginOpts }; var qie = Fn; var JM = da; var Wie = Mr.templatedArray; var Zie = Wie("button", { visible: { valType: "boolean", dflt: true, editType: "plot", description: "Determines whether or not this button is visible." }, step: { valType: "enumerated", values: ["month", "year", "day", "hour", "minute", "second", "all"], dflt: "month", editType: "plot", description: [ "The unit of measurement that the `count` value will set the range by." ].join(" ") }, stepmode: { valType: "enumerated", values: ["backward", "todate"], dflt: "backward", editType: "plot", description: [ "Sets the range update mode.", "If *backward*, the range update shifts the start of range", "back *count* times *step* milliseconds.", "If *todate*, the range update shifts the start of range", "back to the first timestamp from *count* times", "*step* milliseconds back.", "For example, with `step` set to *year* and `count` set to *1*", "the range update shifts the start of the range back to", "January 01 of the current year.", "Month and year *todate* are currently available only", "for the built-in (Gregorian) calendar." ].join(" ") }, count: { valType: "number", min: 0, dflt: 1, editType: "plot", description: [ "Sets the number of steps to take to update the range.", "Use with `step` to specify the update interval." ].join(" ") }, label: { valType: "string", editType: "plot", description: "Sets the text label to appear on the button." }, editType: "plot", description: [ "Sets the specifications for each buttons.", "By default, a range selector comes with no buttons." ].join(" ") }); var Qy = { visible: { valType: "boolean", editType: "plot", description: [ "Determines whether or not this range selector is visible.", "Note that range selectors are only available for x axes of", "`type` set to or auto-typed to *date*." ].join(" ") }, buttons: Zie, x: { valType: "number", min: -2, max: 3, editType: "plot", description: "Sets the x position (in normalized coordinates) of the range selector." }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", editType: "plot", description: [ "Sets the range selector's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, editType: "plot", description: "Sets the y position (in normalized coordinates) of the range selector." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "bottom", editType: "plot", description: [ "Sets the range selector's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, font: qie({ editType: "plot", description: "Sets the font of the range selector button text." }), bgcolor: { valType: "color", dflt: JM.lightLine, editType: "plot", description: "Sets the background color of the range selector buttons." }, activecolor: { valType: "color", editType: "plot", description: "Sets the background color of the active range selector button." }, bordercolor: { valType: "color", dflt: JM.defaultLine, editType: "plot", description: "Sets the color of the border enclosing the range selector." }, borderwidth: { valType: "number", min: 0, dflt: 0, editType: "plot", description: "Sets the width (in px) of the border enclosing the range selector." }, editType: "plot" }; var j6 = { // 'y' position pad above counter axis domain yPad: 0.02, // minimum button width (regardless of text size) minButtonWidth: 30, // buttons rect radii rx: 3, ry: 3, // light fraction used to compute the 'activecolor' default lightAmount: 25, darkAmount: 10 }; var Wh = Ue; var Yie = nr; var Xie = Mr; var Kie = Ji; var U6 = Qy; var e1 = j6; var Jie = function(t, r, n, a, i) { var o = t.rangeselector || {}, l = Xie.newContainer(r, "rangeselector"); function s(p, v) { return Wh.coerce(o, l, U6, p, v); } var u = Kie(o, l, { name: "buttons", handleItemDefaults: Qie, calendar: i }), f = s("visible", u.length > 0); if (f) { var d = eoe(r, n, a); s("x", d[0]), s("y", d[1]), Wh.noneOrAll(t, r, ["x", "y"]), s("xanchor"), s("yanchor"), Wh.coerceFont(s, "font", n.font); var h = s("bgcolor"); s("activecolor", Yie.contrast(h, e1.lightAmount, e1.darkAmount)), s("bordercolor"), s("borderwidth"); } }; function Qie(e10, t, r, n) { var a = n.calendar; function i(s, u) { return Wh.coerce(e10, t, U6.buttons, s, u); } var o = i("visible"); if (o) { var l = i("step"); l !== "all" && (a && a !== "gregorian" && (l === "month" || l === "year") ? t.stepmode = "backward" : i("stepmode"), i("count")), i("label"); } } function eoe(e10, t, r) { for (var n = r.filter(function(l) { return t[l].anchor === e10._id; }), a = 0, i = 0; i < n.length; i++) { var o = t[n[i]].domain; o && (a = Math.max(o[1], a)); } return [e10.domain[0], a + e1.yPad]; } var toe = tp(VB); var roe = toe; var noe = Ue.titleCase; var aoe = function(t, r) { var n = t._name, a = {}; if (r.step === "all") a[n + ".autorange"] = true; else { var i = ioe(t, r); a[n + ".range[0]"] = i[0], a[n + ".range[1]"] = i[1]; } return a; }; function ioe(e10, t) { var r = e10.range, n = new Date(e10.r2l(r[1])), a = t.step, i = roe["utc" + noe(a)], o = t.count, l; switch (t.stepmode) { case "backward": l = e10.l2r(+i.offset(n, -o)); break; case "todate": var s = i.offset(n, -o); l = e10.l2r(+i.ceil(s)); break; } var u = r[1]; return [l, u]; } var $v = lr; var ooe = Nt; var loe = Tn; var QM = nr; var G6 = Sr; var go = Ue; var eS = go.strTranslate; var Zh = Rn; var soe = gn; var b_ = On; var tS = b_.LINE_SPACING; var rS = b_.FROM_TL; var nS = b_.FROM_BR; var t1 = j6; var uoe = aoe; var foe = function(t) { var r = t._fullLayout, n = r._infolayer.selectAll(".rangeselector").data(coe(t), doe); n.enter().append("g").classed("rangeselector", true), n.exit().remove(), n.style({ cursor: "pointer", "pointer-events": "all" }), n.each(function(a) { var i = $v.select(this), o = a, l = o.rangeselector, s = i.selectAll("g.button").data(go.filterVisible(l.buttons)); s.enter().append("g").classed("button", true), s.exit().remove(), s.each(function(u) { var f = $v.select(this), d = uoe(o, u); u._isActive = hoe(o, u, d), f.call(b0, l, u), f.call(poe, l, u, t), f.on("click", function() { t._dragged || ooe.call("_guiRelayout", t, d); }), f.on("mouseover", function() { u._isHovered = true, f.call(b0, l, u); }), f.on("mouseout", function() { u._isHovered = false, f.call(b0, l, u); }); }), goe(t, s, l, o._name, i); }); }; function coe(e10) { for (var t = soe.list(e10, "x", true), r = [], n = 0; n < t.length; n++) { var a = t[n]; a.rangeselector && a.rangeselector.visible && r.push(a); } return r; } function doe(e10) { return e10._id; } function hoe(e10, t, r) { if (t.step === "all") return e10.autorange === true; var n = Object.keys(r); return e10.range[0] === r[n[0]] && e10.range[1] === r[n[1]]; } function b0(e10, t, r) { var n = go.ensureSingle(e10, "rect", "selector-rect", function(a) { a.attr("shape-rendering", "crispEdges"); }); n.attr({ rx: t1.rx, ry: t1.ry }), n.call(QM.stroke, t.bordercolor).call(QM.fill, voe(t, r)).style("stroke-width", t.borderwidth + "px"); } function voe(e10, t) { return t._isActive || t._isHovered ? e10.activecolor : e10.bgcolor; } function poe(e10, t, r, n) { function a(o) { Zh.convertToTspans(o, n); } var i = go.ensureSingle(e10, "text", "selector-text", function(o) { o.attr("text-anchor", "middle"); }); i.call(G6.font, t.font).text(moe(r, n._fullLayout._meta)).call(a); } function moe(e10, t) { return e10.label ? t ? go.templateString(e10.label, t) : e10.label : e10.step === "all" ? "all" : e10.count + e10.step.charAt(0); } function goe(e10, t, r, n, a) { var i = 0, o = 0, l = r.borderwidth; t.each(function() { var p = $v.select(this), v = p.select(".selector-text"), m = r.font.size * tS, g = Math.max(m * Zh.lineCount(v), 16) + 3; o = Math.max(o, g); }), t.each(function() { var p = $v.select(this), v = p.select(".selector-rect"), m = p.select(".selector-text"), g = m.node() && G6.bBox(m.node()).width, y = r.font.size * tS, w = Zh.lineCount(m), k = Math.max(g + 10, t1.minButtonWidth); p.attr("transform", eS(l + i, l)), v.attr({ x: 0, y: 0, width: k, height: o }), Zh.positionText( m, k / 2, o / 2 - (w - 1) * y / 2 + 3 ), i += k + 5; }); var s = e10._fullLayout._size, u = s.l + s.w * r.x, f = s.t + s.h * (1 - r.y), d = "left"; go.isRightAnchor(r) && (u -= i, d = "right"), go.isCenterAnchor(r) && (u -= i / 2, d = "center"); var h = "top"; go.isBottomAnchor(r) && (f -= o, h = "bottom"), go.isMiddleAnchor(r) && (f -= o / 2, h = "middle"), i = Math.ceil(i), o = Math.ceil(o), u = Math.round(u), f = Math.round(f), loe.autoMargin(e10, n + "-range-selector", { x: r.x, y: r.y, l: i * rS[d], r: i * nS[d], b: o * nS[h], t: o * rS[h] }), a.attr("transform", eS(u, f)); } var yoe = { moduleType: "component", name: "rangeselector", schema: { subplots: { xaxis: { rangeselector: Qy } } }, layoutAttributes: Qy, handleDefaults: Jie, draw: foe }; var __ = {}; var aS = en.extendFlat; __.attributes = function(e10, t) { e10 = e10 || {}, t = t || {}; var r = { valType: "info_array", editType: e10.editType, items: [ { valType: "number", min: 0, max: 1, editType: e10.editType }, { valType: "number", min: 0, max: 1, editType: e10.editType } ], dflt: [0, 1] }, n = e10.name ? e10.name + " " : "", a = e10.trace ? "trace " : "subplot ", i = t.description ? " " + t.description : "", o = { x: aS({}, r, { description: [ "Sets the horizontal domain of this ", n, a, "(in plot fraction).", i ].join("") }), y: aS({}, r, { description: [ "Sets the vertical domain of this ", n, a, "(in plot fraction).", i ].join("") }), editType: e10.editType }; return e10.noGridCell || (o.row = { valType: "integer", min: 0, dflt: 0, editType: e10.editType, description: [ "If there is a layout grid, use the domain ", "for this row in the grid for this ", n, a, ".", i ].join("") }, o.column = { valType: "integer", min: 0, dflt: 0, editType: e10.editType, description: [ "If there is a layout grid, use the domain ", "for this column in the grid for this ", n, a, ".", i ].join("") }), o; }; __.defaults = function(e10, t, r, n) { var a = n && n.x || [0, 1], i = n && n.y || [0, 1], o = t.grid; if (o) { var l = r("domain.column"); l !== void 0 && (l < o.columns ? a = o._domains.x[l] : delete e10.domain.column); var s = r("domain.row"); s !== void 0 && (s < o.rows ? i = o._domains.y[s] : delete e10.domain.row); } var u = r("domain.x", a), f = r("domain.y", i); u[0] < u[1] || (e10.domain.x = a.slice()), f[0] < f[1] || (e10.domain.y = i.slice()); }; var boe = Ue; var _oe = Zu.counter; var xoe = __.attributes; var iS = Yn.idRegex; var woe = Mr; var r1 = { rows: { valType: "integer", min: 1, editType: "plot", description: [ "The number of rows in the grid. If you provide a 2D `subplots`", "array or a `yaxes` array, its length is used as the default.", "But it's also possible to have a different length, if you", "want to leave a row at the end for non-cartesian subplots." ].join(" ") }, roworder: { valType: "enumerated", values: ["top to bottom", "bottom to top"], dflt: "top to bottom", editType: "plot", description: [ "Is the first row the top or the bottom? Note that columns", "are always enumerated from left to right." ].join(" ") }, columns: { valType: "integer", min: 1, editType: "plot", description: [ "The number of columns in the grid. If you provide a 2D `subplots`", "array, the length of its longest row is used as the default.", "If you give an `xaxes` array, its length is used as the default.", "But it's also possible to have a different length, if you", "want to leave a row at the end for non-cartesian subplots." ].join(" ") }, subplots: { valType: "info_array", freeLength: true, dimensions: 2, items: { valType: "enumerated", values: [_oe("xy").toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used for freeform grids, where some axes may be shared across subplots", "but others are not. Each entry should be a cartesian subplot id, like", "*xy* or *x3y2*, or ** to leave that cell empty. You may reuse x axes", "within the same column, and y axes within the same row.", "Non-cartesian subplots and traces that support `domain` can place themselves", "in this grid separately using the `gridcell` attribute." ].join(" ") }, xaxes: { valType: "info_array", freeLength: true, items: { valType: "enumerated", values: [iS.x.toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used with `yaxes` when the x and y axes are shared across columns and rows.", "Each entry should be an x axis id like *x*, *x2*, etc., or ** to", "not put an x axis in that column. Entries other than ** must be unique.", "Ignored if `subplots` is present. If missing but `yaxes` is present,", "will generate consecutive IDs." ].join(" ") }, yaxes: { valType: "info_array", freeLength: true, items: { valType: "enumerated", values: [iS.y.toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used with `yaxes` when the x and y axes are shared across columns and rows.", "Each entry should be an y axis id like *y*, *y2*, etc., or ** to", "not put a y axis in that row. Entries other than ** must be unique.", "Ignored if `subplots` is present. If missing but `xaxes` is present,", "will generate consecutive IDs." ].join(" ") }, pattern: { valType: "enumerated", values: ["independent", "coupled"], dflt: "coupled", editType: "plot", description: [ "If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`,", "we can generate defaults using consecutive axis IDs, in two ways:", "*coupled* gives one x axis per column and one y axis per row.", "*independent* uses a new xy pair for each cell, left-to-right across each row", "then iterating rows according to `roworder`." ].join(" ") }, xgap: { valType: "number", min: 0, max: 1, editType: "plot", description: [ "Horizontal space between grid cells, expressed as a fraction", "of the total width available to one cell. Defaults to 0.1", "for coupled-axes grids and 0.2 for independent grids." ].join(" ") }, ygap: { valType: "number", min: 0, max: 1, editType: "plot", description: [ "Vertical space between grid cells, expressed as a fraction", "of the total height available to one cell. Defaults to 0.1", "for coupled-axes grids and 0.3 for independent grids." ].join(" ") }, domain: xoe({ name: "grid", editType: "plot", noGridCell: true }, { description: [ "The first and last cells end exactly at the domain", "edges, with no grout around the edges." ].join(" ") }), xside: { valType: "enumerated", values: ["bottom", "bottom plot", "top plot", "top"], dflt: "bottom plot", editType: "plot", description: [ "Sets where the x axis labels and titles go. *bottom* means", "the very bottom of the grid. *bottom plot* is the lowest plot", "that each x axis is used in. *top* and *top plot* are similar." ].join(" ") }, yside: { valType: "enumerated", values: ["left", "left plot", "right plot", "right"], dflt: "left plot", editType: "plot", description: [ "Sets where the y axis labels and titles go. *left* means", "the very left edge of the grid. *left plot* is the leftmost plot", "that each y axis is used in. *right* and *right plot* are similar." ].join(" ") }, editType: "plot" }; function zv(e10, t, r) { var n = t[r + "axes"], a = Object.keys((e10._splomAxes || {})[r] || {}); if (Array.isArray(n)) return n; if (a.length) return a; } function Toe(e10, t) { var r = e10.grid || {}, n = zv(t, r, "x"), a = zv(t, r, "y"); if (!e10.grid && !n && !a) return; var i = Array.isArray(r.subplots) && Array.isArray(r.subplots[0]), o = Array.isArray(n), l = Array.isArray(a), s = o && n !== r.xaxes && l && a !== r.yaxes, u, f; i ? (u = r.subplots.length, f = r.subplots[0].length) : (l && (u = a.length), o && (f = n.length)); var d = woe.newContainer(t, "grid"); function h(T, S) { return boe.coerce(r, d, r1, T, S); } var p = h("rows", u), v = h("columns", f); if (!(p * v > 1)) { delete t.grid; return; } if (!i && !o && !l) { var m = h("pattern") === "independent"; m && (i = true); } d._hasSubplotGrid = i; var g = h("roworder"), y = g === "top to bottom", w = i ? 0.2 : 0.1, k = i ? 0.3 : 0.1, x, _; s && t._splomGridDflt && (x = t._splomGridDflt.xside, _ = t._splomGridDflt.yside), d._domains = { x: oS("x", h, w, x, v), y: oS("y", h, k, _, p, y) }; } function oS(e10, t, r, n, a, i) { var o = t(e10 + "gap", r), l = t("domain." + e10); t(e10 + "side", n); for (var s = new Array(a), u = l[0], f = (l[1] - u) / (a - o), d = f * (1 - o), h = 0; h < a; h++) { var p = u + f * h; s[i ? a - 1 - h : h] = [p, p + d]; } return s; } function koe(e10, t) { var r = t.grid; if (!(!r || !r._domains)) { var n = e10.grid || {}, a = t._subplots, i = r._hasSubplotGrid, o = r.rows, l = r.columns, s = r.pattern === "independent", u, f, d, h, p, v, m, g = r._axisMap = {}; if (i) { var y = n.subplots || []; v = r.subplots = new Array(o); var w = 1; for (u = 0; u < o; u++) { var k = v[u] = new Array(l), x = y[u] || []; for (f = 0; f < l; f++) if (s ? (p = w === 1 ? "xy" : "x" + w + "y" + w, w++) : p = x[f], k[f] = "", a.cartesian.indexOf(p) !== -1) { if (m = p.indexOf("y"), d = p.slice(0, m), h = p.slice(m), g[d] !== void 0 && g[d] !== f || g[h] !== void 0 && g[h] !== u) continue; k[f] = p, g[d] = f, g[h] = u; } } } else { var _ = zv(t, n, "x"), T = zv(t, n, "y"); r.xaxes = lS(_, a.xaxis, l, g, "x"), r.yaxes = lS(T, a.yaxis, o, g, "y"); } var S = r._anchors = {}, M = r.roworder === "top to bottom"; for (var L in g) { var F = L.charAt(0), $ = r[F + "side"], I, O, G; if ($.length < 8) S[L] = "free"; else if (F === "x") { if ($.charAt(0) === "t" === M ? (I = 0, O = 1, G = o) : (I = o - 1, O = -1, G = -1), i) { var K = g[L]; for (u = I; u !== G; u += O) if (p = v[u][K], !!p && (m = p.indexOf("y"), p.slice(0, m) === L)) { S[L] = p.slice(m); break; } } else for (u = I; u !== G; u += O) if (h = r.yaxes[u], a.cartesian.indexOf(L + h) !== -1) { S[L] = h; break; } } else if ($.charAt(0) === "l" ? (I = 0, O = 1, G = l) : (I = l - 1, O = -1, G = -1), i) { var V = g[L]; for (u = I; u !== G; u += O) if (p = v[V][u], !!p && (m = p.indexOf("y"), p.slice(m) === L)) { S[L] = p.slice(0, m); break; } } else for (u = I; u !== G; u += O) if (d = r.xaxes[u], a.cartesian.indexOf(d + L) !== -1) { S[L] = d; break; } } } } function lS(e10, t, r, n, a) { var i = new Array(r), o; function l(s, u) { t.indexOf(u) !== -1 && n[u] === void 0 ? (i[s] = u, n[u] = s) : i[s] = ""; } if (Array.isArray(e10)) for (o = 0; o < r; o++) l(o, e10[o]); else for (l(0, a), o = 1; o < r; o++) l(o, a + (o + 1)); return i; } var Aoe = { moduleType: "component", name: "grid", schema: { layout: { grid: r1 } }, layoutAttributes: r1, sizeDefaults: Toe, contentDefaults: koe }; var V6 = { visible: { valType: "boolean", editType: "calc", description: [ "Determines whether or not this set of error bars is visible." ].join(" ") }, type: { valType: "enumerated", values: ["percent", "constant", "sqrt", "data"], editType: "calc", description: [ "Determines the rule used to generate the error bars.", "If *constant`, the bar lengths are of a constant value.", "Set this constant in `value`.", "If *percent*, the bar lengths correspond to a percentage of", "underlying data. Set this percentage in `value`.", "If *sqrt*, the bar lengths correspond to the square of the", "underlying data.", "If *data*, the bar lengths are set with data set `array`." ].join(" ") }, symmetric: { valType: "boolean", editType: "calc", description: [ "Determines whether or not the error bars have the same length", "in both direction", "(top/bottom for vertical bars, left/right for horizontal bars." ].join(" ") }, array: { valType: "data_array", editType: "calc", description: [ "Sets the data corresponding the length of each error bar.", "Values are plotted relative to the underlying data." ].join(" ") }, arrayminus: { valType: "data_array", editType: "calc", description: [ "Sets the data corresponding the length of each error bar in the", "bottom (left) direction for vertical (horizontal) bars", "Values are plotted relative to the underlying data." ].join(" ") }, value: { valType: "number", min: 0, dflt: 10, editType: "calc", description: [ "Sets the value of either the percentage", "(if `type` is set to *percent*) or the constant", "(if `type` is set to *constant*) corresponding to the lengths of", "the error bars." ].join(" ") }, valueminus: { valType: "number", min: 0, dflt: 10, editType: "calc", description: [ "Sets the value of either the percentage", "(if `type` is set to *percent*) or the constant", "(if `type` is set to *constant*) corresponding to the lengths of", "the error bars in the", "bottom (left) direction for vertical (horizontal) bars" ].join(" ") }, traceref: { valType: "integer", min: 0, dflt: 0, editType: "style" }, tracerefminus: { valType: "integer", min: 0, dflt: 0, editType: "style" }, copy_ystyle: { valType: "boolean", editType: "plot" }, copy_zstyle: { valType: "boolean", editType: "style" }, color: { valType: "color", editType: "style", description: "Sets the stoke color of the error bars." }, thickness: { valType: "number", min: 0, dflt: 2, editType: "style", description: "Sets the thickness (in px) of the error bars." }, width: { valType: "number", min: 0, editType: "plot", description: [ "Sets the width (in px) of the cross-bar at both ends", "of the error bars." ].join(" ") }, editType: "calc", _deprecated: { opacity: { valType: "number", editType: "style", description: [ "Obsolete.", "Use the alpha channel in error bar `color` to set the opacity." ].join(" ") } } }; var _0; var sS; function Moe() { if (sS) return _0; sS = 1; var e10 = sr, t = Nt, r = Ue, n = Mr, a = V6; return _0 = function(i, o, l, s) { var u = "error_" + s.axis, f = n.newContainer(o, u), d = i[u] || {}; function h(k, x) { return r.coerce(d, f, a, k, x); } var p = d.array !== void 0 || d.value !== void 0 || d.type === "sqrt", v = h("visible", p); if (v !== false) { var m = h("type", "array" in d ? "data" : "percent"), g = true; m !== "sqrt" && (g = h( "symmetric", !((m === "data" ? "arrayminus" : "valueminus") in d) )), m === "data" ? (h("array"), h("traceref"), g || (h("arrayminus"), h("tracerefminus"))) : (m === "percent" || m === "constant") && (h("value"), g || h("valueminus")); var y = "copy_" + s.inherit + "style"; if (s.inherit) { var w = o["error_" + s.inherit]; (w || {}).visible && h(y, !(d.color || e10(d.thickness) || e10(d.width))); } (!s.inherit || !f[y]) && (h("color", l), h("thickness"), h("width", t.traceIs(o, "gl3d") ? 0 : 4)); } }, _0; } var x0; var uS; function q6() { if (uS) return x0; uS = 1, x0 = function(r) { var n = r.type, a = r.symmetric; if (n === "data") { var i = r.array || []; if (a) return function(f, d) { var h = +i[d]; return [h, h]; }; var o = r.arrayminus || []; return function(f, d) { var h = +i[d], p = +o[d]; return !isNaN(h) || !isNaN(p) ? [p || 0, h || 0] : [NaN, NaN]; }; } else { var l = e10(n, r.value), s = e10(n, r.valueminus); return a || r.valueminus === void 0 ? function(f) { var d = l(f); return [d, d]; } : function(f) { return [ s(f), l(f) ]; }; } }; function e10(t, r) { if (t === "percent") return function(n) { return Math.abs(n * r / 100); }; if (t === "constant") return function() { return Math.abs(r); }; if (t === "sqrt") return function(n) { return Math.sqrt(Math.abs(n)); }; } return x0; } var w0; var fS; function Soe() { if (fS) return w0; fS = 1; var e10 = sr, t = Nt, r = Cr, n = Ue, a = q6(); w0 = function(l) { for (var s = l.calcdata, u = 0; u < s.length; u++) { var f = s[u], d = f[0].trace; if (d.visible === true && t.traceIs(d, "errorBarsOK")) { var h = r.getFromId(l, d.xaxis), p = r.getFromId(l, d.yaxis); i(f, d, h, "x"), i(f, d, p, "y"); } } }; function i(o, l, s, u) { var f = l["error_" + u] || {}, d = f.visible && ["linear", "log"].indexOf(s.type) !== -1, h = []; if (d) { for (var p = a(f), v = 0; v < o.length; v++) { var m = o[v], g = m.i; if (g === void 0) g = v; else if (g === null) continue; var y = m[u]; if (e10(s.c2l(y))) { var w = p(y, g); if (e10(w[0]) && e10(w[1])) { var k = m[u + "s"] = y - w[0], x = m[u + "h"] = y + w[1]; h.push(k, x); } } } var _ = s._id, T = l._extremes[_], S = r.findExtremes( s, h, n.extendFlat({ tozero: T.opts.tozero }, { padded: true }) ); T.min = T.min.concat(S.min), T.max = T.max.concat(S.max); } } return w0; } var T0; var cS; function Coe() { if (cS) return T0; cS = 1; var e10 = lr, t = sr, r = Sr, n = Ya; T0 = function(o, l, s, u) { var f, d = s.xaxis, h = s.yaxis, p = u && u.duration > 0, v = o._context.staticPlot; l.each(function(m) { var g = m[0].trace, y = g.error_x || {}, w = g.error_y || {}, k; g.ids && (k = function(S) { return S.id; }); var x = n.hasMarkers(g) && g.marker.maxdisplayed > 0; !w.visible && !y.visible && (m = []); var _ = e10.select(this).selectAll("g.errorbar").data(m, k); if (_.exit().remove(), !!m.length) { y.visible || _.selectAll("path.xerror").remove(), w.visible || _.selectAll("path.yerror").remove(), _.style("opacity", 1); var T = _.enter().append("g").classed("errorbar", true); p && T.style("opacity", 0).transition().duration(u.duration).style("opacity", 1), r.setClipUrl(_, s.layerClipId, o), _.each(function(S) { var M = e10.select(this), L = a(S, d, h); if (!(x && !S.vis)) { var F, $ = M.select("path.yerror"); if (w.visible && t(L.x) && t(L.yh) && t(L.ys)) { var I = w.width; F = "M" + (L.x - I) + "," + L.yh + "h" + 2 * I + // hat "m-" + I + ",0V" + L.ys, L.noYS || (F += "m-" + I + ",0h" + 2 * I), f = !$.size(), f ? $ = M.append("path").style("vector-effect", v ? "none" : "non-scaling-stroke").classed("yerror", true) : p && ($ = $.transition().duration(u.duration).ease(u.easing)), $.attr("d", F); } else $.remove(); var O = M.select("path.xerror"); if (y.visible && t(L.y) && t(L.xh) && t(L.xs)) { var G = (y.copy_ystyle ? w : y).width; F = "M" + L.xh + "," + (L.y - G) + "v" + 2 * G + // hat "m0,-" + G + "H" + L.xs, L.noXS || (F += "m0,-" + G + "v" + 2 * G), f = !O.size(), f ? O = M.append("path").style("vector-effect", v ? "none" : "non-scaling-stroke").classed("xerror", true) : p && (O = O.transition().duration(u.duration).ease(u.easing)), O.attr("d", F); } else O.remove(); } }); } }); }; function a(i, o, l) { var s = { x: o.c2p(i.x), y: l.c2p(i.y) }; return i.yh !== void 0 && (s.yh = l.c2p(i.yh), s.ys = l.c2p(i.ys), t(s.ys) || (s.noYS = true, s.ys = l.c2p(i.ys, true))), i.xh !== void 0 && (s.xh = o.c2p(i.xh), s.xs = o.c2p(i.xs), t(s.xs) || (s.noXS = true, s.xs = o.c2p(i.xs, true))), s; } return T0; } var k0; var dS; function Loe() { if (dS) return k0; dS = 1; var e10 = lr, t = nr; return k0 = function(n) { n.each(function(a) { var i = a[0].trace, o = i.error_y || {}, l = i.error_x || {}, s = e10.select(this); s.selectAll("path.yerror").style("stroke-width", o.thickness + "px").call(t.stroke, o.color), l.copy_ystyle && (l = o), s.selectAll("path.xerror").style("stroke-width", l.thickness + "px").call(t.stroke, l.color); }); }, k0; } var sc = Ue; var hS = Lo.overrideAll; var uc = V6; var Ul = { error_x: sc.extendFlat({}, uc), error_y: sc.extendFlat({}, uc) }; delete Ul.error_x.copy_zstyle; delete Ul.error_y.copy_zstyle; delete Ul.error_y.copy_ystyle; var id = { error_x: sc.extendFlat({}, uc), error_y: sc.extendFlat({}, uc), error_z: sc.extendFlat({}, uc) }; delete id.error_x.copy_ystyle; delete id.error_y.copy_ystyle; delete id.error_z.copy_ystyle; delete id.error_z.copy_zstyle; var Doe = { moduleType: "component", name: "errorbars", schema: { traces: { scatter: Ul, bar: Ul, histogram: Ul, scatter3d: hS(id, "calc", "nested"), scattergl: hS(Ul, "calc", "nested") } }, supplyDefaults: Moe(), calc: Soe(), makeComputeError: q6(), plot: Coe(), style: Loe(), hoverInfo: Eoe }; function Eoe(e10, t, r) { (t.error_y || {}).visible && (r.yerr = e10.yh - e10.y, t.error_y.symmetric || (r.yerrneg = e10.y - e10.ys)), (t.error_x || {}).visible && (r.xerr = e10.xh - e10.x, t.error_x.symmetric || (r.xerrneg = e10.x - e10.xs)); } var Foe = { cn: { colorbar: "colorbar", cbbg: "cbbg", cbfill: "cbfill", cbfills: "cbfills", cbline: "cbline", cblines: "cblines", cbaxis: "cbaxis", cbtitleunshift: "cbtitleunshift", cbtitle: "cbtitle", cboutline: "cboutline", crisp: "crisp", jsPlaceholder: "js-placeholder" } }; var qo = lr; var A0 = bi; var Yh = Tn; var vS = Nt; var lo = Cr; var xh = Qi; var Ba = Ue; var oi = Ba.strTranslate; var W6 = en.extendFlat; var M0 = xs; var ni = Sr; var S0 = nr; var Roe = Cp; var Poe = Rn; var $oe = wi.flipScale; var zoe = n6; var Ioe = a6; var Noe = Ki; var x_ = On; var pS = x_.LINE_SPACING; var mS = x_.FROM_TL; var gS = x_.FROM_BR; var Hr = Foe.cn; function Ooe(e10) { var t = e10._fullLayout, r = t._infolayer.selectAll("g." + Hr.colorbar).data(Hoe(e10), function(n) { return n._id; }); r.enter().append("g").attr("class", function(n) { return n._id; }).classed(Hr.colorbar, true), r.each(function(n) { var a = qo.select(this); Ba.ensureSingle(a, "rect", Hr.cbbg), Ba.ensureSingle(a, "g", Hr.cbfills), Ba.ensureSingle(a, "g", Hr.cblines), Ba.ensureSingle(a, "g", Hr.cbaxis, function(o) { o.classed(Hr.crisp, true); }), Ba.ensureSingle(a, "g", Hr.cbtitleunshift, function(o) { o.append("g").classed(Hr.cbtitle, true); }), Ba.ensureSingle(a, "rect", Hr.cboutline); var i = Boe(a, n, e10); i && i.then && (e10._promises || []).push(i), e10._context.edits.colorbarPosition && joe(a, n, e10); }), r.exit().each(function(n) { Yh.autoMargin(e10, n._id); }).remove(), r.order(); } function Hoe(e10) { var t = e10._fullLayout, r = e10.calcdata, n = [], a, i, o, l; function s(k) { return W6(k, { // fillcolor can be a d3 scale, domain is z values, range is colors // or leave it out for no fill, // or set to a string constant for single-color fill _fillcolor: null, // line.color has the same options as fillcolor _line: { color: null, width: null, dash: null }, // levels of lines to draw. // note that this DOES NOT determine the extent of the bar // that's given by the domain of fillcolor // (or line.color if no fillcolor domain) _levels: { start: null, end: null, size: null }, // separate fill levels (for example, heatmap coloring of a // contour map) if this is omitted, fillcolors will be // evaluated halfway between levels _filllevels: null, // for continuous colorscales: fill with a gradient instead of explicit levels // value should be the colorscale [[0, c0], [v1, c1], ..., [1, cEnd]] _fillgradient: null, // when using a gradient, we need the data range specified separately _zrange: null }); } function u() { typeof l.calc == "function" ? l.calc(e10, o, a) : (a._fillgradient = i.reversescale ? $oe(i.colorscale) : i.colorscale, a._zrange = [i[l.min], i[l.max]]); } for (var f = 0; f < r.length; f++) { var d = r[f]; if (o = d[0].trace, !!o._module) { var h = o._module.colorbar; if (o.visible === true && h) for (var p = Array.isArray(h), v = p ? h : [h], m = 0; m < v.length; m++) { l = v[m]; var g = l.container; i = g ? o[g] : o, i && i.showscale && (a = s(i.colorbar), a._id = "cb" + o.uid + (p && g ? "-" + g : ""), a._traceIndex = o.index, a._propPrefix = (g ? g + "." : "") + "colorbar.", a._meta = o._meta, u(), n.push(a)); } } } for (var y in t._colorAxes) if (i = t[y], i.showscale) { var w = t._colorAxes[y]; a = s(i.colorbar), a._id = "cb" + y, a._propPrefix = y + ".colorbar.", a._meta = t._meta, l = { min: "cmin", max: "cmax" }, w[0] !== "heatmap" && (o = w[1], l.calc = o._module.colorbar.calc), u(), n.push(a); } return n; } function Boe(e10, t, r) { var n = t.orientation === "v", a = t.len, i = t.lenmode, o = t.thickness, l = t.thicknessmode, s = t.outlinewidth, u = t.borderwidth, f = t.bgcolor, d = t.xanchor, h = t.yanchor, p = t.xpad, v = t.ypad, m = t.x, g = n ? t.y : 1 - t.y, y = t.yref === "paper", w = t.xref === "paper", k = r._fullLayout, x = k._size, _ = t._fillcolor, T = t._line, S = t.title, M = S.side, L = t._zrange || qo.extent((typeof _ == "function" ? _ : T.color).domain()), F = typeof T.color == "function" ? T.color : function() { return T.color; }, $ = typeof _ == "function" ? _ : function() { return _; }, I = t._levels, O = Uoe(r, t, L), G = O.fill, K = O.line, V = Math.round(o * (l === "fraction" ? n ? x.w : x.h : 1)), z = V / (n ? x.w : x.h), P = Math.round(a * (i === "fraction" ? n ? x.h : x.w : 1)), R = P / (n ? x.h : x.w), H = w ? x.w : r._fullLayout.width, B = y ? x.h : r._fullLayout.height, W = Math.round( n ? m * H + p : g * B + v ), ee = { center: 0.5, right: 1 }[d] || 0, re = { top: 1, middle: 0.5 }[h] || 0, ae = n ? m - ee * z : g - re * z, Q = n ? g - re * R : m - ee * R, ue = Math.round( n ? B * (1 - Q) : H * Q ); t._lenFrac = R, t._thickFrac = z, t._uFrac = ae, t._vFrac = Q; var j = t._axis = Goe(r, t, L); j.position = z + (n ? m + p / x.w : g + v / x.h); var U = ["top", "bottom"].indexOf(M) !== -1; if (n && U && (j.title.side = M, j.titlex = m + p / x.w, j.titley = Q + (S.side === "top" ? R - v / x.h : v / x.h)), !n && !U && (j.title.side = M, j.titley = g + v / x.h, j.titlex = Q + p / x.w), T.color && t.tickmode === "auto") { j.tickmode = "linear", j.tick0 = I.start; var Z = I.size, le = Ba.constrain(P / 50, 4, 15) + 1, J = (L[1] - L[0]) / ((t.nticks || le) * Z); if (J > 1) { var pe = Math.pow(10, Math.floor(Math.log(J) / Math.LN10)); Z *= pe * Ba.roundUp(J / pe, [2, 5, 10]), (Math.abs(I.start) / I.size + 1e-6) % 1 < 2e-6 && (j.tick0 = 0); } j.dtick = Z; } j.domain = n ? [ Q + v / x.h, Q + R - v / x.h ] : [ Q + p / x.w, Q + R - p / x.w ], j.setScale(), e10.attr("transform", oi(Math.round(x.l), Math.round(x.t))); var ge = e10.select("." + Hr.cbtitleunshift).attr("transform", oi(-Math.round(x.l), -Math.round(x.t))), ve = j.ticklabelposition, me = j.title.font.size, Le = e10.select("." + Hr.cbaxis), ze, Fe = 0, Oe = 0; function Re(Qe, ot) { var ht = { propContainer: j, propName: t._propPrefix + "title", traceIndex: t._traceIndex, _meta: t._meta, placeholder: k._dfltTitle.colorbar, containerGroup: e10.select("." + Hr.cbtitle) }, vt = Qe.charAt(0) === "h" ? Qe.substr(1) : "h" + Qe; e10.selectAll("." + vt + ",." + vt + "-math-group").remove(), Roe.draw(r, Qe, W6(ht, ot || {})); } function We() { if (n && U || !n && !U) { var Qe, ot; M === "top" && (Qe = p + x.l + H * m, ot = v + x.t + B * (1 - Q - R) + 3 + me * 0.75), M === "bottom" && (Qe = p + x.l + H * m, ot = v + x.t + B * (1 - Q) - 3 - me * 0.25), M === "right" && (ot = v + x.t + B * g + 3 + me * 0.75, Qe = p + x.l + H * Q), Re(j._id + "title", { attributes: { x: Qe, y: ot, "text-anchor": n ? "start" : "middle" } }); } } function Me() { if (n && !U || !n && U) { var Qe = j.position || 0, ot = j._offset + j._length / 2, ht, vt; if (M === "right") vt = ot, ht = x.l + H * Qe + 10 + me * (j.showticklabels ? 1 : 0.5); else if (ht = ot, M === "bottom" && (vt = x.t + B * Qe + 10 + (ve.indexOf("inside") === -1 ? j.tickfont.size : 0) + (j.ticks !== "intside" && t.ticklen || 0)), M === "top") { var nt = S.text.split("
").length; vt = x.t + B * Qe + 10 - V - pS * me * nt; } Re((n ? ( // the 'h' + is a hack to get around the fact that // convertToTspans rotates any 'y...' class by 90 degrees. // TODO: find a better way to control this. "h" ) : "v") + j._id + "title", { avoid: { selection: qo.select(r).selectAll("g." + j._id + "tick"), side: M, offsetTop: n ? 0 : x.t, offsetLeft: n ? x.l : 0, maxShift: n ? k.width : k.height }, attributes: { x: ht, y: vt, "text-anchor": "middle" }, transform: { rotate: n ? -90 : 0, offset: 0 } }); } } function Ve() { if (!n && !U || n && U) { var Qe = e10.select("." + Hr.cbtitle), ot = Qe.select("text"), ht = [-s / 2, s / 2], vt = Qe.select(".h" + j._id + "title-math-group").node(), nt = 15.6; ot.node() && (nt = parseInt(ot.node().style.fontSize, 10) * pS); var ft; if (vt ? (ft = ni.bBox(vt), Oe = ft.width, Fe = ft.height, Fe > nt && (ht[1] -= (Fe - nt) / 2)) : ot.node() && !ot.classed(Hr.jsPlaceholder) && (ft = ni.bBox(ot.node()), Oe = ft.width, Fe = ft.height), n) { if (Fe) { if (Fe += 5, M === "top") j.domain[1] -= Fe / x.h, ht[1] *= -1; else { j.domain[0] += Fe / x.h; var Pe = Poe.lineCount(ot); ht[1] += (1 - Pe) * nt; } Qe.attr("transform", oi(ht[0], ht[1])), j.setScale(); } } else Oe && (M === "right" && (j.domain[0] += (Oe + me / 2) / x.w), Qe.attr("transform", oi(ht[0], ht[1])), j.setScale()); } e10.selectAll("." + Hr.cbfills + ",." + Hr.cblines).attr( "transform", n ? oi(0, Math.round(x.h * (1 - j.domain[1]))) : oi(Math.round(x.w * j.domain[0]), 0) ), Le.attr( "transform", n ? oi(0, Math.round(-x.t)) : oi(Math.round(-x.l), 0) ); var Ie = e10.select("." + Hr.cbfills).selectAll("rect." + Hr.cbfill).attr("style", "").data(G); Ie.enter().append("rect").classed(Hr.cbfill, true).attr("style", ""), Ie.exit().remove(); var Ne = L.map(j.c2p).map(Math.round).sort(function(Tt, gt) { return Tt - gt; }); Ie.each(function(Tt, gt) { var He = [ gt === 0 ? L[0] : (G[gt] + G[gt - 1]) / 2, gt === G.length - 1 ? L[1] : (G[gt] + G[gt + 1]) / 2 ].map(j.c2p).map(Math.round); n && (He[1] = Ba.constrain(He[1] + (He[1] > He[0]) ? 1 : -1, Ne[0], Ne[1])); var pt = qo.select(this).attr(n ? "x" : "y", W).attr(n ? "y" : "x", qo.min(He)).attr(n ? "width" : "height", Math.max(V, 2)).attr(n ? "height" : "width", Math.max(qo.max(He) - qo.min(He), 2)); if (t._fillgradient) ni.gradient(pt, r, t._id, n ? "vertical" : "horizontalreversed", t._fillgradient, "fill"); else { var bt = $(Tt).replace("e-", ""); pt.attr("fill", A0(bt).toHexString()); } }); var tt = e10.select("." + Hr.cblines).selectAll("path." + Hr.cbline).data(T.color && T.width ? K : []); tt.enter().append("path").classed(Hr.cbline, true), tt.exit().remove(), tt.each(function(Tt) { var gt = W, He = Math.round(j.c2p(Tt)) + T.width / 2 % 1; qo.select(this).attr( "d", "M" + (n ? gt + "," + He : He + "," + gt) + (n ? "h" : "v") + V ).call(ni.lineGroupStyle, T.width, F(Tt), T.dash); }), Le.selectAll("g." + j._id + "tick,path").remove(); var Je = W + V + (s || 0) / 2 - (t.ticks === "outside" ? 1 : 0), it = lo.calcTicks(j), at = lo.getTickSigns(j)[2]; return lo.drawTicks(r, j, { vals: j.ticks === "inside" ? lo.clipEnds(j, it) : it, layer: Le, path: lo.makeTickPath(j, Je, at), transFn: lo.makeTransTickFn(j) }), lo.drawLabels(r, j, { vals: it, layer: Le, transFn: lo.makeTransTickLabelFn(j), labelFns: lo.makeLabelFns(j, Je) }); } function qe() { var Qe, ot = V + s / 2; ve.indexOf("inside") === -1 && (Qe = ni.bBox(Le.node()), ot += n ? Qe.width : Qe.height), ze = ge.select("text"); var ht = 0, vt = n && M === "top", nt = !n && M === "right", ft = 0; if (ze.node() && !ze.classed(Hr.jsPlaceholder)) { var Pe, Ie = ge.select(".h" + j._id + "title-math-group").node(); Ie && (n && U || !n && !U) ? (Qe = ni.bBox(Ie), ht = Qe.width, Pe = Qe.height) : (Qe = ni.bBox(ge.node()), ht = Qe.right - x.l - (n ? W : ue), Pe = Qe.bottom - x.t - (n ? ue : W), !n && M === "top" && (ot += Qe.height, ft = Qe.height)), nt && (ze.attr("transform", oi(ht / 2 + me / 2, 0)), ht *= 2), ot = Math.max( ot, n ? ht : Pe ); } var Ne = (n ? p : v) * 2 + ot + u + s / 2, tt = 0; !n && S.text && h === "bottom" && g <= 0 && (tt = Ne / 2, Ne += tt, ft += tt), k._hColorbarMoveTitle = tt, k._hColorbarMoveCBTitle = ft; var Je = u + s, it = (n ? W : ue) - Je / 2 - (n ? p : 0), at = (n ? ue : W) - (n ? P : v + ft - tt); e10.select("." + Hr.cbbg).attr("x", it).attr("y", at).attr(n ? "width" : "height", Math.max(Ne - tt, 2)).attr(n ? "height" : "width", Math.max(P + Je, 2)).call(S0.fill, f).call(S0.stroke, t.bordercolor).style("stroke-width", u); var Tt = nt ? Math.max(ht - 10, 0) : 0; e10.selectAll("." + Hr.cboutline).attr("x", (n ? W : ue + p) + Tt).attr("y", (n ? ue + v - P : W) + (vt ? Fe : 0)).attr(n ? "width" : "height", Math.max(V, 2)).attr(n ? "height" : "width", Math.max(P - (n ? 2 * v + Fe : 2 * p + Tt), 2)).call(S0.stroke, t.outlinecolor).style({ fill: "none", "stroke-width": s }); var gt = n ? ee * Ne : 0, He = n ? 0 : (1 - re) * Ne - ft; if (gt = w ? x.l - gt : -gt, He = y ? x.t - He : -He, e10.attr("transform", oi( gt, He )), !n && (u || A0(f).getAlpha() && !A0.equals(k.paper_bgcolor, f))) { var pt = Le.selectAll("text"), bt = pt[0].length, Ke = e10.select("." + Hr.cbbg).node(), st = ni.bBox(Ke), rt = ni.getTranslate(e10), ct = 2; pt.each(function(oe, Ce) { var Be = 0, Xe = bt - 1; if (Ce === Be || Ce === Xe) { var Et = ni.bBox(this), Pt = ni.getTranslate(this), It; if (Ce === Xe) { var kt = Et.right + Pt.x, qt = st.right + rt.x + ue - u - ct + m; It = qt - kt, It > 0 && (It = 0); } else if (Ce === Be) { var Ot = Et.left + Pt.x, wt = st.left + rt.x + ue + u + ct; It = wt - Ot, It < 0 && (It = 0); } It && (bt < 3 ? this.setAttribute( "transform", "translate(" + It + ",0) " + this.getAttribute("transform") ) : this.setAttribute("visibility", "hidden")); } }); } var X = {}, se = mS[d], ie = gS[d], fe = mS[h], ke = gS[h], _e = Ne - V; n ? (i === "pixels" ? (X.y = g, X.t = P * fe, X.b = P * ke) : (X.t = X.b = 0, X.yt = g + a * fe, X.yb = g - a * ke), l === "pixels" ? (X.x = m, X.l = Ne * se, X.r = Ne * ie) : (X.l = _e * se, X.r = _e * ie, X.xl = m - o * se, X.xr = m + o * ie)) : (i === "pixels" ? (X.x = m, X.l = P * se, X.r = P * ie) : (X.l = X.r = 0, X.xl = m + a * se, X.xr = m - a * ie), l === "pixels" ? (X.y = 1 - g, X.t = Ne * fe, X.b = Ne * ke) : (X.t = _e * fe, X.b = _e * ke, X.yt = g - o * fe, X.yb = g + o * ke)); var Ge = t.y < 0.5 ? "b" : "t", je = t.x < 0.5 ? "l" : "r"; r._fullLayout._reservedMargin[t._id] = {}; var Ee = { r: k.width - it - gt, l: it + X.r, b: k.height - at - He, t: at + X.b }; w && y ? Yh.autoMargin(r, t._id, X) : w ? r._fullLayout._reservedMargin[t._id][Ge] = Ee[Ge] : y || n ? r._fullLayout._reservedMargin[t._id][je] = Ee[je] : r._fullLayout._reservedMargin[t._id][Ge] = Ee[Ge]; } return Ba.syncOrAsync([ Yh.previousPromises, We, Ve, Me, Yh.previousPromises, qe ], r); } function joe(e10, t, r) { var n = t.orientation === "v", a = r._fullLayout, i = a._size, o, l, s; xh.init({ element: e10.node(), gd: r, prepFn: function() { o = e10.attr("transform"), M0(e10); }, moveFn: function(u, f) { e10.attr("transform", o + oi(u, f)), l = xh.align( (n ? t._uFrac : t._vFrac) + u / i.w, n ? t._thickFrac : t._lenFrac, 0, 1, t.xanchor ), s = xh.align( (n ? t._vFrac : 1 - t._uFrac) - f / i.h, n ? t._lenFrac : t._thickFrac, 0, 1, t.yanchor ); var d = xh.getCursor(l, s, t.xanchor, t.yanchor); M0(e10, d); }, doneFn: function() { if (M0(e10), l !== void 0 && s !== void 0) { var u = {}; u[t._propPrefix + "x"] = l, u[t._propPrefix + "y"] = s, t._traceIndex !== void 0 ? vS.call("_guiRestyle", r, u, t._traceIndex) : vS.call("_guiRelayout", r, u); } } }); } function Uoe(e10, t, r) { var n = t._levels, a = [], i = [], o, l, s = n.end + n.size / 100, u = n.size, f = 1.001 * r[0] - 1e-3 * r[1], d = 1.001 * r[1] - 1e-3 * r[0]; for (l = 0; l < 1e5 && (o = n.start + l * u, !(u > 0 ? o >= s : o <= s)); l++) o > f && o < d && a.push(o); if (t._fillgradient) i = [0]; else if (typeof t._fillcolor == "function") { var h = t._filllevels; if (h) for (s = h.end + h.size / 100, u = h.size, l = 0; l < 1e5 && (o = h.start + l * u, !(u > 0 ? o >= s : o <= s)); l++) o > r[0] && o < r[1] && i.push(o); else i = a.map(function(p) { return p - n.size / 2; }), i.push(i[i.length - 1] + n.size); } else t._fillcolor && typeof t._fillcolor == "string" && (i = [0]); return n.size < 0 && (a.reverse(), i.reverse()), { line: a, fill: i }; } function Goe(e10, t, r) { var n = e10._fullLayout, a = t.orientation === "v", i = { type: "linear", range: r, tickmode: t.tickmode, nticks: t.nticks, tick0: t.tick0, dtick: t.dtick, tickvals: t.tickvals, ticktext: t.ticktext, ticks: t.ticks, ticklen: t.ticklen, tickwidth: t.tickwidth, tickcolor: t.tickcolor, showticklabels: t.showticklabels, labelalias: t.labelalias, ticklabelposition: t.ticklabelposition, ticklabeloverflow: t.ticklabeloverflow, ticklabelstep: t.ticklabelstep, tickfont: t.tickfont, tickangle: t.tickangle, tickformat: t.tickformat, exponentformat: t.exponentformat, minexponent: t.minexponent, separatethousands: t.separatethousands, showexponent: t.showexponent, showtickprefix: t.showtickprefix, tickprefix: t.tickprefix, showticksuffix: t.showticksuffix, ticksuffix: t.ticksuffix, title: t.title, showline: true, anchor: "free", side: a ? "right" : "bottom", position: 1 }, o = a ? "y" : "x", l = { type: "linear", _id: o + t._id }, s = { letter: o, font: n.font, noHover: true, noTickson: true, noTicklabelmode: true, noInsideRange: true, calendar: n.calendar // not really necessary (yet?) }; function u(f, d) { return Ba.coerce(i, l, Noe, f, d); } return zoe(i, l, u, s, n), Ioe(i, l, u, s), l; } var Voe = { draw: Ooe }; var qoe = { moduleType: "component", name: "colorbar", attributes: hb, supplyDefaults: x4, draw: Voe.draw, hasColorbar: h4 }; var Woe = { moduleType: "component", name: "legend", layoutAttributes: tD, supplyLayoutDefaults: rD, draw: oD, style: aD }; var Zoe = { moduleType: "locale", name: "en", dictionary: { "Click to enter Colorscale title": "Click to enter Colourscale title" }, format: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], periods: ["AM", "PM"], dateTime: "%a %b %e %X %Y", date: "%d/%m/%Y", time: "%H:%M:%S", decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], year: "%Y", month: "%b %Y", dayMonth: "%b %-d", dayMonthYear: "%b %-d, %Y" } }; var Yoe = { moduleType: "locale", name: "en-US", dictionary: { "Click to enter Colorscale title": "Click to enter Colorscale title" }, format: { date: "%m/%d/%Y" } }; var Xoe = Nt; var Z6 = Ue; var C0 = Z6.extendFlat; var yS = Z6.extendDeep; function bS(e10) { var t; switch (e10) { case "themes__thumb": t = { autosize: true, width: 150, height: 150, title: { text: "" }, showlegend: false, margin: { l: 5, r: 5, t: 5, b: 5, pad: 0 }, annotations: [] }; break; case "thumbnail": t = { title: { text: "" }, hidesources: true, showlegend: false, borderwidth: 0, bordercolor: "", margin: { l: 1, r: 1, t: 1, b: 1, pad: 0 }, annotations: [] }; break; default: t = {}; } return t; } function Koe(e10) { var t = ["xaxis", "yaxis", "zaxis"]; return t.indexOf(e10.slice(0, 5)) > -1; } var Y6 = function(t, r) { var n, a = t.data, i = t.layout, o = yS([], a), l = yS({}, i, bS(r.tileClass)), s = t._context || {}; if (r.width && (l.width = r.width), r.height && (l.height = r.height), r.tileClass === "thumbnail" || r.tileClass === "themes__thumb") { l.annotations = []; var u = Object.keys(l); for (n = 0; n < u.length; n++) Koe(u[n]) && (l[u[n]].title = { text: "" }); for (n = 0; n < o.length; n++) { var f = o[n]; f.showscale = false, f.marker && (f.marker.showscale = false), Xoe.traceIs(f, "pie-like") && (f.textposition = "none"); } } if (Array.isArray(r.annotations)) for (n = 0; n < r.annotations.length; n++) l.annotations.push(r.annotations[n]); var d = Object.keys(l).filter(function(g) { return g.match(/^scene\d*$/); }); if (d.length) { var h = {}; for (r.tileClass === "thumbnail" && (h = { title: { text: "" }, showaxeslabels: false, showticklabels: false, linetickenable: false }), n = 0; n < d.length; n++) { var p = l[d[n]]; p.xaxis || (p.xaxis = {}), p.yaxis || (p.yaxis = {}), p.zaxis || (p.zaxis = {}), C0(p.xaxis, h), C0(p.yaxis, h), C0(p.zaxis, h), p._scene = null; } } var v = document.createElement("div"); r.tileClass && (v.className = r.tileClass); var m = { gd: v, td: v, // for external (image server) compatibility layout: l, data: o, config: { staticPlot: r.staticPlot === void 0 ? true : r.staticPlot, plotGlPixelRatio: r.plotGlPixelRatio === void 0 ? 2 : r.plotGlPixelRatio, displaylogo: r.displaylogo || false, showLink: r.showLink || false, showTips: r.showTips || false, mapboxAccessToken: s.mapboxAccessToken } }; return r.setBackground !== "transparent" && (m.config.setBackground = r.setBackground || "opaque"), m.gd.defaultLayout = bS(r.tileClass), m; }; var Joe = sb.EventEmitter; var Qoe = Nt; var ele = Ue; var _S = jn; var tle = Y6; var rle = n_; var nle = a_; function ale(e10, t) { var r = new Joe(), n = tle(e10, { format: "png" }), a = n.gd; a.style.position = "absolute", a.style.left = "-5000px", document.body.appendChild(a); function i() { var l = _S.getDelay(a._fullLayout); setTimeout(function() { var s = rle(a), u = document.createElement("canvas"); u.id = ele.randstr(), r = nle({ format: t.format, width: a._fullLayout.width, height: a._fullLayout.height, canvas: u, emitter: r, svg: s }), r.clean = function() { a && document.body.removeChild(a); }; }, l); } var o = _S.getRedrawFunc(a); return Qoe.call("_doPlot", a, n.data, n.layout, n.config).then(o).then(i).catch(function(l) { r.emit("error", l); }), r; } var ile = ale; var xS = jn; var ole = { getDelay: xS.getDelay, getRedrawFunc: xS.getRedrawFunc, clone: Y6, toSVG: n_, svgToImg: a_, toImage: ile, downloadImage: LE }; var lle = ole; (function(e10) { e10.version = ap.version; for (var t = Nt, r = e10.register = t.register, n = Or, a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i]; o.charAt(0) !== "_" && (e10[o] = n[o]), r({ moduleType: "apiMethod", name: o, fn: n[o] }); } r(u6), r([ Gne, sae, rd, Aae, Nae, uie, $ie, Vie, yoe, Aoe, Doe, Qc, qoe, Woe, // legend needs to come after shape | legend defaults depends on shapes Ao, // fx needs to come after legend | unified hover defaults depends on legends GD ]), r([ Zoe, Yoe ]), window.PlotlyLocales && Array.isArray(window.PlotlyLocales) && (r(window.PlotlyLocales), delete window.PlotlyLocales), e10.Icons = Fb; var l = Ao, s = Tn; e10.Plots = { resize: s.resize, graphJson: s.graphJson, sendDataToCloud: s.sendDataToCloud }, e10.Fx = { hover: l.hover, unhover: l.unhover, loneHover: l.loneHover, loneUnhover: l.loneUnhover }, e10.Snapshot = lle, e10.PlotSchema = Qu; })(nC); var sle = nC; var Oc = Vc(sle); var ule = u6; var fle = Vc(ule); var X6 = { // padding in pixels around text TEXTPAD: 3, // 'value' and 'label' are not really necessary for bar traces, // but they were made available to `texttemplate` (maybe by accident) // via tokens `%{value}` and `%{label}` starting in 1.50.0, // so let's include them in the event data also. eventDataKeys: ["value", "label"] }; var Zr = ws; var wS = kp.axisHoverFormat; var cle = _i.hovertemplateAttrs; var dle = _i.texttemplateAttrs; var K6 = Jc; var hle = Fn; var TS = X6; var vle = Zi.pattern; var Gl = en.extendFlat; var L0 = hle({ editType: "calc", arrayOk: true, colorEditType: "style", description: "" }); var ple = Zr.marker; var mle = ple.line; var gle = Gl( {}, mle.width, { dflt: 0 } ); var yle = Gl({ width: gle, editType: "calc" }, K6("marker.line")); var ble = Gl({ line: yle, editType: "calc" }, K6("marker"), { opacity: { valType: "number", arrayOk: true, dflt: 1, min: 0, max: 1, editType: "style", description: "Sets the opacity of the bars." }, pattern: vle }); var Qp = { x: Zr.x, x0: Zr.x0, dx: Zr.dx, y: Zr.y, y0: Zr.y0, dy: Zr.dy, xperiod: Zr.xperiod, yperiod: Zr.yperiod, xperiod0: Zr.xperiod0, yperiod0: Zr.yperiod0, xperiodalignment: Zr.xperiodalignment, yperiodalignment: Zr.yperiodalignment, xhoverformat: wS("x"), yhoverformat: wS("y"), text: Zr.text, texttemplate: dle({ editType: "plot" }, { keys: TS.eventDataKeys }), hovertext: Zr.hovertext, hovertemplate: cle({}, { keys: TS.eventDataKeys }), textposition: { valType: "enumerated", values: ["inside", "outside", "auto", "none"], dflt: "auto", arrayOk: true, editType: "calc", description: [ "Specifies the location of the `text`.", "*inside* positions `text` inside, next to the bar end", "(rotated and scaled if needed).", "*outside* positions `text` outside, next to the bar end", "(scaled if needed), unless there is another bar stacked on", "this one, then the text gets pushed inside.", "*auto* tries to position `text` inside the bar, but if", "the bar is too small and no bar is stacked on this one", "the text is moved outside.", "If *none*, no text appears." ].join(" ") }, insidetextanchor: { valType: "enumerated", values: ["end", "middle", "start"], dflt: "end", editType: "plot", description: [ "Determines if texts are kept at center or start/end points in `textposition` *inside* mode." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", editType: "plot", description: [ "Sets the angle of the tick labels with respect to the bar.", "For example, a `tickangle` of -90 draws the tick labels", "vertically. With *auto* the texts may automatically be", "rotated to fit with the maximum size in bars." ].join(" ") }, textfont: Gl({}, L0, { description: "Sets the font used for `text`." }), insidetextfont: Gl({}, L0, { description: "Sets the font used for `text` lying inside the bar." }), outsidetextfont: Gl({}, L0, { description: "Sets the font used for `text` lying outside the bar." }), constraintext: { valType: "enumerated", values: ["inside", "outside", "both", "none"], dflt: "both", editType: "calc", description: [ "Constrain the size of text inside or outside a bar to be no", "larger than the bar itself." ].join(" ") }, cliponaxis: Gl({}, Zr.cliponaxis, { description: [ "Determines whether the text nodes", "are clipped about the subplot axes.", "To show the text nodes above axis lines and tick labels,", "make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*." ].join(" ") }), orientation: { valType: "enumerated", values: ["v", "h"], editType: "calc+clearAxisTypes", description: [ "Sets the orientation of the bars.", "With *v* (*h*), the value of the each bar spans", "along the vertical (horizontal)." ].join(" ") }, base: { valType: "any", dflt: null, arrayOk: true, editType: "calc", description: [ "Sets where the bar base is drawn (in position axis units).", "In *stack* or *relative* barmode,", "traces that set *base* will be excluded", "and drawn in *overlay* mode instead." ].join(" ") }, offset: { valType: "number", dflt: null, arrayOk: true, editType: "calc", description: [ "Shifts the position where the bar is drawn", "(in position axis units).", "In *group* barmode,", "traces that set *offset* will be excluded", "and drawn in *overlay* mode instead." ].join(" ") }, width: { valType: "number", dflt: null, min: 0, arrayOk: true, editType: "calc", description: [ "Sets the bar width (in position axis units)." ].join(" ") }, marker: ble, offsetgroup: Zr.offsetgroup, alignmentgroup: Zr.alignmentgroup, selected: { marker: { opacity: Zr.selected.marker.opacity, color: Zr.selected.marker.color, editType: "style" }, textfont: Zr.selected.textfont, editType: "style" }, unselected: { marker: { opacity: Zr.unselected.marker.opacity, color: Zr.unselected.marker.color, editType: "style" }, textfont: Zr.unselected.textfont, editType: "style" }, _deprecated: { bardir: { valType: "enumerated", editType: "calc", values: ["v", "h"], description: "Renamed to `orientation`." } } }; var J6 = { barmode: { valType: "enumerated", values: ["stack", "group", "overlay", "relative"], dflt: "group", editType: "calc", description: [ "Determines how bars at the same location coordinate", "are displayed on the graph.", "With *stack*, the bars are stacked on top of one another", "With *relative*, the bars are stacked on top of one another,", "with negative values below the axis, positive values above", "With *group*, the bars are plotted next to one another", "centered around the shared location.", "With *overlay*, the bars are plotted over one another,", "you might need to reduce *opacity* to see multiple bars." ].join(" ") }, barnorm: { valType: "enumerated", values: ["", "fraction", "percent"], dflt: "", editType: "calc", description: [ "Sets the normalization for bar traces on the graph.", "With *fraction*, the value of each bar is divided by the sum of all", "values at that location coordinate.", "*percent* is the same but multiplied by 100 to show percentages." ].join(" ") }, bargap: { valType: "number", min: 0, max: 1, editType: "calc", description: [ "Sets the gap (in plot fraction) between bars of", "adjacent location coordinates." ].join(" ") }, bargroupgap: { valType: "number", min: 0, max: 1, dflt: 0, editType: "calc", description: [ "Sets the gap (in plot fraction) between bars of", "the same location coordinate." ].join(" ") } }; var _le = nr; var kS = wi.hasColorscale; var AS = ef; var xle = Ue.coercePattern; var wle = function(t, r, n, a, i) { var o = n("marker.color", a), l = kS(t, "marker"); l && AS( t, r, i, n, { prefix: "marker.", cLetter: "c" } ), n("marker.line.color", _le.defaultLine), kS(t, "marker.line") && AS( t, r, i, n, { prefix: "marker.line.", cLetter: "c" } ), n("marker.line.width"), n("marker.opacity"), xle(n, "marker.pattern", o, l), n("selected.marker.color"), n("unselected.marker.color"); }; var Hu = Ue; var MS = nr; var Tle = Nt; var kle = $E; var Ale = o_; var Mle = wle; var Sle = zE; var Q6 = Qp; var wh = Hu.coerceFont; function Cle(e10, t, r, n) { function a(u, f) { return Hu.coerce(e10, t, Q6, u, f); } var i = kle(e10, t, n, a); if (!i) { t.visible = false; return; } Ale(e10, t, n, a), a("xhoverformat"), a("yhoverformat"), a("orientation", t.x && !t.y ? "h" : "v"), a("base"), a("offset"), a("width"), a("text"), a("hovertext"), a("hovertemplate"); var o = a("textposition"); e82(e10, t, n, a, o, { moduleHasSelected: true, moduleHasUnselected: true, moduleHasConstrain: true, moduleHasCliponaxis: true, moduleHasTextangle: true, moduleHasInsideanchor: true }), Mle(e10, t, a, r, n); var l = (t.marker.line || {}).color, s = Tle.getComponentMethod("errorbars", "supplyDefaults"); s(e10, t, l || MS.defaultLine, { axis: "y" }), s(e10, t, l || MS.defaultLine, { axis: "x", inherit: "y" }), Hu.coerceSelectionMarkerOpacity(t, a); } function Lle(e10, t) { var r, n; function a(o) { return Hu.coerce(n._input, n, Q6, o); } if (t.barmode === "group") for (var i = 0; i < e10.length; i++) n = e10[i], n.type === "bar" && (r = n._input, Sle(r, n, t, a)); } function e82(e10, t, r, n, a, i) { i = i || {}; var o = i.moduleHasSelected !== false, l = i.moduleHasUnselected !== false, s = i.moduleHasConstrain !== false, u = i.moduleHasCliponaxis !== false, f = i.moduleHasTextangle !== false, d = i.moduleHasInsideanchor !== false, h = !!i.hasPathbar, p = Array.isArray(a) || a === "auto", v = p || a === "inside", m = p || a === "outside"; if (v || m) { var g = wh(n, "textfont", r.font), y = Hu.extendFlat({}, g), w = e10.textfont && e10.textfont.color, k = !w; if (k && delete y.color, wh(n, "insidetextfont", y), h) { var x = Hu.extendFlat({}, g); k && delete x.color, wh(n, "pathbar.textfont", x); } m && wh(n, "outsidetextfont", g), o && n("selected.textfont.color"), l && n("unselected.textfont.color"), s && n("constraintext"), u && n("cliponaxis"), f && n("textangle"), n("texttemplate"); } v && d && n("insidetextanchor"); } var SS = { supplyDefaults: Cle, crossTraceDefaults: Lle, handleText: e82 }; var Dle = Nt; var Ele = Cr; var Fle = Ue; var Rle = J6; var Ple = function(e10, t, r) { function n(p, v) { return Fle.coerce(e10, t, Rle, p, v); } for (var a = false, i = false, o = false, l = {}, s = n("barmode"), u = 0; u < r.length; u++) { var f = r[u]; if (Dle.traceIs(f, "bar") && f.visible) a = true; else continue; if (s === "group") { var d = f.xaxis + f.yaxis; l[d] && (o = true), l[d] = true; } if (f.visible && f.type === "histogram") { var h = Ele.getFromId( { _fullLayout: t }, f[f.orientation === "v" ? "xaxis" : "yaxis"] ); h.type !== "category" && (i = true); } } if (!a) { delete t.barmode; return; } s !== "overlay" && n("barnorm"), n("bargap", i && !o ? 0 : 0.2), n("bargroupgap"); }; var Ys = Ue; var w_ = function(t, r) { for (var n = 0; n < t.length; n++) t[n].i = n; Ys.mergeArray(r.text, t, "tx"), Ys.mergeArray(r.hovertext, t, "htx"); var a = r.marker; if (a) { Ys.mergeArray(a.opacity, t, "mo", true), Ys.mergeArray(a.color, t, "mc"); var i = a.line; i && (Ys.mergeArray(i.color, t, "mlc"), Ys.mergeArrayCastPositive(i.width, t, "mlw")); } }; var CS = Cr; var LS = Wp; var DS = wi.hasColorscale; var ES = Mp; var $le = w_; var zle = OE; var Ile = function(t, r) { var n = CS.getFromId(t, r.xaxis || "x"), a = CS.getFromId(t, r.yaxis || "y"), i, o, l, s, u, f, d = { msUTC: !!(r.base || r.base === 0) }; r.orientation === "h" ? (i = n.makeCalcdata(r, "x", d), l = a.makeCalcdata(r, "y"), s = LS(r, a, "y", l), u = !!r.yperiodalignment, f = "y") : (i = a.makeCalcdata(r, "y", d), l = n.makeCalcdata(r, "x"), s = LS(r, n, "x", l), u = !!r.xperiodalignment, f = "x"), o = s.vals; for (var h = Math.min(o.length, i.length), p = new Array(h), v = 0; v < h; v++) p[v] = { p: o[v], s: i[v] }, u && (p[v].orig_p = l[v], p[v][f + "End"] = s.ends[v], p[v][f + "Start"] = s.starts[v]), r.ids && (p[v].id = String(r.ids[v])); return DS(r, "marker") && ES(t, r, { vals: r.marker.color, containerStr: "marker", cLetter: "c" }), DS(r, "marker.line") && ES(t, r, { vals: r.marker.line.color, containerStr: "marker.line", cLetter: "c" }), $le(p, r), zle(p, r), p; }; var Nle = lr; var Ole = Ue; function Hle(e10, t, r) { var n = e10._fullLayout, a = n["_" + r + "Text_minsize"]; if (a) { var i = n.uniformtext.mode === "hide", o; switch (r) { case "funnelarea": case "pie": case "sunburst": o = "g.slice"; break; case "treemap": case "icicle": o = "g.slice, g.pathbar"; break; default: o = "g.points > g.point"; } t.selectAll(o).each(function(l) { var s = l.transform; if (s) { s.scale = i && s.hide ? 0 : a / s.fontSize; var u = Nle.select(this).select("text"); Ole.setTransormAndDisplay(u, s); } }); } } function Ble(e10, t, r) { if (r.uniformtext.mode) { var n = t8(e10), a = r.uniformtext.minsize, i = t.scale * t.fontSize; t.hide = i < a, r[n] = r[n] || 1 / 0, t.hide || (r[n] = Math.min( r[n], Math.max(i, a) )); } } function jle(e10, t) { var r = t8(e10); t[r] = void 0; } function t8(e10) { return "_" + e10 + "Text_minsize"; } var r8 = { recordMinTextSize: Ble, clearMinTextSize: jle, resizeText: Hle }; var Fo = {}; var Ule = sr; var Gle = bi; var n8 = Ue.isArrayOrTypedArray; Fo.coerceString = function(e10, t, r) { if (typeof t == "string") { if (t || !e10.noBlank) return t; } else if ((typeof t == "number" || t === true) && !e10.strict) return String(t); return r !== void 0 ? r : e10.dflt; }; Fo.coerceNumber = function(e10, t, r) { if (Ule(t)) { t = +t; var n = e10.min, a = e10.max, i = n !== void 0 && t < n || a !== void 0 && t > a; if (!i) return t; } return r !== void 0 ? r : e10.dflt; }; Fo.coerceColor = function(e10, t, r) { return Gle(t).isValid() ? t : r !== void 0 ? r : e10.dflt; }; Fo.coerceEnumerated = function(e10, t, r) { return e10.coerceNumber && (t = +t), e10.values.indexOf(t) !== -1 ? t : r !== void 0 ? r : e10.dflt; }; Fo.getValue = function(e10, t) { var r; return n8(e10) ? t < e10.length && (r = e10[t]) : r = e10, r; }; Fo.getLineWidth = function(e10, t) { var r = 0 < t.mlw ? t.mlw : n8(e10.marker.line.width) ? 0 : e10.marker.line.width; return r; }; var fc = lr; var Vle = nr; var Hc = Sr; var a8 = Ue; var i8 = Nt; var o8 = r8.resizeText; var T_ = Qp; var qle = T_.textfont; var Wle = T_.insidetextfont; var Zle = T_.outsidetextfont; var Xs = Fo; function Yle(e10) { var t = fc.select(e10).selectAll("g.barlayer").selectAll("g.trace"); o8(e10, t, "bar"); var r = t.size(), n = e10._fullLayout; t.style("opacity", function(a) { return a[0].trace.opacity; }).each(function(a) { (n.barmode === "stack" && r > 1 || n.bargap === 0 && n.bargroupgap === 0 && !a[0].trace.marker.line.width) && fc.select(this).attr("shape-rendering", "crispEdges"); }), t.selectAll("g.points").each(function(a) { var i = fc.select(this), o = a[0].trace; l8(i, o, e10); }), i8.getComponentMethod("errorbars", "style")(t); } function l8(e10, t, r) { Hc.pointStyle(e10.selectAll("path"), t, r), s8(e10, t, r); } function s8(e10, t, r) { e10.selectAll("text").each(function(n) { var a = fc.select(this), i = a8.ensureUniformFontSize(r, u8(a, n, t, r)); Hc.font(a, i); }); } function Xle(e10, t, r) { var n = t[0].trace; n.selectedpoints ? Kle(r, n, e10) : (l8(r, n, e10), i8.getComponentMethod("errorbars", "style")(r)); } function Kle(e10, t, r) { Hc.selectedPointStyle(e10.selectAll("path"), t), Jle(e10.selectAll("text"), t, r); } function Jle(e10, t, r) { e10.each(function(n) { var a = fc.select(this), i; if (n.selected) { i = a8.ensureUniformFontSize(r, u8(a, n, t, r)); var o = t.selected.textfont && t.selected.textfont.color; o && (i.color = o), Hc.font(a, i); } else Hc.selectedTextStyle(a, t); }); } function u8(e10, t, r, n) { var a = n._fullLayout.font, i = r.textfont; if (e10.classed("bartext-inside")) { var o = h8(t, r); i = c8(r, t.i, a, o); } else e10.classed("bartext-outside") && (i = d8(r, t.i, a)); return i; } function f8(e10, t, r) { return k_( qle, e10.textfont, t, r ); } function c8(e10, t, r, n) { var a = f8(e10, t, r), i = e10._input.textfont === void 0 || e10._input.textfont.color === void 0 || Array.isArray(e10.textfont.color) && e10.textfont.color[t] === void 0; return i && (a = { color: Vle.contrast(n), family: a.family, size: a.size }), k_( Wle, e10.insidetextfont, t, a ); } function d8(e10, t, r) { var n = f8(e10, t, r); return k_( Zle, e10.outsidetextfont, t, n ); } function k_(e10, t, r, n) { t = t || {}; var a = Xs.getValue(t.family, r), i = Xs.getValue(t.size, r), o = Xs.getValue(t.color, r); return { family: Xs.coerceString( e10.family, a, n.family ), size: Xs.coerceNumber( e10.size, i, n.size ), color: Xs.coerceColor( e10.color, o, n.color ) }; } function h8(e10, t) { return t.type === "waterfall" ? t[e10.dir].marker.color : e10.mcc || e10.mc || t.marker.color; } var n1 = { style: Yle, styleTextPoints: s8, styleOnSelect: Xle, getInsideTextFont: c8, getOutsideTextFont: d8, getBarColor: h8, resizeText: o8 }; var Th = lr; var kh = sr; var bn = Ue; var Qle = Rn; var ese = nr; var el = Sr; var tse = Nt; var Iv = Cr.tickText; var v8 = r8; var rse = v8.recordMinTextSize; var nse = v8.clearMinTextSize; var D0 = n1; var Bu = Fo; var ase = X6; var p8 = Qp; var ise = p8.text; var ose = p8.textposition; var lse = Do.appendArrayPointValue; var di = ase.TEXTPAD; function sse(e10) { return e10.id; } function use(e10) { if (e10.ids) return sse; } function al(e10, t) { return e10 < t ? 1 : -1; } function fse(e10, t, r, n) { var a = [], i = [], o = n ? t : r, l = n ? r : t; return a[0] = o.c2p(e10.s0, true), i[0] = l.c2p(e10.p0, true), a[1] = o.c2p(e10.s1, true), i[1] = l.c2p(e10.p1, true), n ? [a, i] : [i, a]; } function m8(e10, t, r, n) { if (!t.uniformtext.mode && g8(r)) { var a; return n && (a = n()), e10.transition().duration(r.duration).ease(r.easing).each("end", function() { a && a(); }).each("interrupt", function() { a && a(); }); } else return e10; } function g8(e10) { return e10 && e10.duration > 0; } function cse(e10, t, r, n, a, i) { var o = t.xaxis, l = t.yaxis, s = e10._fullLayout, u = e10._context.staticPlot; a || (a = { mode: s.barmode, norm: s.barmode, gap: s.bargap, groupgap: s.bargroupgap }, nse("bar", s)); var f = bn.makeTraceGroups(n, r, "trace bars").each(function(d) { var h = Th.select(this), p = d[0].trace, v = p.type === "waterfall", m = p.type === "funnel", g = p.type === "bar", y = g || m, w = 0; v && p.connector.visible && p.connector.mode === "between" && (w = p.connector.line.width / 2); var k = p.orientation === "h", x = g8(a), _ = bn.ensureSingle(h, "g", "points"), T = use(p), S = _.selectAll("g.point").data(bn.identity, T); S.enter().append("g").classed("point", true), S.exit().remove(), S.each(function(L, F) { var $ = Th.select(this), I = fse(L, o, l, k), O = I[0][0], G = I[0][1], K = I[1][0], V = I[1][1], z = (k ? G - O : V - K) === 0; z && y && Bu.getLineWidth(p, L) && (z = false), z || (z = !kh(O) || !kh(G) || !kh(K) || !kh(V)), L.isBlank = z, z && (k ? G = O : V = K), w && !z && (k ? (O -= al(O, G) * w, G += al(O, G) * w) : (K -= al(K, V) * w, V += al(K, V) * w)); var P, R; if (p.type === "waterfall") { if (!z) { var H = p[L.dir].marker; P = H.line.width, R = H.color; } } else P = Bu.getLineWidth(p, L), R = L.mc || p.marker.color; function B(ue) { var j = Th.round(P / 2 % 1, 2); return a.gap === 0 && a.groupgap === 0 ? Th.round(Math.round(ue) - j, 2) : ue; } function W(ue, j, U) { return U && ue === j ? ue : Math.abs(ue - j) >= 2 ? B(ue) : ( // but if it's very thin, expand it so it's // necessarily visible, even if it might overlap // its neighbor ue > j ? Math.ceil(ue) : Math.floor(ue) ); } if (!e10._context.staticPlot) { var ee = ese.opacity(R), re = ee < 1 || P > 0.01 ? B : W; O = re(O, G, k), G = re(G, O, k), K = re(K, V, !k), V = re(V, K, !k); } var ae = m8(bn.ensureSingle($, "path"), s, a, i); if (ae.style("vector-effect", u ? "none" : "non-scaling-stroke").attr("d", isNaN((G - O) * (V - K)) || z && e10._context.staticPlot ? "M0,0Z" : "M" + O + "," + K + "V" + V + "H" + G + "V" + K + "Z").call(el.setClipUrl, t.layerClipId, e10), !s.uniformtext.mode && x) { var Q = el.makePointStyleFns(p); el.singlePointStyle(L, ae, p, Q, e10); } dse(e10, t, $, d, F, O, G, K, V, a, i), t.layerClipId && el.hideOutsideRangePoint(L, $.select("text"), o, l, p.xcalendar, p.ycalendar); }); var M = p.cliponaxis === false; el.setClipUrl(h, M ? null : t.layerClipId, e10); }); tse.getComponentMethod("errorbars", "plot")(e10, f, t, a); } function dse(e10, t, r, n, a, i, o, l, s, u, f) { var d = t.xaxis, h = t.yaxis, p = e10._fullLayout, v; function m(ue, j, U) { var Z = bn.ensureSingle(ue, "text").text(j).attr({ class: "bartext bartext-" + v, "text-anchor": "middle", // prohibit tex interpretation until we can handle // tex and regular text together "data-notex": 1 }).call(el.font, U).call(Qle.convertToTspans, e10); return Z; } var g = n[0].trace, y = g.orientation === "h", w = vse(p, n, a, d, h); v = pse(g, a); var k = u.mode === "stack" || u.mode === "relative", x = n[a], _ = !k || x._outmost; if (!w || v === "none" || (x.isBlank || i === o || l === s) && (v === "auto" || v === "inside")) { r.select("text").remove(); return; } var T = p.font, S = D0.getBarColor(n[a], g), M = D0.getInsideTextFont(g, a, T, S), L = D0.getOutsideTextFont(g, a, T), F = r.datum(); y ? d.type === "log" && F.s0 <= 0 && (d.range[0] < d.range[1] ? i = 0 : i = d._length) : h.type === "log" && F.s0 <= 0 && (h.range[0] < h.range[1] ? l = h._length : l = 0); var $ = Math.abs(o - i) - 2 * di, I = Math.abs(s - l) - 2 * di, O, G, K, V, z; if (v === "outside" && !_ && !x.hasB && (v = "inside"), v === "auto") if (_) { v = "inside", z = bn.ensureUniformFontSize(e10, M), O = m(r, w, z), G = el.bBox(O.node()), K = G.width, V = G.height; var P = K > 0 && V > 0, R = K <= $ && V <= I, H = K <= I && V <= $, B = y ? $ >= K * (I / V) : I >= V * ($ / K); P && (R || H || B) ? v = "inside" : (v = "outside", O.remove(), O = null); } else v = "inside"; if (!O) { z = bn.ensureUniformFontSize(e10, v === "outside" ? L : M), O = m(r, w, z); var W = O.attr("transform"); if (O.attr("transform", ""), G = el.bBox(O.node()), K = G.width, V = G.height, O.attr("transform", W), K <= 0 || V <= 0) { O.remove(); return; } } var ee = g.textangle, re, ae; v === "outside" ? (ae = g.constraintext === "both" || g.constraintext === "outside", re = hse(i, o, l, s, G, { isHorizontal: y, constrained: ae, angle: ee })) : (ae = g.constraintext === "both" || g.constraintext === "inside", re = _8(i, o, l, s, G, { isHorizontal: y, constrained: ae, angle: ee, anchor: g.insidetextanchor })), re.fontSize = z.size, rse(g.type === "histogram" ? "bar" : g.type, re, p), x.transform = re; var Q = m8(O, p, u, f); bn.setTransormAndDisplay(Q, re); } function y8(e10) { return e10 === "auto" ? 0 : e10; } function b8(e10, t) { var r = Math.PI / 180 * t, n = Math.abs(Math.sin(r)), a = Math.abs(Math.cos(r)); return { x: e10.width * a + e10.height * n, y: e10.width * n + e10.height * a }; } function _8(e10, t, r, n, a, i) { var o = !!i.isHorizontal, l = !!i.constrained, s = i.angle || 0, u = i.anchor || "end", f = u === "end", d = u === "start", h = i.leftToRight || 0, p = (h + 1) / 2, v = 1 - p, m = a.width, g = a.height, y = Math.abs(t - e10), w = Math.abs(n - r), k = y > 2 * di && w > 2 * di ? di : 0; y -= 2 * k, w -= 2 * k; var x = y8(s); s === "auto" && !(m <= y && g <= w) && (m > y || g > w) && (!(m > w || g > y) || m < g != y < w) && (x += 90); var _ = b8(a, x), T = 1; l && (T = Math.min( 1, y / _.x, w / _.y )); var S = a.left * v + a.right * p, M = (a.top + a.bottom) / 2, L = (e10 + di) * v + (t - di) * p, F = (r + n) / 2, $ = 0, I = 0; if (d || f) { var O = (o ? _.x : _.y) / 2, G = o ? al(e10, t) : al(r, n); o ? d ? (L = e10 + G * k, $ = -G * O) : (L = t - G * k, $ = G * O) : d ? (F = r + G * k, I = -G * O) : (F = n - G * k, I = G * O); } return { textX: S, textY: M, targetX: L, targetY: F, anchorX: $, anchorY: I, scale: T, rotate: x }; } function hse(e10, t, r, n, a, i) { var o = !!i.isHorizontal, l = !!i.constrained, s = i.angle || 0, u = a.width, f = a.height, d = Math.abs(t - e10), h = Math.abs(n - r), p; o ? p = h > 2 * di ? di : 0 : p = d > 2 * di ? di : 0; var v = 1; l && (v = o ? Math.min(1, h / f) : Math.min(1, d / u)); var m = y8(s), g = b8(a, m), y = (o ? g.x : g.y) / 2, w = (a.left + a.right) / 2, k = (a.top + a.bottom) / 2, x = (e10 + t) / 2, _ = (r + n) / 2, T = 0, S = 0, M = o ? al(t, e10) : al(r, n); return o ? (x = t - M * p, T = M * y) : (_ = n + M * p, S = -M * y), { textX: w, textY: k, targetX: x, targetY: _, anchorX: T, anchorY: S, scale: v, rotate: m }; } function vse(e10, t, r, n, a) { var i = t[0].trace, o = i.texttemplate, l; return o ? l = mse(e10, t, r, n, a) : i.textinfo ? l = gse(t, r, n, a) : l = Bu.getValue(i.text, r), Bu.coerceString(ise, l); } function pse(e10, t) { var r = Bu.getValue(e10.textposition, t); return Bu.coerceEnumerated(ose, r); } function mse(e10, t, r, n, a) { var i = t[0].trace, o = bn.castOption(i, r, "texttemplate"); if (!o) return ""; var l = i.type === "histogram", s = i.type === "waterfall", u = i.type === "funnel", f = i.orientation === "h", d, h, p, v; f ? (d = "y", h = a, p = "x", v = n) : (d = "x", h = n, p = "y", v = a); function m(T) { return Iv(h, h.c2l(T), true).text; } function g(T) { return Iv(v, v.c2l(T), true).text; } var y = t[r], w = {}; w.label = y.p, w.labelLabel = w[d + "Label"] = m(y.p); var k = bn.castOption(i, y.i, "text"); (k === 0 || k) && (w.text = k), w.value = y.s, w.valueLabel = w[p + "Label"] = g(y.s); var x = {}; lse(x, i, y.i), (l || x.x === void 0) && (x.x = f ? w.value : w.label), (l || x.y === void 0) && (x.y = f ? w.label : w.value), (l || x.xLabel === void 0) && (x.xLabel = f ? w.valueLabel : w.labelLabel), (l || x.yLabel === void 0) && (x.yLabel = f ? w.labelLabel : w.valueLabel), s && (w.delta = +y.rawS || y.s, w.deltaLabel = g(w.delta), w.final = y.v, w.finalLabel = g(w.final), w.initial = w.final - w.delta, w.initialLabel = g(w.initial)), u && (w.value = y.s, w.valueLabel = g(w.value), w.percentInitial = y.begR, w.percentInitialLabel = bn.formatPercent(y.begR), w.percentPrevious = y.difR, w.percentPreviousLabel = bn.formatPercent(y.difR), w.percentTotal = y.sumR, w.percenTotalLabel = bn.formatPercent(y.sumR)); var _ = bn.castOption(i, y.i, "customdata"); return _ && (w.customdata = _), bn.texttemplateString(o, w, e10._d3locale, x, w, i._meta || {}); } function gse(e10, t, r, n) { var a = e10[0].trace, i = a.orientation === "h", o = a.type === "waterfall", l = a.type === "funnel"; function s(_) { var T = i ? n : r; return Iv(T, _, true).text; } function u(_) { var T = i ? r : n; return Iv(T, +_, true).text; } var f = a.textinfo, d = e10[t], h = f.split("+"), p = [], v, m = function(_) { return h.indexOf(_) !== -1; }; if (m("label") && p.push(s(e10[t].p)), m("text") && (v = bn.castOption(a, d.i, "text"), (v === 0 || v) && p.push(v)), o) { var g = +d.rawS || d.s, y = d.v, w = y - g; m("initial") && p.push(u(w)), m("delta") && p.push(u(g)), m("final") && p.push(u(y)); } if (l) { m("value") && p.push(u(d.s)); var k = 0; m("percent initial") && k++, m("percent previous") && k++, m("percent total") && k++; var x = k > 1; m("percent initial") && (v = bn.formatPercent(d.begR), x && (v += " of initial"), p.push(v)), m("percent previous") && (v = bn.formatPercent(d.difR), x && (v += " of previous"), p.push(v)), m("percent total") && (v = bn.formatPercent(d.sumR), x && (v += " of total"), p.push(v)); } return p.join("
"); } var yse = { plot: cse, toMoveInsideBar: _8 }; var Vf = Ao; var bse = Nt; var FS = nr; var _se = Ue.fillText; var xse = Fo.getLineWidth; var E0 = Cr.hoverLabelText; var wse = Qr.BADNUM; function Tse(e10, t, r, n, a) { var i = x8(e10, t, r, n, a); if (i) { var o = i.cd, l = o[0].trace, s = o[i.index]; return i.color = w8(l, s), bse.getComponentMethod("errorbars", "hoverInfo")(s, l, i), [i]; } } function x8(e10, t, r, n, a) { var i = e10.cd, o = i[0].trace, l = i[0].t, s = n === "closest", u = o.type === "waterfall", f = e10.maxHoverDistance, d = e10.maxSpikeDistance, h, p, v, m, g, y, w; o.orientation === "h" ? (h = r, p = t, v = "y", m = "x", g = K, y = I) : (h = t, p = r, v = "x", m = "y", y = K, g = I); var k = o[v + "period"], x = s || k; function _(Q) { return S(Q, -1); } function T(Q) { return S(Q, 1); } function S(Q, ue) { var j = Q.w; return Q[v] + ue * j / 2; } function M(Q) { return Q[v + "End"] - Q[v + "Start"]; } var L = s ? _ : k ? function(Q) { return Q.p - M(Q) / 2; } : function(Q) { return Math.min(_(Q), Q.p - l.bardelta / 2); }, F = s ? T : k ? function(Q) { return Q.p + M(Q) / 2; } : function(Q) { return Math.max(T(Q), Q.p + l.bardelta / 2); }; function $(Q, ue, j) { return a.finiteRange && (j = 0), Vf.inbox( Q - h, ue - h, j + Math.min(1, Math.abs(ue - Q) / w) - 1 ); } function I(Q) { return $(L(Q), F(Q), f); } function O(Q) { return $(_(Q), T(Q), d); } function G(Q) { var ue = Q[m]; if (u) { var j = Math.abs(Q.rawS) || 0; p > 0 ? ue += j : p < 0 && (ue -= j); } return ue; } function K(Q) { var ue = p, j = Q.b, U = G(Q); return Vf.inbox(j - ue, U - ue, f + (U - ue) / (U - j) - 1); } function V(Q) { var ue = p, j = Q.b, U = G(Q); return Vf.inbox(j - ue, U - ue, d + (U - ue) / (U - j) - 1); } var z = e10[v + "a"], P = e10[m + "a"]; w = Math.abs(z.r2c(z.range[1]) - z.r2c(z.range[0])); function R(Q) { return (g(Q) + y(Q)) / 2; } var H = Vf.getDistanceFunction(n, g, y, R); if (Vf.getClosest(i, H, e10), e10.index !== false && i[e10.index].p !== wse) { x || (L = function(Q) { return Math.min(_(Q), Q.p - l.bargroupwidth / 2); }, F = function(Q) { return Math.max(T(Q), Q.p + l.bargroupwidth / 2); }); var B = e10.index, W = i[B], ee = o.base ? W.b + W.s : W.s; e10[m + "0"] = e10[m + "1"] = P.c2p(W[m], true), e10[m + "LabelVal"] = ee; var re = l.extents[l.extents.round(W.p)]; e10[v + "0"] = z.c2p(s ? L(W) : re[0], true), e10[v + "1"] = z.c2p(s ? F(W) : re[1], true); var ae = W.orig_p !== void 0; return e10[v + "LabelVal"] = ae ? W.orig_p : W.p, e10.labelLabel = E0(z, e10[v + "LabelVal"], o[v + "hoverformat"]), e10.valueLabel = E0(P, e10[m + "LabelVal"], o[m + "hoverformat"]), e10.baseLabel = E0(P, W.b, o[m + "hoverformat"]), e10.spikeDistance = (V(W) + O(W)) / 2, e10[v + "Spike"] = z.c2p(W.p, true), _se(W, o, e10), e10.hovertemplate = o.hovertemplate, e10; } } function w8(e10, t) { var r = t.mcc || e10.marker.color, n = t.mlcc || e10.marker.line.color, a = xse(e10, t); if (FS.opacity(r)) return r; if (FS.opacity(n) && a) return n; } var kse = { hoverPoints: Tse, hoverOnBars: x8, getTraceColor: w8 }; var Ase = function(t, r, n) { return t.x = "xVal" in r ? r.xVal : r.x, t.y = "yVal" in r ? r.yVal : r.y, r.xa && (t.xaxis = r.xa), r.ya && (t.yaxis = r.ya), n.orientation === "h" ? (t.label = t.y, t.value = t.x) : (t.label = t.x, t.value = t.y), t; }; var Mse = function(t, r) { var n = t.cd, a = t.xaxis, i = t.yaxis, o = n[0].trace, l = o.type === "funnel", s = o.orientation === "h", u = [], f; if (r === false) for (f = 0; f < n.length; f++) n[f].selected = 0; else for (f = 0; f < n.length; f++) { var d = n[f], h = "ct" in d ? d.ct : Sse(d, a, i, s, l); r.contains(h, false, f, t) ? (u.push({ pointNumber: f, x: a.c2d(d.x), y: i.c2d(d.y) }), d.selected = 1) : d.selected = 0; } return u; }; function Sse(e10, t, r, n, a) { var i = t.c2p(n ? e10.s0 : e10.p0, true), o = t.c2p(n ? e10.s1 : e10.p1, true), l = r.c2p(n ? e10.p0 : e10.s0, true), s = r.c2p(n ? e10.p1 : e10.s1, true); return a ? [(i + o) / 2, (l + s) / 2] : n ? [o, (l + s) / 2] : [(i + o) / 2, s]; } var Cse = { attributes: Qp, layoutAttributes: J6, supplyDefaults: SS.supplyDefaults, crossTraceDefaults: SS.crossTraceDefaults, supplyLayoutDefaults: Ple, calc: Ile, crossTraceCalc: KE.crossTraceCalc, colorbar: t6, arraysToCalcdata: w_, plot: yse.plot, style: n1.style, styleOnSelect: n1.styleOnSelect, hoverPoints: kse.hoverPoints, eventData: Ase, selectPoints: Mse, moduleType: "trace", name: "bar", basePlotModule: yn, categories: ["bar-like", "cartesian", "svg", "bar", "oriented", "errorBarsOK", "showLegend", "zoomScale"], animatable: true, meta: { description: [ "The data visualized by the span of the bars is set in `y`", "if `orientation` is set to *v* (the default)", "and the labels are set in `x`.", "By setting `orientation` to *h*, the roles are interchanged." ].join(" ") } }; var Lse = Cse; var Dse = Vc(Lse); var Fa = ws; var Ese = Wi; var Fse = Fn; var F0 = kp.axisHoverFormat; var Rse = _i.hovertemplateAttrs; var Pse = _i.texttemplateAttrs; var $se = Jc; var ta = en.extendFlat; var T8 = ta( { z: { valType: "data_array", editType: "calc", description: "Sets the z data." }, x: ta({}, Fa.x, { impliedEdits: { xtype: "array" } }), x0: ta({}, Fa.x0, { impliedEdits: { xtype: "scaled" } }), dx: ta({}, Fa.dx, { impliedEdits: { xtype: "scaled" } }), y: ta({}, Fa.y, { impliedEdits: { ytype: "array" } }), y0: ta({}, Fa.y0, { impliedEdits: { ytype: "scaled" } }), dy: ta({}, Fa.dy, { impliedEdits: { ytype: "scaled" } }), xperiod: ta({}, Fa.xperiod, { impliedEdits: { xtype: "scaled" } }), yperiod: ta({}, Fa.yperiod, { impliedEdits: { ytype: "scaled" } }), xperiod0: ta({}, Fa.xperiod0, { impliedEdits: { xtype: "scaled" } }), yperiod0: ta({}, Fa.yperiod0, { impliedEdits: { ytype: "scaled" } }), xperiodalignment: ta({}, Fa.xperiodalignment, { impliedEdits: { xtype: "scaled" } }), yperiodalignment: ta({}, Fa.yperiodalignment, { impliedEdits: { ytype: "scaled" } }), text: { valType: "data_array", editType: "calc", description: "Sets the text elements associated with each z value." }, hovertext: { valType: "data_array", editType: "calc", description: "Same as `text`." }, transpose: { valType: "boolean", dflt: false, editType: "calc", description: "Transposes the z data." }, xtype: { valType: "enumerated", values: ["array", "scaled"], editType: "calc+clearAxisTypes", description: [ "If *array*, the heatmap's x coordinates are given by *x*", "(the default behavior when `x` is provided).", "If *scaled*, the heatmap's x coordinates are given by *x0* and *dx*", "(the default behavior when `x` is not provided)." ].join(" ") }, ytype: { valType: "enumerated", values: ["array", "scaled"], editType: "calc+clearAxisTypes", description: [ "If *array*, the heatmap's y coordinates are given by *y*", "(the default behavior when `y` is provided)", "If *scaled*, the heatmap's y coordinates are given by *y0* and *dy*", "(the default behavior when `y` is not provided)" ].join(" ") }, zsmooth: { valType: "enumerated", values: ["fast", "best", false], dflt: false, editType: "calc", description: [ "Picks a smoothing algorithm use to smooth `z` data." ].join(" ") }, hoverongaps: { valType: "boolean", dflt: true, editType: "none", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the `z` data have hover labels associated with them." ].join(" ") }, connectgaps: { valType: "boolean", editType: "calc", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the `z` data are filled in.", "It is defaulted to true if `z` is a", "one dimensional array and `zsmooth` is not false;", "otherwise it is defaulted to false." ].join(" ") }, xgap: { valType: "number", dflt: 0, min: 0, editType: "plot", description: "Sets the horizontal gap (in pixels) between bricks." }, ygap: { valType: "number", dflt: 0, min: 0, editType: "plot", description: "Sets the vertical gap (in pixels) between bricks." }, xhoverformat: F0("x"), yhoverformat: F0("y"), zhoverformat: F0("z", 1), hovertemplate: Rse(), texttemplate: Pse({ arrayOk: false, editType: "plot" }, { keys: ["x", "y", "z", "text"] }), textfont: Fse({ editType: "plot", autoSize: true, autoColor: true, colorEditType: "style", description: "Sets the text font." }), showlegend: ta({}, Ese.showlegend, { dflt: false }) }, { transforms: void 0 }, $se("", { cLetter: "z", autoColorDflt: false }) ); var zse = sr; var Xh = Ue; var Ise = Nt; var Nse = function(t, r, n, a, i, o) { var l = n("z"); i = i || "x", o = o || "y"; var s, u; if (l === void 0 || !l.length) return 0; if (Xh.isArray1D(l)) { s = n(i), u = n(o); var f = Xh.minRowLength(s), d = Xh.minRowLength(u); if (f === 0 || d === 0) return 0; r._length = Math.min(f, d, l.length); } else { if (s = RS(i, n), u = RS(o, n), !Ose(l)) return 0; n("transpose"), r._length = null; } if (t.type === "heatmapgl") return true; var h = Ise.getComponentMethod("calendars", "handleTraceDefaults"); return h(t, r, [i, o], a), true; }; function RS(e10, t) { var r = t(e10), n = r ? t(e10 + "type", "array") : "scaled"; return n === "scaled" && (t(e10 + "0"), t("d" + e10)), r; } function Ose(e10) { for (var t = true, r = false, n = false, a, i = 0; i < e10.length; i++) { if (a = e10[i], !Xh.isArrayOrTypedArray(a)) { t = false; break; } a.length > 0 && (r = true); for (var o = 0; o < a.length; o++) if (zse(a[o])) { n = true; break; } } return t && r && n; } var PS = Ue; var Hse = function(t, r) { t("texttemplate"); var n = PS.extendFlat({}, r.font, { color: "auto", size: "auto" }); PS.coerceFont(t, "textfont", n); }; var Bse = function(t, r, n) { var a = n("zsmooth"); a === false && (n("xgap"), n("ygap")), n("zhoverformat"); }; var $S = Ue; var jse = Nse; var Use = Hse; var Gse = o_; var Vse = Bse; var qse = ef; var Wse = T8; var Zse = function(t, r, n, a) { function i(l, s) { return $S.coerce(t, r, Wse, l, s); } var o = jse(t, r, i, a); if (!o) { r.visible = false; return; } Gse(t, r, a, i), i("xhoverformat"), i("yhoverformat"), i("text"), i("hovertext"), i("hovertemplate"), Use(i, a), Vse(t, r, i), i("hoverongaps"), i("connectgaps", $S.isArray1D(r.z) && r.zsmooth !== false), qse(t, r, a, i, { prefix: "", cLetter: "z" }); }; var Ks = sr; var k8 = { count: function(e10, t, r) { return r[e10]++, 1; }, sum: function(e10, t, r, n) { var a = n[t]; return Ks(a) ? (a = Number(a), r[e10] += a, a) : 0; }, avg: function(e10, t, r, n, a) { var i = n[t]; return Ks(i) && (i = Number(i), r[e10] += i, a[e10]++), 0; }, min: function(e10, t, r, n) { var a = n[t]; if (Ks(a)) if (a = Number(a), Ks(r[e10])) { if (r[e10] > a) { var i = a - r[e10]; return r[e10] = a, i; } } else return r[e10] = a, a; return 0; }, max: function(e10, t, r, n) { var a = n[t]; if (Ks(a)) if (a = Number(a), Ks(r[e10])) { if (r[e10] < a) { var i = a - r[e10]; return r[e10] = a, i; } } else return r[e10] = a, a; return 0; } }; var A8 = { percent: function(e10, t) { for (var r = e10.length, n = 100 / t, a = 0; a < r; a++) e10[a] *= n; }, probability: function(e10, t) { for (var r = e10.length, n = 0; n < r; n++) e10[n] /= t; }, density: function(e10, t, r, n) { var a = e10.length; n = n || 1; for (var i = 0; i < a; i++) e10[i] *= r[i] * n; }, "probability density": function(e10, t, r, n) { var a = e10.length; n && (t /= n); for (var i = 0; i < a; i++) e10[i] *= r[i] / t; } }; var M8 = function(t, r) { for (var n = t.length, a = 0, i = 0; i < n; i++) r[i] ? (t[i] /= r[i], a += t[i]) : t[i] = null; return a; }; var af = Qr; var es = af.ONEAVGYEAR; var zS = af.ONEAVGMONTH; var Nv = af.ONEDAY; var IS = af.ONEHOUR; var NS = af.ONEMIN; var OS = af.ONESEC; var HS = Cr.tickIncrement; var S8 = function(t, r, n, a, i) { var o = -1.1 * r, l = -0.1 * r, s = t - l, u = n[0], f = n[1], d = Math.min( Ah(u + l, u + s, a, i), Ah(f + l, f + s, a, i) ), h = Math.min( Ah(u + o, u + l, a, i), Ah(f + o, f + l, a, i) ), p, v; if (d > h && h < Math.abs(f - u) / 4e3 ? (p = d, v = false) : (p = Math.min(d, h), v = true), a.type === "date" && p > Nv) { var m = p === es ? 1 : 6, g = p === es ? "M12" : "M1"; return function(y, w) { var k = a.c2d(y, es, i), x = k.indexOf("-", m); x > 0 && (k = k.substr(0, x)); var _ = a.d2c(k, 0, i); if (_ < y) { var T = HS(_, g, false, i); (_ + T) / 2 < y + t && (_ = T); } return w && v ? HS(_, g, true, i) : _; }; } return function(y, w) { var k = p * Math.round(y / p); return k + p / 10 < y && k + p * 0.9 < y + t && (k += p), w && v && (k -= p), k; }; }; function Ah(e10, t, r, n) { if (e10 * t <= 0) return 1 / 0; for (var a = Math.abs(t - e10), i = r.type === "date", o = BS(a, i), l = 0; l < 10; l++) { var s = BS(o * 80, i); if (o === s) break; if (Yse(s, e10, t, i, r, n)) o = s; else break; } return o; } function BS(e10, t) { return t && e10 > OS ? e10 > Nv ? e10 > es * 1.1 ? es : e10 > zS * 1.1 ? zS : Nv : e10 > IS ? IS : e10 > NS ? NS : OS : Math.pow(10, Math.floor(Math.log(e10) / Math.LN10)); } function Yse(e10, t, r, n, a, i) { if (n && e10 > Nv) { var o = jS(t, a, i), l = jS(r, a, i), s = e10 === es ? 0 : 1; return o[s] !== l[s]; } return Math.floor(r / e10) - Math.floor(t / e10) > 0.1; } function jS(e10, t, r) { var n = t.c2d(e10, es, r).split("-"); return n[0] === "" && (n.unshift(), n[0] = "-" + n[0]), n; } var a1 = sr; var Nn = Ue; var US = Nt; var za = Cr; var Xse = w_; var GS = k8; var Kse = A8; var Jse = M8; var Qse = S8; function eue(e10, t) { var r = [], n = [], a = t.orientation === "h", i = za.getFromId(e10, a ? t.yaxis : t.xaxis), o = a ? "y" : "x", l = { x: "y", y: "x" }[o], s = t[o + "calendar"], u = t.cumulative, f, d = A_(e10, t, i, o), h = d[0], p = d[1], v = typeof h.size == "string", m = [], g = v ? m : h, y = [], w = [], k = [], x = 0, _ = t.histnorm, T = t.histfunc, S = _.indexOf("density") !== -1, M, L, F; u.enabled && S && (_ = _.replace(/ ?density$/, ""), S = false); var $ = T === "max" || T === "min", I = $ ? null : 0, O = GS.count, G = Kse[_], K = false, V = function(J) { return i.r2c(J, 0, s); }, z; for (Nn.isArrayOrTypedArray(t[l]) && T !== "count" && (z = t[l], K = T === "avg", O = GS[T]), f = V(h.start), L = V(h.end) + (f - za.tickIncrement(f, h.size, false, s)) / 1e6; f < L && r.length < 1e6 && (M = za.tickIncrement(f, h.size, false, s), r.push((f + M) / 2), n.push(I), k.push([]), m.push(f), S && y.push(1 / (M - f)), K && w.push(0), !(M <= f)); ) f = M; m.push(f), !v && i.type === "date" && (g = { start: V(g.start), end: V(g.end), size: g.size }), e10._fullLayout._roundFnOpts || (e10._fullLayout._roundFnOpts = {}); var P = t["_" + o + "bingroup"], R = { leftGap: 1 / 0, rightGap: 1 / 0 }; P && (e10._fullLayout._roundFnOpts[P] || (e10._fullLayout._roundFnOpts[P] = R), R = e10._fullLayout._roundFnOpts[P]); var H = n.length, B = true, W = R.leftGap, ee = R.rightGap, re = {}; for (f = 0; f < p.length; f++) { var ae = p[f]; F = Nn.findBin(ae, g), F >= 0 && F < H && (x += O(F, f, n, z, w), B && k[F].length && ae !== p[k[F][0]] && (B = false), k[F].push(f), re[f] = F, W = Math.min(W, ae - m[F]), ee = Math.min(ee, m[F + 1] - ae)); } R.leftGap = W, R.rightGap = ee; var Q; B || (Q = function(J, pe) { return function() { var ge = e10._fullLayout._roundFnOpts[P]; return Qse( ge.leftGap, ge.rightGap, m, i, s )(J, pe); }; }), K && (x = Jse(n, w)), G && G(n, x, y), u.enabled && nue(n, u.direction, u.currentbin); var ue = Math.min(r.length, n.length), j = [], U = 0, Z = ue - 1; for (f = 0; f < ue; f++) if (n[f]) { U = f; break; } for (f = ue - 1; f >= U; f--) if (n[f]) { Z = f; break; } for (f = U; f <= Z; f++) if (a1(r[f]) && a1(n[f])) { var le = { p: r[f], s: n[f], b: 0 }; u.enabled || (le.pts = k[f], B ? le.ph0 = le.ph1 = k[f].length ? p[k[f][0]] : r[f] : (t._computePh = true, le.ph0 = Q(m[f]), le.ph1 = Q(m[f + 1], true))), j.push(le); } return j.length === 1 && (j[0].width1 = za.tickIncrement(j[0].p, h.size, false, s) - j[0].p), Xse(j, t), Nn.isArrayOrTypedArray(t.selectedpoints) && Nn.tagSelected(j, t, re), j; } function A_(e10, t, r, n, a) { var i = n + "bins", o = e10._fullLayout, l = t["_" + n + "bingroup"], s = o._histogramBinOpts[l], u = o.barmode === "overlay", f, d, h, p, v, m, g, y = function(ae) { return r.r2c(ae, 0, p); }, w = function(ae) { return r.c2r(ae, 0, p); }, k = r.type === "date" ? function(ae) { return ae || ae === 0 ? Nn.cleanDate(ae, null, p) : null; } : function(ae) { return a1(ae) ? Number(ae) : null; }; function x(ae, Q, ue) { Q[ae + "Found"] ? (Q[ae] = k(Q[ae]), Q[ae] === null && (Q[ae] = ue[ae])) : (m[ae] = Q[ae] = ue[ae], Nn.nestedProperty(d[0], i + "." + ae).set(ue[ae])); } if (t["_" + n + "autoBinFinished"]) delete t["_" + n + "autoBinFinished"]; else { d = s.traces; var _ = [], T = true, S = false, M = false; for (f = 0; f < d.length; f++) if (h = d[f], h.visible) { var L = s.dirs[f]; v = h["_" + L + "pos0"] = r.makeCalcdata(h, L), _ = Nn.concat(_, v), delete h["_" + n + "autoBinFinished"], t.visible === true && (T ? T = false : (delete h._autoBin, h["_" + n + "autoBinFinished"] = 1), US.traceIs(h, "2dMap") && (S = true), h.type === "histogram2dcontour" && (M = true)); } p = d[0][n + "calendar"]; var F = za.autoBin(_, r, s.nbins, S, p, s.sizeFound && s.size), $ = d[0]._autoBin = {}; if (m = $[s.dirs[0]] = {}, M && (s.size || (F.start = w(za.tickIncrement( y(F.start), F.size, true, p ))), s.end === void 0 && (F.end = w(za.tickIncrement( y(F.end), F.size, false, p )))), u && !US.traceIs(t, "2dMap") && F._dataSpan === 0 && r.type !== "category" && r.type !== "multicategory" && t.bingroup === "" && typeof t.xbins > "u") { if (a) return [F, v, true]; F = tue(e10, t, r, n, i); } g = h.cumulative || {}, g.enabled && g.currentbin !== "include" && (g.direction === "decreasing" ? F.start = w(za.tickIncrement( y(F.start), F.size, true, p )) : F.end = w(za.tickIncrement( y(F.end), F.size, false, p ))), s.size = F.size, s.sizeFound || (m.size = F.size, Nn.nestedProperty(d[0], i + ".size").set(F.size)), x("start", s, F), x("end", s, F); } v = t["_" + n + "pos0"], delete t["_" + n + "pos0"]; var I = t._input[i] || {}, O = Nn.extendFlat({}, s), G = s.start, K = r.r2l(I.start), V = K !== void 0; if ((s.startFound || V) && K !== r.r2l(G)) { var z = V ? K : Nn.aggNums(Math.min, null, v), P = { type: r.type === "category" || r.type === "multicategory" ? "linear" : r.type, r2l: r.r2l, dtick: s.size, tick0: G, calendar: p, range: [z, za.tickIncrement(z, s.size, false, p)].map(r.l2r) }, R = za.tickFirst(P); R > r.r2l(z) && (R = za.tickIncrement(R, s.size, true, p)), O.start = r.l2r(R), V || Nn.nestedProperty(t, i + ".start").set(O.start); } var H = s.end, B = r.r2l(I.end), W = B !== void 0; if ((s.endFound || W) && B !== r.r2l(H)) { var ee = W ? B : Nn.aggNums(Math.max, null, v); O.end = r.l2r(ee), W || Nn.nestedProperty(t, i + ".start").set(O.end); } var re = "autobin" + n; return t._input[re] === false && (t._input[i] = Nn.extendFlat({}, t[i] || {}), delete t._input[re], delete t[re]), [O, v]; } function tue(e10, t, r, n, a) { var i = e10._fullLayout, o = rue(e10, t), l = false, s = 1 / 0, u = [t], f, d, h; for (f = 0; f < o.length; f++) if (d = o[f], d === t) l = true; else if (!l) h = i._histogramBinOpts[d["_" + n + "bingroup"]], s = Math.min(s, h.size || d[a].size); else { var p = A_(e10, d, r, n, true), v = p[0], m = p[2]; d["_" + n + "autoBinFinished"] = 1, d["_" + n + "pos0"] = p[1], m ? u.push(d) : s = Math.min(s, v.size); } var g = new Array(u.length); for (f = 0; f < u.length; f++) for (var y = u[f]["_" + n + "pos0"], w = 0; w < y.length; w++) if (y[w] !== void 0) { g[f] = y[w]; break; } for (isFinite(s) || (s = Nn.distinctVals(g).minDiff), f = 0; f < u.length; f++) { d = u[f]; var k = d[n + "calendar"], x = { start: r.c2r(g[f] - s / 2, 0, k), end: r.c2r(g[f] + s / 2, 0, k), size: s }; d._input[a] = d[a] = x, h = i._histogramBinOpts[d["_" + n + "bingroup"]], h && Nn.extendFlat(h, x); } return t[a]; } function rue(e10, t) { for (var r = t.xaxis, n = t.yaxis, a = t.orientation, i = [], o = e10._fullData, l = 0; l < o.length; l++) { var s = o[l]; s.type === "histogram" && s.visible === true && s.orientation === a && s.xaxis === r && s.yaxis === n && i.push(s); } return i; } function nue(e10, t, r) { var n, a, i; function o(s) { i = e10[s], e10[s] /= 2; } function l(s) { a = e10[s], e10[s] = i + a / 2, i += a; } if (r === "half") if (t === "increasing") for (o(0), n = 1; n < e10.length; n++) l(n); else for (o(e10.length - 1), n = e10.length - 2; n >= 0; n--) l(n); else if (t === "increasing") { for (n = 1; n < e10.length; n++) e10[n] += e10[n - 1]; r === "exclude" && (e10.unshift(0), e10.pop()); } else { for (n = e10.length - 2; n >= 0; n--) e10[n] += e10[n + 1]; r === "exclude" && (e10.push(0), e10.shift()); } } var aue = { calc: eue, calcAllAutoBins: A_ }; var VS = Ue; var Js = Cr; var qS = k8; var iue = A8; var oue = M8; var lue = S8; var WS = aue.calcAllAutoBins; var sue = function(t, r) { var n = Js.getFromId(t, r.xaxis), a = Js.getFromId(t, r.yaxis), i = r.xcalendar, o = r.ycalendar, l = function(Pe) { return n.r2c(Pe, 0, i); }, s = function(Pe) { return a.r2c(Pe, 0, o); }, u = function(Pe) { return n.c2r(Pe, 0, i); }, f = function(Pe) { return a.c2r(Pe, 0, o); }, d, h, p, v, m = WS(t, r, n, "x"), g = m[0], y = m[1], w = WS(t, r, a, "y"), k = w[0], x = w[1], _ = r._length; y.length > _ && y.splice(_, y.length - _), x.length > _ && x.splice(_, x.length - _); var T = [], S = [], M = [], L = typeof g.size == "string", F = typeof k.size == "string", $ = [], I = [], O = L ? $ : g, G = F ? I : k, K = 0, V = [], z = [], P = r.histnorm, R = r.histfunc, H = P.indexOf("density") !== -1, B = R === "max" || R === "min", W = B ? null : 0, ee = qS.count, re = iue[P], ae = false, Q = [], ue = [], j = "z" in r ? r.z : "marker" in r && Array.isArray(r.marker.color) ? r.marker.color : ""; j && R !== "count" && (ae = R === "avg", ee = qS[R]); var U = g.size, Z = l(g.start), le = l(g.end) + (Z - Js.tickIncrement(Z, U, false, i)) / 1e6; for (d = Z; d < le; d = Js.tickIncrement(d, U, false, i)) S.push(W), $.push(d), ae && M.push(0); $.push(d); var J = S.length, pe = (d - Z) / J, ge = u(Z + pe / 2), ve = k.size, me = s(k.start), Le = s(k.end) + (me - Js.tickIncrement(me, ve, false, o)) / 1e6; for (d = me; d < Le; d = Js.tickIncrement(d, ve, false, o)) { T.push(S.slice()), I.push(d); var ze = new Array(J); for (h = 0; h < J; h++) ze[h] = []; z.push(ze), ae && V.push(M.slice()); } I.push(d); var Fe = T.length, Oe = (d - me) / Fe, Re = f(me + Oe / 2); H && (Q = ZS(S.length, O, pe, L), ue = ZS(T.length, G, Oe, F)), !L && n.type === "date" && (O = YS(l, O)), !F && a.type === "date" && (G = YS(s, G)); var We = true, Me = true, Ve = new Array(J), qe = new Array(Fe), Qe = 1 / 0, ot = 1 / 0, ht = 1 / 0, vt = 1 / 0; for (d = 0; d < _; d++) { var nt = y[d], ft = x[d]; p = VS.findBin(nt, O), v = VS.findBin(ft, G), p >= 0 && p < J && v >= 0 && v < Fe && (K += ee(p, d, T[v], j, V[v]), z[v][p].push(d), We && (Ve[p] === void 0 ? Ve[p] = nt : Ve[p] !== nt && (We = false)), Me && (qe[v] === void 0 ? qe[v] = ft : qe[v] !== ft && (Me = false)), Qe = Math.min(Qe, nt - $[p]), ot = Math.min(ot, $[p + 1] - nt), ht = Math.min(ht, ft - I[v]), vt = Math.min(vt, I[v + 1] - ft)); } if (ae) for (v = 0; v < Fe; v++) K += oue(T[v], V[v]); if (re) for (v = 0; v < Fe; v++) re(T[v], K, Q, ue[v]); return { x: y, xRanges: XS($, We && Ve, Qe, ot, n, i), x0: ge, dx: pe, y: x, yRanges: XS(I, Me && qe, ht, vt, a, o), y0: Re, dy: Oe, z: T, pts: z }; }; function ZS(e10, t, r, n) { var a = new Array(e10), i; if (n) for (i = 0; i < e10; i++) a[i] = 1 / (t[i + 1] - t[i]); else { var o = 1 / r; for (i = 0; i < e10; i++) a[i] = o; } return a; } function YS(e10, t) { return { start: e10(t.start), end: e10(t.end), size: t.size }; } function XS(e10, t, r, n, a, i) { var o, l = e10.length - 1, s = new Array(l), u = lue(r, n, e10, a, i); for (o = 0; o < l; o++) { var f = (t || [])[o]; s[o] = f === void 0 ? [u(e10[o]), u(e10[o + 1], true)] : [f, f]; } return s; } var Ei = Ue; var KS = Qr.BADNUM; var JS = Wp; var uue = function(t, r, n, a, i, o) { var l = t._length, s = r.makeCalcdata(t, a), u = n.makeCalcdata(t, i); s = JS(t, r, a, s).vals, u = JS(t, n, i, u).vals; var f = t.text, d = f !== void 0 && Ei.isArray1D(f), h = t.hovertext, p = h !== void 0 && Ei.isArray1D(h), v, m, g = Ei.distinctVals(s), y = g.vals, w = Ei.distinctVals(u), k = w.vals, x = [], _, T, S = k.length, M = y.length; for (v = 0; v < o.length; v++) x[v] = Ei.init2dArray(S, M); d && (_ = Ei.init2dArray(S, M)), p && (T = Ei.init2dArray(S, M)); var L = Ei.init2dArray(S, M); for (v = 0; v < l; v++) if (s[v] !== KS && u[v] !== KS) { var F = Ei.findBin(s[v] + g.minDiff / 2, y), $ = Ei.findBin(u[v] + w.minDiff / 2, k); for (m = 0; m < o.length; m++) { var I = o[m], O = t[I], G = x[m]; G[$][F] = O[v], L[$][F] = v; } d && (_[$][F] = f[v]), p && (T[$][F] = h[v]); } for (t["_" + a] = y, t["_" + i] = k, m = 0; m < o.length; m++) t["_" + o[m]] = x[m]; d && (t._text = _), p && (t._hovertext = T), r && r.type === "category" && (t["_" + a + "CategoryMap"] = y.map(function(K) { return r._categories[K]; })), n && n.type === "category" && (t["_" + i + "CategoryMap"] = k.map(function(K) { return n._categories[K]; })), t._after2before = L; }; var fue = sr; var cue = Ue; var Mh = Qr.BADNUM; var due = function(t, r, n, a) { var i, o, l, s, u, f; function d(y) { if (fue(y)) return +y; } if (r && r.transpose) { for (i = 0, u = 0; u < t.length; u++) i = Math.max(i, t[u].length); if (i === 0) return false; l = function(y) { return y.length; }, s = function(y, w, k) { return (y[k] || [])[w]; }; } else i = t.length, l = function(y, w) { return y[w].length; }, s = function(y, w, k) { return (y[w] || [])[k]; }; var h = function(y, w, k) { return w === Mh || k === Mh ? Mh : s(y, w, k); }; function p(y) { if (r && r.type !== "carpet" && r.type !== "contourcarpet" && y && y.type === "category" && r["_" + y._id.charAt(0)].length) { var w = y._id.charAt(0), k = {}, x = r["_" + w + "CategoryMap"] || r[w]; for (u = 0; u < x.length; u++) k[x[u]] = u; return function(_) { var T = k[y._categories[_]]; return T + 1 ? T : Mh; }; } else return cue.identity; } var v = p(n), m = p(a); a && a.type === "category" && (i = a._categories.length); var g = new Array(i); for (u = 0; u < i; u++) for (n && n.type === "category" ? o = n._categories.length : o = l(t, u), g[u] = new Array(o), f = 0; f < o; f++) g[u][f] = d(h(t, m(u), v(f))); return g; }; var hue = Ue; var QS = 0.01; var vue = [[-1, 0], [1, 0], [0, -1], [0, 1]]; function pue(e10) { return 0.5 - 0.25 * Math.min(1, e10 * 0.5); } var mue = function(t, r) { var n = 1, a; for (e32(t, r), a = 0; a < r.length && !(r[a][2] < 4); a++) ; for (r = r.slice(a), a = 0; a < 100 && n > QS; a++) n = e32( t, r, pue(n) ); return n > QS && hue.log("interp2d didn't converge quickly", n), t; }; function e32(e10, t, r) { var n = 0, a, i, o, l, s, u, f, d, h, p, v, m, g; for (l = 0; l < t.length; l++) { for (a = t[l], i = a[0], o = a[1], v = e10[i][o], p = 0, h = 0, s = 0; s < 4; s++) u = vue[s], f = e10[i + u[0]], f && (d = f[o + u[1]], d !== void 0 && (p === 0 ? m = g = d : (m = Math.min(m, d), g = Math.max(g, d)), h++, p += d)); if (h === 0) throw "iterateInterp2d order is wrong: no defined neighbors"; e10[i][o] = p / h, v === void 0 ? h < 4 && (n = 1) : (e10[i][o] = (1 + r) * e10[i][o] - r * v, g > m && (n = Math.max( n, Math.abs(e10[i][o] - v) / (g - m) ))); } return n; } var gue = Ue.maxRowLength; var yue = function(t) { var r = [], n = {}, a = [], i = t[0], o = [], l = [0, 0, 0], s = gue(t), u, f, d, h, p, v, m, g; for (f = 0; f < t.length; f++) for (u = o, o = i, i = t[f + 1] || [], d = 0; d < s; d++) o[d] === void 0 && (v = (o[d - 1] !== void 0 ? 1 : 0) + (o[d + 1] !== void 0 ? 1 : 0) + (u[d] !== void 0 ? 1 : 0) + (i[d] !== void 0 ? 1 : 0), v ? (f === 0 && v++, d === 0 && v++, f === t.length - 1 && v++, d === o.length - 1 && v++, v < 4 && (n[[f, d]] = [f, d, v]), r.push([f, d, v])) : a.push([f, d])); for (; a.length; ) { for (m = {}, g = false, p = a.length - 1; p >= 0; p--) h = a[p], f = h[0], d = h[1], v = ((n[[f - 1, d]] || l)[2] + (n[[f + 1, d]] || l)[2] + (n[[f, d - 1]] || l)[2] + (n[[f, d + 1]] || l)[2]) / 20, v && (m[h] = [f, d, v], a.splice(p, 1), g = true); if (!g) throw "findEmpties iterated with no new neighbors"; for (h in m) n[h] = m[h], r.push(m[h]); } return r.sort(function(y, w) { return w[2] - y[2]; }); }; var R0 = Nt; var t3 = Ue.isArrayOrTypedArray; var bue = function(t, r, n, a, i, o) { var l = [], s = R0.traceIs(t, "contour"), u = R0.traceIs(t, "histogram"), f = R0.traceIs(t, "gl2d"), d, h, p, v = t3(r) && r.length > 1; if (v && !u && o.type !== "category") { var m = r.length; if (m <= i) { if (s || f) l = Array.from(r).slice(0, i); else if (i === 1) l = [r[0] - 0.5, r[0] + 0.5]; else { for (l = [1.5 * r[0] - 0.5 * r[1]], p = 1; p < m; p++) l.push((r[p - 1] + r[p]) * 0.5); l.push(1.5 * r[m - 1] - 0.5 * r[m - 2]); } if (m < i) { var g = l[l.length - 1], y = g - l[l.length - 2]; for (p = m; p < i; p++) g += y, l.push(g); } } else return s ? r.slice(0, i) : ( // we must be strict for contours r.slice(0, i + 1) ); } else { var w = t[o._id.charAt(0) + "calendar"]; if (u) d = o.r2c(n, 0, w); else if (t3(r) && r.length === 1) d = r[0]; else if (n === void 0) d = 0; else { var k = o.type === "log" ? o.d2c : o.r2c; d = k(n, 0, w); } for (h = a || 1, p = s || f ? 0 : -0.5; p < i; p++) l.push(d + h * p); } return l; }; var P0 = Nt; var $0 = Ue; var Sh = Cr; var r3 = Wp; var _ue = sue; var xue = Mp; var wue = uue; var Tue = due; var kue = mue; var Aue = yue; var Ch = bue; var i1 = Qr.BADNUM; var Mue = function(t, r) { var n = Sh.getFromId(t, r.xaxis || "x"), a = Sh.getFromId(t, r.yaxis || "y"), i = P0.traceIs(r, "contour"), o = P0.traceIs(r, "histogram"), l = P0.traceIs(r, "gl2d"), s = i ? "best" : r.zsmooth, u, f, d, h, p, v, m, g, y, w, k; if (n._minDtick = 0, a._minDtick = 0, o) k = _ue(t, r), h = k.orig_x, u = k.x, f = k.x0, d = k.dx, g = k.orig_y, p = k.y, v = k.y0, m = k.dy, y = k.z; else { var x = r.z; $0.isArray1D(x) ? (wue(r, n, a, "x", "y", ["z"]), u = r._x, p = r._y, x = r._z) : (h = r.x ? n.makeCalcdata(r, "x") : [], g = r.y ? a.makeCalcdata(r, "y") : [], u = r3(r, n, "x", h).vals, p = r3(r, a, "y", g).vals, r._x = u, r._y = p), f = r.x0, d = r.dx, v = r.y0, m = r.dy, y = Tue(x, r, n, a); } (n.rangebreaks || a.rangebreaks) && (y = Sue(u, p, y), o || (u = n3(u), p = n3(p), r._x = u, r._y = p)), !o && (i || r.connectgaps) && (r._emptypoints = Aue(y), kue(y, r._emptypoints)); function _(G) { s = r._input.zsmooth = r.zsmooth = false, $0.warn('cannot use zsmooth: "fast": ' + G); } function T(G) { if (G.length > 1) { var K = (G[G.length - 1] - G[0]) / (G.length - 1), V = Math.abs(K / 100); for (w = 0; w < G.length - 1; w++) if (Math.abs(G[w + 1] - G[w] - K) > V) return false; } return true; } r._islinear = false, n.type === "log" || a.type === "log" ? s === "fast" && _("log axis found") : T(u) ? T(p) ? r._islinear = true : s === "fast" && _("y scale is not linear") : s === "fast" && _("x scale is not linear"); var S = $0.maxRowLength(y), M = r.xtype === "scaled" ? "" : u, L = Ch(r, M, f, d, S, n), F = r.ytype === "scaled" ? "" : p, $ = Ch(r, F, v, m, y.length, a); l || (r._extremes[n._id] = Sh.findExtremes(n, L), r._extremes[a._id] = Sh.findExtremes(a, $)); var I = { x: L, y: $, z: y, text: r._text || r.text, hovertext: r._hovertext || r.hovertext }; if (r.xperiodalignment && h && (I.orig_x = h), r.yperiodalignment && g && (I.orig_y = g), M && M.length === L.length - 1 && (I.xCenter = M), F && F.length === $.length - 1 && (I.yCenter = F), o && (I.xRanges = k.xRanges, I.yRanges = k.yRanges, I.pts = k.pts), i || xue(t, r, { vals: y, cLetter: "z" }), i && r.contours && r.contours.coloring === "heatmap") { var O = { type: r.type === "contour" ? "heatmap" : "histogram2d", xcalendar: r.xcalendar, ycalendar: r.ycalendar }; I.xfill = Ch(O, M, f, d, S, n), I.yfill = Ch(O, F, v, m, y.length, a); } return [I]; }; function n3(e10) { for (var t = [], r = e10.length, n = 0; n < r; n++) { var a = e10[n]; a !== i1 && t.push(a); } return t; } function Sue(e10, t, r) { for (var n = [], a = -1, i = 0; i < r.length; i++) if (t[i] !== i1) { a++, n[a] = []; for (var o = 0; o < r[i].length; o++) e10[o] !== i1 && n[a].push(r[i][o]); } return n; } var M_ = {}; (function(e10) { e10.CSS_DECLARATIONS = [ ["image-rendering", "optimizeSpeed"], ["image-rendering", "-moz-crisp-edges"], ["image-rendering", "-o-crisp-edges"], ["image-rendering", "-webkit-optimize-contrast"], ["image-rendering", "optimize-contrast"], ["image-rendering", "crisp-edges"], ["image-rendering", "pixelated"] ], e10.STYLE = e10.CSS_DECLARATIONS.map(function(t) { return t.join(": ") + "; "; }).join(""); })(M_); var a3 = M_; var Cue = Sr; var z0 = Ue; var Qs = null; function Lue() { if (Qs !== null) return Qs; Qs = false; var e10 = z0.isIE() || z0.isSafari() || z0.isIOS(); if (window.navigator.userAgent && !e10) { var t = Array.from(a3.CSS_DECLARATIONS).reverse(), r = window.CSS && window.CSS.supports || window.supportsCSS; if (typeof r == "function") Qs = t.some(function(o) { return r.apply(null, o); }); else { var n = Cue.tester.append("image").attr("style", a3.STYLE), a = window.getComputedStyle(n.node()), i = a.imageRendering; Qs = t.some(function(o) { var l = o[1]; return i === l || i === l.toLowerCase(); }), n.remove(); } } return Qs; } var Due = Lue; var i3 = lr; var Eue = bi; var Fue = Nt; var Rue = Sr; var Pue = Cr; var Ia = Ue; var o3 = Rn; var $ue = r6; var zue = nr; var Iue = Qc.extractOpts; var Nue = Qc.makeColorScaleFuncFromTrace; var Oue = yl; var Hue = On; var I0 = Hue.LINE_SPACING; var Bue = Due; var jue = M_.STYLE; var C8 = "heatmap-label"; function L8(e10) { return e10.selectAll("g." + C8); } function l3(e10) { L8(e10).remove(); } var Uue = function(e10, t, r, n) { var a = t.xaxis, i = t.yaxis; Ia.makeTraceGroups(n, r, "hm").each(function(o) { var l = i3.select(this), s = o[0], u = s.trace, f = u.xgap || 0, d = u.ygap || 0, h = s.z, p = s.x, v = s.y, m = s.xCenter, g = s.yCenter, y = Fue.traceIs(u, "contour"), w = y ? "best" : u.zsmooth, k = h.length, x = Ia.maxRowLength(h), _ = false, T = false, S, M, L, F, $, I, O, G; for (I = 0; S === void 0 && I < p.length - 1; ) S = a.c2p(p[I]), I++; for (I = p.length - 1; M === void 0 && I > 0; ) M = a.c2p(p[I]), I--; for (M < S && (L = M, M = S, S = L, _ = true), I = 0; F === void 0 && I < v.length - 1; ) F = i.c2p(v[I]), I++; for (I = v.length - 1; $ === void 0 && I > 0; ) $ = i.c2p(v[I]), I--; $ < F && (L = F, F = $, $ = L, T = true), y && (m = p, g = v, p = s.xfill, v = s.yfill); var K = "default"; if (w ? K = w === "best" ? "smooth" : "fast" : u._islinear && f === 0 && d === 0 && Bue() && (K = "fast"), K !== "fast") { var V = w === "best" ? 0 : 0.5; S = Math.max(-V * a._length, S), M = Math.min((1 + V) * a._length, M), F = Math.max(-V * i._length, F), $ = Math.min((1 + V) * i._length, $); } var z = Math.round(M - S), P = Math.round($ - F), R = S >= a._length || M <= 0 || F >= i._length || $ <= 0; if (R) { var H = l.selectAll("image").data([]); H.exit().remove(), l3(l); return; } var B, W; K === "fast" ? (B = x, W = k) : (B = z, W = P); var ee = document.createElement("canvas"); ee.width = B, ee.height = W; var re = ee.getContext("2d", { willReadFrequently: true }), ae = Nue(u, { noNumericCheck: true, returnArray: true }), Q, ue; K === "fast" ? (Q = _ ? function(Ht) { return x - 1 - Ht; } : Ia.identity, ue = T ? function(Ht) { return k - 1 - Ht; } : Ia.identity) : (Q = function(Ht) { return Ia.constrain( Math.round(a.c2p(p[Ht]) - S), 0, z ); }, ue = function(Ht) { return Ia.constrain( Math.round(i.c2p(v[Ht]) - F), 0, P ); }); var j = ue(0), U = [j, j], Z = _ ? 0 : 1, le = T ? 0 : 1, J = 0, pe = 0, ge = 0, ve = 0, me, Le, ze, Fe, Oe; function Re(Ht, $r) { if (Ht !== void 0) { var ar = ae(Ht); return ar[0] = Math.round(ar[0]), ar[1] = Math.round(ar[1]), ar[2] = Math.round(ar[2]), J += $r, pe += ar[0] * $r, ge += ar[1] * $r, ve += ar[2] * $r, ar; } return [0, 0, 0, 0]; } function We(Ht, $r, ar, Pr) { var Ur = Ht[ar.bin0]; if (Ur === void 0) return Re(void 0, 1); var Pn = Ht[ar.bin1], hn = $r[ar.bin0], vn = $r[ar.bin1], Ka = Pn - Ur || 0, to = hn - Ur || 0, ln; return Pn === void 0 ? vn === void 0 ? ln = 0 : hn === void 0 ? ln = 2 * (vn - Ur) : ln = (2 * vn - hn - Ur) * 2 / 3 : vn === void 0 ? hn === void 0 ? ln = 0 : ln = (2 * Ur - Pn - hn) * 2 / 3 : hn === void 0 ? ln = (2 * vn - Pn - Ur) * 2 / 3 : ln = vn + Ur - Pn - hn, Re(Ur + ar.frac * Ka + Pr.frac * (to + ar.frac * ln)); } if (K !== "default") { var Me = 0, Ve; try { Ve = new Uint8Array(B * W * 4); } catch { Ve = new Array(B * W * 4); } if (K === "smooth") { var qe = m || p, Qe = g || v, ot = new Array(qe.length), ht = new Array(Qe.length), vt = new Array(z), nt = m ? u3 : s3, ft = g ? u3 : s3, Pe, Ie, Ne; for (I = 0; I < qe.length; I++) ot[I] = Math.round(a.c2p(qe[I]) - S); for (I = 0; I < Qe.length; I++) ht[I] = Math.round(i.c2p(Qe[I]) - F); for (I = 0; I < z; I++) vt[I] = nt(I, ot); for (O = 0; O < P; O++) for (Pe = ft(O, ht), Ie = h[Pe.bin0], Ne = h[Pe.bin1], I = 0; I < z; I++, Me += 4) Oe = We(Ie, Ne, vt[I], Pe), f3(Ve, Me, Oe); } else for (O = 0; O < k; O++) for (Fe = h[O], U = ue(O), I = 0; I < x; I++) Oe = Re(Fe[I], 1), Me = (U * x + Q(I)) * 4, f3(Ve, Me, Oe); var tt = re.createImageData(B, W); try { tt.data.set(Ve); } catch { var Je = tt.data, it = Je.length; for (O = 0; O < it; O++) Je[O] = Ve[O]; } re.putImageData(tt, 0, 0); } else { var at = Math.floor(f / 2), Tt = Math.floor(d / 2); for (O = 0; O < k; O++) if (Fe = h[O], U.reverse(), U[le] = ue(O + 1), !(U[0] === U[1] || U[0] === void 0 || U[1] === void 0)) for (Le = Q(0), me = [Le, Le], I = 0; I < x; I++) me.reverse(), me[Z] = Q(I + 1), !(me[0] === me[1] || me[0] === void 0 || me[1] === void 0) && (ze = Fe[I], Oe = Re(ze, (me[1] - me[0]) * (U[1] - U[0])), re.fillStyle = "rgba(" + Oe.join(",") + ")", re.fillRect( me[0] + at, U[0] + Tt, me[1] - me[0] - f, U[1] - U[0] - d )); } pe = Math.round(pe / J), ge = Math.round(ge / J), ve = Math.round(ve / J); var gt = Eue("rgb(" + pe + "," + ge + "," + ve + ")"); e10._hmpixcount = (e10._hmpixcount || 0) + J, e10._hmlumcount = (e10._hmlumcount || 0) + J * gt.getLuminance(); var He = l.selectAll("image").data(o); He.enter().append("svg:image").attr({ xmlns: Oue.svg, preserveAspectRatio: "none" }), He.attr({ height: P, width: z, x: S, y: F, "xlink:href": ee.toDataURL("image/png") }), K === "fast" && !w && He.attr("style", jue), l3(l); var pt = u.texttemplate; if (pt) { var bt = Iue(u), Ke = { type: "linear", range: [bt.min, bt.max], _separators: a._separators, _numFormat: a._numFormat }, st = u.type === "histogram2dcontour", rt = u.type === "contour", ct = rt ? 1 : 0, X = rt ? k - 1 : k, se = rt ? 1 : 0, ie = rt ? x - 1 : x, fe = []; for (I = ct; I < X; I++) { var ke; if (rt) ke = s.y[I]; else if (st) { if (I === 0 || I === k - 1) continue; ke = s.y[I]; } else if (s.yCenter) ke = s.yCenter[I]; else { if (I + 1 === k && s.y[I + 1] === void 0) continue; ke = (s.y[I] + s.y[I + 1]) / 2; } var _e = Math.round(i.c2p(ke)); if (!(0 > _e || _e > i._length)) for (O = se; O < ie; O++) { var Ge; if (rt) Ge = s.x[O]; else if (st) { if (O === 0 || O === x - 1) continue; Ge = s.x[O]; } else if (s.xCenter) Ge = s.xCenter[O]; else { if (O + 1 === x && s.x[O + 1] === void 0) continue; Ge = (s.x[O] + s.x[O + 1]) / 2; } var je = Math.round(a.c2p(Ge)); if (!(0 > je || je > a._length)) { var Ee = $ue({ x: Ge, y: ke }, u, e10._fullLayout); Ee.x = Ge, Ee.y = ke; var oe = s.z[I][O]; oe === void 0 ? (Ee.z = "", Ee.zLabel = "") : (Ee.z = oe, Ee.zLabel = Pue.tickText(Ke, oe, "hover").text); var Ce = s.text && s.text[I] && s.text[I][O]; (Ce === void 0 || Ce === false) && (Ce = ""), Ee.text = Ce; var Be = Ia.texttemplateString(pt, Ee, e10._fullLayout._d3locale, Ee, u._meta || {}); if (Be) { var Xe = Be.split("
"), Et = Xe.length, Pt = 0; for (G = 0; G < Et; G++) Pt = Math.max(Pt, Xe[G].length); fe.push({ l: Et, // number of lines c: Pt, // maximum number of chars in a line t: Be, // text x: je, y: _e, z: oe }); } } } } var It = u.textfont, kt = It.family, qt = It.size, Ot = e10._fullLayout.font.size; if (!qt || qt === "auto") { var wt = 1 / 0, Yt = 1 / 0, Kt = 0, $t = 0; for (G = 0; G < fe.length; G++) { var zt = fe[G]; if (Kt = Math.max(Kt, zt.l), $t = Math.max($t, zt.c), G < fe.length - 1) { var Mt = fe[G + 1], St = Math.abs(Mt.x - zt.x), Ut = Math.abs(Mt.y - zt.y); St && (wt = Math.min(wt, St)), Ut && (Yt = Math.min(Yt, Ut)); } } !isFinite(wt) || !isFinite(Yt) ? qt = Ot : (wt -= f, Yt -= d, wt /= $t, Yt /= Kt, wt /= I0 / 2, Yt /= I0, qt = Math.min( Math.floor(wt), Math.floor(Yt), Ot )); } if (qt <= 0 || !isFinite(qt)) return; var fr = function(Ht) { return Ht.x; }, Ct = function(Ht) { return Ht.y - qt * (Ht.l * I0 / 2 - 1); }, tr = L8(l).data(fe); tr.enter().append("g").classed(C8, 1).append("text").attr("text-anchor", "middle").each(function(Ht) { var $r = i3.select(this), ar = It.color; (!ar || ar === "auto") && (ar = zue.contrast( "rgba(" + ae(Ht.z).join() + ")" )), $r.attr("data-notex", 1).call(o3.positionText, fr(Ht), Ct(Ht)).call(Rue.font, kt, qt, ar).text(Ht.t).call(o3.convertToTspans, e10); }); } }); }; function s3(e10, t) { var r = t.length - 2, n = Ia.constrain(Ia.findBin(e10, t), 0, r), a = t[n], i = t[n + 1], o = Ia.constrain(n + (e10 - a) / (i - a) - 0.5, 0, r), l = Math.round(o), s = Math.abs(o - l); return !o || o === r || !s ? { bin0: l, bin1: l, frac: 0 } : { bin0: l, frac: s, bin1: Math.round(l + s / (o - l)) }; } function u3(e10, t) { var r = t.length - 1, n = Ia.constrain(Ia.findBin(e10, t), 0, r), a = t[n], i = t[n + 1], o = (e10 - a) / (i - a) || 0; return o <= 0 ? { bin0: n, bin1: n, frac: 0 } : o < 0.5 ? { bin0: n, bin1: n + 1, frac: o } : { bin0: n + 1, bin1: n, frac: 1 - o }; } function f3(e10, t, r) { e10[t] = r[0], e10[t + 1] = r[1], e10[t + 2] = r[2], e10[t + 3] = Math.round(r[3] * 255); } var Gue = { min: "zmin", max: "zmax" }; var Vue = lr; var que = function(t) { Vue.select(t).selectAll(".hm image").style("opacity", function(r) { return r.trace.opacity; }); }; var c3 = Ao; var Kf = Ue; var Lh = Kf.isArrayOrTypedArray; var Wue = Cr; var Zue = Qc.extractOpts; var Yue = function(t, r, n, a, i) { i || (i = {}); var o = i.isContour, l = t.cd[0], s = l.trace, u = t.xa, f = t.ya, d = l.x, h = l.y, p = l.z, v = l.xCenter, m = l.yCenter, g = l.zmask, y = s.zhoverformat, w = d, k = h, x, _, T, S; if (t.index !== false) { try { T = Math.round(t.index[1]), S = Math.round(t.index[0]); } catch { Kf.error("Error hovering on heatmap, pointNumber must be [row,col], found:", t.index); return; } if (T < 0 || T >= p[0].length || S < 0 || S > p.length) return; } else { if (c3.inbox(r - d[0], r - d[d.length - 1], 0) > 0 || c3.inbox(n - h[0], n - h[h.length - 1], 0) > 0) return; if (o) { var M; for (w = [2 * d[0] - d[1]], M = 1; M < d.length; M++) w.push((d[M] + d[M - 1]) / 2); for (w.push([2 * d[d.length - 1] - d[d.length - 2]]), k = [2 * h[0] - h[1]], M = 1; M < h.length; M++) k.push((h[M] + h[M - 1]) / 2); k.push([2 * h[h.length - 1] - h[h.length - 2]]); } T = Math.max(0, Math.min(w.length - 2, Kf.findBin(r, w))), S = Math.max(0, Math.min(k.length - 2, Kf.findBin(n, k))); } var L = u.c2p(d[T]), F = u.c2p(d[T + 1]), $ = f.c2p(h[S]), I = f.c2p(h[S + 1]), O, G; o ? (O = l.orig_x || d, G = l.orig_y || h, F = L, x = O[T], I = $, _ = G[S]) : (O = l.orig_x || v || d, G = l.orig_y || m || h, x = v ? O[T] : (O[T] + O[T + 1]) / 2, _ = m ? G[S] : (G[S] + G[S + 1]) / 2, u && u.type === "category" && (x = d[T]), f && f.type === "category" && (_ = h[S]), s.zsmooth && (L = F = u.c2p(x), $ = I = f.c2p(_))); var K = p[S][T]; if (g && !g[S][T] && (K = void 0), !(K === void 0 && !s.hoverongaps)) { var V; Lh(l.hovertext) && Lh(l.hovertext[S]) ? V = l.hovertext[S][T] : Lh(l.text) && Lh(l.text[S]) && (V = l.text[S][T]); var z = Zue(s), P = { type: "linear", range: [z.min, z.max], hoverformat: y, _separators: u._separators, _numFormat: u._numFormat }, R = Wue.tickText(P, K, "hover").text; return [Kf.extendFlat(t, { index: s._after2before ? s._after2before[S][T] : [S, T], // never let a 2D override 1D type as closest point distance: t.maxHoverDistance, spikeDistance: t.maxSpikeDistance, x0: L, x1: F, y0: $, y1: I, xLabelVal: x, yLabelVal: _, zLabelVal: K, zLabel: R, text: V })]; } }; var Xue = { attributes: T8, supplyDefaults: Zse, calc: Mue, plot: Uue, colorbar: Gue, style: que, hoverPoints: Yue, moduleType: "trace", name: "heatmap", basePlotModule: yn, categories: ["cartesian", "svg", "2dMap", "showLegend"], meta: { description: [ "The data that describes the heatmap value-to-color mapping", "is set in `z`.", "Data in `z` can either be a {2D array} of values (ragged or not)", "or a 1D array of values.", "In the case where `z` is a {2D array},", "say that `z` has N rows and M columns.", "Then, by default, the resulting heatmap will have N partitions along", "the y axis and M partitions along the x axis.", "In other words, the i-th row/ j-th column cell in `z`", "is mapped to the i-th partition of the y axis", "(starting from the bottom of the plot) and the j-th partition", "of the x-axis (starting from the left of the plot).", "This behavior can be flipped by using `transpose`.", "Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.", "If M (N), then the coordinates correspond to the center of the", "heatmap cells and the cells have equal width.", "If M+1 (N+1), then the coordinates correspond to the edges of the", "heatmap cells.", "In the case where `z` is a 1D {array}, the x and y coordinates must be", "provided in `x` and `y` respectively to form data triplets." ].join(" ") } }; var Kue = Xue; var Jue = Vc(Kue); Oc.register([fle, Dse, Jue]); var D8 = { exports: {} }; (function(e10, t) { (function(r, n) { e10.exports = n(); })(Wl, function r() { var n = typeof self < "u" ? self : typeof window < "u" ? window : n !== void 0 ? n : {}, a = !n.document && !!n.postMessage, i = n.IS_PAPA_WORKER || false, o = {}, l = 0, s = { parse: function(M, L) { var F = (L = L || {}).dynamicTyping || false; if (S(F) && (L.dynamicTypingFunction = F, F = {}), L.dynamicTyping = F, L.transform = !!S(L.transform) && L.transform, L.worker && s.WORKERS_SUPPORTED) { var $ = function() { if (!s.WORKERS_SUPPORTED) return false; var O = (K = n.URL || n.webkitURL || null, V = r.toString(), s.BLOB_URL || (s.BLOB_URL = K.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", V, ")();"], { type: "text/javascript" })))), G = new n.Worker(O), K, V; return G.onmessage = w, G.id = l++, o[G.id] = G; }(); return $.userStep = L.step, $.userChunk = L.chunk, $.userComplete = L.complete, $.userError = L.error, L.step = S(L.step), L.chunk = S(L.chunk), L.complete = S(L.complete), L.error = S(L.error), delete L.worker, void $.postMessage({ input: M, config: L, workerId: $.id }); } var I = null; return s.NODE_STREAM_INPUT, typeof M == "string" ? (M = function(O) { return O.charCodeAt(0) === 65279 ? O.slice(1) : O; }(M), I = L.download ? new d(L) : new p(L)) : M.readable === true && S(M.read) && S(M.on) ? I = new v(L) : (n.File && M instanceof File || M instanceof Object) && (I = new h(L)), I.stream(M); }, unparse: function(M, L) { var F = false, $ = true, I = ",", O = `\r `, G = '"', K = G + G, V = false, z = null, P = false; (function() { if (typeof L == "object") { if (typeof L.delimiter != "string" || s.BAD_DELIMITERS.filter(function(W) { return L.delimiter.indexOf(W) !== -1; }).length || (I = L.delimiter), (typeof L.quotes == "boolean" || typeof L.quotes == "function" || Array.isArray(L.quotes)) && (F = L.quotes), typeof L.skipEmptyLines != "boolean" && typeof L.skipEmptyLines != "string" || (V = L.skipEmptyLines), typeof L.newline == "string" && (O = L.newline), typeof L.quoteChar == "string" && (G = L.quoteChar), typeof L.header == "boolean" && ($ = L.header), Array.isArray(L.columns)) { if (L.columns.length === 0) throw new Error("Option columns is empty"); z = L.columns; } L.escapeChar !== void 0 && (K = L.escapeChar + G), (typeof L.escapeFormulae == "boolean" || L.escapeFormulae instanceof RegExp) && (P = L.escapeFormulae instanceof RegExp ? L.escapeFormulae : /^[=+\-@\t\r].*$/); } })(); var R = new RegExp(g(G), "g"); if (typeof M == "string" && (M = JSON.parse(M)), Array.isArray(M)) { if (!M.length || Array.isArray(M[0])) return H(null, M, V); if (typeof M[0] == "object") return H(z || Object.keys(M[0]), M, V); } else if (typeof M == "object") return typeof M.data == "string" && (M.data = JSON.parse(M.data)), Array.isArray(M.data) && (M.fields || (M.fields = M.meta && M.meta.fields || z), M.fields || (M.fields = Array.isArray(M.data[0]) ? M.fields : typeof M.data[0] == "object" ? Object.keys(M.data[0]) : []), Array.isArray(M.data[0]) || typeof M.data[0] == "object" || (M.data = [M.data])), H(M.fields || [], M.data || [], V); throw new Error("Unable to serialize unrecognized input"); function H(W, ee, re) { var ae = ""; typeof W == "string" && (W = JSON.parse(W)), typeof ee == "string" && (ee = JSON.parse(ee)); var Q = Array.isArray(W) && 0 < W.length, ue = !Array.isArray(ee[0]); if (Q && $) { for (var j = 0; j < W.length; j++) 0 < j && (ae += I), ae += B(W[j], j); 0 < ee.length && (ae += O); } for (var U = 0; U < ee.length; U++) { var Z = Q ? W.length : ee[U].length, le = false, J = Q ? Object.keys(ee[U]).length === 0 : ee[U].length === 0; if (re && !Q && (le = re === "greedy" ? ee[U].join("").trim() === "" : ee[U].length === 1 && ee[U][0].length === 0), re === "greedy" && Q) { for (var pe = [], ge = 0; ge < Z; ge++) { var ve = ue ? W[ge] : ge; pe.push(ee[U][ve]); } le = pe.join("").trim() === ""; } if (!le) { for (var me = 0; me < Z; me++) { 0 < me && !J && (ae += I); var Le = Q && ue ? W[me] : me; ae += B(ee[U][Le], me); } U < ee.length - 1 && (!re || 0 < Z && !J) && (ae += O); } } return ae; } function B(W, ee) { if (W == null) return ""; if (W.constructor === Date) return JSON.stringify(W).slice(1, 25); var re = false; P && typeof W == "string" && P.test(W) && (W = "'" + W, re = true); var ae = W.toString().replace(R, K); return (re = re || F === true || typeof F == "function" && F(W, ee) || Array.isArray(F) && F[ee] || function(Q, ue) { for (var j = 0; j < ue.length; j++) if (-1 < Q.indexOf(ue[j])) return true; return false; }(ae, s.BAD_DELIMITERS) || -1 < ae.indexOf(I) || ae.charAt(0) === " " || ae.charAt(ae.length - 1) === " ") ? G + ae + G : ae; } } }; if (s.RECORD_SEP = "", s.UNIT_SEP = "", s.BYTE_ORDER_MARK = "\uFEFF", s.BAD_DELIMITERS = ["\r", ` `, '"', s.BYTE_ORDER_MARK], s.WORKERS_SUPPORTED = !a && !!n.Worker, s.NODE_STREAM_INPUT = 1, s.LocalChunkSize = 10485760, s.RemoteChunkSize = 5242880, s.DefaultDelimiter = ",", s.Parser = y, s.ParserHandle = m, s.NetworkStreamer = d, s.FileStreamer = h, s.StringStreamer = p, s.ReadableStreamStreamer = v, n.jQuery) { var u = n.jQuery; u.fn.parse = function(M) { var L = M.config || {}, F = []; return this.each(function(O) { if (!(u(this).prop("tagName").toUpperCase() === "INPUT" && u(this).attr("type").toLowerCase() === "file" && n.FileReader) || !this.files || this.files.length === 0) return true; for (var G = 0; G < this.files.length; G++) F.push({ file: this.files[G], inputElem: this, instanceConfig: u.extend({}, L) }); }), $(), this; function $() { if (F.length !== 0) { var O, G, K, V, z = F[0]; if (S(M.before)) { var P = M.before(z.file, z.inputElem); if (typeof P == "object") { if (P.action === "abort") return O = "AbortError", G = z.file, K = z.inputElem, V = P.reason, void (S(M.error) && M.error({ name: O }, G, K, V)); if (P.action === "skip") return void I(); typeof P.config == "object" && (z.instanceConfig = u.extend(z.instanceConfig, P.config)); } else if (P === "skip") return void I(); } var R = z.instanceConfig.complete; z.instanceConfig.complete = function(H) { S(R) && R(H, z.file, z.inputElem), I(); }, s.parse(z.file, z.instanceConfig); } else S(M.complete) && M.complete(); } function I() { F.splice(0, 1), $(); } }; } function f(M) { this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, (function(L) { var F = _(L); F.chunkSize = parseInt(F.chunkSize), L.step || L.chunk || (F.chunkSize = null), this._handle = new m(F), (this._handle.streamer = this)._config = F; }).call(this, M), this.parseChunk = function(L, F) { if (this.isFirstChunk && S(this._config.beforeFirstChunk)) { var $ = this._config.beforeFirstChunk(L); $ !== void 0 && (L = $); } this.isFirstChunk = false, this._halted = false; var I = this._partialLine + L; this._partialLine = ""; var O = this._handle.parse(I, this._baseIndex, !this._finished); if (!this._handle.paused() && !this._handle.aborted()) { var G = O.meta.cursor; this._finished || (this._partialLine = I.substring(G - this._baseIndex), this._baseIndex = G), O && O.data && (this._rowCount += O.data.length); var K = this._finished || this._config.preview && this._rowCount >= this._config.preview; if (i) n.postMessage({ results: O, workerId: s.WORKER_ID, finished: K }); else if (S(this._config.chunk) && !F) { if (this._config.chunk(O, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true); O = void 0, this._completeResults = void 0; } return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(O.data), this._completeResults.errors = this._completeResults.errors.concat(O.errors), this._completeResults.meta = O.meta), this._completed || !K || !S(this._config.complete) || O && O.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), K || O && O.meta.paused || this._nextChunk(), O; } this._halted = true; }, this._sendError = function(L) { S(this._config.error) ? this._config.error(L) : i && this._config.error && n.postMessage({ workerId: s.WORKER_ID, error: L, finished: false }); }; } function d(M) { var L; (M = M || {}).chunkSize || (M.chunkSize = s.RemoteChunkSize), f.call(this, M), this._nextChunk = a ? function() { this._readChunk(), this._chunkLoaded(); } : function() { this._readChunk(); }, this.stream = function(F) { this._input = F, this._nextChunk(); }, this._readChunk = function() { if (this._finished) this._chunkLoaded(); else { if (L = new XMLHttpRequest(), this._config.withCredentials && (L.withCredentials = this._config.withCredentials), a || (L.onload = T(this._chunkLoaded, this), L.onerror = T(this._chunkError, this)), L.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !a), this._config.downloadRequestHeaders) { var F = this._config.downloadRequestHeaders; for (var $ in F) L.setRequestHeader($, F[$]); } if (this._config.chunkSize) { var I = this._start + this._config.chunkSize - 1; L.setRequestHeader("Range", "bytes=" + this._start + "-" + I); } try { L.send(this._config.downloadRequestBody); } catch (O) { this._chunkError(O.message); } a && L.status === 0 && this._chunkError(); } }, this._chunkLoaded = function() { L.readyState === 4 && (L.status < 200 || 400 <= L.status ? this._chunkError() : (this._start += this._config.chunkSize ? this._config.chunkSize : L.responseText.length, this._finished = !this._config.chunkSize || this._start >= function(F) { var $ = F.getResponseHeader("Content-Range"); return $ === null ? -1 : parseInt($.substring($.lastIndexOf("/") + 1)); }(L), this.parseChunk(L.responseText))); }, this._chunkError = function(F) { var $ = L.statusText || F; this._sendError(new Error($)); }; } function h(M) { var L, F; (M = M || {}).chunkSize || (M.chunkSize = s.LocalChunkSize), f.call(this, M); var $ = typeof FileReader < "u"; this.stream = function(I) { this._input = I, F = I.slice || I.webkitSlice || I.mozSlice, $ ? ((L = new FileReader()).onload = T(this._chunkLoaded, this), L.onerror = T(this._chunkError, this)) : L = new FileReaderSync(), this._nextChunk(); }, this._nextChunk = function() { this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk(); }, this._readChunk = function() { var I = this._input; if (this._config.chunkSize) { var O = Math.min(this._start + this._config.chunkSize, this._input.size); I = F.call(I, this._start, O); } var G = L.readAsText(I, this._config.encoding); $ || this._chunkLoaded({ target: { result: G } }); }, this._chunkLoaded = function(I) { this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(I.target.result); }, this._chunkError = function() { this._sendError(L.error); }; } function p(M) { var L; f.call(this, M = M || {}), this.stream = function(F) { return L = F, this._nextChunk(); }, this._nextChunk = function() { if (!this._finished) { var F, $ = this._config.chunkSize; return $ ? (F = L.substring(0, $), L = L.substring($)) : (F = L, L = ""), this._finished = !L, this.parseChunk(F); } }; } function v(M) { f.call(this, M = M || {}); var L = [], F = true, $ = false; this.pause = function() { f.prototype.pause.apply(this, arguments), this._input.pause(); }, this.resume = function() { f.prototype.resume.apply(this, arguments), this._input.resume(); }, this.stream = function(I) { this._input = I, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError); }, this._checkIsFinished = function() { $ && L.length === 1 && (this._finished = true); }, this._nextChunk = function() { this._checkIsFinished(), L.length ? this.parseChunk(L.shift()) : F = true; }, this._streamData = T(function(I) { try { L.push(typeof I == "string" ? I : I.toString(this._config.encoding)), F && (F = false, this._checkIsFinished(), this.parseChunk(L.shift())); } catch (O) { this._streamError(O); } }, this), this._streamError = T(function(I) { this._streamCleanUp(), this._sendError(I); }, this), this._streamEnd = T(function() { this._streamCleanUp(), $ = true, this._streamData(""); }, this), this._streamCleanUp = T(function() { this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError); }, this); } function m(M) { var L, F, $, I = Math.pow(2, 53), O = -I, G = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, K = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, V = this, z = 0, P = 0, R = false, H = false, B = [], W = { data: [], errors: [], meta: {} }; if (S(M.step)) { var ee = M.step; M.step = function(U) { if (W = U, Q()) ae(); else { if (ae(), W.data.length === 0) return; z += U.data.length, M.preview && z > M.preview ? F.abort() : (W.data = W.data[0], ee(W, V)); } }; } function re(U) { return M.skipEmptyLines === "greedy" ? U.join("").trim() === "" : U.length === 1 && U[0].length === 0; } function ae() { return W && $ && (j("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + s.DefaultDelimiter + "'"), $ = false), M.skipEmptyLines && (W.data = W.data.filter(function(U) { return !re(U); })), Q() && function() { if (!W) return; function U(le, J) { S(M.transformHeader) && (le = M.transformHeader(le, J)), B.push(le); } if (Array.isArray(W.data[0])) { for (var Z = 0; Q() && Z < W.data.length; Z++) W.data[Z].forEach(U); W.data.splice(0, 1); } else W.data.forEach(U); }(), function() { if (!W || !M.header && !M.dynamicTyping && !M.transform) return W; function U(le, J) { var pe, ge = M.header ? {} : []; for (pe = 0; pe < le.length; pe++) { var ve = pe, me = le[pe]; M.header && (ve = pe >= B.length ? "__parsed_extra" : B[pe]), M.transform && (me = M.transform(me, ve)), me = ue(ve, me), ve === "__parsed_extra" ? (ge[ve] = ge[ve] || [], ge[ve].push(me)) : ge[ve] = me; } return M.header && (pe > B.length ? j("FieldMismatch", "TooManyFields", "Too many fields: expected " + B.length + " fields but parsed " + pe, P + J) : pe < B.length && j("FieldMismatch", "TooFewFields", "Too few fields: expected " + B.length + " fields but parsed " + pe, P + J)), ge; } var Z = 1; return !W.data.length || Array.isArray(W.data[0]) ? (W.data = W.data.map(U), Z = W.data.length) : W.data = U(W.data, 0), M.header && W.meta && (W.meta.fields = B), P += Z, W; }(); } function Q() { return M.header && B.length === 0; } function ue(U, Z) { return le = U, M.dynamicTypingFunction && M.dynamicTyping[le] === void 0 && (M.dynamicTyping[le] = M.dynamicTypingFunction(le)), (M.dynamicTyping[le] || M.dynamicTyping) === true ? Z === "true" || Z === "TRUE" || Z !== "false" && Z !== "FALSE" && (function(J) { if (G.test(J)) { var pe = parseFloat(J); if (O < pe && pe < I) return true; } return false; }(Z) ? parseFloat(Z) : K.test(Z) ? new Date(Z) : Z === "" ? null : Z) : Z; var le; } function j(U, Z, le, J) { var pe = { type: U, code: Z, message: le }; J !== void 0 && (pe.row = J), W.errors.push(pe); } this.parse = function(U, Z, le) { var J = M.quoteChar || '"'; if (M.newline || (M.newline = function(ve, me) { ve = ve.substring(0, 1048576); var Le = new RegExp(g(me) + "([^]*?)" + g(me), "gm"), ze = (ve = ve.replace(Le, "")).split("\r"), Fe = ve.split(` `), Oe = 1 < Fe.length && Fe[0].length < ze[0].length; if (ze.length === 1 || Oe) return ` `; for (var Re = 0, We = 0; We < ze.length; We++) ze[We][0] === ` ` && Re++; return Re >= ze.length / 2 ? `\r ` : "\r"; }(U, J)), $ = false, M.delimiter) S(M.delimiter) && (M.delimiter = M.delimiter(U), W.meta.delimiter = M.delimiter); else { var pe = function(ve, me, Le, ze, Fe) { var Oe, Re, We, Me; Fe = Fe || [",", " ", "|", ";", s.RECORD_SEP, s.UNIT_SEP]; for (var Ve = 0; Ve < Fe.length; Ve++) { var qe = Fe[Ve], Qe = 0, ot = 0, ht = 0; We = void 0; for (var vt = new y({ comments: ze, delimiter: qe, newline: me, preview: 10 }).parse(ve), nt = 0; nt < vt.data.length; nt++) if (Le && re(vt.data[nt])) ht++; else { var ft = vt.data[nt].length; ot += ft, We !== void 0 ? 0 < ft && (Qe += Math.abs(ft - We), We = ft) : We = ft; } 0 < vt.data.length && (ot /= vt.data.length - ht), (Re === void 0 || Qe <= Re) && (Me === void 0 || Me < ot) && 1.99 < ot && (Re = Qe, Oe = qe, Me = ot); } return { successful: !!(M.delimiter = Oe), bestDelimiter: Oe }; }(U, M.newline, M.skipEmptyLines, M.comments, M.delimitersToGuess); pe.successful ? M.delimiter = pe.bestDelimiter : ($ = true, M.delimiter = s.DefaultDelimiter), W.meta.delimiter = M.delimiter; } var ge = _(M); return M.preview && M.header && ge.preview++, L = U, F = new y(ge), W = F.parse(L, Z, le), ae(), R ? { meta: { paused: true } } : W || { meta: { paused: false } }; }, this.paused = function() { return R; }, this.pause = function() { R = true, F.abort(), L = S(M.chunk) ? "" : L.substring(F.getCharIndex()); }, this.resume = function() { V.streamer._halted ? (R = false, V.streamer.parseChunk(L, true)) : setTimeout(V.resume, 3); }, this.aborted = function() { return H; }, this.abort = function() { H = true, F.abort(), W.meta.aborted = true, S(M.complete) && M.complete(W), L = ""; }; } function g(M) { return M.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function y(M) { var L, F = (M = M || {}).delimiter, $ = M.newline, I = M.comments, O = M.step, G = M.preview, K = M.fastMode, V = L = M.quoteChar === void 0 || M.quoteChar === null ? '"' : M.quoteChar; if (M.escapeChar !== void 0 && (V = M.escapeChar), (typeof F != "string" || -1 < s.BAD_DELIMITERS.indexOf(F)) && (F = ","), I === F) throw new Error("Comment character same as delimiter"); I === true ? I = "#" : (typeof I != "string" || -1 < s.BAD_DELIMITERS.indexOf(I)) && (I = false), $ !== ` ` && $ !== "\r" && $ !== `\r ` && ($ = ` `); var z = 0, P = false; this.parse = function(R, H, B) { if (typeof R != "string") throw new Error("Input must be a string"); var W = R.length, ee = F.length, re = $.length, ae = I.length, Q = S(O), ue = [], j = [], U = [], Z = z = 0; if (!R) return Pe(); if (M.header && !H) { var le = R.split($)[0].split(F), J = [], pe = {}, ge = false; for (var ve in le) { var me = le[ve]; S(M.transformHeader) && (me = M.transformHeader(me, ve)); var Le = me, ze = pe[me] || 0; for (0 < ze && (ge = true, Le = me + "_" + ze), pe[me] = ze + 1; J.includes(Le); ) Le = Le + "_" + ze; J.push(Le); } if (ge) { var Fe = R.split($); Fe[0] = J.join(F), R = Fe.join($); } } if (K || K !== false && R.indexOf(L) === -1) { for (var Oe = R.split($), Re = 0; Re < Oe.length; Re++) { if (U = Oe[Re], z += U.length, Re !== Oe.length - 1) z += $.length; else if (B) return Pe(); if (!I || U.substring(0, ae) !== I) { if (Q) { if (ue = [], ht(U.split(F)), Ie(), P) return Pe(); } else ht(U.split(F)); if (G && G <= Re) return ue = ue.slice(0, G), Pe(true); } } return Pe(); } for (var We = R.indexOf(F, z), Me = R.indexOf($, z), Ve = new RegExp(g(V) + g(L), "g"), qe = R.indexOf(L, z); ; ) if (R[z] !== L) if (I && U.length === 0 && R.substring(z, z + ae) === I) { if (Me === -1) return Pe(); z = Me + re, Me = R.indexOf($, z), We = R.indexOf(F, z); } else if (We !== -1 && (We < Me || Me === -1)) U.push(R.substring(z, We)), z = We + ee, We = R.indexOf(F, z); else { if (Me === -1) break; if (U.push(R.substring(z, Me)), ft(Me + re), Q && (Ie(), P)) return Pe(); if (G && ue.length >= G) return Pe(true); } else for (qe = z, z++; ; ) { if ((qe = R.indexOf(L, qe + 1)) === -1) return B || j.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: ue.length, index: z }), nt(); if (qe === W - 1) return nt(R.substring(z, qe).replace(Ve, L)); if (L !== V || R[qe + 1] !== V) { if (L === V || qe === 0 || R[qe - 1] !== V) { We !== -1 && We < qe + 1 && (We = R.indexOf(F, qe + 1)), Me !== -1 && Me < qe + 1 && (Me = R.indexOf($, qe + 1)); var Qe = vt(Me === -1 ? We : Math.min(We, Me)); if (R.substr(qe + 1 + Qe, ee) === F) { U.push(R.substring(z, qe).replace(Ve, L)), R[z = qe + 1 + Qe + ee] !== L && (qe = R.indexOf(L, z)), We = R.indexOf(F, z), Me = R.indexOf($, z); break; } var ot = vt(Me); if (R.substring(qe + 1 + ot, qe + 1 + ot + re) === $) { if (U.push(R.substring(z, qe).replace(Ve, L)), ft(qe + 1 + ot + re), We = R.indexOf(F, z), qe = R.indexOf(L, z), Q && (Ie(), P)) return Pe(); if (G && ue.length >= G) return Pe(true); break; } j.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: ue.length, index: z }), qe++; } } else qe++; } return nt(); function ht(Ne) { ue.push(Ne), Z = z; } function vt(Ne) { var tt = 0; if (Ne !== -1) { var Je = R.substring(qe + 1, Ne); Je && Je.trim() === "" && (tt = Je.length); } return tt; } function nt(Ne) { return B || (Ne === void 0 && (Ne = R.substring(z)), U.push(Ne), z = W, ht(U), Q && Ie()), Pe(); } function ft(Ne) { z = Ne, ht(U), U = [], Me = R.indexOf($, z); } function Pe(Ne) { return { data: ue, errors: j, meta: { delimiter: F, linebreak: $, aborted: P, truncated: !!Ne, cursor: Z + (H || 0) } }; } function Ie() { O(Pe()), ue = [], j = []; } }, this.abort = function() { P = true; }, this.getCharIndex = function() { return z; }; } function w(M) { var L = M.data, F = o[L.workerId], $ = false; if (L.error) F.userError(L.error, L.file); else if (L.results && L.results.data) { var I = { abort: function() { $ = true, k(L.workerId, { data: [], errors: [], meta: { aborted: true } }); }, pause: x, resume: x }; if (S(F.userStep)) { for (var O = 0; O < L.results.data.length && (F.userStep({ data: L.results.data[O], errors: L.results.errors, meta: L.results.meta }, I), !$); O++) ; delete L.results; } else S(F.userChunk) && (F.userChunk(L.results, I, L.file), delete L.results); } L.finished && !$ && k(L.workerId, L.results); } function k(M, L) { var F = o[M]; S(F.userComplete) && F.userComplete(L), F.terminate(), delete o[M]; } function x() { throw new Error("Not implemented."); } function _(M) { if (typeof M != "object" || M === null) return M; var L = Array.isArray(M) ? [] : {}; for (var F in M) L[F] = _(M[F]); return L; } function T(M, L) { return function() { M.apply(L, arguments); }; } function S(M) { return typeof M == "function"; } return i && (n.onmessage = function(M) { var L = M.data; if (s.WORKER_ID === void 0 && L && (s.WORKER_ID = L.workerId), typeof L.input == "string") n.postMessage({ workerId: s.WORKER_ID, results: s.parse(L.input, L.config), finished: true }); else if (n.File && L.input instanceof File || L.input instanceof Object) { var F = s.parse(L.input, L.config); F && n.postMessage({ workerId: s.WORKER_ID, results: F, finished: true }); } }), (d.prototype = Object.create(f.prototype)).constructor = d, (h.prototype = Object.create(f.prototype)).constructor = h, (p.prototype = Object.create(p.prototype)).constructor = p, (v.prototype = Object.create(f.prototype)).constructor = v, s; }); })(D8); var Que = D8.exports; var efe = Vc(Que); var tfe = (e10, t) => efe.parse(e10, { download: true, complete: t }); var o1 = { loadFile: tfe }; var E8 = { components: { PlotControls: qc }, props: { metadata: { type: Object, required: true }, sourceData: { type: Object, required: true }, plotLayout: { type: Object, required: true }, supplementalData: { type: Array, required: true }, version: { type: String, required: true }, selectorUi: { type: Boolean, default: true } }, data: function() { return { layout: { paper_bgcolor: "rgba(0,0,0,0)", plot_bgcolor: "rgba(0,0,0,0)", autosize: true, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 } }, loading: false, options: { responsive: true, scrollZoom: true } }; }, computed: { title() { return this.sourceData.url.split("\\").pop().split("/").pop().split(".")[0]; } } }; var rfe = { name: "TimeseriesPlot", components: { PlotControls: qc, ElSelect: Vu, ElButton: Gc, ElOption: qu }, mixins: [E8], data: function() { return { dataValues: markRaw([]), filterX: [], parsedData: null, time: markRaw([]), traceData: null, traceNames: [], xAxisLabel: "time" }; }, computed: { fullMetadata() { let e10 = JSON.parse(JSON.stringify(this.metadata)); return e10["y-axes-columns"] || (e10["y-axes-columns"] = []), e10["x-axis-column"] || (e10["x-axis-column"] = 0), e10["no-header"] || (e10["no-header"] = false), e10["row-major"] || (e10["row-major"] = false), e10; } }, watch: { sourceData: function() { this.loadData(this.sourceData); } }, mounted: function() { this.loadData(this.sourceData); }, methods: { loadData(e10) { e10.url ? (this.loading = true, o1.loadFile(e10.url, this.dataReady)) : Oc.react(this.$refs.plotlyplot, this.sourceData.data, this.plotLayout ? this.plotLayout : this.layout, this.options); }, dataReady(e10) { const t = Date.now(); this.fullMetadata["no-header"] && o1.loadFile(this.supplementalData[0].url, this.headerDataReady), this.loading = false, this.parsedData = markRaw(e10), this.findYaxesCols(), this.populateTime(), this.populateDataValues(), this.fullMetadata["no-header"] || (this.populateXaxisLabel(), this.populateTraceNames()), this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames), console.log(Date.now() - t); }, headerDataReady(e10) { this.traceData = markRaw(e10), this.populateXaxisLabel(), this.populateTraceNames(), this.loading || this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames); }, filterPlot() { let e10 = this.filterX; if (e10.length === 0) { this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames); return; } let t = []; for (let a of e10) t.push(this.fullMetadata["y-axes-columns"][this.traceNames.indexOf(a)]); let r = this.parsedData.data; this.fullMetadata["no-header"] || (r = r.slice(1)); let n = []; for (let a of t) { const i = r.map((o) => o[a]); n.push(i); } this.createPlot(this.time, this.xAxisLabel, n, e10); }, createPlot(e10, t, r, n) { let a = []; for (let s = 0; s < r.length; s++) a.push({ type: "scatter", mode: "lines", name: n[s], x: e10, y: r[s] }); let i = this.plotLayout ? this.plotLayout : this.layout, o = { title: { text: this.title }, xaxis: { title: { text: t } } }, l = { ...toRaw(i), ...o }; Oc.react(this.$refs.plotlyplot, a, l, this.options); }, findYaxesCols() { if (this.fullMetadata["y-axes-columns"].length === 0) { let e10 = Array(this.parsedData.data[0].length).keys(); e10.shift(), e10.shift(), this.fullMetadata["y-axes-columns"] = e10; } }, populateXaxisLabel() { this.fullMetadata["no-header"] ? this.xAxisLabel = this.traceData.data[0][this.fullMetadata["x-axis-column"]] : this.xAxisLabel = this.parsedData.data[0][this.fullMetadata["x-axis-column"]]; }, populateTraceNames() { if (this.fullMetadata["no-header"]) { this.traceNames.splice(0, this.traceNames.length); for (let e10 of this.fullMetadata["y-axes-columns"]) this.traceNames.push(this.traceData.data[0][e10]); this.$set(this.traceNames, 0, this.traceNames[0]); } else { this.traceNames = []; for (let e10 of this.fullMetadata["y-axes-columns"]) this.traceNames.push(this.parsedData.data[0][e10]); } }, populateTime() { const e10 = this; let t = this.parsedData.data; this.fullMetadata["no-header"] || (t = t.slice(1)), this.time = markRaw(t.map(function(r) { return r[e10.fullMetadata["x-axis-column"]]; })); }, populateDataValues() { let e10 = this.parsedData.data; this.fullMetadata["no-header"] || (e10 = e10.slice(1)); let t = []; for (let r of this.fullMetadata["y-axes-columns"]) { const n = e10.map((a) => a[r]); t.push(n); } this.dataValues = markRaw(t); } } }; var nfe = { ref: "plotContainer", class: "container" }; var afe = { ref: "plotlyplot", class: "vue-plotly" }; function ife(e10, t, r, n, a, i) { const o = qu, l = Vu, s = Gc, u = qc; return openBlock(), createElementBlock("div", nfe, [ createBaseVNode("div", afe, null, 512), e10.selectorUi ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(["chooser-container", { inactive: e10.loading }]) }, [ createBaseVNode("span", null, [ createVNode(l, { ref: "selectBox", modelValue: e10.filterX, "onUpdate:modelValue": t[0] || (t[0] = (f) => e10.filterX = f), class: "channel-select", size: "large", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", teleported: false, placeholder: "select" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.traceNames, (f) => (openBlock(), createBlock(o, { key: f, label: f, value: f }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), createBaseVNode("span", null, [ createVNode(s, { class: "view-heatmap-button", onClick: i.filterPlot }, { default: withCtx(() => [ createTextVNode("Filter plot") ]), _: 1 }, 8, ["onClick"]) ]) ], 2)) : createCommentVNode("", true), createVNode(u, { ref: "controls", "parent-element": { element: e10.$refs.plotContainer }, "controls-enabled": !e10.loading }, null, 8, ["parent-element", "controls-enabled"]) ], 512); } var ofe = np(rfe, [["render", ife], ["__scopeId", "data-v-ab61b52c"]]); var lfe = { name: "HeatmapPlot", components: { PlotControls: qc, ElSelect: Vu, ElOption: qu, ElCollapse: g5, ElCollapseItem: y5, ElButton: Gc, ElPopover: z1 }, mixins: [E8], data: function() { return { columnHeaders: [], rowHeaders: [], dataValues: markRaw([]), filterX: [], filterY: [], loading: false, logScale: false, logDataValues: markRaw([]) }; }, computed: { fullMetadata() { let e10 = JSON.parse(JSON.stringify(this.metadata)); return e10.columnHeaderSize || (e10.columnHeaderSize = 1), e10.columnHeaderIndex || (e10.columnHeaderIndex = 0), e10.rowHeaderSize || (e10.rowHeaderSize = 1), e10.rowHeaderIndex || (e10.rowHeaderIndex = 0), e10; }, logScaleEnabled() { return !!JSON.parse(JSON.stringify(this.metadata)).logScale; }, plotTitle() { return this.logScale ? this.title + " (Log scale)" : this.title; } }, watch: { sourceData: function() { this.loadData(this.sourceData); } }, mounted: function() { this.loadData(this.sourceData); }, methods: { loadData(e10) { e10.url ? (this.loading = true, o1.loadFile(e10.url, this.dataReady)) : Oc.react(this.$refs.plotlyplot, this.sourceData.data, this.sourceData.layout ? this.sourceData.layout : this.layout, this.options); }, dataReady(e10) { this.loading = false; const t = e10; this.populateColumnHeaders(t), this.populateRowHeaders(t), this.populateDataValues(t), this.logScaleEnabled ? (this.logValues(), this.logScale = true, this.createPlot(this.columnHeaders, this.rowHeaders, this.logDataValues, "heatmap")) : this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap"); }, logValues() { this.dataValues.forEach((e10, t) => { this.logDataValues.push([]), e10.forEach((r) => { this.logDataValues[t].push(Math.log10(r)); }); }); }, logToggle() { this.logScale ? (this.logScale = false, this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap")) : (this.logScale = true, this.createPlot(this.columnHeaders, this.rowHeaders, this.logDataValues, "heatmap")); }, filterPlot() { let e10 = this.filterX, t = this.filterY; if (e10.length === 0 && t.length === 0) { this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap"); return; } e10.length === 0 && (e10 = this.columnHeaders), t.length === 0 && (t = this.rowHeaders); let r = []; for (let i of e10) r.push(this.columnHeaders.indexOf(i)); let n = []; for (let i of t) n.push(this.rowHeaders.indexOf(i)); let a = []; for (let i of r) { const o = this.dataValues.map((s) => s[i]); let l = []; for (let s of n) l.push(o[s]); a.push(l); } a = a[0].map((i, o) => a.map((l) => l[o])), this.createPlot(e10, t, a, "heatmap"); }, createPlot(e10, t, r, n) { var a = [ { x: e10, y: t, z: r, type: n } ]; const i = { title: { text: this.plotTitle } }; Oc.react(this.$refs.plotlyplot, a, { ...this.layout, ...i, ...this.plotLayout }, this.options); }, populateColumnHeaders(e10) { let r = [...e10.data[this.fullMetadata.columnHeaderIndex]]; this.columnHeaders = r.slice(this.fullMetadata.rowHeaderSize); }, populateRowHeaders(e10) { const r = e10.data.map((n) => n[this.fullMetadata.rowHeaderIndex]); this.rowHeaders = r.slice(this.fullMetadata.columnHeaderSize); }, populateDataValues(e10) { const r = e10.data.slice(this.fullMetadata.columnHeaderSize); this.dataValues = markRaw(r.map((n) => n.slice(this.fullMetadata.rowHeaderSize))); } } }; var sfe = { ref: "plotContainer", class: "container" }; var ufe = { ref: "plotlyplot", class: "vue-plotly" }; var ffe = { key: 0 }; function cfe(e10, t, r, n, a, i) { const o = qu, l = Vu, s = Gc, u = qc; return openBlock(), createElementBlock("div", sfe, [ createBaseVNode("div", ufe, null, 512), e10.selectorUi ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(["chooser-container", { inactive: e10.loading }]) }, [ createBaseVNode("span", null, [ createVNode(l, { modelValue: e10.filterX, "onUpdate:modelValue": t[0] || (t[0] = (f) => e10.filterX = f), class: "channel-select", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", placeholder: "select" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.columnHeaders, (f) => (openBlock(), createBlock(o, { key: f, label: f, value: f }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), createBaseVNode("span", null, [ createVNode(l, { modelValue: e10.filterY, "onUpdate:modelValue": t[1] || (t[1] = (f) => e10.filterY = f), class: "channel-select", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", placeholder: "select" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(e10.rowHeaders, (f) => (openBlock(), createBlock(o, { key: f, label: f, value: f }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), createBaseVNode("span", null, [ createVNode(s, { class: "view-heatmap-button", onClick: i.filterPlot }, { default: withCtx(() => [ createTextVNode("Filter plot") ]), _: 1 }, 8, ["onClick"]) ]), i.logScaleEnabled ? (openBlock(), createElementBlock("span", ffe, [ createVNode(s, { class: "view-heatmap-button", onClick: i.logToggle }, { default: withCtx(() => [ createTextVNode("Toggle log") ]), _: 1 }, 8, ["onClick"]) ])) : createCommentVNode("", true) ], 2)) : createCommentVNode("", true), createVNode(u, { "parent-element": { element: e10.$refs.plotContainer }, "controls-enabled": !e10.loading }, null, 8, ["parent-element", "controls-enabled"]) ], 512); } var dfe = np(lfe, [["render", cfe], ["__scopeId", "data-v-e71fb8c3"]]); var hfe = ["1.2.0", "1.1.0"]; var vfe = { name: "PlotVuer", components: { TimeseriesPlot: ofe, HeatmapPlot: dfe }, props: { /** * The object with `url` property * where the `url` is the source url to load the data. */ dataSource: { type: Object, required: true, default: () => { } }, /** * The metadata object * with `version`, `type`, and `attrs` properties. */ metadata: { type: Object, required: true, validator: function(e10) { return hfe.includes(e10.version) && e10.type === "plot"; } }, /** * The plotLayout for UI. */ plotLayout: { type: Object, /** * `{ * paper_bgcolor: 'rgba(0,0,0,0)', plot_bgcolor: 'rgba(0,0,0,0)', autosize: true, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 }, loading: false, options: { responsive: true, scrollZoom: true } * }` */ default: () => ({ paper_bgcolor: "rgba(0,0,0,0)", plot_bgcolor: "rgba(0,0,0,0)", autosize: true, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 }, loading: false, options: { responsive: true, scrollZoom: true } }) }, /** * The supplemental data to load. */ supplementalData: { type: Array, default: () => [] }, /** * The option to choose helpMode. */ helpMode: { type: Boolean, default: false }, /** * The option to show the selector UI. */ selectorUi: { type: Boolean, default: true } }, computed: { plotType: function() { return this.metadata.attrs.style + "-plot"; }, layout: function() { return this.metadata ? this.metadata.attrs ? this.metadata.attrs.layout ? this.metadata.attrs.layout : this.plotLayout : this.plotLayout : this.plotLayout; } } }; var pfe = { class: "plotvuer_parent" }; function mfe(e10, t, r, n, a, i) { return openBlock(), createElementBlock("div", pfe, [ i.plotType != "-plot" ? (openBlock(), createBlock(resolveDynamicComponent(i.plotType), { key: 0, sourceData: r.dataSource, plotLayout: i.layout, version: r.metadata.version, metadata: r.metadata.attrs, selectorUi: r.selectorUi, supplementalData: r.supplementalData }, null, 8, ["sourceData", "plotLayout", "version", "metadata", "selectorUi", "supplementalData"])) : createCommentVNode("", true) ]); } var yfe = np(vfe, [["render", mfe], ["__scopeId", "data-v-72189ced"]]); export { yfe }; /*! Bundled license information: @abi-software/plotvuer/dist/plotvuer.js: (*! Element Plus Icons Vue v2.3.1 *) (*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org *) (* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs *) (* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse License: MIT *) */ //# sourceMappingURL=chunk-CRD3SALI.js.map