var PR = Object.defineProperty;
var kR = (r, t, e) => t in r ? PR(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var Hv = (r, t, e) => kR(r, typeof t != "symbol" ? t + "" : t, e);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const bf = globalThis, Iy = bf.ShadowRoot && (bf.ShadyCSS === void 0 || bf.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ly = Symbol(), T1 = /* @__PURE__ */ new WeakMap();
let dD = class {
  constructor(t, e, n) {
    if (this._$cssResult$ = !0, n !== Ly) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
    this.cssText = t, this.t = e;
  }
  get styleSheet() {
    let t = this.o;
    const e = this.t;
    if (Iy && t === void 0) {
      const n = e !== void 0 && e.length === 1;
      n && (t = T1.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), n && T1.set(e, t));
    }
    return t;
  }
  toString() {
    return this.cssText;
  }
};
const RR = (r) => new dD(typeof r == "string" ? r : r + "", void 0, Ly), Nn = (r, ...t) => {
  const e = r.length === 1 ? r[0] : t.reduce((n, i, a) => n + ((o) => {
    if (o._$cssResult$ === !0) return o.cssText;
    if (typeof o == "number") return o;
    throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
  })(i) + r[a + 1], r[0]);
  return new dD(e, r, Ly);
}, OR = (r, t) => {
  if (Iy) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
  else for (const e of t) {
    const n = document.createElement("style"), i = bf.litNonce;
    i !== void 0 && n.setAttribute("nonce", i), n.textContent = e.cssText, r.appendChild(n);
  }
}, M1 = Iy ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
  let e = "";
  for (const n of t.cssRules) e += n.cssText;
  return RR(e);
})(r) : r;
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const { is: FR, defineProperty: BR, getOwnPropertyDescriptor: NR, getOwnPropertyNames: zR, getOwnPropertySymbols: VR, getPrototypeOf: $R } = Object, qi = globalThis, I1 = qi.trustedTypes, GR = I1 ? I1.emptyScript : "", qv = qi.reactiveElementPolyfillSupport, Vl = (r, t) => r, Hf = { toAttribute(r, t) {
  switch (t) {
    case Boolean:
      r = r ? GR : null;
      break;
    case Object:
    case Array:
      r = r == null ? r : JSON.stringify(r);
  }
  return r;
}, fromAttribute(r, t) {
  let e = r;
  switch (t) {
    case Boolean:
      e = r !== null;
      break;
    case Number:
      e = r === null ? null : Number(r);
      break;
    case Object:
    case Array:
      try {
        e = JSON.parse(r);
      } catch {
        e = null;
      }
  }
  return e;
} }, Ey = (r, t) => !FR(r, t), L1 = { attribute: !0, type: String, converter: Hf, reflect: !1, useDefault: !1, hasChanged: Ey };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), qi.litPropertyMetadata ?? (qi.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
let Qo = class extends HTMLElement {
  static addInitializer(t) {
    this._$Ei(), (this.l ?? (this.l = [])).push(t);
  }
  static get observedAttributes() {
    return this.finalize(), this._$Eh && [...this._$Eh.keys()];
  }
  static createProperty(t, e = L1) {
    if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
      const n = Symbol(), i = this.getPropertyDescriptor(t, n, e);
      i !== void 0 && BR(this.prototype, t, i);
    }
  }
  static getPropertyDescriptor(t, e, n) {
    const { get: i, set: a } = NR(this.prototype, t) ?? { get() {
      return this[e];
    }, set(o) {
      this[e] = o;
    } };
    return { get: i, set(o) {
      const s = i == null ? void 0 : i.call(this);
      a == null || a.call(this, o), this.requestUpdate(t, s, n);
    }, configurable: !0, enumerable: !0 };
  }
  static getPropertyOptions(t) {
    return this.elementProperties.get(t) ?? L1;
  }
  static _$Ei() {
    if (this.hasOwnProperty(Vl("elementProperties"))) return;
    const t = $R(this);
    t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
  }
  static finalize() {
    if (this.hasOwnProperty(Vl("finalized"))) return;
    if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Vl("properties"))) {
      const e = this.properties, n = [...zR(e), ...VR(e)];
      for (const i of n) this.createProperty(i, e[i]);
    }
    const t = this[Symbol.metadata];
    if (t !== null) {
      const e = litPropertyMetadata.get(t);
      if (e !== void 0) for (const [n, i] of e) this.elementProperties.set(n, i);
    }
    this._$Eh = /* @__PURE__ */ new Map();
    for (const [e, n] of this.elementProperties) {
      const i = this._$Eu(e, n);
      i !== void 0 && this._$Eh.set(i, e);
    }
    this.elementStyles = this.finalizeStyles(this.styles);
  }
  static finalizeStyles(t) {
    const e = [];
    if (Array.isArray(t)) {
      const n = new Set(t.flat(1 / 0).reverse());
      for (const i of n) e.unshift(M1(i));
    } else t !== void 0 && e.push(M1(t));
    return e;
  }
  static _$Eu(t, e) {
    const n = e.attribute;
    return n === !1 ? void 0 : typeof n == "string" ? n : typeof t == "string" ? t.toLowerCase() : void 0;
  }
  constructor() {
    super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
  }
  _$Ev() {
    var t;
    this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
  }
  addController(t) {
    var e;
    (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
  }
  removeController(t) {
    var e;
    (e = this._$EO) == null || e.delete(t);
  }
  _$E_() {
    const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
    for (const n of e.keys()) this.hasOwnProperty(n) && (t.set(n, this[n]), delete this[n]);
    t.size > 0 && (this._$Ep = t);
  }
  createRenderRoot() {
    const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
    return OR(t, this.constructor.elementStyles), t;
  }
  connectedCallback() {
    var t;
    this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
      var n;
      return (n = e.hostConnected) == null ? void 0 : n.call(e);
    });
  }
  enableUpdating(t) {
  }
  disconnectedCallback() {
    var t;
    (t = this._$EO) == null || t.forEach((e) => {
      var n;
      return (n = e.hostDisconnected) == null ? void 0 : n.call(e);
    });
  }
  attributeChangedCallback(t, e, n) {
    this._$AK(t, n);
  }
  _$ET(t, e) {
    var a;
    const n = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, n);
    if (i !== void 0 && n.reflect === !0) {
      const o = (((a = n.converter) == null ? void 0 : a.toAttribute) !== void 0 ? n.converter : Hf).toAttribute(e, n.type);
      this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
    }
  }
  _$AK(t, e) {
    var a, o;
    const n = this.constructor, i = n._$Eh.get(t);
    if (i !== void 0 && this._$Em !== i) {
      const s = n.getPropertyOptions(i), l = typeof s.converter == "function" ? { fromAttribute: s.converter } : ((a = s.converter) == null ? void 0 : a.fromAttribute) !== void 0 ? s.converter : Hf;
      this._$Em = i;
      const u = l.fromAttribute(e, s.type);
      this[i] = u ?? ((o = this._$Ej) == null ? void 0 : o.get(i)) ?? u, this._$Em = null;
    }
  }
  requestUpdate(t, e, n, i = !1, a) {
    var o;
    if (t !== void 0) {
      const s = this.constructor;
      if (i === !1 && (a = this[t]), n ?? (n = s.getPropertyOptions(t)), !((n.hasChanged ?? Ey)(a, e) || n.useDefault && n.reflect && a === ((o = this._$Ej) == null ? void 0 : o.get(t)) && !this.hasAttribute(s._$Eu(t, n)))) return;
      this.C(t, e, n);
    }
    this.isUpdatePending === !1 && (this._$ES = this._$EP());
  }
  C(t, e, { useDefault: n, reflect: i, wrapped: a }, o) {
    n && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), a !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || n || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
  }
  async _$EP() {
    this.isUpdatePending = !0;
    try {
      await this._$ES;
    } catch (e) {
      Promise.reject(e);
    }
    const t = this.scheduleUpdate();
    return t != null && await t, !this.isUpdatePending;
  }
  scheduleUpdate() {
    return this.performUpdate();
  }
  performUpdate() {
    var n;
    if (!this.isUpdatePending) return;
    if (!this.hasUpdated) {
      if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
        for (const [a, o] of this._$Ep) this[a] = o;
        this._$Ep = void 0;
      }
      const i = this.constructor.elementProperties;
      if (i.size > 0) for (const [a, o] of i) {
        const { wrapped: s } = o, l = this[a];
        s !== !0 || this._$AL.has(a) || l === void 0 || this.C(a, void 0, o, l);
      }
    }
    let t = !1;
    const e = this._$AL;
    try {
      t = this.shouldUpdate(e), t ? (this.willUpdate(e), (n = this._$EO) == null || n.forEach((i) => {
        var a;
        return (a = i.hostUpdate) == null ? void 0 : a.call(i);
      }), this.update(e)) : this._$EM();
    } catch (i) {
      throw t = !1, this._$EM(), i;
    }
    t && this._$AE(e);
  }
  willUpdate(t) {
  }
  _$AE(t) {
    var e;
    (e = this._$EO) == null || e.forEach((n) => {
      var i;
      return (i = n.hostUpdated) == null ? void 0 : i.call(n);
    }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
  }
  _$EM() {
    this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
  }
  get updateComplete() {
    return this.getUpdateComplete();
  }
  getUpdateComplete() {
    return this._$ES;
  }
  shouldUpdate(t) {
    return !0;
  }
  update(t) {
    this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
  }
  updated(t) {
  }
  firstUpdated(t) {
  }
};
Qo.elementStyles = [], Qo.shadowRootOptions = { mode: "open" }, Qo[Vl("elementProperties")] = /* @__PURE__ */ new Map(), Qo[Vl("finalized")] = /* @__PURE__ */ new Map(), qv == null || qv({ ReactiveElement: Qo }), (qi.reactiveElementVersions ?? (qi.reactiveElementVersions = [])).push("2.1.2");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const $l = globalThis, E1 = (r) => r, qf = $l.trustedTypes, P1 = qf ? qf.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, pD = "$lit$", ki = `lit$${Math.random().toFixed(9).slice(2)}$`, gD = "?" + ki, HR = `<${gD}>`, co = document, au = () => co.createComment(""), ou = (r) => r === null || typeof r != "object" && typeof r != "function", Py = Array.isArray, qR = (r) => Py(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", Wv = `[ 	
\f\r]`, Zs = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, k1 = /-->/g, R1 = />/g, ua = RegExp(`>|${Wv}(?:([^\\s"'>=/]+)(${Wv}*=${Wv}*(?:[^ 	
\f\r"'\`<>=]|("|')|))|$)`, "g"), O1 = /'/g, F1 = /"/g, mD = /^(?:script|style|textarea|title)$/i, WR = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), ge = WR(1), fo = Symbol.for("lit-noChange"), ct = Symbol.for("lit-nothing"), B1 = /* @__PURE__ */ new WeakMap(), qa = co.createTreeWalker(co, 129);
function yD(r, t) {
  if (!Py(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
  return P1 !== void 0 ? P1.createHTML(t) : t;
}
const UR = (r, t) => {
  const e = r.length - 1, n = [];
  let i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = Zs;
  for (let s = 0; s < e; s++) {
    const l = r[s];
    let u, c, f = -1, h = 0;
    for (; h < l.length && (o.lastIndex = h, c = o.exec(l), c !== null); ) h = o.lastIndex, o === Zs ? c[1] === "!--" ? o = k1 : c[1] !== void 0 ? o = R1 : c[2] !== void 0 ? (mD.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = ua) : c[3] !== void 0 && (o = ua) : o === ua ? c[0] === ">" ? (o = i ?? Zs, f = -1) : c[1] === void 0 ? f = -2 : (f = o.lastIndex - c[2].length, u = c[1], o = c[3] === void 0 ? ua : c[3] === '"' ? F1 : O1) : o === F1 || o === O1 ? o = ua : o === k1 || o === R1 ? o = Zs : (o = ua, i = void 0);
    const v = o === ua && r[s + 1].startsWith("/>") ? " " : "";
    a += o === Zs ? l + HR : f >= 0 ? (n.push(u), l.slice(0, f) + pD + l.slice(f) + ki + v) : l + ki + (f === -2 ? s : v);
  }
  return [yD(r, a + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), n];
};
class su {
  constructor({ strings: t, _$litType$: e }, n) {
    let i;
    this.parts = [];
    let a = 0, o = 0;
    const s = t.length - 1, l = this.parts, [u, c] = UR(t, e);
    if (this.el = su.createElement(u, n), qa.currentNode = this.el.content, e === 2 || e === 3) {
      const f = this.el.content.firstChild;
      f.replaceWith(...f.childNodes);
    }
    for (; (i = qa.nextNode()) !== null && l.length < s; ) {
      if (i.nodeType === 1) {
        if (i.hasAttributes()) for (const f of i.getAttributeNames()) if (f.endsWith(pD)) {
          const h = c[o++], v = i.getAttribute(f).split(ki), d = /([.?@])?(.*)/.exec(h);
          l.push({ type: 1, index: a, name: d[2], strings: v, ctor: d[1] === "." ? ZR : d[1] === "?" ? XR : d[1] === "@" ? jR : Uh }), i.removeAttribute(f);
        } else f.startsWith(ki) && (l.push({ type: 6, index: a }), i.removeAttribute(f));
        if (mD.test(i.tagName)) {
          const f = i.textContent.split(ki), h = f.length - 1;
          if (h > 0) {
            i.textContent = qf ? qf.emptyScript : "";
            for (let v = 0; v < h; v++) i.append(f[v], au()), qa.nextNode(), l.push({ type: 2, index: ++a });
            i.append(f[h], au());
          }
        }
      } else if (i.nodeType === 8) if (i.data === gD) l.push({ type: 2, index: a });
      else {
        let f = -1;
        for (; (f = i.data.indexOf(ki, f + 1)) !== -1; ) l.push({ type: 7, index: a }), f += ki.length - 1;
      }
      a++;
    }
  }
  static createElement(t, e) {
    const n = co.createElement("template");
    return n.innerHTML = t, n;
  }
}
function ps(r, t, e = r, n) {
  var o, s;
  if (t === fo) return t;
  let i = n !== void 0 ? (o = e._$Co) == null ? void 0 : o[n] : e._$Cl;
  const a = ou(t) ? void 0 : t._$litDirective$;
  return (i == null ? void 0 : i.constructor) !== a && ((s = i == null ? void 0 : i._$AO) == null || s.call(i, !1), a === void 0 ? i = void 0 : (i = new a(r), i._$AT(r, e, n)), n !== void 0 ? (e._$Co ?? (e._$Co = []))[n] = i : e._$Cl = i), i !== void 0 && (t = ps(r, i._$AS(r, t.values), i, n)), t;
}
class YR {
  constructor(t, e) {
    this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
  }
  get parentNode() {
    return this._$AM.parentNode;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  u(t) {
    const { el: { content: e }, parts: n } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? co).importNode(e, !0);
    qa.currentNode = i;
    let a = qa.nextNode(), o = 0, s = 0, l = n[0];
    for (; l !== void 0; ) {
      if (o === l.index) {
        let u;
        l.type === 2 ? u = new ky(a, a.nextSibling, this, t) : l.type === 1 ? u = new l.ctor(a, l.name, l.strings, this, t) : l.type === 6 && (u = new KR(a, this, t)), this._$AV.push(u), l = n[++s];
      }
      o !== (l == null ? void 0 : l.index) && (a = qa.nextNode(), o++);
    }
    return qa.currentNode = co, i;
  }
  p(t) {
    let e = 0;
    for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(t, n, e), e += n.strings.length - 2) : n._$AI(t[e])), e++;
  }
}
let ky = class _D {
  get _$AU() {
    var t;
    return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
  }
  constructor(t, e, n, i) {
    this.type = 2, this._$AH = ct, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = n, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
  }
  get parentNode() {
    let t = this._$AA.parentNode;
    const e = this._$AM;
    return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
  }
  get startNode() {
    return this._$AA;
  }
  get endNode() {
    return this._$AB;
  }
  _$AI(t, e = this) {
    t = ps(this, t, e), ou(t) ? t === ct || t == null || t === "" ? (this._$AH !== ct && this._$AR(), this._$AH = ct) : t !== this._$AH && t !== fo && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : qR(t) ? this.k(t) : this._(t);
  }
  O(t) {
    return this._$AA.parentNode.insertBefore(t, this._$AB);
  }
  T(t) {
    this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
  }
  _(t) {
    this._$AH !== ct && ou(this._$AH) ? this._$AA.nextSibling.data = t : this.T(co.createTextNode(t)), this._$AH = t;
  }
  $(t) {
    var a;
    const { values: e, _$litType$: n } = t, i = typeof n == "number" ? this._$AC(t) : (n.el === void 0 && (n.el = su.createElement(yD(n.h, n.h[0]), this.options)), n);
    if (((a = this._$AH) == null ? void 0 : a._$AD) === i) this._$AH.p(e);
    else {
      const o = new YR(i, this), s = o.u(this.options);
      o.p(e), this.T(s), this._$AH = o;
    }
  }
  _$AC(t) {
    let e = B1.get(t.strings);
    return e === void 0 && B1.set(t.strings, e = new su(t)), e;
  }
  k(t) {
    Py(this._$AH) || (this._$AH = [], this._$AR());
    const e = this._$AH;
    let n, i = 0;
    for (const a of t) i === e.length ? e.push(n = new _D(this.O(au()), this.O(au()), this, this.options)) : n = e[i], n._$AI(a), i++;
    i < e.length && (this._$AR(n && n._$AB.nextSibling, i), e.length = i);
  }
  _$AR(t = this._$AA.nextSibling, e) {
    var n;
    for ((n = this._$AP) == null ? void 0 : n.call(this, !1, !0, e); t !== this._$AB; ) {
      const i = E1(t).nextSibling;
      E1(t).remove(), t = i;
    }
  }
  setConnected(t) {
    var e;
    this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
  }
};
class Uh {
  get tagName() {
    return this.element.tagName;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  constructor(t, e, n, i, a) {
    this.type = 1, this._$AH = ct, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = a, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = ct;
  }
  _$AI(t, e = this, n, i) {
    const a = this.strings;
    let o = !1;
    if (a === void 0) t = ps(this, t, e, 0), o = !ou(t) || t !== this._$AH && t !== fo, o && (this._$AH = t);
    else {
      const s = t;
      let l, u;
      for (t = a[0], l = 0; l < a.length - 1; l++) u = ps(this, s[n + l], e, l), u === fo && (u = this._$AH[l]), o || (o = !ou(u) || u !== this._$AH[l]), u === ct ? t = ct : t !== ct && (t += (u ?? "") + a[l + 1]), this._$AH[l] = u;
    }
    o && !i && this.j(t);
  }
  j(t) {
    t === ct ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
  }
}
class ZR extends Uh {
  constructor() {
    super(...arguments), this.type = 3;
  }
  j(t) {
    this.element[this.name] = t === ct ? void 0 : t;
  }
}
class XR extends Uh {
  constructor() {
    super(...arguments), this.type = 4;
  }
  j(t) {
    this.element.toggleAttribute(this.name, !!t && t !== ct);
  }
}
class jR extends Uh {
  constructor(t, e, n, i, a) {
    super(t, e, n, i, a), this.type = 5;
  }
  _$AI(t, e = this) {
    if ((t = ps(this, t, e, 0) ?? ct) === fo) return;
    const n = this._$AH, i = t === ct && n !== ct || t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive, a = t !== ct && (n === ct || i);
    i && this.element.removeEventListener(this.name, this, n), a && this.element.addEventListener(this.name, this, t), this._$AH = t;
  }
  handleEvent(t) {
    var e;
    typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
  }
}
class KR {
  constructor(t, e, n) {
    this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = n;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  _$AI(t) {
    ps(this, t);
  }
}
const Uv = $l.litHtmlPolyfillSupport;
Uv == null || Uv(su, ky), ($l.litHtmlVersions ?? ($l.litHtmlVersions = [])).push("3.3.2");
const JR = (r, t, e) => {
  const n = (e == null ? void 0 : e.renderBefore) ?? t;
  let i = n._$litPart$;
  if (i === void 0) {
    const a = (e == null ? void 0 : e.renderBefore) ?? null;
    n._$litPart$ = i = new ky(t.insertBefore(au(), a), a, void 0, e ?? {});
  }
  return i._$AI(r), i;
};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Qa = globalThis;
let wr = class extends Qo {
  constructor() {
    super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
  }
  createRenderRoot() {
    var e;
    const t = super.createRenderRoot();
    return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
  }
  update(t) {
    const e = this.render();
    this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = JR(e, this.renderRoot, this.renderOptions);
  }
  connectedCallback() {
    var t;
    super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
  }
  disconnectedCallback() {
    var t;
    super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
  }
  render() {
    return fo;
  }
};
var vD;
wr._$litElement$ = !0, wr.finalized = !0, (vD = Qa.litElementHydrateSupport) == null || vD.call(Qa, { LitElement: wr });
const Yv = Qa.litElementPolyfillSupport;
Yv == null || Yv({ LitElement: wr });
(Qa.litElementVersions ?? (Qa.litElementVersions = [])).push("4.2.2");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Ts = (r) => (t, e) => {
  e !== void 0 ? e.addInitializer(() => {
    customElements.define(r, t);
  }) : customElements.define(r, t);
};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const QR = { attribute: !0, type: String, converter: Hf, reflect: !1, hasChanged: Ey }, e5 = (r = QR, t, e) => {
  const { kind: n, metadata: i } = e;
  let a = globalThis.litPropertyMetadata.get(i);
  if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), n === "setter" && ((r = Object.create(r)).wrapped = !0), a.set(e.name, r), n === "accessor") {
    const { name: o } = e;
    return { set(s) {
      const l = t.get.call(this);
      t.set.call(this, s), this.requestUpdate(o, l, r, !0, s);
    }, init(s) {
      return s !== void 0 && this.C(o, void 0, r, s), s;
    } };
  }
  if (n === "setter") {
    const { name: o } = e;
    return function(s) {
      const l = this[o];
      t.call(this, s), this.requestUpdate(o, l, r, !0, s);
    };
  }
  throw Error("Unsupported decorator location: " + n);
};
function Re(r) {
  return (t, e) => typeof e == "object" ? e5(r, t, e) : ((n, i, a) => {
    const o = i.hasOwnProperty(a);
    return i.constructor.createProperty(a, n), o ? Object.getOwnPropertyDescriptor(i, a) : void 0;
  })(r, t, e);
}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
function Ve(r) {
  return Re({ ...r, state: !0, attribute: !1 });
}
class t5 {
  constructor() {
    this.handlers = /* @__PURE__ */ new Set(), this.currentPath = "/", this.navigationGuard = null, this.currentPath = window.location.pathname || "/", window.addEventListener("popstate", () => {
      this.handleRouteChange();
    }), document.addEventListener("click", (t) => {
      if (t.defaultPrevented) return;
      const n = t.target.closest("a");
      if (!n) return;
      const i = n.getAttribute("href");
      if (i && i.startsWith("/") && !i.startsWith("//")) {
        const a = t;
        if (a.metaKey || a.ctrlKey || a.shiftKey || a.button === 1)
          return;
        t.preventDefault(), this.navigate(i);
      }
    });
  }
  /**
   * Handle route changes and notify handlers.
   */
  handleRouteChange() {
    const t = window.location.pathname || "/";
    t !== this.currentPath && (this.currentPath = t, this.notifyHandlers());
  }
  /**
   * Notify all registered handlers of route change.
   */
  notifyHandlers() {
    for (const t of this.handlers)
      t(this.currentPath);
  }
  /**
   * Get the current path.
   */
  getPath() {
    return this.currentPath;
  }
  /**
   * Navigate to a new path.
   * Returns true if navigation succeeded, false if blocked by guard.
   */
  navigate(t) {
    if (t !== this.currentPath) {
      if (this.navigationGuard && !this.navigationGuard())
        return !1;
      this.currentPath = t, history.pushState(null, "", t), this.notifyHandlers();
    }
    return !0;
  }
  /**
   * Set a navigation guard that can prevent navigation.
   * The guard should return true to allow navigation, false to block.
   * Returns a function to clear the guard.
   */
  setNavigationGuard(t) {
    return this.navigationGuard = t, () => {
      this.navigationGuard === t && (this.navigationGuard = null);
    };
  }
  /**
   * Register a handler for route changes.
   * Returns an unsubscribe function.
   */
  onRouteChange(t) {
    return this.handlers.add(t), () => {
      this.handlers.delete(t);
    };
  }
  /**
   * Check if a path matches the current path.
   */
  isActive(t) {
    return t === "/" ? this.currentPath === "/" : this.currentPath === t || this.currentPath.startsWith(t + "/");
  }
}
function N1(r) {
  return r === "/" || r === "" ? "index" : r.startsWith("/") ? r.slice(1) : r;
}
let Zv = null;
function Li() {
  return Zv || (Zv = new t5()), Zv;
}
function r5() {
  return Li();
}
const n5 = "";
class i5 extends Error {
  constructor(t, e, n) {
    super(t), this.status = e, this.detail = n, this.name = "ApiRequestError";
  }
}
async function aa(r, t) {
  const e = await fetch(`${n5}${r}`, {
    headers: {
      "Content-Type": "application/json"
    },
    ...t
  });
  if (!e.ok) {
    let n;
    try {
      n = (await e.json()).detail;
    } catch {
    }
    throw new i5(
      `API request failed: ${e.status}`,
      e.status,
      n
    );
  }
  return e.json();
}
async function a5(r, t, e, n) {
  const i = { page: r, query: t, params: e };
  return n !== void 0 && (i.sql = n), aa("/_api/v1/sources/query", {
    method: "POST",
    body: JSON.stringify(i)
  });
}
async function o5() {
  return aa("/_api/v1/pages/menu");
}
async function s5() {
  return aa("/_api/v1/pages/docs-menu");
}
async function bD() {
  return aa("/_api/v1/pages/settings");
}
async function l5(r) {
  let t = r;
  return t.startsWith("/") && (t = t.slice(1)), t || (t = "index"), aa(`/_api/v1/pages/page/${t}`);
}
async function u5(r, t) {
  let e = r;
  return e.startsWith("/") && (e = e.slice(1)), e || (e = "index"), aa(`/_api/v1/pages/page/${e}`, {
    method: "PUT",
    body: JSON.stringify({ content: t })
  });
}
async function c5(r, t) {
  let e = r;
  return e.startsWith("/") && (e = e.slice(1)), aa(`/_api/v1/pages/page/${e}`, {
    method: "POST",
    body: JSON.stringify({ content: t })
  });
}
async function f5(r) {
  let t = r;
  return t.startsWith("/") && (t = t.slice(1)), aa(`/_api/v1/pages/page/${t}`, {
    method: "DELETE"
  });
}
const oa = Nn`
  :host {
    /* Typography */
    --lence-font-family: system-ui;
    --lence-font-mono: ui-monospace, monospace;
    --lence-font-size-xs: 0.75rem;
    --lence-font-size-sm: 0.875rem;
    --lence-font-size-base: 1rem;
    --lence-font-size-lg: 1.125rem;
    --lence-font-size-xl: 1.375rem;

    /* Colors - Background */
    --lence-bg: #ffffff;
    --lence-bg-subtle: #f9fafb;
    --lence-bg-muted: #f3f4f6;

    /* Colors - Text */
    --lence-text: #374151;
    --lence-text-muted: #6b7280;
    --lence-text-heading: #111827;

    /* Colors - Border */
    --lence-border: #e5e7eb;
    --lence-border-hover: #d1d5db;
    --lence-border-strong: #d1d5db;

    /* Colors - Primary (actions, links, active states) */
    --lence-primary: #236aa4;
    --lence-primary-bg: rgba(35, 106, 164, 0.1);

    /* Colors - Semantic */
    --lence-negative: #dc2626;
    --lence-negative-bg: #fef2f2;

    /* Sizing */
    --lence-radius: 4px;
    --lence-chart-height: 300px;
  }
`;
var h5 = Object.defineProperty, Ut = (r, t, e, n) => {
  for (var i = void 0, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = o(t, e, i) || i);
  return i && h5(t, e, i), i;
};
const n1 = class n1 extends wr {
  constructor() {
    super(...arguments), this.menu = [], this.loading = !0, this.currentPath = "/", this.showHelp = !1, this.docsMenu = [], this.siteTitle = "Lence", this.version = "", this.editMode = !1, this.editing = !1, this.showNewPageDialog = !1, this.newPagePath = "", this.newPageError = "", this.showDeleteDialog = !1, this.deleting = !1, this.deleteTargetPath = "", this.menuOpenPath = null, this.boundEditingHandler = this.handleEditingChange.bind(this);
  }
  connectedCallback() {
    super.connectedCallback(), this.loadMenu(), this.loadSettings();
    const t = Li();
    this.currentPath = t.getPath(), this.unsubscribeRouter = t.onRouteChange((e) => {
      this.currentPath = e, this.editing = !1;
    }), this.addEventListener("lence-editing-change", this.boundEditingHandler);
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.unsubscribeRouter && this.unsubscribeRouter(), this.removeEventListener("lence-editing-change", this.boundEditingHandler);
  }
  handleEditingChange(t) {
    this.editing = t.detail.editing;
  }
  async loadMenu() {
    try {
      this.menu = await o5();
    } catch (t) {
      console.error("Failed to load menu:", t), this.menu = [];
    } finally {
      this.loading = !1;
    }
  }
  async loadSettings() {
    try {
      const t = await bD();
      this.showHelp = t.showHelp, this.siteTitle = t.title, this.editMode = t.editMode, this.version = t.version, this.showHelp && (this.docsMenu = await s5());
    } catch (t) {
      console.error("Failed to load settings:", t);
    }
  }
  handleNavClick(t, e) {
    const n = t;
    n.metaKey || n.ctrlKey || n.shiftKey || n.button === 1 || (t.preventDefault(), Li().navigate(e));
  }
  isActive(t) {
    return Li().isActive(t);
  }
  isExactActive(t) {
    return this.currentPath === t;
  }
  openNewPageDialog() {
    this.showNewPageDialog = !0, this.newPagePath = "", this.newPageError = "";
  }
  closeNewPageDialog() {
    this.showNewPageDialog = !1, this.newPagePath = "", this.newPageError = "";
  }
  handleNewPageInput(t) {
    this.newPagePath = t.target.value, this.newPageError = "";
  }
  async handleCreatePage() {
    var e;
    const t = this.newPagePath.trim();
    if (!t) {
      this.newPageError = "Please enter a page path";
      return;
    }
    if (!/^[\w\-/]+$/.test(t)) {
      this.newPageError = "Invalid path (use letters, numbers, dashes, underscores)";
      return;
    }
    try {
      const n = ((e = t.split("/").pop()) == null ? void 0 : e.replace(/-/g, " ").replace(/\b\w/g, (a) => a.toUpperCase())) || "New Page", i = `---
title: ${n}
---

# ${n}

Content goes here.
`;
      await c5(t, i), this.closeNewPageDialog(), await this.loadMenu(), Li().navigate("/" + t);
    } catch (n) {
      const i = n;
      this.newPageError = i.message || "Failed to create page";
    }
  }
  handleDialogKeydown(t) {
    t.key === "Enter" ? this.handleCreatePage() : t.key === "Escape" && this.closeNewPageDialog();
  }
  openNavMenu(t, e) {
    t.stopPropagation(), this.menuOpenPath = e;
  }
  closeNavMenu() {
    this.menuOpenPath = null;
  }
  handleEditFromMenu(t) {
    this.closeNavMenu(), Li().navigate(t), setTimeout(() => {
      this.dispatchEvent(new CustomEvent("lence-request-edit", {
        bubbles: !0,
        composed: !0
      }));
    }, 100);
  }
  openDeleteDialog(t) {
    this.closeNavMenu(), this.deleteTargetPath = t, this.showDeleteDialog = !0;
  }
  closeDeleteDialog() {
    this.showDeleteDialog = !1, this.deleteTargetPath = "";
  }
  async handleDeletePage() {
    if (!this.deleting) {
      this.deleting = !0;
      try {
        let t = this.deleteTargetPath;
        t.startsWith("/") && (t = t.slice(1)), t || (t = "index"), await f5(t), this.closeDeleteDialog(), await this.loadMenu(), (this.currentPath === this.deleteTargetPath || this.deleteTargetPath === "") && Li().navigate("/");
      } catch (t) {
        console.error("Delete failed:", t), this.closeDeleteDialog();
      } finally {
        this.deleting = !1;
      }
    }
  }
  renderMenuItem(t) {
    if (t.children && t.children.length > 0) {
      const a = t.path ? ge`<a
            href="${t.path}"
            class="nav-group-title ${this.isExactActive(t.path) ? "active" : ""}"
            @click=${(o) => this.handleNavClick(o, t.path)}
          >${t.title}</a>` : ge`<div class="nav-group-title">${t.title}</div>`;
      return ge`
        <li>
          ${a}
          <ul class="nav-children">
            ${t.children.map((o) => this.renderMenuItem(o))}
          </ul>
        </li>
      `;
    }
    const e = t.path || "/", n = this.isActive(e), i = this.menuOpenPath === e;
    return ge`
      <li class="nav-item">
        <a
          href="${e}"
          class=${n ? "active" : ""}
          @click=${(a) => this.handleNavClick(a, e)}
        >
          ${t.title}
        </a>
        ${this.editMode ? ge`
              <button
                class="nav-item-menu"
                @click=${(a) => this.openNavMenu(a, e)}
              >⋯</button>
              ${i ? ge`
                    <div class="nav-dropdown-backdrop" @click=${this.closeNavMenu}></div>
                    <div class="nav-dropdown">
                      <button class="nav-dropdown-item" @click=${() => this.handleEditFromMenu(e)}>Edit</button>
                      <button class="nav-dropdown-item danger" @click=${() => this.openDeleteDialog(e)}>Delete</button>
                    </div>
                  ` : null}
            ` : null}
      </li>
    `;
  }
  render() {
    return ge`
      <header class="header">
        <div class="header-left">
          <span class="header-title">${this.siteTitle}</span>
        </div>
        <div class="header-main">
          ${this.editMode ? ge`<span class="edit-mode-badge">Edit Mode</span>` : null}
        </div>
        <div class="header-right"></div>
      </header>
      <div class="body ${this.editing ? "editing" : ""}">
        <aside class="sidebar">
          <nav>
            ${this.loading ? ge`<div class="loading">Loading...</div>` : ge`
                  <ul>
                    ${this.menu.map((t) => this.renderMenuItem(t))}
                  </ul>
                  ${this.editMode ? ge`<button class="new-page-button" @click=${this.openNewPageDialog}>+ New Page</button>` : null}
                `}
          </nav>
          ${this.showHelp ? ge`
                <nav class="docs-section">
                  <a
                    href="/_docs/"
                    class="nav-group-title ${this.isExactActive("/_docs/") ? "active" : ""}"
                    @click=${(t) => this.handleNavClick(t, "/_docs/")}
                  >Docs</a>
                  <ul class="nav-children">
                    ${this.docsMenu.map((t) => this.renderMenuItem(t))}
                  </ul>
                </nav>
              ` : null}
          ${this.version ? ge`<div class="version"><a href="https://github.com/osks/lence" target="_blank">Lence</a> ${this.version}</div>` : null}
        </aside>
        <main class="main">
          <slot></slot>
        </main>
        <aside class="sidebar-right"></aside>
      </div>
      ${this.showNewPageDialog ? ge`
            <div class="dialog-overlay" @click=${this.closeNewPageDialog}>
              <div class="dialog" @click=${(t) => t.stopPropagation()}>
                <h3>Create New Page</h3>
                <input
                  type="text"
                  class="dialog-input"
                  placeholder="path/to/page"
                  .value=${this.newPagePath}
                  @input=${this.handleNewPageInput}
                  @keydown=${this.handleDialogKeydown}
                  autofocus
                />
                ${this.newPageError ? ge`<div class="dialog-error">${this.newPageError}</div>` : null}
                <div class="dialog-buttons">
                  <button class="dialog-button" @click=${this.closeNewPageDialog}>Cancel</button>
                  <button class="dialog-button primary" @click=${this.handleCreatePage}>Create</button>
                </div>
              </div>
            </div>
          ` : null}
      ${this.showDeleteDialog ? ge`
            <div class="dialog-overlay" @click=${this.closeDeleteDialog}>
              <div class="dialog" @click=${(t) => t.stopPropagation()}>
                <h3>Delete Page</h3>
                <p>Are you sure you want to delete this page? This cannot be undone.</p>
                <div class="dialog-buttons">
                  <button class="dialog-button" @click=${this.closeDeleteDialog}>Cancel</button>
                  <button
                    class="dialog-button danger"
                    @click=${this.handleDeletePage}
                    ?disabled=${this.deleting}
                  >
                    ${this.deleting ? "Deleting..." : "Delete"}
                  </button>
                </div>
              </div>
            </div>
          ` : null}
    `;
  }
};
n1.styles = [
  oa,
  Nn`
      :host {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        font-family: var(--lence-font-family);
      }

      .header {
        display: flex;
        padding: 0 3rem;
        border-bottom: 1px solid var(--lence-border);
        background: var(--lence-bg);
      }

      .header-left {
        width: 220px;
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        box-sizing: border-box;
      }

      .header-title {
        font-size: var(--lence-font-size-base);
        font-weight: 600;
        color: var(--lence-text-heading);
      }

      .header-main {
        flex: 1;
        padding: 0.5rem 2rem;
      }

      .header-right {
        width: 220px;
        flex-shrink: 0;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 0.5rem 0;
      }

      .edit-mode-badge {
        background: #fef3c7;
        border: 1px solid #f59e0b;
        border-radius: var(--lence-radius);
        padding: 0.25rem 0.5rem;
        font-size: var(--lence-font-size-xs);
        color: #92400e;
        font-weight: 500;
      }

      .docs-section {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--lence-border);
      }

      .docs-section .nav-group-title {
        margin-top: 0;
      }

      .body {
        display: flex;
        flex: 1;
        padding: 0 3rem;
      }

      .sidebar {
        width: 220px;
        flex-shrink: 0;
        background: var(--lence-bg);
        padding: 0.75rem;
        position: sticky;
        top: 0;
        height: calc(100vh - 3rem);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
      }

      .main {
        flex: 1;
        padding: 1rem 2rem;
        min-width: 0;
      }

      .sidebar-right {
        width: 220px;
        flex-shrink: 0;
      }

      .body.editing .sidebar-right {
        display: none;
      }

      nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
      }

      nav li {
        margin-bottom: 1px;
      }

      nav a {
        display: block;
        padding: 0.3rem 0.5rem;
        border-radius: var(--lence-radius);
        text-decoration: none;
        color: var(--lence-text);
        font-size: var(--lence-font-size-sm);
        cursor: pointer;
      }

      nav a:hover {
        text-decoration: underline;
      }

      nav a.active {
        background: var(--lence-primary-bg);
        color: var(--lence-primary);
        font-weight: 500;
      }

      .nav-group-title {
        display: block;
        font-weight: 500;
        font-size: var(--lence-font-size-xs);
        color: var(--lence-text-muted);
        padding: 0.3rem 0.5rem;
        margin-top: 0.625rem;
        text-decoration: none;
        border-radius: var(--lence-radius);
        text-transform: uppercase;
        letter-spacing: 0.03em;
      }

      a.nav-group-title {
        cursor: pointer;
      }

      a.nav-group-title:hover {
        background: var(--lence-bg-muted);
      }

      a.nav-group-title.active {
        background: var(--lence-primary-bg);
        color: var(--lence-primary);
      }

      .nav-children {
        padding-left: 0.5rem;
      }

      .loading {
        color: var(--lence-text-muted);
        padding: 0.75rem;
        font-size: var(--lence-font-size-sm);
      }

      .new-page-button {
        display: block;
        width: 100%;
        margin-top: 0.75rem;
        padding: 0.5rem 0.75rem;
        font-size: var(--lence-font-size-sm);
        color: var(--lence-text-muted);
        background: none;
        border: 1px dashed var(--lence-border);
        border-radius: var(--lence-radius);
        cursor: pointer;
        text-align: left;
      }

      .new-page-button:hover {
        color: var(--lence-text);
        border-color: var(--lence-text-muted);
        background: var(--lence-bg-subtle);
      }

      .dialog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
      }

      .dialog {
        background: var(--lence-bg);
        border-radius: var(--lence-radius);
        padding: 1.5rem;
        min-width: 300px;
        max-width: 400px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
      }

      .dialog h3 {
        margin: 0 0 0.5rem 0;
        font-size: var(--lence-font-size-base);
        color: var(--lence-text-heading);
      }

      .dialog p {
        margin: 0 0 1rem 0;
        font-size: var(--lence-font-size-sm);
        color: var(--lence-text-muted);
      }

      .dialog-input {
        width: 100%;
        padding: 0.5rem 0.75rem;
        font-size: var(--lence-font-size-sm);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        box-sizing: border-box;
      }

      .dialog-input:focus {
        outline: none;
        border-color: var(--lence-primary);
      }

      .dialog-error {
        margin-top: 0.5rem;
        font-size: var(--lence-font-size-xs);
        color: var(--lence-negative);
      }

      .dialog-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
        margin-top: 1rem;
      }

      .dialog-button {
        padding: 0.5rem 1rem;
        font-size: var(--lence-font-size-sm);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        cursor: pointer;
        background: var(--lence-bg);
        color: var(--lence-text);
      }

      .dialog-button:hover {
        background: var(--lence-bg-subtle);
      }

      .dialog-button.primary {
        background: var(--lence-primary);
        border-color: var(--lence-primary);
        color: white;
      }

      .dialog-button.primary:hover {
        opacity: 0.9;
      }

      .dialog-button.danger {
        background: var(--lence-negative);
        border-color: var(--lence-negative);
        color: white;
      }

      .dialog-button.danger:hover {
        opacity: 0.9;
      }

      .nav-item {
        position: relative;
        display: flex;
        align-items: center;
      }

      .nav-item a {
        flex: 1;
        min-width: 0;
      }

      .nav-item-menu {
        position: absolute;
        right: 0.25rem;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        padding: 0.1rem 0.3rem;
        font-size: var(--lence-font-size-sm);
        color: var(--lence-text-muted);
        background: none;
        border: none;
        border-radius: var(--lence-radius);
        cursor: pointer;
        line-height: 1;
      }

      .nav-item:hover .nav-item-menu {
        opacity: 0.6;
      }

      .nav-item-menu:hover {
        opacity: 1;
        color: var(--lence-text);
      }

      .nav-dropdown-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99;
      }

      .nav-dropdown {
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 0.25rem;
        background: var(--lence-bg);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        min-width: 100px;
        z-index: 100;
      }

      .nav-dropdown-item {
        display: block;
        width: 100%;
        padding: 0.5rem 0.75rem;
        font-size: var(--lence-font-size-sm);
        text-align: left;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--lence-text);
      }

      .nav-dropdown-item:hover {
        background: var(--lence-bg-subtle);
      }

      .nav-dropdown-item.danger {
        color: var(--lence-negative);
      }

      .nav-dropdown-item.danger:hover {
        background: var(--lence-negative-bg);
      }

      .version {
        margin-top: auto;
        padding: 0.75rem;
        font-size: var(--lence-font-size-xs);
        color: var(--lence-text-muted);
      }

      .version a {
        color: inherit;
        text-decoration: none;
      }

      .version a:hover {
        text-decoration: underline;
      }

      @media (max-width: 768px) {
        .sidebar,
        .sidebar-right {
          display: none;
        }
      }
    `
];
let Tt = n1;
Ut([
  Ve()
], Tt.prototype, "menu");
Ut([
  Ve()
], Tt.prototype, "loading");
Ut([
  Ve()
], Tt.prototype, "currentPath");
Ut([
  Ve()
], Tt.prototype, "showHelp");
Ut([
  Ve()
], Tt.prototype, "docsMenu");
Ut([
  Ve()
], Tt.prototype, "siteTitle");
Ut([
  Ve()
], Tt.prototype, "version");
Ut([
  Ve()
], Tt.prototype, "editMode");
Ut([
  Ve()
], Tt.prototype, "editing");
Ut([
  Ve()
], Tt.prototype, "showNewPageDialog");
Ut([
  Ve()
], Tt.prototype, "newPagePath");
Ut([
  Ve()
], Tt.prototype, "newPageError");
Ut([
  Ve()
], Tt.prototype, "showDeleteDialog");
Ut([
  Ve()
], Tt.prototype, "deleting");
Ut([
  Ve()
], Tt.prototype, "deleteTargetPath");
Ut([
  Ve()
], Tt.prototype, "menuOpenPath");
customElements.define("lence-layout", Tt);
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const v5 = { CHILD: 2 }, d5 = (r) => (...t) => ({ _$litDirective$: r, values: t });
let p5 = class {
  constructor(t) {
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  _$AT(t, e, n) {
    this._$Ct = t, this._$AM = e, this._$Ci = n;
  }
  _$AS(t, e) {
    return this.update(t, e);
  }
  update(t, e) {
    return this.render(...e);
  }
};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
let Ig = class extends p5 {
  constructor(t) {
    if (super(t), this.it = ct, t.type !== v5.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
  }
  render(t) {
    if (t === ct || t == null) return this._t = void 0, this.it = t;
    if (t === fo) return t;
    if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
    if (t === this.it) return this._t;
    this.it = t;
    const e = [t];
    return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
  }
};
Ig.directiveName = "unsafeHTML", Ig.resultType = 1;
const z1 = d5(Ig);
class g5 {
  constructor() {
    this.state = /* @__PURE__ */ new Map(), this.handlers = /* @__PURE__ */ new Set();
  }
  /**
   * Get the current value for an input.
   */
  get(t) {
    return this.state.get(t) ?? { value: null, label: null };
  }
  /**
   * Set a value for an input and notify subscribers.
   */
  set(t, e, n) {
    this.state.set(t, { value: e, label: n ?? e }), this.notifyHandlers(t);
  }
  /**
   * Subscribe to input changes.
   * Returns an unsubscribe function.
   */
  onChange(t) {
    return this.handlers.add(t), () => {
      this.handlers.delete(t);
    };
  }
  /**
   * Clear all input state. Useful when navigating between pages.
   */
  clear() {
    this.state.clear();
  }
  notifyHandlers(t) {
    for (const e of this.handlers)
      e(t);
  }
}
const Sr = new g5();
var m5 = Object.create, Yh = Object.defineProperty, y5 = Object.getOwnPropertyDescriptor, _5 = Object.getOwnPropertyNames, b5 = Object.getPrototypeOf, S5 = Object.prototype.hasOwnProperty, SD = (r) => Yh(r, "__esModule", { value: !0 }), le = (r, t) => function() {
  return t || (0, r[Object.keys(r)[0]])((t = { exports: {} }).exports, t), t.exports;
}, xD = (r, t) => {
  SD(r);
  for (var e in t)
    Yh(r, e, { get: t[e], enumerable: !0 });
}, x5 = (r, t, e) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of _5(t))
      !S5.call(r, n) && n !== "default" && Yh(r, n, { get: () => t[n], enumerable: !(e = y5(t, n)) || e.enumerable });
  return r;
}, Zh = (r) => x5(SD(Yh(r != null ? m5(b5(r)) : {}, "default", r && r.__esModule && "default" in r ? { get: () => r.default, enumerable: !0 } : { value: r, enumerable: !0 })), r), wD = le({
  "src/grammar/tag.js"(r, t) {
    function e(a, o) {
      function s() {
        this.constructor = a;
      }
      s.prototype = o.prototype, a.prototype = new s();
    }
    function n(a, o, s, l) {
      this.message = a, this.expected = o, this.found = s, this.location = l, this.name = "SyntaxError", typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, n);
    }
    e(n, Error), n.buildMessage = function(a, o, s) {
      var l = {
        literal: function(p) {
          return '"' + c(p.text) + '"';
        },
        class: function(p) {
          var g = p.parts.map(function(m) {
            return Array.isArray(m) ? f(m[0]) + "-" + f(m[1]) : f(m);
          });
          return "[" + (p.inverted ? "^" : "") + g + "]";
        },
        any: function() {
          return "any character";
        },
        end: function() {
          return "end of input";
        },
        other: function(p) {
          return p.description;
        },
        not: function(p) {
          return "not " + h(p.expected);
        }
      };
      function u(p) {
        return p.charCodeAt(0).toString(16).toUpperCase();
      }
      function c(p) {
        return p.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(g) {
          return "\\x0" + u(g);
        }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(g) {
          return "\\x" + u(g);
        });
      }
      function f(p) {
        return p.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(g) {
          return "\\x0" + u(g);
        }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(g) {
          return "\\x" + u(g);
        });
      }
      function h(p) {
        return l[p.type](p);
      }
      function v(p) {
        var g = p.map(h), m, y;
        if (g.sort(), g.length > 0) {
          for (m = 1, y = 1; m < g.length; m++)
            g[m - 1] !== g[m] && (g[y] = g[m], y++);
          g.length = y;
        }
        switch (g.length) {
          case 1:
            return g[0];
          case 2:
            return g[0] + " or " + g[1];
          default:
            return g.slice(0, -1).join(", ") + ", or " + g[g.length - 1];
        }
      }
      function d(p) {
        return p ? '"' + c(p) + '"' : "end of input";
      }
      return "Expected " + v(a) + " but " + d(o) + " found.";
    };
    function i(a, o) {
      o = o !== void 0 ? o : {};
      var s = {}, l = { Top: f1 }, u = f1, c = "/", f = ".", h = "#", v = "=", d = "(", p = ")", g = ",", m = "[", y = "]", _ = "null", b = "true", S = "false", x = "{", w = "}", C = ":", D = '"', A = "\\", T = "n", L = "r", E = "t", I = /^[$@]/, P = /^[0-9]/, R = /^[^\0-\x1F"\\]/, F = /^[a-zA-Z0-9_\-]/, O = /^[ \n\t]/, z = dn("/", !1), G = pn("tag name"), W = pn("class"), Y = pn("id"), j = dn("=", !1), ee = dn("(", !1), ie = dn(")", !1), Me = dn(",", !1), We = pn("variable"), ve = pn("null"), ae = pn("boolean"), be = dn("[", !1), ne = dn("]", !1), de = dn("{", !1), Ke = dn("}", !1), Ge = dn(":", !1), Xe = pn("number"), at = pn("string"), pt = pn("identifier"), Yt = pn("whitespace"), Nt = function(k) {
        return { type: "variable", meta: { variable: k } };
      }, Gn = function(k) {
        return { type: "annotation", meta: { attributes: k } };
      }, vn = function(k, B) {
        return B;
      }, sc = function(k, B, $, Z) {
        B && ($ = $ || [], $.unshift({
          type: "attribute",
          name: "primary",
          value: B
        }));
        const [K, he] = Z ? ["tag", 0] : ["tag_open", 1];
        return { type: K, nesting: he, meta: { tag: k, attributes: $ } };
      }, Ys = function(k) {
        return { type: "tag_close", nesting: -1, meta: { tag: k } };
      }, Vk = function(k, B) {
        return k ? [k, ...B] : [];
      }, s1 = function(k) {
        return k;
      }, $k = function(k) {
        return k;
      }, Gk = function(k) {
        return k;
      }, Hk = function(k) {
        return k;
      }, qk = function(k) {
        return { type: "class", name: k, value: !0 };
      }, Wk = function(k) {
        return { type: "attribute", name: "id", value: k };
      }, Uk = function(k, B) {
        return { type: "attribute", name: k, value: B };
      }, Yk = function(k, B, $) {
        return B ? [B, ...$] : [];
      }, Zk = function(k, B) {
        let $ = {};
        for (let [Z, { name: K, value: he }] of B.entries())
          $[K || Z] = he;
        return new LR(k, $);
      }, l1 = function(k) {
        return k;
      }, Xk = function(k, B) {
        return { name: k, value: B };
      }, $v = function(k) {
        return k;
      }, jk = function(k, B, $) {
        return k === "@" ? [B, ...$] : new IR([B, ...$]);
      }, Kk = function() {
        return null;
      }, Jk = function() {
        return !0;
      }, Qk = function() {
        return !1;
      }, eR = function(k, B) {
        return [k, ...B];
      }, tR = function(k) {
        return k || [];
      }, rR = function(k, B) {
        return Object.assign(k, ...B);
      }, nR = function(k) {
        return k || {};
      }, iR = function(k, B) {
        return k === "$$mdtype" ? {} : { [k]: B };
      }, aR = function() {
        return parseFloat(fR());
      }, oR = function(k) {
        return k.join("");
      }, sR = function() {
        return `
`;
      }, lR = function() {
        return "\r";
      }, uR = function() {
        return "	";
      }, cR = function(k) {
        return k;
      }, V = 0, ze = 0, lc = [{ line: 1, column: 1 }], uc = [], Pe = 0, cc;
      if ("startRule" in o) {
        if (!(o.startRule in l))
          throw new Error(`Can't start parsing from rule "` + o.startRule + '".');
        u = l[o.startRule];
      }
      function fR() {
        return a.substring(ze, V);
      }
      function dn(k, B) {
        return { type: "literal", text: k, ignoreCase: B };
      }
      function hR() {
        return { type: "end" };
      }
      function pn(k) {
        return { type: "other", description: k };
      }
      function u1(k) {
        var B = lc[k], $;
        if (B)
          return B;
        for ($ = k - 1; !lc[$]; )
          $--;
        for (B = lc[$], B = {
          line: B.line,
          column: B.column
        }; $ < k; )
          a.charCodeAt($) === 10 ? (B.line++, B.column = 1) : B.column++, $++;
        return lc[k] = B, B;
      }
      var vR = typeof o.filename == "string" && o.filename.length > 0;
      function c1(k, B) {
        var $ = {};
        vR && ($.filename = o.filename);
        var Z = u1(k);
        $.start = {
          offset: k,
          line: Z.line,
          column: Z.column
        };
        var K = u1(B);
        return $.end = {
          offset: B,
          line: K.line,
          column: K.column
        }, $;
      }
      function dR() {
        uc.push({ pos: V, variants: [] });
      }
      function ft(k) {
        var B = uc[uc.length - 1];
        V < B.pos || (V > B.pos && (B.pos = V, B.variants = []), B.variants.push(k));
      }
      function pR(k, B, $) {
        return new n(n.buildMessage(k, B, $), k, B, $);
      }
      function gR() {
        var k = uc[0], B = k.pos;
        return pR(k.variants, B < a.length ? a.charAt(B) : null, B < a.length ? c1(B, B + 1) : c1(B, B));
      }
      function f1() {
        var k;
        return k = mR(), k === s && (k = yR(), k === s && (k = _R(), k === s && (k = bR()))), k;
      }
      function mR() {
        var k, B;
        return k = V, B = b1(), B === s && (B = g1()), B !== s && (ze = k, B = Nt(B)), k = B, k;
      }
      function yR() {
        var k, B, $, Z;
        if (k = V, B = v1(), B !== s) {
          for ($ = [], Z = Ue(); Z !== s; )
            $.push(Z), Z = Ue();
          ze = k, k = Gn(B);
        } else
          V = k, k = s;
        return k;
      }
      function _R() {
        var k, B, $, Z, K, he, $e, lr = function(yi) {
          Pe === 0 && ft(yi);
        };
        if (k = V, B = h1(), B !== s) {
          for ($ = [], Z = Ue(); Z !== s; )
            $.push(Z), Z = Ue();
          for (Z = V, K = Lo(), K !== s ? (he = Ue(), he === s && (he = null), ze = Z, Z = vn(B, K)) : (V = Z, Z = s), Z === s && (Z = null), K = v1(), K === s && (K = null), he = [], $e = Ue(); $e !== s; )
            he.push($e), $e = Ue();
          lr(z), a.charCodeAt(V) === 47 ? ($e = c, V++) : $e = s, $e === s && ($e = null), ze = k, k = sc(B, Z, K, $e);
        } else
          V = k, k = s;
        return k;
      }
      function bR() {
        var k, B, $, Z = function(K) {
          Pe === 0 && ft(K);
        };
        return k = V, Z(z), a.charCodeAt(V) === 47 ? (B = c, V++) : B = s, B !== s ? ($ = h1(), $ !== s ? (ze = k, k = Ys($)) : (V = k, k = s)) : (V = k, k = s), k;
      }
      function h1() {
        var k, B = function($) {
          Pe === 0 && ft($);
        };
        return B(G), Pe++, k = Hn(), Pe--, k;
      }
      function v1() {
        var k, B, $, Z;
        if (k = V, B = p1(), B !== s) {
          for ($ = [], Z = d1(); Z !== s; )
            $.push(Z), Z = d1();
          ze = k, k = Vk(B, $);
        } else
          V = k, k = s;
        return k;
      }
      function d1() {
        var k, B, $;
        if (k = V, B = [], $ = Ue(), $ !== s)
          for (; $ !== s; )
            B.push($), $ = Ue();
        else
          B = s;
        return B !== s ? ($ = p1(), $ !== s ? (ze = k, k = s1($)) : (V = k, k = s)) : (V = k, k = s), k;
      }
      function p1() {
        var k, B;
        return k = V, B = xR(), B !== s && (ze = k, B = $k(B)), k = B, k === s && (k = V, B = SR(), B !== s && (ze = k, B = Gk(B)), k = B, k === s && (k = V, B = wR(), B !== s && (ze = k, B = Hk(B)), k = B)), k;
      }
      function SR() {
        var k, B, $, Z = function(K) {
          Pe === 0 && ft(K);
        };
        return Z(W), Pe++, k = V, a.charCodeAt(V) === 46 ? (B = f, V++) : B = s, B !== s ? ($ = Hn(), $ !== s ? (ze = k, k = qk($)) : (V = k, k = s)) : (V = k, k = s), Pe--, k;
      }
      function xR() {
        var k, B, $, Z = function(K) {
          Pe === 0 && ft(K);
        };
        return Z(Y), Pe++, k = V, a.charCodeAt(V) === 35 ? (B = h, V++) : B = s, B !== s ? ($ = Hn(), $ !== s ? (ze = k, k = Wk($)) : (V = k, k = s)) : (V = k, k = s), Pe--, k;
      }
      function wR() {
        var k, B, $, Z, K = function(he) {
          Pe === 0 && ft(he);
        };
        return k = V, B = Hn(), B !== s ? (K(j), a.charCodeAt(V) === 61 ? ($ = v, V++) : $ = s, $ !== s ? (Z = Lo(), Z !== s ? (ze = k, k = Uk(B, Z)) : (V = k, k = s)) : (V = k, k = s)) : (V = k, k = s), k;
      }
      function g1() {
        var k, B, $, Z, K, he, $e, lr, yi = function(ER) {
          Pe === 0 && ft(ER);
        };
        if (k = V, B = Hn(), B !== s)
          if (yi(ee), a.charCodeAt(V) === 40 ? ($ = d, V++) : $ = s, $ !== s) {
            for (Z = [], K = Ue(); K !== s; )
              Z.push(K), K = Ue();
            for (K = V, he = m1(), he === s && (he = null), $e = [], lr = y1(); lr !== s; )
              $e.push(lr), lr = y1();
            ze = K, K = Yk(B, he, $e), yi(ie), a.charCodeAt(V) === 41 ? (he = p, V++) : he = s, he !== s ? (ze = k, k = Zk(B, K)) : (V = k, k = s);
          } else
            V = k, k = s;
        else
          V = k, k = s;
        return k;
      }
      function m1() {
        var k, B, $, Z, K = function(he) {
          Pe === 0 && ft(he);
        };
        return k = V, B = V, $ = Hn(), $ !== s ? (K(j), a.charCodeAt(V) === 61 ? (Z = v, V++) : Z = s, Z !== s ? (ze = B, B = l1($)) : (V = B, B = s)) : (V = B, B = s), B === s && (B = null), $ = Lo(), $ !== s ? (ze = k, k = Xk(B, $)) : (V = k, k = s), k;
      }
      function y1() {
        var k, B, $, Z, K, he = function($e) {
          Pe === 0 && ft($e);
        };
        for (k = V, B = [], $ = Ue(); $ !== s; )
          B.push($), $ = Ue();
        if (he(Me), a.charCodeAt(V) === 44 ? ($ = g, V++) : $ = s, $ !== s) {
          for (Z = [], K = Ue(); K !== s; )
            Z.push(K), K = Ue();
          K = m1(), K !== s ? (ze = k, k = $v(K)) : (V = k, k = s);
        } else
          V = k, k = s;
        return k;
      }
      function _1() {
        var k, B, $, Z = function(K) {
          Pe === 0 && ft(K);
        };
        for (k = V, B = [], $ = Ue(); $ !== s; )
          B.push($), $ = Ue();
        return Z(Me), a.charCodeAt(V) === 44 ? ($ = g, V++) : $ = s, $ !== s ? (B = [B, $], k = B) : (V = k, k = s), k === s && (k = null), k;
      }
      function b1() {
        var k, B, $, Z, K, he = function($e) {
          Pe === 0 && ft($e);
        };
        if (he(We), Pe++, k = V, I.test(a.charAt(V)) ? (B = a.charAt(V), V++) : B = s, B !== s)
          if ($ = Hn(), $ !== s) {
            for (Z = [], K = S1(); K !== s; )
              Z.push(K), K = S1();
            ze = k, k = jk(B, $, Z);
          } else
            V = k, k = s;
        else
          V = k, k = s;
        return Pe--, k;
      }
      function S1() {
        var k, B, $, Z;
        return k = V, a.charCodeAt(V) === 46 ? (B = f, V++) : B = s, B !== s ? ($ = Hn(), $ !== s ? (ze = k, k = l1($)) : (V = k, k = s)) : (V = k, k = s), k === s && (k = V, a.charCodeAt(V) === 91 ? (B = m, V++) : B = s, B !== s ? ($ = A1(), $ === s && ($ = Gv()), $ !== s ? (a.charCodeAt(V) === 93 ? (Z = y, V++) : Z = s, Z !== s ? (ze = k, k = $v($)) : (V = k, k = s)) : (V = k, k = s)) : (V = k, k = s)), k;
      }
      function Lo() {
        var k;
        return k = CR(), k === s && (k = AR(), k === s && (k = Gv(), k === s && (k = A1(), k === s && (k = DR(), k === s && (k = TR(), k === s && (k = g1(), k === s && (k = b1()))))))), k;
      }
      function CR() {
        var k, B, $ = function(Z) {
          Pe === 0 && ft(Z);
        };
        return $(ve), Pe++, k = V, a.substr(V, 4) === _ ? (B = _, V += 4) : B = s, B !== s && (ze = k, B = Kk()), k = B, Pe--, k;
      }
      function AR() {
        var k, B, $ = function(Z) {
          Pe === 0 && ft(Z);
        };
        return $(ae), Pe++, k = V, a.substr(V, 4) === b ? (B = b, V += 4) : B = s, B !== s && (ze = k, B = Jk()), k = B, k === s && (k = V, a.substr(V, 5) === S ? (B = S, V += 5) : B = s, B !== s && (ze = k, B = Qk()), k = B), Pe--, k;
      }
      function DR() {
        var k, B, $, Z, K, he, $e, lr = function(yi) {
          Pe === 0 && ft(yi);
        };
        if (k = V, lr(be), a.charCodeAt(V) === 91 ? (B = m, V++) : B = s, B !== s) {
          for ($ = [], Z = Ue(); Z !== s; )
            $.push(Z), Z = Ue();
          if (Z = V, K = Lo(), K !== s) {
            for (he = [], $e = x1(); $e !== s; )
              he.push($e), $e = x1();
            $e = _1(), ze = Z, Z = eR(K, he);
          } else
            V = Z, Z = s;
          for (Z === s && (Z = null), K = [], he = Ue(); he !== s; )
            K.push(he), he = Ue();
          lr(ne), a.charCodeAt(V) === 93 ? (he = y, V++) : he = s, he !== s ? (ze = k, k = tR(Z)) : (V = k, k = s);
        } else
          V = k, k = s;
        return k;
      }
      function x1() {
        var k, B, $, Z, K, he = function($e) {
          Pe === 0 && ft($e);
        };
        for (k = V, B = [], $ = Ue(); $ !== s; )
          B.push($), $ = Ue();
        if (he(Me), a.charCodeAt(V) === 44 ? ($ = g, V++) : $ = s, $ !== s) {
          for (Z = [], K = Ue(); K !== s; )
            Z.push(K), K = Ue();
          K = Lo(), K !== s ? (ze = k, k = $v(K)) : (V = k, k = s);
        } else
          V = k, k = s;
        return k;
      }
      function TR() {
        var k, B, $, Z, K, he, $e, lr = function(yi) {
          Pe === 0 && ft(yi);
        };
        if (k = V, lr(de), a.charCodeAt(V) === 123 ? (B = x, V++) : B = s, B !== s) {
          for ($ = [], Z = Ue(); Z !== s; )
            $.push(Z), Z = Ue();
          if (Z = V, K = C1(), K !== s) {
            for (he = [], $e = w1(); $e !== s; )
              he.push($e), $e = w1();
            $e = _1(), ze = Z, Z = rR(K, he);
          } else
            V = Z, Z = s;
          for (Z === s && (Z = null), K = [], he = Ue(); he !== s; )
            K.push(he), he = Ue();
          lr(Ke), a.charCodeAt(V) === 125 ? (he = w, V++) : he = s, he !== s ? (ze = k, k = nR(Z)) : (V = k, k = s);
        } else
          V = k, k = s;
        return k;
      }
      function w1() {
        var k, B, $, Z, K, he = function($e) {
          Pe === 0 && ft($e);
        };
        for (k = V, B = [], $ = Ue(); $ !== s; )
          B.push($), $ = Ue();
        if (he(Me), a.charCodeAt(V) === 44 ? ($ = g, V++) : $ = s, $ !== s) {
          for (Z = [], K = Ue(); K !== s; )
            Z.push(K), K = Ue();
          K = C1(), K !== s ? (ze = k, k = s1(K)) : (V = k, k = s);
        } else
          V = k, k = s;
        return k;
      }
      function C1() {
        var k, B, $, Z, K, he = function($e) {
          Pe === 0 && ft($e);
        };
        if (k = V, B = Hn(), B === s && (B = Gv()), B !== s)
          if (he(Ge), a.charCodeAt(V) === 58 ? ($ = C, V++) : $ = s, $ !== s) {
            for (Z = [], K = Ue(); K !== s; )
              Z.push(K), K = Ue();
            K = Lo(), K !== s ? (ze = k, k = iR(B, K)) : (V = k, k = s);
          } else
            V = k, k = s;
        else
          V = k, k = s;
        return k;
      }
      function A1() {
        var k, B, $, Z, K, he, $e = function(lr) {
          Pe === 0 && ft(lr);
        };
        if ($e(Xe), Pe++, k = V, a.charCodeAt(V) === 45 && V++, B = [], P.test(a.charAt(V)) ? ($ = a.charAt(V), V++) : $ = s, $ !== s)
          for (; $ !== s; )
            B.push($), P.test(a.charAt(V)) ? ($ = a.charAt(V), V++) : $ = s;
        else
          B = s;
        if (B !== s) {
          if ($ = V, a.charCodeAt(V) === 46 ? (Z = f, V++) : Z = s, Z !== s) {
            if (K = [], P.test(a.charAt(V)) ? (he = a.charAt(V), V++) : he = s, he !== s)
              for (; he !== s; )
                K.push(he), P.test(a.charAt(V)) ? (he = a.charAt(V), V++) : he = s;
            else
              K = s;
            K !== s ? (Z = [Z, K], $ = Z) : (V = $, $ = s);
          } else
            V = $, $ = s;
          $ === s && ($ = null), ze = k, k = aR();
        } else
          V = k, k = s;
        return Pe--, k;
      }
      function Gv() {
        var k, B, $, Z, K = function(he) {
          Pe === 0 && ft(he);
        };
        if (K(at), Pe++, k = V, a.charCodeAt(V) === 34 ? (B = D, V++) : B = s, B !== s) {
          for ($ = [], Z = D1(); Z !== s; )
            $.push(Z), Z = D1();
          a.charCodeAt(V) === 34 ? (Z = D, V++) : Z = s, Z !== s ? (ze = k, k = oR($)) : (V = k, k = s);
        } else
          V = k, k = s;
        return Pe--, k;
      }
      function D1() {
        var k;
        return R.test(a.charAt(V)) ? (k = a.charAt(V), V++) : k = s, k === s && (k = MR()), k;
      }
      function MR() {
        var k, B, $, Z;
        return k = V, a.charCodeAt(V) === 92 ? (B = A, V++) : B = s, B !== s ? (a.charCodeAt(V) === 34 ? ($ = D, V++) : $ = s, $ === s && (a.charCodeAt(V) === 92 ? ($ = A, V++) : $ = s, $ === s && ($ = V, a.charCodeAt(V) === 110 ? (Z = T, V++) : Z = s, Z !== s && (ze = $, Z = sR()), $ = Z, $ === s && ($ = V, a.charCodeAt(V) === 114 ? (Z = L, V++) : Z = s, Z !== s && (ze = $, Z = lR()), $ = Z, $ === s && ($ = V, a.charCodeAt(V) === 116 ? (Z = E, V++) : Z = s, Z !== s && (ze = $, Z = uR()), $ = Z)))), $ !== s ? (ze = k, k = cR($)) : (V = k, k = s)) : (V = k, k = s), k;
      }
      function Hn() {
        var k, B, $, Z = function(K) {
          Pe === 0 && ft(K);
        };
        if (Z(pt), Pe++, k = V, B = [], F.test(a.charAt(V)) ? ($ = a.charAt(V), V++) : $ = s, $ !== s)
          for (; $ !== s; )
            B.push($), F.test(a.charAt(V)) ? ($ = a.charAt(V), V++) : $ = s;
        else
          B = s;
        return B !== s ? k = a.substring(k, V) : k = B, Pe--, k;
      }
      function Ue() {
        var k, B = function($) {
          Pe === 0 && ft($);
        };
        return B(Yt), Pe++, O.test(a.charAt(V)) ? (k = a.charAt(V), V++) : k = s, Pe--, k;
      }
      const { Variable: IR, Function: LR } = o;
      if (dR(), cc = u(), cc !== s && V === a.length)
        return cc;
      throw cc !== s && V < a.length && ft(hR()), gR();
    }
    t.exports = {
      SyntaxError: n,
      parse: i
    };
  }
}), w5 = le({
  "node_modules/entities/lib/maps/entities.json"(r, t) {
    t.exports = { Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "⁡", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "⁡", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ﬃ", fflig: "ﬀ", ffllig: "ﬄ", Ffr: "𝔉", ffr: "𝔣", filig: "ﬁ", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "ﬂ", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "⁣", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "Ĳ", ijlig: "ĳ", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "⁣", InvisibleTimes: "⁢", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "⁢", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "‎", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ŉ", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "​", NegativeThickSpace: "​", NegativeThinSpace: "​", NegativeVeryThinSpace: "​", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: `
`, nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "⁠", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: '"', QUOT: '"', rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "‏", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "­", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "	", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: "  ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "​", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "‍", zwnj: "‌" };
  }
}), CD = le({
  "node_modules/markdown-it/lib/common/entities.js"(r, t) {
    t.exports = w5();
  }
}), Ry = le({
  "node_modules/uc.micro/categories/P/regex.js"(r, t) {
    t.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
  }
}), C5 = le({
  "node_modules/mdurl/encode.js"(r, t) {
    var e = {};
    function n(a) {
      var o, s, l = e[a];
      if (l)
        return l;
      for (l = e[a] = [], o = 0; o < 128; o++)
        s = String.fromCharCode(o), /^[0-9a-z]$/i.test(s) ? l.push(s) : l.push("%" + ("0" + o.toString(16).toUpperCase()).slice(-2));
      for (o = 0; o < a.length; o++)
        l[a.charCodeAt(o)] = a[o];
      return l;
    }
    function i(a, o, s) {
      var l, u, c, f, h, v = "";
      for (typeof o != "string" && (s = o, o = i.defaultChars), typeof s > "u" && (s = !0), h = n(o), l = 0, u = a.length; l < u; l++) {
        if (c = a.charCodeAt(l), s && c === 37 && l + 2 < u && /^[0-9a-f]{2}$/i.test(a.slice(l + 1, l + 3))) {
          v += a.slice(l, l + 3), l += 2;
          continue;
        }
        if (c < 128) {
          v += h[c];
          continue;
        }
        if (c >= 55296 && c <= 57343) {
          if (c >= 55296 && c <= 56319 && l + 1 < u && (f = a.charCodeAt(l + 1), f >= 56320 && f <= 57343)) {
            v += encodeURIComponent(a[l] + a[l + 1]), l++;
            continue;
          }
          v += "%EF%BF%BD";
          continue;
        }
        v += encodeURIComponent(a[l]);
      }
      return v;
    }
    i.defaultChars = ";/?:@&=+$,-_.!~*'()#", i.componentChars = "-_.!~*'()", t.exports = i;
  }
}), A5 = le({
  "node_modules/mdurl/decode.js"(r, t) {
    var e = {};
    function n(a) {
      var o, s, l = e[a];
      if (l)
        return l;
      for (l = e[a] = [], o = 0; o < 128; o++)
        s = String.fromCharCode(o), l.push(s);
      for (o = 0; o < a.length; o++)
        s = a.charCodeAt(o), l[s] = "%" + ("0" + s.toString(16).toUpperCase()).slice(-2);
      return l;
    }
    function i(a, o) {
      var s;
      return typeof o != "string" && (o = i.defaultChars), s = n(o), a.replace(/(%[a-f0-9]{2})+/gi, function(l) {
        var u, c, f, h, v, d, p, g = "";
        for (u = 0, c = l.length; u < c; u += 3) {
          if (f = parseInt(l.slice(u + 1, u + 3), 16), f < 128) {
            g += s[f];
            continue;
          }
          if ((f & 224) === 192 && u + 3 < c && (h = parseInt(l.slice(u + 4, u + 6), 16), (h & 192) === 128)) {
            p = f << 6 & 1984 | h & 63, p < 128 ? g += "��" : g += String.fromCharCode(p), u += 3;
            continue;
          }
          if ((f & 240) === 224 && u + 6 < c && (h = parseInt(l.slice(u + 4, u + 6), 16), v = parseInt(l.slice(u + 7, u + 9), 16), (h & 192) === 128 && (v & 192) === 128)) {
            p = f << 12 & 61440 | h << 6 & 4032 | v & 63, p < 2048 || p >= 55296 && p <= 57343 ? g += "���" : g += String.fromCharCode(p), u += 6;
            continue;
          }
          if ((f & 248) === 240 && u + 9 < c && (h = parseInt(l.slice(u + 4, u + 6), 16), v = parseInt(l.slice(u + 7, u + 9), 16), d = parseInt(l.slice(u + 10, u + 12), 16), (h & 192) === 128 && (v & 192) === 128 && (d & 192) === 128)) {
            p = f << 18 & 1835008 | h << 12 & 258048 | v << 6 & 4032 | d & 63, p < 65536 || p > 1114111 ? g += "����" : (p -= 65536, g += String.fromCharCode(55296 + (p >> 10), 56320 + (p & 1023))), u += 9;
            continue;
          }
          g += "�";
        }
        return g;
      });
    }
    i.defaultChars = ";/?:@&=+$,#", i.componentChars = "", t.exports = i;
  }
}), D5 = le({
  "node_modules/mdurl/format.js"(r, t) {
    t.exports = function(n) {
      var i = "";
      return i += n.protocol || "", i += n.slashes ? "//" : "", i += n.auth ? n.auth + "@" : "", n.hostname && n.hostname.indexOf(":") !== -1 ? i += "[" + n.hostname + "]" : i += n.hostname || "", i += n.port ? ":" + n.port : "", i += n.pathname || "", i += n.search || "", i += n.hash || "", i;
    };
  }
}), T5 = le({
  "node_modules/mdurl/parse.js"(r, t) {
    function e() {
      this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
    }
    var n = /^([a-z0-9.+-]+:)/i, i = /:[0-9]*$/, a = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, o = ["<", ">", '"', "`", " ", "\r", `
`, "	"], s = ["{", "}", "|", "\\", "^", "`"].concat(o), l = ["'"].concat(s), u = ["%", "/", "?", ";", "#"].concat(l), c = ["/", "?", "#"], f = 255, h = /^[+a-z0-9A-Z_-]{0,63}$/, v = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, d = {
      javascript: !0,
      "javascript:": !0
    }, p = {
      http: !0,
      https: !0,
      ftp: !0,
      gopher: !0,
      file: !0,
      "http:": !0,
      "https:": !0,
      "ftp:": !0,
      "gopher:": !0,
      "file:": !0
    };
    function g(m, y) {
      if (m && m instanceof e)
        return m;
      var _ = new e();
      return _.parse(m, y), _;
    }
    e.prototype.parse = function(m, y) {
      var _, b, S, x, w, C = m;
      if (C = C.trim(), !y && m.split("#").length === 1) {
        var D = a.exec(C);
        if (D)
          return this.pathname = D[1], D[2] && (this.search = D[2]), this;
      }
      var A = n.exec(C);
      if (A && (A = A[0], S = A.toLowerCase(), this.protocol = A, C = C.substr(A.length)), (y || A || C.match(/^\/\/[^@\/]+@[^@\/]+/)) && (w = C.substr(0, 2) === "//", w && !(A && d[A]) && (C = C.substr(2), this.slashes = !0)), !d[A] && (w || A && !p[A])) {
        var T = -1;
        for (_ = 0; _ < c.length; _++)
          x = C.indexOf(c[_]), x !== -1 && (T === -1 || x < T) && (T = x);
        var L, E;
        for (T === -1 ? E = C.lastIndexOf("@") : E = C.lastIndexOf("@", T), E !== -1 && (L = C.slice(0, E), C = C.slice(E + 1), this.auth = L), T = -1, _ = 0; _ < u.length; _++)
          x = C.indexOf(u[_]), x !== -1 && (T === -1 || x < T) && (T = x);
        T === -1 && (T = C.length), C[T - 1] === ":" && T--;
        var I = C.slice(0, T);
        C = C.slice(T), this.parseHost(I), this.hostname = this.hostname || "";
        var P = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
        if (!P) {
          var R = this.hostname.split(/\./);
          for (_ = 0, b = R.length; _ < b; _++) {
            var F = R[_];
            if (F && !F.match(h)) {
              for (var O = "", z = 0, G = F.length; z < G; z++)
                F.charCodeAt(z) > 127 ? O += "x" : O += F[z];
              if (!O.match(h)) {
                var W = R.slice(0, _), Y = R.slice(_ + 1), j = F.match(v);
                j && (W.push(j[1]), Y.unshift(j[2])), Y.length && (C = Y.join(".") + C), this.hostname = W.join(".");
                break;
              }
            }
          }
        }
        this.hostname.length > f && (this.hostname = ""), P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2));
      }
      var ee = C.indexOf("#");
      ee !== -1 && (this.hash = C.substr(ee), C = C.slice(0, ee));
      var ie = C.indexOf("?");
      return ie !== -1 && (this.search = C.substr(ie), C = C.slice(0, ie)), C && (this.pathname = C), p[S] && this.hostname && !this.pathname && (this.pathname = ""), this;
    }, e.prototype.parseHost = function(m) {
      var y = i.exec(m);
      y && (y = y[0], y !== ":" && (this.port = y.substr(1)), m = m.substr(0, m.length - y.length)), m && (this.hostname = m);
    }, t.exports = g;
  }
}), AD = le({
  "node_modules/mdurl/index.js"(r, t) {
    t.exports.encode = C5(), t.exports.decode = A5(), t.exports.format = D5(), t.exports.parse = T5();
  }
}), DD = le({
  "node_modules/uc.micro/properties/Any/regex.js"(r, t) {
    t.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  }
}), TD = le({
  "node_modules/uc.micro/categories/Cc/regex.js"(r, t) {
    t.exports = /[\0-\x1F\x7F-\x9F]/;
  }
}), M5 = le({
  "node_modules/uc.micro/categories/Cf/regex.js"(r, t) {
    t.exports = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
  }
}), MD = le({
  "node_modules/uc.micro/categories/Z/regex.js"(r, t) {
    t.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
  }
}), I5 = le({
  "node_modules/uc.micro/index.js"(r) {
    r.Any = DD(), r.Cc = TD(), r.Cf = M5(), r.P = Ry(), r.Z = MD();
  }
}), tt = le({
  "node_modules/markdown-it/lib/common/utils.js"(r) {
    function t(I) {
      return Object.prototype.toString.call(I);
    }
    function e(I) {
      return t(I) === "[object String]";
    }
    var n = Object.prototype.hasOwnProperty;
    function i(I, P) {
      return n.call(I, P);
    }
    function a(I) {
      var P = Array.prototype.slice.call(arguments, 1);
      return P.forEach(function(R) {
        if (R) {
          if (typeof R != "object")
            throw new TypeError(R + "must be object");
          Object.keys(R).forEach(function(F) {
            I[F] = R[F];
          });
        }
      }), I;
    }
    function o(I, P, R) {
      return [].concat(I.slice(0, P), R, I.slice(P + 1));
    }
    function s(I) {
      return !(I >= 55296 && I <= 57343 || I >= 64976 && I <= 65007 || (I & 65535) === 65535 || (I & 65535) === 65534 || I >= 0 && I <= 8 || I === 11 || I >= 14 && I <= 31 || I >= 127 && I <= 159 || I > 1114111);
    }
    function l(I) {
      if (I > 65535) {
        I -= 65536;
        var P = 55296 + (I >> 10), R = 56320 + (I & 1023);
        return String.fromCharCode(P, R);
      }
      return String.fromCharCode(I);
    }
    var u = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g, c = /&([a-z#][a-z0-9]{1,31});/gi, f = new RegExp(u.source + "|" + c.source, "gi"), h = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i, v = CD();
    function d(I, P) {
      var R = 0;
      return i(v, P) ? v[P] : P.charCodeAt(0) === 35 && h.test(P) && (R = P[1].toLowerCase() === "x" ? parseInt(P.slice(2), 16) : parseInt(P.slice(1), 10), s(R)) ? l(R) : I;
    }
    function p(I) {
      return I.indexOf("\\") < 0 ? I : I.replace(u, "$1");
    }
    function g(I) {
      return I.indexOf("\\") < 0 && I.indexOf("&") < 0 ? I : I.replace(f, function(P, R, F) {
        return R || d(P, F);
      });
    }
    var m = /[&<>"]/, y = /[&<>"]/g, _ = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;"
    };
    function b(I) {
      return _[I];
    }
    function S(I) {
      return m.test(I) ? I.replace(y, b) : I;
    }
    var x = /[.?*+^$[\]\\(){}|-]/g;
    function w(I) {
      return I.replace(x, "\\$&");
    }
    function C(I) {
      switch (I) {
        case 9:
        case 32:
          return !0;
      }
      return !1;
    }
    function D(I) {
      if (I >= 8192 && I <= 8202)
        return !0;
      switch (I) {
        case 9:
        case 10:
        case 11:
        case 12:
        case 13:
        case 32:
        case 160:
        case 5760:
        case 8239:
        case 8287:
        case 12288:
          return !0;
      }
      return !1;
    }
    var A = Ry();
    function T(I) {
      return A.test(I);
    }
    function L(I) {
      switch (I) {
        case 33:
        case 34:
        case 35:
        case 36:
        case 37:
        case 38:
        case 39:
        case 40:
        case 41:
        case 42:
        case 43:
        case 44:
        case 45:
        case 46:
        case 47:
        case 58:
        case 59:
        case 60:
        case 61:
        case 62:
        case 63:
        case 64:
        case 91:
        case 92:
        case 93:
        case 94:
        case 95:
        case 96:
        case 123:
        case 124:
        case 125:
        case 126:
          return !0;
        default:
          return !1;
      }
    }
    function E(I) {
      return I = I.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (I = I.replace(/ẞ/g, "ß")), I.toLowerCase().toUpperCase();
    }
    r.lib = {}, r.lib.mdurl = AD(), r.lib.ucmicro = I5(), r.assign = a, r.isString = e, r.has = i, r.unescapeMd = p, r.unescapeAll = g, r.isValidEntityCode = s, r.fromCodePoint = l, r.escapeHtml = S, r.arrayReplaceAt = o, r.isSpace = C, r.isWhiteSpace = D, r.isMdAsciiPunct = L, r.isPunctChar = T, r.escapeRE = w, r.normalizeReference = E;
  }
}), L5 = le({
  "node_modules/markdown-it/lib/helpers/parse_link_label.js"(r, t) {
    t.exports = function(n, i, a) {
      var o, s, l, u, c = -1, f = n.posMax, h = n.pos;
      for (n.pos = i + 1, o = 1; n.pos < f; ) {
        if (l = n.src.charCodeAt(n.pos), l === 93 && (o--, o === 0)) {
          s = !0;
          break;
        }
        if (u = n.pos, n.md.inline.skipToken(n), l === 91) {
          if (u === n.pos - 1)
            o++;
          else if (a)
            return n.pos = h, -1;
        }
      }
      return s && (c = n.pos), n.pos = h, c;
    };
  }
}), E5 = le({
  "node_modules/markdown-it/lib/helpers/parse_link_destination.js"(r, t) {
    var e = tt().unescapeAll;
    t.exports = function(i, a, o) {
      var s, l, u = 0, c = a, f = {
        ok: !1,
        pos: 0,
        lines: 0,
        str: ""
      };
      if (i.charCodeAt(a) === 60) {
        for (a++; a < o; ) {
          if (s = i.charCodeAt(a), s === 10 || s === 60)
            return f;
          if (s === 62)
            return f.pos = a + 1, f.str = e(i.slice(c + 1, a)), f.ok = !0, f;
          if (s === 92 && a + 1 < o) {
            a += 2;
            continue;
          }
          a++;
        }
        return f;
      }
      for (l = 0; a < o && (s = i.charCodeAt(a), !(s === 32 || s < 32 || s === 127)); ) {
        if (s === 92 && a + 1 < o) {
          if (i.charCodeAt(a + 1) === 32)
            break;
          a += 2;
          continue;
        }
        if (s === 40 && (l++, l > 32))
          return f;
        if (s === 41) {
          if (l === 0)
            break;
          l--;
        }
        a++;
      }
      return c === a || l !== 0 || (f.str = e(i.slice(c, a)), f.lines = u, f.pos = a, f.ok = !0), f;
    };
  }
}), P5 = le({
  "node_modules/markdown-it/lib/helpers/parse_link_title.js"(r, t) {
    var e = tt().unescapeAll;
    t.exports = function(i, a, o) {
      var s, l, u = 0, c = a, f = {
        ok: !1,
        pos: 0,
        lines: 0,
        str: ""
      };
      if (a >= o || (l = i.charCodeAt(a), l !== 34 && l !== 39 && l !== 40))
        return f;
      for (a++, l === 40 && (l = 41); a < o; ) {
        if (s = i.charCodeAt(a), s === l)
          return f.pos = a + 1, f.lines = u, f.str = e(i.slice(c + 1, a)), f.ok = !0, f;
        if (s === 40 && l === 41)
          return f;
        s === 10 ? u++ : s === 92 && a + 1 < o && (a++, i.charCodeAt(a) === 10 && u++), a++;
      }
      return f;
    };
  }
}), k5 = le({
  "node_modules/markdown-it/lib/helpers/index.js"(r) {
    r.parseLinkLabel = L5(), r.parseLinkDestination = E5(), r.parseLinkTitle = P5();
  }
}), R5 = le({
  "node_modules/markdown-it/lib/renderer.js"(r, t) {
    var e = tt().assign, n = tt().unescapeAll, i = tt().escapeHtml, a = {};
    a.code_inline = function(s, l, u, c, f) {
      var h = s[l];
      return "<code" + f.renderAttrs(h) + ">" + i(s[l].content) + "</code>";
    }, a.code_block = function(s, l, u, c, f) {
      var h = s[l];
      return "<pre" + f.renderAttrs(h) + "><code>" + i(s[l].content) + `</code></pre>
`;
    }, a.fence = function(s, l, u, c, f) {
      var h = s[l], v = h.info ? n(h.info).trim() : "", d = "", p = "", g, m, y, _, b;
      return v && (y = v.split(/(\s+)/g), d = y[0], p = y.slice(2).join("")), u.highlight ? g = u.highlight(h.content, d, p) || i(h.content) : g = i(h.content), g.indexOf("<pre") === 0 ? g + `
` : v ? (m = h.attrIndex("class"), _ = h.attrs ? h.attrs.slice() : [], m < 0 ? _.push(["class", u.langPrefix + d]) : (_[m] = _[m].slice(), _[m][1] += " " + u.langPrefix + d), b = {
        attrs: _
      }, "<pre><code" + f.renderAttrs(b) + ">" + g + `</code></pre>
`) : "<pre><code" + f.renderAttrs(h) + ">" + g + `</code></pre>
`;
    }, a.image = function(s, l, u, c, f) {
      var h = s[l];
      return h.attrs[h.attrIndex("alt")][1] = f.renderInlineAsText(h.children, u, c), f.renderToken(s, l, u);
    }, a.hardbreak = function(s, l, u) {
      return u.xhtmlOut ? `<br />
` : `<br>
`;
    }, a.softbreak = function(s, l, u) {
      return u.breaks ? u.xhtmlOut ? `<br />
` : `<br>
` : `
`;
    }, a.text = function(s, l) {
      return i(s[l].content);
    }, a.html_block = function(s, l) {
      return s[l].content;
    }, a.html_inline = function(s, l) {
      return s[l].content;
    };
    function o() {
      this.rules = e({}, a);
    }
    o.prototype.renderAttrs = function(l) {
      var u, c, f;
      if (!l.attrs)
        return "";
      for (f = "", u = 0, c = l.attrs.length; u < c; u++)
        f += " " + i(l.attrs[u][0]) + '="' + i(l.attrs[u][1]) + '"';
      return f;
    }, o.prototype.renderToken = function(l, u, c) {
      var f, h = "", v = !1, d = l[u];
      return d.hidden ? "" : (d.block && d.nesting !== -1 && u && l[u - 1].hidden && (h += `
`), h += (d.nesting === -1 ? "</" : "<") + d.tag, h += this.renderAttrs(d), d.nesting === 0 && c.xhtmlOut && (h += " /"), d.block && (v = !0, d.nesting === 1 && u + 1 < l.length && (f = l[u + 1], (f.type === "inline" || f.hidden || f.nesting === -1 && f.tag === d.tag) && (v = !1))), h += v ? `>
` : ">", h);
    }, o.prototype.renderInline = function(s, l, u) {
      for (var c, f = "", h = this.rules, v = 0, d = s.length; v < d; v++)
        c = s[v].type, typeof h[c] < "u" ? f += h[c](s, v, l, u, this) : f += this.renderToken(s, v, l);
      return f;
    }, o.prototype.renderInlineAsText = function(s, l, u) {
      for (var c = "", f = 0, h = s.length; f < h; f++)
        s[f].type === "text" ? c += s[f].content : s[f].type === "image" ? c += this.renderInlineAsText(s[f].children, l, u) : s[f].type === "softbreak" && (c += `
`);
      return c;
    }, o.prototype.render = function(s, l, u) {
      var c, f, h, v = "", d = this.rules;
      for (c = 0, f = s.length; c < f; c++)
        h = s[c].type, h === "inline" ? v += this.renderInline(s[c].children, l, u) : typeof d[h] < "u" ? v += d[s[c].type](s, c, l, u, this) : v += this.renderToken(s, c, l, u);
      return v;
    }, t.exports = o;
  }
}), Oy = le({
  "node_modules/markdown-it/lib/ruler.js"(r, t) {
    function e() {
      this.__rules__ = [], this.__cache__ = null;
    }
    e.prototype.__find__ = function(n) {
      for (var i = 0; i < this.__rules__.length; i++)
        if (this.__rules__[i].name === n)
          return i;
      return -1;
    }, e.prototype.__compile__ = function() {
      var n = this, i = [""];
      n.__rules__.forEach(function(a) {
        a.enabled && a.alt.forEach(function(o) {
          i.indexOf(o) < 0 && i.push(o);
        });
      }), n.__cache__ = {}, i.forEach(function(a) {
        n.__cache__[a] = [], n.__rules__.forEach(function(o) {
          o.enabled && (a && o.alt.indexOf(a) < 0 || n.__cache__[a].push(o.fn));
        });
      });
    }, e.prototype.at = function(n, i, a) {
      var o = this.__find__(n), s = a || {};
      if (o === -1)
        throw new Error("Parser rule not found: " + n);
      this.__rules__[o].fn = i, this.__rules__[o].alt = s.alt || [], this.__cache__ = null;
    }, e.prototype.before = function(n, i, a, o) {
      var s = this.__find__(n), l = o || {};
      if (s === -1)
        throw new Error("Parser rule not found: " + n);
      this.__rules__.splice(s, 0, {
        name: i,
        enabled: !0,
        fn: a,
        alt: l.alt || []
      }), this.__cache__ = null;
    }, e.prototype.after = function(n, i, a, o) {
      var s = this.__find__(n), l = o || {};
      if (s === -1)
        throw new Error("Parser rule not found: " + n);
      this.__rules__.splice(s + 1, 0, {
        name: i,
        enabled: !0,
        fn: a,
        alt: l.alt || []
      }), this.__cache__ = null;
    }, e.prototype.push = function(n, i, a) {
      var o = a || {};
      this.__rules__.push({
        name: n,
        enabled: !0,
        fn: i,
        alt: o.alt || []
      }), this.__cache__ = null;
    }, e.prototype.enable = function(n, i) {
      Array.isArray(n) || (n = [n]);
      var a = [];
      return n.forEach(function(o) {
        var s = this.__find__(o);
        if (s < 0) {
          if (i)
            return;
          throw new Error("Rules manager: invalid rule name " + o);
        }
        this.__rules__[s].enabled = !0, a.push(o);
      }, this), this.__cache__ = null, a;
    }, e.prototype.enableOnly = function(n, i) {
      Array.isArray(n) || (n = [n]), this.__rules__.forEach(function(a) {
        a.enabled = !1;
      }), this.enable(n, i);
    }, e.prototype.disable = function(n, i) {
      Array.isArray(n) || (n = [n]);
      var a = [];
      return n.forEach(function(o) {
        var s = this.__find__(o);
        if (s < 0) {
          if (i)
            return;
          throw new Error("Rules manager: invalid rule name " + o);
        }
        this.__rules__[s].enabled = !1, a.push(o);
      }, this), this.__cache__ = null, a;
    }, e.prototype.getRules = function(n) {
      return this.__cache__ === null && this.__compile__(), this.__cache__[n] || [];
    }, t.exports = e;
  }
}), O5 = le({
  "node_modules/markdown-it/lib/rules_core/normalize.js"(r, t) {
    var e = /\r\n?|\n/g, n = /\0/g;
    t.exports = function(a) {
      var o;
      o = a.src.replace(e, `
`), o = o.replace(n, "�"), a.src = o;
    };
  }
}), F5 = le({
  "node_modules/markdown-it/lib/rules_core/block.js"(r, t) {
    t.exports = function(n) {
      var i;
      n.inlineMode ? (i = new n.Token("inline", "", 0), i.content = n.src, i.map = [0, 1], i.children = [], n.tokens.push(i)) : n.md.block.parse(n.src, n.md, n.env, n.tokens);
    };
  }
}), B5 = le({
  "node_modules/markdown-it/lib/rules_core/inline.js"(r, t) {
    t.exports = function(n) {
      var i = n.tokens, a, o, s;
      for (o = 0, s = i.length; o < s; o++)
        a = i[o], a.type === "inline" && n.md.inline.parse(a.content, n.md, n.env, a.children);
    };
  }
}), N5 = le({
  "node_modules/markdown-it/lib/rules_core/linkify.js"(r, t) {
    var e = tt().arrayReplaceAt;
    function n(a) {
      return /^<a[>\s]/i.test(a);
    }
    function i(a) {
      return /^<\/a\s*>/i.test(a);
    }
    t.exports = function(o) {
      var s, l, u, c, f, h, v, d, p, g, m, y, _, b, S, x, w = o.tokens, C;
      if (o.md.options.linkify) {
        for (l = 0, u = w.length; l < u; l++)
          if (!(w[l].type !== "inline" || !o.md.linkify.pretest(w[l].content)))
            for (c = w[l].children, _ = 0, s = c.length - 1; s >= 0; s--) {
              if (h = c[s], h.type === "link_close") {
                for (s--; c[s].level !== h.level && c[s].type !== "link_open"; )
                  s--;
                continue;
              }
              if (h.type === "html_inline" && (n(h.content) && _ > 0 && _--, i(h.content) && _++), !(_ > 0) && h.type === "text" && o.md.linkify.test(h.content)) {
                for (p = h.content, C = o.md.linkify.match(p), v = [], y = h.level, m = 0, d = 0; d < C.length; d++)
                  b = C[d].url, S = o.md.normalizeLink(b), o.md.validateLink(S) && (x = C[d].text, C[d].schema ? C[d].schema === "mailto:" && !/^mailto:/i.test(x) ? x = o.md.normalizeLinkText("mailto:" + x).replace(/^mailto:/, "") : x = o.md.normalizeLinkText(x) : x = o.md.normalizeLinkText("http://" + x).replace(/^http:\/\//, ""), g = C[d].index, g > m && (f = new o.Token("text", "", 0), f.content = p.slice(m, g), f.level = y, v.push(f)), f = new o.Token("link_open", "a", 1), f.attrs = [["href", S]], f.level = y++, f.markup = "linkify", f.info = "auto", v.push(f), f = new o.Token("text", "", 0), f.content = x, f.level = y, v.push(f), f = new o.Token("link_close", "a", -1), f.level = --y, f.markup = "linkify", f.info = "auto", v.push(f), m = C[d].lastIndex);
                m < p.length && (f = new o.Token("text", "", 0), f.content = p.slice(m), f.level = y, v.push(f)), w[l].children = c = e(c, s, v);
              }
            }
      }
    };
  }
}), z5 = le({
  "node_modules/markdown-it/lib/rules_core/replacements.js"(r, t) {
    var e = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, n = /\((c|tm|r|p)\)/i, i = /\((c|tm|r|p)\)/ig, a = {
      c: "©",
      r: "®",
      p: "§",
      tm: "™"
    };
    function o(u, c) {
      return a[c.toLowerCase()];
    }
    function s(u) {
      var c, f, h = 0;
      for (c = u.length - 1; c >= 0; c--)
        f = u[c], f.type === "text" && !h && (f.content = f.content.replace(i, o)), f.type === "link_open" && f.info === "auto" && h--, f.type === "link_close" && f.info === "auto" && h++;
    }
    function l(u) {
      var c, f, h = 0;
      for (c = u.length - 1; c >= 0; c--)
        f = u[c], f.type === "text" && !h && e.test(f.content) && (f.content = f.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1—").replace(/(^|\s)--(?=\s|$)/mg, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1–")), f.type === "link_open" && f.info === "auto" && h--, f.type === "link_close" && f.info === "auto" && h++;
    }
    t.exports = function(c) {
      var f;
      if (c.md.options.typographer)
        for (f = c.tokens.length - 1; f >= 0; f--)
          c.tokens[f].type === "inline" && (n.test(c.tokens[f].content) && s(c.tokens[f].children), e.test(c.tokens[f].content) && l(c.tokens[f].children));
    };
  }
}), V5 = le({
  "node_modules/markdown-it/lib/rules_core/smartquotes.js"(r, t) {
    var e = tt().isWhiteSpace, n = tt().isPunctChar, i = tt().isMdAsciiPunct, a = /['"]/, o = /['"]/g, s = "’";
    function l(c, f, h) {
      return c.substr(0, f) + h + c.substr(f + 1);
    }
    function u(c, f) {
      var h, v, d, p, g, m, y, _, b, S, x, w, C, D, A, T, L, E, I, P, R;
      for (I = [], h = 0; h < c.length; h++) {
        for (v = c[h], y = c[h].level, L = I.length - 1; L >= 0 && !(I[L].level <= y); L--)
          ;
        if (I.length = L + 1, v.type === "text") {
          d = v.content, g = 0, m = d.length;
          e:
            for (; g < m && (o.lastIndex = g, p = o.exec(d), !!p); ) {
              if (A = T = !0, g = p.index + 1, E = p[0] === "'", b = 32, p.index - 1 >= 0)
                b = d.charCodeAt(p.index - 1);
              else
                for (L = h - 1; L >= 0 && !(c[L].type === "softbreak" || c[L].type === "hardbreak"); L--)
                  if (c[L].content) {
                    b = c[L].content.charCodeAt(c[L].content.length - 1);
                    break;
                  }
              if (S = 32, g < m)
                S = d.charCodeAt(g);
              else
                for (L = h + 1; L < c.length && !(c[L].type === "softbreak" || c[L].type === "hardbreak"); L++)
                  if (c[L].content) {
                    S = c[L].content.charCodeAt(0);
                    break;
                  }
              if (x = i(b) || n(String.fromCharCode(b)), w = i(S) || n(String.fromCharCode(S)), C = e(b), D = e(S), D ? A = !1 : w && (C || x || (A = !1)), C ? T = !1 : x && (D || w || (T = !1)), S === 34 && p[0] === '"' && b >= 48 && b <= 57 && (T = A = !1), A && T && (A = x, T = w), !A && !T) {
                E && (v.content = l(v.content, p.index, s));
                continue;
              }
              if (T) {
                for (L = I.length - 1; L >= 0 && (_ = I[L], !(I[L].level < y)); L--)
                  if (_.single === E && I[L].level === y) {
                    _ = I[L], E ? (P = f.md.options.quotes[2], R = f.md.options.quotes[3]) : (P = f.md.options.quotes[0], R = f.md.options.quotes[1]), v.content = l(v.content, p.index, R), c[_.token].content = l(c[_.token].content, _.pos, P), g += R.length - 1, _.token === h && (g += P.length - 1), d = v.content, m = d.length, I.length = L;
                    continue e;
                  }
              }
              A ? I.push({
                token: h,
                pos: p.index,
                single: E,
                level: y
              }) : T && E && (v.content = l(v.content, p.index, s));
            }
        }
      }
    }
    t.exports = function(f) {
      var h;
      if (f.md.options.typographer)
        for (h = f.tokens.length - 1; h >= 0; h--)
          f.tokens[h].type !== "inline" || !a.test(f.tokens[h].content) || u(f.tokens[h].children, f);
    };
  }
}), Fy = le({
  "node_modules/markdown-it/lib/token.js"(r, t) {
    function e(n, i, a) {
      this.type = n, this.tag = i, this.attrs = null, this.map = null, this.nesting = a, this.level = 0, this.children = null, this.content = "", this.markup = "", this.info = "", this.meta = null, this.block = !1, this.hidden = !1;
    }
    e.prototype.attrIndex = function(i) {
      var a, o, s;
      if (!this.attrs)
        return -1;
      for (a = this.attrs, o = 0, s = a.length; o < s; o++)
        if (a[o][0] === i)
          return o;
      return -1;
    }, e.prototype.attrPush = function(i) {
      this.attrs ? this.attrs.push(i) : this.attrs = [i];
    }, e.prototype.attrSet = function(i, a) {
      var o = this.attrIndex(i), s = [i, a];
      o < 0 ? this.attrPush(s) : this.attrs[o] = s;
    }, e.prototype.attrGet = function(i) {
      var a = this.attrIndex(i), o = null;
      return a >= 0 && (o = this.attrs[a][1]), o;
    }, e.prototype.attrJoin = function(i, a) {
      var o = this.attrIndex(i);
      o < 0 ? this.attrPush([i, a]) : this.attrs[o][1] = this.attrs[o][1] + " " + a;
    }, t.exports = e;
  }
}), $5 = le({
  "node_modules/markdown-it/lib/rules_core/state_core.js"(r, t) {
    var e = Fy();
    function n(i, a, o) {
      this.src = i, this.env = o, this.tokens = [], this.inlineMode = !1, this.md = a;
    }
    n.prototype.Token = e, t.exports = n;
  }
}), G5 = le({
  "node_modules/markdown-it/lib/parser_core.js"(r, t) {
    var e = Oy(), n = [
      ["normalize", O5()],
      ["block", F5()],
      ["inline", B5()],
      ["linkify", N5()],
      ["replacements", z5()],
      ["smartquotes", V5()]
    ];
    function i() {
      this.ruler = new e();
      for (var a = 0; a < n.length; a++)
        this.ruler.push(n[a][0], n[a][1]);
    }
    i.prototype.process = function(a) {
      var o, s, l;
      for (l = this.ruler.getRules(""), o = 0, s = l.length; o < s; o++)
        l[o](a);
    }, i.prototype.State = $5(), t.exports = i;
  }
}), H5 = le({
  "node_modules/markdown-it/lib/rules_block/table.js"(r, t) {
    var e = tt().isSpace;
    function n(a, o) {
      var s = a.bMarks[o] + a.tShift[o], l = a.eMarks[o];
      return a.src.substr(s, l - s);
    }
    function i(a) {
      var o = [], s = 0, l = a.length, u, c = !1, f = 0, h = "";
      for (u = a.charCodeAt(s); s < l; )
        u === 124 && (c ? (h += a.substring(f, s - 1), f = s) : (o.push(h + a.substring(f, s)), h = "", f = s + 1)), c = u === 92, s++, u = a.charCodeAt(s);
      return o.push(h + a.substring(f)), o;
    }
    t.exports = function(o, s, l, u) {
      var c, f, h, v, d, p, g, m, y, _, b, S, x, w, C, D, A, T;
      if (s + 2 > l || (p = s + 1, o.sCount[p] < o.blkIndent) || !o.md.options.allowIndentation && o.sCount[p] - o.blkIndent >= 4 || (h = o.bMarks[p] + o.tShift[p], h >= o.eMarks[p]) || (A = o.src.charCodeAt(h++), A !== 124 && A !== 45 && A !== 58) || h >= o.eMarks[p] || (T = o.src.charCodeAt(h++), T !== 124 && T !== 45 && T !== 58 && !e(T)) || A === 45 && e(T))
        return !1;
      for (; h < o.eMarks[p]; ) {
        if (c = o.src.charCodeAt(h), c !== 124 && c !== 45 && c !== 58 && !e(c))
          return !1;
        h++;
      }
      for (f = n(o, s + 1), g = f.split("|"), _ = [], v = 0; v < g.length; v++) {
        if (b = g[v].trim(), !b) {
          if (v === 0 || v === g.length - 1)
            continue;
          return !1;
        }
        if (!/^:?-+:?$/.test(b))
          return !1;
        b.charCodeAt(b.length - 1) === 58 ? _.push(b.charCodeAt(0) === 58 ? "center" : "right") : b.charCodeAt(0) === 58 ? _.push("left") : _.push("");
      }
      if (f = n(o, s).trim(), f.indexOf("|") === -1 || !o.md.options.allowIndentation && o.sCount[s] - o.blkIndent >= 4 || (g = i(f), g.length && g[0] === "" && g.shift(), g.length && g[g.length - 1] === "" && g.pop(), m = g.length, m === 0 || m !== _.length))
        return !1;
      if (u)
        return !0;
      for (w = o.parentType, o.parentType = "table", D = o.md.block.ruler.getRules("blockquote"), y = o.push("table_open", "table", 1), y.map = S = [s, 0], y = o.push("thead_open", "thead", 1), y.map = [s, s + 1], y = o.push("tr_open", "tr", 1), y.map = [s, s + 1], v = 0; v < g.length; v++)
        y = o.push("th_open", "th", 1), _[v] && (y.attrs = [["style", "text-align:" + _[v]]]), y = o.push("inline", "", 0), y.content = g[v].trim(), y.children = [], y = o.push("th_close", "th", -1);
      for (y = o.push("tr_close", "tr", -1), y = o.push("thead_close", "thead", -1), p = s + 2; p < l && !(o.sCount[p] < o.blkIndent); p++) {
        for (C = !1, v = 0, d = D.length; v < d; v++)
          if (D[v](o, p, l, !0)) {
            C = !0;
            break;
          }
        if (C || (f = n(o, p).trim(), !f) || !o.md.options.allowIndentation && o.sCount[p] - o.blkIndent >= 4)
          break;
        for (g = i(f), g.length && g[0] === "" && g.shift(), g.length && g[g.length - 1] === "" && g.pop(), p === s + 2 && (y = o.push("tbody_open", "tbody", 1), y.map = x = [s + 2, 0]), y = o.push("tr_open", "tr", 1), y.map = [p, p + 1], v = 0; v < m; v++)
          y = o.push("td_open", "td", 1), _[v] && (y.attrs = [["style", "text-align:" + _[v]]]), y = o.push("inline", "", 0), y.content = g[v] ? g[v].trim() : "", y.children = [], y = o.push("td_close", "td", -1);
        y = o.push("tr_close", "tr", -1);
      }
      return x && (y = o.push("tbody_close", "tbody", -1), x[1] = p), y = o.push("table_close", "table", -1), S[1] = p, o.parentType = w, o.line = p, !0;
    };
  }
}), q5 = le({
  "node_modules/markdown-it/lib/rules_block/code.js"(r, t) {
    t.exports = function(n, i, a) {
      if (n.md.options.allowIndentation)
        return !1;
      var o, s, l;
      if (n.sCount[i] - n.blkIndent < 4)
        return !1;
      for (s = o = i + 1; o < a; ) {
        if (n.isEmpty(o)) {
          o++;
          continue;
        }
        if (n.sCount[o] - n.blkIndent >= 4) {
          o++, s = o;
          continue;
        }
        break;
      }
      return n.line = s, l = n.push("code_block", "code", 0), l.content = n.getLines(i, s, 4 + n.blkIndent, !1) + `
`, l.map = [i, n.line], !0;
    };
  }
}), W5 = le({
  "node_modules/markdown-it/lib/rules_block/fence.js"(r, t) {
    t.exports = function(n, i, a, o) {
      var s, l, u, c, f, h, v, d = !1, p = n.bMarks[i] + n.tShift[i], g = n.eMarks[i];
      if (!n.md.options.allowIndentation && n.sCount[i] - n.blkIndent >= 4 || p + 3 > g || (s = n.src.charCodeAt(p), s !== 126 && s !== 96) || (f = p, p = n.skipChars(p, s), l = p - f, l < 3) || (v = n.src.slice(f, p), u = n.src.slice(p, g), s === 96 && u.indexOf(String.fromCharCode(s)) >= 0))
        return !1;
      if (o)
        return !0;
      for (c = i; c++, !(c >= a || (p = f = n.bMarks[c] + n.tShift[c], g = n.eMarks[c], p < g && n.sCount[c] < n.blkIndent)); )
        if (n.src.charCodeAt(p) === s && !(!n.md.options.allowIndentation && n.sCount[c] - n.blkIndent >= 4) && (p = n.skipChars(p, s), !(p - f < l) && (p = n.skipSpaces(p), !(p < g)))) {
          d = !0;
          break;
        }
      return l = n.sCount[i], n.line = c + (d ? 1 : 0), h = n.push("fence", "code", 0), h.info = u, h.content = n.getLines(i + 1, c, l, !0), h.markup = v, h.map = [i, n.line], !0;
    };
  }
}), U5 = le({
  "node_modules/markdown-it/lib/rules_block/blockquote.js"(r, t) {
    var e = tt().isSpace;
    t.exports = function(i, a, o, s) {
      var l, u, c, f, h, v, d, p, g, m, y, _, b, S, x, w, C, D, A, T, L = i.lineMax, E = i.bMarks[a] + i.tShift[a], I = i.eMarks[a];
      if (!i.md.options.allowIndentation && i.sCount[a] - i.blkIndent >= 4 || i.src.charCodeAt(E++) !== 62)
        return !1;
      if (s)
        return !0;
      for (f = g = i.sCount[a] + 1, i.src.charCodeAt(E) === 32 ? (E++, f++, g++, l = !1, w = !0) : i.src.charCodeAt(E) === 9 ? (w = !0, (i.bsCount[a] + g) % 4 === 3 ? (E++, f++, g++, l = !1) : l = !0) : w = !1, m = [i.bMarks[a]], i.bMarks[a] = E; E < I && (u = i.src.charCodeAt(E), e(u)); ) {
        u === 9 ? g += 4 - (g + i.bsCount[a] + (l ? 1 : 0)) % 4 : g++;
        E++;
      }
      for (y = [i.bsCount[a]], i.bsCount[a] = i.sCount[a] + 1 + (w ? 1 : 0), v = E >= I, S = [i.sCount[a]], i.sCount[a] = g - f, x = [i.tShift[a]], i.tShift[a] = E - i.bMarks[a], D = i.md.block.ruler.getRules("blockquote"), b = i.parentType, i.parentType = "blockquote", p = a + 1; p < o && (T = i.sCount[p] < i.blkIndent, E = i.bMarks[p] + i.tShift[p], I = i.eMarks[p], !(E >= I)); p++) {
        if (i.src.charCodeAt(E++) === 62 && !T) {
          for (f = g = i.sCount[p] + 1, i.src.charCodeAt(E) === 32 ? (E++, f++, g++, l = !1, w = !0) : i.src.charCodeAt(E) === 9 ? (w = !0, (i.bsCount[p] + g) % 4 === 3 ? (E++, f++, g++, l = !1) : l = !0) : w = !1, m.push(i.bMarks[p]), i.bMarks[p] = E; E < I && (u = i.src.charCodeAt(E), e(u)); ) {
            u === 9 ? g += 4 - (g + i.bsCount[p] + (l ? 1 : 0)) % 4 : g++;
            E++;
          }
          v = E >= I, y.push(i.bsCount[p]), i.bsCount[p] = i.sCount[p] + 1 + (w ? 1 : 0), S.push(i.sCount[p]), i.sCount[p] = g - f, x.push(i.tShift[p]), i.tShift[p] = E - i.bMarks[p];
          continue;
        }
        if (v)
          break;
        for (C = !1, c = 0, h = D.length; c < h; c++)
          if (D[c](i, p, o, !0)) {
            C = !0;
            break;
          }
        if (C) {
          i.lineMax = p, i.blkIndent !== 0 && (m.push(i.bMarks[p]), y.push(i.bsCount[p]), x.push(i.tShift[p]), S.push(i.sCount[p]), i.sCount[p] -= i.blkIndent);
          break;
        }
        m.push(i.bMarks[p]), y.push(i.bsCount[p]), x.push(i.tShift[p]), S.push(i.sCount[p]), i.sCount[p] = -1;
      }
      for (_ = i.blkIndent, i.blkIndent = 0, A = i.push("blockquote_open", "blockquote", 1), A.markup = ">", A.map = d = [a, 0], i.md.block.tokenize(i, a, p), A = i.push("blockquote_close", "blockquote", -1), A.markup = ">", i.lineMax = L, i.parentType = b, d[1] = i.line, c = 0; c < x.length; c++)
        i.bMarks[c + a] = m[c], i.tShift[c + a] = x[c], i.sCount[c + a] = S[c], i.bsCount[c + a] = y[c];
      return i.blkIndent = _, !0;
    };
  }
}), Y5 = le({
  "node_modules/markdown-it/lib/rules_block/hr.js"(r, t) {
    var e = tt().isSpace;
    t.exports = function(i, a, o, s) {
      var l, u, c, f, h = i.bMarks[a] + i.tShift[a], v = i.eMarks[a];
      if (!i.md.options.allowIndentation && i.sCount[a] - i.blkIndent >= 4 || (l = i.src.charCodeAt(h++), l !== 42 && l !== 45 && l !== 95))
        return !1;
      for (u = 1; h < v; ) {
        if (c = i.src.charCodeAt(h++), c !== l && !e(c))
          return !1;
        c === l && u++;
      }
      return u < 3 ? !1 : (s || (i.line = a + 1, f = i.push("hr", "hr", 0), f.map = [a, i.line], f.markup = Array(u + 1).join(String.fromCharCode(l))), !0);
    };
  }
}), Z5 = le({
  "node_modules/markdown-it/lib/rules_block/list.js"(r, t) {
    var e = tt().isSpace;
    function n(o, s) {
      var l, u, c, f;
      return u = o.bMarks[s] + o.tShift[s], c = o.eMarks[s], l = o.src.charCodeAt(u++), l !== 42 && l !== 45 && l !== 43 || u < c && (f = o.src.charCodeAt(u), !e(f)) ? -1 : u;
    }
    function i(o, s) {
      var l, u = o.bMarks[s] + o.tShift[s], c = u, f = o.eMarks[s];
      if (c + 1 >= f || (l = o.src.charCodeAt(c++), l < 48 || l > 57))
        return -1;
      for (; ; ) {
        if (c >= f)
          return -1;
        if (l = o.src.charCodeAt(c++), l >= 48 && l <= 57) {
          if (c - u >= 10)
            return -1;
          continue;
        }
        if (l === 41 || l === 46)
          break;
        return -1;
      }
      return c < f && (l = o.src.charCodeAt(c), !e(l)) ? -1 : c;
    }
    function a(o, s) {
      var l, u, c = o.level + 2;
      for (l = s + 2, u = o.tokens.length - 2; l < u; l++)
        o.tokens[l].level === c && o.tokens[l].type === "paragraph_open" && (o.tokens[l + 2].hidden = !0, o.tokens[l].hidden = !0, l += 2);
    }
    t.exports = function(s, l, u, c) {
      var f, h, v, d, p, g, m, y, _, b, S, x, w, C, D, A, T, L, E, I, P, R, F, O, z, G, W, Y, j = !1, ee = !0;
      if (!s.md.options.allowIndentation && s.sCount[l] - s.blkIndent >= 4 || !s.md.options.allowIndentation && s.listIndent >= 0 && s.sCount[l] - s.listIndent >= 4 && s.sCount[l] < s.blkIndent)
        return !1;
      if (c && s.parentType === "paragraph" && s.sCount[l] >= s.blkIndent && (j = !0), (F = i(s, l)) >= 0) {
        if (m = !0, z = s.bMarks[l] + s.tShift[l], w = Number(s.src.slice(z, F - 1)), j && w !== 1)
          return !1;
      } else if ((F = n(s, l)) >= 0)
        m = !1;
      else
        return !1;
      if (j && s.skipSpaces(F) >= s.eMarks[l])
        return !1;
      if (x = s.src.charCodeAt(F - 1), c)
        return !0;
      for (S = s.tokens.length, m ? (Y = s.push("ordered_list_open", "ol", 1), w !== 1 && (Y.attrs = [["start", w]])) : Y = s.push("bullet_list_open", "ul", 1), Y.map = b = [l, 0], Y.markup = String.fromCharCode(x), D = l, O = !1, W = s.md.block.ruler.getRules("list"), L = s.parentType, s.parentType = "list"; D < u; ) {
        for (R = F, C = s.eMarks[D], g = A = s.sCount[D] + F - (s.bMarks[l] + s.tShift[l]); R < C; ) {
          if (f = s.src.charCodeAt(R), f === 9)
            A += 4 - (A + s.bsCount[D]) % 4;
          else if (f === 32)
            A++;
          else
            break;
          R++;
        }
        if (h = R, h >= C ? p = 1 : p = A - g, !s.md.options.allowIndentation && p > 4 && (p = 1), d = g + p, Y = s.push("list_item_open", "li", 1), Y.markup = String.fromCharCode(x), Y.map = y = [l, 0], m && (Y.info = s.src.slice(z, F - 1)), P = s.tight, I = s.tShift[l], E = s.sCount[l], T = s.listIndent, s.listIndent = s.blkIndent, s.blkIndent = d, s.tight = !0, s.tShift[l] = h - s.bMarks[l], s.sCount[l] = A, h >= C && s.isEmpty(l + 1) ? s.line = Math.min(s.line + 2, u) : s.md.block.tokenize(s, l, u, !0), (!s.tight || O) && (ee = !1), O = s.line - l > 1 && s.isEmpty(s.line - 1), s.blkIndent = s.listIndent, s.listIndent = T, s.tShift[l] = I, s.sCount[l] = E, s.tight = P, Y = s.push("list_item_close", "li", -1), Y.markup = String.fromCharCode(x), D = l = s.line, y[1] = D, h = s.bMarks[l], D >= u || s.sCount[D] < s.blkIndent || !s.md.options.allowIndentation && s.sCount[l] - s.blkIndent >= 4)
          break;
        for (G = !1, v = 0, _ = W.length; v < _; v++)
          if (W[v](s, D, u, !0)) {
            G = !0;
            break;
          }
        if (G)
          break;
        if (m) {
          if (F = i(s, D), F < 0)
            break;
          z = s.bMarks[D] + s.tShift[D];
        } else if (F = n(s, D), F < 0)
          break;
        if (x !== s.src.charCodeAt(F - 1))
          break;
      }
      return m ? Y = s.push("ordered_list_close", "ol", -1) : Y = s.push("bullet_list_close", "ul", -1), Y.markup = String.fromCharCode(x), b[1] = D, s.line = D, s.parentType = L, ee && a(s, S), !0;
    };
  }
}), X5 = le({
  "node_modules/markdown-it/lib/rules_block/reference.js"(r, t) {
    var e = tt().normalizeReference, n = tt().isSpace;
    t.exports = function(a, o, s, l) {
      var u, c, f, h, v, d, p, g, m, y, _, b, S, x, w, C, D = 0, A = a.bMarks[o] + a.tShift[o], T = a.eMarks[o], L = o + 1;
      if (!a.md.options.allowIndentation && a.sCount[o] - a.blkIndent >= 4 || a.src.charCodeAt(A) !== 91)
        return !1;
      for (; ++A < T; )
        if (a.src.charCodeAt(A) === 93 && a.src.charCodeAt(A - 1) !== 92) {
          if (A + 1 === T || a.src.charCodeAt(A + 1) !== 58)
            return !1;
          break;
        }
      for (h = a.lineMax, w = a.md.block.ruler.getRules("reference"), y = a.parentType, a.parentType = "reference"; L < h && !a.isEmpty(L); L++)
        if (!(!a.md.options.allowIndentation && a.sCount[L] - a.blkIndent > 3) && !(a.sCount[L] < 0)) {
          for (x = !1, d = 0, p = w.length; d < p; d++)
            if (w[d](a, L, h, !0)) {
              x = !0;
              break;
            }
          if (x)
            break;
        }
      for (S = a.getLines(o, L, a.blkIndent, !1).trim(), T = S.length, A = 1; A < T; A++) {
        if (u = S.charCodeAt(A), u === 91)
          return !1;
        if (u === 93) {
          m = A;
          break;
        } else u === 10 ? D++ : u === 92 && (A++, A < T && S.charCodeAt(A) === 10 && D++);
      }
      if (m < 0 || S.charCodeAt(m + 1) !== 58)
        return !1;
      for (A = m + 2; A < T; A++)
        if (u = S.charCodeAt(A), u === 10)
          D++;
        else if (!n(u)) break;
      if (_ = a.md.helpers.parseLinkDestination(S, A, T), !_.ok || (v = a.md.normalizeLink(_.str), !a.md.validateLink(v)))
        return !1;
      for (A = _.pos, D += _.lines, c = A, f = D, b = A; A < T; A++)
        if (u = S.charCodeAt(A), u === 10)
          D++;
        else if (!n(u)) break;
      for (_ = a.md.helpers.parseLinkTitle(S, A, T), A < T && b !== A && _.ok ? (C = _.str, A = _.pos, D += _.lines) : (C = "", A = c, D = f); A < T && (u = S.charCodeAt(A), !!n(u)); )
        A++;
      if (A < T && S.charCodeAt(A) !== 10 && C)
        for (C = "", A = c, D = f; A < T && (u = S.charCodeAt(A), !!n(u)); )
          A++;
      return A < T && S.charCodeAt(A) !== 10 || (g = e(S.slice(1, m)), !g) ? !1 : (l || (typeof a.env.references > "u" && (a.env.references = {}), typeof a.env.references[g] > "u" && (a.env.references[g] = { title: C, href: v }), a.parentType = y, a.line = o + D + 1), !0);
    };
  }
}), j5 = le({
  "node_modules/markdown-it/lib/common/html_blocks.js"(r, t) {
    t.exports = [
      "address",
      "article",
      "aside",
      "base",
      "basefont",
      "blockquote",
      "body",
      "caption",
      "center",
      "col",
      "colgroup",
      "dd",
      "details",
      "dialog",
      "dir",
      "div",
      "dl",
      "dt",
      "fieldset",
      "figcaption",
      "figure",
      "footer",
      "form",
      "frame",
      "frameset",
      "h1",
      "h2",
      "h3",
      "h4",
      "h5",
      "h6",
      "head",
      "header",
      "hr",
      "html",
      "iframe",
      "legend",
      "li",
      "link",
      "main",
      "menu",
      "menuitem",
      "nav",
      "noframes",
      "ol",
      "optgroup",
      "option",
      "p",
      "param",
      "section",
      "source",
      "summary",
      "table",
      "tbody",
      "td",
      "tfoot",
      "th",
      "thead",
      "title",
      "tr",
      "track",
      "ul"
    ];
  }
}), ID = le({
  "node_modules/markdown-it/lib/common/html_re.js"(r, t) {
    var e = "[a-zA-Z_:][a-zA-Z0-9:._-]*", n = "[^\"'=<>`\\x00-\\x20]+", i = "'[^']*'", a = '"[^"]*"', o = "(?:" + n + "|" + i + "|" + a + ")", s = "(?:\\s+" + e + "(?:\\s*=\\s*" + o + ")?)", l = "<[A-Za-z][A-Za-z0-9\\-]*" + s + "*\\s*\\/?>", u = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", c = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->", f = "<[?][\\s\\S]*?[?]>", h = "<![A-Z]+\\s+[^>]*>", v = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", d = new RegExp("^(?:" + l + "|" + u + "|" + c + "|" + f + "|" + h + "|" + v + ")"), p = new RegExp("^(?:" + l + "|" + u + ")");
    t.exports.HTML_TAG_RE = d, t.exports.HTML_OPEN_CLOSE_TAG_RE = p;
  }
}), K5 = le({
  "node_modules/markdown-it/lib/rules_block/html_block.js"(r, t) {
    var e = j5(), n = ID().HTML_OPEN_CLOSE_TAG_RE, i = [
      [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
      [/^<!--/, /-->/, !0],
      [/^<\?/, /\?>/, !0],
      [/^<![A-Z]/, />/, !0],
      [/^<!\[CDATA\[/, /\]\]>/, !0],
      [new RegExp("^</?(" + e.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, !0],
      [new RegExp(n.source + "\\s*$"), /^$/, !1]
    ];
    t.exports = function(o, s, l, u) {
      var c, f, h, v, d = o.bMarks[s] + o.tShift[s], p = o.eMarks[s];
      if (!o.md.options.allowIndentation && o.sCount[s] - o.blkIndent >= 4 || !o.md.options.html || o.src.charCodeAt(d) !== 60)
        return !1;
      for (v = o.src.slice(d, p), c = 0; c < i.length && !i[c][0].test(v); c++)
        ;
      if (c === i.length)
        return !1;
      if (u)
        return i[c][2];
      if (f = s + 1, !i[c][1].test(v)) {
        for (; f < l && !(o.sCount[f] < o.blkIndent); f++)
          if (d = o.bMarks[f] + o.tShift[f], p = o.eMarks[f], v = o.src.slice(d, p), i[c][1].test(v)) {
            v.length !== 0 && f++;
            break;
          }
      }
      return o.line = f, h = o.push("html_block", "", 0), h.map = [s, f], h.content = o.getLines(s, f, o.blkIndent, !0), !0;
    };
  }
}), J5 = le({
  "node_modules/markdown-it/lib/rules_block/heading.js"(r, t) {
    var e = tt().isSpace;
    t.exports = function(i, a, o, s) {
      var l, u, c, f, h = i.bMarks[a] + i.tShift[a], v = i.eMarks[a];
      if (!i.md.options.allowIndentation && i.sCount[a] - i.blkIndent >= 4 || (l = i.src.charCodeAt(h), l !== 35 || h >= v))
        return !1;
      for (u = 1, l = i.src.charCodeAt(++h); l === 35 && h < v && u <= 6; )
        u++, l = i.src.charCodeAt(++h);
      return u > 6 || h < v && !e(l) ? !1 : (s || (v = i.skipSpacesBack(v, h), c = i.skipCharsBack(v, 35, h), c > h && e(i.src.charCodeAt(c - 1)) && (v = c), i.line = a + 1, f = i.push("heading_open", "h" + String(u), 1), f.markup = "########".slice(0, u), f.map = [a, i.line], f = i.push("inline", "", 0), f.content = i.src.slice(h, v).trim(), f.map = [a, i.line], f.children = [], f = i.push("heading_close", "h" + String(u), -1), f.markup = "########".slice(0, u)), !0);
    };
  }
}), Q5 = le({
  "node_modules/markdown-it/lib/rules_block/lheading.js"(r, t) {
    t.exports = function(n, i, a) {
      var o, s, l, u, c, f, h, v, d, p = i + 1, g, m = n.md.block.ruler.getRules("paragraph");
      if (!n.md.options.allowIndentation && n.sCount[i] - n.blkIndent >= 4)
        return !1;
      for (g = n.parentType, n.parentType = "paragraph"; p < a && !n.isEmpty(p); p++)
        if (!(!n.md.options.allowIndentation && n.sCount[p] - n.blkIndent > 3)) {
          if (n.sCount[p] >= n.blkIndent && (f = n.bMarks[p] + n.tShift[p], h = n.eMarks[p], f < h && (d = n.src.charCodeAt(f), (d === 45 || d === 61) && (f = n.skipChars(f, d), f = n.skipSpaces(f), f >= h)))) {
            v = d === 61 ? 1 : 2;
            break;
          }
          if (!(n.sCount[p] < 0)) {
            for (s = !1, l = 0, u = m.length; l < u; l++)
              if (m[l](n, p, a, !0)) {
                s = !0;
                break;
              }
            if (s)
              break;
          }
        }
      return v ? (o = n.getLines(i, p, n.blkIndent, !1).trim(), n.line = p + 1, c = n.push("heading_open", "h" + String(v), 1), c.markup = String.fromCharCode(d), c.map = [i, n.line], c = n.push("inline", "", 0), c.content = o, c.map = [i, n.line - 1], c.children = [], c = n.push("heading_close", "h" + String(v), -1), c.markup = String.fromCharCode(d), n.parentType = g, !0) : !1;
    };
  }
}), eO = le({
  "node_modules/markdown-it/lib/rules_block/paragraph.js"(r, t) {
    t.exports = function(n, i) {
      var a, o, s, l, u, c, f = i + 1, h = n.md.block.ruler.getRules("paragraph"), v = n.lineMax;
      for (c = n.parentType, n.parentType = "paragraph"; f < v && !n.isEmpty(f); f++)
        if (!(!n.md.options.allowIndentation && n.sCount[f] - n.blkIndent > 3) && !(n.sCount[f] < 0)) {
          for (o = !1, s = 0, l = h.length; s < l; s++)
            if (h[s](n, f, v, !0)) {
              o = !0;
              break;
            }
          if (o)
            break;
        }
      return a = n.getLines(i, f, n.blkIndent, !1).trim(), n.line = f, u = n.push("paragraph_open", "p", 1), u.map = [i, n.line], u = n.push("inline", "", 0), u.content = a, u.map = [i, n.line], u.children = [], u = n.push("paragraph_close", "p", -1), n.parentType = c, !0;
    };
  }
}), tO = le({
  "node_modules/markdown-it/lib/rules_block/state_block.js"(r, t) {
    var e = Fy(), n = tt().isSpace;
    function i(a, o, s, l) {
      var u, c, f, h, v, d, p, g;
      for (this.src = a, this.md = o, this.env = s, this.tokens = l, this.bMarks = [], this.eMarks = [], this.tShift = [], this.sCount = [], this.bsCount = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.ddIndent = -1, this.listIndent = -1, this.parentType = "root", this.level = 0, this.result = "", c = this.src, g = !1, f = h = d = p = 0, v = c.length; h < v; h++) {
        if (u = c.charCodeAt(h), !g)
          if (n(u)) {
            d++, u === 9 ? p += 4 - p % 4 : p++;
            continue;
          } else
            g = !0;
        (u === 10 || h === v - 1) && (u !== 10 && h++, this.bMarks.push(f), this.eMarks.push(h), this.tShift.push(d), this.sCount.push(p), this.bsCount.push(0), g = !1, d = 0, p = 0, f = h + 1);
      }
      this.bMarks.push(c.length), this.eMarks.push(c.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
    }
    i.prototype.push = function(a, o, s) {
      var l = new e(a, o, s);
      return l.block = !0, s < 0 && this.level--, l.level = this.level, s > 0 && this.level++, this.tokens.push(l), l;
    }, i.prototype.isEmpty = function(o) {
      return this.bMarks[o] + this.tShift[o] >= this.eMarks[o];
    }, i.prototype.skipEmptyLines = function(o) {
      for (var s = this.lineMax; o < s && !(this.bMarks[o] + this.tShift[o] < this.eMarks[o]); o++)
        ;
      return o;
    }, i.prototype.skipSpaces = function(o) {
      for (var s, l = this.src.length; o < l && (s = this.src.charCodeAt(o), !!n(s)); o++)
        ;
      return o;
    }, i.prototype.skipSpacesBack = function(o, s) {
      if (o <= s)
        return o;
      for (; o > s; )
        if (!n(this.src.charCodeAt(--o)))
          return o + 1;
      return o;
    }, i.prototype.skipChars = function(o, s) {
      for (var l = this.src.length; o < l && this.src.charCodeAt(o) === s; o++)
        ;
      return o;
    }, i.prototype.skipCharsBack = function(o, s, l) {
      if (o <= l)
        return o;
      for (; o > l; )
        if (s !== this.src.charCodeAt(--o))
          return o + 1;
      return o;
    }, i.prototype.getLines = function(o, s, l, u) {
      var c, f, h, v, d, p, g, m = o;
      if (o >= s)
        return "";
      for (p = new Array(s - o), c = 0; m < s; m++, c++) {
        for (f = 0, g = v = this.bMarks[m], m + 1 < s || u ? d = this.eMarks[m] + 1 : d = this.eMarks[m]; v < d && f < l; ) {
          if (h = this.src.charCodeAt(v), n(h))
            h === 9 ? f += 4 - (f + this.bsCount[m]) % 4 : f++;
          else if (v - g < this.tShift[m])
            f++;
          else
            break;
          v++;
        }
        f > l ? p[c] = new Array(f - l + 1).join(" ") + this.src.slice(v, d) : p[c] = this.src.slice(v, d);
      }
      return p.join("");
    }, i.prototype.Token = e, t.exports = i;
  }
}), rO = le({
  "node_modules/markdown-it/lib/parser_block.js"(r, t) {
    var e = Oy(), n = [
      ["table", H5(), ["paragraph", "reference"]],
      ["code", q5()],
      ["fence", W5(), ["paragraph", "reference", "blockquote", "list"]],
      ["blockquote", U5(), ["paragraph", "reference", "blockquote", "list"]],
      ["hr", Y5(), ["paragraph", "reference", "blockquote", "list"]],
      ["list", Z5(), ["paragraph", "reference", "blockquote"]],
      ["reference", X5()],
      ["html_block", K5(), ["paragraph", "reference", "blockquote"]],
      ["heading", J5(), ["paragraph", "reference", "blockquote"]],
      ["lheading", Q5()],
      ["paragraph", eO()]
    ];
    function i() {
      this.ruler = new e();
      for (var a = 0; a < n.length; a++)
        this.ruler.push(n[a][0], n[a][1], { alt: (n[a][2] || []).slice() });
    }
    i.prototype.tokenize = function(a, o, s) {
      for (var l, u, c = this.ruler.getRules(""), f = c.length, h = o, v = !1, d = a.md.options.maxNesting; h < s && (a.line = h = a.skipEmptyLines(h), !(h >= s || a.sCount[h] < a.blkIndent)); ) {
        if (a.level >= d) {
          a.line = s;
          break;
        }
        for (u = 0; u < f && (l = c[u](a, h, s, !1), !l); u++)
          ;
        a.tight = !v, a.isEmpty(a.line - 1) && (v = !0), h = a.line, h < s && a.isEmpty(h) && (v = !0, h++, a.line = h);
      }
    }, i.prototype.parse = function(a, o, s, l) {
      var u;
      a && (u = new this.State(a, o, s, l), this.tokenize(u, u.line, u.lineMax));
    }, i.prototype.State = tO(), t.exports = i;
  }
}), nO = le({
  "node_modules/markdown-it/lib/rules_inline/text.js"(r, t) {
    function e(n) {
      switch (n) {
        case 10:
        case 33:
        case 35:
        case 36:
        case 37:
        case 38:
        case 42:
        case 43:
        case 45:
        case 58:
        case 60:
        case 61:
        case 62:
        case 64:
        case 91:
        case 92:
        case 93:
        case 94:
        case 95:
        case 96:
        case 123:
        case 125:
        case 126:
          return !0;
        default:
          return !1;
      }
    }
    t.exports = function(i, a) {
      for (var o = i.pos; o < i.posMax && !e(i.src.charCodeAt(o)); )
        o++;
      return o === i.pos ? !1 : (a || (i.pending += i.src.slice(i.pos, o)), i.pos = o, !0);
    };
  }
}), iO = le({
  "node_modules/markdown-it/lib/rules_inline/newline.js"(r, t) {
    var e = tt().isSpace;
    t.exports = function(i, a) {
      var o, s, l, u = i.pos;
      if (i.src.charCodeAt(u) !== 10)
        return !1;
      if (o = i.pending.length - 1, s = i.posMax, !a)
        if (o >= 0 && i.pending.charCodeAt(o) === 32)
          if (o >= 1 && i.pending.charCodeAt(o - 1) === 32) {
            for (l = o - 1; l >= 1 && i.pending.charCodeAt(l - 1) === 32; )
              l--;
            i.pending = i.pending.slice(0, l), i.push("hardbreak", "br", 0);
          } else
            i.pending = i.pending.slice(0, -1), i.push("softbreak", "br", 0);
        else
          i.push("softbreak", "br", 0);
      for (u++; u < s && e(i.src.charCodeAt(u)); )
        u++;
      return i.pos = u, !0;
    };
  }
}), aO = le({
  "node_modules/markdown-it/lib/rules_inline/escape.js"(r, t) {
    var e = tt().isSpace, n = [];
    for (i = 0; i < 256; i++)
      n.push(0);
    var i;
    "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(a) {
      n[a.charCodeAt(0)] = 1;
    }), t.exports = function(o, s) {
      var l, u = o.pos, c = o.posMax;
      if (o.src.charCodeAt(u) !== 92)
        return !1;
      if (u++, u < c) {
        if (l = o.src.charCodeAt(u), l < 256 && n[l] !== 0)
          return s || (o.pending += o.src[u]), o.pos += 2, !0;
        if (l === 10) {
          for (s || o.push("hardbreak", "br", 0), u++; u < c && (l = o.src.charCodeAt(u), !!e(l)); )
            u++;
          return o.pos = u, !0;
        }
      }
      return s || (o.pending += "\\"), o.pos++, !0;
    };
  }
}), oO = le({
  "node_modules/markdown-it/lib/rules_inline/backticks.js"(r, t) {
    t.exports = function(n, i) {
      var a, o, s, l, u, c, f, h, v = n.pos, d = n.src.charCodeAt(v);
      if (d !== 96)
        return !1;
      for (a = v, v++, o = n.posMax; v < o && n.src.charCodeAt(v) === 96; )
        v++;
      if (s = n.src.slice(a, v), f = s.length, n.backticksScanned && (n.backticks[f] || 0) <= a)
        return i || (n.pending += s), n.pos += f, !0;
      for (u = c = v; (u = n.src.indexOf("`", c)) !== -1; ) {
        for (c = u + 1; c < o && n.src.charCodeAt(c) === 96; )
          c++;
        if (h = c - u, h === f)
          return i || (l = n.push("code_inline", "code", 0), l.markup = s, l.content = n.src.slice(v, u).replace(/\n/g, " ").replace(/^ (.+) $/, "$1")), n.pos = c, !0;
        n.backticks[h] = u;
      }
      return n.backticksScanned = !0, i || (n.pending += s), n.pos += f, !0;
    };
  }
}), V1 = le({
  "node_modules/markdown-it/lib/rules_inline/strikethrough.js"(r, t) {
    t.exports.tokenize = function(i, a) {
      var o, s, l, u, c, f = i.pos, h = i.src.charCodeAt(f);
      if (a || h !== 126 || (s = i.scanDelims(i.pos, !0), u = s.length, c = String.fromCharCode(h), u < 2))
        return !1;
      for (u % 2 && (l = i.push("text", "", 0), l.content = c, u--), o = 0; o < u; o += 2)
        l = i.push("text", "", 0), l.content = c + c, i.delimiters.push({
          marker: h,
          length: 0,
          token: i.tokens.length - 1,
          end: -1,
          open: s.can_open,
          close: s.can_close
        });
      return i.pos += s.length, !0;
    };
    function e(n, i) {
      var a, o, s, l, u, c = [], f = i.length;
      for (a = 0; a < f; a++)
        s = i[a], s.marker === 126 && s.end !== -1 && (l = i[s.end], u = n.tokens[s.token], u.type = "s_open", u.tag = "s", u.nesting = 1, u.markup = "~~", u.content = "", u = n.tokens[l.token], u.type = "s_close", u.tag = "s", u.nesting = -1, u.markup = "~~", u.content = "", n.tokens[l.token - 1].type === "text" && n.tokens[l.token - 1].content === "~" && c.push(l.token - 1));
      for (; c.length; ) {
        for (a = c.pop(), o = a + 1; o < n.tokens.length && n.tokens[o].type === "s_close"; )
          o++;
        o--, a !== o && (u = n.tokens[o], n.tokens[o] = n.tokens[a], n.tokens[a] = u);
      }
    }
    t.exports.postProcess = function(i) {
      var a, o = i.tokens_meta, s = i.tokens_meta.length;
      for (e(i, i.delimiters), a = 0; a < s; a++)
        o[a] && o[a].delimiters && e(i, o[a].delimiters);
    };
  }
}), $1 = le({
  "node_modules/markdown-it/lib/rules_inline/emphasis.js"(r, t) {
    t.exports.tokenize = function(i, a) {
      var o, s, l, u = i.pos, c = i.src.charCodeAt(u);
      if (a || c !== 95 && c !== 42)
        return !1;
      for (s = i.scanDelims(i.pos, c === 42), o = 0; o < s.length; o++)
        l = i.push("text", "", 0), l.content = String.fromCharCode(c), i.delimiters.push({
          marker: c,
          length: s.length,
          token: i.tokens.length - 1,
          end: -1,
          open: s.can_open,
          close: s.can_close
        });
      return i.pos += s.length, !0;
    };
    function e(n, i) {
      var a, o, s, l, u, c, f = i.length;
      for (a = f - 1; a >= 0; a--)
        o = i[a], !(o.marker !== 95 && o.marker !== 42) && o.end !== -1 && (s = i[o.end], c = a > 0 && i[a - 1].end === o.end + 1 && i[a - 1].marker === o.marker && i[a - 1].token === o.token - 1 && i[o.end + 1].token === s.token + 1, u = String.fromCharCode(o.marker), l = n.tokens[o.token], l.type = c ? "strong_open" : "em_open", l.tag = c ? "strong" : "em", l.nesting = 1, l.markup = c ? u + u : u, l.content = "", l = n.tokens[s.token], l.type = c ? "strong_close" : "em_close", l.tag = c ? "strong" : "em", l.nesting = -1, l.markup = c ? u + u : u, l.content = "", c && (n.tokens[i[a - 1].token].content = "", n.tokens[i[o.end + 1].token].content = "", a--));
    }
    t.exports.postProcess = function(i) {
      var a, o = i.tokens_meta, s = i.tokens_meta.length;
      for (e(i, i.delimiters), a = 0; a < s; a++)
        o[a] && o[a].delimiters && e(i, o[a].delimiters);
    };
  }
}), sO = le({
  "node_modules/markdown-it/lib/rules_inline/link.js"(r, t) {
    var e = tt().normalizeReference, n = tt().isSpace;
    t.exports = function(a, o) {
      var s, l, u, c, f, h, v, d, p, g = "", m = "", y = a.pos, _ = a.posMax, b = a.pos, S = !0;
      if (a.src.charCodeAt(a.pos) !== 91 || (f = a.pos + 1, c = a.md.helpers.parseLinkLabel(a, a.pos, !0), c < 0))
        return !1;
      if (h = c + 1, h < _ && a.src.charCodeAt(h) === 40) {
        for (S = !1, h++; h < _ && (l = a.src.charCodeAt(h), !(!n(l) && l !== 10)); h++)
          ;
        if (h >= _)
          return !1;
        if (b = h, v = a.md.helpers.parseLinkDestination(a.src, h, a.posMax), v.ok) {
          for (g = a.md.normalizeLink(v.str), a.md.validateLink(g) ? h = v.pos : g = "", b = h; h < _ && (l = a.src.charCodeAt(h), !(!n(l) && l !== 10)); h++)
            ;
          if (v = a.md.helpers.parseLinkTitle(a.src, h, a.posMax), h < _ && b !== h && v.ok)
            for (m = v.str, h = v.pos; h < _ && (l = a.src.charCodeAt(h), !(!n(l) && l !== 10)); h++)
              ;
        }
        (h >= _ || a.src.charCodeAt(h) !== 41) && (S = !0), h++;
      }
      if (S) {
        if (typeof a.env.references > "u")
          return !1;
        if (h < _ && a.src.charCodeAt(h) === 91 ? (b = h + 1, h = a.md.helpers.parseLinkLabel(a, h), h >= 0 ? u = a.src.slice(b, h++) : h = c + 1) : h = c + 1, u || (u = a.src.slice(f, c)), d = a.env.references[e(u)], !d)
          return a.pos = y, !1;
        g = d.href, m = d.title;
      }
      return o || (a.pos = f, a.posMax = c, p = a.push("link_open", "a", 1), p.attrs = s = [["href", g]], m && s.push(["title", m]), a.md.inline.tokenize(a), p = a.push("link_close", "a", -1)), a.pos = h, a.posMax = _, !0;
    };
  }
}), lO = le({
  "node_modules/markdown-it/lib/rules_inline/image.js"(r, t) {
    var e = tt().normalizeReference, n = tt().isSpace;
    t.exports = function(a, o) {
      var s, l, u, c, f, h, v, d, p, g, m, y, _, b = "", S = a.pos, x = a.posMax;
      if (a.src.charCodeAt(a.pos) !== 33 || a.src.charCodeAt(a.pos + 1) !== 91 || (h = a.pos + 2, f = a.md.helpers.parseLinkLabel(a, a.pos + 1, !1), f < 0))
        return !1;
      if (v = f + 1, v < x && a.src.charCodeAt(v) === 40) {
        for (v++; v < x && (l = a.src.charCodeAt(v), !(!n(l) && l !== 10)); v++)
          ;
        if (v >= x)
          return !1;
        for (_ = v, p = a.md.helpers.parseLinkDestination(a.src, v, a.posMax), p.ok && (b = a.md.normalizeLink(p.str), a.md.validateLink(b) ? v = p.pos : b = ""), _ = v; v < x && (l = a.src.charCodeAt(v), !(!n(l) && l !== 10)); v++)
          ;
        if (p = a.md.helpers.parseLinkTitle(a.src, v, a.posMax), v < x && _ !== v && p.ok)
          for (g = p.str, v = p.pos; v < x && (l = a.src.charCodeAt(v), !(!n(l) && l !== 10)); v++)
            ;
        else
          g = "";
        if (v >= x || a.src.charCodeAt(v) !== 41)
          return a.pos = S, !1;
        v++;
      } else {
        if (typeof a.env.references > "u")
          return !1;
        if (v < x && a.src.charCodeAt(v) === 91 ? (_ = v + 1, v = a.md.helpers.parseLinkLabel(a, v), v >= 0 ? c = a.src.slice(_, v++) : v = f + 1) : v = f + 1, c || (c = a.src.slice(h, f)), d = a.env.references[e(c)], !d)
          return a.pos = S, !1;
        b = d.href, g = d.title;
      }
      return o || (u = a.src.slice(h, f), a.md.inline.parse(u, a.md, a.env, y = []), m = a.push("image", "img", 0), m.attrs = s = [["src", b], ["alt", ""]], m.children = y, m.content = u, g && s.push(["title", g])), a.pos = v, a.posMax = x, !0;
    };
  }
}), uO = le({
  "node_modules/markdown-it/lib/rules_inline/autolink.js"(r, t) {
    var e = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/, n = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;
    t.exports = function(a, o) {
      var s, l, u, c, f, h, v = a.pos;
      if (a.src.charCodeAt(v) !== 60)
        return !1;
      for (f = a.pos, h = a.posMax; ; ) {
        if (++v >= h || (c = a.src.charCodeAt(v), c === 60))
          return !1;
        if (c === 62)
          break;
      }
      return s = a.src.slice(f + 1, v), n.test(s) ? (l = a.md.normalizeLink(s), a.md.validateLink(l) ? (o || (u = a.push("link_open", "a", 1), u.attrs = [["href", l]], u.markup = "autolink", u.info = "auto", u = a.push("text", "", 0), u.content = a.md.normalizeLinkText(s), u = a.push("link_close", "a", -1), u.markup = "autolink", u.info = "auto"), a.pos += s.length + 2, !0) : !1) : e.test(s) ? (l = a.md.normalizeLink("mailto:" + s), a.md.validateLink(l) ? (o || (u = a.push("link_open", "a", 1), u.attrs = [["href", l]], u.markup = "autolink", u.info = "auto", u = a.push("text", "", 0), u.content = a.md.normalizeLinkText(s), u = a.push("link_close", "a", -1), u.markup = "autolink", u.info = "auto"), a.pos += s.length + 2, !0) : !1) : !1;
    };
  }
}), cO = le({
  "node_modules/markdown-it/lib/rules_inline/html_inline.js"(r, t) {
    var e = ID().HTML_TAG_RE;
    function n(i) {
      var a = i | 32;
      return a >= 97 && a <= 122;
    }
    t.exports = function(a, o) {
      var s, l, u, c, f = a.pos;
      return !a.md.options.html || (u = a.posMax, a.src.charCodeAt(f) !== 60 || f + 2 >= u) || (s = a.src.charCodeAt(f + 1), s !== 33 && s !== 63 && s !== 47 && !n(s)) || (l = a.src.slice(f).match(e), !l) ? !1 : (o || (c = a.push("html_inline", "", 0), c.content = a.src.slice(f, f + l[0].length)), a.pos += l[0].length, !0);
    };
  }
}), fO = le({
  "node_modules/markdown-it/lib/rules_inline/entity.js"(r, t) {
    var e = CD(), n = tt().has, i = tt().isValidEntityCode, a = tt().fromCodePoint, o = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, s = /^&([a-z][a-z0-9]{1,31});/i;
    t.exports = function(u, c) {
      var f, h, v, d = u.pos, p = u.posMax;
      if (u.src.charCodeAt(d) !== 38)
        return !1;
      if (d + 1 < p) {
        if (f = u.src.charCodeAt(d + 1), f === 35) {
          if (v = u.src.slice(d).match(o), v)
            return c || (h = v[1][0].toLowerCase() === "x" ? parseInt(v[1].slice(1), 16) : parseInt(v[1], 10), u.pending += i(h) ? a(h) : a(65533)), u.pos += v[0].length, !0;
        } else if (v = u.src.slice(d).match(s), v && n(e, v[1]))
          return c || (u.pending += e[v[1]]), u.pos += v[0].length, !0;
      }
      return c || (u.pending += "&"), u.pos++, !0;
    };
  }
}), hO = le({
  "node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(r, t) {
    function e(n, i) {
      var a, o, s, l, u, c, f, h, v = {}, d = i.length;
      if (d) {
        var p = 0, g = -2, m = [];
        for (a = 0; a < d; a++)
          if (s = i[a], m.push(0), (i[p].marker !== s.marker || g !== s.token - 1) && (p = a), g = s.token, s.length = s.length || 0, !!s.close) {
            for (v.hasOwnProperty(s.marker) || (v[s.marker] = [-1, -1, -1, -1, -1, -1]), u = v[s.marker][(s.open ? 3 : 0) + s.length % 3], o = p - m[p] - 1, c = o; o > u; o -= m[o] + 1)
              if (l = i[o], l.marker === s.marker && l.open && l.end < 0 && (f = !1, (l.close || s.open) && (l.length + s.length) % 3 === 0 && (l.length % 3 !== 0 || s.length % 3 !== 0) && (f = !0), !f)) {
                h = o > 0 && !i[o - 1].open ? m[o - 1] + 1 : 0, m[a] = a - o + h, m[o] = h, s.open = !1, l.end = a, l.close = !1, c = -1, g = -2;
                break;
              }
            c !== -1 && (v[s.marker][(s.open ? 3 : 0) + (s.length || 0) % 3] = c);
          }
      }
    }
    t.exports = function(i) {
      var a, o = i.tokens_meta, s = i.tokens_meta.length;
      for (e(i, i.delimiters), a = 0; a < s; a++)
        o[a] && o[a].delimiters && e(i, o[a].delimiters);
    };
  }
}), vO = le({
  "node_modules/markdown-it/lib/rules_inline/text_collapse.js"(r, t) {
    t.exports = function(n) {
      var i, a, o = 0, s = n.tokens, l = n.tokens.length;
      for (i = a = 0; i < l; i++)
        s[i].nesting < 0 && o--, s[i].level = o, s[i].nesting > 0 && o++, s[i].type === "text" && i + 1 < l && s[i + 1].type === "text" ? s[i + 1].content = s[i].content + s[i + 1].content : (i !== a && (s[a] = s[i]), a++);
      i !== a && (s.length = a);
    };
  }
}), dO = le({
  "node_modules/markdown-it/lib/rules_inline/state_inline.js"(r, t) {
    var e = Fy(), n = tt().isWhiteSpace, i = tt().isPunctChar, a = tt().isMdAsciiPunct;
    function o(s, l, u, c) {
      this.src = s, this.env = u, this.md = l, this.tokens = c, this.tokens_meta = Array(c.length), this.pos = 0, this.posMax = this.src.length, this.level = 0, this.pending = "", this.pendingLevel = 0, this.cache = {}, this.delimiters = [], this._prev_delimiters = [], this.backticks = {}, this.backticksScanned = !1;
    }
    o.prototype.pushPending = function() {
      var s = new e("text", "", 0);
      return s.content = this.pending, s.level = this.pendingLevel, this.tokens.push(s), this.pending = "", s;
    }, o.prototype.push = function(s, l, u) {
      this.pending && this.pushPending();
      var c = new e(s, l, u), f = null;
      return u < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), c.level = this.level, u > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], f = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(c), this.tokens_meta.push(f), c;
    }, o.prototype.scanDelims = function(s, l) {
      var u = s, c, f, h, v, d, p, g, m, y, _ = !0, b = !0, S = this.posMax, x = this.src.charCodeAt(s);
      for (c = s > 0 ? this.src.charCodeAt(s - 1) : 32; u < S && this.src.charCodeAt(u) === x; )
        u++;
      return h = u - s, f = u < S ? this.src.charCodeAt(u) : 32, g = a(c) || i(String.fromCharCode(c)), y = a(f) || i(String.fromCharCode(f)), p = n(c), m = n(f), m ? _ = !1 : y && (p || g || (_ = !1)), p ? b = !1 : g && (m || y || (b = !1)), l ? (v = _, d = b) : (v = _ && (!b || g), d = b && (!_ || y)), {
        can_open: v,
        can_close: d,
        length: h
      };
    }, o.prototype.Token = e, t.exports = o;
  }
}), pO = le({
  "node_modules/markdown-it/lib/parser_inline.js"(r, t) {
    var e = Oy(), n = [
      ["text", nO()],
      ["newline", iO()],
      ["escape", aO()],
      ["backticks", oO()],
      ["strikethrough", V1().tokenize],
      ["emphasis", $1().tokenize],
      ["link", sO()],
      ["image", lO()],
      ["autolink", uO()],
      ["html_inline", cO()],
      ["entity", fO()]
    ], i = [
      ["balance_pairs", hO()],
      ["strikethrough", V1().postProcess],
      ["emphasis", $1().postProcess],
      ["text_collapse", vO()]
    ];
    function a() {
      var o;
      for (this.ruler = new e(), o = 0; o < n.length; o++)
        this.ruler.push(n[o][0], n[o][1]);
      for (this.ruler2 = new e(), o = 0; o < i.length; o++)
        this.ruler2.push(i[o][0], i[o][1]);
    }
    a.prototype.skipToken = function(o) {
      var s, l, u = o.pos, c = this.ruler.getRules(""), f = c.length, h = o.md.options.maxNesting, v = o.cache;
      if (typeof v[u] < "u") {
        o.pos = v[u];
        return;
      }
      if (o.level < h)
        for (l = 0; l < f && (o.level++, s = c[l](o, !0), o.level--, !s); l++)
          ;
      else
        o.pos = o.posMax;
      s || o.pos++, v[u] = o.pos;
    }, a.prototype.tokenize = function(o) {
      for (var s, l, u = this.ruler.getRules(""), c = u.length, f = o.posMax, h = o.md.options.maxNesting; o.pos < f; ) {
        if (o.level < h)
          for (l = 0; l < c && (s = u[l](o, !1), !s); l++)
            ;
        if (s) {
          if (o.pos >= f)
            break;
          continue;
        }
        o.pending += o.src[o.pos++];
      }
      o.pending && o.pushPending();
    }, a.prototype.parse = function(o, s, l, u) {
      var c, f, h, v = new this.State(o, s, l, u);
      for (this.tokenize(v), f = this.ruler2.getRules(""), h = f.length, c = 0; c < h; c++)
        f[c](v);
    }, a.prototype.State = dO(), t.exports = a;
  }
}), gO = le({
  "node_modules/linkify-it/lib/re.js"(r, t) {
    t.exports = function(e) {
      var n = {};
      n.src_Any = DD().source, n.src_Cc = TD().source, n.src_Z = MD().source, n.src_P = Ry().source, n.src_ZPCc = [n.src_Z, n.src_P, n.src_Cc].join("|"), n.src_ZCc = [n.src_Z, n.src_Cc].join("|");
      var i = "[><｜]";
      return n.src_pseudo_letter = "(?:(?!" + i + "|" + n.src_ZPCc + ")" + n.src_Any + ")", n.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", n.src_auth = "(?:(?:(?!" + n.src_ZCc + "|[@/\\[\\]()]).)+@)?", n.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?", n.src_host_terminator = "(?=$|" + i + "|" + n.src_ZPCc + ")(?!-|_|:\\d|\\.-|\\.(?!$|" + n.src_ZPCc + "))", n.src_path = "(?:[/?#](?:(?!" + n.src_ZCc + "|" + i + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + n.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + n.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + n.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + n.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + n.src_ZCc + "|[']).)+\\'|\\'(?=" + n.src_pseudo_letter + "|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + n.src_ZCc + "|[.]).|" + (e && e["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + n.src_ZCc + ").|;(?!" + n.src_ZCc + ").|\\!+(?!" + n.src_ZCc + "|[!]).|\\?(?!" + n.src_ZCc + "|[?]).)+|\\/)?", n.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*', n.src_xn = "xn--[a-z0-9\\-]{1,59}", n.src_domain_root = "(?:" + n.src_xn + "|" + n.src_pseudo_letter + "{1,63})", n.src_domain = "(?:" + n.src_xn + "|(?:" + n.src_pseudo_letter + ")|(?:" + n.src_pseudo_letter + "(?:-|" + n.src_pseudo_letter + "){0,61}" + n.src_pseudo_letter + "))", n.src_host = "(?:(?:(?:(?:" + n.src_domain + ")\\.)*" + n.src_domain + "))", n.tpl_host_fuzzy = "(?:" + n.src_ip4 + "|(?:(?:(?:" + n.src_domain + ")\\.)+(?:%TLDS%)))", n.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + n.src_domain + ")\\.)+(?:%TLDS%))", n.src_host_strict = n.src_host + n.src_host_terminator, n.tpl_host_fuzzy_strict = n.tpl_host_fuzzy + n.src_host_terminator, n.src_host_port_strict = n.src_host + n.src_port + n.src_host_terminator, n.tpl_host_port_fuzzy_strict = n.tpl_host_fuzzy + n.src_port + n.src_host_terminator, n.tpl_host_port_no_ip_fuzzy_strict = n.tpl_host_no_ip_fuzzy + n.src_port + n.src_host_terminator, n.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + n.src_ZPCc + "|>|$))", n.tpl_email_fuzzy = "(^|" + i + '|"|\\(|' + n.src_ZCc + ")(" + n.src_email_name + "@" + n.tpl_host_fuzzy_strict + ")", n.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + n.src_ZPCc + "))((?![$+<=>^`|｜])" + n.tpl_host_port_fuzzy_strict + n.src_path + ")", n.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + n.src_ZPCc + "))((?![$+<=>^`|｜])" + n.tpl_host_port_no_ip_fuzzy_strict + n.src_path + ")", n;
    };
  }
}), mO = le({
  "node_modules/linkify-it/index.js"(r, t) {
    function e(S) {
      var x = Array.prototype.slice.call(arguments, 1);
      return x.forEach(function(w) {
        w && Object.keys(w).forEach(function(C) {
          S[C] = w[C];
        });
      }), S;
    }
    function n(S) {
      return Object.prototype.toString.call(S);
    }
    function i(S) {
      return n(S) === "[object String]";
    }
    function a(S) {
      return n(S) === "[object Object]";
    }
    function o(S) {
      return n(S) === "[object RegExp]";
    }
    function s(S) {
      return n(S) === "[object Function]";
    }
    function l(S) {
      return S.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
    }
    var u = {
      fuzzyLink: !0,
      fuzzyEmail: !0,
      fuzzyIP: !1
    };
    function c(S) {
      return Object.keys(S || {}).reduce(function(x, w) {
        return x || u.hasOwnProperty(w);
      }, !1);
    }
    var f = {
      "http:": {
        validate: function(S, x, w) {
          var C = S.slice(x);
          return w.re.http || (w.re.http = new RegExp("^\\/\\/" + w.re.src_auth + w.re.src_host_port_strict + w.re.src_path, "i")), w.re.http.test(C) ? C.match(w.re.http)[0].length : 0;
        }
      },
      "https:": "http:",
      "ftp:": "http:",
      "//": {
        validate: function(S, x, w) {
          var C = S.slice(x);
          return w.re.no_http || (w.re.no_http = new RegExp("^" + w.re.src_auth + "(?:localhost|(?:(?:" + w.re.src_domain + ")\\.)+" + w.re.src_domain_root + ")" + w.re.src_port + w.re.src_host_terminator + w.re.src_path, "i")), w.re.no_http.test(C) ? x >= 3 && S[x - 3] === ":" || x >= 3 && S[x - 3] === "/" ? 0 : C.match(w.re.no_http)[0].length : 0;
        }
      },
      "mailto:": {
        validate: function(S, x, w) {
          var C = S.slice(x);
          return w.re.mailto || (w.re.mailto = new RegExp("^" + w.re.src_email_name + "@" + w.re.src_host_strict, "i")), w.re.mailto.test(C) ? C.match(w.re.mailto)[0].length : 0;
        }
      }
    }, h = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]", v = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
    function d(S) {
      S.__index__ = -1, S.__text_cache__ = "";
    }
    function p(S) {
      return function(x, w) {
        var C = x.slice(w);
        return S.test(C) ? C.match(S)[0].length : 0;
      };
    }
    function g() {
      return function(S, x) {
        x.normalize(S);
      };
    }
    function m(S) {
      var x = S.re = gO()(S.__opts__), w = S.__tlds__.slice();
      S.onCompile(), S.__tlds_replaced__ || w.push(h), w.push(x.src_xn), x.src_tlds = w.join("|");
      function C(L) {
        return L.replace("%TLDS%", x.src_tlds);
      }
      x.email_fuzzy = RegExp(C(x.tpl_email_fuzzy), "i"), x.link_fuzzy = RegExp(C(x.tpl_link_fuzzy), "i"), x.link_no_ip_fuzzy = RegExp(C(x.tpl_link_no_ip_fuzzy), "i"), x.host_fuzzy_test = RegExp(C(x.tpl_host_fuzzy_test), "i");
      var D = [];
      S.__compiled__ = {};
      function A(L, E) {
        throw new Error('(LinkifyIt) Invalid schema "' + L + '": ' + E);
      }
      Object.keys(S.__schemas__).forEach(function(L) {
        var E = S.__schemas__[L];
        if (E !== null) {
          var I = { validate: null, link: null };
          if (S.__compiled__[L] = I, a(E)) {
            o(E.validate) ? I.validate = p(E.validate) : s(E.validate) ? I.validate = E.validate : A(L, E), s(E.normalize) ? I.normalize = E.normalize : E.normalize ? A(L, E) : I.normalize = g();
            return;
          }
          if (i(E)) {
            D.push(L);
            return;
          }
          A(L, E);
        }
      }), D.forEach(function(L) {
        S.__compiled__[S.__schemas__[L]] && (S.__compiled__[L].validate = S.__compiled__[S.__schemas__[L]].validate, S.__compiled__[L].normalize = S.__compiled__[S.__schemas__[L]].normalize);
      }), S.__compiled__[""] = { validate: null, normalize: g() };
      var T = Object.keys(S.__compiled__).filter(function(L) {
        return L.length > 0 && S.__compiled__[L];
      }).map(l).join("|");
      S.re.schema_test = RegExp("(^|(?!_)(?:[><｜]|" + x.src_ZPCc + "))(" + T + ")", "i"), S.re.schema_search = RegExp("(^|(?!_)(?:[><｜]|" + x.src_ZPCc + "))(" + T + ")", "ig"), S.re.pretest = RegExp("(" + S.re.schema_test.source + ")|(" + S.re.host_fuzzy_test.source + ")|@", "i"), d(S);
    }
    function y(S, x) {
      var w = S.__index__, C = S.__last_index__, D = S.__text_cache__.slice(w, C);
      this.schema = S.__schema__.toLowerCase(), this.index = w + x, this.lastIndex = C + x, this.raw = D, this.text = D, this.url = D;
    }
    function _(S, x) {
      var w = new y(S, x);
      return S.__compiled__[w.schema].normalize(w, S), w;
    }
    function b(S, x) {
      if (!(this instanceof b))
        return new b(S, x);
      x || c(S) && (x = S, S = {}), this.__opts__ = e({}, u, x), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = e({}, f, S), this.__compiled__ = {}, this.__tlds__ = v, this.__tlds_replaced__ = !1, this.re = {}, m(this);
    }
    b.prototype.add = function(x, w) {
      return this.__schemas__[x] = w, m(this), this;
    }, b.prototype.set = function(x) {
      return this.__opts__ = e(this.__opts__, x), this;
    }, b.prototype.test = function(x) {
      if (this.__text_cache__ = x, this.__index__ = -1, !x.length)
        return !1;
      var w, C, D, A, T, L, E, I, P;
      if (this.re.schema_test.test(x)) {
        for (E = this.re.schema_search, E.lastIndex = 0; (w = E.exec(x)) !== null; )
          if (A = this.testSchemaAt(x, w[2], E.lastIndex), A) {
            this.__schema__ = w[2], this.__index__ = w.index + w[1].length, this.__last_index__ = w.index + w[0].length + A;
            break;
          }
      }
      return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (I = x.search(this.re.host_fuzzy_test), I >= 0 && (this.__index__ < 0 || I < this.__index__) && (C = x.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (T = C.index + C[1].length, (this.__index__ < 0 || T < this.__index__) && (this.__schema__ = "", this.__index__ = T, this.__last_index__ = C.index + C[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (P = x.indexOf("@"), P >= 0 && (D = x.match(this.re.email_fuzzy)) !== null && (T = D.index + D[1].length, L = D.index + D[0].length, (this.__index__ < 0 || T < this.__index__ || T === this.__index__ && L > this.__last_index__) && (this.__schema__ = "mailto:", this.__index__ = T, this.__last_index__ = L))), this.__index__ >= 0;
    }, b.prototype.pretest = function(x) {
      return this.re.pretest.test(x);
    }, b.prototype.testSchemaAt = function(x, w, C) {
      return this.__compiled__[w.toLowerCase()] ? this.__compiled__[w.toLowerCase()].validate(x, C, this) : 0;
    }, b.prototype.match = function(x) {
      var w = 0, C = [];
      this.__index__ >= 0 && this.__text_cache__ === x && (C.push(_(this, w)), w = this.__last_index__);
      for (var D = w ? x.slice(w) : x; this.test(D); )
        C.push(_(this, w)), D = D.slice(this.__last_index__), w += this.__last_index__;
      return C.length ? C : null;
    }, b.prototype.tlds = function(x, w) {
      return x = Array.isArray(x) ? x : [x], w ? (this.__tlds__ = this.__tlds__.concat(x).sort().filter(function(C, D, A) {
        return C !== A[D - 1];
      }).reverse(), m(this), this) : (this.__tlds__ = x.slice(), this.__tlds_replaced__ = !0, m(this), this);
    }, b.prototype.normalize = function(x) {
      x.schema || (x.url = "http://" + x.url), x.schema === "mailto:" && !/^mailto:/i.test(x.url) && (x.url = "mailto:" + x.url);
    }, b.prototype.onCompile = function() {
    }, t.exports = b;
  }
}), yO = le({
  "node_modules/punycode/punycode.js"(r, t) {
    var e = 2147483647, n = 36, i = 1, a = 26, o = 38, s = 700, l = 72, u = 128, c = "-", f = /^xn--/, h = /[^\0-\x7E]/, v = /[\x2E\u3002\uFF0E\uFF61]/g, d = {
      overflow: "Overflow: input needs wider integers to process",
      "not-basic": "Illegal input >= 0x80 (not a basic code point)",
      "invalid-input": "Invalid input"
    }, p = n - i, g = Math.floor, m = String.fromCharCode;
    function y(P) {
      throw new RangeError(d[P]);
    }
    function _(P, R) {
      const F = [];
      let O = P.length;
      for (; O--; )
        F[O] = R(P[O]);
      return F;
    }
    function b(P, R) {
      const F = P.split("@");
      let O = "";
      F.length > 1 && (O = F[0] + "@", P = F[1]), P = P.replace(v, ".");
      const z = P.split("."), G = _(z, R).join(".");
      return O + G;
    }
    function S(P) {
      const R = [];
      let F = 0;
      const O = P.length;
      for (; F < O; ) {
        const z = P.charCodeAt(F++);
        if (z >= 55296 && z <= 56319 && F < O) {
          const G = P.charCodeAt(F++);
          (G & 64512) == 56320 ? R.push(((z & 1023) << 10) + (G & 1023) + 65536) : (R.push(z), F--);
        } else
          R.push(z);
      }
      return R;
    }
    var x = (P) => String.fromCodePoint(...P), w = function(P) {
      return P - 48 < 10 ? P - 22 : P - 65 < 26 ? P - 65 : P - 97 < 26 ? P - 97 : n;
    }, C = function(P, R) {
      return P + 22 + 75 * (P < 26) - ((R != 0) << 5);
    }, D = function(P, R, F) {
      let O = 0;
      for (P = F ? g(P / s) : P >> 1, P += g(P / R); P > p * a >> 1; O += n)
        P = g(P / p);
      return g(O + (p + 1) * P / (P + o));
    }, A = function(P) {
      const R = [], F = P.length;
      let O = 0, z = u, G = l, W = P.lastIndexOf(c);
      W < 0 && (W = 0);
      for (let Y = 0; Y < W; ++Y)
        P.charCodeAt(Y) >= 128 && y("not-basic"), R.push(P.charCodeAt(Y));
      for (let Y = W > 0 ? W + 1 : 0; Y < F; ) {
        let j = O;
        for (let ie = 1, Me = n; ; Me += n) {
          Y >= F && y("invalid-input");
          const We = w(P.charCodeAt(Y++));
          (We >= n || We > g((e - O) / ie)) && y("overflow"), O += We * ie;
          const ve = Me <= G ? i : Me >= G + a ? a : Me - G;
          if (We < ve)
            break;
          const ae = n - ve;
          ie > g(e / ae) && y("overflow"), ie *= ae;
        }
        const ee = R.length + 1;
        G = D(O - j, ee, j == 0), g(O / ee) > e - z && y("overflow"), z += g(O / ee), O %= ee, R.splice(O++, 0, z);
      }
      return String.fromCodePoint(...R);
    }, T = function(P) {
      const R = [];
      P = S(P);
      let F = P.length, O = u, z = 0, G = l;
      for (const j of P)
        j < 128 && R.push(m(j));
      let W = R.length, Y = W;
      for (W && R.push(c); Y < F; ) {
        let j = e;
        for (const ie of P)
          ie >= O && ie < j && (j = ie);
        const ee = Y + 1;
        j - O > g((e - z) / ee) && y("overflow"), z += (j - O) * ee, O = j;
        for (const ie of P)
          if (ie < O && ++z > e && y("overflow"), ie == O) {
            let Me = z;
            for (let We = n; ; We += n) {
              const ve = We <= G ? i : We >= G + a ? a : We - G;
              if (Me < ve)
                break;
              const ae = Me - ve, be = n - ve;
              R.push(m(C(ve + ae % be, 0))), Me = g(ae / be);
            }
            R.push(m(C(Me, 0))), G = D(z, ee, Y == W), z = 0, ++Y;
          }
        ++z, ++O;
      }
      return R.join("");
    }, L = function(P) {
      return b(P, function(R) {
        return f.test(R) ? A(R.slice(4).toLowerCase()) : R;
      });
    }, E = function(P) {
      return b(P, function(R) {
        return h.test(R) ? "xn--" + T(R) : R;
      });
    }, I = {
      version: "2.1.0",
      ucs2: {
        decode: S,
        encode: x
      },
      decode: A,
      encode: T,
      toASCII: E,
      toUnicode: L
    };
    t.exports = I;
  }
}), _O = le({
  "node_modules/markdown-it/lib/presets/default.js"(r, t) {
    t.exports = {
      options: {
        html: !1,
        xhtmlOut: !1,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 100
      },
      components: {
        core: {},
        block: {},
        inline: {}
      }
    };
  }
}), bO = le({
  "node_modules/markdown-it/lib/presets/zero.js"(r, t) {
    t.exports = {
      options: {
        html: !1,
        xhtmlOut: !1,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 20
      },
      components: {
        core: {
          rules: [
            "normalize",
            "block",
            "inline"
          ]
        },
        block: {
          rules: [
            "paragraph"
          ]
        },
        inline: {
          rules: [
            "text"
          ],
          rules2: [
            "balance_pairs",
            "text_collapse"
          ]
        }
      }
    };
  }
}), SO = le({
  "node_modules/markdown-it/lib/presets/commonmark.js"(r, t) {
    t.exports = {
      options: {
        html: !0,
        xhtmlOut: !0,
        breaks: !1,
        langPrefix: "language-",
        linkify: !1,
        typographer: !1,
        quotes: "“”‘’",
        highlight: null,
        maxNesting: 20
      },
      components: {
        core: {
          rules: [
            "normalize",
            "block",
            "inline"
          ]
        },
        block: {
          rules: [
            "blockquote",
            "code",
            "fence",
            "heading",
            "hr",
            "html_block",
            "lheading",
            "list",
            "reference",
            "paragraph"
          ]
        },
        inline: {
          rules: [
            "autolink",
            "backticks",
            "emphasis",
            "entity",
            "escape",
            "html_inline",
            "image",
            "link",
            "newline",
            "text"
          ],
          rules2: [
            "balance_pairs",
            "emphasis",
            "text_collapse"
          ]
        }
      }
    };
  }
}), LD = le({
  "node_modules/markdown-it/lib/index.js"(r, t) {
    var e = tt(), n = k5(), i = R5(), a = G5(), o = rO(), s = pO(), l = mO(), u = AD(), c = yO(), f = {
      default: _O(),
      zero: bO(),
      commonmark: SO()
    }, h = /^(vbscript|javascript|file|data):/, v = /^data:image\/(gif|png|jpeg|webp);/;
    function d(_) {
      var b = _.trim().toLowerCase();
      return h.test(b) ? !!v.test(b) : !0;
    }
    var p = ["http:", "https:", "mailto:"];
    function g(_) {
      var b = u.parse(_, !0);
      if (b.hostname && (!b.protocol || p.indexOf(b.protocol) >= 0))
        try {
          b.hostname = c.toASCII(b.hostname);
        } catch {
        }
      return u.encode(u.format(b));
    }
    function m(_) {
      var b = u.parse(_, !0);
      if (b.hostname && (!b.protocol || p.indexOf(b.protocol) >= 0))
        try {
          b.hostname = c.toUnicode(b.hostname);
        } catch {
        }
      return u.decode(u.format(b), u.decode.defaultChars + "%");
    }
    function y(_, b) {
      if (!(this instanceof y))
        return new y(_, b);
      b || e.isString(_) || (b = _ || {}, _ = "default"), this.inline = new s(), this.block = new o(), this.core = new a(), this.renderer = new i(), this.linkify = new l(), this.validateLink = d, this.normalizeLink = g, this.normalizeLinkText = m, this.utils = e, this.helpers = e.assign({}, n), this.options = {}, this.configure(_), b && this.set(b);
    }
    y.prototype.set = function(_) {
      return e.assign(this.options, _), this;
    }, y.prototype.configure = function(_) {
      var b = this, S;
      if (e.isString(_) && (S = _, _ = f[S], !_))
        throw new Error('Wrong `markdown-it` preset "' + S + '", check name');
      if (!_)
        throw new Error("Wrong `markdown-it` preset, can't be empty");
      return _.options && b.set(_.options), _.components && Object.keys(_.components).forEach(function(x) {
        _.components[x].rules && b[x].ruler.enableOnly(_.components[x].rules), _.components[x].rules2 && b[x].ruler2.enableOnly(_.components[x].rules2);
      }), this;
    }, y.prototype.enable = function(_, b) {
      var S = [];
      Array.isArray(_) || (_ = [_]), ["core", "block", "inline"].forEach(function(w) {
        S = S.concat(this[w].ruler.enable(_, !0));
      }, this), S = S.concat(this.inline.ruler2.enable(_, !0));
      var x = _.filter(function(w) {
        return S.indexOf(w) < 0;
      });
      if (x.length && !b)
        throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + x);
      return this;
    }, y.prototype.disable = function(_, b) {
      var S = [];
      Array.isArray(_) || (_ = [_]), ["core", "block", "inline"].forEach(function(w) {
        S = S.concat(this[w].ruler.disable(_, !0));
      }, this), S = S.concat(this.inline.ruler2.disable(_, !0));
      var x = _.filter(function(w) {
        return S.indexOf(w) < 0;
      });
      if (x.length && !b)
        throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + x);
      return this;
    }, y.prototype.use = function(_) {
      var b = [this].concat(Array.prototype.slice.call(arguments, 1));
      return _.apply(_, b), this;
    }, y.prototype.parse = function(_, b) {
      if (typeof _ != "string")
        throw new Error("Input data should be a String");
      var S = new this.core.State(_, this, b);
      return this.core.process(S), S.tokens;
    }, y.prototype.render = function(_, b) {
      return b = b || {}, this.renderer.render(this.parse(_, b), this.options, b);
    }, y.prototype.parseInline = function(_, b) {
      var S = new this.core.State(_, this, b);
      return S.inlineMode = !0, this.core.process(S), S.tokens;
    }, y.prototype.renderInline = function(_, b) {
      return b = b || {}, this.renderer.render(this.parseInline(_, b), this.options, b);
    }, t.exports = y;
  }
}), xO = le({
  "node_modules/markdown-it/index.js"(r, t) {
    t.exports = LD();
  }
}), ED = {};
xD(ED, {
  getAstValues: () => Lg,
  isAst: () => By,
  isFunction: () => wO,
  isVariable: () => CO,
  resolve: () => lu
});
function By(r) {
  return !!(r != null && r.$$mdtype);
}
function wO(r) {
  return (r == null ? void 0 : r.$$mdtype) === "Function";
}
function CO(r) {
  return (r == null ? void 0 : r.$$mdtype) === "Variable";
}
function* Lg(r) {
  if (!(r == null || typeof r != "object")) {
    if (Array.isArray(r))
      for (const t of r)
        yield* Lg(t);
    if (By(r) && (yield r), Object.getPrototypeOf(r) === Object.prototype)
      for (const t of Object.values(r))
        yield* Lg(t);
  }
}
function lu(r, t = {}) {
  if (r == null || typeof r != "object")
    return r;
  if (Array.isArray(r))
    return r.map((n) => lu(n, t));
  if (By(r) && (r == null ? void 0 : r.resolve) instanceof Function)
    return r.resolve(t);
  if (Object.getPrototypeOf(r) !== Object.prototype)
    return r;
  const e = {};
  for (const [n, i] of Object.entries(r))
    e[n] = lu(i, t);
  return e;
}
var sn = class {
  constructor(r = "div", t = {}, e = []) {
    this.$$mdtype = "Tag", this.name = r, this.attributes = t, this.children = e;
  }
};
sn.isTag = (r) => (r == null ? void 0 : r.$$mdtype) === "Tag";
var AO = class {
  validate(r, t, e) {
    return typeof r == "string" || typeof r == "object" ? [] : [
      {
        id: "attribute-type-invalid",
        level: "error",
        message: `Attribute '${e}' must be type 'string | object'`
      }
    ];
  }
  transform(r) {
    if (!r || typeof r == "string")
      return r;
    const t = [];
    for (const [e, n] of Object.entries(r ?? {}))
      n && t.push(e);
    return t.join(" ");
  }
}, DO = class {
  validate(r) {
    return typeof r == "string" && r.match(/^[a-zA-Z]/) ? [] : [
      {
        id: "attribute-value-invalid",
        level: "error",
        message: "The 'id' attribute must start with a letter"
      }
    ];
  }
}, G1 = Zh(wD()), Xh = class {
  constructor(r = []) {
    this.$$mdtype = "Variable", this.path = r;
  }
  resolve({ variables: r } = {}) {
    return r instanceof Function ? r(this.path) : this.path.reduce((t = {}, e) => t[e], r);
  }
}, jh = class {
  constructor(r, t) {
    this.$$mdtype = "Function", this.name = r, this.parameters = t;
  }
  resolve(r = {}) {
    var n, i;
    const t = (n = r == null ? void 0 : r.functions) == null ? void 0 : n[this.name];
    if (!t)
      return null;
    const e = lu(this.parameters, r);
    return (i = t.transform) == null ? void 0 : i.call(t, e, r);
  }
}, H1;
(function(r) {
  r[r.normal = 0] = "normal", r[r.string = 1] = "string", r[r.escape = 2] = "escape";
})(H1 || (H1 = {}));
var Qt = "{%", Ln = "%}", TO = /^[a-zA-Z0-9_-]+$/;
function Wf(r) {
  return typeof r == "string" && TO.test(r);
}
function eo(r) {
  return r && typeof r == "object" && typeof r.then == "function";
}
function Kh(r, t = 0) {
  let e = 0;
  for (let n = t; n < r.length; n++) {
    const i = r[n];
    switch (e) {
      case 1:
        switch (i) {
          case '"':
            e = 0;
            break;
          case "\\":
            e = 2;
            break;
        }
        break;
      case 2:
        e = 1;
        break;
      case 0:
        if (i === '"')
          e = 1;
        else if (r.startsWith(Ln, n))
          return n;
    }
  }
  return null;
}
function MO(r, t, e) {
  try {
    return (0, G1.parse)(r, { Variable: Xh, Function: jh });
  } catch (n) {
    if (!(n instanceof G1.SyntaxError))
      throw n;
    const {
      message: i,
      location: { start: a, end: o }
    } = n, s = {
      start: { line: t, character: a.offset + e },
      end: { line: t + 1, character: o.offset + e }
    };
    return { type: "error", meta: { error: { message: i, location: s } } };
  }
}
function PD(r, t = 0) {
  let e = t + 1;
  const n = [];
  let i = 0;
  for (let a = 0; a < r.length; a++) {
    if (r[a] === `
`) {
      e++;
      continue;
    }
    if (!r.startsWith(Qt, a))
      continue;
    const o = Kh(r, a);
    if (o == null) {
      a = a + Qt.length;
      continue;
    }
    const s = r.slice(a, o + Ln.length), l = r.slice(a + Qt.length, o), u = r.lastIndexOf(`
`, a), c = r.indexOf(`
`, o), f = r.slice(u, c), h = MO(l.trim(), e, a - u), v = f.trim() === s ? u : a, d = r.slice(i, v);
    n.push({
      type: "text",
      start: i,
      end: a - 1,
      content: d
    }), n.push({
      map: [e, e + 1],
      position: {
        start: a - u,
        end: a - u + s.length
      },
      start: a,
      end: a + s.length - 1,
      info: s,
      ...h
    }), i = o + Ln.length, a = i - 1;
  }
  return n.push({
    type: "text",
    start: i,
    end: r.length - 1,
    content: r.slice(i)
  }), n;
}
var Ny = {
  class: { type: AO, render: !0 },
  id: { type: DO, render: !0 }
}, Tl = {
  findSchema(r, { nodes: t = {}, tags: e = {} } = {}) {
    return r.tag ? e[r.tag] : t[r.type];
  },
  attributes(r, t = {}) {
    const e = this.findSchema(r, t) ?? {}, n = {}, i = { ...Ny, ...e.attributes };
    for (const [a, o] of Object.entries(i)) {
      if (o.render == !1)
        continue;
      const s = typeof o.render == "string" ? o.render : a;
      let l = r.attributes[a];
      if (typeof o.type == "function") {
        const u = new o.type();
        u.transform && (l = u.transform(l, t));
      }
      l = l === void 0 ? o.default : l, l !== void 0 && (n[s] = l);
    }
    if (e.slots)
      for (const [a, o] of Object.entries(e.slots)) {
        if (o.render === !1)
          continue;
        const s = typeof o.render == "string" ? o.render : a;
        r.slots[a] && (n[s] = this.node(r.slots[a], t));
      }
    return n;
  },
  children(r, t = {}) {
    const e = r.children.flatMap((n) => this.node(n, t));
    return e.some(eo) ? Promise.all(e) : e;
  },
  node(r, t = {}) {
    const e = this.findSchema(r, t) ?? {};
    if (e && e.transform instanceof Function)
      return e.transform(r, t);
    const n = this.children(r, t);
    if (!e || !e.render)
      return n;
    const i = this.attributes(r, t);
    return eo(i) || eo(n) ? Promise.all([i, n]).then((a) => new sn(e.render, ...a)) : new sn(e.render, i, n);
  }
}, Jh = class {
  constructor(r = "node", t = {}, e = [], n) {
    this.$$mdtype = "Node", this.errors = [], this.lines = [], this.inline = !1, this.attributes = t, this.children = e, this.type = r, this.tag = n, this.annotations = [], this.slots = {};
  }
  *walk() {
    for (const r of [...Object.values(this.slots), ...this.children])
      yield r, yield* r.walk();
  }
  push(r) {
    this.children.push(r);
  }
  resolve(r = {}) {
    return Object.assign(new Jh(), this, {
      children: this.children.map((t) => t.resolve(r)),
      attributes: lu(this.attributes, r),
      slots: Object.fromEntries(Object.entries(this.slots).map(([t, e]) => [
        t,
        e.resolve(r)
      ]))
    });
  }
  findSchema(r = {}) {
    return Tl.findSchema(this, r);
  }
  transformAttributes(r = {}) {
    return Tl.attributes(this, r);
  }
  transformChildren(r) {
    return Tl.children(this, r);
  }
  transform(r) {
    return Tl.node(this, r);
  }
}, kD = {
  Function: jh,
  Node: Jh,
  Variable: Xh
};
function IO(r, t) {
  if (!t)
    return t;
  const e = kD[t.$$mdtype];
  return e ? Object.assign(new e(), t) : t;
}
function LO(r) {
  return JSON.parse(r, IO);
}
var pr = {
  ...kD,
  ...ED,
  fromJSON: LO
}, xt = " ", Eg = ", ", Je = `
`, EO = ".", q1 = "-", PO = 80, kO = ["strong", "em", "s"], RO = (r, t) => Math.max(r, t), Xv = (r, t = 2) => ({
  ...r,
  indent: (r.indent || 0) + t
});
function* ur(r, t) {
  for (const e of r.children)
    yield* jn(e, t);
}
function* fc(r) {
  yield [...r].join("").trim();
}
function* jv(r) {
  yield `| ${r.join(" | ")} |`;
}
function Uf(r) {
  if (r !== void 0)
    return pr.isAst(r) ? Yf(r) : r === null ? "null" : Array.isArray(r) ? "[" + r.map(Uf).join(Eg) + "]" : typeof r == "object" ? "{" + Object.entries(r).map(([t, e]) => `${Wf(t) ? t : `"${t}"`}: ${Uf(e)}`).join(Eg) + "}" : JSON.stringify(r);
}
function Pg(r) {
  const t = Uf(r.value);
  if (t !== void 0)
    return r.name === "primary" ? t : r.name === "id" && typeof r.value == "string" && Wf(r.value) ? "#" + r.value : r.type === "class" && Wf(r.name) ? "." + r.name : `${r.name}=${t}`;
}
function* OO(r) {
  for (const [t, e] of Object.entries(r.attributes))
    if (t === "class" && typeof e == "object" && !pr.isAst(e))
      for (const n of Object.keys(e))
        yield Pg({ type: "class", name: n, value: e });
    else
      yield Pg({ type: "attribute", name: t, value: e });
}
function* Xs(r) {
  r.annotations.length && (yield Qt + xt, yield r.annotations.map(Pg).join(xt), yield xt + Ln);
}
function* FO(r) {
  yield "$", yield r.path.map((t, e) => e === 0 ? t : Wf(t) ? "." + t : typeof t == "number" ? `[${t}]` : `["${t}"]`).join("");
}
function* BO(r) {
  yield r.name, yield "(", yield Object.values(r.parameters).map(Uf).join(Eg), yield ")";
}
function* W1(r) {
  let t;
  do {
    const { value: e, done: n } = r.next();
    if (n)
      return;
    t = e.trimStart();
  } while (!t.length);
  yield t, yield* r;
}
function* hc(r, t) {
  yield r.replace(t, "\\$&").replace(new RegExp(" ", "g"), "&nbsp;");
}
function* NO(r, t = {}) {
  const e = { ...t, parent: r }, n = xt.repeat(e.indent || 0);
  switch (r.type) {
    case "document": {
      r.attributes.frontmatter && r.attributes.frontmatter.length && (yield "---" + Je + r.attributes.frontmatter + Je + "---" + Je + Je), yield* W1(ur(r, e));
      break;
    }
    case "heading": {
      yield Je, yield n, yield "#".repeat(r.attributes.level || 1), yield xt, yield* W1(ur(r, e)), yield* Xs(r), yield Je;
      break;
    }
    case "paragraph": {
      yield Je, yield* ur(r, e), yield* Xs(r), yield Je;
      break;
    }
    case "inline": {
      yield n, yield* ur(r, e);
      break;
    }
    case "image": {
      yield "!", yield "[", yield* jn(r.attributes.alt, e), yield "]", yield "(", yield* typeof r.attributes.src == "string" ? hc(r.attributes.src, /[()]/) : jn(r.attributes.src, e), r.attributes.title && (yield xt + `"${r.attributes.title}"`), yield ")";
      break;
    }
    case "link": {
      yield "[", yield* ur(r, e), yield "]", yield "(", yield* typeof r.attributes.href == "string" ? hc(r.attributes.href, /[()]/g) : jn(r.attributes.href, e), r.attributes.title && (yield xt + `"${r.attributes.title}"`), yield ")";
      break;
    }
    case "text": {
      const { content: i } = r.attributes;
      pr.isAst(i) ? (yield Qt + xt, yield* jn(i, e), yield xt + Ln) : t.parent && kO.includes(t.parent.type) ? yield* hc(i, /[*_~]/g) : yield* hc(i, /^[*>#]/);
      break;
    }
    case "blockquote": {
      const i = ">" + xt;
      yield r.children.map((a) => Yf(a, e).trimStart()).map((a) => Je + n + i + a).join(n + i);
      break;
    }
    case "hr": {
      yield Je, yield n, yield "---", yield Je;
      break;
    }
    case "fence": {
      yield Je, yield n;
      const a = (r.attributes.content.match(/`{3,}/g) || []).map((s) => s.length).reduce(RO, 0), o = "`".repeat(a ? a + 1 : 3);
      yield o, r.attributes.language && (yield r.attributes.language), r.annotations.length && (yield xt), yield* Xs(r), yield Je, yield n, yield r.attributes.content.split(Je).join(Je + n), yield o, yield Je;
      break;
    }
    case "tag": {
      r.inline || (yield Je, yield n);
      const i = Qt + xt, a = [...OO(r)].filter((u) => u !== void 0), o = [i + r.tag, ...a], s = o.join(xt), l = s.length + i.length * 2 > (t.maxTagOpeningWidth || PO);
      yield (!r.inline && l ? o.join(Je + xt.repeat(i.length) + n) : s) + xt + (r.children.length ? "" : "/") + Ln, r.children.length && (yield* ur(r, e.allowIndentation ? Xv(e) : e), r.inline || (yield n), yield Qt + xt + "/" + r.tag + xt + Ln), r.inline || (yield Je);
      break;
    }
    case "list": {
      const i = r.children.some((a) => a.children.some((o) => o.type === "paragraph"));
      for (let a = 0; a < r.children.length; a++) {
        const o = r.attributes.ordered ? `${a === 0 ? r.attributes.start ?? "1" : "1"}${r.attributes.marker ?? EO}` : r.attributes.marker ?? q1;
        let s = Yf(r.children[a], Xv(e, o.length + 1));
        (!i || a === r.children.length - 1) && (s = s.trim()), yield Je + n + o + " " + s;
      }
      yield Je;
      break;
    }
    case "item": {
      for (let i = 0; i < r.children.length; i++)
        yield* jn(r.children[i], e), i === 0 && (yield* Xs(r));
      break;
    }
    case "strong": {
      yield r.attributes.marker ?? "**", yield* fc(ur(r, e)), yield r.attributes.marker ?? "**";
      break;
    }
    case "em": {
      yield r.attributes.marker ?? "*", yield* fc(ur(r, e)), yield r.attributes.marker ?? "*";
      break;
    }
    case "code": {
      yield "`", yield* fc(jn(r.attributes.content, e)), yield "`";
      break;
    }
    case "s": {
      yield "~~", yield* fc(ur(r, e)), yield "~~";
      break;
    }
    case "hardbreak": {
      yield "\\" + Je, yield n;
      break;
    }
    case "softbreak": {
      yield Je, yield n;
      break;
    }
    case "table": {
      const i = [...ur(r, Xv(e))];
      if (t.parent && t.parent.type === "tag" && t.parent.tag === "table") {
        for (let a = 0; a < i.length; a++) {
          const o = i[a];
          if (typeof o == "string")
            o.trim().length && (yield Je, yield o);
          else {
            a !== 0 && (yield Je, yield n + "---");
            for (const s of o)
              yield Je + n + q1 + " " + s;
          }
        }
        yield Je;
      } else {
        const a = [];
        for (const l of i)
          for (let u = 0; u < l.length; u++)
            a[u] = a[u] ? Math.max(a[u], l[u].length) : l[u].length;
        const [o, ...s] = i;
        yield Je, yield* jv(o.map((l, u) => l + xt.repeat(a[u] - l.length))), yield Je, yield* jv(o.map((l, u) => "-".repeat(a[u]))), yield Je;
        for (const l of s)
          yield* jv(l.map((u, c) => u + xt.repeat(a[c] - u.length))), yield Je;
      }
      break;
    }
    case "thead": {
      const [i] = [...ur(r, e)];
      yield i || [];
      break;
    }
    case "tr": {
      yield [...ur(r, e)];
      break;
    }
    case "td":
    case "th": {
      yield [...ur(r, e), ...Xs(r)].join("").trim();
      break;
    }
    case "tbody": {
      yield* ur(r, e);
      break;
    }
    case "comment": {
      yield "<!-- " + r.attributes.content + ` -->
`;
      break;
    }
  }
}
function* jn(r, t = {}) {
  switch (typeof r) {
    case "undefined":
      break;
    case "boolean":
    case "number":
    case "string": {
      yield r.toString();
      break;
    }
    case "object": {
      if (r === null)
        break;
      if (Array.isArray(r)) {
        for (const e of r)
          yield* jn(e, t);
        break;
      }
      switch (r.$$mdtype) {
        case "Function": {
          yield* BO(r);
          break;
        }
        case "Node":
          yield* NO(r, t);
          break;
        case "Variable": {
          yield* FO(r);
          break;
        }
        default:
          throw new Error(`Unimplemented: "${r.$$mdtype}"`);
      }
      break;
    }
  }
}
function Yf(r, t) {
  let e = "";
  for (const n of jn(r, t))
    e += n;
  return e.trimStart();
}
function Nu(r) {
  return r !== !1 && r !== void 0 && r !== null;
}
function zO(r) {
  const t = [
    { condition: r.attributes.primary, children: [] }
  ];
  for (const e of r.children)
    e.type === "tag" && e.tag === "else" ? t.push({
      condition: "primary" in e.attributes ? e.attributes.primary : !0,
      children: []
    }) : t[t.length - 1].children.push(e);
  return t;
}
var VO = {
  attributes: {
    primary: { type: Object, render: !1 }
  },
  transform(r, t) {
    const e = zO(r);
    for (const { condition: n, children: i } of e)
      if (Nu(n)) {
        const a = i.flatMap((o) => o.transform(t));
        return a.some(eo) ? Promise.all(a).then((o) => o.flat()) : a;
      }
    return [];
  }
}, $O = {
  selfClosing: !0,
  attributes: {
    primary: { type: Object, render: !1 }
  }
}, GO = {
  transform(r) {
    return Object.values(r).every((t) => Nu(t));
  }
}, HO = {
  transform(r) {
    return Object.values(r).find((t) => Nu(t)) !== void 0;
  }
}, qO = {
  parameters: {
    0: { required: !0 }
  },
  transform(r) {
    return !Nu(r[0]);
  }
}, WO = {
  transform(r) {
    const t = Object.values(r);
    return t.every((e) => e === t[0]);
  }
}, UO = {
  transform(r) {
    return JSON.stringify(r[0], null, 2);
  }
}, YO = {
  transform(r) {
    return r[0] === void 0 ? r[1] : r[0];
  }
}, RD = { and: GO, or: HO, not: qO, equals: WO, default: YO, debug: UO };
function Kv(r, t = "td") {
  r.type = "tr", r.attributes = {};
  for (const e of r.children)
    e.type = t;
  return r;
}
function ZO(r) {
  for (const t of r.walk()) {
    if (t.type !== "tag" || t.tag !== "table")
      continue;
    const [e, ...n] = t.children;
    if (!e || e.type === "table")
      continue;
    const i = new pr.Node("table", t.attributes, [
      new pr.Node("thead"),
      new pr.Node("tbody")
    ]), [a, o] = i.children;
    e.type === "list" && a.push(Kv(e, "th"));
    for (const s of n) {
      if (s.type === "list")
        Kv(s);
      else if (s.type === "tag" && s.tag === "if") {
        const l = [];
        for (const u of s.children)
          u.type !== "hr" && (u.type === "list" && Kv(u), l.push(u));
        s.children = l;
      } else
        continue;
      o.push(s);
    }
    t.children = [i];
  }
}
var OD = [ZO], U1 = {
  ordered_list: "list",
  bullet_list: "list",
  code_inline: "code",
  list_item: "item",
  variable: "text"
};
function Y1(r, t) {
  for (const e of t) {
    r.annotations.push(e);
    const { name: n, value: i, type: a } = e;
    a === "attribute" ? (r.attributes[n] !== void 0 && r.errors.push({
      id: "duplicate-attribute",
      level: "warning",
      message: `Attribute '${n}' already set`
    }), r.attributes[n] = i) : a === "class" && (r.attributes.class ? r.attributes.class[n] = i : r.attributes.class = { [n]: i });
  }
}
function XO(r, t) {
  switch (t) {
    case "heading":
      return { level: Number(r.tag.replace("h", "")) };
    case "list": {
      const e = r.attrs ? Object.fromEntries(r.attrs) : void 0, n = r.type.startsWith("ordered");
      return n && (e != null && e.start) ? { ordered: !0, start: e.start, marker: r.markup } : { ordered: n, marker: r.markup };
    }
    case "link": {
      const e = Object.fromEntries(r.attrs);
      return e.title ? { href: e.href, title: e.title } : { href: e.href };
    }
    case "image": {
      const e = Object.fromEntries(r.attrs);
      return e.title ? { alt: r.content, src: e.src, title: e.title } : { alt: r.content, src: e.src };
    }
    case "em":
    case "strong":
      return { marker: r.markup };
    case "text":
    case "code":
    case "comment":
      return { content: (r.meta || {}).variable || r.content };
    case "fence": {
      const [e] = r.info.split(" ", 1);
      return e === "" || e === Qt ? { content: r.content } : { content: r.content, language: e };
    }
    case "td":
    case "th": {
      if (r.attrs) {
        const e = Object.fromEntries(r.attrs);
        let n;
        if (e.style && (e.style.includes("left") ? n = "left" : e.style.includes("center") ? n = "center" : e.style.includes("right") && (n = "right")), n)
          return { align: n };
      }
      return {};
    }
    default:
      return {};
  }
}
function FD(r, t, e, n, i, a) {
  if (r.type === "frontmatter") {
    t[0].attributes.frontmatter = r.content;
    return;
  }
  if (r.hidden || r.type === "text" && r.content === "")
    return;
  const o = r.errors || [], s = t[t.length - 1], { tag: l, attributes: u, error: c } = r.meta || {};
  if (r.type === "annotation")
    return a ? Y1(a, u) : s.errors.push({
      id: "no-inline-annotations",
      level: "error",
      message: `Can't apply inline annotations to '${s.type}'`
    });
  let f = r.type.replace(/_(open|close)$/, "");
  if (U1[f] && (f = U1[f]), f === "error") {
    const { message: g, location: m } = c;
    o.push({ id: "parse-error", level: "critical", message: g, location: m });
  }
  if (r.nesting < 0) {
    if (s.type === f && s.tag === l)
      return s.lines && r.map && s.lines.push(...r.map), t.pop();
    o.push({
      id: "missing-opening",
      level: "critical",
      message: `Node '${f}' is missing opening`
    });
  }
  const h = XO(r, f), v = new Jh(f, h, void 0, l || void 0), { position: d = {} } = r;
  if (v.errors = o, i !== !1 && (v.lines = r.map || s.lines || [], v.location = {
    file: e,
    start: {
      line: v.lines[0],
      character: d.start
    },
    end: {
      line: v.lines[1],
      character: d.end
    }
  }), a && (v.inline = !0), u && ["tag", "fence", "image"].includes(f) && Y1(v, u), n && l === "slot" && typeof v.attributes.primary == "string" ? s.slots[v.attributes.primary] = v : s.push(v), r.nesting > 0 && t.push(v), !Array.isArray(r.children))
    return;
  if (v.type === "inline" && (a = s), t.push(v), !(f === "image"))
    for (const g of r.children)
      FD(g, t, e, n, i, a);
  t.pop();
}
function jO(r, t) {
  const e = new Jh("document"), n = [e];
  typeof t == "string" && (t = { file: t });
  for (const i of r)
    FD(i, n, t == null ? void 0 : t.file, t == null ? void 0 : t.slots, t == null ? void 0 : t.location);
  if (n.length > 1)
    for (const i of n.slice(1))
      i.errors.push({
        id: "missing-closing",
        level: "critical",
        message: `Node '${i.tag || i.type}' is missing closing`
      });
  for (const i of OD)
    i(e);
  return e;
}
var zy = {};
xD(zy, {
  blockquote: () => rF,
  code: () => mF,
  comment: () => SF,
  document: () => KO,
  em: () => vF,
  error: () => xF,
  fence: () => tF,
  hardbreak: () => _F,
  heading: () => JO,
  hr: () => aF,
  image: () => eF,
  inline: () => pF,
  item: () => nF,
  link: () => gF,
  list: () => iF,
  node: () => wF,
  paragraph: () => QO,
  s: () => dF,
  softbreak: () => bF,
  strong: () => hF,
  table: () => oF,
  tbody: () => cF,
  td: () => sF,
  text: () => yF,
  th: () => lF,
  thead: () => fF,
  tr: () => uF
});
var KO = {
  render: "article",
  children: [
    "heading",
    "paragraph",
    "image",
    "table",
    "tag",
    "fence",
    "blockquote",
    "comment",
    "list",
    "hr"
  ],
  attributes: {
    frontmatter: { render: !1 }
  }
}, JO = {
  children: ["inline"],
  attributes: {
    level: { type: Number, render: !1, required: !0 }
  },
  transform(r, t) {
    return new sn(`h${r.attributes.level}`, r.transformAttributes(t), r.transformChildren(t));
  }
}, QO = {
  render: "p",
  children: ["inline"]
}, eF = {
  render: "img",
  attributes: {
    src: { type: String, required: !0 },
    alt: { type: String },
    title: { type: String }
  }
}, tF = {
  render: "pre",
  attributes: {
    content: { type: String, render: !1, required: !0 },
    language: { type: String, render: "data-language" },
    process: { type: Boolean, render: !1, default: !0 }
  },
  transform(r, t) {
    const e = r.transformAttributes(t), n = r.children.length ? r.transformChildren(t) : [r.attributes.content];
    return new sn("pre", e, n);
  }
}, rF = {
  render: "blockquote",
  children: [
    "heading",
    "paragraph",
    "image",
    "table",
    "tag",
    "fence",
    "blockquote",
    "list",
    "hr"
  ]
}, nF = {
  render: "li",
  children: [
    "inline",
    "heading",
    "paragraph",
    "image",
    "table",
    "tag",
    "fence",
    "blockquote",
    "list",
    "hr"
  ]
}, iF = {
  children: ["item"],
  attributes: {
    ordered: { type: Boolean, render: !1, required: !0 },
    start: { type: Number },
    marker: { type: String, render: !1 }
  },
  transform(r, t) {
    return new sn(r.attributes.ordered ? "ol" : "ul", r.transformAttributes(t), r.transformChildren(t));
  }
}, aF = {
  render: "hr"
}, oF = {
  render: "table"
}, sF = {
  render: "td",
  children: [
    "inline",
    "heading",
    "paragraph",
    "image",
    "table",
    "tag",
    "fence",
    "blockquote",
    "list",
    "hr"
  ],
  attributes: {
    align: { type: String },
    colspan: { type: Number, render: "colSpan" },
    rowspan: { type: Number, render: "rowSpan" }
  }
}, lF = {
  render: "th",
  attributes: {
    width: { type: String },
    align: { type: String },
    colspan: { type: Number, render: "colSpan" },
    rowspan: { type: Number, render: "rowSpan" }
  }
}, uF = {
  render: "tr",
  children: ["th", "td"]
}, cF = {
  render: "tbody",
  children: ["tr", "tag"]
}, fF = {
  render: "thead",
  children: ["tr"]
}, hF = {
  render: "strong",
  children: ["em", "s", "link", "code", "text", "tag"],
  attributes: {
    marker: { type: String, render: !1 }
  }
}, vF = {
  render: "em",
  children: ["strong", "s", "link", "code", "text", "tag"],
  attributes: {
    marker: { type: String, render: !1 }
  }
}, dF = {
  render: "s",
  children: ["strong", "em", "link", "code", "text", "tag"]
}, pF = {
  children: [
    "strong",
    "em",
    "s",
    "code",
    "text",
    "tag",
    "link",
    "image",
    "hardbreak",
    "softbreak",
    "comment"
  ]
}, gF = {
  render: "a",
  children: ["strong", "em", "s", "code", "text", "tag"],
  attributes: {
    href: { type: String, required: !0 },
    title: { type: String }
  }
}, mF = {
  render: "code",
  attributes: {
    content: { type: String, render: !1, required: !0 }
  },
  transform(r, t) {
    const e = r.transformAttributes(t);
    return new sn("code", e, [r.attributes.content]);
  }
}, yF = {
  attributes: {
    content: { type: String, required: !0 }
  },
  transform(r) {
    return r.attributes.content;
  }
}, _F = {
  render: "br"
}, bF = {
  transform() {
    return " ";
  }
}, SF = {
  attributes: {
    content: { type: String, required: !0 }
  }
}, xF = {}, wF = {}, CF = Zh(xO()), { escapeHtml: Z1 } = (0, CF.default)().utils, AF = /* @__PURE__ */ new Set([
  "area",
  "base",
  "br",
  "col",
  "embed",
  "hr",
  "img",
  "input",
  "link",
  "meta",
  "param",
  "source",
  "track",
  "wbr"
]);
function Sf(r) {
  if (typeof r == "string" || typeof r == "number")
    return Z1(String(r));
  if (Array.isArray(r))
    return r.map(Sf).join("");
  if (r === null || typeof r != "object" || !sn.isTag(r))
    return "";
  const { name: t, attributes: e, children: n = [] } = r;
  if (!t)
    return Sf(n);
  let i = `<${t}`;
  for (const [a, o] of Object.entries(e ?? {}))
    i += ` ${a.toLowerCase()}="${Z1(String(o))}"`;
  return i += ">", AF.has(t) || (n.length && (i += Sf(n)), i += `</${t}>`), i;
}
function DF(r, t) {
  return typeof r != "string" || r[0] !== r[0].toUpperCase() ? r : t instanceof Function ? t(r) : t[r];
}
function TF(r, t, { components: e = {} } = {}) {
  function n(a) {
    if (a == null || typeof a != "object")
      return a;
    if (Array.isArray(a))
      return a.map((s) => n(s));
    if (a.$$mdtype === "Tag")
      return i(a);
    if (typeof a != "object")
      return a;
    const o = {};
    for (const [s, l] of Object.entries(a))
      o[s] = n(l);
    return o;
  }
  function i(a) {
    if (Array.isArray(a))
      return t.createElement(t.Fragment, null, ...a.map(i));
    if (a === null || typeof a != "object" || !sn.isTag(a))
      return a;
    const {
      name: o,
      attributes: { class: s, ...l } = {},
      children: u = []
    } = a;
    return s && (l.className = s), t.createElement(DF(o, e), Object.keys(l).length == 0 ? null : n(l), ...u.map(i));
  }
  return i(r);
}
function MF(r, t) {
  return typeof r != "string" ? "Fragment" : r[0] !== r[0].toUpperCase() ? r : t instanceof Function ? t(r) : t[r];
}
function X1(r) {
  return r.map(Vy).join(", ");
}
function kg(r) {
  return r == null || typeof r != "object" ? JSON.stringify(r) : Array.isArray(r) ? `[${r.map((e) => kg(e)).join(", ")}]` : r.$$mdtype === "Tag" ? Vy(r) : typeof r != "object" ? JSON.stringify(r) : `{${Object.entries(r).map(([e, n]) => [JSON.stringify(e), kg(n)].join(": ")).join(", ")}}`;
}
function Vy(r) {
  if (Array.isArray(r))
    return `React.createElement(React.Fragment, null, ${X1(r)})`;
  if (r === null || typeof r != "object" || !sn.isTag(r))
    return JSON.stringify(r);
  const {
    name: t,
    attributes: { class: e, ...n } = {},
    children: i = []
  } = r;
  return e && (n.className = e), `React.createElement(
    tagName(${JSON.stringify(t)}, components),
    ${Object.keys(n).length == 0 ? "null" : kg(n)},
    ${X1(i)})`;
}
function IF(r) {
  return `
  (({components = {}} = {}) => {
    ${MF}
    return ${Vy(r)};
  })
`;
}
var LF = { html: Sf, react: TF, reactStatic: IF }, EF = class {
  validate(r, t) {
    const { partials: e = {} } = t;
    return e[r] ? [] : [
      {
        id: "attribute-value-invalid",
        level: "error",
        message: `Partial \`${r}\` not found. The 'file' attribute must be set in \`config.partials\``
      }
    ];
  }
}, PF = {
  inline: !1,
  selfClosing: !0,
  attributes: {
    file: { type: EF, render: !1, required: !0 },
    variables: { type: Object, render: !1 }
  },
  transform(r, t) {
    const { partials: e = {} } = t, { file: n, variables: i } = r.attributes, a = e[n];
    if (!a)
      return null;
    const o = {
      ...t,
      variables: {
        ...t.variables,
        ...i,
        "$$partial:filename": n
      }
    }, s = (l) => l.resolve(o).transformChildren(o);
    return Array.isArray(a) ? a.flatMap(s) : s(a);
  }
}, kF = {
  children: ["table"],
  inline: !1
}, RF = {
  attributes: {
    primary: { type: String, required: !0 }
  }
}, BD = {
  else: $O,
  if: VO,
  partial: PF,
  slot: RF,
  table: kF
}, OF = Zh(LD()), Zf = Zh(wD());
function ND(r, t, e) {
  try {
    const { type: n, meta: i, nesting: a = 0 } = (0, Zf.parse)(t, { Variable: Xh, Function: jh }), o = r.push(n, "", a);
    return o.info = t, o.meta = i, r.delimiters || (r.delimiters = []), o;
  } catch (n) {
    if (!(n instanceof Zf.SyntaxError))
      throw n;
    const {
      message: i,
      location: { start: a, end: o }
    } = n, s = e ? {
      start: { offset: a.offset + e },
      end: { offset: o.offset + e }
    } : null, l = r.push("error", "", 0);
    return l.meta = { error: { message: i, location: s } }, l;
  }
}
function FF(r, t, e, n) {
  const i = r.bMarks[t] + r.tShift[t], a = r.eMarks[t];
  if (!r.src.startsWith(Qt, i))
    return !1;
  const o = Kh(r.src, i), s = r.src.slice(0, a).trim().length;
  if (!o || o < s - Ln.length)
    return !1;
  const l = i + Qt.length, u = r.src.slice(l, o).trim(), c = r.src.slice(i, o + Ln.length).split(`
`).length;
  if (u[0] === "$")
    return !1;
  if (n)
    return !0;
  const f = ND(r, u, l);
  return f.map = [t, t + c], r.line += c, !0;
}
function BF(r, t) {
  if (!r.src.startsWith(Qt, r.pos))
    return !1;
  const e = Kh(r.src, r.pos);
  if (!e)
    return !1;
  const n = r.src.slice(r.pos + Qt.length, e);
  return t || ND(r, n.trim()), r.pos = e + Ln.length, !0;
}
function NF(r) {
  var e, n;
  let t;
  for (t of r.tokens)
    if (t.type === "fence") {
      if (t.info.includes(Qt)) {
        const i = t.info.indexOf(Qt), a = Kh(t.info, i), o = t.info.slice(i + Qt.length, a);
        try {
          const { meta: s } = (0, Zf.parse)(o.trim(), { Variable: Xh, Function: jh });
          t.meta = s;
        } catch (s) {
          if (!(s instanceof Zf.SyntaxError))
            throw s;
          t.errors || (t.errors = []), t.errors.push({
            id: "fence-tag-error",
            level: "error",
            message: `Syntax error in fence tag: ${s.message}`
          });
        }
      }
      (n = (e = t == null ? void 0 : t.meta) == null ? void 0 : e.attributes) != null && n.find((i) => i.name === "process" && !i.value) || (t.children = PD(t.content, t.map[0]));
    }
}
function zF(r) {
  r.block.ruler.before("paragraph", "annotations", FF, {
    alt: ["paragraph", "blockquote"]
  }), r.inline.ruler.push("containers", BF), r.core.ruler.push("annotations", NF);
}
var zD = "---";
function VD(r, t) {
  return r.src.slice(r.bMarks[t], r.eMarks[t]).trim();
}
function VF(r, t) {
  for (let e = 1; e < t; e++)
    if (VD(r, e) === zD)
      return e;
}
function $F(r, t, e, n) {
  if (t != 0 || VD(r, 0) != zD)
    return !1;
  const i = VF(r, e);
  if (!i)
    return !1;
  if (n)
    return !0;
  const a = r.push("frontmatter", "", 0);
  return a.content = r.src.slice(r.eMarks[0], r.bMarks[i]).trim(), a.map = [0, i], a.hidden = !0, r.line = i + 1, !0;
}
function GF(r) {
  r.block.ruler.before("hr", "frontmatter", $F);
}
var Xf = "<!--", Rg = "-->";
function HF(r, t, e, n) {
  const i = r.bMarks[t] + r.tShift[t];
  if (!r.src.startsWith(Xf, i))
    return !1;
  const a = r.src.indexOf(Rg, i);
  if (!a)
    return !1;
  if (n)
    return !0;
  const o = r.src.slice(i + Xf.length, a), s = o.split(`
`).length, l = r.push("comment", "", 0);
  return l.content = o.trim(), l.map = [t, t + s], r.line += s, !0;
}
function qF(r, t) {
  if (!r.src.startsWith(Xf, r.pos))
    return !1;
  const e = r.src.indexOf(Rg, r.pos);
  if (!e)
    return !1;
  if (t)
    return !0;
  const n = r.src.slice(r.pos + Xf.length, e), i = r.push("comment", "", 0);
  return i.content = n.trim(), r.pos = e + Rg.length, !0;
}
function WF(r) {
  r.block.ruler.before("table", "comment", HF, { alt: ["paragraph"] }), r.inline.ruler.push("comment", qF);
}
var $D = class {
  constructor(r = {}) {
    this.parser = new OF.default(r), this.parser.use(zF, "annotations", {}), this.parser.use(GF, "frontmatter", {}), this.parser.disable([
      "lheading",
      "code"
    ]), r.allowComments && this.parser.use(WF, "comments", {});
  }
  tokenize(r) {
    return this.parser.parse(r.toString(), {});
  }
}, UF = {
  String,
  Number,
  Array,
  Object,
  Boolean
};
function $y(r, t, e, n) {
  var i, a;
  if (!r)
    return !0;
  if (pr.isFunction(t) && ((i = e.validation) != null && i.validateFunctions)) {
    const o = (a = e.functions) == null ? void 0 : a[t.name];
    return o != null && o.returns ? Array.isArray(o.returns) ? o.returns.find((s) => s === r) !== void 0 : o.returns === r : !0;
  }
  if (pr.isAst(t))
    return !0;
  if (Array.isArray(r))
    return r.some((o) => $y(o, t, e, n));
  if (typeof r == "string" && (r = UF[r]), typeof r == "function") {
    const o = new r();
    if (o.validate)
      return o.validate(t, e, n);
  }
  return t != null && t.constructor === r;
}
function Gy(r) {
  return typeof r == "string" ? r : Array.isArray(r) ? r.map(Gy).join(" | ") : r.name;
}
function YF(r, t) {
  var i, a;
  const e = (i = t.functions) == null ? void 0 : i[r.name], n = [];
  if (!e)
    return [
      {
        id: "function-undefined",
        level: "critical",
        message: `Undefined function: '${r.name}'`
      }
    ];
  if (e.validate && n.push(...e.validate(r, t)), e.parameters)
    for (const [o, s] of Object.entries(r.parameters)) {
      const l = (a = e.parameters) == null ? void 0 : a[o];
      if (!l) {
        n.push({
          id: "parameter-undefined",
          level: "error",
          message: `Invalid parameter: '${o}'`
        });
        continue;
      }
      if (!(pr.isAst(s) && !pr.isFunction(s)) && l.type) {
        const u = $y(l.type, s, t, o);
        u === !1 ? n.push({
          id: "parameter-type-invalid",
          level: "error",
          message: `Parameter '${o}' of '${r.name}' must be type of '${Gy(l.type)}'`
        }) : Array.isArray(u) && n.push(...u);
      }
    }
  for (const [o, { required: s }] of Object.entries(e.parameters ?? {}))
    s && r.parameters[o] === void 0 && n.push({
      id: "parameter-missing-required",
      level: "error",
      message: `Missing required parameter: '${o}'`
    });
  return n;
}
function ZF(r, t) {
  return r.length <= t ? JSON.stringify(r) : `[${r.slice(0, t).map((n) => JSON.stringify(n)).join(",")}, ... ${r.length - t} more]`;
}
function GD(r, t) {
  var a, o;
  const e = r.findSchema(t), n = [...r.errors || []];
  if (!e)
    return n.push({
      id: r.tag ? "tag-undefined" : "node-undefined",
      level: "critical",
      message: r.tag ? `Undefined tag: '${r.tag}'` : `Undefined node: '${r.type}'`
    }), n;
  e.inline != null && r.inline !== e.inline && n.push({
    id: "tag-placement-invalid",
    level: "critical",
    message: `'${r.tag}' tag should be ${e.inline ? "inline" : "block"}`
  }), e.selfClosing && r.children.length > 0 && n.push({
    id: "tag-selfclosing-has-children",
    level: "critical",
    message: `'${r.tag}' tag should be self-closing`
  });
  const i = {
    ...Ny,
    ...e.attributes
  };
  for (const s of Object.keys(r.slots))
    ((a = e.slots) == null ? void 0 : a[s]) || n.push({
      id: "slot-undefined",
      level: "error",
      message: `Invalid slot: '${s}'`
    });
  for (let [s, l] of Object.entries(r.attributes)) {
    const u = i[s];
    if (!u) {
      n.push({
        id: "attribute-undefined",
        level: "error",
        message: `Invalid attribute: '${s}'`
      });
      continue;
    }
    let { type: c, matches: f, errorLevel: h } = u;
    if (pr.isAst(l))
      if (pr.isFunction(l) && ((o = t.validation) != null && o.validateFunctions))
        n.push(...YF(l, t));
      else if (pr.isVariable(l) && t.variables) {
        let v = !1, d = t.variables;
        for (const p of l.path) {
          if (!Object.prototype.hasOwnProperty.call(d, p)) {
            v = !0;
            break;
          }
          d = d[p];
        }
        v && n.push({
          id: "variable-undefined",
          level: "error",
          message: `Undefined variable: '${l.path.join(".")}'`
        });
      } else
        continue;
    if (l = l, c) {
      const v = $y(c, l, t, s);
      v === !1 && n.push({
        id: "attribute-type-invalid",
        level: h || "error",
        message: `Attribute '${s}' must be type of '${Gy(c)}'`
      }), Array.isArray(v) && n.push(...v);
    }
    if (typeof f == "function" && (f = f(t)), Array.isArray(f) && !f.includes(l) && n.push({
      id: "attribute-value-invalid",
      level: h || "error",
      message: `Attribute '${s}' must match one of ${ZF(f, 8)}. Got '${l}' instead.`
    }), f instanceof RegExp && !f.test(l) && n.push({
      id: "attribute-value-invalid",
      level: h || "error",
      message: `Attribute '${s}' must match ${f}. Got '${l}' instead.`
    }), typeof u.validate == "function") {
      const v = u.validate(l, t, s);
      Array.isArray(v) && n.push(...v);
    }
  }
  for (const [s, { required: l }] of Object.entries(i))
    l && r.attributes[s] === void 0 && n.push({
      id: "attribute-missing-required",
      level: "error",
      message: `Missing required attribute: '${s}'`
    });
  if (e.slots)
    for (const [s, { required: l }] of Object.entries(e.slots))
      l && r.slots[s] === void 0 && n.push({
        id: "slot-missing-required",
        level: "error",
        message: `Missing required slot: '${s}'`
      });
  for (const { type: s } of r.children)
    e.children && s !== "error" && !e.children.includes(s) && n.push({
      id: "child-invalid",
      level: "warning",
      message: `Can't nest '${s}' in '${r.tag || r.type}'`
    });
  if (e.validate) {
    const s = e.validate(r, t);
    if (eo(s))
      return s.then((l) => n.concat(l));
    n.push(...s);
  }
  return n;
}
function* HD(r, t = []) {
  yield [r, t];
  for (const e of [...Object.values(r.slots), ...r.children])
    yield* HD(e, [...t, r]);
}
function XF(r, t) {
  const e = [...HD(r)].map(([n, i]) => {
    const { type: a, lines: o, location: s } = n, l = {
      ...t,
      validation: { ...t.validation, parents: i }
    }, u = GD(n, l);
    return eo(u) ? u.then((c) => c.map((f) => ({ type: a, lines: o, location: s, error: f }))) : u.map((c) => ({ type: a, lines: o, location: s, error: c }));
  });
  return e.some(eo) ? Promise.all(e).then((n) => n.flat()) : e.flat();
}
var jF = new $D();
function qD(r = {}) {
  return {
    ...r,
    tags: {
      ...BD,
      ...r.tags
    },
    nodes: {
      ...zy,
      ...r.nodes
    },
    functions: {
      ...RD,
      ...r.functions
    }
  };
}
function WD(r, t) {
  return typeof r == "string" && (r = jF.tokenize(r)), jO(r, t);
}
function UD(r, t) {
  return Array.isArray(r) ? r.flatMap((e) => e.resolve(t)) : r.resolve(t);
}
function YD(r, t) {
  const e = qD(t), n = UD(r, e);
  return Array.isArray(n) ? n.flatMap((i) => i.transform(e)) : n.transform(e);
}
function ZD(r, t) {
  const e = qD(t);
  return XF(r, e);
}
function KF(r, t = {}, ...e) {
  return { name: r, attributes: t, children: e };
}
var ot = class {
  constructor(r) {
    this.parse = WD, this.resolve = (t) => UD(t, this.config), this.transform = (t) => YD(t, this.config), this.validate = (t) => ZD(t, this.config), this.config = r;
  }
};
ot.nodes = zy;
ot.tags = BD;
ot.functions = RD;
ot.globalAttributes = Ny;
ot.renderers = LF;
ot.transforms = OD;
ot.Ast = pr;
ot.Tag = sn;
ot.Tokenizer = $D;
ot.parseTags = PD;
ot.transformer = Tl;
ot.validator = GD;
ot.parse = WD;
ot.transform = YD;
ot.validate = ZD;
ot.createElement = KF;
ot.truthy = Nu;
ot.format = Yf;
const JF = /^---\s*\n([\s\S]*?)\n---\s*\n/;
function QF(r) {
  const t = r.match(JF);
  if (!t)
    return { frontmatter: {}, body: r };
  const e = t[1], n = r.slice(t[0].length), i = {};
  for (const a of e.split(`
`)) {
    const o = a.indexOf(":");
    if (o > 0) {
      const s = a.slice(0, o).trim();
      let l = a.slice(o + 1).trim();
      l === "true" ? l = !0 : l === "false" ? l = !1 : !isNaN(Number(l)) && l !== "" ? l = Number(l) : (typeof l == "string" && l.startsWith('"') && l.endsWith('"') || typeof l == "string" && l.startsWith("'") && l.endsWith("'")) && (l = l.slice(1, -1)), i[s] = l;
    }
  }
  return { frontmatter: i, body: n };
}
function Hy(r) {
  var t;
  return r.type === "text" ? ((t = r.attributes) == null ? void 0 : t.content) || "" : r.children ? r.children.filter((e) => typeof e == "object" && e !== null).map(Hy).join(`
`) : "";
}
const e3 = {
  line_chart: {
    render: "lence-chart",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      x: { type: String, required: !0 },
      y: { type: String, required: !0 },
      title: { type: String }
    },
    transform(r, t) {
      const e = r.transformAttributes(t);
      return new ot.Tag("lence-chart", { ...e, type: "line" }, []);
    }
  },
  bar_chart: {
    render: "lence-chart",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      x: { type: String, required: !0 },
      y: { type: String, required: !0 },
      title: { type: String }
    },
    transform(r, t) {
      const e = r.transformAttributes(t);
      return new ot.Tag("lence-chart", { ...e, type: "bar" }, []);
    }
  },
  pie_chart: {
    render: "lence-chart",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      x: { type: String, required: !0 },
      y: { type: String, required: !0 },
      title: { type: String }
    },
    transform(r, t) {
      const e = r.transformAttributes(t);
      return new ot.Tag("lence-chart", { ...e, type: "pie" }, []);
    }
  },
  scatter_chart: {
    render: "lence-chart",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      x: { type: String, required: !0 },
      y: { type: String, required: !0 },
      title: { type: String }
    },
    transform(r, t) {
      const e = r.transformAttributes(t);
      return new ot.Tag("lence-chart", { ...e, type: "scatter" }, []);
    }
  },
  area_chart: {
    render: "lence-area-chart",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      x: { type: String, required: !0 },
      y: { type: String, required: !0 },
      title: { type: String },
      stacked: { type: Boolean, default: !1 }
    }
  },
  table: {
    render: "lence-data-table",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      search: { type: Boolean, default: !1 },
      pagination: { type: Number },
      sort: { type: Boolean, default: !0 }
    }
  },
  gantt_chart: {
    render: "lence-gantt",
    selfClosing: !0,
    attributes: {
      data: { type: String, required: !0 },
      label: { type: String, required: !0 },
      start: { type: String, required: !0 },
      end: { type: String, required: !0 },
      title: { type: String },
      url: { type: String },
      showToday: { type: Boolean, default: !1 },
      viewStart: { type: String },
      viewEnd: { type: String },
      maxHeight: { type: Number }
    }
  },
  dropdown: {
    render: "lence-dropdown",
    selfClosing: !0,
    attributes: {
      name: { type: String, required: !0 },
      data: { type: String },
      value: { type: String },
      label: { type: String },
      title: { type: String },
      defaultValue: { type: String },
      placeholder: { type: String },
      disableSelectAll: { type: Boolean, default: !1 }
    }
  },
  checkbox: {
    render: "lence-checkbox",
    selfClosing: !0,
    attributes: {
      name: { type: String, required: !0 },
      title: { type: String },
      label: { type: String, required: !0 },
      defaultValue: { type: Boolean, default: !1 }
    }
  },
  data: {
    render: "data-block",
    attributes: {
      name: { type: String, required: !0 }
    },
    transform(r, t) {
      const e = r.transformAttributes(t), n = Hy(r).trim();
      return new ot.Tag("data-block", { ...e, json: n }, []);
    }
  }
}, j1 = {
  tags: e3
}, t3 = /```sql\s+\w+\s*\n[\s\S]*?```\n?/g;
function r3(r) {
  return r.replace(t3, "");
}
function n3(r) {
  const t = [], e = /```sql\s+(\w+)\s*\n([\s\S]*?)```/g;
  let n;
  for (; (n = e.exec(r)) !== null; ) {
    const i = n[1], a = n[2].trim();
    t.push({ name: i, sql: a });
  }
  return t;
}
function i3(r) {
  const t = ot.parse(r), e = [];
  function n(i) {
    if (!(i.type === "fence" || i.type === "code")) {
      if (i.type === "tag" && i.tag === "data") {
        const a = i.attributes || {}, o = Hy(i).trim();
        e.push({
          name: a.name,
          json: o
        });
      }
      if (i.children)
        for (const a of i.children)
          typeof a == "object" && a !== null && n(a);
    }
  }
  return n(t), e;
}
function K1(r) {
  const t = [];
  function e(n) {
    var a;
    if (n === null || typeof n != "object") return;
    if (Array.isArray(n)) {
      for (const o of n)
        e(o);
      return;
    }
    const i = n;
    if ((a = i.name) != null && a.startsWith("lence-") && t.push({
      type: i.name,
      attributes: i.attributes || {}
    }), i.children)
      for (const o of i.children)
        e(o);
  }
  return e(r), t;
}
function J1(r) {
  const t = /* @__PURE__ */ new Set();
  for (const e of r) {
    const n = e.attributes.data;
    typeof n == "string" && t.add(n);
  }
  return Array.from(t);
}
function Q1(r) {
  const { frontmatter: t, body: e } = QF(r), n = n3(e), i = r3(e), a = ot.parse(i), o = ot.validate(a, j1), s = i3(i);
  return {
    content: ot.transform(a, j1),
    queries: n,
    data: s,
    frontmatter: t,
    errors: o
  };
}
function eb(r) {
  return ot.renderers.html(r);
}
function tb(r) {
  const t = /* @__PURE__ */ new Map();
  for (const e of r)
    t.set(e.name, e);
  return t;
}
var a3 = Object.defineProperty, yr = (r, t, e, n) => {
  for (var i = void 0, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = o(t, e, i) || i);
  return i && a3(t, e, i), i;
};
const i1 = class i1 extends wr {
  constructor() {
    super(...arguments), this.path = "/", this.htmlContent = "", this.rawContent = "", this.loading = !0, this.error = null, this.queryData = /* @__PURE__ */ new Map(), this.queryErrors = /* @__PURE__ */ new Map(), this.parseErrors = [], this.showSourceEnabled = !1, this.viewingSource = !1, this.editMode = !1, this.editing = !1, this.isDirty = !1, this.saving = !1, this.originalContent = "", this.queryMap = /* @__PURE__ */ new Map(), this.pagePath = "", this.inputDependencies = /* @__PURE__ */ new Map(), this.boundRequestEditHandler = this.handleRequestEdit.bind(this), this.boundBeforeUnload = this.handleBeforeUnload.bind(this);
  }
  connectedCallback() {
    super.connectedCallback(), this.unsubscribeInputs = Sr.onChange((t) => this.handleInputChange(t)), this.loadSettings(), this.loadPage(), this.handleKeyDown = this.handleKeyDown.bind(this), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("lence-request-edit", this.boundRequestEditHandler);
  }
  async loadSettings() {
    try {
      const t = await bD();
      this.showSourceEnabled = t.showSource, this.editMode = t.editMode;
    } catch {
    }
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.unsubscribeInputs && this.unsubscribeInputs(), this.editDebounceTimer && clearTimeout(this.editDebounceTimer), this.clearNavigationGuard && this.clearNavigationGuard(), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("lence-request-edit", this.boundRequestEditHandler), window.removeEventListener("beforeunload", this.boundBeforeUnload);
  }
  handleRequestEdit() {
    this.editMode && !this.editing && (this.originalContent = this.rawContent, this.isDirty = !1, this.editing = !0);
  }
  handleBeforeUnload(t) {
    if (this.isDirty)
      return t.preventDefault(), t.returnValue = "", "";
  }
  updated(t) {
    t.has("path") && this.path && this.loadPage(), t.has("editing") && this.dispatchEvent(new CustomEvent("lence-editing-change", {
      detail: { editing: this.editing },
      bubbles: !0,
      composed: !0
    })), t.has("isDirty") && (this.isDirty ? (window.addEventListener("beforeunload", this.boundBeforeUnload), this.clearNavigationGuard = Li().setNavigationGuard(() => confirm("You have unsaved changes. Are you sure you want to leave?"))) : (window.removeEventListener("beforeunload", this.boundBeforeUnload), this.clearNavigationGuard && (this.clearNavigationGuard(), this.clearNavigationGuard = void 0))), (t.has("queryData") || t.has("htmlContent") || t.has("editing")) && requestAnimationFrame(() => this.updateComponentData());
  }
  async loadPage() {
    this.loading = !0, this.error = null, this.queryData = /* @__PURE__ */ new Map(), this.queryErrors = /* @__PURE__ */ new Map(), this.parseErrors = [], this.inputDependencies = /* @__PURE__ */ new Map(), this.viewingSource = !1, this.editing = !1, Sr.clear();
    try {
      const t = N1(this.path), e = await l5(t);
      this.pagePath = "/" + t + ".md", this.rawContent = e.content, this.updateDocumentTitle(e.frontmatter.title);
      const n = Q1(e.content);
      this.htmlContent = eb(n.content), this.queryMap = tb(n.queries), this.parseErrors = n.errors, this.buildInputDependencies(), this.processInlineData(n.data);
      const i = K1(n.content), o = J1(i).filter((s) => !this.queryData.has(s));
      await this.executeQueries(o);
    } catch (t) {
      this.error = t instanceof Error ? t.message : "Failed to load page", this.htmlContent = "";
    } finally {
      this.loading = !1;
    }
  }
  /**
   * Build a map of input name -> dependent query names by parsing SQL.
   */
  buildInputDependencies() {
    const t = /\$\{inputs\.(\w+)\.value\}/g;
    for (const [e, n] of this.queryMap) {
      let i;
      for (; (i = t.exec(n.sql)) !== null; ) {
        const a = i[1], o = this.inputDependencies.get(a) || [];
        o.includes(e) || o.push(e), this.inputDependencies.set(a, o);
      }
    }
  }
  /**
   * Handle input value changes by re-executing dependent queries.
   */
  async handleInputChange(t) {
    const e = this.inputDependencies.get(t);
    if (!(!e || e.length === 0)) {
      for (const n of e)
        this.queryErrors.delete(n);
      await this.executeQueries(e);
    }
  }
  /**
   * Process inline data definitions and add to queryData.
   */
  processInlineData(t) {
    var e;
    for (const n of t)
      try {
        const i = JSON.parse(n.json), a = {
          columns: i.columns || [],
          data: i.data || [],
          row_count: i.row_count ?? ((e = i.data) == null ? void 0 : e.length) ?? 0
        };
        this.queryData = new Map(this.queryData).set(n.name, a);
      } catch (i) {
        const a = i instanceof Error ? i.message : "Invalid JSON";
        this.queryErrors = new Map(this.queryErrors).set(n.name, `Data "${n.name}": ${a}`);
      }
  }
  async executeQueries(t) {
    const e = t.map(async (n) => {
      const i = this.queryMap.get(n);
      if (!i) {
        this.queryErrors.set(n, `Query not defined: ${n}`);
        return;
      }
      try {
        const a = this.collectQueryParams(i), o = await a5(
          this.pagePath,
          n,
          a,
          this.editMode ? i.sql : void 0
        );
        this.queryData = new Map(this.queryData).set(n, o);
      } catch (a) {
        const o = a instanceof Error ? a.message : "Query failed";
        this.queryErrors = new Map(this.queryErrors).set(n, o);
      }
    });
    await Promise.all(e);
  }
  /**
   * Collect parameter values from inputs for a query.
   * Extracts values for all ${inputs.X.value} references in the query SQL.
   */
  collectQueryParams(t) {
    const e = {}, n = /\$\{inputs\.(\w+)\.value\}/g;
    let i;
    for (; (i = n.exec(t.sql)) !== null; ) {
      const a = i[1];
      if (!(a in e)) {
        const o = Sr.get(a);
        e[a] = o.value ?? "";
      }
    }
    return e;
  }
  /**
   * After rendering, find components and pass them their data.
   */
  updateComponentData() {
    var i;
    const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".preview-pane .content, .content");
    if (!t) return;
    const e = t.querySelectorAll("lence-chart, lence-area-chart, lence-data-table, lence-gantt");
    for (const a of e) {
      const o = a.getAttribute("data") || a.getAttribute("query");
      o && this.queryData.has(o) && (a.data = this.queryData.get(o));
    }
    const n = t.querySelectorAll("lence-dropdown");
    for (const a of n) {
      const o = a.getAttribute("data");
      o && this.queryData.has(o) && (a.queryData = this.queryData.get(o));
    }
  }
  renderQueryErrors() {
    return this.queryErrors.size === 0 ? null : ge`
      ${Array.from(this.queryErrors.entries()).map(
      ([t, e]) => ge`
          <div class="error">Query "${t}" failed: ${e}</div>
        `
    )}
    `;
  }
  renderParseErrors() {
    return !this.editing || this.parseErrors.length === 0 ? null : ge`
      ${this.parseErrors.map(
      (t) => {
        var e;
        return ge`
          <div class="error">
            Line ${((e = t.lines) == null ? void 0 : e[0]) ?? "?"}: ${t.error.message}
          </div>
        `;
      }
    )}
    `;
  }
  renderErrorNotice() {
    if (this.editing) return null;
    const t = this.parseErrors.length > 0, e = this.queryErrors.size > 0;
    if (!t && !e) return null;
    const n = [];
    return t && n.push(`${this.parseErrors.length} syntax`), e && n.push(`${this.queryErrors.size} query`), ge`
      <div class="error-notice">
        ${n.join(", ")} error${this.parseErrors.length + this.queryErrors.size > 1 ? "s" : ""}
      </div>
    `;
  }
  toggleSource() {
    this.viewingSource = !this.viewingSource;
  }
  toggleEditing() {
    this.editing || (this.originalContent = this.rawContent, this.isDirty = !1), this.editing = !this.editing;
  }
  handleKeyDown(t) {
    (t.ctrlKey || t.metaKey) && t.key === "s" && this.editing && this.isDirty && (t.preventDefault(), this.handleSave());
  }
  async handleSave() {
    if (!(this.saving || !this.isDirty)) {
      this.saving = !0;
      try {
        const t = N1(this.path);
        await u5(t, this.rawContent), this.originalContent = this.rawContent, this.isDirty = !1;
      } catch (t) {
        console.error("Save failed:", t);
      } finally {
        this.saving = !1;
      }
    }
  }
  updateDocumentTitle(t) {
    document.title = t || "Lence";
  }
  /**
   * Handle edits to the source markdown.
   * Debounces to avoid re-parsing on every keystroke.
   */
  handleSourceEdit(t) {
    const e = t.target;
    this.rawContent = e.value, this.isDirty = this.rawContent !== this.originalContent, this.editDebounceTimer && clearTimeout(this.editDebounceTimer), this.editDebounceTimer = setTimeout(() => {
      this.reprocessContent();
    }, 300);
  }
  /**
   * Re-parse the current rawContent and re-execute queries.
   */
  async reprocessContent() {
    try {
      const t = Q1(this.rawContent);
      this.htmlContent = eb(t.content), this.queryMap = tb(t.queries), this.parseErrors = t.errors, this.updateDocumentTitle(t.frontmatter.title), this.inputDependencies = /* @__PURE__ */ new Map(), this.buildInputDependencies(), this.queryData = /* @__PURE__ */ new Map(), this.queryErrors = /* @__PURE__ */ new Map(), this.processInlineData(t.data);
      const e = K1(t.content), i = J1(e).filter((a) => !this.queryData.has(a));
      await this.executeQueries(i);
    } catch (t) {
      console.error("Parse error:", t);
    }
  }
  render() {
    if (this.loading)
      return ge`<div class="loading">Loading page...</div>`;
    if (this.error)
      return ge`<div class="error">${this.error}</div>`;
    if (this.editing)
      return ge`
        <div class="page-header">
          <button
            class="header-button save-button"
            @click=${this.handleSave}
            ?disabled=${!this.isDirty || this.saving}
          >
            ${this.saving ? "Saving..." : this.isDirty ? "Save" : "Saved"}
          </button>
          <button class="header-button" @click=${this.toggleEditing}>Close</button>
        </div>
        <div class="split-view">
          <div class="editor-pane">
            <textarea
              class="source-editor"
              .value=${this.rawContent}
              @input=${this.handleSourceEdit}
            ></textarea>
            ${this.renderParseErrors()}
            ${this.renderQueryErrors()}
          </div>
          <div class="preview-pane">
            <article class="content">
              ${z1(this.htmlContent)}
            </article>
          </div>
        </div>
      `;
    if (this.viewingSource)
      return ge`
        <div class="page-header">
          <button class="header-button" @click=${this.toggleSource}>✕</button>
        </div>
        ${this.renderQueryErrors()}
        <pre class="source-view">${this.rawContent}</pre>
      `;
    const t = this.showSourceEnabled || this.editMode;
    return ge`
      ${t ? ge`
            <div class="page-header">
              ${this.showSourceEnabled ? ge`<button class="header-button" @click=${this.toggleSource}>Source</button>` : null}
              ${this.editMode ? ge`<button class="header-button" @click=${this.toggleEditing}>Edit</button>` : null}
            </div>
          ` : null}
      ${this.renderErrorNotice()}
      <article class="content">${z1(this.htmlContent)}</article>
    `;
  }
};
i1.styles = [
  oa,
  Nn`
      :host {
        display: block;
        position: relative;
        font-family: var(--lence-font-family);
        font-size: var(--lence-font-size-sm);
        line-height: 1.6;
      }

      .loading {
        color: var(--lence-text-muted);
        padding: 1.5rem;
      }

      .error {
        padding: 0.75rem;
        background: var(--lence-negative-bg);
        border: 1px solid var(--lence-negative);
        border-radius: var(--lence-radius);
        color: var(--lence-negative);
        margin: 0.75rem 0;
      }

      .content {
        color: var(--lence-text);
      }

      .content p {
        margin: 1rem 0;
      }

      .content h1 {
        font-size: var(--lence-font-size-xl);
        color: var(--lence-text-heading);
        font-weight: 600;
        margin: 0 0 1rem 0;
      }

      .content h1:first-child {
        margin-top: 0;
      }

      .content h2 {
        font-size: var(--lence-font-size-lg);
        color: var(--lence-text-heading);
        font-weight: 600;
        margin: 1.5rem 0 0.75rem 0;
      }

      .content h3 {
        font-size: var(--lence-font-size-base);
        color: var(--lence-text-heading);
        font-weight: 600;
        margin: 1.25rem 0 0.5rem 0;
      }

      .content a {
        color: var(--lence-primary);
        text-decoration: none;
      }

      .content a:hover {
        text-decoration: underline;
      }

      .content ul,
      .content ol {
        margin: 0.75rem 0;
        padding-left: 1.5rem;
      }

      .content li {
        margin: 0.375rem 0;
      }

      .content pre {
        background: var(--lence-bg-subtle);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        padding: 0.75rem 1rem;
        overflow-x: auto;
        font-size: var(--lence-font-size-xs);
        line-height: 1.5;
      }

      .content code {
        font-family: var(--lence-font-mono);
        font-size: 0.9em;
      }

      .content table {
        border-collapse: collapse;
        margin: 0.75rem 0;
        font-size: var(--lence-font-size-sm);
        width: 100%;
      }

      .content th,
      .content td {
        padding: 0.375rem 0.5rem;
        text-align: left;
        border-bottom: 1px solid var(--lence-border);
      }

      .content th {
        background: var(--lence-bg-subtle);
        font-weight: 500;
        font-size: var(--lence-font-size-xs);
        color: var(--lence-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
      }

      /* Style for component containers */
      .content lence-chart,
      .content lence-area-chart,
      .content lence-data-table,
      .content lence-gantt {
        display: block;
        margin: 1rem 0;
      }

      .content lence-dropdown,
      .content lence-checkbox {
        display: inline-block;
        margin: 0.5rem 0.5rem 0.5rem 0;
      }

      .page-header {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 1;
        display: flex;
        gap: 0.5rem;
      }

      .header-button {
        font-size: var(--lence-font-size-xs);
        color: var(--lence-text-muted);
        background: none;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        padding: 0.25rem 0.5rem;
        cursor: pointer;
      }

      .header-button:hover {
        background: var(--lence-bg-subtle);
        color: var(--lence-text);
      }

      .header-button:disabled {
        opacity: 0.5;
        cursor: default;
      }

      .header-button:disabled:hover {
        background: none;
        color: var(--lence-text-muted);
      }

      .save-button:not(:disabled) {
        color: var(--lence-primary);
        border-color: var(--lence-primary);
      }

      .source-view {
        background: var(--lence-bg-subtle);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        padding: 1rem;
        overflow-x: auto;
        font-family: var(--lence-font-mono);
        font-size: var(--lence-font-size-xs);
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-word;
      }

      .split-view {
        display: flex;
        gap: 1rem;
        height: calc(100vh - 6rem);
      }

      .split-view .editor-pane {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
      }

      .editor-pane .error {
        flex-shrink: 0;
        margin: 0.5rem 0 0 0;
        padding: 0.5rem 0.75rem;
        font-size: var(--lence-font-size-xs);
      }

      .error-notice {
        font-size: var(--lence-font-size-xs);
        background: var(--lence-negative-bg);
        border: 1px solid var(--lence-negative);
        border-radius: var(--lence-radius);
        color: var(--lence-negative);
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
      }

      .split-view .preview-pane {
        flex: 1;
        overflow-y: auto;
        min-width: 0;
      }

      .source-editor {
        flex: 1;
        width: 100%;
        background: var(--lence-bg-subtle);
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        padding: 1rem;
        font-family: var(--lence-font-mono);
        font-size: var(--lence-font-size-xs);
        line-height: 1.5;
        resize: none;
        box-sizing: border-box;
      }

      .source-editor:focus {
        outline: none;
        border-color: var(--lence-primary);
      }
    `
];
let Ot = i1;
yr([
  Re({ type: String })
], Ot.prototype, "path");
yr([
  Ve()
], Ot.prototype, "htmlContent");
yr([
  Ve()
], Ot.prototype, "rawContent");
yr([
  Ve()
], Ot.prototype, "loading");
yr([
  Ve()
], Ot.prototype, "error");
yr([
  Ve()
], Ot.prototype, "queryData");
yr([
  Ve()
], Ot.prototype, "queryErrors");
yr([
  Ve()
], Ot.prototype, "parseErrors");
yr([
  Ve()
], Ot.prototype, "showSourceEnabled");
yr([
  Ve()
], Ot.prototype, "viewingSource");
yr([
  Ve()
], Ot.prototype, "editMode");
yr([
  Ve()
], Ot.prototype, "editing");
yr([
  Ve()
], Ot.prototype, "isDirty");
yr([
  Ve()
], Ot.prototype, "saving");
customElements.define("lence-page", Ot);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Og = function(r, t) {
  return Og = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
    e.__proto__ = n;
  } || function(e, n) {
    for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
  }, Og(r, t);
};
function N(r, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  Og(r, t);
  function e() {
    this.constructor = r;
  }
  r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
}
var o3 = /* @__PURE__ */ function() {
  function r() {
    this.firefox = !1, this.ie = !1, this.edge = !1, this.newEdge = !1, this.weChat = !1;
  }
  return r;
}(), s3 = /* @__PURE__ */ function() {
  function r() {
    this.browser = new o3(), this.node = !1, this.wxa = !1, this.worker = !1, this.svgSupported = !1, this.touchEventsSupported = !1, this.pointerEventsSupported = !1, this.domSupported = !1, this.transformSupported = !1, this.transform3dSupported = !1, this.hasGlobalWindow = typeof window < "u";
  }
  return r;
}(), Ie = new s3();
typeof wx == "object" && typeof wx.getSystemInfoSync == "function" ? (Ie.wxa = !0, Ie.touchEventsSupported = !0) : typeof document > "u" && typeof self < "u" ? Ie.worker = !0 : !Ie.hasGlobalWindow || "Deno" in window ? (Ie.node = !0, Ie.svgSupported = !0) : l3(navigator.userAgent, Ie);
function l3(r, t) {
  var e = t.browser, n = r.match(/Firefox\/([\d.]+)/), i = r.match(/MSIE\s([\d.]+)/) || r.match(/Trident\/.+?rv:(([\d.]+))/), a = r.match(/Edge?\/([\d.]+)/), o = /micromessenger/i.test(r);
  n && (e.firefox = !0, e.version = n[1]), i && (e.ie = !0, e.version = i[1]), a && (e.edge = !0, e.version = a[1], e.newEdge = +a[1].split(".")[0] > 18), o && (e.weChat = !0), t.svgSupported = typeof SVGRect < "u", t.touchEventsSupported = "ontouchstart" in window && !e.ie && !e.edge, t.pointerEventsSupported = "onpointerdown" in window && (e.edge || e.ie && +e.version >= 11), t.domSupported = typeof document < "u";
  var s = document.documentElement.style;
  t.transform3dSupported = (e.ie && "transition" in s || e.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in s) && !("OTransition" in s), t.transformSupported = t.transform3dSupported || e.ie && +e.version >= 9;
}
var qy = 12, XD = "sans-serif", Xi = qy + "px " + XD, u3 = 20, c3 = 100, f3 = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";
function h3(r) {
  var t = {};
  if (typeof JSON > "u")
    return t;
  for (var e = 0; e < r.length; e++) {
    var n = String.fromCharCode(e + 32), i = (r.charCodeAt(e) - u3) / c3;
    t[n] = i;
  }
  return t;
}
var v3 = h3(f3), ji = {
  createCanvas: function() {
    return typeof document < "u" && document.createElement("canvas");
  },
  measureText: /* @__PURE__ */ function() {
    var r, t;
    return function(e, n) {
      if (!r) {
        var i = ji.createCanvas();
        r = i && i.getContext("2d");
      }
      if (r)
        return t !== n && (t = r.font = n || Xi), r.measureText(e);
      e = e || "", n = n || Xi;
      var a = /((?:\d+)?\.?\d*)px/.exec(n), o = a && +a[1] || qy, s = 0;
      if (n.indexOf("mono") >= 0)
        s = o * e.length;
      else
        for (var l = 0; l < e.length; l++) {
          var u = v3[e[l]];
          s += u == null ? o : u * o;
        }
      return { width: s };
    };
  }(),
  loadImage: function(r, t, e) {
    var n = new Image();
    return n.onload = t, n.onerror = e, n.src = r, n;
  }
}, jD = kn([
  "Function",
  "RegExp",
  "Date",
  "Error",
  "CanvasGradient",
  "CanvasPattern",
  "Image",
  "Canvas"
], function(r, t) {
  return r["[object " + t + "]"] = !0, r;
}, {}), KD = kn([
  "Int8",
  "Uint8",
  "Uint8Clamped",
  "Int16",
  "Uint16",
  "Int32",
  "Uint32",
  "Float32",
  "Float64"
], function(r, t) {
  return r["[object " + t + "Array]"] = !0, r;
}, {}), Ms = Object.prototype.toString, Qh = Array.prototype, d3 = Qh.forEach, p3 = Qh.filter, Wy = Qh.slice, g3 = Qh.map, rb = (function() {
}).constructor, vc = rb ? rb.prototype : null, Uy = "__proto__", m3 = 2311;
function JD() {
  return m3++;
}
function Yy() {
  for (var r = [], t = 0; t < arguments.length; t++)
    r[t] = arguments[t];
  typeof console < "u" && console.error.apply(console, r);
}
function ce(r) {
  if (r == null || typeof r != "object")
    return r;
  var t = r, e = Ms.call(r);
  if (e === "[object Array]") {
    if (!Gl(r)) {
      t = [];
      for (var n = 0, i = r.length; n < i; n++)
        t[n] = ce(r[n]);
    }
  } else if (KD[e]) {
    if (!Gl(r)) {
      var a = r.constructor;
      if (a.from)
        t = a.from(r);
      else {
        t = new a(r.length);
        for (var n = 0, i = r.length; n < i; n++)
          t[n] = r[n];
      }
    }
  } else if (!jD[e] && !Gl(r) && !gs(r)) {
    t = {};
    for (var o in r)
      r.hasOwnProperty(o) && o !== Uy && (t[o] = ce(r[o]));
  }
  return t;
}
function _e(r, t, e) {
  if (!ue(t) || !ue(r))
    return e ? ce(t) : r;
  for (var n in t)
    if (t.hasOwnProperty(n) && n !== Uy) {
      var i = r[n], a = t[n];
      ue(a) && ue(i) && !q(a) && !q(i) && !gs(a) && !gs(i) && !nb(a) && !nb(i) && !Gl(a) && !Gl(i) ? _e(i, a, e) : (e || !(n in r)) && (r[n] = ce(t[n]));
    }
  return r;
}
function Zy(r, t) {
  for (var e = r[0], n = 1, i = r.length; n < i; n++)
    e = _e(e, r[n], t);
  return e;
}
function H(r, t) {
  if (Object.assign)
    Object.assign(r, t);
  else
    for (var e in t)
      t.hasOwnProperty(e) && e !== Uy && (r[e] = t[e]);
  return r;
}
function se(r, t, e) {
  for (var n = Ee(t), i = 0, a = n.length; i < a; i++) {
    var o = n[i];
    (e ? t[o] != null : r[o] == null) && (r[o] = t[o]);
  }
  return r;
}
function we(r, t) {
  if (r) {
    if (r.indexOf)
      return r.indexOf(t);
    for (var e = 0, n = r.length; e < n; e++)
      if (r[e] === t)
        return e;
  }
  return -1;
}
function y3(r, t) {
  var e = r.prototype;
  function n() {
  }
  n.prototype = t.prototype, r.prototype = new n();
  for (var i in e)
    e.hasOwnProperty(i) && (r.prototype[i] = e[i]);
  r.prototype.constructor = r, r.superClass = t;
}
function _t(r, t, e) {
  if (r = "prototype" in r ? r.prototype : r, t = "prototype" in t ? t.prototype : t, Object.getOwnPropertyNames)
    for (var n = Object.getOwnPropertyNames(t), i = 0; i < n.length; i++) {
      var a = n[i];
      a !== "constructor" && (e ? t[a] != null : r[a] == null) && (r[a] = t[a]);
    }
  else
    se(r, t, e);
}
function qt(r) {
  return !r || typeof r == "string" ? !1 : typeof r.length == "number";
}
function M(r, t, e) {
  if (r && t)
    if (r.forEach && r.forEach === d3)
      r.forEach(t, e);
    else if (r.length === +r.length)
      for (var n = 0, i = r.length; n < i; n++)
        t.call(e, r[n], n, r);
    else
      for (var a in r)
        r.hasOwnProperty(a) && t.call(e, r[a], a, r);
}
function U(r, t, e) {
  if (!r)
    return [];
  if (!t)
    return Xy(r);
  if (r.map && r.map === g3)
    return r.map(t, e);
  for (var n = [], i = 0, a = r.length; i < a; i++)
    n.push(t.call(e, r[i], i, r));
  return n;
}
function kn(r, t, e, n) {
  if (r && t) {
    for (var i = 0, a = r.length; i < a; i++)
      e = t.call(n, e, r[i], i, r);
    return e;
  }
}
function qe(r, t, e) {
  if (!r)
    return [];
  if (!t)
    return Xy(r);
  if (r.filter && r.filter === p3)
    return r.filter(t, e);
  for (var n = [], i = 0, a = r.length; i < a; i++)
    t.call(e, r[i], i, r) && n.push(r[i]);
  return n;
}
function _3(r, t, e) {
  if (r && t) {
    for (var n = 0, i = r.length; n < i; n++)
      if (t.call(e, r[n], n, r))
        return r[n];
  }
}
function Ee(r) {
  if (!r)
    return [];
  if (Object.keys)
    return Object.keys(r);
  var t = [];
  for (var e in r)
    r.hasOwnProperty(e) && t.push(e);
  return t;
}
function b3(r, t) {
  for (var e = [], n = 2; n < arguments.length; n++)
    e[n - 2] = arguments[n];
  return function() {
    return r.apply(t, e.concat(Wy.call(arguments)));
  };
}
var Q = vc && oe(vc.bind) ? vc.call.bind(vc.bind) : b3;
function ye(r) {
  for (var t = [], e = 1; e < arguments.length; e++)
    t[e - 1] = arguments[e];
  return function() {
    return r.apply(this, t.concat(Wy.call(arguments)));
  };
}
function q(r) {
  return Array.isArray ? Array.isArray(r) : Ms.call(r) === "[object Array]";
}
function oe(r) {
  return typeof r == "function";
}
function J(r) {
  return typeof r == "string";
}
function Fg(r) {
  return Ms.call(r) === "[object String]";
}
function Be(r) {
  return typeof r == "number";
}
function ue(r) {
  var t = typeof r;
  return t === "function" || !!r && t === "object";
}
function nb(r) {
  return !!jD[Ms.call(r)];
}
function gr(r) {
  return !!KD[Ms.call(r)];
}
function gs(r) {
  return typeof r == "object" && typeof r.nodeType == "number" && typeof r.ownerDocument == "object";
}
function ev(r) {
  return r.colorStops != null;
}
function S3(r) {
  return r.image != null;
}
function x3(r) {
  return Ms.call(r) === "[object RegExp]";
}
function uu(r) {
  return r !== r;
}
function Et() {
  for (var r = [], t = 0; t < arguments.length; t++)
    r[t] = arguments[t];
  for (var e = 0, n = r.length; e < n; e++)
    if (r[e] != null)
      return r[e];
}
function me(r, t) {
  return r ?? t;
}
function En(r, t, e) {
  return r ?? t ?? e;
}
function Xy(r) {
  for (var t = [], e = 1; e < arguments.length; e++)
    t[e - 1] = arguments[e];
  return Wy.apply(r, t);
}
function jy(r) {
  if (typeof r == "number")
    return [r, r, r, r];
  var t = r.length;
  return t === 2 ? [r[0], r[1], r[0], r[1]] : t === 3 ? [r[0], r[1], r[2], r[1]] : r;
}
function rr(r, t) {
  if (!r)
    throw new Error(t);
}
function tn(r) {
  return r == null ? null : typeof r.trim == "function" ? r.trim() : r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
}
var QD = "__ec_primitive__";
function jf(r) {
  r[QD] = !0;
}
function Gl(r) {
  return r[QD];
}
var w3 = function() {
  function r() {
    this.data = {};
  }
  return r.prototype.delete = function(t) {
    var e = this.has(t);
    return e && delete this.data[t], e;
  }, r.prototype.has = function(t) {
    return this.data.hasOwnProperty(t);
  }, r.prototype.get = function(t) {
    return this.data[t];
  }, r.prototype.set = function(t, e) {
    return this.data[t] = e, this;
  }, r.prototype.keys = function() {
    return Ee(this.data);
  }, r.prototype.forEach = function(t) {
    var e = this.data;
    for (var n in e)
      e.hasOwnProperty(n) && t(e[n], n);
  }, r;
}(), eT = typeof Map == "function";
function C3() {
  return eT ? /* @__PURE__ */ new Map() : new w3();
}
var A3 = function() {
  function r(t) {
    var e = q(t);
    this.data = C3();
    var n = this;
    t instanceof r ? t.each(i) : t && M(t, i);
    function i(a, o) {
      e ? n.set(a, o) : n.set(o, a);
    }
  }
  return r.prototype.hasKey = function(t) {
    return this.data.has(t);
  }, r.prototype.get = function(t) {
    return this.data.get(t);
  }, r.prototype.set = function(t, e) {
    return this.data.set(t, e), e;
  }, r.prototype.each = function(t, e) {
    this.data.forEach(function(n, i) {
      t.call(e, n, i);
    });
  }, r.prototype.keys = function() {
    var t = this.data.keys();
    return eT ? Array.from(t) : t;
  }, r.prototype.removeKey = function(t) {
    this.data.delete(t);
  }, r;
}();
function re(r) {
  return new A3(r);
}
function cu(r, t) {
  for (var e = new r.constructor(r.length + t.length), n = 0; n < r.length; n++)
    e[n] = r[n];
  for (var i = r.length, n = 0; n < t.length; n++)
    e[n + i] = t[n];
  return e;
}
function tv(r, t) {
  var e;
  if (Object.create)
    e = Object.create(r);
  else {
    var n = function() {
    };
    n.prototype = r, e = new n();
  }
  return t && H(e, t), e;
}
function tT(r) {
  var t = r.style;
  t.webkitUserSelect = "none", t.userSelect = "none", t.webkitTapHighlightColor = "rgba(0,0,0,0)", t["-webkit-touch-callout"] = "none";
}
function te(r, t) {
  return r.hasOwnProperty(t);
}
function dt() {
}
var xf = 180 / Math.PI;
function bo(r, t) {
  return r == null && (r = 0), t == null && (t = 0), [r, t];
}
function Xt(r, t) {
  return r[0] = t[0], r[1] = t[1], r;
}
function Qn(r) {
  return [r[0], r[1]];
}
function D3(r, t, e) {
  return r[0] = t, r[1] = e, r;
}
function ib(r, t, e) {
  return r[0] = t[0] + e[0], r[1] = t[1] + e[1], r;
}
function Bg(r, t, e, n) {
  return r[0] = t[0] + e[0] * n, r[1] = t[1] + e[1] * n, r;
}
function Wa(r, t, e) {
  return r[0] = t[0] - e[0], r[1] = t[1] - e[1], r;
}
function Ng(r) {
  return Math.sqrt(T3(r));
}
function T3(r) {
  return r[0] * r[0] + r[1] * r[1];
}
function wf(r, t, e) {
  return r[0] = t[0] * e, r[1] = t[1] * e, r;
}
function Is(r, t) {
  var e = Ng(t);
  return e === 0 ? (r[0] = 0, r[1] = 0) : (r[0] = t[0] / e, r[1] = t[1] / e), r;
}
function zg(r, t) {
  return Math.sqrt((r[0] - t[0]) * (r[0] - t[0]) + (r[1] - t[1]) * (r[1] - t[1]));
}
var Ri = zg;
function M3(r, t) {
  return (r[0] - t[0]) * (r[0] - t[0]) + (r[1] - t[1]) * (r[1] - t[1]);
}
var to = M3;
function Cf(r, t, e, n) {
  return r[0] = t[0] + n * (e[0] - t[0]), r[1] = t[1] + n * (e[1] - t[1]), r;
}
function Rt(r, t, e) {
  var n = t[0], i = t[1];
  return r[0] = e[0] * n + e[2] * i + e[4], r[1] = e[1] * n + e[3] * i + e[5], r;
}
function Oi(r, t, e) {
  return r[0] = Math.min(t[0], e[0]), r[1] = Math.min(t[1], e[1]), r;
}
function Fi(r, t, e) {
  return r[0] = Math.max(t[0], e[0]), r[1] = Math.max(t[1], e[1]), r;
}
var Eo = /* @__PURE__ */ function() {
  function r(t, e) {
    this.target = t, this.topTarget = e && e.topTarget;
  }
  return r;
}(), I3 = function() {
  function r(t) {
    this.handler = t, t.on("mousedown", this._dragStart, this), t.on("mousemove", this._drag, this), t.on("mouseup", this._dragEnd, this);
  }
  return r.prototype._dragStart = function(t) {
    for (var e = t.target; e && !e.draggable; )
      e = e.parent || e.__hostTarget;
    e && (this._draggingTarget = e, e.dragging = !0, this._x = t.offsetX, this._y = t.offsetY, this.handler.dispatchToElement(new Eo(e, t), "dragstart", t.event));
  }, r.prototype._drag = function(t) {
    var e = this._draggingTarget;
    if (e) {
      var n = t.offsetX, i = t.offsetY, a = n - this._x, o = i - this._y;
      this._x = n, this._y = i, e.drift(a, o, t), this.handler.dispatchToElement(new Eo(e, t), "drag", t.event);
      var s = this.handler.findHover(n, i, e).target, l = this._dropTarget;
      this._dropTarget = s, e !== s && (l && s !== l && this.handler.dispatchToElement(new Eo(l, t), "dragleave", t.event), s && s !== l && this.handler.dispatchToElement(new Eo(s, t), "dragenter", t.event));
    }
  }, r.prototype._dragEnd = function(t) {
    var e = this._draggingTarget;
    e && (e.dragging = !1), this.handler.dispatchToElement(new Eo(e, t), "dragend", t.event), this._dropTarget && this.handler.dispatchToElement(new Eo(this._dropTarget, t), "drop", t.event), this._draggingTarget = null, this._dropTarget = null;
  }, r;
}(), Wr = function() {
  function r(t) {
    t && (this._$eventProcessor = t);
  }
  return r.prototype.on = function(t, e, n, i) {
    this._$handlers || (this._$handlers = {});
    var a = this._$handlers;
    if (typeof e == "function" && (i = n, n = e, e = null), !n || !t)
      return this;
    var o = this._$eventProcessor;
    e != null && o && o.normalizeQuery && (e = o.normalizeQuery(e)), a[t] || (a[t] = []);
    for (var s = 0; s < a[t].length; s++)
      if (a[t][s].h === n)
        return this;
    var l = {
      h: n,
      query: e,
      ctx: i || this,
      callAtLast: n.zrEventfulCallAtLast
    }, u = a[t].length - 1, c = a[t][u];
    return c && c.callAtLast ? a[t].splice(u, 0, l) : a[t].push(l), this;
  }, r.prototype.isSilent = function(t) {
    var e = this._$handlers;
    return !e || !e[t] || !e[t].length;
  }, r.prototype.off = function(t, e) {
    var n = this._$handlers;
    if (!n)
      return this;
    if (!t)
      return this._$handlers = {}, this;
    if (e) {
      if (n[t]) {
        for (var i = [], a = 0, o = n[t].length; a < o; a++)
          n[t][a].h !== e && i.push(n[t][a]);
        n[t] = i;
      }
      n[t] && n[t].length === 0 && delete n[t];
    } else
      delete n[t];
    return this;
  }, r.prototype.trigger = function(t) {
    for (var e = [], n = 1; n < arguments.length; n++)
      e[n - 1] = arguments[n];
    if (!this._$handlers)
      return this;
    var i = this._$handlers[t], a = this._$eventProcessor;
    if (i)
      for (var o = e.length, s = i.length, l = 0; l < s; l++) {
        var u = i[l];
        if (!(a && a.filter && u.query != null && !a.filter(t, u.query)))
          switch (o) {
            case 0:
              u.h.call(u.ctx);
              break;
            case 1:
              u.h.call(u.ctx, e[0]);
              break;
            case 2:
              u.h.call(u.ctx, e[0], e[1]);
              break;
            default:
              u.h.apply(u.ctx, e);
              break;
          }
      }
    return a && a.afterTrigger && a.afterTrigger(t), this;
  }, r.prototype.triggerWithContext = function(t) {
    for (var e = [], n = 1; n < arguments.length; n++)
      e[n - 1] = arguments[n];
    if (!this._$handlers)
      return this;
    var i = this._$handlers[t], a = this._$eventProcessor;
    if (i)
      for (var o = e.length, s = e[o - 1], l = i.length, u = 0; u < l; u++) {
        var c = i[u];
        if (!(a && a.filter && c.query != null && !a.filter(t, c.query)))
          switch (o) {
            case 0:
              c.h.call(s);
              break;
            case 1:
              c.h.call(s, e[0]);
              break;
            case 2:
              c.h.call(s, e[0], e[1]);
              break;
            default:
              c.h.apply(s, e.slice(1, o - 1));
              break;
          }
      }
    return a && a.afterTrigger && a.afterTrigger(t), this;
  }, r;
}(), L3 = Math.log(2);
function Vg(r, t, e, n, i, a) {
  var o = n + "-" + i, s = r.length;
  if (a.hasOwnProperty(o))
    return a[o];
  if (t === 1) {
    var l = Math.round(Math.log((1 << s) - 1 & ~i) / L3);
    return r[e][l];
  }
  for (var u = n | 1 << e, c = e + 1; n & 1 << c; )
    c++;
  for (var f = 0, h = 0, v = 0; h < s; h++) {
    var d = 1 << h;
    d & i || (f += (v % 2 ? -1 : 1) * r[e][h] * Vg(r, t - 1, c, u, i | d, a), v++);
  }
  return a[o] = f, f;
}
function ab(r, t) {
  var e = [
    [r[0], r[1], 1, 0, 0, 0, -t[0] * r[0], -t[0] * r[1]],
    [0, 0, 0, r[0], r[1], 1, -t[1] * r[0], -t[1] * r[1]],
    [r[2], r[3], 1, 0, 0, 0, -t[2] * r[2], -t[2] * r[3]],
    [0, 0, 0, r[2], r[3], 1, -t[3] * r[2], -t[3] * r[3]],
    [r[4], r[5], 1, 0, 0, 0, -t[4] * r[4], -t[4] * r[5]],
    [0, 0, 0, r[4], r[5], 1, -t[5] * r[4], -t[5] * r[5]],
    [r[6], r[7], 1, 0, 0, 0, -t[6] * r[6], -t[6] * r[7]],
    [0, 0, 0, r[6], r[7], 1, -t[7] * r[6], -t[7] * r[7]]
  ], n = {}, i = Vg(e, 8, 0, 0, 0, n);
  if (i !== 0) {
    for (var a = [], o = 0; o < 8; o++)
      for (var s = 0; s < 8; s++)
        a[s] == null && (a[s] = 0), a[s] += ((o + s) % 2 ? -1 : 1) * Vg(e, 7, o === 0 ? 1 : 0, 1 << o, 1 << s, n) / i * t[o];
    return function(l, u, c) {
      var f = u * a[6] + c * a[7] + 1;
      l[0] = (u * a[0] + c * a[1] + a[2]) / f, l[1] = (u * a[3] + c * a[4] + a[5]) / f;
    };
  }
}
var ob = "___zrEVENTSAVED", Jv = [];
function E3(r, t, e, n, i) {
  return $g(Jv, t, n, i, !0) && $g(r, e, Jv[0], Jv[1]);
}
function $g(r, t, e, n, i) {
  if (t.getBoundingClientRect && Ie.domSupported && !rT(t)) {
    var a = t[ob] || (t[ob] = {}), o = P3(t, a), s = k3(o, a, i);
    if (s)
      return s(r, e, n), !0;
  }
  return !1;
}
function P3(r, t) {
  var e = t.markers;
  if (e)
    return e;
  e = t.markers = [];
  for (var n = ["left", "right"], i = ["top", "bottom"], a = 0; a < 4; a++) {
    var o = document.createElement("div"), s = o.style, l = a % 2, u = (a >> 1) % 2;
    s.cssText = [
      "position: absolute",
      "visibility: hidden",
      "padding: 0",
      "margin: 0",
      "border-width: 0",
      "user-select: none",
      "width:0",
      "height:0",
      n[l] + ":0",
      i[u] + ":0",
      n[1 - l] + ":auto",
      i[1 - u] + ":auto",
      ""
    ].join("!important;"), r.appendChild(o), e.push(o);
  }
  return e;
}
function k3(r, t, e) {
  for (var n = e ? "invTrans" : "trans", i = t[n], a = t.srcCoords, o = [], s = [], l = !0, u = 0; u < 4; u++) {
    var c = r[u].getBoundingClientRect(), f = 2 * u, h = c.left, v = c.top;
    o.push(h, v), l = l && a && h === a[f] && v === a[f + 1], s.push(r[u].offsetLeft, r[u].offsetTop);
  }
  return l && i ? i : (t.srcCoords = o, t[n] = e ? ab(s, o) : ab(o, s));
}
function rT(r) {
  return r.nodeName.toUpperCase() === "CANVAS";
}
var R3 = /([&<>"'])/g, O3 = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
};
function Jt(r) {
  return r == null ? "" : (r + "").replace(R3, function(t, e) {
    return O3[e];
  });
}
var F3 = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, Qv = [], B3 = Ie.browser.firefox && +Ie.browser.version.split(".")[0] < 39;
function Gg(r, t, e, n) {
  return e = e || {}, n ? sb(r, t, e) : B3 && t.layerX != null && t.layerX !== t.offsetX ? (e.zrX = t.layerX, e.zrY = t.layerY) : t.offsetX != null ? (e.zrX = t.offsetX, e.zrY = t.offsetY) : sb(r, t, e), e;
}
function sb(r, t, e) {
  if (Ie.domSupported && r.getBoundingClientRect) {
    var n = t.clientX, i = t.clientY;
    if (rT(r)) {
      var a = r.getBoundingClientRect();
      e.zrX = n - a.left, e.zrY = i - a.top;
      return;
    } else if ($g(Qv, r, n, i)) {
      e.zrX = Qv[0], e.zrY = Qv[1];
      return;
    }
  }
  e.zrX = e.zrY = 0;
}
function Ky(r) {
  return r || window.event;
}
function Rr(r, t, e) {
  if (t = Ky(t), t.zrX != null)
    return t;
  var n = t.type, i = n && n.indexOf("touch") >= 0;
  if (i) {
    var o = n !== "touchend" ? t.targetTouches[0] : t.changedTouches[0];
    o && Gg(r, o, t, e);
  } else {
    Gg(r, t, t, e);
    var a = N3(t);
    t.zrDelta = a ? a / 120 : -(t.detail || 0) / 3;
  }
  var s = t.button;
  return t.which == null && s !== void 0 && F3.test(t.type) && (t.which = s & 1 ? 1 : s & 2 ? 3 : s & 4 ? 2 : 0), t;
}
function N3(r) {
  var t = r.wheelDelta;
  if (t)
    return t;
  var e = r.deltaX, n = r.deltaY;
  if (e == null || n == null)
    return t;
  var i = Math.abs(n !== 0 ? n : e), a = n > 0 ? -1 : n < 0 ? 1 : e > 0 ? -1 : 1;
  return 3 * i * a;
}
function Hg(r, t, e, n) {
  r.addEventListener(t, e, n);
}
function z3(r, t, e, n) {
  r.removeEventListener(t, e, n);
}
var ii = function(r) {
  r.preventDefault(), r.stopPropagation(), r.cancelBubble = !0;
};
function lb(r) {
  return r.which === 2 || r.which === 3;
}
var V3 = function() {
  function r() {
    this._track = [];
  }
  return r.prototype.recognize = function(t, e, n) {
    return this._doTrack(t, e, n), this._recognize(t);
  }, r.prototype.clear = function() {
    return this._track.length = 0, this;
  }, r.prototype._doTrack = function(t, e, n) {
    var i = t.touches;
    if (i) {
      for (var a = {
        points: [],
        touches: [],
        target: e,
        event: t
      }, o = 0, s = i.length; o < s; o++) {
        var l = i[o], u = Gg(n, l, {});
        a.points.push([u.zrX, u.zrY]), a.touches.push(l);
      }
      this._track.push(a);
    }
  }, r.prototype._recognize = function(t) {
    for (var e in ed)
      if (ed.hasOwnProperty(e)) {
        var n = ed[e](this._track, t);
        if (n)
          return n;
      }
  }, r;
}();
function ub(r) {
  var t = r[1][0] - r[0][0], e = r[1][1] - r[0][1];
  return Math.sqrt(t * t + e * e);
}
function $3(r) {
  return [
    (r[0][0] + r[1][0]) / 2,
    (r[0][1] + r[1][1]) / 2
  ];
}
var ed = {
  pinch: function(r, t) {
    var e = r.length;
    if (e) {
      var n = (r[e - 1] || {}).points, i = (r[e - 2] || {}).points || n;
      if (i && i.length > 1 && n && n.length > 1) {
        var a = ub(n) / ub(i);
        !isFinite(a) && (a = 1), t.pinchScale = a;
        var o = $3(n);
        return t.pinchX = o[0], t.pinchY = o[1], {
          type: "pinch",
          target: r[0].target,
          event: t
        };
      }
    }
  }
};
function Cr() {
  return [1, 0, 0, 1, 0, 0];
}
function rv(r) {
  return r[0] = 1, r[1] = 0, r[2] = 0, r[3] = 1, r[4] = 0, r[5] = 0, r;
}
function Jy(r, t) {
  return r[0] = t[0], r[1] = t[1], r[2] = t[2], r[3] = t[3], r[4] = t[4], r[5] = t[5], r;
}
function ei(r, t, e) {
  var n = t[0] * e[0] + t[2] * e[1], i = t[1] * e[0] + t[3] * e[1], a = t[0] * e[2] + t[2] * e[3], o = t[1] * e[2] + t[3] * e[3], s = t[0] * e[4] + t[2] * e[5] + t[4], l = t[1] * e[4] + t[3] * e[5] + t[5];
  return r[0] = n, r[1] = i, r[2] = a, r[3] = o, r[4] = s, r[5] = l, r;
}
function Rn(r, t, e) {
  return r[0] = t[0], r[1] = t[1], r[2] = t[2], r[3] = t[3], r[4] = t[4] + e[0], r[5] = t[5] + e[1], r;
}
function So(r, t, e, n) {
  n === void 0 && (n = [0, 0]);
  var i = t[0], a = t[2], o = t[4], s = t[1], l = t[3], u = t[5], c = Math.sin(e), f = Math.cos(e);
  return r[0] = i * f + s * c, r[1] = -i * c + s * f, r[2] = a * f + l * c, r[3] = -a * c + f * l, r[4] = f * (o - n[0]) + c * (u - n[1]) + n[0], r[5] = f * (u - n[1]) - c * (o - n[0]) + n[1], r;
}
function Qy(r, t, e) {
  var n = e[0], i = e[1];
  return r[0] = t[0] * n, r[1] = t[1] * i, r[2] = t[2] * n, r[3] = t[3] * i, r[4] = t[4] * n, r[5] = t[5] * i, r;
}
function Ls(r, t) {
  var e = t[0], n = t[2], i = t[4], a = t[1], o = t[3], s = t[5], l = e * o - a * n;
  return l ? (l = 1 / l, r[0] = o * l, r[1] = -a * l, r[2] = -n * l, r[3] = e * l, r[4] = (n * s - o * i) * l, r[5] = (a * i - e * s) * l, r) : null;
}
function G3(r) {
  var t = Cr();
  return Jy(t, r), t;
}
var Se = function() {
  function r(t, e) {
    this.x = t || 0, this.y = e || 0;
  }
  return r.prototype.copy = function(t) {
    return this.x = t.x, this.y = t.y, this;
  }, r.prototype.clone = function() {
    return new r(this.x, this.y);
  }, r.prototype.set = function(t, e) {
    return this.x = t, this.y = e, this;
  }, r.prototype.equal = function(t) {
    return t.x === this.x && t.y === this.y;
  }, r.prototype.add = function(t) {
    return this.x += t.x, this.y += t.y, this;
  }, r.prototype.scale = function(t) {
    this.x *= t, this.y *= t;
  }, r.prototype.scaleAndAdd = function(t, e) {
    this.x += t.x * e, this.y += t.y * e;
  }, r.prototype.sub = function(t) {
    return this.x -= t.x, this.y -= t.y, this;
  }, r.prototype.dot = function(t) {
    return this.x * t.x + this.y * t.y;
  }, r.prototype.len = function() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }, r.prototype.lenSquare = function() {
    return this.x * this.x + this.y * this.y;
  }, r.prototype.normalize = function() {
    var t = this.len();
    return this.x /= t, this.y /= t, this;
  }, r.prototype.distance = function(t) {
    var e = this.x - t.x, n = this.y - t.y;
    return Math.sqrt(e * e + n * n);
  }, r.prototype.distanceSquare = function(t) {
    var e = this.x - t.x, n = this.y - t.y;
    return e * e + n * n;
  }, r.prototype.negate = function() {
    return this.x = -this.x, this.y = -this.y, this;
  }, r.prototype.transform = function(t) {
    if (t) {
      var e = this.x, n = this.y;
      return this.x = t[0] * e + t[2] * n + t[4], this.y = t[1] * e + t[3] * n + t[5], this;
    }
  }, r.prototype.toArray = function(t) {
    return t[0] = this.x, t[1] = this.y, t;
  }, r.prototype.fromArray = function(t) {
    this.x = t[0], this.y = t[1];
  }, r.set = function(t, e, n) {
    t.x = e, t.y = n;
  }, r.copy = function(t, e) {
    t.x = e.x, t.y = e.y;
  }, r.len = function(t) {
    return Math.sqrt(t.x * t.x + t.y * t.y);
  }, r.lenSquare = function(t) {
    return t.x * t.x + t.y * t.y;
  }, r.dot = function(t, e) {
    return t.x * e.x + t.y * e.y;
  }, r.add = function(t, e, n) {
    t.x = e.x + n.x, t.y = e.y + n.y;
  }, r.sub = function(t, e, n) {
    t.x = e.x - n.x, t.y = e.y - n.y;
  }, r.scale = function(t, e, n) {
    t.x = e.x * n, t.y = e.y * n;
  }, r.scaleAndAdd = function(t, e, n, i) {
    t.x = e.x + n.x * i, t.y = e.y + n.y * i;
  }, r.lerp = function(t, e, n, i) {
    var a = 1 - i;
    t.x = a * e.x + i * n.x, t.y = a * e.y + i * n.y;
  }, r;
}(), dc = Math.min, pc = Math.max, ca = new Se(), fa = new Se(), ha = new Se(), va = new Se(), js = new Se(), Ks = new Se(), xe = function() {
  function r(t, e, n, i) {
    n < 0 && (t = t + n, n = -n), i < 0 && (e = e + i, i = -i), this.x = t, this.y = e, this.width = n, this.height = i;
  }
  return r.prototype.union = function(t) {
    var e = dc(t.x, this.x), n = dc(t.y, this.y);
    isFinite(this.x) && isFinite(this.width) ? this.width = pc(t.x + t.width, this.x + this.width) - e : this.width = t.width, isFinite(this.y) && isFinite(this.height) ? this.height = pc(t.y + t.height, this.y + this.height) - n : this.height = t.height, this.x = e, this.y = n;
  }, r.prototype.applyTransform = function(t) {
    r.applyTransform(this, this, t);
  }, r.prototype.calculateTransform = function(t) {
    var e = this, n = t.width / e.width, i = t.height / e.height, a = Cr();
    return Rn(a, a, [-e.x, -e.y]), Qy(a, a, [n, i]), Rn(a, a, [t.x, t.y]), a;
  }, r.prototype.intersect = function(t, e) {
    if (!t)
      return !1;
    t instanceof r || (t = r.create(t));
    var n = this, i = n.x, a = n.x + n.width, o = n.y, s = n.y + n.height, l = t.x, u = t.x + t.width, c = t.y, f = t.y + t.height, h = !(a < l || u < i || s < c || f < o);
    if (e) {
      var v = 1 / 0, d = 0, p = Math.abs(a - l), g = Math.abs(u - i), m = Math.abs(s - c), y = Math.abs(f - o), _ = Math.min(p, g), b = Math.min(m, y);
      a < l || u < i ? _ > d && (d = _, p < g ? Se.set(Ks, -p, 0) : Se.set(Ks, g, 0)) : _ < v && (v = _, p < g ? Se.set(js, p, 0) : Se.set(js, -g, 0)), s < c || f < o ? b > d && (d = b, m < y ? Se.set(Ks, 0, -m) : Se.set(Ks, 0, y)) : _ < v && (v = _, m < y ? Se.set(js, 0, m) : Se.set(js, 0, -y));
    }
    return e && Se.copy(e, h ? js : Ks), h;
  }, r.prototype.contain = function(t, e) {
    var n = this;
    return t >= n.x && t <= n.x + n.width && e >= n.y && e <= n.y + n.height;
  }, r.prototype.clone = function() {
    return new r(this.x, this.y, this.width, this.height);
  }, r.prototype.copy = function(t) {
    r.copy(this, t);
  }, r.prototype.plain = function() {
    return {
      x: this.x,
      y: this.y,
      width: this.width,
      height: this.height
    };
  }, r.prototype.isFinite = function() {
    return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
  }, r.prototype.isZero = function() {
    return this.width === 0 || this.height === 0;
  }, r.create = function(t) {
    return new r(t.x, t.y, t.width, t.height);
  }, r.copy = function(t, e) {
    t.x = e.x, t.y = e.y, t.width = e.width, t.height = e.height;
  }, r.applyTransform = function(t, e, n) {
    if (!n) {
      t !== e && r.copy(t, e);
      return;
    }
    if (n[1] < 1e-5 && n[1] > -1e-5 && n[2] < 1e-5 && n[2] > -1e-5) {
      var i = n[0], a = n[3], o = n[4], s = n[5];
      t.x = e.x * i + o, t.y = e.y * a + s, t.width = e.width * i, t.height = e.height * a, t.width < 0 && (t.x += t.width, t.width = -t.width), t.height < 0 && (t.y += t.height, t.height = -t.height);
      return;
    }
    ca.x = ha.x = e.x, ca.y = va.y = e.y, fa.x = va.x = e.x + e.width, fa.y = ha.y = e.y + e.height, ca.transform(n), va.transform(n), fa.transform(n), ha.transform(n), t.x = dc(ca.x, fa.x, ha.x, va.x), t.y = dc(ca.y, fa.y, ha.y, va.y);
    var l = pc(ca.x, fa.x, ha.x, va.x), u = pc(ca.y, fa.y, ha.y, va.y);
    t.width = l - t.x, t.height = u - t.y;
  }, r;
}(), nT = "silent";
function H3(r, t, e) {
  return {
    type: r,
    event: e,
    target: t.target,
    topTarget: t.topTarget,
    cancelBubble: !1,
    offsetX: e.zrX,
    offsetY: e.zrY,
    gestureEvent: e.gestureEvent,
    pinchX: e.pinchX,
    pinchY: e.pinchY,
    pinchScale: e.pinchScale,
    wheelDelta: e.zrDelta,
    zrByTouch: e.zrByTouch,
    which: e.which,
    stop: q3
  };
}
function q3() {
  ii(this.event);
}
var W3 = function(r) {
  N(t, r);
  function t() {
    var e = r !== null && r.apply(this, arguments) || this;
    return e.handler = null, e;
  }
  return t.prototype.dispose = function() {
  }, t.prototype.setCursor = function() {
  }, t;
}(Wr), Js = /* @__PURE__ */ function() {
  function r(t, e) {
    this.x = t, this.y = e;
  }
  return r;
}(), U3 = [
  "click",
  "dblclick",
  "mousewheel",
  "mouseout",
  "mouseup",
  "mousedown",
  "mousemove",
  "contextmenu"
], td = new xe(0, 0, 0, 0), iT = function(r) {
  N(t, r);
  function t(e, n, i, a, o) {
    var s = r.call(this) || this;
    return s._hovered = new Js(0, 0), s.storage = e, s.painter = n, s.painterRoot = a, s._pointerSize = o, i = i || new W3(), s.proxy = null, s.setHandlerProxy(i), s._draggingMgr = new I3(s), s;
  }
  return t.prototype.setHandlerProxy = function(e) {
    this.proxy && this.proxy.dispose(), e && (M(U3, function(n) {
      e.on && e.on(n, this[n], this);
    }, this), e.handler = this), this.proxy = e;
  }, t.prototype.mousemove = function(e) {
    var n = e.zrX, i = e.zrY, a = aT(this, n, i), o = this._hovered, s = o.target;
    s && !s.__zr && (o = this.findHover(o.x, o.y), s = o.target);
    var l = this._hovered = a ? new Js(n, i) : this.findHover(n, i), u = l.target, c = this.proxy;
    c.setCursor && c.setCursor(u ? u.cursor : "default"), s && u !== s && this.dispatchToElement(o, "mouseout", e), this.dispatchToElement(l, "mousemove", e), u && u !== s && this.dispatchToElement(l, "mouseover", e);
  }, t.prototype.mouseout = function(e) {
    var n = e.zrEventControl;
    n !== "only_globalout" && this.dispatchToElement(this._hovered, "mouseout", e), n !== "no_globalout" && this.trigger("globalout", { type: "globalout", event: e });
  }, t.prototype.resize = function() {
    this._hovered = new Js(0, 0);
  }, t.prototype.dispatch = function(e, n) {
    var i = this[e];
    i && i.call(this, n);
  }, t.prototype.dispose = function() {
    this.proxy.dispose(), this.storage = null, this.proxy = null, this.painter = null;
  }, t.prototype.setCursorStyle = function(e) {
    var n = this.proxy;
    n.setCursor && n.setCursor(e);
  }, t.prototype.dispatchToElement = function(e, n, i) {
    e = e || {};
    var a = e.target;
    if (!(a && a.silent)) {
      for (var o = "on" + n, s = H3(n, e, i); a && (a[o] && (s.cancelBubble = !!a[o].call(a, s)), a.trigger(n, s), a = a.__hostTarget ? a.__hostTarget : a.parent, !s.cancelBubble); )
        ;
      s.cancelBubble || (this.trigger(n, s), this.painter && this.painter.eachOtherLayer && this.painter.eachOtherLayer(function(l) {
        typeof l[o] == "function" && l[o].call(l, s), l.trigger && l.trigger(n, s);
      }));
    }
  }, t.prototype.findHover = function(e, n, i) {
    var a = this.storage.getDisplayList(), o = new Js(e, n);
    if (cb(a, o, e, n, i), this._pointerSize && !o.target) {
      for (var s = [], l = this._pointerSize, u = l / 2, c = new xe(e - u, n - u, l, l), f = a.length - 1; f >= 0; f--) {
        var h = a[f];
        h !== i && !h.ignore && !h.ignoreCoarsePointer && (!h.parent || !h.parent.ignoreCoarsePointer) && (td.copy(h.getBoundingRect()), h.transform && td.applyTransform(h.transform), td.intersect(c) && s.push(h));
      }
      if (s.length)
        for (var v = 4, d = Math.PI / 12, p = Math.PI * 2, g = 0; g < u; g += v)
          for (var m = 0; m < p; m += d) {
            var y = e + g * Math.cos(m), _ = n + g * Math.sin(m);
            if (cb(s, o, y, _, i), o.target)
              return o;
          }
    }
    return o;
  }, t.prototype.processGesture = function(e, n) {
    this._gestureMgr || (this._gestureMgr = new V3());
    var i = this._gestureMgr;
    n === "start" && i.clear();
    var a = i.recognize(e, this.findHover(e.zrX, e.zrY, null).target, this.proxy.dom);
    if (n === "end" && i.clear(), a) {
      var o = a.type;
      e.gestureEvent = o;
      var s = new Js();
      s.target = a.target, this.dispatchToElement(s, o, a.event);
    }
  }, t;
}(Wr);
M(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(r) {
  iT.prototype[r] = function(t) {
    var e = t.zrX, n = t.zrY, i = aT(this, e, n), a, o;
    if ((r !== "mouseup" || !i) && (a = this.findHover(e, n), o = a.target), r === "mousedown")
      this._downEl = o, this._downPoint = [t.zrX, t.zrY], this._upEl = o;
    else if (r === "mouseup")
      this._upEl = o;
    else if (r === "click") {
      if (this._downEl !== this._upEl || !this._downPoint || Ri(this._downPoint, [t.zrX, t.zrY]) > 4)
        return;
      this._downPoint = null;
    }
    this.dispatchToElement(a, r, t);
  };
});
function Y3(r, t, e) {
  if (r[r.rectHover ? "rectContain" : "contain"](t, e)) {
    for (var n = r, i = void 0, a = !1; n; ) {
      if (n.ignoreClip && (a = !0), !a) {
        var o = n.getClipPath();
        if (o && !o.contain(t, e))
          return !1;
      }
      n.silent && (i = !0);
      var s = n.__hostTarget;
      n = s || n.parent;
    }
    return i ? nT : !0;
  }
  return !1;
}
function cb(r, t, e, n, i) {
  for (var a = r.length - 1; a >= 0; a--) {
    var o = r[a], s = void 0;
    if (o !== i && !o.ignore && (s = Y3(o, e, n)) && (!t.topTarget && (t.topTarget = o), s !== nT)) {
      t.target = o;
      break;
    }
  }
}
function aT(r, t, e) {
  var n = r.painter;
  return t < 0 || t > n.getWidth() || e < 0 || e > n.getHeight();
}
var oT = 32, Qs = 7;
function Z3(r) {
  for (var t = 0; r >= oT; )
    t |= r & 1, r >>= 1;
  return r + t;
}
function fb(r, t, e, n) {
  var i = t + 1;
  if (i === e)
    return 1;
  if (n(r[i++], r[t]) < 0) {
    for (; i < e && n(r[i], r[i - 1]) < 0; )
      i++;
    X3(r, t, i);
  } else
    for (; i < e && n(r[i], r[i - 1]) >= 0; )
      i++;
  return i - t;
}
function X3(r, t, e) {
  for (e--; t < e; ) {
    var n = r[t];
    r[t++] = r[e], r[e--] = n;
  }
}
function hb(r, t, e, n, i) {
  for (n === t && n++; n < e; n++) {
    for (var a = r[n], o = t, s = n, l; o < s; )
      l = o + s >>> 1, i(a, r[l]) < 0 ? s = l : o = l + 1;
    var u = n - o;
    switch (u) {
      case 3:
        r[o + 3] = r[o + 2];
      case 2:
        r[o + 2] = r[o + 1];
      case 1:
        r[o + 1] = r[o];
        break;
      default:
        for (; u > 0; )
          r[o + u] = r[o + u - 1], u--;
    }
    r[o] = a;
  }
}
function rd(r, t, e, n, i, a) {
  var o = 0, s = 0, l = 1;
  if (a(r, t[e + i]) > 0) {
    for (s = n - i; l < s && a(r, t[e + i + l]) > 0; )
      o = l, l = (l << 1) + 1, l <= 0 && (l = s);
    l > s && (l = s), o += i, l += i;
  } else {
    for (s = i + 1; l < s && a(r, t[e + i - l]) <= 0; )
      o = l, l = (l << 1) + 1, l <= 0 && (l = s);
    l > s && (l = s);
    var u = o;
    o = i - l, l = i - u;
  }
  for (o++; o < l; ) {
    var c = o + (l - o >>> 1);
    a(r, t[e + c]) > 0 ? o = c + 1 : l = c;
  }
  return l;
}
function nd(r, t, e, n, i, a) {
  var o = 0, s = 0, l = 1;
  if (a(r, t[e + i]) < 0) {
    for (s = i + 1; l < s && a(r, t[e + i - l]) < 0; )
      o = l, l = (l << 1) + 1, l <= 0 && (l = s);
    l > s && (l = s);
    var u = o;
    o = i - l, l = i - u;
  } else {
    for (s = n - i; l < s && a(r, t[e + i + l]) >= 0; )
      o = l, l = (l << 1) + 1, l <= 0 && (l = s);
    l > s && (l = s), o += i, l += i;
  }
  for (o++; o < l; ) {
    var c = o + (l - o >>> 1);
    a(r, t[e + c]) < 0 ? l = c : o = c + 1;
  }
  return l;
}
function j3(r, t) {
  var e = Qs, n, i, a = 0, o = [];
  n = [], i = [];
  function s(v, d) {
    n[a] = v, i[a] = d, a += 1;
  }
  function l() {
    for (; a > 1; ) {
      var v = a - 2;
      if (v >= 1 && i[v - 1] <= i[v] + i[v + 1] || v >= 2 && i[v - 2] <= i[v] + i[v - 1])
        i[v - 1] < i[v + 1] && v--;
      else if (i[v] > i[v + 1])
        break;
      c(v);
    }
  }
  function u() {
    for (; a > 1; ) {
      var v = a - 2;
      v > 0 && i[v - 1] < i[v + 1] && v--, c(v);
    }
  }
  function c(v) {
    var d = n[v], p = i[v], g = n[v + 1], m = i[v + 1];
    i[v] = p + m, v === a - 3 && (n[v + 1] = n[v + 2], i[v + 1] = i[v + 2]), a--;
    var y = nd(r[g], r, d, p, 0, t);
    d += y, p -= y, p !== 0 && (m = rd(r[d + p - 1], r, g, m, m - 1, t), m !== 0 && (p <= m ? f(d, p, g, m) : h(d, p, g, m)));
  }
  function f(v, d, p, g) {
    var m = 0;
    for (m = 0; m < d; m++)
      o[m] = r[v + m];
    var y = 0, _ = p, b = v;
    if (r[b++] = r[_++], --g === 0) {
      for (m = 0; m < d; m++)
        r[b + m] = o[y + m];
      return;
    }
    if (d === 1) {
      for (m = 0; m < g; m++)
        r[b + m] = r[_ + m];
      r[b + g] = o[y];
      return;
    }
    for (var S = e, x, w, C; ; ) {
      x = 0, w = 0, C = !1;
      do
        if (t(r[_], o[y]) < 0) {
          if (r[b++] = r[_++], w++, x = 0, --g === 0) {
            C = !0;
            break;
          }
        } else if (r[b++] = o[y++], x++, w = 0, --d === 1) {
          C = !0;
          break;
        }
      while ((x | w) < S);
      if (C)
        break;
      do {
        if (x = nd(r[_], o, y, d, 0, t), x !== 0) {
          for (m = 0; m < x; m++)
            r[b + m] = o[y + m];
          if (b += x, y += x, d -= x, d <= 1) {
            C = !0;
            break;
          }
        }
        if (r[b++] = r[_++], --g === 0) {
          C = !0;
          break;
        }
        if (w = rd(o[y], r, _, g, 0, t), w !== 0) {
          for (m = 0; m < w; m++)
            r[b + m] = r[_ + m];
          if (b += w, _ += w, g -= w, g === 0) {
            C = !0;
            break;
          }
        }
        if (r[b++] = o[y++], --d === 1) {
          C = !0;
          break;
        }
        S--;
      } while (x >= Qs || w >= Qs);
      if (C)
        break;
      S < 0 && (S = 0), S += 2;
    }
    if (e = S, e < 1 && (e = 1), d === 1) {
      for (m = 0; m < g; m++)
        r[b + m] = r[_ + m];
      r[b + g] = o[y];
    } else {
      if (d === 0)
        throw new Error();
      for (m = 0; m < d; m++)
        r[b + m] = o[y + m];
    }
  }
  function h(v, d, p, g) {
    var m = 0;
    for (m = 0; m < g; m++)
      o[m] = r[p + m];
    var y = v + d - 1, _ = g - 1, b = p + g - 1, S = 0, x = 0;
    if (r[b--] = r[y--], --d === 0) {
      for (S = b - (g - 1), m = 0; m < g; m++)
        r[S + m] = o[m];
      return;
    }
    if (g === 1) {
      for (b -= d, y -= d, x = b + 1, S = y + 1, m = d - 1; m >= 0; m--)
        r[x + m] = r[S + m];
      r[b] = o[_];
      return;
    }
    for (var w = e; ; ) {
      var C = 0, D = 0, A = !1;
      do
        if (t(o[_], r[y]) < 0) {
          if (r[b--] = r[y--], C++, D = 0, --d === 0) {
            A = !0;
            break;
          }
        } else if (r[b--] = o[_--], D++, C = 0, --g === 1) {
          A = !0;
          break;
        }
      while ((C | D) < w);
      if (A)
        break;
      do {
        if (C = d - nd(o[_], r, v, d, d - 1, t), C !== 0) {
          for (b -= C, y -= C, d -= C, x = b + 1, S = y + 1, m = C - 1; m >= 0; m--)
            r[x + m] = r[S + m];
          if (d === 0) {
            A = !0;
            break;
          }
        }
        if (r[b--] = o[_--], --g === 1) {
          A = !0;
          break;
        }
        if (D = g - rd(r[y], o, 0, g, g - 1, t), D !== 0) {
          for (b -= D, _ -= D, g -= D, x = b + 1, S = _ + 1, m = 0; m < D; m++)
            r[x + m] = o[S + m];
          if (g <= 1) {
            A = !0;
            break;
          }
        }
        if (r[b--] = r[y--], --d === 0) {
          A = !0;
          break;
        }
        w--;
      } while (C >= Qs || D >= Qs);
      if (A)
        break;
      w < 0 && (w = 0), w += 2;
    }
    if (e = w, e < 1 && (e = 1), g === 1) {
      for (b -= d, y -= d, x = b + 1, S = y + 1, m = d - 1; m >= 0; m--)
        r[x + m] = r[S + m];
      r[b] = o[_];
    } else {
      if (g === 0)
        throw new Error();
      for (S = b - (g - 1), m = 0; m < g; m++)
        r[S + m] = o[m];
    }
  }
  return {
    mergeRuns: l,
    forceMergeRuns: u,
    pushRun: s
  };
}
function Af(r, t, e, n) {
  e || (e = 0), n || (n = r.length);
  var i = n - e;
  if (!(i < 2)) {
    var a = 0;
    if (i < oT) {
      a = fb(r, e, n, t), hb(r, e, n, e + a, t);
      return;
    }
    var o = j3(r, t), s = Z3(i);
    do {
      if (a = fb(r, e, n, t), a < s) {
        var l = i;
        l > s && (l = s), hb(r, e, e + l, e + a, t), a = l;
      }
      o.pushRun(e, a), o.mergeRuns(), i -= a, e += a;
    } while (i !== 0);
    o.forceMergeRuns();
  }
}
var br = 1, Ml = 2, es = 4, vb = !1;
function id() {
  vb || (vb = !0, console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"));
}
function db(r, t) {
  return r.zlevel === t.zlevel ? r.z === t.z ? r.z2 - t.z2 : r.z - t.z : r.zlevel - t.zlevel;
}
var K3 = function() {
  function r() {
    this._roots = [], this._displayList = [], this._displayListLen = 0, this.displayableSortFunc = db;
  }
  return r.prototype.traverse = function(t, e) {
    for (var n = 0; n < this._roots.length; n++)
      this._roots[n].traverse(t, e);
  }, r.prototype.getDisplayList = function(t, e) {
    e = e || !1;
    var n = this._displayList;
    return (t || !n.length) && this.updateDisplayList(e), n;
  }, r.prototype.updateDisplayList = function(t) {
    this._displayListLen = 0;
    for (var e = this._roots, n = this._displayList, i = 0, a = e.length; i < a; i++)
      this._updateAndAddDisplayable(e[i], null, t);
    n.length = this._displayListLen, Af(n, db);
  }, r.prototype._updateAndAddDisplayable = function(t, e, n) {
    if (!(t.ignore && !n)) {
      t.beforeUpdate(), t.update(), t.afterUpdate();
      var i = t.getClipPath();
      if (t.ignoreClip)
        e = null;
      else if (i) {
        e ? e = e.slice() : e = [];
        for (var a = i, o = t; a; )
          a.parent = o, a.updateTransform(), e.push(a), o = a, a = a.getClipPath();
      }
      if (t.childrenRef) {
        for (var s = t.childrenRef(), l = 0; l < s.length; l++) {
          var u = s[l];
          t.__dirty && (u.__dirty |= br), this._updateAndAddDisplayable(u, e, n);
        }
        t.__dirty = 0;
      } else {
        var c = t;
        e && e.length ? c.__clipPaths = e : c.__clipPaths && c.__clipPaths.length > 0 && (c.__clipPaths = []), isNaN(c.z) && (id(), c.z = 0), isNaN(c.z2) && (id(), c.z2 = 0), isNaN(c.zlevel) && (id(), c.zlevel = 0), this._displayList[this._displayListLen++] = c;
      }
      var f = t.getDecalElement && t.getDecalElement();
      f && this._updateAndAddDisplayable(f, e, n);
      var h = t.getTextGuideLine();
      h && this._updateAndAddDisplayable(h, e, n);
      var v = t.getTextContent();
      v && this._updateAndAddDisplayable(v, e, n);
    }
  }, r.prototype.addRoot = function(t) {
    t.__zr && t.__zr.storage === this || this._roots.push(t);
  }, r.prototype.delRoot = function(t) {
    if (t instanceof Array) {
      for (var e = 0, n = t.length; e < n; e++)
        this.delRoot(t[e]);
      return;
    }
    var i = we(this._roots, t);
    i >= 0 && this._roots.splice(i, 1);
  }, r.prototype.delAllRoots = function() {
    this._roots = [], this._displayList = [], this._displayListLen = 0;
  }, r.prototype.getRoots = function() {
    return this._roots;
  }, r.prototype.dispose = function() {
    this._displayList = null, this._roots = null;
  }, r;
}(), Kf;
Kf = Ie.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(r) {
  return setTimeout(r, 16);
};
var Hl = {
  linear: function(r) {
    return r;
  },
  quadraticIn: function(r) {
    return r * r;
  },
  quadraticOut: function(r) {
    return r * (2 - r);
  },
  quadraticInOut: function(r) {
    return (r *= 2) < 1 ? 0.5 * r * r : -0.5 * (--r * (r - 2) - 1);
  },
  cubicIn: function(r) {
    return r * r * r;
  },
  cubicOut: function(r) {
    return --r * r * r + 1;
  },
  cubicInOut: function(r) {
    return (r *= 2) < 1 ? 0.5 * r * r * r : 0.5 * ((r -= 2) * r * r + 2);
  },
  quarticIn: function(r) {
    return r * r * r * r;
  },
  quarticOut: function(r) {
    return 1 - --r * r * r * r;
  },
  quarticInOut: function(r) {
    return (r *= 2) < 1 ? 0.5 * r * r * r * r : -0.5 * ((r -= 2) * r * r * r - 2);
  },
  quinticIn: function(r) {
    return r * r * r * r * r;
  },
  quinticOut: function(r) {
    return --r * r * r * r * r + 1;
  },
  quinticInOut: function(r) {
    return (r *= 2) < 1 ? 0.5 * r * r * r * r * r : 0.5 * ((r -= 2) * r * r * r * r + 2);
  },
  sinusoidalIn: function(r) {
    return 1 - Math.cos(r * Math.PI / 2);
  },
  sinusoidalOut: function(r) {
    return Math.sin(r * Math.PI / 2);
  },
  sinusoidalInOut: function(r) {
    return 0.5 * (1 - Math.cos(Math.PI * r));
  },
  exponentialIn: function(r) {
    return r === 0 ? 0 : Math.pow(1024, r - 1);
  },
  exponentialOut: function(r) {
    return r === 1 ? 1 : 1 - Math.pow(2, -10 * r);
  },
  exponentialInOut: function(r) {
    return r === 0 ? 0 : r === 1 ? 1 : (r *= 2) < 1 ? 0.5 * Math.pow(1024, r - 1) : 0.5 * (-Math.pow(2, -10 * (r - 1)) + 2);
  },
  circularIn: function(r) {
    return 1 - Math.sqrt(1 - r * r);
  },
  circularOut: function(r) {
    return Math.sqrt(1 - --r * r);
  },
  circularInOut: function(r) {
    return (r *= 2) < 1 ? -0.5 * (Math.sqrt(1 - r * r) - 1) : 0.5 * (Math.sqrt(1 - (r -= 2) * r) + 1);
  },
  elasticIn: function(r) {
    var t, e = 0.1, n = 0.4;
    return r === 0 ? 0 : r === 1 ? 1 : (!e || e < 1 ? (e = 1, t = n / 4) : t = n * Math.asin(1 / e) / (2 * Math.PI), -(e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - t) * (2 * Math.PI) / n)));
  },
  elasticOut: function(r) {
    var t, e = 0.1, n = 0.4;
    return r === 0 ? 0 : r === 1 ? 1 : (!e || e < 1 ? (e = 1, t = n / 4) : t = n * Math.asin(1 / e) / (2 * Math.PI), e * Math.pow(2, -10 * r) * Math.sin((r - t) * (2 * Math.PI) / n) + 1);
  },
  elasticInOut: function(r) {
    var t, e = 0.1, n = 0.4;
    return r === 0 ? 0 : r === 1 ? 1 : (!e || e < 1 ? (e = 1, t = n / 4) : t = n * Math.asin(1 / e) / (2 * Math.PI), (r *= 2) < 1 ? -0.5 * (e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - t) * (2 * Math.PI) / n)) : e * Math.pow(2, -10 * (r -= 1)) * Math.sin((r - t) * (2 * Math.PI) / n) * 0.5 + 1);
  },
  backIn: function(r) {
    var t = 1.70158;
    return r * r * ((t + 1) * r - t);
  },
  backOut: function(r) {
    var t = 1.70158;
    return --r * r * ((t + 1) * r + t) + 1;
  },
  backInOut: function(r) {
    var t = 2.5949095;
    return (r *= 2) < 1 ? 0.5 * (r * r * ((t + 1) * r - t)) : 0.5 * ((r -= 2) * r * ((t + 1) * r + t) + 2);
  },
  bounceIn: function(r) {
    return 1 - Hl.bounceOut(1 - r);
  },
  bounceOut: function(r) {
    return r < 1 / 2.75 ? 7.5625 * r * r : r < 2 / 2.75 ? 7.5625 * (r -= 1.5 / 2.75) * r + 0.75 : r < 2.5 / 2.75 ? 7.5625 * (r -= 2.25 / 2.75) * r + 0.9375 : 7.5625 * (r -= 2.625 / 2.75) * r + 0.984375;
  },
  bounceInOut: function(r) {
    return r < 0.5 ? Hl.bounceIn(r * 2) * 0.5 : Hl.bounceOut(r * 2 - 1) * 0.5 + 0.5;
  }
}, gc = Math.pow, Wi = Math.sqrt, Jf = 1e-8, sT = 1e-4, pb = Wi(3), mc = 1 / 3, Cn = bo(), Nr = bo(), us = bo();
function Bi(r) {
  return r > -Jf && r < Jf;
}
function lT(r) {
  return r > Jf || r < -Jf;
}
function wt(r, t, e, n, i) {
  var a = 1 - i;
  return a * a * (a * r + 3 * i * t) + i * i * (i * n + 3 * a * e);
}
function gb(r, t, e, n, i) {
  var a = 1 - i;
  return 3 * (((t - r) * a + 2 * (e - t) * i) * a + (n - e) * i * i);
}
function Qf(r, t, e, n, i, a) {
  var o = n + 3 * (t - e) - r, s = 3 * (e - t * 2 + r), l = 3 * (t - r), u = r - i, c = s * s - 3 * o * l, f = s * l - 9 * o * u, h = l * l - 3 * s * u, v = 0;
  if (Bi(c) && Bi(f))
    if (Bi(s))
      a[0] = 0;
    else {
      var d = -l / s;
      d >= 0 && d <= 1 && (a[v++] = d);
    }
  else {
    var p = f * f - 4 * c * h;
    if (Bi(p)) {
      var g = f / c, d = -s / o + g, m = -g / 2;
      d >= 0 && d <= 1 && (a[v++] = d), m >= 0 && m <= 1 && (a[v++] = m);
    } else if (p > 0) {
      var y = Wi(p), _ = c * s + 1.5 * o * (-f + y), b = c * s + 1.5 * o * (-f - y);
      _ < 0 ? _ = -gc(-_, mc) : _ = gc(_, mc), b < 0 ? b = -gc(-b, mc) : b = gc(b, mc);
      var d = (-s - (_ + b)) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d);
    } else {
      var S = (2 * c * s - 3 * o * f) / (2 * Wi(c * c * c)), x = Math.acos(S) / 3, w = Wi(c), C = Math.cos(x), d = (-s - 2 * w * C) / (3 * o), m = (-s + w * (C + pb * Math.sin(x))) / (3 * o), D = (-s + w * (C - pb * Math.sin(x))) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d), m >= 0 && m <= 1 && (a[v++] = m), D >= 0 && D <= 1 && (a[v++] = D);
    }
  }
  return v;
}
function uT(r, t, e, n, i) {
  var a = 6 * e - 12 * t + 6 * r, o = 9 * t + 3 * n - 3 * r - 9 * e, s = 3 * t - 3 * r, l = 0;
  if (Bi(o)) {
    if (lT(a)) {
      var u = -s / a;
      u >= 0 && u <= 1 && (i[l++] = u);
    }
  } else {
    var c = a * a - 4 * o * s;
    if (Bi(c))
      i[0] = -a / (2 * o);
    else if (c > 0) {
      var f = Wi(c), u = (-a + f) / (2 * o), h = (-a - f) / (2 * o);
      u >= 0 && u <= 1 && (i[l++] = u), h >= 0 && h <= 1 && (i[l++] = h);
    }
  }
  return l;
}
function Ki(r, t, e, n, i, a) {
  var o = (t - r) * i + r, s = (e - t) * i + t, l = (n - e) * i + e, u = (s - o) * i + o, c = (l - s) * i + s, f = (c - u) * i + u;
  a[0] = r, a[1] = o, a[2] = u, a[3] = f, a[4] = f, a[5] = c, a[6] = l, a[7] = n;
}
function cT(r, t, e, n, i, a, o, s, l, u, c) {
  var f, h = 5e-3, v = 1 / 0, d, p, g, m;
  Cn[0] = l, Cn[1] = u;
  for (var y = 0; y < 1; y += 0.05)
    Nr[0] = wt(r, e, i, o, y), Nr[1] = wt(t, n, a, s, y), g = to(Cn, Nr), g < v && (f = y, v = g);
  v = 1 / 0;
  for (var _ = 0; _ < 32 && !(h < sT); _++)
    d = f - h, p = f + h, Nr[0] = wt(r, e, i, o, d), Nr[1] = wt(t, n, a, s, d), g = to(Nr, Cn), d >= 0 && g < v ? (f = d, v = g) : (us[0] = wt(r, e, i, o, p), us[1] = wt(t, n, a, s, p), m = to(us, Cn), p <= 1 && m < v ? (f = p, v = m) : h *= 0.5);
  return c && (c[0] = wt(r, e, i, o, f), c[1] = wt(t, n, a, s, f)), Wi(v);
}
function J3(r, t, e, n, i, a, o, s, l) {
  for (var u = r, c = t, f = 0, h = 1 / l, v = 1; v <= l; v++) {
    var d = v * h, p = wt(r, e, i, o, d), g = wt(t, n, a, s, d), m = p - u, y = g - c;
    f += Math.sqrt(m * m + y * y), u = p, c = g;
  }
  return f;
}
function Lt(r, t, e, n) {
  var i = 1 - n;
  return i * (i * r + 2 * n * t) + n * n * e;
}
function qg(r, t, e, n) {
  return 2 * ((1 - n) * (t - r) + n * (e - t));
}
function Q3(r, t, e, n, i) {
  var a = r - 2 * t + e, o = 2 * (t - r), s = r - n, l = 0;
  if (Bi(a)) {
    if (lT(o)) {
      var u = -s / o;
      u >= 0 && u <= 1 && (i[l++] = u);
    }
  } else {
    var c = o * o - 4 * a * s;
    if (Bi(c)) {
      var u = -o / (2 * a);
      u >= 0 && u <= 1 && (i[l++] = u);
    } else if (c > 0) {
      var f = Wi(c), u = (-o + f) / (2 * a), h = (-o - f) / (2 * a);
      u >= 0 && u <= 1 && (i[l++] = u), h >= 0 && h <= 1 && (i[l++] = h);
    }
  }
  return l;
}
function fT(r, t, e) {
  var n = r + e - 2 * t;
  return n === 0 ? 0.5 : (r - t) / n;
}
function fu(r, t, e, n, i) {
  var a = (t - r) * n + r, o = (e - t) * n + t, s = (o - a) * n + a;
  i[0] = r, i[1] = a, i[2] = s, i[3] = s, i[4] = o, i[5] = e;
}
function hT(r, t, e, n, i, a, o, s, l) {
  var u, c = 5e-3, f = 1 / 0;
  Cn[0] = o, Cn[1] = s;
  for (var h = 0; h < 1; h += 0.05) {
    Nr[0] = Lt(r, e, i, h), Nr[1] = Lt(t, n, a, h);
    var v = to(Cn, Nr);
    v < f && (u = h, f = v);
  }
  f = 1 / 0;
  for (var d = 0; d < 32 && !(c < sT); d++) {
    var p = u - c, g = u + c;
    Nr[0] = Lt(r, e, i, p), Nr[1] = Lt(t, n, a, p);
    var v = to(Nr, Cn);
    if (p >= 0 && v < f)
      u = p, f = v;
    else {
      us[0] = Lt(r, e, i, g), us[1] = Lt(t, n, a, g);
      var m = to(us, Cn);
      g <= 1 && m < f ? (u = g, f = m) : c *= 0.5;
    }
  }
  return l && (l[0] = Lt(r, e, i, u), l[1] = Lt(t, n, a, u)), Wi(f);
}
function eB(r, t, e, n, i, a, o) {
  for (var s = r, l = t, u = 0, c = 1 / o, f = 1; f <= o; f++) {
    var h = f * c, v = Lt(r, e, i, h), d = Lt(t, n, a, h), p = v - s, g = d - l;
    u += Math.sqrt(p * p + g * g), s = v, l = d;
  }
  return u;
}
var tB = /cubic-bezier\(([0-9,\.e ]+)\)/;
function e0(r) {
  var t = r && tB.exec(r);
  if (t) {
    var e = t[1].split(","), n = +tn(e[0]), i = +tn(e[1]), a = +tn(e[2]), o = +tn(e[3]);
    if (isNaN(n + i + a + o))
      return;
    var s = [];
    return function(l) {
      return l <= 0 ? 0 : l >= 1 ? 1 : Qf(0, n, a, 1, l, s) && wt(0, i, o, 1, s[0]);
    };
  }
}
var rB = function() {
  function r(t) {
    this._inited = !1, this._startTime = 0, this._pausedTime = 0, this._paused = !1, this._life = t.life || 1e3, this._delay = t.delay || 0, this.loop = t.loop || !1, this.onframe = t.onframe || dt, this.ondestroy = t.ondestroy || dt, this.onrestart = t.onrestart || dt, t.easing && this.setEasing(t.easing);
  }
  return r.prototype.step = function(t, e) {
    if (this._inited || (this._startTime = t + this._delay, this._inited = !0), this._paused) {
      this._pausedTime += e;
      return;
    }
    var n = this._life, i = t - this._startTime - this._pausedTime, a = i / n;
    a < 0 && (a = 0), a = Math.min(a, 1);
    var o = this.easingFunc, s = o ? o(a) : a;
    if (this.onframe(s), a === 1)
      if (this.loop) {
        var l = i % n;
        this._startTime = t - l, this._pausedTime = 0, this.onrestart();
      } else
        return !0;
    return !1;
  }, r.prototype.pause = function() {
    this._paused = !0;
  }, r.prototype.resume = function() {
    this._paused = !1;
  }, r.prototype.setEasing = function(t) {
    this.easing = t, this.easingFunc = oe(t) ? t : Hl[t] || e0(t);
  }, r;
}(), vT = /* @__PURE__ */ function() {
  function r(t) {
    this.value = t;
  }
  return r;
}(), nB = function() {
  function r() {
    this._len = 0;
  }
  return r.prototype.insert = function(t) {
    var e = new vT(t);
    return this.insertEntry(e), e;
  }, r.prototype.insertEntry = function(t) {
    this.head ? (this.tail.next = t, t.prev = this.tail, t.next = null, this.tail = t) : this.head = this.tail = t, this._len++;
  }, r.prototype.remove = function(t) {
    var e = t.prev, n = t.next;
    e ? e.next = n : this.head = n, n ? n.prev = e : this.tail = e, t.next = t.prev = null, this._len--;
  }, r.prototype.len = function() {
    return this._len;
  }, r.prototype.clear = function() {
    this.head = this.tail = null, this._len = 0;
  }, r;
}(), zu = function() {
  function r(t) {
    this._list = new nB(), this._maxSize = 10, this._map = {}, this._maxSize = t;
  }
  return r.prototype.put = function(t, e) {
    var n = this._list, i = this._map, a = null;
    if (i[t] == null) {
      var o = n.len(), s = this._lastRemovedEntry;
      if (o >= this._maxSize && o > 0) {
        var l = n.head;
        n.remove(l), delete i[l.key], a = l.value, this._lastRemovedEntry = l;
      }
      s ? s.value = e : s = new vT(e), s.key = t, n.insertEntry(s), i[t] = s;
    }
    return a;
  }, r.prototype.get = function(t) {
    var e = this._map[t], n = this._list;
    if (e != null)
      return e !== n.tail && (n.remove(e), n.insertEntry(e)), e.value;
  }, r.prototype.clear = function() {
    this._list.clear(), this._map = {};
  }, r.prototype.len = function() {
    return this._list.len();
  }, r;
}(), mb = {
  transparent: [0, 0, 0, 0],
  aliceblue: [240, 248, 255, 1],
  antiquewhite: [250, 235, 215, 1],
  aqua: [0, 255, 255, 1],
  aquamarine: [127, 255, 212, 1],
  azure: [240, 255, 255, 1],
  beige: [245, 245, 220, 1],
  bisque: [255, 228, 196, 1],
  black: [0, 0, 0, 1],
  blanchedalmond: [255, 235, 205, 1],
  blue: [0, 0, 255, 1],
  blueviolet: [138, 43, 226, 1],
  brown: [165, 42, 42, 1],
  burlywood: [222, 184, 135, 1],
  cadetblue: [95, 158, 160, 1],
  chartreuse: [127, 255, 0, 1],
  chocolate: [210, 105, 30, 1],
  coral: [255, 127, 80, 1],
  cornflowerblue: [100, 149, 237, 1],
  cornsilk: [255, 248, 220, 1],
  crimson: [220, 20, 60, 1],
  cyan: [0, 255, 255, 1],
  darkblue: [0, 0, 139, 1],
  darkcyan: [0, 139, 139, 1],
  darkgoldenrod: [184, 134, 11, 1],
  darkgray: [169, 169, 169, 1],
  darkgreen: [0, 100, 0, 1],
  darkgrey: [169, 169, 169, 1],
  darkkhaki: [189, 183, 107, 1],
  darkmagenta: [139, 0, 139, 1],
  darkolivegreen: [85, 107, 47, 1],
  darkorange: [255, 140, 0, 1],
  darkorchid: [153, 50, 204, 1],
  darkred: [139, 0, 0, 1],
  darksalmon: [233, 150, 122, 1],
  darkseagreen: [143, 188, 143, 1],
  darkslateblue: [72, 61, 139, 1],
  darkslategray: [47, 79, 79, 1],
  darkslategrey: [47, 79, 79, 1],
  darkturquoise: [0, 206, 209, 1],
  darkviolet: [148, 0, 211, 1],
  deeppink: [255, 20, 147, 1],
  deepskyblue: [0, 191, 255, 1],
  dimgray: [105, 105, 105, 1],
  dimgrey: [105, 105, 105, 1],
  dodgerblue: [30, 144, 255, 1],
  firebrick: [178, 34, 34, 1],
  floralwhite: [255, 250, 240, 1],
  forestgreen: [34, 139, 34, 1],
  fuchsia: [255, 0, 255, 1],
  gainsboro: [220, 220, 220, 1],
  ghostwhite: [248, 248, 255, 1],
  gold: [255, 215, 0, 1],
  goldenrod: [218, 165, 32, 1],
  gray: [128, 128, 128, 1],
  green: [0, 128, 0, 1],
  greenyellow: [173, 255, 47, 1],
  grey: [128, 128, 128, 1],
  honeydew: [240, 255, 240, 1],
  hotpink: [255, 105, 180, 1],
  indianred: [205, 92, 92, 1],
  indigo: [75, 0, 130, 1],
  ivory: [255, 255, 240, 1],
  khaki: [240, 230, 140, 1],
  lavender: [230, 230, 250, 1],
  lavenderblush: [255, 240, 245, 1],
  lawngreen: [124, 252, 0, 1],
  lemonchiffon: [255, 250, 205, 1],
  lightblue: [173, 216, 230, 1],
  lightcoral: [240, 128, 128, 1],
  lightcyan: [224, 255, 255, 1],
  lightgoldenrodyellow: [250, 250, 210, 1],
  lightgray: [211, 211, 211, 1],
  lightgreen: [144, 238, 144, 1],
  lightgrey: [211, 211, 211, 1],
  lightpink: [255, 182, 193, 1],
  lightsalmon: [255, 160, 122, 1],
  lightseagreen: [32, 178, 170, 1],
  lightskyblue: [135, 206, 250, 1],
  lightslategray: [119, 136, 153, 1],
  lightslategrey: [119, 136, 153, 1],
  lightsteelblue: [176, 196, 222, 1],
  lightyellow: [255, 255, 224, 1],
  lime: [0, 255, 0, 1],
  limegreen: [50, 205, 50, 1],
  linen: [250, 240, 230, 1],
  magenta: [255, 0, 255, 1],
  maroon: [128, 0, 0, 1],
  mediumaquamarine: [102, 205, 170, 1],
  mediumblue: [0, 0, 205, 1],
  mediumorchid: [186, 85, 211, 1],
  mediumpurple: [147, 112, 219, 1],
  mediumseagreen: [60, 179, 113, 1],
  mediumslateblue: [123, 104, 238, 1],
  mediumspringgreen: [0, 250, 154, 1],
  mediumturquoise: [72, 209, 204, 1],
  mediumvioletred: [199, 21, 133, 1],
  midnightblue: [25, 25, 112, 1],
  mintcream: [245, 255, 250, 1],
  mistyrose: [255, 228, 225, 1],
  moccasin: [255, 228, 181, 1],
  navajowhite: [255, 222, 173, 1],
  navy: [0, 0, 128, 1],
  oldlace: [253, 245, 230, 1],
  olive: [128, 128, 0, 1],
  olivedrab: [107, 142, 35, 1],
  orange: [255, 165, 0, 1],
  orangered: [255, 69, 0, 1],
  orchid: [218, 112, 214, 1],
  palegoldenrod: [238, 232, 170, 1],
  palegreen: [152, 251, 152, 1],
  paleturquoise: [175, 238, 238, 1],
  palevioletred: [219, 112, 147, 1],
  papayawhip: [255, 239, 213, 1],
  peachpuff: [255, 218, 185, 1],
  peru: [205, 133, 63, 1],
  pink: [255, 192, 203, 1],
  plum: [221, 160, 221, 1],
  powderblue: [176, 224, 230, 1],
  purple: [128, 0, 128, 1],
  red: [255, 0, 0, 1],
  rosybrown: [188, 143, 143, 1],
  royalblue: [65, 105, 225, 1],
  saddlebrown: [139, 69, 19, 1],
  salmon: [250, 128, 114, 1],
  sandybrown: [244, 164, 96, 1],
  seagreen: [46, 139, 87, 1],
  seashell: [255, 245, 238, 1],
  sienna: [160, 82, 45, 1],
  silver: [192, 192, 192, 1],
  skyblue: [135, 206, 235, 1],
  slateblue: [106, 90, 205, 1],
  slategray: [112, 128, 144, 1],
  slategrey: [112, 128, 144, 1],
  snow: [255, 250, 250, 1],
  springgreen: [0, 255, 127, 1],
  steelblue: [70, 130, 180, 1],
  tan: [210, 180, 140, 1],
  teal: [0, 128, 128, 1],
  thistle: [216, 191, 216, 1],
  tomato: [255, 99, 71, 1],
  turquoise: [64, 224, 208, 1],
  violet: [238, 130, 238, 1],
  wheat: [245, 222, 179, 1],
  white: [255, 255, 255, 1],
  whitesmoke: [245, 245, 245, 1],
  yellow: [255, 255, 0, 1],
  yellowgreen: [154, 205, 50, 1]
};
function nn(r) {
  return r = Math.round(r), r < 0 ? 0 : r > 255 ? 255 : r;
}
function iB(r) {
  return r = Math.round(r), r < 0 ? 0 : r > 360 ? 360 : r;
}
function hu(r) {
  return r < 0 ? 0 : r > 1 ? 1 : r;
}
function ad(r) {
  var t = r;
  return t.length && t.charAt(t.length - 1) === "%" ? nn(parseFloat(t) / 100 * 255) : nn(parseInt(t, 10));
}
function ro(r) {
  var t = r;
  return t.length && t.charAt(t.length - 1) === "%" ? hu(parseFloat(t) / 100) : hu(parseFloat(t));
}
function od(r, t, e) {
  return e < 0 ? e += 1 : e > 1 && (e -= 1), e * 6 < 1 ? r + (t - r) * e * 6 : e * 2 < 1 ? t : e * 3 < 2 ? r + (t - r) * (2 / 3 - e) * 6 : r;
}
function Ni(r, t, e) {
  return r + (t - r) * e;
}
function kr(r, t, e, n, i) {
  return r[0] = t, r[1] = e, r[2] = n, r[3] = i, r;
}
function Wg(r, t) {
  return r[0] = t[0], r[1] = t[1], r[2] = t[2], r[3] = t[3], r;
}
var dT = new zu(20), yc = null;
function Po(r, t) {
  yc && Wg(yc, t), yc = dT.put(r, yc || t.slice());
}
function Ar(r, t) {
  if (r) {
    t = t || [];
    var e = dT.get(r);
    if (e)
      return Wg(t, e);
    r = r + "";
    var n = r.replace(/ /g, "").toLowerCase();
    if (n in mb)
      return Wg(t, mb[n]), Po(r, t), t;
    var i = n.length;
    if (n.charAt(0) === "#") {
      if (i === 4 || i === 5) {
        var a = parseInt(n.slice(1, 4), 16);
        if (!(a >= 0 && a <= 4095)) {
          kr(t, 0, 0, 0, 1);
          return;
        }
        return kr(t, (a & 3840) >> 4 | (a & 3840) >> 8, a & 240 | (a & 240) >> 4, a & 15 | (a & 15) << 4, i === 5 ? parseInt(n.slice(4), 16) / 15 : 1), Po(r, t), t;
      } else if (i === 7 || i === 9) {
        var a = parseInt(n.slice(1, 7), 16);
        if (!(a >= 0 && a <= 16777215)) {
          kr(t, 0, 0, 0, 1);
          return;
        }
        return kr(t, (a & 16711680) >> 16, (a & 65280) >> 8, a & 255, i === 9 ? parseInt(n.slice(7), 16) / 255 : 1), Po(r, t), t;
      }
      return;
    }
    var o = n.indexOf("("), s = n.indexOf(")");
    if (o !== -1 && s + 1 === i) {
      var l = n.substr(0, o), u = n.substr(o + 1, s - (o + 1)).split(","), c = 1;
      switch (l) {
        case "rgba":
          if (u.length !== 4)
            return u.length === 3 ? kr(t, +u[0], +u[1], +u[2], 1) : kr(t, 0, 0, 0, 1);
          c = ro(u.pop());
        case "rgb":
          if (u.length >= 3)
            return kr(t, ad(u[0]), ad(u[1]), ad(u[2]), u.length === 3 ? c : ro(u[3])), Po(r, t), t;
          kr(t, 0, 0, 0, 1);
          return;
        case "hsla":
          if (u.length !== 4) {
            kr(t, 0, 0, 0, 1);
            return;
          }
          return u[3] = ro(u[3]), Ug(u, t), Po(r, t), t;
        case "hsl":
          if (u.length !== 3) {
            kr(t, 0, 0, 0, 1);
            return;
          }
          return Ug(u, t), Po(r, t), t;
        default:
          return;
      }
    }
    kr(t, 0, 0, 0, 1);
  }
}
function Ug(r, t) {
  var e = (parseFloat(r[0]) % 360 + 360) % 360 / 360, n = ro(r[1]), i = ro(r[2]), a = i <= 0.5 ? i * (n + 1) : i + n - i * n, o = i * 2 - a;
  return t = t || [], kr(t, nn(od(o, a, e + 1 / 3) * 255), nn(od(o, a, e) * 255), nn(od(o, a, e - 1 / 3) * 255), 1), r.length === 4 && (t[3] = r[3]), t;
}
function aB(r) {
  if (r) {
    var t = r[0] / 255, e = r[1] / 255, n = r[2] / 255, i = Math.min(t, e, n), a = Math.max(t, e, n), o = a - i, s = (a + i) / 2, l, u;
    if (o === 0)
      l = 0, u = 0;
    else {
      s < 0.5 ? u = o / (a + i) : u = o / (2 - a - i);
      var c = ((a - t) / 6 + o / 2) / o, f = ((a - e) / 6 + o / 2) / o, h = ((a - n) / 6 + o / 2) / o;
      t === a ? l = h - f : e === a ? l = 1 / 3 + c - h : n === a && (l = 2 / 3 + f - c), l < 0 && (l += 1), l > 1 && (l -= 1);
    }
    var v = [l * 360, u, s];
    return r[3] != null && v.push(r[3]), v;
  }
}
function Yg(r, t) {
  var e = Ar(r);
  if (e) {
    for (var n = 0; n < 3; n++)
      t < 0 ? e[n] = e[n] * (1 - t) | 0 : e[n] = (255 - e[n]) * t + e[n] | 0, e[n] > 255 ? e[n] = 255 : e[n] < 0 && (e[n] = 0);
    return ti(e, e.length === 4 ? "rgba" : "rgb");
  }
}
function sd(r, t, e) {
  if (!(!(t && t.length) || !(r >= 0 && r <= 1))) {
    e = e || [];
    var n = r * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = t[i], s = t[a], l = n - i;
    return e[0] = nn(Ni(o[0], s[0], l)), e[1] = nn(Ni(o[1], s[1], l)), e[2] = nn(Ni(o[2], s[2], l)), e[3] = hu(Ni(o[3], s[3], l)), e;
  }
}
function oB(r, t, e) {
  if (!(!(t && t.length) || !(r >= 0 && r <= 1))) {
    var n = r * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = Ar(t[i]), s = Ar(t[a]), l = n - i, u = ti([
      nn(Ni(o[0], s[0], l)),
      nn(Ni(o[1], s[1], l)),
      nn(Ni(o[2], s[2], l)),
      hu(Ni(o[3], s[3], l))
    ], "rgba");
    return e ? {
      color: u,
      leftIndex: i,
      rightIndex: a,
      value: n
    } : u;
  }
}
function ql(r, t, e, n) {
  var i = Ar(r);
  if (r)
    return i = aB(i), t != null && (i[0] = iB(t)), e != null && (i[1] = ro(e)), n != null && (i[2] = ro(n)), ti(Ug(i), "rgba");
}
function eh(r, t) {
  var e = Ar(r);
  if (e && t != null)
    return e[3] = hu(t), ti(e, "rgba");
}
function ti(r, t) {
  if (!(!r || !r.length)) {
    var e = r[0] + "," + r[1] + "," + r[2];
    return (t === "rgba" || t === "hsva" || t === "hsla") && (e += "," + r[3]), t + "(" + e + ")";
  }
}
function th(r, t) {
  var e = Ar(r);
  return e ? (0.299 * e[0] + 0.587 * e[1] + 0.114 * e[2]) * e[3] / 255 + (1 - e[3]) * t : 0;
}
var yb = new zu(100);
function Zg(r) {
  if (J(r)) {
    var t = yb.get(r);
    return t || (t = Yg(r, -0.1), yb.put(r, t)), t;
  } else if (ev(r)) {
    var e = H({}, r);
    return e.colorStops = U(r.colorStops, function(n) {
      return {
        offset: n.offset,
        color: Yg(n.color, -0.1)
      };
    }), e;
  }
  return r;
}
var rh = Math.round;
function vu(r) {
  var t;
  if (!r || r === "transparent")
    r = "none";
  else if (typeof r == "string" && r.indexOf("rgba") > -1) {
    var e = Ar(r);
    e && (r = "rgb(" + e[0] + "," + e[1] + "," + e[2] + ")", t = e[3]);
  }
  return {
    color: r,
    opacity: t ?? 1
  };
}
var _b = 1e-4;
function zi(r) {
  return r < _b && r > -_b;
}
function _c(r) {
  return rh(r * 1e3) / 1e3;
}
function Xg(r) {
  return rh(r * 1e4) / 1e4;
}
function sB(r) {
  return "matrix(" + _c(r[0]) + "," + _c(r[1]) + "," + _c(r[2]) + "," + _c(r[3]) + "," + Xg(r[4]) + "," + Xg(r[5]) + ")";
}
var lB = {
  left: "start",
  right: "end",
  center: "middle",
  middle: "middle"
};
function uB(r, t, e) {
  return e === "top" ? r += t / 2 : e === "bottom" && (r -= t / 2), r;
}
function cB(r) {
  return r && (r.shadowBlur || r.shadowOffsetX || r.shadowOffsetY);
}
function fB(r) {
  var t = r.style, e = r.getGlobalScale();
  return [
    t.shadowColor,
    (t.shadowBlur || 0).toFixed(2),
    (t.shadowOffsetX || 0).toFixed(2),
    (t.shadowOffsetY || 0).toFixed(2),
    e[0],
    e[1]
  ].join(",");
}
function pT(r) {
  return r && !!r.image;
}
function hB(r) {
  return r && !!r.svgElement;
}
function t0(r) {
  return pT(r) || hB(r);
}
function gT(r) {
  return r.type === "linear";
}
function mT(r) {
  return r.type === "radial";
}
function yT(r) {
  return r && (r.type === "linear" || r.type === "radial");
}
function nv(r) {
  return "url(#" + r + ")";
}
function _T(r) {
  var t = r.getGlobalScale(), e = Math.max(t[0], t[1]);
  return Math.max(Math.ceil(Math.log(e) / Math.log(10)), 1);
}
function bT(r) {
  var t = r.x || 0, e = r.y || 0, n = (r.rotation || 0) * xf, i = me(r.scaleX, 1), a = me(r.scaleY, 1), o = r.skewX || 0, s = r.skewY || 0, l = [];
  return (t || e) && l.push("translate(" + t + "px," + e + "px)"), n && l.push("rotate(" + n + ")"), (i !== 1 || a !== 1) && l.push("scale(" + i + "," + a + ")"), (o || s) && l.push("skew(" + rh(o * xf) + "deg, " + rh(s * xf) + "deg)"), l.join(" ");
}
var vB = function() {
  return Ie.hasGlobalWindow && oe(window.btoa) ? function(r) {
    return window.btoa(unescape(encodeURIComponent(r)));
  } : typeof Buffer < "u" ? function(r) {
    return Buffer.from(r).toString("base64");
  } : function(r) {
    return null;
  };
}(), jg = Array.prototype.slice;
function Yn(r, t, e) {
  return (t - r) * e + r;
}
function ld(r, t, e, n) {
  for (var i = t.length, a = 0; a < i; a++)
    r[a] = Yn(t[a], e[a], n);
  return r;
}
function dB(r, t, e, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    r[o] || (r[o] = []);
    for (var s = 0; s < a; s++)
      r[o][s] = Yn(t[o][s], e[o][s], n);
  }
  return r;
}
function bc(r, t, e, n) {
  for (var i = t.length, a = 0; a < i; a++)
    r[a] = t[a] + e[a] * n;
  return r;
}
function bb(r, t, e, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    r[o] || (r[o] = []);
    for (var s = 0; s < a; s++)
      r[o][s] = t[o][s] + e[o][s] * n;
  }
  return r;
}
function pB(r, t) {
  for (var e = r.length, n = t.length, i = e > n ? t : r, a = Math.min(e, n), o = i[a - 1] || { color: [0, 0, 0, 0], offset: 0 }, s = a; s < Math.max(e, n); s++)
    i.push({
      offset: o.offset,
      color: o.color.slice()
    });
}
function gB(r, t, e) {
  var n = r, i = t;
  if (!(!n.push || !i.push)) {
    var a = n.length, o = i.length;
    if (a !== o) {
      var s = a > o;
      if (s)
        n.length = o;
      else
        for (var l = a; l < o; l++)
          n.push(e === 1 ? i[l] : jg.call(i[l]));
    }
    for (var u = n[0] && n[0].length, l = 0; l < n.length; l++)
      if (e === 1)
        isNaN(n[l]) && (n[l] = i[l]);
      else
        for (var c = 0; c < u; c++)
          isNaN(n[l][c]) && (n[l][c] = i[l][c]);
  }
}
function Wl(r) {
  if (qt(r)) {
    var t = r.length;
    if (qt(r[0])) {
      for (var e = [], n = 0; n < t; n++)
        e.push(jg.call(r[n]));
      return e;
    }
    return jg.call(r);
  }
  return r;
}
function Df(r) {
  return r[0] = Math.floor(r[0]) || 0, r[1] = Math.floor(r[1]) || 0, r[2] = Math.floor(r[2]) || 0, r[3] = r[3] == null ? 1 : r[3], "rgba(" + r.join(",") + ")";
}
function mB(r) {
  return qt(r && r[0]) ? 2 : 1;
}
var Sc = 0, Tf = 1, ST = 2, Il = 3, Kg = 4, Jg = 5, Sb = 6;
function xb(r) {
  return r === Kg || r === Jg;
}
function xc(r) {
  return r === Tf || r === ST;
}
var el = [0, 0, 0, 0], yB = function() {
  function r(t) {
    this.keyframes = [], this.discrete = !1, this._invalid = !1, this._needsSort = !1, this._lastFr = 0, this._lastFrP = 0, this.propName = t;
  }
  return r.prototype.isFinished = function() {
    return this._finished;
  }, r.prototype.setFinished = function() {
    this._finished = !0, this._additiveTrack && this._additiveTrack.setFinished();
  }, r.prototype.needsAnimate = function() {
    return this.keyframes.length >= 1;
  }, r.prototype.getAdditiveTrack = function() {
    return this._additiveTrack;
  }, r.prototype.addKeyframe = function(t, e, n) {
    this._needsSort = !0;
    var i = this.keyframes, a = i.length, o = !1, s = Sb, l = e;
    if (qt(e)) {
      var u = mB(e);
      s = u, (u === 1 && !Be(e[0]) || u === 2 && !Be(e[0][0])) && (o = !0);
    } else if (Be(e) && !uu(e))
      s = Sc;
    else if (J(e))
      if (!isNaN(+e))
        s = Sc;
      else {
        var c = Ar(e);
        c && (l = c, s = Il);
      }
    else if (ev(e)) {
      var f = H({}, l);
      f.colorStops = U(e.colorStops, function(v) {
        return {
          offset: v.offset,
          color: Ar(v.color)
        };
      }), gT(e) ? s = Kg : mT(e) && (s = Jg), l = f;
    }
    a === 0 ? this.valType = s : (s !== this.valType || s === Sb) && (o = !0), this.discrete = this.discrete || o;
    var h = {
      time: t,
      value: l,
      rawValue: e,
      percent: 0
    };
    return n && (h.easing = n, h.easingFunc = oe(n) ? n : Hl[n] || e0(n)), i.push(h), h;
  }, r.prototype.prepare = function(t, e) {
    var n = this.keyframes;
    this._needsSort && n.sort(function(p, g) {
      return p.time - g.time;
    });
    for (var i = this.valType, a = n.length, o = n[a - 1], s = this.discrete, l = xc(i), u = xb(i), c = 0; c < a; c++) {
      var f = n[c], h = f.value, v = o.value;
      f.percent = f.time / t, s || (l && c !== a - 1 ? gB(h, v, i) : u && pB(h.colorStops, v.colorStops));
    }
    if (!s && i !== Jg && e && this.needsAnimate() && e.needsAnimate() && i === e.valType && !e._finished) {
      this._additiveTrack = e;
      for (var d = n[0].value, c = 0; c < a; c++)
        i === Sc ? n[c].additiveValue = n[c].value - d : i === Il ? n[c].additiveValue = bc([], n[c].value, d, -1) : xc(i) && (n[c].additiveValue = i === Tf ? bc([], n[c].value, d, -1) : bb([], n[c].value, d, -1));
    }
  }, r.prototype.step = function(t, e) {
    if (!this._finished) {
      this._additiveTrack && this._additiveTrack._finished && (this._additiveTrack = null);
      var n = this._additiveTrack != null, i = n ? "additiveValue" : "value", a = this.valType, o = this.keyframes, s = o.length, l = this.propName, u = a === Il, c, f = this._lastFr, h = Math.min, v, d;
      if (s === 1)
        v = d = o[0];
      else {
        if (e < 0)
          c = 0;
        else if (e < this._lastFrP) {
          var p = h(f + 1, s - 1);
          for (c = p; c >= 0 && !(o[c].percent <= e); c--)
            ;
          c = h(c, s - 2);
        } else {
          for (c = f; c < s && !(o[c].percent > e); c++)
            ;
          c = h(c - 1, s - 2);
        }
        d = o[c + 1], v = o[c];
      }
      if (v && d) {
        this._lastFr = c, this._lastFrP = e;
        var g = d.percent - v.percent, m = g === 0 ? 1 : h((e - v.percent) / g, 1);
        d.easingFunc && (m = d.easingFunc(m));
        var y = n ? this._additiveValue : u ? el : t[l];
        if ((xc(a) || u) && !y && (y = this._additiveValue = []), this.discrete)
          t[l] = m < 1 ? v.rawValue : d.rawValue;
        else if (xc(a))
          a === Tf ? ld(y, v[i], d[i], m) : dB(y, v[i], d[i], m);
        else if (xb(a)) {
          var _ = v[i], b = d[i], S = a === Kg;
          t[l] = {
            type: S ? "linear" : "radial",
            x: Yn(_.x, b.x, m),
            y: Yn(_.y, b.y, m),
            colorStops: U(_.colorStops, function(w, C) {
              var D = b.colorStops[C];
              return {
                offset: Yn(w.offset, D.offset, m),
                color: Df(ld([], w.color, D.color, m))
              };
            }),
            global: b.global
          }, S ? (t[l].x2 = Yn(_.x2, b.x2, m), t[l].y2 = Yn(_.y2, b.y2, m)) : t[l].r = Yn(_.r, b.r, m);
        } else if (u)
          ld(y, v[i], d[i], m), n || (t[l] = Df(y));
        else {
          var x = Yn(v[i], d[i], m);
          n ? this._additiveValue = x : t[l] = x;
        }
        n && this._addToTarget(t);
      }
    }
  }, r.prototype._addToTarget = function(t) {
    var e = this.valType, n = this.propName, i = this._additiveValue;
    e === Sc ? t[n] = t[n] + i : e === Il ? (Ar(t[n], el), bc(el, el, i, 1), t[n] = Df(el)) : e === Tf ? bc(t[n], t[n], i, 1) : e === ST && bb(t[n], t[n], i, 1);
  }, r;
}(), r0 = function() {
  function r(t, e, n, i) {
    if (this._tracks = {}, this._trackKeys = [], this._maxTime = 0, this._started = 0, this._clip = null, this._target = t, this._loop = e, e && i) {
      Yy("Can' use additive animation on looped animation.");
      return;
    }
    this._additiveAnimators = i, this._allowDiscrete = n;
  }
  return r.prototype.getMaxTime = function() {
    return this._maxTime;
  }, r.prototype.getDelay = function() {
    return this._delay;
  }, r.prototype.getLoop = function() {
    return this._loop;
  }, r.prototype.getTarget = function() {
    return this._target;
  }, r.prototype.changeTarget = function(t) {
    this._target = t;
  }, r.prototype.when = function(t, e, n) {
    return this.whenWithKeys(t, e, Ee(e), n);
  }, r.prototype.whenWithKeys = function(t, e, n, i) {
    for (var a = this._tracks, o = 0; o < n.length; o++) {
      var s = n[o], l = a[s];
      if (!l) {
        l = a[s] = new yB(s);
        var u = void 0, c = this._getAdditiveTrack(s);
        if (c) {
          var f = c.keyframes, h = f[f.length - 1];
          u = h && h.value, c.valType === Il && u && (u = Df(u));
        } else
          u = this._target[s];
        if (u == null)
          continue;
        t > 0 && l.addKeyframe(0, Wl(u), i), this._trackKeys.push(s);
      }
      l.addKeyframe(t, Wl(e[s]), i);
    }
    return this._maxTime = Math.max(this._maxTime, t), this;
  }, r.prototype.pause = function() {
    this._clip.pause(), this._paused = !0;
  }, r.prototype.resume = function() {
    this._clip.resume(), this._paused = !1;
  }, r.prototype.isPaused = function() {
    return !!this._paused;
  }, r.prototype.duration = function(t) {
    return this._maxTime = t, this._force = !0, this;
  }, r.prototype._doneCallback = function() {
    this._setTracksFinished(), this._clip = null;
    var t = this._doneCbs;
    if (t)
      for (var e = t.length, n = 0; n < e; n++)
        t[n].call(this);
  }, r.prototype._abortedCallback = function() {
    this._setTracksFinished();
    var t = this.animation, e = this._abortedCbs;
    if (t && t.removeClip(this._clip), this._clip = null, e)
      for (var n = 0; n < e.length; n++)
        e[n].call(this);
  }, r.prototype._setTracksFinished = function() {
    for (var t = this._tracks, e = this._trackKeys, n = 0; n < e.length; n++)
      t[e[n]].setFinished();
  }, r.prototype._getAdditiveTrack = function(t) {
    var e, n = this._additiveAnimators;
    if (n)
      for (var i = 0; i < n.length; i++) {
        var a = n[i].getTrack(t);
        a && (e = a);
      }
    return e;
  }, r.prototype.start = function(t) {
    if (!(this._started > 0)) {
      this._started = 1;
      for (var e = this, n = [], i = this._maxTime || 0, a = 0; a < this._trackKeys.length; a++) {
        var o = this._trackKeys[a], s = this._tracks[o], l = this._getAdditiveTrack(o), u = s.keyframes, c = u.length;
        if (s.prepare(i, l), s.needsAnimate())
          if (!this._allowDiscrete && s.discrete) {
            var f = u[c - 1];
            f && (e._target[s.propName] = f.rawValue), s.setFinished();
          } else
            n.push(s);
      }
      if (n.length || this._force) {
        var h = new rB({
          life: i,
          loop: this._loop,
          delay: this._delay || 0,
          onframe: function(v) {
            e._started = 2;
            var d = e._additiveAnimators;
            if (d) {
              for (var p = !1, g = 0; g < d.length; g++)
                if (d[g]._clip) {
                  p = !0;
                  break;
                }
              p || (e._additiveAnimators = null);
            }
            for (var g = 0; g < n.length; g++)
              n[g].step(e._target, v);
            var m = e._onframeCbs;
            if (m)
              for (var g = 0; g < m.length; g++)
                m[g](e._target, v);
          },
          ondestroy: function() {
            e._doneCallback();
          }
        });
        this._clip = h, this.animation && this.animation.addClip(h), t && h.setEasing(t);
      } else
        this._doneCallback();
      return this;
    }
  }, r.prototype.stop = function(t) {
    if (this._clip) {
      var e = this._clip;
      t && e.onframe(1), this._abortedCallback();
    }
  }, r.prototype.delay = function(t) {
    return this._delay = t, this;
  }, r.prototype.during = function(t) {
    return t && (this._onframeCbs || (this._onframeCbs = []), this._onframeCbs.push(t)), this;
  }, r.prototype.done = function(t) {
    return t && (this._doneCbs || (this._doneCbs = []), this._doneCbs.push(t)), this;
  }, r.prototype.aborted = function(t) {
    return t && (this._abortedCbs || (this._abortedCbs = []), this._abortedCbs.push(t)), this;
  }, r.prototype.getClip = function() {
    return this._clip;
  }, r.prototype.getTrack = function(t) {
    return this._tracks[t];
  }, r.prototype.getTracks = function() {
    var t = this;
    return U(this._trackKeys, function(e) {
      return t._tracks[e];
    });
  }, r.prototype.stopTracks = function(t, e) {
    if (!t.length || !this._clip)
      return !0;
    for (var n = this._tracks, i = this._trackKeys, a = 0; a < t.length; a++) {
      var o = n[t[a]];
      o && !o.isFinished() && (e ? o.step(this._target, 1) : this._started === 1 && o.step(this._target, 0), o.setFinished());
    }
    for (var s = !0, a = 0; a < i.length; a++)
      if (!n[i[a]].isFinished()) {
        s = !1;
        break;
      }
    return s && this._abortedCallback(), s;
  }, r.prototype.saveTo = function(t, e, n) {
    if (t) {
      e = e || this._trackKeys;
      for (var i = 0; i < e.length; i++) {
        var a = e[i], o = this._tracks[a];
        if (!(!o || o.isFinished())) {
          var s = o.keyframes, l = s[n ? 0 : s.length - 1];
          l && (t[a] = Wl(l.rawValue));
        }
      }
    }
  }, r.prototype.__changeFinalValue = function(t, e) {
    e = e || Ee(t);
    for (var n = 0; n < e.length; n++) {
      var i = e[n], a = this._tracks[i];
      if (a) {
        var o = a.keyframes;
        if (o.length > 1) {
          var s = o.pop();
          a.addKeyframe(s.time, t[i]), a.prepare(this._maxTime, a.getAdditiveTrack());
        }
      }
    }
  }, r;
}();
function as() {
  return (/* @__PURE__ */ new Date()).getTime();
}
var _B = function(r) {
  N(t, r);
  function t(e) {
    var n = r.call(this) || this;
    return n._running = !1, n._time = 0, n._pausedTime = 0, n._pauseStart = 0, n._paused = !1, e = e || {}, n.stage = e.stage || {}, n;
  }
  return t.prototype.addClip = function(e) {
    e.animation && this.removeClip(e), this._head ? (this._tail.next = e, e.prev = this._tail, e.next = null, this._tail = e) : this._head = this._tail = e, e.animation = this;
  }, t.prototype.addAnimator = function(e) {
    e.animation = this;
    var n = e.getClip();
    n && this.addClip(n);
  }, t.prototype.removeClip = function(e) {
    if (e.animation) {
      var n = e.prev, i = e.next;
      n ? n.next = i : this._head = i, i ? i.prev = n : this._tail = n, e.next = e.prev = e.animation = null;
    }
  }, t.prototype.removeAnimator = function(e) {
    var n = e.getClip();
    n && this.removeClip(n), e.animation = null;
  }, t.prototype.update = function(e) {
    for (var n = as() - this._pausedTime, i = n - this._time, a = this._head; a; ) {
      var o = a.next, s = a.step(n, i);
      s && (a.ondestroy(), this.removeClip(a)), a = o;
    }
    this._time = n, e || (this.trigger("frame", i), this.stage.update && this.stage.update());
  }, t.prototype._startLoop = function() {
    var e = this;
    this._running = !0;
    function n() {
      e._running && (Kf(n), !e._paused && e.update());
    }
    Kf(n);
  }, t.prototype.start = function() {
    this._running || (this._time = as(), this._pausedTime = 0, this._startLoop());
  }, t.prototype.stop = function() {
    this._running = !1;
  }, t.prototype.pause = function() {
    this._paused || (this._pauseStart = as(), this._paused = !0);
  }, t.prototype.resume = function() {
    this._paused && (this._pausedTime += as() - this._pauseStart, this._paused = !1);
  }, t.prototype.clear = function() {
    for (var e = this._head; e; ) {
      var n = e.next;
      e.prev = e.next = e.animation = null, e = n;
    }
    this._head = this._tail = null;
  }, t.prototype.isFinished = function() {
    return this._head == null;
  }, t.prototype.animate = function(e, n) {
    n = n || {}, this.start();
    var i = new r0(e, n.loop);
    return this.addAnimator(i), i;
  }, t;
}(Wr), bB = 300, ud = Ie.domSupported, cd = function() {
  var r = [
    "click",
    "dblclick",
    "mousewheel",
    "wheel",
    "mouseout",
    "mouseup",
    "mousedown",
    "mousemove",
    "contextmenu"
  ], t = [
    "touchstart",
    "touchend",
    "touchmove"
  ], e = {
    pointerdown: 1,
    pointerup: 1,
    pointermove: 1,
    pointerout: 1
  }, n = U(r, function(i) {
    var a = i.replace("mouse", "pointer");
    return e.hasOwnProperty(a) ? a : i;
  });
  return {
    mouse: r,
    touch: t,
    pointer: n
  };
}(), wb = {
  mouse: ["mousemove", "mouseup"],
  pointer: ["pointermove", "pointerup"]
}, Cb = !1;
function Qg(r) {
  var t = r.pointerType;
  return t === "pen" || t === "touch";
}
function SB(r) {
  r.touching = !0, r.touchTimer != null && (clearTimeout(r.touchTimer), r.touchTimer = null), r.touchTimer = setTimeout(function() {
    r.touching = !1, r.touchTimer = null;
  }, 700);
}
function fd(r) {
  r && (r.zrByTouch = !0);
}
function xB(r, t) {
  return Rr(r.dom, new wB(r, t), !0);
}
function xT(r, t) {
  for (var e = t, n = !1; e && e.nodeType !== 9 && !(n = e.domBelongToZr || e !== t && e === r.painterRoot); )
    e = e.parentNode;
  return n;
}
var wB = /* @__PURE__ */ function() {
  function r(t, e) {
    this.stopPropagation = dt, this.stopImmediatePropagation = dt, this.preventDefault = dt, this.type = e.type, this.target = this.currentTarget = t.dom, this.pointerType = e.pointerType, this.clientX = e.clientX, this.clientY = e.clientY;
  }
  return r;
}(), Jr = {
  mousedown: function(r) {
    r = Rr(this.dom, r), this.__mayPointerCapture = [r.zrX, r.zrY], this.trigger("mousedown", r);
  },
  mousemove: function(r) {
    r = Rr(this.dom, r);
    var t = this.__mayPointerCapture;
    t && (r.zrX !== t[0] || r.zrY !== t[1]) && this.__togglePointerCapture(!0), this.trigger("mousemove", r);
  },
  mouseup: function(r) {
    r = Rr(this.dom, r), this.__togglePointerCapture(!1), this.trigger("mouseup", r);
  },
  mouseout: function(r) {
    r = Rr(this.dom, r);
    var t = r.toElement || r.relatedTarget;
    xT(this, t) || (this.__pointerCapturing && (r.zrEventControl = "no_globalout"), this.trigger("mouseout", r));
  },
  wheel: function(r) {
    Cb = !0, r = Rr(this.dom, r), this.trigger("mousewheel", r);
  },
  mousewheel: function(r) {
    Cb || (r = Rr(this.dom, r), this.trigger("mousewheel", r));
  },
  touchstart: function(r) {
    r = Rr(this.dom, r), fd(r), this.__lastTouchMoment = /* @__PURE__ */ new Date(), this.handler.processGesture(r, "start"), Jr.mousemove.call(this, r), Jr.mousedown.call(this, r);
  },
  touchmove: function(r) {
    r = Rr(this.dom, r), fd(r), this.handler.processGesture(r, "change"), Jr.mousemove.call(this, r);
  },
  touchend: function(r) {
    r = Rr(this.dom, r), fd(r), this.handler.processGesture(r, "end"), Jr.mouseup.call(this, r), +/* @__PURE__ */ new Date() - +this.__lastTouchMoment < bB && Jr.click.call(this, r);
  },
  pointerdown: function(r) {
    Jr.mousedown.call(this, r);
  },
  pointermove: function(r) {
    Qg(r) || Jr.mousemove.call(this, r);
  },
  pointerup: function(r) {
    Jr.mouseup.call(this, r);
  },
  pointerout: function(r) {
    Qg(r) || Jr.mouseout.call(this, r);
  }
};
M(["click", "dblclick", "contextmenu"], function(r) {
  Jr[r] = function(t) {
    t = Rr(this.dom, t), this.trigger(r, t);
  };
});
var em = {
  pointermove: function(r) {
    Qg(r) || em.mousemove.call(this, r);
  },
  pointerup: function(r) {
    em.mouseup.call(this, r);
  },
  mousemove: function(r) {
    this.trigger("mousemove", r);
  },
  mouseup: function(r) {
    var t = this.__pointerCapturing;
    this.__togglePointerCapture(!1), this.trigger("mouseup", r), t && (r.zrEventControl = "only_globalout", this.trigger("mouseout", r));
  }
};
function CB(r, t) {
  var e = t.domHandlers;
  Ie.pointerEventsSupported ? M(cd.pointer, function(n) {
    Mf(t, n, function(i) {
      e[n].call(r, i);
    });
  }) : (Ie.touchEventsSupported && M(cd.touch, function(n) {
    Mf(t, n, function(i) {
      e[n].call(r, i), SB(t);
    });
  }), M(cd.mouse, function(n) {
    Mf(t, n, function(i) {
      i = Ky(i), t.touching || e[n].call(r, i);
    });
  }));
}
function AB(r, t) {
  Ie.pointerEventsSupported ? M(wb.pointer, e) : Ie.touchEventsSupported || M(wb.mouse, e);
  function e(n) {
    function i(a) {
      a = Ky(a), xT(r, a.target) || (a = xB(r, a), t.domHandlers[n].call(r, a));
    }
    Mf(t, n, i, { capture: !0 });
  }
}
function Mf(r, t, e, n) {
  r.mounted[t] = e, r.listenerOpts[t] = n, Hg(r.domTarget, t, e, n);
}
function hd(r) {
  var t = r.mounted;
  for (var e in t)
    t.hasOwnProperty(e) && z3(r.domTarget, e, t[e], r.listenerOpts[e]);
  r.mounted = {};
}
var Ab = /* @__PURE__ */ function() {
  function r(t, e) {
    this.mounted = {}, this.listenerOpts = {}, this.touching = !1, this.domTarget = t, this.domHandlers = e;
  }
  return r;
}(), DB = function(r) {
  N(t, r);
  function t(e, n) {
    var i = r.call(this) || this;
    return i.__pointerCapturing = !1, i.dom = e, i.painterRoot = n, i._localHandlerScope = new Ab(e, Jr), ud && (i._globalHandlerScope = new Ab(document, em)), CB(i, i._localHandlerScope), i;
  }
  return t.prototype.dispose = function() {
    hd(this._localHandlerScope), ud && hd(this._globalHandlerScope);
  }, t.prototype.setCursor = function(e) {
    this.dom.style && (this.dom.style.cursor = e || "default");
  }, t.prototype.__togglePointerCapture = function(e) {
    if (this.__mayPointerCapture = null, ud && +this.__pointerCapturing ^ +e) {
      this.__pointerCapturing = e;
      var n = this._globalHandlerScope;
      e ? AB(this, n) : hd(n);
    }
  }, t;
}(Wr), wT = 1;
Ie.hasGlobalWindow && (wT = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1));
var nh = wT, tm = 0.4, rm = "#333", nm = "#ccc", TB = "#eee", Db = rv, Tb = 5e-5;
function da(r) {
  return r > Tb || r < -Tb;
}
var pa = [], ko = [], vd = Cr(), dd = Math.abs, Kn = function() {
  function r() {
  }
  return r.prototype.getLocalTransform = function(t) {
    return r.getLocalTransform(this, t);
  }, r.prototype.setPosition = function(t) {
    this.x = t[0], this.y = t[1];
  }, r.prototype.setScale = function(t) {
    this.scaleX = t[0], this.scaleY = t[1];
  }, r.prototype.setSkew = function(t) {
    this.skewX = t[0], this.skewY = t[1];
  }, r.prototype.setOrigin = function(t) {
    this.originX = t[0], this.originY = t[1];
  }, r.prototype.needLocalTransform = function() {
    return da(this.rotation) || da(this.x) || da(this.y) || da(this.scaleX - 1) || da(this.scaleY - 1) || da(this.skewX) || da(this.skewY);
  }, r.prototype.updateTransform = function() {
    var t = this.parent && this.parent.transform, e = this.needLocalTransform(), n = this.transform;
    if (!(e || t)) {
      n && (Db(n), this.invTransform = null);
      return;
    }
    n = n || Cr(), e ? this.getLocalTransform(n) : Db(n), t && (e ? ei(n, t, n) : Jy(n, t)), this.transform = n, this._resolveGlobalScaleRatio(n);
  }, r.prototype._resolveGlobalScaleRatio = function(t) {
    var e = this.globalScaleRatio;
    if (e != null && e !== 1) {
      this.getGlobalScale(pa);
      var n = pa[0] < 0 ? -1 : 1, i = pa[1] < 0 ? -1 : 1, a = ((pa[0] - n) * e + n) / pa[0] || 0, o = ((pa[1] - i) * e + i) / pa[1] || 0;
      t[0] *= a, t[1] *= a, t[2] *= o, t[3] *= o;
    }
    this.invTransform = this.invTransform || Cr(), Ls(this.invTransform, t);
  }, r.prototype.getComputedTransform = function() {
    for (var t = this, e = []; t; )
      e.push(t), t = t.parent;
    for (; t = e.pop(); )
      t.updateTransform();
    return this.transform;
  }, r.prototype.setLocalTransform = function(t) {
    if (t) {
      var e = t[0] * t[0] + t[1] * t[1], n = t[2] * t[2] + t[3] * t[3], i = Math.atan2(t[1], t[0]), a = Math.PI / 2 + i - Math.atan2(t[3], t[2]);
      n = Math.sqrt(n) * Math.cos(a), e = Math.sqrt(e), this.skewX = a, this.skewY = 0, this.rotation = -i, this.x = +t[4], this.y = +t[5], this.scaleX = e, this.scaleY = n, this.originX = 0, this.originY = 0;
    }
  }, r.prototype.decomposeTransform = function() {
    if (this.transform) {
      var t = this.parent, e = this.transform;
      t && t.transform && (t.invTransform = t.invTransform || Cr(), ei(ko, t.invTransform, e), e = ko);
      var n = this.originX, i = this.originY;
      (n || i) && (vd[4] = n, vd[5] = i, ei(ko, e, vd), ko[4] -= n, ko[5] -= i, e = ko), this.setLocalTransform(e);
    }
  }, r.prototype.getGlobalScale = function(t) {
    var e = this.transform;
    return t = t || [], e ? (t[0] = Math.sqrt(e[0] * e[0] + e[1] * e[1]), t[1] = Math.sqrt(e[2] * e[2] + e[3] * e[3]), e[0] < 0 && (t[0] = -t[0]), e[3] < 0 && (t[1] = -t[1]), t) : (t[0] = 1, t[1] = 1, t);
  }, r.prototype.transformCoordToLocal = function(t, e) {
    var n = [t, e], i = this.invTransform;
    return i && Rt(n, n, i), n;
  }, r.prototype.transformCoordToGlobal = function(t, e) {
    var n = [t, e], i = this.transform;
    return i && Rt(n, n, i), n;
  }, r.prototype.getLineScale = function() {
    var t = this.transform;
    return t && dd(t[0] - 1) > 1e-10 && dd(t[3] - 1) > 1e-10 ? Math.sqrt(dd(t[0] * t[3] - t[2] * t[1])) : 1;
  }, r.prototype.copyTransform = function(t) {
    CT(this, t);
  }, r.getLocalTransform = function(t, e) {
    e = e || [];
    var n = t.originX || 0, i = t.originY || 0, a = t.scaleX, o = t.scaleY, s = t.anchorX, l = t.anchorY, u = t.rotation || 0, c = t.x, f = t.y, h = t.skewX ? Math.tan(t.skewX) : 0, v = t.skewY ? Math.tan(-t.skewY) : 0;
    if (n || i || s || l) {
      var d = n + s, p = i + l;
      e[4] = -d * a - h * p * o, e[5] = -p * o - v * d * a;
    } else
      e[4] = e[5] = 0;
    return e[0] = a, e[3] = o, e[1] = v * a, e[2] = h * o, u && So(e, e, u), e[4] += n + c, e[5] += i + f, e;
  }, r.initDefaultProps = function() {
    var t = r.prototype;
    t.scaleX = t.scaleY = t.globalScaleRatio = 1, t.x = t.y = t.originX = t.originY = t.skewX = t.skewY = t.rotation = t.anchorX = t.anchorY = 0;
  }(), r;
}(), On = [
  "x",
  "y",
  "originX",
  "originY",
  "anchorX",
  "anchorY",
  "rotation",
  "scaleX",
  "scaleY",
  "skewX",
  "skewY"
];
function CT(r, t) {
  for (var e = 0; e < On.length; e++) {
    var n = On[e];
    r[n] = t[n];
  }
}
var Mb = {};
function Dr(r, t) {
  t = t || Xi;
  var e = Mb[t];
  e || (e = Mb[t] = new zu(500));
  var n = e.get(r);
  return n == null && (n = ji.measureText(r, t).width, e.put(r, n)), n;
}
function Ib(r, t, e, n) {
  var i = Dr(r, t), a = iv(t), o = Ll(0, i, e), s = ts(0, a, n), l = new xe(o, s, i, a);
  return l;
}
function Vu(r, t, e, n) {
  var i = ((r || "") + "").split(`
`), a = i.length;
  if (a === 1)
    return Ib(i[0], t, e, n);
  for (var o = new xe(0, 0, 0, 0), s = 0; s < i.length; s++) {
    var l = Ib(i[s], t, e, n);
    s === 0 ? o.copy(l) : o.union(l);
  }
  return o;
}
function Ll(r, t, e) {
  return e === "right" ? r -= t : e === "center" && (r -= t / 2), r;
}
function ts(r, t, e) {
  return e === "middle" ? r -= t / 2 : e === "bottom" && (r -= t), r;
}
function iv(r) {
  return Dr("国", r);
}
function ln(r, t) {
  return typeof r == "string" ? r.lastIndexOf("%") >= 0 ? parseFloat(r) / 100 * t : parseFloat(r) : r;
}
function ih(r, t, e) {
  var n = t.position || "inside", i = t.distance != null ? t.distance : 5, a = e.height, o = e.width, s = a / 2, l = e.x, u = e.y, c = "left", f = "top";
  if (n instanceof Array)
    l += ln(n[0], e.width), u += ln(n[1], e.height), c = null, f = null;
  else
    switch (n) {
      case "left":
        l -= i, u += s, c = "right", f = "middle";
        break;
      case "right":
        l += i + o, u += s, f = "middle";
        break;
      case "top":
        l += o / 2, u -= i, c = "center", f = "bottom";
        break;
      case "bottom":
        l += o / 2, u += a + i, c = "center";
        break;
      case "inside":
        l += o / 2, u += s, c = "center", f = "middle";
        break;
      case "insideLeft":
        l += i, u += s, f = "middle";
        break;
      case "insideRight":
        l += o - i, u += s, c = "right", f = "middle";
        break;
      case "insideTop":
        l += o / 2, u += i, c = "center";
        break;
      case "insideBottom":
        l += o / 2, u += a - i, c = "center", f = "bottom";
        break;
      case "insideTopLeft":
        l += i, u += i;
        break;
      case "insideTopRight":
        l += o - i, u += i, c = "right";
        break;
      case "insideBottomLeft":
        l += i, u += a - i, f = "bottom";
        break;
      case "insideBottomRight":
        l += o - i, u += a - i, c = "right", f = "bottom";
        break;
    }
  return r = r || {}, r.x = l, r.y = u, r.align = c, r.verticalAlign = f, r;
}
var pd = "__zr_normal__", gd = On.concat(["ignore"]), MB = kn(On, function(r, t) {
  return r[t] = !0, r;
}, { ignore: !1 }), Ro = {}, IB = new xe(0, 0, 0, 0), av = function() {
  function r(t) {
    this.id = JD(), this.animators = [], this.currentStates = [], this.states = {}, this._init(t);
  }
  return r.prototype._init = function(t) {
    this.attr(t);
  }, r.prototype.drift = function(t, e, n) {
    switch (this.draggable) {
      case "horizontal":
        e = 0;
        break;
      case "vertical":
        t = 0;
        break;
    }
    var i = this.transform;
    i || (i = this.transform = [1, 0, 0, 1, 0, 0]), i[4] += t, i[5] += e, this.decomposeTransform(), this.markRedraw();
  }, r.prototype.beforeUpdate = function() {
  }, r.prototype.afterUpdate = function() {
  }, r.prototype.update = function() {
    this.updateTransform(), this.__dirty && this.updateInnerText();
  }, r.prototype.updateInnerText = function(t) {
    var e = this._textContent;
    if (e && (!e.ignore || t)) {
      this.textConfig || (this.textConfig = {});
      var n = this.textConfig, i = n.local, a = e.innerTransformable, o = void 0, s = void 0, l = !1;
      a.parent = i ? this : null;
      var u = !1;
      if (a.copyTransform(e), n.position != null) {
        var c = IB;
        n.layoutRect ? c.copy(n.layoutRect) : c.copy(this.getBoundingRect()), i || c.applyTransform(this.transform), this.calculateTextPosition ? this.calculateTextPosition(Ro, n, c) : ih(Ro, n, c), a.x = Ro.x, a.y = Ro.y, o = Ro.align, s = Ro.verticalAlign;
        var f = n.origin;
        if (f && n.rotation != null) {
          var h = void 0, v = void 0;
          f === "center" ? (h = c.width * 0.5, v = c.height * 0.5) : (h = ln(f[0], c.width), v = ln(f[1], c.height)), u = !0, a.originX = -a.x + h + (i ? 0 : c.x), a.originY = -a.y + v + (i ? 0 : c.y);
        }
      }
      n.rotation != null && (a.rotation = n.rotation);
      var d = n.offset;
      d && (a.x += d[0], a.y += d[1], u || (a.originX = -d[0], a.originY = -d[1]));
      var p = n.inside == null ? typeof n.position == "string" && n.position.indexOf("inside") >= 0 : n.inside, g = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {}), m = void 0, y = void 0, _ = void 0;
      p && this.canBeInsideText() ? (m = n.insideFill, y = n.insideStroke, (m == null || m === "auto") && (m = this.getInsideTextFill()), (y == null || y === "auto") && (y = this.getInsideTextStroke(m), _ = !0)) : (m = n.outsideFill, y = n.outsideStroke, (m == null || m === "auto") && (m = this.getOutsideFill()), (y == null || y === "auto") && (y = this.getOutsideStroke(m), _ = !0)), m = m || "#000", (m !== g.fill || y !== g.stroke || _ !== g.autoStroke || o !== g.align || s !== g.verticalAlign) && (l = !0, g.fill = m, g.stroke = y, g.autoStroke = _, g.align = o, g.verticalAlign = s, e.setDefaultTextStyle(g)), e.__dirty |= br, l && e.dirtyStyle(!0);
    }
  }, r.prototype.canBeInsideText = function() {
    return !0;
  }, r.prototype.getInsideTextFill = function() {
    return "#fff";
  }, r.prototype.getInsideTextStroke = function(t) {
    return "#000";
  }, r.prototype.getOutsideFill = function() {
    return this.__zr && this.__zr.isDarkMode() ? nm : rm;
  }, r.prototype.getOutsideStroke = function(t) {
    var e = this.__zr && this.__zr.getBackgroundColor(), n = typeof e == "string" && Ar(e);
    n || (n = [255, 255, 255, 1]);
    for (var i = n[3], a = this.__zr.isDarkMode(), o = 0; o < 3; o++)
      n[o] = n[o] * i + (a ? 0 : 255) * (1 - i);
    return n[3] = 1, ti(n, "rgba");
  }, r.prototype.traverse = function(t, e) {
  }, r.prototype.attrKV = function(t, e) {
    t === "textConfig" ? this.setTextConfig(e) : t === "textContent" ? this.setTextContent(e) : t === "clipPath" ? this.setClipPath(e) : t === "extra" ? (this.extra = this.extra || {}, H(this.extra, e)) : this[t] = e;
  }, r.prototype.hide = function() {
    this.ignore = !0, this.markRedraw();
  }, r.prototype.show = function() {
    this.ignore = !1, this.markRedraw();
  }, r.prototype.attr = function(t, e) {
    if (typeof t == "string")
      this.attrKV(t, e);
    else if (ue(t))
      for (var n = t, i = Ee(n), a = 0; a < i.length; a++) {
        var o = i[a];
        this.attrKV(o, t[o]);
      }
    return this.markRedraw(), this;
  }, r.prototype.saveCurrentToNormalState = function(t) {
    this._innerSaveToNormal(t);
    for (var e = this._normalState, n = 0; n < this.animators.length; n++) {
      var i = this.animators[n], a = i.__fromStateTransition;
      if (!(i.getLoop() || a && a !== pd)) {
        var o = i.targetName, s = o ? e[o] : e;
        i.saveTo(s);
      }
    }
  }, r.prototype._innerSaveToNormal = function(t) {
    var e = this._normalState;
    e || (e = this._normalState = {}), t.textConfig && !e.textConfig && (e.textConfig = this.textConfig), this._savePrimaryToNormal(t, e, gd);
  }, r.prototype._savePrimaryToNormal = function(t, e, n) {
    for (var i = 0; i < n.length; i++) {
      var a = n[i];
      t[a] != null && !(a in e) && (e[a] = this[a]);
    }
  }, r.prototype.hasState = function() {
    return this.currentStates.length > 0;
  }, r.prototype.getState = function(t) {
    return this.states[t];
  }, r.prototype.ensureState = function(t) {
    var e = this.states;
    return e[t] || (e[t] = {}), e[t];
  }, r.prototype.clearStates = function(t) {
    this.useState(pd, !1, t);
  }, r.prototype.useState = function(t, e, n, i) {
    var a = t === pd, o = this.hasState();
    if (!(!o && a)) {
      var s = this.currentStates, l = this.stateTransition;
      if (!(we(s, t) >= 0 && (e || s.length === 1))) {
        var u;
        if (this.stateProxy && !a && (u = this.stateProxy(t)), u || (u = this.states && this.states[t]), !u && !a) {
          Yy("State " + t + " not exists.");
          return;
        }
        a || this.saveCurrentToNormalState(u);
        var c = !!(u && u.hoverLayer || i);
        c && this._toggleHoverLayerFlag(!0), this._applyStateObj(t, u, this._normalState, e, !n && !this.__inHover && l && l.duration > 0, l);
        var f = this._textContent, h = this._textGuide;
        return f && f.useState(t, e, n, c), h && h.useState(t, e, n, c), a ? (this.currentStates = [], this._normalState = {}) : e ? this.currentStates.push(t) : this.currentStates = [t], this._updateAnimationTargets(), this.markRedraw(), !c && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= ~br), u;
      }
    }
  }, r.prototype.useStates = function(t, e, n) {
    if (!t.length)
      this.clearStates();
    else {
      var i = [], a = this.currentStates, o = t.length, s = o === a.length;
      if (s) {
        for (var l = 0; l < o; l++)
          if (t[l] !== a[l]) {
            s = !1;
            break;
          }
      }
      if (s)
        return;
      for (var l = 0; l < o; l++) {
        var u = t[l], c = void 0;
        this.stateProxy && (c = this.stateProxy(u, t)), c || (c = this.states[u]), c && i.push(c);
      }
      var f = i[o - 1], h = !!(f && f.hoverLayer || n);
      h && this._toggleHoverLayerFlag(!0);
      var v = this._mergeStates(i), d = this.stateTransition;
      this.saveCurrentToNormalState(v), this._applyStateObj(t.join(","), v, this._normalState, !1, !e && !this.__inHover && d && d.duration > 0, d);
      var p = this._textContent, g = this._textGuide;
      p && p.useStates(t, e, h), g && g.useStates(t, e, h), this._updateAnimationTargets(), this.currentStates = t.slice(), this.markRedraw(), !h && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= ~br);
    }
  }, r.prototype.isSilent = function() {
    for (var t = this.silent, e = this.parent; !t && e; ) {
      if (e.silent) {
        t = !0;
        break;
      }
      e = e.parent;
    }
    return t;
  }, r.prototype._updateAnimationTargets = function() {
    for (var t = 0; t < this.animators.length; t++) {
      var e = this.animators[t];
      e.targetName && e.changeTarget(this[e.targetName]);
    }
  }, r.prototype.removeState = function(t) {
    var e = we(this.currentStates, t);
    if (e >= 0) {
      var n = this.currentStates.slice();
      n.splice(e, 1), this.useStates(n);
    }
  }, r.prototype.replaceState = function(t, e, n) {
    var i = this.currentStates.slice(), a = we(i, t), o = we(i, e) >= 0;
    a >= 0 ? o ? i.splice(a, 1) : i[a] = e : n && !o && i.push(e), this.useStates(i);
  }, r.prototype.toggleState = function(t, e) {
    e ? this.useState(t, !0) : this.removeState(t);
  }, r.prototype._mergeStates = function(t) {
    for (var e = {}, n, i = 0; i < t.length; i++) {
      var a = t[i];
      H(e, a), a.textConfig && (n = n || {}, H(n, a.textConfig));
    }
    return n && (e.textConfig = n), e;
  }, r.prototype._applyStateObj = function(t, e, n, i, a, o) {
    var s = !(e && i);
    e && e.textConfig ? (this.textConfig = H({}, i ? this.textConfig : n.textConfig), H(this.textConfig, e.textConfig)) : s && n.textConfig && (this.textConfig = n.textConfig);
    for (var l = {}, u = !1, c = 0; c < gd.length; c++) {
      var f = gd[c], h = a && MB[f];
      e && e[f] != null ? h ? (u = !0, l[f] = e[f]) : this[f] = e[f] : s && n[f] != null && (h ? (u = !0, l[f] = n[f]) : this[f] = n[f]);
    }
    if (!a)
      for (var c = 0; c < this.animators.length; c++) {
        var v = this.animators[c], d = v.targetName;
        v.getLoop() || v.__changeFinalValue(d ? (e || n)[d] : e || n);
      }
    u && this._transitionState(t, l, o);
  }, r.prototype._attachComponent = function(t) {
    if (!(t.__zr && !t.__hostTarget) && t !== this) {
      var e = this.__zr;
      e && t.addSelfToZr(e), t.__zr = e, t.__hostTarget = this;
    }
  }, r.prototype._detachComponent = function(t) {
    t.__zr && t.removeSelfFromZr(t.__zr), t.__zr = null, t.__hostTarget = null;
  }, r.prototype.getClipPath = function() {
    return this._clipPath;
  }, r.prototype.setClipPath = function(t) {
    this._clipPath && this._clipPath !== t && this.removeClipPath(), this._attachComponent(t), this._clipPath = t, this.markRedraw();
  }, r.prototype.removeClipPath = function() {
    var t = this._clipPath;
    t && (this._detachComponent(t), this._clipPath = null, this.markRedraw());
  }, r.prototype.getTextContent = function() {
    return this._textContent;
  }, r.prototype.setTextContent = function(t) {
    var e = this._textContent;
    e !== t && (e && e !== t && this.removeTextContent(), t.innerTransformable = new Kn(), this._attachComponent(t), this._textContent = t, this.markRedraw());
  }, r.prototype.setTextConfig = function(t) {
    this.textConfig || (this.textConfig = {}), H(this.textConfig, t), this.markRedraw();
  }, r.prototype.removeTextConfig = function() {
    this.textConfig = null, this.markRedraw();
  }, r.prototype.removeTextContent = function() {
    var t = this._textContent;
    t && (t.innerTransformable = null, this._detachComponent(t), this._textContent = null, this._innerTextDefaultStyle = null, this.markRedraw());
  }, r.prototype.getTextGuideLine = function() {
    return this._textGuide;
  }, r.prototype.setTextGuideLine = function(t) {
    this._textGuide && this._textGuide !== t && this.removeTextGuideLine(), this._attachComponent(t), this._textGuide = t, this.markRedraw();
  }, r.prototype.removeTextGuideLine = function() {
    var t = this._textGuide;
    t && (this._detachComponent(t), this._textGuide = null, this.markRedraw());
  }, r.prototype.markRedraw = function() {
    this.__dirty |= br;
    var t = this.__zr;
    t && (this.__inHover ? t.refreshHover() : t.refresh()), this.__hostTarget && this.__hostTarget.markRedraw();
  }, r.prototype.dirty = function() {
    this.markRedraw();
  }, r.prototype._toggleHoverLayerFlag = function(t) {
    this.__inHover = t;
    var e = this._textContent, n = this._textGuide;
    e && (e.__inHover = t), n && (n.__inHover = t);
  }, r.prototype.addSelfToZr = function(t) {
    if (this.__zr !== t) {
      this.__zr = t;
      var e = this.animators;
      if (e)
        for (var n = 0; n < e.length; n++)
          t.animation.addAnimator(e[n]);
      this._clipPath && this._clipPath.addSelfToZr(t), this._textContent && this._textContent.addSelfToZr(t), this._textGuide && this._textGuide.addSelfToZr(t);
    }
  }, r.prototype.removeSelfFromZr = function(t) {
    if (this.__zr) {
      this.__zr = null;
      var e = this.animators;
      if (e)
        for (var n = 0; n < e.length; n++)
          t.animation.removeAnimator(e[n]);
      this._clipPath && this._clipPath.removeSelfFromZr(t), this._textContent && this._textContent.removeSelfFromZr(t), this._textGuide && this._textGuide.removeSelfFromZr(t);
    }
  }, r.prototype.animate = function(t, e, n) {
    var i = t ? this[t] : this, a = new r0(i, e, n);
    return t && (a.targetName = t), this.addAnimator(a, t), a;
  }, r.prototype.addAnimator = function(t, e) {
    var n = this.__zr, i = this;
    t.during(function() {
      i.updateDuringAnimation(e);
    }).done(function() {
      var a = i.animators, o = we(a, t);
      o >= 0 && a.splice(o, 1);
    }), this.animators.push(t), n && n.animation.addAnimator(t), n && n.wakeUp();
  }, r.prototype.updateDuringAnimation = function(t) {
    this.markRedraw();
  }, r.prototype.stopAnimation = function(t, e) {
    for (var n = this.animators, i = n.length, a = [], o = 0; o < i; o++) {
      var s = n[o];
      !t || t === s.scope ? s.stop(e) : a.push(s);
    }
    return this.animators = a, this;
  }, r.prototype.animateTo = function(t, e, n) {
    md(this, t, e, n);
  }, r.prototype.animateFrom = function(t, e, n) {
    md(this, t, e, n, !0);
  }, r.prototype._transitionState = function(t, e, n, i) {
    for (var a = md(this, e, n, i), o = 0; o < a.length; o++)
      a[o].__fromStateTransition = t;
  }, r.prototype.getBoundingRect = function() {
    return null;
  }, r.prototype.getPaintRect = function() {
    return null;
  }, r.initDefaultProps = function() {
    var t = r.prototype;
    t.type = "element", t.name = "", t.ignore = t.silent = t.isGroup = t.draggable = t.dragging = t.ignoreClip = t.__inHover = !1, t.__dirty = br;
    function e(n, i, a, o) {
      Object.defineProperty(t, n, {
        get: function() {
          if (!this[i]) {
            var l = this[i] = [];
            s(this, l);
          }
          return this[i];
        },
        set: function(l) {
          this[a] = l[0], this[o] = l[1], this[i] = l, s(this, l);
        }
      });
      function s(l, u) {
        Object.defineProperty(u, 0, {
          get: function() {
            return l[a];
          },
          set: function(c) {
            l[a] = c;
          }
        }), Object.defineProperty(u, 1, {
          get: function() {
            return l[o];
          },
          set: function(c) {
            l[o] = c;
          }
        });
      }
    }
    Object.defineProperty && (e("position", "_legacyPos", "x", "y"), e("scale", "_legacyScale", "scaleX", "scaleY"), e("origin", "_legacyOrigin", "originX", "originY"));
  }(), r;
}();
_t(av, Wr);
_t(av, Kn);
function md(r, t, e, n, i) {
  e = e || {};
  var a = [];
  AT(r, "", r, t, e, n, a, i);
  var o = a.length, s = !1, l = e.done, u = e.aborted, c = function() {
    s = !0, o--, o <= 0 && (s ? l && l() : u && u());
  }, f = function() {
    o--, o <= 0 && (s ? l && l() : u && u());
  };
  o || l && l(), a.length > 0 && e.during && a[0].during(function(d, p) {
    e.during(p);
  });
  for (var h = 0; h < a.length; h++) {
    var v = a[h];
    c && v.done(c), f && v.aborted(f), e.force && v.duration(e.duration), v.start(e.easing);
  }
  return a;
}
function yd(r, t, e) {
  for (var n = 0; n < e; n++)
    r[n] = t[n];
}
function LB(r) {
  return qt(r[0]);
}
function EB(r, t, e) {
  if (qt(t[e]))
    if (qt(r[e]) || (r[e] = []), gr(t[e])) {
      var n = t[e].length;
      r[e].length !== n && (r[e] = new t[e].constructor(n), yd(r[e], t[e], n));
    } else {
      var i = t[e], a = r[e], o = i.length;
      if (LB(i))
        for (var s = i[0].length, l = 0; l < o; l++)
          a[l] ? yd(a[l], i[l], s) : a[l] = Array.prototype.slice.call(i[l]);
      else
        yd(a, i, o);
      a.length = i.length;
    }
  else
    r[e] = t[e];
}
function PB(r, t) {
  return r === t || qt(r) && qt(t) && kB(r, t);
}
function kB(r, t) {
  var e = r.length;
  if (e !== t.length)
    return !1;
  for (var n = 0; n < e; n++)
    if (r[n] !== t[n])
      return !1;
  return !0;
}
function AT(r, t, e, n, i, a, o, s) {
  for (var l = Ee(n), u = i.duration, c = i.delay, f = i.additive, h = i.setToFinal, v = !ue(a), d = r.animators, p = [], g = 0; g < l.length; g++) {
    var m = l[g], y = n[m];
    if (y != null && e[m] != null && (v || a[m]))
      if (ue(y) && !qt(y) && !ev(y)) {
        if (t) {
          s || (e[m] = y, r.updateDuringAnimation(t));
          continue;
        }
        AT(r, m, e[m], y, i, a && a[m], o, s);
      } else
        p.push(m);
    else s || (e[m] = y, r.updateDuringAnimation(t), p.push(m));
  }
  var _ = p.length;
  if (!f && _)
    for (var b = 0; b < d.length; b++) {
      var S = d[b];
      if (S.targetName === t) {
        var x = S.stopTracks(p);
        if (x) {
          var w = we(d, S);
          d.splice(w, 1);
        }
      }
    }
  if (i.force || (p = qe(p, function(T) {
    return !PB(n[T], e[T]);
  }), _ = p.length), _ > 0 || i.force && !o.length) {
    var C = void 0, D = void 0, A = void 0;
    if (s) {
      D = {}, h && (C = {});
      for (var b = 0; b < _; b++) {
        var m = p[b];
        D[m] = e[m], h ? C[m] = n[m] : e[m] = n[m];
      }
    } else if (h) {
      A = {};
      for (var b = 0; b < _; b++) {
        var m = p[b];
        A[m] = Wl(e[m]), EB(e, n, m);
      }
    }
    var S = new r0(e, !1, !1, f ? qe(d, function(L) {
      return L.targetName === t;
    }) : null);
    S.targetName = t, i.scope && (S.scope = i.scope), h && C && S.whenWithKeys(0, C, p), A && S.whenWithKeys(0, A, p), S.whenWithKeys(u ?? 500, s ? D : n, p).delay(c || 0), r.addAnimator(S, t), o.push(S);
  }
}
var fe = function(r) {
  N(t, r);
  function t(e) {
    var n = r.call(this) || this;
    return n.isGroup = !0, n._children = [], n.attr(e), n;
  }
  return t.prototype.childrenRef = function() {
    return this._children;
  }, t.prototype.children = function() {
    return this._children.slice();
  }, t.prototype.childAt = function(e) {
    return this._children[e];
  }, t.prototype.childOfName = function(e) {
    for (var n = this._children, i = 0; i < n.length; i++)
      if (n[i].name === e)
        return n[i];
  }, t.prototype.childCount = function() {
    return this._children.length;
  }, t.prototype.add = function(e) {
    return e && e !== this && e.parent !== this && (this._children.push(e), this._doAdd(e)), this;
  }, t.prototype.addBefore = function(e, n) {
    if (e && e !== this && e.parent !== this && n && n.parent === this) {
      var i = this._children, a = i.indexOf(n);
      a >= 0 && (i.splice(a, 0, e), this._doAdd(e));
    }
    return this;
  }, t.prototype.replace = function(e, n) {
    var i = we(this._children, e);
    return i >= 0 && this.replaceAt(n, i), this;
  }, t.prototype.replaceAt = function(e, n) {
    var i = this._children, a = i[n];
    if (e && e !== this && e.parent !== this && e !== a) {
      i[n] = e, a.parent = null;
      var o = this.__zr;
      o && a.removeSelfFromZr(o), this._doAdd(e);
    }
    return this;
  }, t.prototype._doAdd = function(e) {
    e.parent && e.parent.remove(e), e.parent = this;
    var n = this.__zr;
    n && n !== e.__zr && e.addSelfToZr(n), n && n.refresh();
  }, t.prototype.remove = function(e) {
    var n = this.__zr, i = this._children, a = we(i, e);
    return a < 0 ? this : (i.splice(a, 1), e.parent = null, n && e.removeSelfFromZr(n), n && n.refresh(), this);
  }, t.prototype.removeAll = function() {
    for (var e = this._children, n = this.__zr, i = 0; i < e.length; i++) {
      var a = e[i];
      n && a.removeSelfFromZr(n), a.parent = null;
    }
    return e.length = 0, this;
  }, t.prototype.eachChild = function(e, n) {
    for (var i = this._children, a = 0; a < i.length; a++) {
      var o = i[a];
      e.call(n, o, a);
    }
    return this;
  }, t.prototype.traverse = function(e, n) {
    for (var i = 0; i < this._children.length; i++) {
      var a = this._children[i], o = e.call(n, a);
      a.isGroup && !o && a.traverse(e, n);
    }
    return this;
  }, t.prototype.addSelfToZr = function(e) {
    r.prototype.addSelfToZr.call(this, e);
    for (var n = 0; n < this._children.length; n++) {
      var i = this._children[n];
      i.addSelfToZr(e);
    }
  }, t.prototype.removeSelfFromZr = function(e) {
    r.prototype.removeSelfFromZr.call(this, e);
    for (var n = 0; n < this._children.length; n++) {
      var i = this._children[n];
      i.removeSelfFromZr(e);
    }
  }, t.prototype.getBoundingRect = function(e) {
    for (var n = new xe(0, 0, 0, 0), i = e || this._children, a = [], o = null, s = 0; s < i.length; s++) {
      var l = i[s];
      if (!(l.ignore || l.invisible)) {
        var u = l.getBoundingRect(), c = l.getLocalTransform(a);
        c ? (xe.applyTransform(n, u, c), o = o || n.clone(), o.union(n)) : (o = o || u.clone(), o.union(u));
      }
    }
    return o || n;
  }, t;
}(av);
fe.prototype.type = "group";
/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/
var If = {}, DT = {};
function RB(r) {
  delete DT[r];
}
function OB(r) {
  if (!r)
    return !1;
  if (typeof r == "string")
    return th(r, 1) < tm;
  if (r.colorStops) {
    for (var t = r.colorStops, e = 0, n = t.length, i = 0; i < n; i++)
      e += th(t[i].color, 1);
    return e /= n, e < tm;
  }
  return !1;
}
var FB = function() {
  function r(t, e, n) {
    var i = this;
    this._sleepAfterStill = 10, this._stillFrameAccum = 0, this._needsRefresh = !0, this._needsRefreshHover = !0, this._darkMode = !1, n = n || {}, this.dom = e, this.id = t;
    var a = new K3(), o = n.renderer || "canvas";
    If[o] || (o = Ee(If)[0]), n.useDirtyRect = n.useDirtyRect == null ? !1 : n.useDirtyRect;
    var s = new If[o](e, a, n, t), l = n.ssr || s.ssrOnly;
    this.storage = a, this.painter = s;
    var u = !Ie.node && !Ie.worker && !l ? new DB(s.getViewportRoot(), s.root) : null, c = n.useCoarsePointer, f = c == null || c === "auto" ? Ie.touchEventsSupported : !!c, h = 44, v;
    f && (v = me(n.pointerSize, h)), this.handler = new iT(a, s, u, s.root, v), this.animation = new _B({
      stage: {
        update: l ? null : function() {
          return i._flush(!0);
        }
      }
    }), l || this.animation.start();
  }
  return r.prototype.add = function(t) {
    this._disposed || !t || (this.storage.addRoot(t), t.addSelfToZr(this), this.refresh());
  }, r.prototype.remove = function(t) {
    this._disposed || !t || (this.storage.delRoot(t), t.removeSelfFromZr(this), this.refresh());
  }, r.prototype.configLayer = function(t, e) {
    this._disposed || (this.painter.configLayer && this.painter.configLayer(t, e), this.refresh());
  }, r.prototype.setBackgroundColor = function(t) {
    this._disposed || (this.painter.setBackgroundColor && this.painter.setBackgroundColor(t), this.refresh(), this._backgroundColor = t, this._darkMode = OB(t));
  }, r.prototype.getBackgroundColor = function() {
    return this._backgroundColor;
  }, r.prototype.setDarkMode = function(t) {
    this._darkMode = t;
  }, r.prototype.isDarkMode = function() {
    return this._darkMode;
  }, r.prototype.refreshImmediately = function(t) {
    this._disposed || (t || this.animation.update(!0), this._needsRefresh = !1, this.painter.refresh(), this._needsRefresh = !1);
  }, r.prototype.refresh = function() {
    this._disposed || (this._needsRefresh = !0, this.animation.start());
  }, r.prototype.flush = function() {
    this._disposed || this._flush(!1);
  }, r.prototype._flush = function(t) {
    var e, n = as();
    this._needsRefresh && (e = !0, this.refreshImmediately(t)), this._needsRefreshHover && (e = !0, this.refreshHoverImmediately());
    var i = as();
    e ? (this._stillFrameAccum = 0, this.trigger("rendered", {
      elapsedTime: i - n
    })) : this._sleepAfterStill > 0 && (this._stillFrameAccum++, this._stillFrameAccum > this._sleepAfterStill && this.animation.stop());
  }, r.prototype.setSleepAfterStill = function(t) {
    this._sleepAfterStill = t;
  }, r.prototype.wakeUp = function() {
    this._disposed || (this.animation.start(), this._stillFrameAccum = 0);
  }, r.prototype.refreshHover = function() {
    this._needsRefreshHover = !0;
  }, r.prototype.refreshHoverImmediately = function() {
    this._disposed || (this._needsRefreshHover = !1, this.painter.refreshHover && this.painter.getType() === "canvas" && this.painter.refreshHover());
  }, r.prototype.resize = function(t) {
    this._disposed || (t = t || {}, this.painter.resize(t.width, t.height), this.handler.resize());
  }, r.prototype.clearAnimation = function() {
    this._disposed || this.animation.clear();
  }, r.prototype.getWidth = function() {
    if (!this._disposed)
      return this.painter.getWidth();
  }, r.prototype.getHeight = function() {
    if (!this._disposed)
      return this.painter.getHeight();
  }, r.prototype.setCursorStyle = function(t) {
    this._disposed || this.handler.setCursorStyle(t);
  }, r.prototype.findHover = function(t, e) {
    if (!this._disposed)
      return this.handler.findHover(t, e);
  }, r.prototype.on = function(t, e, n) {
    return this._disposed || this.handler.on(t, e, n), this;
  }, r.prototype.off = function(t, e) {
    this._disposed || this.handler.off(t, e);
  }, r.prototype.trigger = function(t, e) {
    this._disposed || this.handler.trigger(t, e);
  }, r.prototype.clear = function() {
    if (!this._disposed) {
      for (var t = this.storage.getRoots(), e = 0; e < t.length; e++)
        t[e] instanceof fe && t[e].removeSelfFromZr(this);
      this.storage.delAllRoots(), this.painter.clear();
    }
  }, r.prototype.dispose = function() {
    this._disposed || (this.animation.stop(), this.clear(), this.storage.dispose(), this.painter.dispose(), this.handler.dispose(), this.animation = this.storage = this.painter = this.handler = null, this._disposed = !0, RB(this.id));
  }, r;
}();
function Lb(r, t) {
  var e = new FB(JD(), r, t);
  return DT[e.id] = e, e;
}
function BB(r, t) {
  If[r] = t;
}
var im;
function NB(r) {
  if (typeof im == "function")
    return im(r);
}
function zB(r) {
  im = r;
}
var Eb = 1e-4, TT = 20;
function VB(r) {
  return r.replace(/^\s+|\s+$/g, "");
}
function Ye(r, t, e, n) {
  var i = t[0], a = t[1], o = e[0], s = e[1], l = a - i, u = s - o;
  if (l === 0)
    return u === 0 ? o : (o + s) / 2;
  if (n)
    if (l > 0) {
      if (r <= i)
        return o;
      if (r >= a)
        return s;
    } else {
      if (r >= i)
        return o;
      if (r <= a)
        return s;
    }
  else {
    if (r === i)
      return o;
    if (r === a)
      return s;
  }
  return (r - i) / l * u + o;
}
function X(r, t) {
  switch (r) {
    case "center":
    case "middle":
      r = "50%";
      break;
    case "left":
    case "top":
      r = "0%";
      break;
    case "right":
    case "bottom":
      r = "100%";
      break;
  }
  return J(r) ? VB(r).match(/%$/) ? parseFloat(r) / 100 * t : parseFloat(r) : r == null ? NaN : +r;
}
function ht(r, t, e) {
  return t == null && (t = 10), t = Math.min(Math.max(0, t), TT), r = (+r).toFixed(t), e ? r : +r;
}
function Gr(r) {
  return r.sort(function(t, e) {
    return t - e;
  }), r;
}
function Dn(r) {
  if (r = +r, isNaN(r))
    return 0;
  if (r > 1e-14) {
    for (var t = 1, e = 0; e < 15; e++, t *= 10)
      if (Math.round(r * t) / t === r)
        return e;
  }
  return $B(r);
}
function $B(r) {
  var t = r.toString().toLowerCase(), e = t.indexOf("e"), n = e > 0 ? +t.slice(e + 1) : 0, i = e > 0 ? e : t.length, a = t.indexOf("."), o = a < 0 ? 0 : i - 1 - a;
  return Math.max(0, o - n);
}
function MT(r, t) {
  var e = Math.log, n = Math.LN10, i = Math.floor(e(r[1] - r[0]) / n), a = Math.round(e(Math.abs(t[1] - t[0])) / n), o = Math.min(Math.max(-i + a, 0), 20);
  return isFinite(o) ? o : 20;
}
function GB(r, t) {
  var e = kn(r, function(v, d) {
    return v + (isNaN(d) ? 0 : d);
  }, 0);
  if (e === 0)
    return [];
  for (var n = Math.pow(10, t), i = U(r, function(v) {
    return (isNaN(v) ? 0 : v) / e * n * 100;
  }), a = n * 100, o = U(i, function(v) {
    return Math.floor(v);
  }), s = kn(o, function(v, d) {
    return v + d;
  }, 0), l = U(i, function(v, d) {
    return v - o[d];
  }); s < a; ) {
    for (var u = Number.NEGATIVE_INFINITY, c = null, f = 0, h = l.length; f < h; ++f)
      l[f] > u && (u = l[f], c = f);
    ++o[c], l[c] = 0, ++s;
  }
  return U(o, function(v) {
    return v / n;
  });
}
function HB(r, t) {
  var e = Math.max(Dn(r), Dn(t)), n = r + t;
  return e > TT ? n : ht(n, e);
}
var Pb = 9007199254740991;
function IT(r) {
  var t = Math.PI * 2;
  return (r % t + t) % t;
}
function du(r) {
  return r > -Eb && r < Eb;
}
var qB = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;
function Fn(r) {
  if (r instanceof Date)
    return r;
  if (J(r)) {
    var t = qB.exec(r);
    if (!t)
      return /* @__PURE__ */ new Date(NaN);
    if (t[8]) {
      var e = +t[4] || 0;
      return t[8].toUpperCase() !== "Z" && (e -= +t[8].slice(0, 3)), new Date(Date.UTC(+t[1], +(t[2] || 1) - 1, +t[3] || 1, e, +(t[5] || 0), +t[6] || 0, t[7] ? +t[7].substring(0, 3) : 0));
    } else
      return new Date(+t[1], +(t[2] || 1) - 1, +t[3] || 1, +t[4] || 0, +(t[5] || 0), +t[6] || 0, t[7] ? +t[7].substring(0, 3) : 0);
  } else if (r == null)
    return /* @__PURE__ */ new Date(NaN);
  return new Date(Math.round(r));
}
function WB(r) {
  return Math.pow(10, n0(r));
}
function n0(r) {
  if (r === 0)
    return 0;
  var t = Math.floor(Math.log(r) / Math.LN10);
  return r / Math.pow(10, t) >= 10 && t++, t;
}
function LT(r, t) {
  var e = n0(r), n = Math.pow(10, e), i = r / n, a;
  return i < 1.5 ? a = 1 : i < 2.5 ? a = 2 : i < 4 ? a = 3 : i < 7 ? a = 5 : a = 10, r = a * n, e >= -20 ? +r.toFixed(e < 0 ? -e : 0) : r;
}
function _d(r, t) {
  var e = (r.length - 1) * t + 1, n = Math.floor(e), i = +r[n - 1], a = e - n;
  return a ? i + a * (r[n] - i) : i;
}
function kb(r) {
  r.sort(function(l, u) {
    return s(l, u, 0) ? -1 : 1;
  });
  for (var t = -1 / 0, e = 1, n = 0; n < r.length; ) {
    for (var i = r[n].interval, a = r[n].close, o = 0; o < 2; o++)
      i[o] <= t && (i[o] = t, a[o] = o ? 1 : 1 - e), t = i[o], e = a[o];
    i[0] === i[1] && a[0] * a[1] !== 1 ? r.splice(n, 1) : n++;
  }
  return r;
  function s(l, u, c) {
    return l.interval[c] < u.interval[c] || l.interval[c] === u.interval[c] && (l.close[c] - u.close[c] === (c ? -1 : 1) || !c && s(l, u, 1));
  }
}
function ai(r) {
  var t = parseFloat(r);
  return t == r && (t !== 0 || !J(r) || r.indexOf("x") <= 0) ? t : NaN;
}
function ET(r) {
  return !isNaN(ai(r));
}
function PT() {
  return Math.round(Math.random() * 9);
}
function kT(r, t) {
  return t === 0 ? r : kT(t, r % t);
}
function Rb(r, t) {
  return r == null ? t : t == null ? r : r * t / kT(r, t);
}
function He(r) {
  throw new Error(r);
}
function Ob(r, t, e) {
  return (t - r) * e + r;
}
var RT = "series\0", OT = "\0_ec_\0";
function je(r) {
  return r instanceof Array ? r : r == null ? [] : [r];
}
function ho(r, t, e) {
  if (r) {
    r[t] = r[t] || {}, r.emphasis = r.emphasis || {}, r.emphasis[t] = r.emphasis[t] || {};
    for (var n = 0, i = e.length; n < i; n++) {
      var a = e[n];
      !r.emphasis[t].hasOwnProperty(a) && r[t].hasOwnProperty(a) && (r.emphasis[t][a] = r[t][a]);
    }
  }
}
var Fb = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];
function Es(r) {
  return ue(r) && !q(r) && !(r instanceof Date) ? r.value : r;
}
function UB(r) {
  return ue(r) && !(r instanceof Array);
}
function FT(r, t, e) {
  var n = e === "normalMerge", i = e === "replaceMerge", a = e === "replaceAll";
  r = r || [], t = (t || []).slice();
  var o = re();
  M(t, function(l, u) {
    if (!ue(l)) {
      t[u] = null;
      return;
    }
  });
  var s = YB(r, o, e);
  return (n || i) && ZB(s, r, o, t), n && XB(s, t), n || i ? jB(s, t, i) : a && KB(s, t), JB(s), s;
}
function YB(r, t, e) {
  var n = [];
  if (e === "replaceAll")
    return n;
  for (var i = 0; i < r.length; i++) {
    var a = r[i];
    a && a.id != null && t.set(a.id, i), n.push({
      existing: e === "replaceMerge" || pu(a) ? null : a,
      newOption: null,
      keyInfo: null,
      brandNew: null
    });
  }
  return n;
}
function ZB(r, t, e, n) {
  M(n, function(i, a) {
    if (!(!i || i.id == null)) {
      var o = Ul(i.id), s = e.get(o);
      if (s != null) {
        var l = r[s];
        rr(!l.newOption, 'Duplicated option on id "' + o + '".'), l.newOption = i, l.existing = t[s], n[a] = null;
      }
    }
  });
}
function XB(r, t) {
  M(t, function(e, n) {
    if (!(!e || e.name == null))
      for (var i = 0; i < r.length; i++) {
        var a = r[i].existing;
        if (!r[i].newOption && a && (a.id == null || e.id == null) && !pu(e) && !pu(a) && BT("name", a, e)) {
          r[i].newOption = e, t[n] = null;
          return;
        }
      }
  });
}
function jB(r, t, e) {
  M(t, function(n) {
    if (n) {
      for (
        var i, a = 0;
        // Be `!resultItem` only when `nextIdx >= result.length`.
        (i = r[a]) && (i.newOption || pu(i.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing.
        i.existing && n.id != null && !BT("id", n, i.existing));
      )
        a++;
      i ? (i.newOption = n, i.brandNew = e) : r.push({
        newOption: n,
        brandNew: e,
        existing: null,
        keyInfo: null
      }), a++;
    }
  });
}
function KB(r, t) {
  M(t, function(e) {
    r.push({
      newOption: e,
      brandNew: !0,
      existing: null,
      keyInfo: null
    });
  });
}
function JB(r) {
  var t = re();
  M(r, function(e) {
    var n = e.existing;
    n && t.set(n.id, e);
  }), M(r, function(e) {
    var n = e.newOption;
    rr(!n || n.id == null || !t.get(n.id) || t.get(n.id) === e, "id duplicates: " + (n && n.id)), n && n.id != null && t.set(n.id, e), !e.keyInfo && (e.keyInfo = {});
  }), M(r, function(e, n) {
    var i = e.existing, a = e.newOption, o = e.keyInfo;
    if (ue(a)) {
      if (o.name = a.name != null ? Ul(a.name) : i ? i.name : RT + n, i)
        o.id = Ul(i.id);
      else if (a.id != null)
        o.id = Ul(a.id);
      else {
        var s = 0;
        do
          o.id = "\0" + o.name + "\0" + s++;
        while (t.get(o.id));
      }
      t.set(o.id, e);
    }
  });
}
function BT(r, t, e) {
  var n = bt(t[r], null), i = bt(e[r], null);
  return n != null && i != null && n === i;
}
function Ul(r) {
  return bt(r, "");
}
function bt(r, t) {
  return r == null ? t : J(r) ? r : Be(r) || Fg(r) ? r + "" : t;
}
function i0(r) {
  var t = r.name;
  return !!(t && t.indexOf(RT));
}
function pu(r) {
  return r && r.id != null && Ul(r.id).indexOf(OT) === 0;
}
function QB(r) {
  return OT + r;
}
function eN(r, t, e) {
  M(r, function(n) {
    var i = n.newOption;
    ue(i) && (n.keyInfo.mainType = t, n.keyInfo.subType = tN(t, i, n.existing, e));
  });
}
function tN(r, t, e, n) {
  var i = t.type ? t.type : e ? e.subType : n.determineSubType(r, t);
  return i;
}
function rN(r, t) {
  var e = {}, n = {};
  return i(r || [], e), i(t || [], n, e), [a(e), a(n)];
  function i(o, s, l) {
    for (var u = 0, c = o.length; u < c; u++) {
      var f = bt(o[u].seriesId, null);
      if (f == null)
        return;
      for (var h = je(o[u].dataIndex), v = l && l[f], d = 0, p = h.length; d < p; d++) {
        var g = h[d];
        v && v[g] ? v[g] = null : (s[f] || (s[f] = {}))[g] = 1;
      }
    }
  }
  function a(o, s) {
    var l = [];
    for (var u in o)
      if (o.hasOwnProperty(u) && o[u] != null)
        if (s)
          l.push(+u);
        else {
          var c = a(o[u], !0);
          c.length && l.push({
            seriesId: u,
            dataIndex: c
          });
        }
    return l;
  }
}
function vo(r, t) {
  if (t.dataIndexInside != null)
    return t.dataIndexInside;
  if (t.dataIndex != null)
    return q(t.dataIndex) ? U(t.dataIndex, function(e) {
      return r.indexOfRawIndex(e);
    }) : r.indexOfRawIndex(t.dataIndex);
  if (t.name != null)
    return q(t.name) ? U(t.name, function(e) {
      return r.indexOfName(e);
    }) : r.indexOfName(t.name);
}
function Oe() {
  var r = "__ec_inner_" + nN++;
  return function(t) {
    return t[r] || (t[r] = {});
  };
}
var nN = PT();
function Yl(r, t, e) {
  var n = a0(t, e), i = n.mainTypeSpecified, a = n.queryOptionMap, o = n.others, s = o, l = e ? e.defaultMainType : null;
  return !i && l && a.set(l, {}), a.each(function(u, c) {
    var f = $u(r, c, u, {
      useDefault: l === c,
      enableAll: e && e.enableAll != null ? e.enableAll : !0,
      enableNone: e && e.enableNone != null ? e.enableNone : !0
    });
    s[c + "Models"] = f.models, s[c + "Model"] = f.models[0];
  }), s;
}
function a0(r, t) {
  var e;
  if (J(r)) {
    var n = {};
    n[r + "Index"] = 0, e = n;
  } else
    e = r;
  var i = re(), a = {}, o = !1;
  return M(e, function(s, l) {
    if (l === "dataIndex" || l === "dataIndexInside") {
      a[l] = s;
      return;
    }
    var u = l.match(/^(\w+)(Index|Id|Name)$/) || [], c = u[1], f = (u[2] || "").toLowerCase();
    if (!(!c || !f || t && t.includeMainTypes && we(t.includeMainTypes, c) < 0)) {
      o = o || !!c;
      var h = i.get(c) || i.set(c, {});
      h[f] = s;
    }
  }), {
    mainTypeSpecified: o,
    queryOptionMap: i,
    others: a
  };
}
var mt = {
  useDefault: !0,
  enableAll: !1,
  enableNone: !1
}, iN = {
  useDefault: !1,
  enableAll: !0,
  enableNone: !0
};
function $u(r, t, e, n) {
  n = n || mt;
  var i = e.index, a = e.id, o = e.name, s = {
    models: null,
    specified: i != null || a != null || o != null
  };
  if (!s.specified) {
    var l = void 0;
    return s.models = n.useDefault && (l = r.getComponent(t)) ? [l] : [], s;
  }
  return i === "none" || i === !1 ? (rr(n.enableNone, '`"none"` or `false` is not a valid value on index option.'), s.models = [], s) : (i === "all" && (rr(n.enableAll, '`"all"` is not a valid value on index option.'), i = a = o = null), s.models = r.queryComponents({
    mainType: t,
    index: i,
    id: a,
    name: o
  }), s);
}
function NT(r, t, e) {
  r.setAttribute ? r.setAttribute(t, e) : r[t] = e;
}
function aN(r, t) {
  return r.getAttribute ? r.getAttribute(t) : r[t];
}
function oN(r) {
  return r === "auto" ? Ie.domSupported ? "html" : "richText" : r || "html";
}
function am(r, t) {
  var e = re(), n = [];
  return M(r, function(i) {
    var a = t(i);
    (e.get(a) || (n.push(a), e.set(a, []))).push(i);
  }), {
    keys: n,
    buckets: e
  };
}
function zT(r, t, e, n, i) {
  var a = t == null || t === "auto";
  if (n == null)
    return n;
  if (Be(n)) {
    var o = Ob(e || 0, n, i);
    return ht(o, a ? Math.max(Dn(e || 0), Dn(n)) : t);
  } else {
    if (J(n))
      return i < 1 ? e : n;
    for (var s = [], l = e, u = n, c = Math.max(l ? l.length : 0, u.length), f = 0; f < c; ++f) {
      var h = r.getDimensionInfo(f);
      if (h && h.type === "ordinal")
        s[f] = (i < 1 && l ? l : u)[f];
      else {
        var v = l && l[f] ? l[f] : 0, d = u[f], o = Ob(v, d, i);
        s[f] = ht(o, a ? Math.max(Dn(v), Dn(d)) : t);
      }
    }
    return s;
  }
}
var sN = ".", ga = "___EC__COMPONENT__CONTAINER___", VT = "___EC__EXTENDED_CLASS___";
function Tn(r) {
  var t = {
    main: "",
    sub: ""
  };
  if (r) {
    var e = r.split(sN);
    t.main = e[0] || "", t.sub = e[1] || "";
  }
  return t;
}
function lN(r) {
  rr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(r), 'componentType "' + r + '" illegal');
}
function uN(r) {
  return !!(r && r[VT]);
}
function o0(r, t) {
  r.$constructor = r, r.extend = function(e) {
    var n = this, i;
    return cN(n) ? i = /** @class */
    function(a) {
      N(o, a);
      function o() {
        return a.apply(this, arguments) || this;
      }
      return o;
    }(n) : (i = function() {
      (e.$constructor || n).apply(this, arguments);
    }, y3(i, this)), H(i.prototype, e), i[VT] = !0, i.extend = this.extend, i.superCall = vN, i.superApply = dN, i.superClass = n, i;
  };
}
function cN(r) {
  return oe(r) && /^class\s/.test(Function.prototype.toString.call(r));
}
function $T(r, t) {
  r.extend = t.extend;
}
var fN = Math.round(Math.random() * 10);
function hN(r) {
  var t = ["__\0is_clz", fN++].join("_");
  r.prototype[t] = !0, r.isInstance = function(e) {
    return !!(e && e[t]);
  };
}
function vN(r, t) {
  for (var e = [], n = 2; n < arguments.length; n++)
    e[n - 2] = arguments[n];
  return this.superClass.prototype[t].apply(r, e);
}
function dN(r, t, e) {
  return this.superClass.prototype[t].apply(r, e);
}
function ov(r) {
  var t = {};
  r.registerClass = function(n) {
    var i = n.type || n.prototype.type;
    if (i) {
      lN(i), n.prototype.type = i;
      var a = Tn(i);
      if (!a.sub)
        t[a.main] = n;
      else if (a.sub !== ga) {
        var o = e(a);
        o[a.sub] = n;
      }
    }
    return n;
  }, r.getClass = function(n, i, a) {
    var o = t[n];
    if (o && o[ga] && (o = i ? o[i] : null), a && !o)
      throw new Error(i ? "Component " + n + "." + (i || "") + " is used but not imported." : n + ".type should be specified.");
    return o;
  }, r.getClassesByMainType = function(n) {
    var i = Tn(n), a = [], o = t[i.main];
    return o && o[ga] ? M(o, function(s, l) {
      l !== ga && a.push(s);
    }) : a.push(o), a;
  }, r.hasClass = function(n) {
    var i = Tn(n);
    return !!t[i.main];
  }, r.getAllClassMainTypes = function() {
    var n = [];
    return M(t, function(i, a) {
      n.push(a);
    }), n;
  }, r.hasSubTypes = function(n) {
    var i = Tn(n), a = t[i.main];
    return a && a[ga];
  };
  function e(n) {
    var i = t[n.main];
    return (!i || !i[ga]) && (i = t[n.main] = {}, i[ga] = !0), i;
  }
}
function po(r, t) {
  for (var e = 0; e < r.length; e++)
    r[e][1] || (r[e][1] = r[e][0]);
  return t = t || !1, function(n, i, a) {
    for (var o = {}, s = 0; s < r.length; s++) {
      var l = r[s][1];
      if (!(i && we(i, l) >= 0 || a && we(a, l) < 0)) {
        var u = n.getShallow(l, t);
        u != null && (o[r[s][0]] = u);
      }
    }
    return o;
  };
}
var pN = [
  ["fill", "color"],
  ["shadowBlur"],
  ["shadowOffsetX"],
  ["shadowOffsetY"],
  ["opacity"],
  ["shadowColor"]
  // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
  // So do not transfer decal directly.
], gN = po(pN), mN = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getAreaStyle = function(t, e) {
      return gN(this, t, e);
    }, r;
  }()
), om = new zu(50);
function yN(r) {
  if (typeof r == "string") {
    var t = om.get(r);
    return t && t.image;
  } else
    return r;
}
function s0(r, t, e, n, i) {
  if (r)
    if (typeof r == "string") {
      if (t && t.__zrImageSrc === r || !e)
        return t;
      var a = om.get(r), o = { hostEl: e, cb: n, cbPayload: i };
      return a ? (t = a.image, !sv(t) && a.pending.push(o)) : (t = ji.loadImage(r, Bb, Bb), t.__zrImageSrc = r, om.put(r, t.__cachedImgObj = {
        image: t,
        pending: [o]
      })), t;
    } else
      return r;
  else return t;
}
function Bb() {
  var r = this.__cachedImgObj;
  this.onload = this.onerror = this.__cachedImgObj = null;
  for (var t = 0; t < r.pending.length; t++) {
    var e = r.pending[t], n = e.cb;
    n && n(this, e.cbPayload), e.hostEl.dirty();
  }
  r.pending.length = 0;
}
function sv(r) {
  return r && r.width && r.height;
}
var bd = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
function _N(r, t, e, n, i, a) {
  if (!e) {
    r.text = "", r.isTruncated = !1;
    return;
  }
  var o = (t + "").split(`
`);
  a = GT(e, n, i, a);
  for (var s = !1, l = {}, u = 0, c = o.length; u < c; u++)
    HT(l, o[u], a), o[u] = l.textLine, s = s || l.isTruncated;
  r.text = o.join(`
`), r.isTruncated = s;
}
function GT(r, t, e, n) {
  n = n || {};
  var i = H({}, n);
  i.font = t, e = me(e, "..."), i.maxIterations = me(n.maxIterations, 2);
  var a = i.minChar = me(n.minChar, 0);
  i.cnCharWidth = Dr("国", t);
  var o = i.ascCharWidth = Dr("a", t);
  i.placeholder = me(n.placeholder, "");
  for (var s = r = Math.max(0, r - 1), l = 0; l < a && s >= o; l++)
    s -= o;
  var u = Dr(e, t);
  return u > s && (e = "", u = 0), s = r - u, i.ellipsis = e, i.ellipsisWidth = u, i.contentWidth = s, i.containerWidth = r, i;
}
function HT(r, t, e) {
  var n = e.containerWidth, i = e.font, a = e.contentWidth;
  if (!n) {
    r.textLine = "", r.isTruncated = !1;
    return;
  }
  var o = Dr(t, i);
  if (o <= n) {
    r.textLine = t, r.isTruncated = !1;
    return;
  }
  for (var s = 0; ; s++) {
    if (o <= a || s >= e.maxIterations) {
      t += e.ellipsis;
      break;
    }
    var l = s === 0 ? bN(t, a, e.ascCharWidth, e.cnCharWidth) : o > 0 ? Math.floor(t.length * a / o) : 0;
    t = t.substr(0, l), o = Dr(t, i);
  }
  t === "" && (t = e.placeholder), r.textLine = t, r.isTruncated = !0;
}
function bN(r, t, e, n) {
  for (var i = 0, a = 0, o = r.length; a < o && i < t; a++) {
    var s = r.charCodeAt(a);
    i += 0 <= s && s <= 127 ? e : n;
  }
  return a;
}
function SN(r, t) {
  r != null && (r += "");
  var e = t.overflow, n = t.padding, i = t.font, a = e === "truncate", o = iv(i), s = me(t.lineHeight, o), l = !!t.backgroundColor, u = t.lineOverflow === "truncate", c = !1, f = t.width, h;
  f != null && (e === "break" || e === "breakAll") ? h = r ? qT(r, t.font, f, e === "breakAll", 0).lines : [] : h = r ? r.split(`
`) : [];
  var v = h.length * s, d = me(t.height, v);
  if (v > d && u) {
    var p = Math.floor(d / s);
    c = c || h.length > p, h = h.slice(0, p);
  }
  if (r && a && f != null)
    for (var g = GT(f, i, t.ellipsis, {
      minChar: t.truncateMinChar,
      placeholder: t.placeholder
    }), m = {}, y = 0; y < h.length; y++)
      HT(m, h[y], g), h[y] = m.textLine, c = c || m.isTruncated;
  for (var _ = d, b = 0, y = 0; y < h.length; y++)
    b = Math.max(Dr(h[y], i), b);
  f == null && (f = b);
  var S = b;
  return n && (_ += n[0] + n[2], S += n[1] + n[3], f += n[1] + n[3]), l && (S = f), {
    lines: h,
    height: d,
    outerWidth: S,
    outerHeight: _,
    lineHeight: s,
    calculatedLineHeight: o,
    contentWidth: b,
    contentHeight: v,
    width: f,
    isTruncated: c
  };
}
var xN = /* @__PURE__ */ function() {
  function r() {
  }
  return r;
}(), Nb = /* @__PURE__ */ function() {
  function r(t) {
    this.tokens = [], t && (this.tokens = t);
  }
  return r;
}(), wN = /* @__PURE__ */ function() {
  function r() {
    this.width = 0, this.height = 0, this.contentWidth = 0, this.contentHeight = 0, this.outerWidth = 0, this.outerHeight = 0, this.lines = [], this.isTruncated = !1;
  }
  return r;
}();
function CN(r, t) {
  var e = new wN();
  if (r != null && (r += ""), !r)
    return e;
  for (var n = t.width, i = t.height, a = t.overflow, o = (a === "break" || a === "breakAll") && n != null ? { width: n, accumWidth: 0, breakAll: a === "breakAll" } : null, s = bd.lastIndex = 0, l; (l = bd.exec(r)) != null; ) {
    var u = l.index;
    u > s && Sd(e, r.substring(s, u), t, o), Sd(e, l[2], t, o, l[1]), s = bd.lastIndex;
  }
  s < r.length && Sd(e, r.substring(s, r.length), t, o);
  var c = [], f = 0, h = 0, v = t.padding, d = a === "truncate", p = t.lineOverflow === "truncate", g = {};
  function m(G, W, Y) {
    G.width = W, G.lineHeight = Y, f += Y, h = Math.max(h, W);
  }
  e: for (var y = 0; y < e.lines.length; y++) {
    for (var _ = e.lines[y], b = 0, S = 0, x = 0; x < _.tokens.length; x++) {
      var w = _.tokens[x], C = w.styleName && t.rich[w.styleName] || {}, D = w.textPadding = C.padding, A = D ? D[1] + D[3] : 0, T = w.font = C.font || t.font;
      w.contentHeight = iv(T);
      var L = me(C.height, w.contentHeight);
      if (w.innerHeight = L, D && (L += D[0] + D[2]), w.height = L, w.lineHeight = En(C.lineHeight, t.lineHeight, L), w.align = C && C.align || t.align, w.verticalAlign = C && C.verticalAlign || "middle", p && i != null && f + w.lineHeight > i) {
        var E = e.lines.length;
        x > 0 ? (_.tokens = _.tokens.slice(0, x), m(_, S, b), e.lines = e.lines.slice(0, y + 1)) : e.lines = e.lines.slice(0, y), e.isTruncated = e.isTruncated || e.lines.length < E;
        break e;
      }
      var I = C.width, P = I == null || I === "auto";
      if (typeof I == "string" && I.charAt(I.length - 1) === "%")
        w.percentWidth = I, c.push(w), w.contentWidth = Dr(w.text, T);
      else {
        if (P) {
          var R = C.backgroundColor, F = R && R.image;
          F && (F = yN(F), sv(F) && (w.width = Math.max(w.width, F.width * L / F.height)));
        }
        var O = d && n != null ? n - S : null;
        O != null && O < w.width ? !P || O < A ? (w.text = "", w.width = w.contentWidth = 0) : (_N(g, w.text, O - A, T, t.ellipsis, { minChar: t.truncateMinChar }), w.text = g.text, e.isTruncated = e.isTruncated || g.isTruncated, w.width = w.contentWidth = Dr(w.text, T)) : w.contentWidth = Dr(w.text, T);
      }
      w.width += A, S += w.width, C && (b = Math.max(b, w.lineHeight));
    }
    m(_, S, b);
  }
  e.outerWidth = e.width = me(n, h), e.outerHeight = e.height = me(i, f), e.contentHeight = f, e.contentWidth = h, v && (e.outerWidth += v[1] + v[3], e.outerHeight += v[0] + v[2]);
  for (var y = 0; y < c.length; y++) {
    var w = c[y], z = w.percentWidth;
    w.width = parseInt(z, 10) / 100 * e.width;
  }
  return e;
}
function Sd(r, t, e, n, i) {
  var a = t === "", o = i && e.rich[i] || {}, s = r.lines, l = o.font || e.font, u = !1, c, f;
  if (n) {
    var h = o.padding, v = h ? h[1] + h[3] : 0;
    if (o.width != null && o.width !== "auto") {
      var d = ln(o.width, n.width) + v;
      s.length > 0 && d + n.accumWidth > n.width && (c = t.split(`
`), u = !0), n.accumWidth = d;
    } else {
      var p = qT(t, l, n.width, n.breakAll, n.accumWidth);
      n.accumWidth = p.accumWidth + v, f = p.linesWidths, c = p.lines;
    }
  } else
    c = t.split(`
`);
  for (var g = 0; g < c.length; g++) {
    var m = c[g], y = new xN();
    if (y.styleName = i, y.text = m, y.isLineHolder = !m && !a, typeof o.width == "number" ? y.width = o.width : y.width = f ? f[g] : Dr(m, l), !g && !u) {
      var _ = (s[s.length - 1] || (s[0] = new Nb())).tokens, b = _.length;
      b === 1 && _[0].isLineHolder ? _[0] = y : (m || !b || a) && _.push(y);
    } else
      s.push(new Nb([y]));
  }
}
function AN(r) {
  var t = r.charCodeAt(0);
  return t >= 32 && t <= 591 || t >= 880 && t <= 4351 || t >= 4608 && t <= 5119 || t >= 7680 && t <= 8303;
}
var DN = kn(",&?/;] ".split(""), function(r, t) {
  return r[t] = !0, r;
}, {});
function TN(r) {
  return AN(r) ? !!DN[r] : !0;
}
function qT(r, t, e, n, i) {
  for (var a = [], o = [], s = "", l = "", u = 0, c = 0, f = 0; f < r.length; f++) {
    var h = r.charAt(f);
    if (h === `
`) {
      l && (s += l, c += u), a.push(s), o.push(c), s = "", l = "", u = 0, c = 0;
      continue;
    }
    var v = Dr(h, t), d = n ? !1 : !TN(h);
    if (a.length ? c + v > e : i + c + v > e) {
      c ? (s || l) && (d ? (s || (s = l, l = "", u = 0, c = u), a.push(s), o.push(c - u), l += h, u += v, s = "", c = u) : (l && (s += l, l = "", u = 0), a.push(s), o.push(c), s = h, c = v)) : d ? (a.push(l), o.push(u), l = h, u = v) : (a.push(h), o.push(v));
      continue;
    }
    c += v, d ? (l += h, u += v) : (l && (s += l, l = "", u = 0), s += h);
  }
  return !a.length && !s && (s = r, l = "", u = 0), l && (s += l), s && (a.push(s), o.push(c)), a.length === 1 && (c += i), {
    accumWidth: c,
    lines: a,
    linesWidths: o
  };
}
var sm = "__zr_style_" + Math.round(Math.random() * 10), no = {
  shadowBlur: 0,
  shadowOffsetX: 0,
  shadowOffsetY: 0,
  shadowColor: "#000",
  opacity: 1,
  blend: "source-over"
}, lv = {
  style: {
    shadowBlur: !0,
    shadowOffsetX: !0,
    shadowOffsetY: !0,
    shadowColor: !0,
    opacity: !0
  }
};
no[sm] = !0;
var zb = ["z", "z2", "invisible"], MN = ["invisible"], qr = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype._init = function(e) {
    for (var n = Ee(e), i = 0; i < n.length; i++) {
      var a = n[i];
      a === "style" ? this.useStyle(e[a]) : r.prototype.attrKV.call(this, a, e[a]);
    }
    this.style || this.useStyle({});
  }, t.prototype.beforeBrush = function() {
  }, t.prototype.afterBrush = function() {
  }, t.prototype.innerBeforeBrush = function() {
  }, t.prototype.innerAfterBrush = function() {
  }, t.prototype.shouldBePainted = function(e, n, i, a) {
    var o = this.transform;
    if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && IN(this, e, n) || o && !o[0] && !o[3])
      return !1;
    if (i && this.__clipPaths) {
      for (var s = 0; s < this.__clipPaths.length; ++s)
        if (this.__clipPaths[s].isZeroArea())
          return !1;
    }
    if (a && this.parent)
      for (var l = this.parent; l; ) {
        if (l.ignore)
          return !1;
        l = l.parent;
      }
    return !0;
  }, t.prototype.contain = function(e, n) {
    return this.rectContain(e, n);
  }, t.prototype.traverse = function(e, n) {
    e.call(n, this);
  }, t.prototype.rectContain = function(e, n) {
    var i = this.transformCoordToLocal(e, n), a = this.getBoundingRect();
    return a.contain(i[0], i[1]);
  }, t.prototype.getPaintRect = function() {
    var e = this._paintRect;
    if (!this._paintRect || this.__dirty) {
      var n = this.transform, i = this.getBoundingRect(), a = this.style, o = a.shadowBlur || 0, s = a.shadowOffsetX || 0, l = a.shadowOffsetY || 0;
      e = this._paintRect || (this._paintRect = new xe(0, 0, 0, 0)), n ? xe.applyTransform(e, i, n) : e.copy(i), (o || s || l) && (e.width += o * 2 + Math.abs(s), e.height += o * 2 + Math.abs(l), e.x = Math.min(e.x, e.x + s - o), e.y = Math.min(e.y, e.y + l - o));
      var u = this.dirtyRectTolerance;
      e.isZero() || (e.x = Math.floor(e.x - u), e.y = Math.floor(e.y - u), e.width = Math.ceil(e.width + 1 + u * 2), e.height = Math.ceil(e.height + 1 + u * 2));
    }
    return e;
  }, t.prototype.setPrevPaintRect = function(e) {
    e ? (this._prevPaintRect = this._prevPaintRect || new xe(0, 0, 0, 0), this._prevPaintRect.copy(e)) : this._prevPaintRect = null;
  }, t.prototype.getPrevPaintRect = function() {
    return this._prevPaintRect;
  }, t.prototype.animateStyle = function(e) {
    return this.animate("style", e);
  }, t.prototype.updateDuringAnimation = function(e) {
    e === "style" ? this.dirtyStyle() : this.markRedraw();
  }, t.prototype.attrKV = function(e, n) {
    e !== "style" ? r.prototype.attrKV.call(this, e, n) : this.style ? this.setStyle(n) : this.useStyle(n);
  }, t.prototype.setStyle = function(e, n) {
    return typeof e == "string" ? this.style[e] = n : H(this.style, e), this.dirtyStyle(), this;
  }, t.prototype.dirtyStyle = function(e) {
    e || this.markRedraw(), this.__dirty |= Ml, this._rect && (this._rect = null);
  }, t.prototype.dirty = function() {
    this.dirtyStyle();
  }, t.prototype.styleChanged = function() {
    return !!(this.__dirty & Ml);
  }, t.prototype.styleUpdated = function() {
    this.__dirty &= ~Ml;
  }, t.prototype.createStyle = function(e) {
    return tv(no, e);
  }, t.prototype.useStyle = function(e) {
    e[sm] || (e = this.createStyle(e)), this.__inHover ? this.__hoverStyle = e : this.style = e, this.dirtyStyle();
  }, t.prototype.isStyleObject = function(e) {
    return e[sm];
  }, t.prototype._innerSaveToNormal = function(e) {
    r.prototype._innerSaveToNormal.call(this, e);
    var n = this._normalState;
    e.style && !n.style && (n.style = this._mergeStyle(this.createStyle(), this.style)), this._savePrimaryToNormal(e, n, zb);
  }, t.prototype._applyStateObj = function(e, n, i, a, o, s) {
    r.prototype._applyStateObj.call(this, e, n, i, a, o, s);
    var l = !(n && a), u;
    if (n && n.style ? o ? a ? u = n.style : (u = this._mergeStyle(this.createStyle(), i.style), this._mergeStyle(u, n.style)) : (u = this._mergeStyle(this.createStyle(), a ? this.style : i.style), this._mergeStyle(u, n.style)) : l && (u = i.style), u)
      if (o) {
        var c = this.style;
        if (this.style = this.createStyle(l ? {} : c), l)
          for (var f = Ee(c), h = 0; h < f.length; h++) {
            var v = f[h];
            v in u && (u[v] = u[v], this.style[v] = c[v]);
          }
        for (var d = Ee(u), h = 0; h < d.length; h++) {
          var v = d[h];
          this.style[v] = this.style[v];
        }
        this._transitionState(e, {
          style: u
        }, s, this.getAnimationStyleProps());
      } else
        this.useStyle(u);
    for (var p = this.__inHover ? MN : zb, h = 0; h < p.length; h++) {
      var v = p[h];
      n && n[v] != null ? this[v] = n[v] : l && i[v] != null && (this[v] = i[v]);
    }
  }, t.prototype._mergeStates = function(e) {
    for (var n = r.prototype._mergeStates.call(this, e), i, a = 0; a < e.length; a++) {
      var o = e[a];
      o.style && (i = i || {}, this._mergeStyle(i, o.style));
    }
    return i && (n.style = i), n;
  }, t.prototype._mergeStyle = function(e, n) {
    return H(e, n), e;
  }, t.prototype.getAnimationStyleProps = function() {
    return lv;
  }, t.initDefaultProps = function() {
    var e = t.prototype;
    e.type = "displayable", e.invisible = !1, e.z = 0, e.z2 = 0, e.zlevel = 0, e.culling = !1, e.cursor = "pointer", e.rectHover = !1, e.incremental = !1, e._rect = null, e.dirtyRectTolerance = 0, e.__dirty = br | Ml;
  }(), t;
}(av), xd = new xe(0, 0, 0, 0), wd = new xe(0, 0, 0, 0);
function IN(r, t, e) {
  return xd.copy(r.getBoundingRect()), r.transform && xd.applyTransform(r.transform), wd.width = t, wd.height = e, !xd.intersect(wd);
}
var hr = Math.min, vr = Math.max, Cd = Math.sin, Ad = Math.cos, ma = Math.PI * 2, wc = bo(), Cc = bo(), Ac = bo();
function uv(r, t, e) {
  if (r.length !== 0) {
    for (var n = r[0], i = n[0], a = n[0], o = n[1], s = n[1], l = 1; l < r.length; l++)
      n = r[l], i = hr(i, n[0]), a = vr(a, n[0]), o = hr(o, n[1]), s = vr(s, n[1]);
    t[0] = i, t[1] = o, e[0] = a, e[1] = s;
  }
}
function Vb(r, t, e, n, i, a) {
  i[0] = hr(r, e), i[1] = hr(t, n), a[0] = vr(r, e), a[1] = vr(t, n);
}
var $b = [], Gb = [];
function LN(r, t, e, n, i, a, o, s, l, u) {
  var c = uT, f = wt, h = c(r, e, i, o, $b);
  l[0] = 1 / 0, l[1] = 1 / 0, u[0] = -1 / 0, u[1] = -1 / 0;
  for (var v = 0; v < h; v++) {
    var d = f(r, e, i, o, $b[v]);
    l[0] = hr(d, l[0]), u[0] = vr(d, u[0]);
  }
  h = c(t, n, a, s, Gb);
  for (var v = 0; v < h; v++) {
    var p = f(t, n, a, s, Gb[v]);
    l[1] = hr(p, l[1]), u[1] = vr(p, u[1]);
  }
  l[0] = hr(r, l[0]), u[0] = vr(r, u[0]), l[0] = hr(o, l[0]), u[0] = vr(o, u[0]), l[1] = hr(t, l[1]), u[1] = vr(t, u[1]), l[1] = hr(s, l[1]), u[1] = vr(s, u[1]);
}
function EN(r, t, e, n, i, a, o, s) {
  var l = fT, u = Lt, c = vr(hr(l(r, e, i), 1), 0), f = vr(hr(l(t, n, a), 1), 0), h = u(r, e, i, c), v = u(t, n, a, f);
  o[0] = hr(r, i, h), o[1] = hr(t, a, v), s[0] = vr(r, i, h), s[1] = vr(t, a, v);
}
function PN(r, t, e, n, i, a, o, s, l) {
  var u = Oi, c = Fi, f = Math.abs(i - a);
  if (f % ma < 1e-4 && f > 1e-4) {
    s[0] = r - e, s[1] = t - n, l[0] = r + e, l[1] = t + n;
    return;
  }
  if (wc[0] = Ad(i) * e + r, wc[1] = Cd(i) * n + t, Cc[0] = Ad(a) * e + r, Cc[1] = Cd(a) * n + t, u(s, wc, Cc), c(l, wc, Cc), i = i % ma, i < 0 && (i = i + ma), a = a % ma, a < 0 && (a = a + ma), i > a && !o ? a += ma : i < a && o && (i += ma), o) {
    var h = a;
    a = i, i = h;
  }
  for (var v = 0; v < a; v += Math.PI / 2)
    v > i && (Ac[0] = Ad(v) * e + r, Ac[1] = Cd(v) * n + t, u(s, Ac, s), c(l, Ac, l));
}
var et = {
  M: 1,
  L: 2,
  C: 3,
  Q: 4,
  A: 5,
  Z: 6,
  R: 7
}, ya = [], _a = [], gn = [], _i = [], mn = [], yn = [], Dd = Math.min, Td = Math.max, ba = Math.cos, Sa = Math.sin, qn = Math.abs, lm = Math.PI, Mi = lm * 2, Md = typeof Float32Array < "u", tl = [];
function Id(r) {
  var t = Math.round(r / lm * 1e8) / 1e8;
  return t % 2 * lm;
}
function l0(r, t) {
  var e = Id(r[0]);
  e < 0 && (e += Mi);
  var n = e - r[0], i = r[1];
  i += n, !t && i - e >= Mi ? i = e + Mi : t && e - i >= Mi ? i = e - Mi : !t && e > i ? i = e + (Mi - Id(e - i)) : t && e < i && (i = e - (Mi - Id(i - e))), r[0] = e, r[1] = i;
}
var Bn = function() {
  function r(t) {
    this.dpr = 1, this._xi = 0, this._yi = 0, this._x0 = 0, this._y0 = 0, this._len = 0, t && (this._saveData = !1), this._saveData && (this.data = []);
  }
  return r.prototype.increaseVersion = function() {
    this._version++;
  }, r.prototype.getVersion = function() {
    return this._version;
  }, r.prototype.setScale = function(t, e, n) {
    n = n || 0, n > 0 && (this._ux = qn(n / nh / t) || 0, this._uy = qn(n / nh / e) || 0);
  }, r.prototype.setDPR = function(t) {
    this.dpr = t;
  }, r.prototype.setContext = function(t) {
    this._ctx = t;
  }, r.prototype.getContext = function() {
    return this._ctx;
  }, r.prototype.beginPath = function() {
    return this._ctx && this._ctx.beginPath(), this.reset(), this;
  }, r.prototype.reset = function() {
    this._saveData && (this._len = 0), this._pathSegLen && (this._pathSegLen = null, this._pathLen = 0), this._version++;
  }, r.prototype.moveTo = function(t, e) {
    return this._drawPendingPt(), this.addData(et.M, t, e), this._ctx && this._ctx.moveTo(t, e), this._x0 = t, this._y0 = e, this._xi = t, this._yi = e, this;
  }, r.prototype.lineTo = function(t, e) {
    var n = qn(t - this._xi), i = qn(e - this._yi), a = n > this._ux || i > this._uy;
    if (this.addData(et.L, t, e), this._ctx && a && this._ctx.lineTo(t, e), a)
      this._xi = t, this._yi = e, this._pendingPtDist = 0;
    else {
      var o = n * n + i * i;
      o > this._pendingPtDist && (this._pendingPtX = t, this._pendingPtY = e, this._pendingPtDist = o);
    }
    return this;
  }, r.prototype.bezierCurveTo = function(t, e, n, i, a, o) {
    return this._drawPendingPt(), this.addData(et.C, t, e, n, i, a, o), this._ctx && this._ctx.bezierCurveTo(t, e, n, i, a, o), this._xi = a, this._yi = o, this;
  }, r.prototype.quadraticCurveTo = function(t, e, n, i) {
    return this._drawPendingPt(), this.addData(et.Q, t, e, n, i), this._ctx && this._ctx.quadraticCurveTo(t, e, n, i), this._xi = n, this._yi = i, this;
  }, r.prototype.arc = function(t, e, n, i, a, o) {
    this._drawPendingPt(), tl[0] = i, tl[1] = a, l0(tl, o), i = tl[0], a = tl[1];
    var s = a - i;
    return this.addData(et.A, t, e, n, n, i, s, 0, o ? 0 : 1), this._ctx && this._ctx.arc(t, e, n, i, a, o), this._xi = ba(a) * n + t, this._yi = Sa(a) * n + e, this;
  }, r.prototype.arcTo = function(t, e, n, i, a) {
    return this._drawPendingPt(), this._ctx && this._ctx.arcTo(t, e, n, i, a), this;
  }, r.prototype.rect = function(t, e, n, i) {
    return this._drawPendingPt(), this._ctx && this._ctx.rect(t, e, n, i), this.addData(et.R, t, e, n, i), this;
  }, r.prototype.closePath = function() {
    this._drawPendingPt(), this.addData(et.Z);
    var t = this._ctx, e = this._x0, n = this._y0;
    return t && t.closePath(), this._xi = e, this._yi = n, this;
  }, r.prototype.fill = function(t) {
    t && t.fill(), this.toStatic();
  }, r.prototype.stroke = function(t) {
    t && t.stroke(), this.toStatic();
  }, r.prototype.len = function() {
    return this._len;
  }, r.prototype.setData = function(t) {
    var e = t.length;
    !(this.data && this.data.length === e) && Md && (this.data = new Float32Array(e));
    for (var n = 0; n < e; n++)
      this.data[n] = t[n];
    this._len = e;
  }, r.prototype.appendPath = function(t) {
    t instanceof Array || (t = [t]);
    for (var e = t.length, n = 0, i = this._len, a = 0; a < e; a++)
      n += t[a].len();
    Md && this.data instanceof Float32Array && (this.data = new Float32Array(i + n));
    for (var a = 0; a < e; a++)
      for (var o = t[a].data, s = 0; s < o.length; s++)
        this.data[i++] = o[s];
    this._len = i;
  }, r.prototype.addData = function(t, e, n, i, a, o, s, l, u) {
    if (this._saveData) {
      var c = this.data;
      this._len + arguments.length > c.length && (this._expandData(), c = this.data);
      for (var f = 0; f < arguments.length; f++)
        c[this._len++] = arguments[f];
    }
  }, r.prototype._drawPendingPt = function() {
    this._pendingPtDist > 0 && (this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY), this._pendingPtDist = 0);
  }, r.prototype._expandData = function() {
    if (!(this.data instanceof Array)) {
      for (var t = [], e = 0; e < this._len; e++)
        t[e] = this.data[e];
      this.data = t;
    }
  }, r.prototype.toStatic = function() {
    if (this._saveData) {
      this._drawPendingPt();
      var t = this.data;
      t instanceof Array && (t.length = this._len, Md && this._len > 11 && (this.data = new Float32Array(t)));
    }
  }, r.prototype.getBoundingRect = function() {
    gn[0] = gn[1] = mn[0] = mn[1] = Number.MAX_VALUE, _i[0] = _i[1] = yn[0] = yn[1] = -Number.MAX_VALUE;
    var t = this.data, e = 0, n = 0, i = 0, a = 0, o;
    for (o = 0; o < this._len; ) {
      var s = t[o++], l = o === 1;
      switch (l && (e = t[o], n = t[o + 1], i = e, a = n), s) {
        case et.M:
          e = i = t[o++], n = a = t[o++], mn[0] = i, mn[1] = a, yn[0] = i, yn[1] = a;
          break;
        case et.L:
          Vb(e, n, t[o], t[o + 1], mn, yn), e = t[o++], n = t[o++];
          break;
        case et.C:
          LN(e, n, t[o++], t[o++], t[o++], t[o++], t[o], t[o + 1], mn, yn), e = t[o++], n = t[o++];
          break;
        case et.Q:
          EN(e, n, t[o++], t[o++], t[o], t[o + 1], mn, yn), e = t[o++], n = t[o++];
          break;
        case et.A:
          var u = t[o++], c = t[o++], f = t[o++], h = t[o++], v = t[o++], d = t[o++] + v;
          o += 1;
          var p = !t[o++];
          l && (i = ba(v) * f + u, a = Sa(v) * h + c), PN(u, c, f, h, v, d, p, mn, yn), e = ba(d) * f + u, n = Sa(d) * h + c;
          break;
        case et.R:
          i = e = t[o++], a = n = t[o++];
          var g = t[o++], m = t[o++];
          Vb(i, a, i + g, a + m, mn, yn);
          break;
        case et.Z:
          e = i, n = a;
          break;
      }
      Oi(gn, gn, mn), Fi(_i, _i, yn);
    }
    return o === 0 && (gn[0] = gn[1] = _i[0] = _i[1] = 0), new xe(gn[0], gn[1], _i[0] - gn[0], _i[1] - gn[1]);
  }, r.prototype._calculateLength = function() {
    var t = this.data, e = this._len, n = this._ux, i = this._uy, a = 0, o = 0, s = 0, l = 0;
    this._pathSegLen || (this._pathSegLen = []);
    for (var u = this._pathSegLen, c = 0, f = 0, h = 0; h < e; ) {
      var v = t[h++], d = h === 1;
      d && (a = t[h], o = t[h + 1], s = a, l = o);
      var p = -1;
      switch (v) {
        case et.M:
          a = s = t[h++], o = l = t[h++];
          break;
        case et.L: {
          var g = t[h++], m = t[h++], y = g - a, _ = m - o;
          (qn(y) > n || qn(_) > i || h === e - 1) && (p = Math.sqrt(y * y + _ * _), a = g, o = m);
          break;
        }
        case et.C: {
          var b = t[h++], S = t[h++], g = t[h++], m = t[h++], x = t[h++], w = t[h++];
          p = J3(a, o, b, S, g, m, x, w, 10), a = x, o = w;
          break;
        }
        case et.Q: {
          var b = t[h++], S = t[h++], g = t[h++], m = t[h++];
          p = eB(a, o, b, S, g, m, 10), a = g, o = m;
          break;
        }
        case et.A:
          var C = t[h++], D = t[h++], A = t[h++], T = t[h++], L = t[h++], E = t[h++], I = E + L;
          h += 1, d && (s = ba(L) * A + C, l = Sa(L) * T + D), p = Td(A, T) * Dd(Mi, Math.abs(E)), a = ba(I) * A + C, o = Sa(I) * T + D;
          break;
        case et.R: {
          s = a = t[h++], l = o = t[h++];
          var P = t[h++], R = t[h++];
          p = P * 2 + R * 2;
          break;
        }
        case et.Z: {
          var y = s - a, _ = l - o;
          p = Math.sqrt(y * y + _ * _), a = s, o = l;
          break;
        }
      }
      p >= 0 && (u[f++] = p, c += p);
    }
    return this._pathLen = c, c;
  }, r.prototype.rebuildPath = function(t, e) {
    var n = this.data, i = this._ux, a = this._uy, o = this._len, s, l, u, c, f, h, v = e < 1, d, p, g = 0, m = 0, y, _ = 0, b, S;
    if (!(v && (this._pathSegLen || this._calculateLength(), d = this._pathSegLen, p = this._pathLen, y = e * p, !y)))
      e: for (var x = 0; x < o; ) {
        var w = n[x++], C = x === 1;
        switch (C && (u = n[x], c = n[x + 1], s = u, l = c), w !== et.L && _ > 0 && (t.lineTo(b, S), _ = 0), w) {
          case et.M:
            s = u = n[x++], l = c = n[x++], t.moveTo(u, c);
            break;
          case et.L: {
            f = n[x++], h = n[x++];
            var D = qn(f - u), A = qn(h - c);
            if (D > i || A > a) {
              if (v) {
                var T = d[m++];
                if (g + T > y) {
                  var L = (y - g) / T;
                  t.lineTo(u * (1 - L) + f * L, c * (1 - L) + h * L);
                  break e;
                }
                g += T;
              }
              t.lineTo(f, h), u = f, c = h, _ = 0;
            } else {
              var E = D * D + A * A;
              E > _ && (b = f, S = h, _ = E);
            }
            break;
          }
          case et.C: {
            var I = n[x++], P = n[x++], R = n[x++], F = n[x++], O = n[x++], z = n[x++];
            if (v) {
              var T = d[m++];
              if (g + T > y) {
                var L = (y - g) / T;
                Ki(u, I, R, O, L, ya), Ki(c, P, F, z, L, _a), t.bezierCurveTo(ya[1], _a[1], ya[2], _a[2], ya[3], _a[3]);
                break e;
              }
              g += T;
            }
            t.bezierCurveTo(I, P, R, F, O, z), u = O, c = z;
            break;
          }
          case et.Q: {
            var I = n[x++], P = n[x++], R = n[x++], F = n[x++];
            if (v) {
              var T = d[m++];
              if (g + T > y) {
                var L = (y - g) / T;
                fu(u, I, R, L, ya), fu(c, P, F, L, _a), t.quadraticCurveTo(ya[1], _a[1], ya[2], _a[2]);
                break e;
              }
              g += T;
            }
            t.quadraticCurveTo(I, P, R, F), u = R, c = F;
            break;
          }
          case et.A:
            var G = n[x++], W = n[x++], Y = n[x++], j = n[x++], ee = n[x++], ie = n[x++], Me = n[x++], We = !n[x++], ve = Y > j ? Y : j, ae = qn(Y - j) > 1e-3, be = ee + ie, ne = !1;
            if (v) {
              var T = d[m++];
              g + T > y && (be = ee + ie * (y - g) / T, ne = !0), g += T;
            }
            if (ae && t.ellipse ? t.ellipse(G, W, Y, j, Me, ee, be, We) : t.arc(G, W, ve, ee, be, We), ne)
              break e;
            C && (s = ba(ee) * Y + G, l = Sa(ee) * j + W), u = ba(be) * Y + G, c = Sa(be) * j + W;
            break;
          case et.R:
            s = u = n[x], l = c = n[x + 1], f = n[x++], h = n[x++];
            var de = n[x++], Ke = n[x++];
            if (v) {
              var T = d[m++];
              if (g + T > y) {
                var Ge = y - g;
                t.moveTo(f, h), t.lineTo(f + Dd(Ge, de), h), Ge -= de, Ge > 0 && t.lineTo(f + de, h + Dd(Ge, Ke)), Ge -= Ke, Ge > 0 && t.lineTo(f + Td(de - Ge, 0), h + Ke), Ge -= de, Ge > 0 && t.lineTo(f, h + Td(Ke - Ge, 0));
                break e;
              }
              g += T;
            }
            t.rect(f, h, de, Ke);
            break;
          case et.Z:
            if (v) {
              var T = d[m++];
              if (g + T > y) {
                var L = (y - g) / T;
                t.lineTo(u * (1 - L) + s * L, c * (1 - L) + l * L);
                break e;
              }
              g += T;
            }
            t.closePath(), u = s, c = l;
        }
      }
  }, r.prototype.clone = function() {
    var t = new r(), e = this.data;
    return t.data = e.slice ? e.slice() : Array.prototype.slice.call(e), t._len = this._len, t;
  }, r.CMD = et, r.initDefaultProps = function() {
    var t = r.prototype;
    t._saveData = !0, t._ux = 0, t._uy = 0, t._pendingPtDist = 0, t._version = 0;
  }(), r;
}();
function Ei(r, t, e, n, i, a, o) {
  if (i === 0)
    return !1;
  var s = i, l = 0, u = r;
  if (o > t + s && o > n + s || o < t - s && o < n - s || a > r + s && a > e + s || a < r - s && a < e - s)
    return !1;
  if (r !== e)
    l = (t - n) / (r - e), u = (r * n - e * t) / (r - e);
  else
    return Math.abs(a - r) <= s / 2;
  var c = l * a - o + u, f = c * c / (l * l + 1);
  return f <= s / 2 * s / 2;
}
function kN(r, t, e, n, i, a, o, s, l, u, c) {
  if (l === 0)
    return !1;
  var f = l;
  if (c > t + f && c > n + f && c > a + f && c > s + f || c < t - f && c < n - f && c < a - f && c < s - f || u > r + f && u > e + f && u > i + f && u > o + f || u < r - f && u < e - f && u < i - f && u < o - f)
    return !1;
  var h = cT(r, t, e, n, i, a, o, s, u, c, null);
  return h <= f / 2;
}
function WT(r, t, e, n, i, a, o, s, l) {
  if (o === 0)
    return !1;
  var u = o;
  if (l > t + u && l > n + u && l > a + u || l < t - u && l < n - u && l < a - u || s > r + u && s > e + u && s > i + u || s < r - u && s < e - u && s < i - u)
    return !1;
  var c = hT(r, t, e, n, i, a, s, l, null);
  return c <= u / 2;
}
var Hb = Math.PI * 2;
function xr(r) {
  return r %= Hb, r < 0 && (r += Hb), r;
}
var rl = Math.PI * 2;
function RN(r, t, e, n, i, a, o, s, l) {
  if (o === 0)
    return !1;
  var u = o;
  s -= r, l -= t;
  var c = Math.sqrt(s * s + l * l);
  if (c - u > e || c + u < e)
    return !1;
  if (Math.abs(n - i) % rl < 1e-4)
    return !0;
  if (a) {
    var f = n;
    n = xr(i), i = xr(f);
  } else
    n = xr(n), i = xr(i);
  n > i && (i += rl);
  var h = Math.atan2(l, s);
  return h < 0 && (h += rl), h >= n && h <= i || h + rl >= n && h + rl <= i;
}
function Zn(r, t, e, n, i, a) {
  if (a > t && a > n || a < t && a < n || n === t)
    return 0;
  var o = (a - t) / (n - t), s = n < t ? 1 : -1;
  (o === 1 || o === 0) && (s = n < t ? 0.5 : -0.5);
  var l = o * (e - r) + r;
  return l === i ? 1 / 0 : l > i ? s : 0;
}
var bi = Bn.CMD, xa = Math.PI * 2, ON = 1e-4;
function FN(r, t) {
  return Math.abs(r - t) < ON;
}
var jt = [-1, -1, -1], Fr = [-1, -1];
function BN() {
  var r = Fr[0];
  Fr[0] = Fr[1], Fr[1] = r;
}
function NN(r, t, e, n, i, a, o, s, l, u) {
  if (u > t && u > n && u > a && u > s || u < t && u < n && u < a && u < s)
    return 0;
  var c = Qf(t, n, a, s, u, jt);
  if (c === 0)
    return 0;
  for (var f = 0, h = -1, v = void 0, d = void 0, p = 0; p < c; p++) {
    var g = jt[p], m = g === 0 || g === 1 ? 0.5 : 1, y = wt(r, e, i, o, g);
    y < l || (h < 0 && (h = uT(t, n, a, s, Fr), Fr[1] < Fr[0] && h > 1 && BN(), v = wt(t, n, a, s, Fr[0]), h > 1 && (d = wt(t, n, a, s, Fr[1]))), h === 2 ? g < Fr[0] ? f += v < t ? m : -m : g < Fr[1] ? f += d < v ? m : -m : f += s < d ? m : -m : g < Fr[0] ? f += v < t ? m : -m : f += s < v ? m : -m);
  }
  return f;
}
function zN(r, t, e, n, i, a, o, s) {
  if (s > t && s > n && s > a || s < t && s < n && s < a)
    return 0;
  var l = Q3(t, n, a, s, jt);
  if (l === 0)
    return 0;
  var u = fT(t, n, a);
  if (u >= 0 && u <= 1) {
    for (var c = 0, f = Lt(t, n, a, u), h = 0; h < l; h++) {
      var v = jt[h] === 0 || jt[h] === 1 ? 0.5 : 1, d = Lt(r, e, i, jt[h]);
      d < o || (jt[h] < u ? c += f < t ? v : -v : c += a < f ? v : -v);
    }
    return c;
  } else {
    var v = jt[0] === 0 || jt[0] === 1 ? 0.5 : 1, d = Lt(r, e, i, jt[0]);
    return d < o ? 0 : a < t ? v : -v;
  }
}
function VN(r, t, e, n, i, a, o, s) {
  if (s -= t, s > e || s < -e)
    return 0;
  var l = Math.sqrt(e * e - s * s);
  jt[0] = -l, jt[1] = l;
  var u = Math.abs(n - i);
  if (u < 1e-4)
    return 0;
  if (u >= xa - 1e-4) {
    n = 0, i = xa;
    var c = a ? 1 : -1;
    return o >= jt[0] + r && o <= jt[1] + r ? c : 0;
  }
  if (n > i) {
    var f = n;
    n = i, i = f;
  }
  n < 0 && (n += xa, i += xa);
  for (var h = 0, v = 0; v < 2; v++) {
    var d = jt[v];
    if (d + r > o) {
      var p = Math.atan2(s, d), c = a ? 1 : -1;
      p < 0 && (p = xa + p), (p >= n && p <= i || p + xa >= n && p + xa <= i) && (p > Math.PI / 2 && p < Math.PI * 1.5 && (c = -c), h += c);
    }
  }
  return h;
}
function UT(r, t, e, n, i) {
  for (var a = r.data, o = r.len(), s = 0, l = 0, u = 0, c = 0, f = 0, h, v, d = 0; d < o; ) {
    var p = a[d++], g = d === 1;
    switch (p === bi.M && d > 1 && (e || (s += Zn(l, u, c, f, n, i))), g && (l = a[d], u = a[d + 1], c = l, f = u), p) {
      case bi.M:
        c = a[d++], f = a[d++], l = c, u = f;
        break;
      case bi.L:
        if (e) {
          if (Ei(l, u, a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += Zn(l, u, a[d], a[d + 1], n, i) || 0;
        l = a[d++], u = a[d++];
        break;
      case bi.C:
        if (e) {
          if (kN(l, u, a[d++], a[d++], a[d++], a[d++], a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += NN(l, u, a[d++], a[d++], a[d++], a[d++], a[d], a[d + 1], n, i) || 0;
        l = a[d++], u = a[d++];
        break;
      case bi.Q:
        if (e) {
          if (WT(l, u, a[d++], a[d++], a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += zN(l, u, a[d++], a[d++], a[d], a[d + 1], n, i) || 0;
        l = a[d++], u = a[d++];
        break;
      case bi.A:
        var m = a[d++], y = a[d++], _ = a[d++], b = a[d++], S = a[d++], x = a[d++];
        d += 1;
        var w = !!(1 - a[d++]);
        h = Math.cos(S) * _ + m, v = Math.sin(S) * b + y, g ? (c = h, f = v) : s += Zn(l, u, h, v, n, i);
        var C = (n - m) * b / _ + m;
        if (e) {
          if (RN(m, y, b, S, S + x, w, t, C, i))
            return !0;
        } else
          s += VN(m, y, b, S, S + x, w, C, i);
        l = Math.cos(S + x) * _ + m, u = Math.sin(S + x) * b + y;
        break;
      case bi.R:
        c = l = a[d++], f = u = a[d++];
        var D = a[d++], A = a[d++];
        if (h = c + D, v = f + A, e) {
          if (Ei(c, f, h, f, t, n, i) || Ei(h, f, h, v, t, n, i) || Ei(h, v, c, v, t, n, i) || Ei(c, v, c, f, t, n, i))
            return !0;
        } else
          s += Zn(h, f, h, v, n, i), s += Zn(c, v, c, f, n, i);
        break;
      case bi.Z:
        if (e) {
          if (Ei(l, u, c, f, t, n, i))
            return !0;
        } else
          s += Zn(l, u, c, f, n, i);
        l = c, u = f;
        break;
    }
  }
  return !e && !FN(u, f) && (s += Zn(l, u, c, f, n, i) || 0), s !== 0;
}
function $N(r, t, e) {
  return UT(r, 0, !1, t, e);
}
function GN(r, t, e, n) {
  return UT(r, t, !0, e, n);
}
var ah = se({
  fill: "#000",
  stroke: null,
  strokePercent: 1,
  fillOpacity: 1,
  strokeOpacity: 1,
  lineDashOffset: 0,
  lineWidth: 1,
  lineCap: "butt",
  miterLimit: 10,
  strokeNoScale: !1,
  strokeFirst: !1
}, no), HN = {
  style: se({
    fill: !0,
    stroke: !0,
    strokePercent: !0,
    fillOpacity: !0,
    strokeOpacity: !0,
    lineDashOffset: !0,
    lineWidth: !0,
    miterLimit: !0
  }, lv.style)
}, Ld = On.concat([
  "invisible",
  "culling",
  "z",
  "z2",
  "zlevel",
  "parent"
]), Te = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.update = function() {
    var e = this;
    r.prototype.update.call(this);
    var n = this.style;
    if (n.decal) {
      var i = this._decalEl = this._decalEl || new t();
      i.buildPath === t.prototype.buildPath && (i.buildPath = function(l) {
        e.buildPath(l, e.shape);
      }), i.silent = !0;
      var a = i.style;
      for (var o in n)
        a[o] !== n[o] && (a[o] = n[o]);
      a.fill = n.fill ? n.decal : null, a.decal = null, a.shadowColor = null, n.strokeFirst && (a.stroke = null);
      for (var s = 0; s < Ld.length; ++s)
        i[Ld[s]] = this[Ld[s]];
      i.__dirty |= br;
    } else this._decalEl && (this._decalEl = null);
  }, t.prototype.getDecalElement = function() {
    return this._decalEl;
  }, t.prototype._init = function(e) {
    var n = Ee(e);
    this.shape = this.getDefaultShape();
    var i = this.getDefaultStyle();
    i && this.useStyle(i);
    for (var a = 0; a < n.length; a++) {
      var o = n[a], s = e[o];
      o === "style" ? this.style ? H(this.style, s) : this.useStyle(s) : o === "shape" ? H(this.shape, s) : r.prototype.attrKV.call(this, o, s);
    }
    this.style || this.useStyle({});
  }, t.prototype.getDefaultStyle = function() {
    return null;
  }, t.prototype.getDefaultShape = function() {
    return {};
  }, t.prototype.canBeInsideText = function() {
    return this.hasFill();
  }, t.prototype.getInsideTextFill = function() {
    var e = this.style.fill;
    if (e !== "none") {
      if (J(e)) {
        var n = th(e, 0);
        return n > 0.5 ? rm : n > 0.2 ? TB : nm;
      } else if (e)
        return nm;
    }
    return rm;
  }, t.prototype.getInsideTextStroke = function(e) {
    var n = this.style.fill;
    if (J(n)) {
      var i = this.__zr, a = !!(i && i.isDarkMode()), o = th(e, 0) < tm;
      if (a === o)
        return n;
    }
  }, t.prototype.buildPath = function(e, n, i) {
  }, t.prototype.pathUpdated = function() {
    this.__dirty &= ~es;
  }, t.prototype.getUpdatedPathProxy = function(e) {
    return !this.path && this.createPathProxy(), this.path.beginPath(), this.buildPath(this.path, this.shape, e), this.path;
  }, t.prototype.createPathProxy = function() {
    this.path = new Bn(!1);
  }, t.prototype.hasStroke = function() {
    var e = this.style, n = e.stroke;
    return !(n == null || n === "none" || !(e.lineWidth > 0));
  }, t.prototype.hasFill = function() {
    var e = this.style, n = e.fill;
    return n != null && n !== "none";
  }, t.prototype.getBoundingRect = function() {
    var e = this._rect, n = this.style, i = !e;
    if (i) {
      var a = !1;
      this.path || (a = !0, this.createPathProxy());
      var o = this.path;
      (a || this.__dirty & es) && (o.beginPath(), this.buildPath(o, this.shape, !1), this.pathUpdated()), e = o.getBoundingRect();
    }
    if (this._rect = e, this.hasStroke() && this.path && this.path.len() > 0) {
      var s = this._rectStroke || (this._rectStroke = e.clone());
      if (this.__dirty || i) {
        s.copy(e);
        var l = n.strokeNoScale ? this.getLineScale() : 1, u = n.lineWidth;
        if (!this.hasFill()) {
          var c = this.strokeContainThreshold;
          u = Math.max(u, c ?? 4);
        }
        l > 1e-10 && (s.width += u / l, s.height += u / l, s.x -= u / l / 2, s.y -= u / l / 2);
      }
      return s;
    }
    return e;
  }, t.prototype.contain = function(e, n) {
    var i = this.transformCoordToLocal(e, n), a = this.getBoundingRect(), o = this.style;
    if (e = i[0], n = i[1], a.contain(e, n)) {
      var s = this.path;
      if (this.hasStroke()) {
        var l = o.lineWidth, u = o.strokeNoScale ? this.getLineScale() : 1;
        if (u > 1e-10 && (this.hasFill() || (l = Math.max(l, this.strokeContainThreshold)), GN(s, l / u, e, n)))
          return !0;
      }
      if (this.hasFill())
        return $N(s, e, n);
    }
    return !1;
  }, t.prototype.dirtyShape = function() {
    this.__dirty |= es, this._rect && (this._rect = null), this._decalEl && this._decalEl.dirtyShape(), this.markRedraw();
  }, t.prototype.dirty = function() {
    this.dirtyStyle(), this.dirtyShape();
  }, t.prototype.animateShape = function(e) {
    return this.animate("shape", e);
  }, t.prototype.updateDuringAnimation = function(e) {
    e === "style" ? this.dirtyStyle() : e === "shape" ? this.dirtyShape() : this.markRedraw();
  }, t.prototype.attrKV = function(e, n) {
    e === "shape" ? this.setShape(n) : r.prototype.attrKV.call(this, e, n);
  }, t.prototype.setShape = function(e, n) {
    var i = this.shape;
    return i || (i = this.shape = {}), typeof e == "string" ? i[e] = n : H(i, e), this.dirtyShape(), this;
  }, t.prototype.shapeChanged = function() {
    return !!(this.__dirty & es);
  }, t.prototype.createStyle = function(e) {
    return tv(ah, e);
  }, t.prototype._innerSaveToNormal = function(e) {
    r.prototype._innerSaveToNormal.call(this, e);
    var n = this._normalState;
    e.shape && !n.shape && (n.shape = H({}, this.shape));
  }, t.prototype._applyStateObj = function(e, n, i, a, o, s) {
    r.prototype._applyStateObj.call(this, e, n, i, a, o, s);
    var l = !(n && a), u;
    if (n && n.shape ? o ? a ? u = n.shape : (u = H({}, i.shape), H(u, n.shape)) : (u = H({}, a ? this.shape : i.shape), H(u, n.shape)) : l && (u = i.shape), u)
      if (o) {
        this.shape = H({}, this.shape);
        for (var c = {}, f = Ee(u), h = 0; h < f.length; h++) {
          var v = f[h];
          typeof u[v] == "object" ? this.shape[v] = u[v] : c[v] = u[v];
        }
        this._transitionState(e, {
          shape: c
        }, s);
      } else
        this.shape = u, this.dirtyShape();
  }, t.prototype._mergeStates = function(e) {
    for (var n = r.prototype._mergeStates.call(this, e), i, a = 0; a < e.length; a++) {
      var o = e[a];
      o.shape && (i = i || {}, this._mergeStyle(i, o.shape));
    }
    return i && (n.shape = i), n;
  }, t.prototype.getAnimationStyleProps = function() {
    return HN;
  }, t.prototype.isZeroArea = function() {
    return !1;
  }, t.extend = function(e) {
    var n = function(a) {
      N(o, a);
      function o(s) {
        var l = a.call(this, s) || this;
        return e.init && e.init.call(l, s), l;
      }
      return o.prototype.getDefaultStyle = function() {
        return ce(e.style);
      }, o.prototype.getDefaultShape = function() {
        return ce(e.shape);
      }, o;
    }(t);
    for (var i in e)
      typeof e[i] == "function" && (n.prototype[i] = e[i]);
    return n;
  }, t.initDefaultProps = function() {
    var e = t.prototype;
    e.type = "path", e.strokeContainThreshold = 5, e.segmentIgnoreThreshold = 0, e.subPixelOptimize = !1, e.autoBatch = !1, e.__dirty = br | Ml | es;
  }(), t;
}(qr), qN = se({
  strokeFirst: !0,
  font: Xi,
  x: 0,
  y: 0,
  textAlign: "left",
  textBaseline: "top",
  miterLimit: 2
}, ah), ms = function(r) {
  N(t, r);
  function t() {
    return r !== null && r.apply(this, arguments) || this;
  }
  return t.prototype.hasStroke = function() {
    var e = this.style, n = e.stroke;
    return n != null && n !== "none" && e.lineWidth > 0;
  }, t.prototype.hasFill = function() {
    var e = this.style, n = e.fill;
    return n != null && n !== "none";
  }, t.prototype.createStyle = function(e) {
    return tv(qN, e);
  }, t.prototype.setBoundingRect = function(e) {
    this._rect = e;
  }, t.prototype.getBoundingRect = function() {
    var e = this.style;
    if (!this._rect) {
      var n = e.text;
      n != null ? n += "" : n = "";
      var i = Vu(n, e.font, e.textAlign, e.textBaseline);
      if (i.x += e.x || 0, i.y += e.y || 0, this.hasStroke()) {
        var a = e.lineWidth;
        i.x -= a / 2, i.y -= a / 2, i.width += a, i.height += a;
      }
      this._rect = i;
    }
    return this._rect;
  }, t.initDefaultProps = function() {
    var e = t.prototype;
    e.dirtyRectTolerance = 10;
  }(), t;
}(qr);
ms.prototype.type = "tspan";
var WN = se({
  x: 0,
  y: 0
}, no), UN = {
  style: se({
    x: !0,
    y: !0,
    width: !0,
    height: !0,
    sx: !0,
    sy: !0,
    sWidth: !0,
    sHeight: !0
  }, lv.style)
};
function YN(r) {
  return !!(r && typeof r != "string" && r.width && r.height);
}
var Pt = function(r) {
  N(t, r);
  function t() {
    return r !== null && r.apply(this, arguments) || this;
  }
  return t.prototype.createStyle = function(e) {
    return tv(WN, e);
  }, t.prototype._getSize = function(e) {
    var n = this.style, i = n[e];
    if (i != null)
      return i;
    var a = YN(n.image) ? n.image : this.__image;
    if (!a)
      return 0;
    var o = e === "width" ? "height" : "width", s = n[o];
    return s == null ? a[e] : a[e] / a[o] * s;
  }, t.prototype.getWidth = function() {
    return this._getSize("width");
  }, t.prototype.getHeight = function() {
    return this._getSize("height");
  }, t.prototype.getAnimationStyleProps = function() {
    return UN;
  }, t.prototype.getBoundingRect = function() {
    var e = this.style;
    return this._rect || (this._rect = new xe(e.x || 0, e.y || 0, this.getWidth(), this.getHeight())), this._rect;
  }, t;
}(qr);
Pt.prototype.type = "image";
function ZN(r, t) {
  var e = t.x, n = t.y, i = t.width, a = t.height, o = t.r, s, l, u, c;
  i < 0 && (e = e + i, i = -i), a < 0 && (n = n + a, a = -a), typeof o == "number" ? s = l = u = c = o : o instanceof Array ? o.length === 1 ? s = l = u = c = o[0] : o.length === 2 ? (s = u = o[0], l = c = o[1]) : o.length === 3 ? (s = o[0], l = c = o[1], u = o[2]) : (s = o[0], l = o[1], u = o[2], c = o[3]) : s = l = u = c = 0;
  var f;
  s + l > i && (f = s + l, s *= i / f, l *= i / f), u + c > i && (f = u + c, u *= i / f, c *= i / f), l + u > a && (f = l + u, l *= a / f, u *= a / f), s + c > a && (f = s + c, s *= a / f, c *= a / f), r.moveTo(e + s, n), r.lineTo(e + i - l, n), l !== 0 && r.arc(e + i - l, n + l, l, -Math.PI / 2, 0), r.lineTo(e + i, n + a - u), u !== 0 && r.arc(e + i - u, n + a - u, u, 0, Math.PI / 2), r.lineTo(e + c, n + a), c !== 0 && r.arc(e + c, n + a - c, c, Math.PI / 2, Math.PI), r.lineTo(e, n + s), s !== 0 && r.arc(e + s, n + s, s, Math.PI, Math.PI * 1.5);
}
var os = Math.round;
function YT(r, t, e) {
  if (t) {
    var n = t.x1, i = t.x2, a = t.y1, o = t.y2;
    r.x1 = n, r.x2 = i, r.y1 = a, r.y2 = o;
    var s = e && e.lineWidth;
    return s && (os(n * 2) === os(i * 2) && (r.x1 = r.x2 = Ua(n, s, !0)), os(a * 2) === os(o * 2) && (r.y1 = r.y2 = Ua(a, s, !0))), r;
  }
}
function ZT(r, t, e) {
  if (t) {
    var n = t.x, i = t.y, a = t.width, o = t.height;
    r.x = n, r.y = i, r.width = a, r.height = o;
    var s = e && e.lineWidth;
    return s && (r.x = Ua(n, s, !0), r.y = Ua(i, s, !0), r.width = Math.max(Ua(n + a, s, !1) - r.x, a === 0 ? 0 : 1), r.height = Math.max(Ua(i + o, s, !1) - r.y, o === 0 ? 0 : 1)), r;
  }
}
function Ua(r, t, e) {
  if (!t)
    return r;
  var n = os(r * 2);
  return (n + os(t)) % 2 === 0 ? n / 2 : (n + (e ? 1 : -1)) / 2;
}
var XN = /* @__PURE__ */ function() {
  function r() {
    this.x = 0, this.y = 0, this.width = 0, this.height = 0;
  }
  return r;
}(), jN = {}, ke = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new XN();
  }, t.prototype.buildPath = function(e, n) {
    var i, a, o, s;
    if (this.subPixelOptimize) {
      var l = ZT(jN, n, this.style);
      i = l.x, a = l.y, o = l.width, s = l.height, l.r = n.r, n = l;
    } else
      i = n.x, a = n.y, o = n.width, s = n.height;
    n.r ? ZN(e, n) : e.rect(i, a, o, s);
  }, t.prototype.isZeroArea = function() {
    return !this.shape.width || !this.shape.height;
  }, t;
}(Te);
ke.prototype.type = "rect";
var qb = {
  fill: "#000"
}, Wb = 2, KN = {
  style: se({
    fill: !0,
    stroke: !0,
    fillOpacity: !0,
    strokeOpacity: !0,
    lineWidth: !0,
    fontSize: !0,
    lineHeight: !0,
    width: !0,
    height: !0,
    textShadowColor: !0,
    textShadowBlur: !0,
    textShadowOffsetX: !0,
    textShadowOffsetY: !0,
    backgroundColor: !0,
    padding: !0,
    borderColor: !0,
    borderWidth: !0,
    borderRadius: !0
  }, lv.style)
}, Fe = function(r) {
  N(t, r);
  function t(e) {
    var n = r.call(this) || this;
    return n.type = "text", n._children = [], n._defaultStyle = qb, n.attr(e), n;
  }
  return t.prototype.childrenRef = function() {
    return this._children;
  }, t.prototype.update = function() {
    r.prototype.update.call(this), this.styleChanged() && this._updateSubTexts();
    for (var e = 0; e < this._children.length; e++) {
      var n = this._children[e];
      n.zlevel = this.zlevel, n.z = this.z, n.z2 = this.z2, n.culling = this.culling, n.cursor = this.cursor, n.invisible = this.invisible;
    }
  }, t.prototype.updateTransform = function() {
    var e = this.innerTransformable;
    e ? (e.updateTransform(), e.transform && (this.transform = e.transform)) : r.prototype.updateTransform.call(this);
  }, t.prototype.getLocalTransform = function(e) {
    var n = this.innerTransformable;
    return n ? n.getLocalTransform(e) : r.prototype.getLocalTransform.call(this, e);
  }, t.prototype.getComputedTransform = function() {
    return this.__hostTarget && (this.__hostTarget.getComputedTransform(), this.__hostTarget.updateInnerText(!0)), r.prototype.getComputedTransform.call(this);
  }, t.prototype._updateSubTexts = function() {
    this._childCursor = 0, ez(this.style), this.style.rich ? this._updateRichTexts() : this._updatePlainTexts(), this._children.length = this._childCursor, this.styleUpdated();
  }, t.prototype.addSelfToZr = function(e) {
    r.prototype.addSelfToZr.call(this, e);
    for (var n = 0; n < this._children.length; n++)
      this._children[n].__zr = e;
  }, t.prototype.removeSelfFromZr = function(e) {
    r.prototype.removeSelfFromZr.call(this, e);
    for (var n = 0; n < this._children.length; n++)
      this._children[n].__zr = null;
  }, t.prototype.getBoundingRect = function() {
    if (this.styleChanged() && this._updateSubTexts(), !this._rect) {
      for (var e = new xe(0, 0, 0, 0), n = this._children, i = [], a = null, o = 0; o < n.length; o++) {
        var s = n[o], l = s.getBoundingRect(), u = s.getLocalTransform(i);
        u ? (e.copy(l), e.applyTransform(u), a = a || e.clone(), a.union(e)) : (a = a || l.clone(), a.union(l));
      }
      this._rect = a || e;
    }
    return this._rect;
  }, t.prototype.setDefaultTextStyle = function(e) {
    this._defaultStyle = e || qb;
  }, t.prototype.setTextContent = function(e) {
  }, t.prototype._mergeStyle = function(e, n) {
    if (!n)
      return e;
    var i = n.rich, a = e.rich || i && {};
    return H(e, n), i && a ? (this._mergeRich(a, i), e.rich = a) : a && (e.rich = a), e;
  }, t.prototype._mergeRich = function(e, n) {
    for (var i = Ee(n), a = 0; a < i.length; a++) {
      var o = i[a];
      e[o] = e[o] || {}, H(e[o], n[o]);
    }
  }, t.prototype.getAnimationStyleProps = function() {
    return KN;
  }, t.prototype._getOrCreateChild = function(e) {
    var n = this._children[this._childCursor];
    return (!n || !(n instanceof e)) && (n = new e()), this._children[this._childCursor++] = n, n.__zr = this.__zr, n.parent = this, n;
  }, t.prototype._updatePlainTexts = function() {
    var e = this.style, n = e.font || Xi, i = e.padding, a = Jb(e), o = SN(a, e), s = Ed(e), l = !!e.backgroundColor, u = o.outerHeight, c = o.outerWidth, f = o.contentWidth, h = o.lines, v = o.lineHeight, d = this._defaultStyle;
    this.isTruncated = !!o.isTruncated;
    var p = e.x || 0, g = e.y || 0, m = e.align || d.align || "left", y = e.verticalAlign || d.verticalAlign || "top", _ = p, b = ts(g, o.contentHeight, y);
    if (s || i) {
      var S = Ll(p, c, m), x = ts(g, u, y);
      s && this._renderBackground(e, e, S, x, c, u);
    }
    b += v / 2, i && (_ = Kb(p, m, i), y === "top" ? b += i[0] : y === "bottom" && (b -= i[2]));
    for (var w = 0, C = !1, D = jb("fill" in e ? e.fill : (C = !0, d.fill)), A = Xb("stroke" in e ? e.stroke : !l && (!d.autoStroke || C) ? (w = Wb, d.stroke) : null), T = e.textShadowBlur > 0, L = e.width != null && (e.overflow === "truncate" || e.overflow === "break" || e.overflow === "breakAll"), E = o.calculatedLineHeight, I = 0; I < h.length; I++) {
      var P = this._getOrCreateChild(ms), R = P.createStyle();
      P.useStyle(R), R.text = h[I], R.x = _, R.y = b, R.textAlign = m, R.textBaseline = "middle", R.opacity = e.opacity, R.strokeFirst = !0, T && (R.shadowBlur = e.textShadowBlur || 0, R.shadowColor = e.textShadowColor || "transparent", R.shadowOffsetX = e.textShadowOffsetX || 0, R.shadowOffsetY = e.textShadowOffsetY || 0), R.stroke = A, R.fill = D, A && (R.lineWidth = e.lineWidth || w, R.lineDash = e.lineDash, R.lineDashOffset = e.lineDashOffset || 0), R.font = n, Yb(R, e), b += v, L && P.setBoundingRect(new xe(Ll(R.x, f, R.textAlign), ts(R.y, E, R.textBaseline), f, E));
    }
  }, t.prototype._updateRichTexts = function() {
    var e = this.style, n = Jb(e), i = CN(n, e), a = i.width, o = i.outerWidth, s = i.outerHeight, l = e.padding, u = e.x || 0, c = e.y || 0, f = this._defaultStyle, h = e.align || f.align, v = e.verticalAlign || f.verticalAlign;
    this.isTruncated = !!i.isTruncated;
    var d = Ll(u, o, h), p = ts(c, s, v), g = d, m = p;
    l && (g += l[3], m += l[0]);
    var y = g + a;
    Ed(e) && this._renderBackground(e, e, d, p, o, s);
    for (var _ = !!e.backgroundColor, b = 0; b < i.lines.length; b++) {
      for (var S = i.lines[b], x = S.tokens, w = x.length, C = S.lineHeight, D = S.width, A = 0, T = g, L = y, E = w - 1, I = void 0; A < w && (I = x[A], !I.align || I.align === "left"); )
        this._placeToken(I, e, C, m, T, "left", _), D -= I.width, T += I.width, A++;
      for (; E >= 0 && (I = x[E], I.align === "right"); )
        this._placeToken(I, e, C, m, L, "right", _), D -= I.width, L -= I.width, E--;
      for (T += (a - (T - g) - (y - L) - D) / 2; A <= E; )
        I = x[A], this._placeToken(I, e, C, m, T + I.width / 2, "center", _), T += I.width, A++;
      m += C;
    }
  }, t.prototype._placeToken = function(e, n, i, a, o, s, l) {
    var u = n.rich[e.styleName] || {};
    u.text = e.text;
    var c = e.verticalAlign, f = a + i / 2;
    c === "top" ? f = a + e.height / 2 : c === "bottom" && (f = a + i - e.height / 2);
    var h = !e.isLineHolder && Ed(u);
    h && this._renderBackground(u, n, s === "right" ? o - e.width : s === "center" ? o - e.width / 2 : o, f - e.height / 2, e.width, e.height);
    var v = !!u.backgroundColor, d = e.textPadding;
    d && (o = Kb(o, s, d), f -= e.height / 2 - d[0] - e.innerHeight / 2);
    var p = this._getOrCreateChild(ms), g = p.createStyle();
    p.useStyle(g);
    var m = this._defaultStyle, y = !1, _ = 0, b = jb("fill" in u ? u.fill : "fill" in n ? n.fill : (y = !0, m.fill)), S = Xb("stroke" in u ? u.stroke : "stroke" in n ? n.stroke : !v && !l && (!m.autoStroke || y) ? (_ = Wb, m.stroke) : null), x = u.textShadowBlur > 0 || n.textShadowBlur > 0;
    g.text = e.text, g.x = o, g.y = f, x && (g.shadowBlur = u.textShadowBlur || n.textShadowBlur || 0, g.shadowColor = u.textShadowColor || n.textShadowColor || "transparent", g.shadowOffsetX = u.textShadowOffsetX || n.textShadowOffsetX || 0, g.shadowOffsetY = u.textShadowOffsetY || n.textShadowOffsetY || 0), g.textAlign = s, g.textBaseline = "middle", g.font = e.font || Xi, g.opacity = En(u.opacity, n.opacity, 1), Yb(g, u), S && (g.lineWidth = En(u.lineWidth, n.lineWidth, _), g.lineDash = me(u.lineDash, n.lineDash), g.lineDashOffset = n.lineDashOffset || 0, g.stroke = S), b && (g.fill = b);
    var w = e.contentWidth, C = e.contentHeight;
    p.setBoundingRect(new xe(Ll(g.x, w, g.textAlign), ts(g.y, C, g.textBaseline), w, C));
  }, t.prototype._renderBackground = function(e, n, i, a, o, s) {
    var l = e.backgroundColor, u = e.borderWidth, c = e.borderColor, f = l && l.image, h = l && !f, v = e.borderRadius, d = this, p, g;
    if (h || e.lineHeight || u && c) {
      p = this._getOrCreateChild(ke), p.useStyle(p.createStyle()), p.style.fill = null;
      var m = p.shape;
      m.x = i, m.y = a, m.width = o, m.height = s, m.r = v, p.dirtyShape();
    }
    if (h) {
      var y = p.style;
      y.fill = l || null, y.fillOpacity = me(e.fillOpacity, 1);
    } else if (f) {
      g = this._getOrCreateChild(Pt), g.onload = function() {
        d.dirtyStyle();
      };
      var _ = g.style;
      _.image = l.image, _.x = i, _.y = a, _.width = o, _.height = s;
    }
    if (u && c) {
      var y = p.style;
      y.lineWidth = u, y.stroke = c, y.strokeOpacity = me(e.strokeOpacity, 1), y.lineDash = e.borderDash, y.lineDashOffset = e.borderDashOffset || 0, p.strokeContainThreshold = 0, p.hasFill() && p.hasStroke() && (y.strokeFirst = !0, y.lineWidth *= 2);
    }
    var b = (p || g).style;
    b.shadowBlur = e.shadowBlur || 0, b.shadowColor = e.shadowColor || "transparent", b.shadowOffsetX = e.shadowOffsetX || 0, b.shadowOffsetY = e.shadowOffsetY || 0, b.opacity = En(e.opacity, n.opacity, 1);
  }, t.makeFont = function(e) {
    var n = "";
    return jT(e) && (n = [
      e.fontStyle,
      e.fontWeight,
      XT(e.fontSize),
      e.fontFamily || "sans-serif"
    ].join(" ")), n && tn(n) || e.textFont || e.font;
  }, t;
}(qr), JN = { left: !0, right: 1, center: 1 }, QN = { top: 1, bottom: 1, middle: 1 }, Ub = ["fontStyle", "fontWeight", "fontSize", "fontFamily"];
function XT(r) {
  return typeof r == "string" && (r.indexOf("px") !== -1 || r.indexOf("rem") !== -1 || r.indexOf("em") !== -1) ? r : isNaN(+r) ? qy + "px" : r + "px";
}
function Yb(r, t) {
  for (var e = 0; e < Ub.length; e++) {
    var n = Ub[e], i = t[n];
    i != null && (r[n] = i);
  }
}
function jT(r) {
  return r.fontSize != null || r.fontFamily || r.fontWeight;
}
function ez(r) {
  return Zb(r), M(r.rich, Zb), r;
}
function Zb(r) {
  if (r) {
    r.font = Fe.makeFont(r);
    var t = r.align;
    t === "middle" && (t = "center"), r.align = t == null || JN[t] ? t : "left";
    var e = r.verticalAlign;
    e === "center" && (e = "middle"), r.verticalAlign = e == null || QN[e] ? e : "top";
    var n = r.padding;
    n && (r.padding = jy(r.padding));
  }
}
function Xb(r, t) {
  return r == null || t <= 0 || r === "transparent" || r === "none" ? null : r.image || r.colorStops ? "#000" : r;
}
function jb(r) {
  return r == null || r === "none" ? null : r.image || r.colorStops ? "#000" : r;
}
function Kb(r, t, e) {
  return t === "right" ? r - e[1] : t === "center" ? r + e[3] / 2 - e[1] / 2 : r + e[3];
}
function Jb(r) {
  var t = r.text;
  return t != null && (t += ""), t;
}
function Ed(r) {
  return !!(r.backgroundColor || r.lineHeight || r.borderWidth && r.borderColor);
}
var pe = Oe(), um = function(r, t, e, n) {
  if (n) {
    var i = pe(n);
    i.dataIndex = e, i.dataType = t, i.seriesIndex = r, i.ssrType = "chart", n.type === "group" && n.traverse(function(a) {
      var o = pe(a);
      o.seriesIndex = r, o.dataIndex = e, o.dataType = t, o.ssrType = "chart";
    });
  }
}, Qb = 1, eS = {}, KT = Oe(), u0 = Oe(), c0 = 0, Gu = 1, cv = 2, nr = ["emphasis", "blur", "select"], gu = ["normal", "emphasis", "blur", "select"], Ps = 10, tz = 9, io = "highlight", Lf = "downplay", Zl = "select", Ef = "unselect", Xl = "toggleSelect";
function Oo(r) {
  return r != null && r !== "none";
}
function fv(r, t, e) {
  r.onHoverStateChange && (r.hoverState || 0) !== e && r.onHoverStateChange(t), r.hoverState = e;
}
function JT(r) {
  fv(r, "emphasis", cv);
}
function QT(r) {
  r.hoverState === cv && fv(r, "normal", c0);
}
function f0(r) {
  fv(r, "blur", Gu);
}
function eM(r) {
  r.hoverState === Gu && fv(r, "normal", c0);
}
function rz(r) {
  r.selected = !0;
}
function nz(r) {
  r.selected = !1;
}
function tS(r, t, e) {
  t(r, e);
}
function di(r, t, e) {
  tS(r, t, e), r.isGroup && r.traverse(function(n) {
    tS(n, t, e);
  });
}
function oh(r, t) {
  switch (t) {
    case "emphasis":
      r.hoverState = cv;
      break;
    case "normal":
      r.hoverState = c0;
      break;
    case "blur":
      r.hoverState = Gu;
      break;
    case "select":
      r.selected = !0;
  }
}
function iz(r, t, e, n) {
  for (var i = r.style, a = {}, o = 0; o < t.length; o++) {
    var s = t[o], l = i[s];
    a[s] = l ?? (n && n[s]);
  }
  for (var o = 0; o < r.animators.length; o++) {
    var u = r.animators[o];
    u.__fromStateTransition && u.__fromStateTransition.indexOf(e) < 0 && u.targetName === "style" && u.saveTo(a, t);
  }
  return a;
}
function az(r, t, e, n) {
  var i = e && we(e, "select") >= 0, a = !1;
  if (r instanceof Te) {
    var o = KT(r), s = i && o.selectFill || o.normalFill, l = i && o.selectStroke || o.normalStroke;
    if (Oo(s) || Oo(l)) {
      n = n || {};
      var u = n.style || {};
      u.fill === "inherit" ? (a = !0, n = H({}, n), u = H({}, u), u.fill = s) : !Oo(u.fill) && Oo(s) ? (a = !0, n = H({}, n), u = H({}, u), u.fill = Zg(s)) : !Oo(u.stroke) && Oo(l) && (a || (n = H({}, n), u = H({}, u)), u.stroke = Zg(l)), n.style = u;
    }
  }
  if (n && n.z2 == null) {
    a || (n = H({}, n));
    var c = r.z2EmphasisLift;
    n.z2 = r.z2 + (c ?? Ps);
  }
  return n;
}
function oz(r, t, e) {
  if (e && e.z2 == null) {
    e = H({}, e);
    var n = r.z2SelectLift;
    e.z2 = r.z2 + (n ?? tz);
  }
  return e;
}
function sz(r, t, e) {
  var n = we(r.currentStates, t) >= 0, i = r.style.opacity, a = n ? null : iz(r, ["opacity"], t, {
    opacity: 1
  });
  e = e || {};
  var o = e.style || {};
  return o.opacity == null && (e = H({}, e), o = H({
    // Already being applied 'emphasis'. DON'T mul opacity multiple times.
    opacity: n ? i : a.opacity * 0.1
  }, o), e.style = o), e;
}
function Pd(r, t) {
  var e = this.states[r];
  if (this.style) {
    if (r === "emphasis")
      return az(this, r, t, e);
    if (r === "blur")
      return sz(this, r, e);
    if (r === "select")
      return oz(this, r, e);
  }
  return e;
}
function go(r) {
  r.stateProxy = Pd;
  var t = r.getTextContent(), e = r.getTextGuideLine();
  t && (t.stateProxy = Pd), e && (e.stateProxy = Pd);
}
function rS(r, t) {
  !iM(r, t) && !r.__highByOuter && di(r, JT);
}
function nS(r, t) {
  !iM(r, t) && !r.__highByOuter && di(r, QT);
}
function oi(r, t) {
  r.__highByOuter |= 1 << (t || 0), di(r, JT);
}
function si(r, t) {
  !(r.__highByOuter &= ~(1 << (t || 0))) && di(r, QT);
}
function tM(r) {
  di(r, f0);
}
function h0(r) {
  di(r, eM);
}
function rM(r) {
  di(r, rz);
}
function nM(r) {
  di(r, nz);
}
function iM(r, t) {
  return r.__highDownSilentOnTouch && t.zrByTouch;
}
function aM(r) {
  var t = r.getModel(), e = [], n = [];
  t.eachComponent(function(i, a) {
    var o = u0(a), s = i === "series", l = s ? r.getViewOfSeriesModel(a) : r.getViewOfComponentModel(a);
    !s && n.push(l), o.isBlured && (l.group.traverse(function(u) {
      eM(u);
    }), s && e.push(a)), o.isBlured = !1;
  }), M(n, function(i) {
    i && i.toggleBlurSeries && i.toggleBlurSeries(e, !1, t);
  });
}
function cm(r, t, e, n) {
  var i = n.getModel();
  e = e || "coordinateSystem";
  function a(u, c) {
    for (var f = 0; f < c.length; f++) {
      var h = u.getItemGraphicEl(c[f]);
      h && h0(h);
    }
  }
  if (r != null && !(!t || t === "none")) {
    var o = i.getSeriesByIndex(r), s = o.coordinateSystem;
    s && s.master && (s = s.master);
    var l = [];
    i.eachSeries(function(u) {
      var c = o === u, f = u.coordinateSystem;
      f && f.master && (f = f.master);
      var h = f && s ? f === s : c;
      if (!// Not blur other series if blurScope series
      (e === "series" && !c || e === "coordinateSystem" && !h || t === "series" && c)) {
        var v = n.getViewOfSeriesModel(u);
        if (v.group.traverse(function(g) {
          g.__highByOuter && c && t === "self" || f0(g);
        }), qt(t))
          a(u.getData(), t);
        else if (ue(t))
          for (var d = Ee(t), p = 0; p < d.length; p++)
            a(u.getData(d[p]), t[d[p]]);
        l.push(u), u0(u).isBlured = !0;
      }
    }), i.eachComponent(function(u, c) {
      if (u !== "series") {
        var f = n.getViewOfComponentModel(c);
        f && f.toggleBlurSeries && f.toggleBlurSeries(l, !0, i);
      }
    });
  }
}
function fm(r, t, e) {
  if (!(r == null || t == null)) {
    var n = e.getModel().getComponent(r, t);
    if (n) {
      u0(n).isBlured = !0;
      var i = e.getViewOfComponentModel(n);
      !i || !i.focusBlurEnabled || i.group.traverse(function(a) {
        f0(a);
      });
    }
  }
}
function lz(r, t, e) {
  var n = r.seriesIndex, i = r.getData(t.dataType);
  if (i) {
    var a = vo(i, t);
    a = (q(a) ? a[0] : a) || 0;
    var o = i.getItemGraphicEl(a);
    if (!o)
      for (var s = i.count(), l = 0; !o && l < s; )
        o = i.getItemGraphicEl(l++);
    if (o) {
      var u = pe(o);
      cm(n, u.focus, u.blurScope, e);
    } else {
      var c = r.get(["emphasis", "focus"]), f = r.get(["emphasis", "blurScope"]);
      c != null && cm(n, c, f, e);
    }
  }
}
function v0(r, t, e, n) {
  var i = {
    focusSelf: !1,
    dispatchers: null
  };
  if (r == null || r === "series" || t == null || e == null)
    return i;
  var a = n.getModel().getComponent(r, t);
  if (!a)
    return i;
  var o = n.getViewOfComponentModel(a);
  if (!o || !o.findHighDownDispatchers)
    return i;
  for (var s = o.findHighDownDispatchers(e), l, u = 0; u < s.length; u++)
    if (pe(s[u]).focus === "self") {
      l = !0;
      break;
    }
  return {
    focusSelf: l,
    dispatchers: s
  };
}
function uz(r, t, e) {
  var n = pe(r), i = v0(n.componentMainType, n.componentIndex, n.componentHighDownName, e), a = i.dispatchers, o = i.focusSelf;
  a ? (o && fm(n.componentMainType, n.componentIndex, e), M(a, function(s) {
    return rS(s, t);
  })) : (cm(n.seriesIndex, n.focus, n.blurScope, e), n.focus === "self" && fm(n.componentMainType, n.componentIndex, e), rS(r, t));
}
function cz(r, t, e) {
  aM(e);
  var n = pe(r), i = v0(n.componentMainType, n.componentIndex, n.componentHighDownName, e).dispatchers;
  i ? M(i, function(a) {
    return nS(a, t);
  }) : nS(r, t);
}
function fz(r, t, e) {
  if (vm(t)) {
    var n = t.dataType, i = r.getData(n), a = vo(i, t);
    q(a) || (a = [a]), r[t.type === Xl ? "toggleSelect" : t.type === Zl ? "select" : "unselect"](a, n);
  }
}
function iS(r) {
  var t = r.getAllData();
  M(t, function(e) {
    var n = e.data, i = e.type;
    n.eachItemGraphicEl(function(a, o) {
      r.isSelected(o, i) ? rM(a) : nM(a);
    });
  });
}
function hz(r) {
  var t = [];
  return r.eachSeries(function(e) {
    var n = e.getAllData();
    M(n, function(i) {
      i.data;
      var a = i.type, o = e.getSelectedDataIndices();
      if (o.length > 0) {
        var s = {
          dataIndex: o,
          seriesIndex: e.seriesIndex
        };
        a != null && (s.dataType = a), t.push(s);
      }
    });
  }), t;
}
function ao(r, t, e) {
  Ya(r, !0), di(r, go), hm(r, t, e);
}
function vz(r) {
  Ya(r, !1);
}
function ut(r, t, e, n) {
  n ? vz(r) : ao(r, t, e);
}
function hm(r, t, e) {
  var n = pe(r);
  t != null ? (n.focus = t, n.blurScope = e) : n.focus && (n.focus = null);
}
var aS = ["emphasis", "blur", "select"], dz = {
  itemStyle: "getItemStyle",
  lineStyle: "getLineStyle",
  areaStyle: "getAreaStyle"
};
function Ft(r, t, e, n) {
  e = e || "itemStyle";
  for (var i = 0; i < aS.length; i++) {
    var a = aS[i], o = t.getModel([a, e]), s = r.ensureState(a);
    s.style = n ? n(o) : o[dz[e]]();
  }
}
function Ya(r, t) {
  var e = t === !1, n = r;
  r.highDownSilentOnTouch && (n.__highDownSilentOnTouch = r.highDownSilentOnTouch), (!e || n.__highDownDispatcher) && (n.__highByOuter = n.__highByOuter || 0, n.__highDownDispatcher = !e);
}
function mu(r) {
  return !!(r && r.__highDownDispatcher);
}
function pz(r, t, e) {
  var n = pe(r);
  n.componentMainType = t.mainType, n.componentIndex = t.componentIndex, n.componentHighDownName = e;
}
function gz(r) {
  var t = eS[r];
  return t == null && Qb <= 32 && (t = eS[r] = Qb++), t;
}
function vm(r) {
  var t = r.type;
  return t === Zl || t === Ef || t === Xl;
}
function oS(r) {
  var t = r.type;
  return t === io || t === Lf;
}
function mz(r) {
  var t = KT(r);
  t.normalFill = r.style.fill, t.normalStroke = r.style.stroke;
  var e = r.states.select || {};
  t.selectFill = e.style && e.style.fill || null, t.selectStroke = e.style && e.style.stroke || null;
}
var Fo = Bn.CMD, yz = [[], [], []], sS = Math.sqrt, _z = Math.atan2;
function oM(r, t) {
  if (t) {
    var e = r.data, n = r.len(), i, a, o, s, l, u, c = Fo.M, f = Fo.C, h = Fo.L, v = Fo.R, d = Fo.A, p = Fo.Q;
    for (o = 0, s = 0; o < n; ) {
      switch (i = e[o++], s = o, a = 0, i) {
        case c:
          a = 1;
          break;
        case h:
          a = 1;
          break;
        case f:
          a = 3;
          break;
        case p:
          a = 2;
          break;
        case d:
          var g = t[4], m = t[5], y = sS(t[0] * t[0] + t[1] * t[1]), _ = sS(t[2] * t[2] + t[3] * t[3]), b = _z(-t[1] / _, t[0] / y);
          e[o] *= y, e[o++] += g, e[o] *= _, e[o++] += m, e[o++] *= y, e[o++] *= _, e[o++] += b, e[o++] += b, o += 2, s = o;
          break;
        case v:
          u[0] = e[o++], u[1] = e[o++], Rt(u, u, t), e[s++] = u[0], e[s++] = u[1], u[0] += e[o++], u[1] += e[o++], Rt(u, u, t), e[s++] = u[0], e[s++] = u[1];
      }
      for (l = 0; l < a; l++) {
        var S = yz[l];
        S[0] = e[o++], S[1] = e[o++], Rt(S, S, t), e[s++] = S[0], e[s++] = S[1];
      }
    }
    r.increaseVersion();
  }
}
var kd = Math.sqrt, Dc = Math.sin, Tc = Math.cos, nl = Math.PI;
function lS(r) {
  return Math.sqrt(r[0] * r[0] + r[1] * r[1]);
}
function dm(r, t) {
  return (r[0] * t[0] + r[1] * t[1]) / (lS(r) * lS(t));
}
function uS(r, t) {
  return (r[0] * t[1] < r[1] * t[0] ? -1 : 1) * Math.acos(dm(r, t));
}
function cS(r, t, e, n, i, a, o, s, l, u, c) {
  var f = l * (nl / 180), h = Tc(f) * (r - e) / 2 + Dc(f) * (t - n) / 2, v = -1 * Dc(f) * (r - e) / 2 + Tc(f) * (t - n) / 2, d = h * h / (o * o) + v * v / (s * s);
  d > 1 && (o *= kd(d), s *= kd(d));
  var p = (i === a ? -1 : 1) * kd((o * o * (s * s) - o * o * (v * v) - s * s * (h * h)) / (o * o * (v * v) + s * s * (h * h))) || 0, g = p * o * v / s, m = p * -s * h / o, y = (r + e) / 2 + Tc(f) * g - Dc(f) * m, _ = (t + n) / 2 + Dc(f) * g + Tc(f) * m, b = uS([1, 0], [(h - g) / o, (v - m) / s]), S = [(h - g) / o, (v - m) / s], x = [(-1 * h - g) / o, (-1 * v - m) / s], w = uS(S, x);
  if (dm(S, x) <= -1 && (w = nl), dm(S, x) >= 1 && (w = 0), w < 0) {
    var C = Math.round(w / nl * 1e6) / 1e6;
    w = nl * 2 + C % 2 * nl;
  }
  c.addData(u, y, _, o, s, b, w, f, a);
}
var bz = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig, Sz = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function xz(r) {
  var t = new Bn();
  if (!r)
    return t;
  var e = 0, n = 0, i = e, a = n, o, s = Bn.CMD, l = r.match(bz);
  if (!l)
    return t;
  for (var u = 0; u < l.length; u++) {
    for (var c = l[u], f = c.charAt(0), h = void 0, v = c.match(Sz) || [], d = v.length, p = 0; p < d; p++)
      v[p] = parseFloat(v[p]);
    for (var g = 0; g < d; ) {
      var m = void 0, y = void 0, _ = void 0, b = void 0, S = void 0, x = void 0, w = void 0, C = e, D = n, A = void 0, T = void 0;
      switch (f) {
        case "l":
          e += v[g++], n += v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "L":
          e = v[g++], n = v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "m":
          e += v[g++], n += v[g++], h = s.M, t.addData(h, e, n), i = e, a = n, f = "l";
          break;
        case "M":
          e = v[g++], n = v[g++], h = s.M, t.addData(h, e, n), i = e, a = n, f = "L";
          break;
        case "h":
          e += v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "H":
          e = v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "v":
          n += v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "V":
          n = v[g++], h = s.L, t.addData(h, e, n);
          break;
        case "C":
          h = s.C, t.addData(h, v[g++], v[g++], v[g++], v[g++], v[g++], v[g++]), e = v[g - 2], n = v[g - 1];
          break;
        case "c":
          h = s.C, t.addData(h, v[g++] + e, v[g++] + n, v[g++] + e, v[g++] + n, v[g++] + e, v[g++] + n), e += v[g - 2], n += v[g - 1];
          break;
        case "S":
          m = e, y = n, A = t.len(), T = t.data, o === s.C && (m += e - T[A - 4], y += n - T[A - 3]), h = s.C, C = v[g++], D = v[g++], e = v[g++], n = v[g++], t.addData(h, m, y, C, D, e, n);
          break;
        case "s":
          m = e, y = n, A = t.len(), T = t.data, o === s.C && (m += e - T[A - 4], y += n - T[A - 3]), h = s.C, C = e + v[g++], D = n + v[g++], e += v[g++], n += v[g++], t.addData(h, m, y, C, D, e, n);
          break;
        case "Q":
          C = v[g++], D = v[g++], e = v[g++], n = v[g++], h = s.Q, t.addData(h, C, D, e, n);
          break;
        case "q":
          C = v[g++] + e, D = v[g++] + n, e += v[g++], n += v[g++], h = s.Q, t.addData(h, C, D, e, n);
          break;
        case "T":
          m = e, y = n, A = t.len(), T = t.data, o === s.Q && (m += e - T[A - 4], y += n - T[A - 3]), e = v[g++], n = v[g++], h = s.Q, t.addData(h, m, y, e, n);
          break;
        case "t":
          m = e, y = n, A = t.len(), T = t.data, o === s.Q && (m += e - T[A - 4], y += n - T[A - 3]), e += v[g++], n += v[g++], h = s.Q, t.addData(h, m, y, e, n);
          break;
        case "A":
          _ = v[g++], b = v[g++], S = v[g++], x = v[g++], w = v[g++], C = e, D = n, e = v[g++], n = v[g++], h = s.A, cS(C, D, e, n, x, w, _, b, S, h, t);
          break;
        case "a":
          _ = v[g++], b = v[g++], S = v[g++], x = v[g++], w = v[g++], C = e, D = n, e += v[g++], n += v[g++], h = s.A, cS(C, D, e, n, x, w, _, b, S, h, t);
          break;
      }
    }
    (f === "z" || f === "Z") && (h = s.Z, t.addData(h), e = i, n = a), o = h;
  }
  return t.toStatic(), t;
}
var sM = function(r) {
  N(t, r);
  function t() {
    return r !== null && r.apply(this, arguments) || this;
  }
  return t.prototype.applyTransform = function(e) {
  }, t;
}(Te);
function lM(r) {
  return r.setData != null;
}
function uM(r, t) {
  var e = xz(r), n = H({}, t);
  return n.buildPath = function(i) {
    if (lM(i)) {
      i.setData(e.data);
      var a = i.getContext();
      a && i.rebuildPath(a, 1);
    } else {
      var a = i;
      e.rebuildPath(a, 1);
    }
  }, n.applyTransform = function(i) {
    oM(e, i), this.dirtyShape();
  }, n;
}
function cM(r, t) {
  return new sM(uM(r, t));
}
function wz(r, t) {
  var e = uM(r, t), n = function(i) {
    N(a, i);
    function a(o) {
      var s = i.call(this, o) || this;
      return s.applyTransform = e.applyTransform, s.buildPath = e.buildPath, s;
    }
    return a;
  }(sM);
  return n;
}
function Cz(r, t) {
  for (var e = [], n = r.length, i = 0; i < n; i++) {
    var a = r[i];
    e.push(a.getUpdatedPathProxy(!0));
  }
  var o = new Te(t);
  return o.createPathProxy(), o.buildPath = function(s) {
    if (lM(s)) {
      s.appendPath(e);
      var l = s.getContext();
      l && s.rebuildPath(l, 1);
    }
  }, o;
}
function d0(r, t) {
  t = t || {};
  var e = new Te();
  return r.shape && e.setShape(r.shape), e.setStyle(r.style), t.bakeTransform ? oM(e.path, r.getComputedTransform()) : t.toLocal ? e.setLocalTransform(r.getComputedTransform()) : e.copyTransform(r), e.buildPath = r.buildPath, e.applyTransform = e.applyTransform, e.z = r.z, e.z2 = r.z2, e.zlevel = r.zlevel, e;
}
var Az = /* @__PURE__ */ function() {
  function r() {
    this.cx = 0, this.cy = 0, this.r = 0;
  }
  return r;
}(), pi = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new Az();
  }, t.prototype.buildPath = function(e, n) {
    e.moveTo(n.cx + n.r, n.cy), e.arc(n.cx, n.cy, n.r, 0, Math.PI * 2);
  }, t;
}(Te);
pi.prototype.type = "circle";
var Dz = /* @__PURE__ */ function() {
  function r() {
    this.cx = 0, this.cy = 0, this.rx = 0, this.ry = 0;
  }
  return r;
}(), hv = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new Dz();
  }, t.prototype.buildPath = function(e, n) {
    var i = 0.5522848, a = n.cx, o = n.cy, s = n.rx, l = n.ry, u = s * i, c = l * i;
    e.moveTo(a - s, o), e.bezierCurveTo(a - s, o - c, a - u, o - l, a, o - l), e.bezierCurveTo(a + u, o - l, a + s, o - c, a + s, o), e.bezierCurveTo(a + s, o + c, a + u, o + l, a, o + l), e.bezierCurveTo(a - u, o + l, a - s, o + c, a - s, o), e.closePath();
  }, t;
}(Te);
hv.prototype.type = "ellipse";
var fM = Math.PI, Rd = fM * 2, wa = Math.sin, Bo = Math.cos, Tz = Math.acos, zt = Math.atan2, fS = Math.abs, jl = Math.sqrt, El = Math.max, _n = Math.min, Kr = 1e-4;
function Mz(r, t, e, n, i, a, o, s) {
  var l = e - r, u = n - t, c = o - i, f = s - a, h = f * l - c * u;
  if (!(h * h < Kr))
    return h = (c * (t - a) - f * (r - i)) / h, [r + h * l, t + h * u];
}
function Mc(r, t, e, n, i, a, o) {
  var s = r - e, l = t - n, u = (o ? a : -a) / jl(s * s + l * l), c = u * l, f = -u * s, h = r + c, v = t + f, d = e + c, p = n + f, g = (h + d) / 2, m = (v + p) / 2, y = d - h, _ = p - v, b = y * y + _ * _, S = i - a, x = h * p - d * v, w = (_ < 0 ? -1 : 1) * jl(El(0, S * S * b - x * x)), C = (x * _ - y * w) / b, D = (-x * y - _ * w) / b, A = (x * _ + y * w) / b, T = (-x * y + _ * w) / b, L = C - g, E = D - m, I = A - g, P = T - m;
  return L * L + E * E > I * I + P * P && (C = A, D = T), {
    cx: C,
    cy: D,
    x0: -c,
    y0: -f,
    x1: C * (i / S - 1),
    y1: D * (i / S - 1)
  };
}
function Iz(r) {
  var t;
  if (q(r)) {
    var e = r.length;
    if (!e)
      return r;
    e === 1 ? t = [r[0], r[0], 0, 0] : e === 2 ? t = [r[0], r[0], r[1], r[1]] : e === 3 ? t = r.concat(r[2]) : t = r;
  } else
    t = [r, r, r, r];
  return t;
}
function Lz(r, t) {
  var e, n = El(t.r, 0), i = El(t.r0 || 0, 0), a = n > 0, o = i > 0;
  if (!(!a && !o)) {
    if (a || (n = i, i = 0), i > n) {
      var s = n;
      n = i, i = s;
    }
    var l = t.startAngle, u = t.endAngle;
    if (!(isNaN(l) || isNaN(u))) {
      var c = t.cx, f = t.cy, h = !!t.clockwise, v = fS(u - l), d = v > Rd && v % Rd;
      if (d > Kr && (v = d), !(n > Kr))
        r.moveTo(c, f);
      else if (v > Rd - Kr)
        r.moveTo(c + n * Bo(l), f + n * wa(l)), r.arc(c, f, n, l, u, !h), i > Kr && (r.moveTo(c + i * Bo(u), f + i * wa(u)), r.arc(c, f, i, u, l, h));
      else {
        var p = void 0, g = void 0, m = void 0, y = void 0, _ = void 0, b = void 0, S = void 0, x = void 0, w = void 0, C = void 0, D = void 0, A = void 0, T = void 0, L = void 0, E = void 0, I = void 0, P = n * Bo(l), R = n * wa(l), F = i * Bo(u), O = i * wa(u), z = v > Kr;
        if (z) {
          var G = t.cornerRadius;
          G && (e = Iz(G), p = e[0], g = e[1], m = e[2], y = e[3]);
          var W = fS(n - i) / 2;
          if (_ = _n(W, m), b = _n(W, y), S = _n(W, p), x = _n(W, g), D = w = El(_, b), A = C = El(S, x), (w > Kr || C > Kr) && (T = n * Bo(u), L = n * wa(u), E = i * Bo(l), I = i * wa(l), v < fM)) {
            var Y = Mz(P, R, E, I, T, L, F, O);
            if (Y) {
              var j = P - Y[0], ee = R - Y[1], ie = T - Y[0], Me = L - Y[1], We = 1 / wa(Tz((j * ie + ee * Me) / (jl(j * j + ee * ee) * jl(ie * ie + Me * Me))) / 2), ve = jl(Y[0] * Y[0] + Y[1] * Y[1]);
              D = _n(w, (n - ve) / (We + 1)), A = _n(C, (i - ve) / (We - 1));
            }
          }
        }
        if (!z)
          r.moveTo(c + P, f + R);
        else if (D > Kr) {
          var ae = _n(m, D), be = _n(y, D), ne = Mc(E, I, P, R, n, ae, h), de = Mc(T, L, F, O, n, be, h);
          r.moveTo(c + ne.cx + ne.x0, f + ne.cy + ne.y0), D < w && ae === be ? r.arc(c + ne.cx, f + ne.cy, D, zt(ne.y0, ne.x0), zt(de.y0, de.x0), !h) : (ae > 0 && r.arc(c + ne.cx, f + ne.cy, ae, zt(ne.y0, ne.x0), zt(ne.y1, ne.x1), !h), r.arc(c, f, n, zt(ne.cy + ne.y1, ne.cx + ne.x1), zt(de.cy + de.y1, de.cx + de.x1), !h), be > 0 && r.arc(c + de.cx, f + de.cy, be, zt(de.y1, de.x1), zt(de.y0, de.x0), !h));
        } else
          r.moveTo(c + P, f + R), r.arc(c, f, n, l, u, !h);
        if (!(i > Kr) || !z)
          r.lineTo(c + F, f + O);
        else if (A > Kr) {
          var ae = _n(p, A), be = _n(g, A), ne = Mc(F, O, T, L, i, -be, h), de = Mc(P, R, E, I, i, -ae, h);
          r.lineTo(c + ne.cx + ne.x0, f + ne.cy + ne.y0), A < C && ae === be ? r.arc(c + ne.cx, f + ne.cy, A, zt(ne.y0, ne.x0), zt(de.y0, de.x0), !h) : (be > 0 && r.arc(c + ne.cx, f + ne.cy, be, zt(ne.y0, ne.x0), zt(ne.y1, ne.x1), !h), r.arc(c, f, i, zt(ne.cy + ne.y1, ne.cx + ne.x1), zt(de.cy + de.y1, de.cx + de.x1), h), ae > 0 && r.arc(c + de.cx, f + de.cy, ae, zt(de.y1, de.x1), zt(de.y0, de.x0), !h));
        } else
          r.lineTo(c + F, f + O), r.arc(c, f, i, u, l, h);
      }
      r.closePath();
    }
  }
}
var Ez = /* @__PURE__ */ function() {
  function r() {
    this.cx = 0, this.cy = 0, this.r0 = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0, this.cornerRadius = 0;
  }
  return r;
}(), ir = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new Ez();
  }, t.prototype.buildPath = function(e, n) {
    Lz(e, n);
  }, t.prototype.isZeroArea = function() {
    return this.shape.startAngle === this.shape.endAngle || this.shape.r === this.shape.r0;
  }, t;
}(Te);
ir.prototype.type = "sector";
var Pz = /* @__PURE__ */ function() {
  function r() {
    this.cx = 0, this.cy = 0, this.r = 0, this.r0 = 0;
  }
  return r;
}(), Hu = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new Pz();
  }, t.prototype.buildPath = function(e, n) {
    var i = n.cx, a = n.cy, o = Math.PI * 2;
    e.moveTo(i + n.r, a), e.arc(i, a, n.r, 0, o, !1), e.moveTo(i + n.r0, a), e.arc(i, a, n.r0, 0, o, !0);
  }, t;
}(Te);
Hu.prototype.type = "ring";
function kz(r, t, e, n) {
  var i = [], a = [], o = [], s = [], l, u, c, f;
  if (n) {
    c = [1 / 0, 1 / 0], f = [-1 / 0, -1 / 0];
    for (var h = 0, v = r.length; h < v; h++)
      Oi(c, c, r[h]), Fi(f, f, r[h]);
    Oi(c, c, n[0]), Fi(f, f, n[1]);
  }
  for (var h = 0, v = r.length; h < v; h++) {
    var d = r[h];
    if (e)
      l = r[h ? h - 1 : v - 1], u = r[(h + 1) % v];
    else if (h === 0 || h === v - 1) {
      i.push(Qn(r[h]));
      continue;
    } else
      l = r[h - 1], u = r[h + 1];
    Wa(a, u, l), wf(a, a, t);
    var p = zg(d, l), g = zg(d, u), m = p + g;
    m !== 0 && (p /= m, g /= m), wf(o, a, -p), wf(s, a, g);
    var y = ib([], d, o), _ = ib([], d, s);
    n && (Fi(y, y, c), Oi(y, y, f), Fi(_, _, c), Oi(_, _, f)), i.push(y), i.push(_);
  }
  return e && i.push(i.shift()), i;
}
function hM(r, t, e) {
  var n = t.smooth, i = t.points;
  if (i && i.length >= 2) {
    if (n) {
      var a = kz(i, n, e, t.smoothConstraint);
      r.moveTo(i[0][0], i[0][1]);
      for (var o = i.length, s = 0; s < (e ? o : o - 1); s++) {
        var l = a[s * 2], u = a[s * 2 + 1], c = i[(s + 1) % o];
        r.bezierCurveTo(l[0], l[1], u[0], u[1], c[0], c[1]);
      }
    } else {
      r.moveTo(i[0][0], i[0][1]);
      for (var s = 1, f = i.length; s < f; s++)
        r.lineTo(i[s][0], i[s][1]);
    }
    e && r.closePath();
  }
}
var Rz = /* @__PURE__ */ function() {
  function r() {
    this.points = null, this.smooth = 0, this.smoothConstraint = null;
  }
  return r;
}(), ar = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new Rz();
  }, t.prototype.buildPath = function(e, n) {
    hM(e, n, !0);
  }, t;
}(Te);
ar.prototype.type = "polygon";
var Oz = /* @__PURE__ */ function() {
  function r() {
    this.points = null, this.percent = 1, this.smooth = 0, this.smoothConstraint = null;
  }
  return r;
}(), sr = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new Oz();
  }, t.prototype.buildPath = function(e, n) {
    hM(e, n, !1);
  }, t;
}(Te);
sr.prototype.type = "polyline";
var Fz = {}, Bz = /* @__PURE__ */ function() {
  function r() {
    this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
  }
  return r;
}(), Ct = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new Bz();
  }, t.prototype.buildPath = function(e, n) {
    var i, a, o, s;
    if (this.subPixelOptimize) {
      var l = YT(Fz, n, this.style);
      i = l.x1, a = l.y1, o = l.x2, s = l.y2;
    } else
      i = n.x1, a = n.y1, o = n.x2, s = n.y2;
    var u = n.percent;
    u !== 0 && (e.moveTo(i, a), u < 1 && (o = i * (1 - u) + o * u, s = a * (1 - u) + s * u), e.lineTo(o, s));
  }, t.prototype.pointAt = function(e) {
    var n = this.shape;
    return [
      n.x1 * (1 - e) + n.x2 * e,
      n.y1 * (1 - e) + n.y2 * e
    ];
  }, t;
}(Te);
Ct.prototype.type = "line";
var cr = [], Nz = /* @__PURE__ */ function() {
  function r() {
    this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.cpx1 = 0, this.cpy1 = 0, this.percent = 1;
  }
  return r;
}();
function hS(r, t, e) {
  var n = r.cpx2, i = r.cpy2;
  return n != null || i != null ? [
    (e ? gb : wt)(r.x1, r.cpx1, r.cpx2, r.x2, t),
    (e ? gb : wt)(r.y1, r.cpy1, r.cpy2, r.y2, t)
  ] : [
    (e ? qg : Lt)(r.x1, r.cpx1, r.x2, t),
    (e ? qg : Lt)(r.y1, r.cpy1, r.y2, t)
  ];
}
var qu = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new Nz();
  }, t.prototype.buildPath = function(e, n) {
    var i = n.x1, a = n.y1, o = n.x2, s = n.y2, l = n.cpx1, u = n.cpy1, c = n.cpx2, f = n.cpy2, h = n.percent;
    h !== 0 && (e.moveTo(i, a), c == null || f == null ? (h < 1 && (fu(i, l, o, h, cr), l = cr[1], o = cr[2], fu(a, u, s, h, cr), u = cr[1], s = cr[2]), e.quadraticCurveTo(l, u, o, s)) : (h < 1 && (Ki(i, l, c, o, h, cr), l = cr[1], c = cr[2], o = cr[3], Ki(a, u, f, s, h, cr), u = cr[1], f = cr[2], s = cr[3]), e.bezierCurveTo(l, u, c, f, o, s)));
  }, t.prototype.pointAt = function(e) {
    return hS(this.shape, e, !1);
  }, t.prototype.tangentAt = function(e) {
    var n = hS(this.shape, e, !0);
    return Is(n, n);
  }, t;
}(Te);
qu.prototype.type = "bezier-curve";
var zz = /* @__PURE__ */ function() {
  function r() {
    this.cx = 0, this.cy = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
  }
  return r;
}(), vv = function(r) {
  N(t, r);
  function t(e) {
    return r.call(this, e) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new zz();
  }, t.prototype.buildPath = function(e, n) {
    var i = n.cx, a = n.cy, o = Math.max(n.r, 0), s = n.startAngle, l = n.endAngle, u = n.clockwise, c = Math.cos(s), f = Math.sin(s);
    e.moveTo(c * o + i, f * o + a), e.arc(i, a, o, s, l, !u);
  }, t;
}(Te);
vv.prototype.type = "arc";
var p0 = function(r) {
  N(t, r);
  function t() {
    var e = r !== null && r.apply(this, arguments) || this;
    return e.type = "compound", e;
  }
  return t.prototype._updatePathDirty = function() {
    for (var e = this.shape.paths, n = this.shapeChanged(), i = 0; i < e.length; i++)
      n = n || e[i].shapeChanged();
    n && this.dirtyShape();
  }, t.prototype.beforeBrush = function() {
    this._updatePathDirty();
    for (var e = this.shape.paths || [], n = this.getGlobalScale(), i = 0; i < e.length; i++)
      e[i].path || e[i].createPathProxy(), e[i].path.setScale(n[0], n[1], e[i].segmentIgnoreThreshold);
  }, t.prototype.buildPath = function(e, n) {
    for (var i = n.paths || [], a = 0; a < i.length; a++)
      i[a].buildPath(e, i[a].shape, !0);
  }, t.prototype.afterBrush = function() {
    for (var e = this.shape.paths || [], n = 0; n < e.length; n++)
      e[n].pathUpdated();
  }, t.prototype.getBoundingRect = function() {
    return this._updatePathDirty.call(this), Te.prototype.getBoundingRect.call(this);
  }, t;
}(Te), vM = function() {
  function r(t) {
    this.colorStops = t || [];
  }
  return r.prototype.addColorStop = function(t, e) {
    this.colorStops.push({
      offset: t,
      color: e
    });
  }, r;
}(), Wu = function(r) {
  N(t, r);
  function t(e, n, i, a, o, s) {
    var l = r.call(this, o) || this;
    return l.x = e ?? 0, l.y = n ?? 0, l.x2 = i ?? 1, l.y2 = a ?? 0, l.type = "linear", l.global = s || !1, l;
  }
  return t;
}(vM), dM = function(r) {
  N(t, r);
  function t(e, n, i, a, o) {
    var s = r.call(this, a) || this;
    return s.x = e ?? 0.5, s.y = n ?? 0.5, s.r = i ?? 0.5, s.type = "radial", s.global = o || !1, s;
  }
  return t;
}(vM), Ca = [0, 0], Aa = [0, 0], Ic = new Se(), Lc = new Se(), sh = function() {
  function r(t, e) {
    this._corners = [], this._axes = [], this._origin = [0, 0];
    for (var n = 0; n < 4; n++)
      this._corners[n] = new Se();
    for (var n = 0; n < 2; n++)
      this._axes[n] = new Se();
    t && this.fromBoundingRect(t, e);
  }
  return r.prototype.fromBoundingRect = function(t, e) {
    var n = this._corners, i = this._axes, a = t.x, o = t.y, s = a + t.width, l = o + t.height;
    if (n[0].set(a, o), n[1].set(s, o), n[2].set(s, l), n[3].set(a, l), e)
      for (var u = 0; u < 4; u++)
        n[u].transform(e);
    Se.sub(i[0], n[1], n[0]), Se.sub(i[1], n[3], n[0]), i[0].normalize(), i[1].normalize();
    for (var u = 0; u < 2; u++)
      this._origin[u] = i[u].dot(n[0]);
  }, r.prototype.intersect = function(t, e) {
    var n = !0, i = !e;
    return Ic.set(1 / 0, 1 / 0), Lc.set(0, 0), !this._intersectCheckOneSide(this, t, Ic, Lc, i, 1) && (n = !1, i) || !this._intersectCheckOneSide(t, this, Ic, Lc, i, -1) && (n = !1, i) || i || Se.copy(e, n ? Ic : Lc), n;
  }, r.prototype._intersectCheckOneSide = function(t, e, n, i, a, o) {
    for (var s = !0, l = 0; l < 2; l++) {
      var u = this._axes[l];
      if (this._getProjMinMaxOnAxis(l, t._corners, Ca), this._getProjMinMaxOnAxis(l, e._corners, Aa), Ca[1] < Aa[0] || Ca[0] > Aa[1]) {
        if (s = !1, a)
          return s;
        var c = Math.abs(Aa[0] - Ca[1]), f = Math.abs(Ca[0] - Aa[1]);
        Math.min(c, f) > i.len() && (c < f ? Se.scale(i, u, -c * o) : Se.scale(i, u, f * o));
      } else if (n) {
        var c = Math.abs(Aa[0] - Ca[1]), f = Math.abs(Ca[0] - Aa[1]);
        Math.min(c, f) < n.len() && (c < f ? Se.scale(n, u, c * o) : Se.scale(n, u, -f * o));
      }
    }
    return s;
  }, r.prototype._getProjMinMaxOnAxis = function(t, e, n) {
    for (var i = this._axes[t], a = this._origin, o = e[0].dot(i) + a[t], s = o, l = o, u = 1; u < e.length; u++) {
      var c = e[u].dot(i) + a[t];
      s = Math.min(c, s), l = Math.max(c, l);
    }
    n[0] = s, n[1] = l;
  }, r;
}(), Vz = [], $z = function(r) {
  N(t, r);
  function t() {
    var e = r !== null && r.apply(this, arguments) || this;
    return e.notClear = !0, e.incremental = !0, e._displayables = [], e._temporaryDisplayables = [], e._cursor = 0, e;
  }
  return t.prototype.traverse = function(e, n) {
    e.call(n, this);
  }, t.prototype.useStyle = function() {
    this.style = {};
  }, t.prototype.getCursor = function() {
    return this._cursor;
  }, t.prototype.innerAfterBrush = function() {
    this._cursor = this._displayables.length;
  }, t.prototype.clearDisplaybles = function() {
    this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.markRedraw(), this.notClear = !1;
  }, t.prototype.clearTemporalDisplayables = function() {
    this._temporaryDisplayables = [];
  }, t.prototype.addDisplayable = function(e, n) {
    n ? this._temporaryDisplayables.push(e) : this._displayables.push(e), this.markRedraw();
  }, t.prototype.addDisplayables = function(e, n) {
    n = n || !1;
    for (var i = 0; i < e.length; i++)
      this.addDisplayable(e[i], n);
  }, t.prototype.getDisplayables = function() {
    return this._displayables;
  }, t.prototype.getTemporalDisplayables = function() {
    return this._temporaryDisplayables;
  }, t.prototype.eachPendingDisplayable = function(e) {
    for (var n = this._cursor; n < this._displayables.length; n++)
      e && e(this._displayables[n]);
    for (var n = 0; n < this._temporaryDisplayables.length; n++)
      e && e(this._temporaryDisplayables[n]);
  }, t.prototype.update = function() {
    this.updateTransform();
    for (var e = this._cursor; e < this._displayables.length; e++) {
      var n = this._displayables[e];
      n.parent = this, n.update(), n.parent = null;
    }
    for (var e = 0; e < this._temporaryDisplayables.length; e++) {
      var n = this._temporaryDisplayables[e];
      n.parent = this, n.update(), n.parent = null;
    }
  }, t.prototype.getBoundingRect = function() {
    if (!this._rect) {
      for (var e = new xe(1 / 0, 1 / 0, -1 / 0, -1 / 0), n = 0; n < this._displayables.length; n++) {
        var i = this._displayables[n], a = i.getBoundingRect().clone();
        i.needLocalTransform() && a.applyTransform(i.getLocalTransform(Vz)), e.union(a);
      }
      this._rect = e;
    }
    return this._rect;
  }, t.prototype.contain = function(e, n) {
    var i = this.transformCoordToLocal(e, n), a = this.getBoundingRect();
    if (a.contain(i[0], i[1]))
      for (var o = 0; o < this._displayables.length; o++) {
        var s = this._displayables[o];
        if (s.contain(e, n))
          return !0;
      }
    return !1;
  }, t;
}(qr), pM = Oe();
function ks(r, t, e, n, i) {
  var a;
  if (t && t.ecModel) {
    var o = t.ecModel.getUpdatePayload();
    a = o && o.animation;
  }
  var s = t && t.isAnimationEnabled(), l = r === "update";
  if (s) {
    var u = void 0, c = void 0, f = void 0;
    n ? (u = me(n.duration, 200), c = me(n.easing, "cubicOut"), f = 0) : (u = t.getShallow(l ? "animationDurationUpdate" : "animationDuration"), c = t.getShallow(l ? "animationEasingUpdate" : "animationEasing"), f = t.getShallow(l ? "animationDelayUpdate" : "animationDelay")), a && (a.duration != null && (u = a.duration), a.easing != null && (c = a.easing), a.delay != null && (f = a.delay)), oe(f) && (f = f(e, i)), oe(u) && (u = u(e));
    var h = {
      duration: u || 0,
      delay: f,
      easing: c
    };
    return h;
  } else
    return null;
}
function g0(r, t, e, n, i, a, o) {
  var s = !1, l;
  oe(i) ? (o = a, a = i, i = null) : ue(i) && (a = i.cb, o = i.during, s = i.isFrom, l = i.removeOpt, i = i.dataIndex);
  var u = r === "leave";
  u || t.stopAnimation("leave");
  var c = ks(r, n, i, u ? l || {} : null, n && n.getAnimationDelayParams ? n.getAnimationDelayParams(t, i) : null);
  if (c && c.duration > 0) {
    var f = c.duration, h = c.delay, v = c.easing, d = {
      duration: f,
      delay: h || 0,
      easing: v,
      done: a,
      force: !!a || !!o,
      // Set to final state in update/init animation.
      // So the post processing based on the path shape can be done correctly.
      setToFinal: !u,
      scope: r,
      during: o
    };
    s ? t.animateFrom(e, d) : t.animateTo(e, d);
  } else
    t.stopAnimation(), !s && t.attr(e), o && o(1), a && a();
}
function Ne(r, t, e, n, i, a) {
  g0("update", r, t, e, n, i, a);
}
function st(r, t, e, n, i, a) {
  g0("enter", r, t, e, n, i, a);
}
function cs(r) {
  if (!r.__zr)
    return !0;
  for (var t = 0; t < r.animators.length; t++) {
    var e = r.animators[t];
    if (e.scope === "leave")
      return !0;
  }
  return !1;
}
function Ji(r, t, e, n, i, a) {
  cs(r) || g0("leave", r, t, e, n, i, a);
}
function vS(r, t, e, n) {
  r.removeTextContent(), r.removeTextGuideLine(), Ji(r, {
    style: {
      opacity: 0
    }
  }, t, e, n);
}
function yu(r, t, e) {
  function n() {
    r.parent && r.parent.remove(r);
  }
  r.isGroup ? r.traverse(function(i) {
    i.isGroup || vS(i, t, e, n);
  }) : vS(r, t, e, n);
}
function un(r) {
  pM(r).oldStyle = r.style;
}
function Gz(r) {
  return pM(r).oldStyle;
}
var lh = Math.max, uh = Math.min, pm = {};
function Hz(r) {
  return Te.extend(r);
}
var qz = wz;
function Wz(r, t) {
  return qz(r, t);
}
function fn(r, t) {
  pm[r] = t;
}
function m0(r) {
  if (pm.hasOwnProperty(r))
    return pm[r];
}
function dv(r, t, e, n) {
  var i = cM(r, t);
  return e && (n === "center" && (e = mM(e, i.getBoundingRect())), yM(i, e)), i;
}
function gM(r, t, e) {
  var n = new Pt({
    style: {
      image: r,
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    onload: function(i) {
      if (e === "center") {
        var a = {
          width: i.width,
          height: i.height
        };
        n.setStyle(mM(t, a));
      }
    }
  });
  return n;
}
function mM(r, t) {
  var e = t.width / t.height, n = r.height * e, i;
  n <= r.width ? i = r.height : (n = r.width, i = n / e);
  var a = r.x + r.width / 2, o = r.y + r.height / 2;
  return {
    x: a - n / 2,
    y: o - i / 2,
    width: n,
    height: i
  };
}
var Vr = Cz;
function yM(r, t) {
  if (r.applyTransform) {
    var e = r.getBoundingRect(), n = e.calculateTransform(t);
    r.applyTransform(n);
  }
}
function ys(r, t) {
  return YT(r, r, {
    lineWidth: t
  }), r;
}
function Uz(r) {
  return ZT(r.shape, r.shape, r.style), r;
}
var Pf = Ua;
function oo(r, t) {
  for (var e = rv([]); r && r !== t; )
    ei(e, r.getLocalTransform(), e), r = r.parent;
  return e;
}
function an(r, t, e) {
  return t && !qt(t) && (t = Kn.getLocalTransform(t)), e && (t = Ls([], t)), Rt([], r, t);
}
function pv(r, t, e) {
  var n = t[4] === 0 || t[5] === 0 || t[0] === 0 ? 1 : Math.abs(2 * t[4] / t[0]), i = t[4] === 0 || t[5] === 0 || t[2] === 0 ? 1 : Math.abs(2 * t[4] / t[2]), a = [r === "left" ? -n : r === "right" ? n : 0, r === "top" ? -i : r === "bottom" ? i : 0];
  return a = an(a, t, e), Math.abs(a[0]) > Math.abs(a[1]) ? a[0] > 0 ? "right" : "left" : a[1] > 0 ? "bottom" : "top";
}
function dS(r) {
  return !r.isGroup;
}
function Yz(r) {
  return r.shape != null;
}
function Uu(r, t, e) {
  if (!r || !t)
    return;
  function n(o) {
    var s = {};
    return o.traverse(function(l) {
      dS(l) && l.anid && (s[l.anid] = l);
    }), s;
  }
  function i(o) {
    var s = {
      x: o.x,
      y: o.y,
      rotation: o.rotation
    };
    return Yz(o) && (s.shape = H({}, o.shape)), s;
  }
  var a = n(r);
  t.traverse(function(o) {
    if (dS(o) && o.anid) {
      var s = a[o.anid];
      if (s) {
        var l = i(o);
        o.attr(i(s)), Ne(o, l, e, pe(o).dataIndex);
      }
    }
  });
}
function _M(r, t) {
  return U(r, function(e) {
    var n = e[0];
    n = lh(n, t.x), n = uh(n, t.x + t.width);
    var i = e[1];
    return i = lh(i, t.y), i = uh(i, t.y + t.height), [n, i];
  });
}
function bM(r, t) {
  var e = lh(r.x, t.x), n = uh(r.x + r.width, t.x + t.width), i = lh(r.y, t.y), a = uh(r.y + r.height, t.y + t.height);
  if (n >= e && a >= i)
    return {
      x: e,
      y: i,
      width: n - e,
      height: a - i
    };
}
function Yu(r, t, e) {
  var n = H({
    rectHover: !0
  }, t), i = n.style = {
    strokeNoScale: !0
  };
  if (e = e || {
    x: -1,
    y: -1,
    width: 2,
    height: 2
  }, r)
    return r.indexOf("image://") === 0 ? (i.image = r.slice(8), se(i, e), new Pt(n)) : dv(r.replace("path://", ""), n, e, "center");
}
function Pl(r, t, e, n, i) {
  for (var a = 0, o = i[i.length - 1]; a < i.length; a++) {
    var s = i[a];
    if (SM(r, t, e, n, s[0], s[1], o[0], o[1]))
      return !0;
    o = s;
  }
}
function SM(r, t, e, n, i, a, o, s) {
  var l = e - r, u = n - t, c = o - i, f = s - a, h = Od(c, f, l, u);
  if (Zz(h))
    return !1;
  var v = r - i, d = t - a, p = Od(v, d, l, u) / h;
  if (p < 0 || p > 1)
    return !1;
  var g = Od(v, d, c, f) / h;
  return !(g < 0 || g > 1);
}
function Od(r, t, e, n) {
  return r * n - e * t;
}
function Zz(r) {
  return r <= 1e-6 && r >= -1e-6;
}
function xo(r) {
  var t = r.itemTooltipOption, e = r.componentModel, n = r.itemName, i = J(t) ? {
    formatter: t
  } : t, a = e.mainType, o = e.componentIndex, s = {
    componentType: a,
    name: n,
    $vars: ["name"]
  };
  s[a + "Index"] = o;
  var l = r.formatterParamsExtra;
  l && M(Ee(l), function(c) {
    te(s, c) || (s[c] = l[c], s.$vars.push(c));
  });
  var u = pe(r.el);
  u.componentMainType = a, u.componentIndex = o, u.tooltipConfig = {
    name: n,
    option: se({
      content: n,
      encodeHTMLContent: !0,
      formatterParams: s
    }, i)
  };
}
function pS(r, t) {
  var e;
  r.isGroup && (e = t(r)), e || r.traverse(t);
}
function sa(r, t) {
  if (r)
    if (q(r))
      for (var e = 0; e < r.length; e++)
        pS(r[e], t);
    else
      pS(r, t);
}
fn("circle", pi);
fn("ellipse", hv);
fn("sector", ir);
fn("ring", Hu);
fn("polygon", ar);
fn("polyline", sr);
fn("rect", ke);
fn("line", Ct);
fn("bezierCurve", qu);
fn("arc", vv);
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Arc: vv,
  BezierCurve: qu,
  BoundingRect: xe,
  Circle: pi,
  CompoundPath: p0,
  Ellipse: hv,
  Group: fe,
  Image: Pt,
  IncrementalDisplayable: $z,
  Line: Ct,
  LinearGradient: Wu,
  OrientedBoundingRect: sh,
  Path: Te,
  Point: Se,
  Polygon: ar,
  Polyline: sr,
  RadialGradient: dM,
  Rect: ke,
  Ring: Hu,
  Sector: ir,
  Text: Fe,
  applyTransform: an,
  clipPointsByRect: _M,
  clipRectByRect: bM,
  createIcon: Yu,
  extendPath: Wz,
  extendShape: Hz,
  getShapeClass: m0,
  getTransform: oo,
  groupTransition: Uu,
  initProps: st,
  isElementRemoved: cs,
  lineLineIntersect: SM,
  linePolygonIntersect: Pl,
  makeImage: gM,
  makePath: dv,
  mergePath: Vr,
  registerShape: fn,
  removeElement: Ji,
  removeElementWithFadeOut: yu,
  resizePath: yM,
  setTooltipConfig: xo,
  subPixelOptimize: Pf,
  subPixelOptimizeLine: ys,
  subPixelOptimizeRect: Uz,
  transformDirection: pv,
  traverseElements: sa,
  updateProps: Ne
}, Symbol.toStringTag, { value: "Module" }));
var gv = {};
function xM(r, t) {
  for (var e = 0; e < nr.length; e++) {
    var n = nr[e], i = t[n], a = r.ensureState(n);
    a.style = a.style || {}, a.style.text = i;
  }
  var o = r.currentStates.slice();
  r.clearStates(!0), r.setStyle({
    text: t.normal
  }), r.useStates(o, !0);
}
function gm(r, t, e) {
  var n = r.labelFetcher, i = r.labelDataIndex, a = r.labelDimIndex, o = t.normal, s;
  n && (s = n.getFormattedLabel(i, "normal", null, a, o && o.get("formatter"), e != null ? {
    interpolatedValue: e
  } : null)), s == null && (s = oe(r.defaultText) ? r.defaultText(i, r, e) : r.defaultText);
  for (var l = {
    normal: s
  }, u = 0; u < nr.length; u++) {
    var c = nr[u], f = t[c];
    l[c] = me(n ? n.getFormattedLabel(i, c, null, a, f && f.get("formatter")) : null, s);
  }
  return l;
}
function Bt(r, t, e, n) {
  e = e || gv;
  for (var i = r instanceof Fe, a = !1, o = 0; o < gu.length; o++) {
    var s = t[gu[o]];
    if (s && s.getShallow("show")) {
      a = !0;
      break;
    }
  }
  var l = i ? r : r.getTextContent();
  if (a) {
    i || (l || (l = new Fe(), r.setTextContent(l)), r.stateProxy && (l.stateProxy = r.stateProxy));
    var u = gm(e, t), c = t.normal, f = !!c.getShallow("show"), h = nt(c, n && n.normal, e, !1, !i);
    h.text = u.normal, i || r.setTextConfig(ch(c, e, !1));
    for (var o = 0; o < nr.length; o++) {
      var v = nr[o], s = t[v];
      if (s) {
        var d = l.ensureState(v), p = !!me(s.getShallow("show"), f);
        if (p !== f && (d.ignore = !p), d.style = nt(s, n && n[v], e, !0, !i), d.style.text = u[v], !i) {
          var g = r.ensureState(v);
          g.textConfig = ch(s, e, !0);
        }
      }
    }
    l.silent = !!c.getShallow("silent"), l.style.x != null && (h.x = l.style.x), l.style.y != null && (h.y = l.style.y), l.ignore = !f, l.useStyle(h), l.dirty(), e.enableTextSetter && (Rs(l).setLabelText = function(m) {
      var y = gm(e, t, m);
      xM(l, y);
    });
  } else l && (l.ignore = !0);
  r.dirty();
}
function Mt(r, t) {
  t = t || "label";
  for (var e = {
    normal: r.getModel(t)
  }, n = 0; n < nr.length; n++) {
    var i = nr[n];
    e[i] = r.getModel([i, t]);
  }
  return e;
}
function nt(r, t, e, n, i) {
  var a = {};
  return Xz(a, r, e, n, i), t && H(a, t), a;
}
function ch(r, t, e) {
  t = t || {};
  var n = {}, i, a = r.getShallow("rotate"), o = me(r.getShallow("distance"), e ? null : 5), s = r.getShallow("offset");
  return i = r.getShallow("position") || (e ? null : "inside"), i === "outside" && (i = t.defaultOutsidePosition || "top"), i != null && (n.position = i), s != null && (n.offset = s), a != null && (a *= Math.PI / 180, n.rotation = a), o != null && (n.distance = o), n.outsideFill = r.get("color") === "inherit" ? t.inheritColor || null : "auto", n;
}
function Xz(r, t, e, n, i) {
  e = e || gv;
  var a = t.ecModel, o = a && a.option.textStyle, s = jz(t), l;
  if (s) {
    l = {};
    for (var u in s)
      if (s.hasOwnProperty(u)) {
        var c = t.getModel(["rich", u]);
        _S(l[u] = {}, c, o, e, n, i, !1, !0);
      }
  }
  l && (r.rich = l);
  var f = t.get("overflow");
  f && (r.overflow = f);
  var h = t.get("minMargin");
  h != null && (r.margin = h), _S(r, t, o, e, n, i, !0, !1);
}
function jz(r) {
  for (var t; r && r !== r.ecModel; ) {
    var e = (r.option || gv).rich;
    if (e) {
      t = t || {};
      for (var n = Ee(e), i = 0; i < n.length; i++) {
        var a = n[i];
        t[a] = 1;
      }
    }
    r = r.parentModel;
  }
  return t;
}
var gS = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], mS = ["align", "lineHeight", "width", "height", "tag", "verticalAlign", "ellipsis"], yS = ["padding", "borderWidth", "borderRadius", "borderDashOffset", "backgroundColor", "borderColor", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
function _S(r, t, e, n, i, a, o, s) {
  e = !i && e || gv;
  var l = n && n.inheritColor, u = t.getShallow("color"), c = t.getShallow("textBorderColor"), f = me(t.getShallow("opacity"), e.opacity);
  (u === "inherit" || u === "auto") && (l ? u = l : u = null), (c === "inherit" || c === "auto") && (l ? c = l : c = null), a || (u = u || e.color, c = c || e.textBorderColor), u != null && (r.fill = u), c != null && (r.stroke = c);
  var h = me(t.getShallow("textBorderWidth"), e.textBorderWidth);
  h != null && (r.lineWidth = h);
  var v = me(t.getShallow("textBorderType"), e.textBorderType);
  v != null && (r.lineDash = v);
  var d = me(t.getShallow("textBorderDashOffset"), e.textBorderDashOffset);
  d != null && (r.lineDashOffset = d), !i && f == null && !s && (f = n && n.defaultOpacity), f != null && (r.opacity = f), !i && !a && r.fill == null && n.inheritColor && (r.fill = n.inheritColor);
  for (var p = 0; p < gS.length; p++) {
    var g = gS[p], m = me(t.getShallow(g), e[g]);
    m != null && (r[g] = m);
  }
  for (var p = 0; p < mS.length; p++) {
    var g = mS[p], m = t.getShallow(g);
    m != null && (r[g] = m);
  }
  if (r.verticalAlign == null) {
    var y = t.getShallow("baseline");
    y != null && (r.verticalAlign = y);
  }
  if (!o || !n.disableBox) {
    for (var p = 0; p < yS.length; p++) {
      var g = yS[p], m = t.getShallow(g);
      m != null && (r[g] = m);
    }
    var _ = t.getShallow("borderType");
    _ != null && (r.borderDash = _), (r.backgroundColor === "auto" || r.backgroundColor === "inherit") && l && (r.backgroundColor = l), (r.borderColor === "auto" || r.borderColor === "inherit") && l && (r.borderColor = l);
  }
}
function y0(r, t) {
  var e = t && t.getModel("textStyle");
  return tn([
    // FIXME in node-canvas fontWeight is before fontStyle
    r.fontStyle || e && e.getShallow("fontStyle") || "",
    r.fontWeight || e && e.getShallow("fontWeight") || "",
    (r.fontSize || e && e.getShallow("fontSize") || 12) + "px",
    r.fontFamily || e && e.getShallow("fontFamily") || "sans-serif"
  ].join(" "));
}
var Rs = Oe();
function wM(r, t, e, n) {
  if (r) {
    var i = Rs(r);
    i.prevValue = i.value, i.value = e;
    var a = t.normal;
    i.valueAnimation = a.get("valueAnimation"), i.valueAnimation && (i.precision = a.get("precision"), i.defaultInterpolatedText = n, i.statesModels = t);
  }
}
function CM(r, t, e, n, i) {
  var a = Rs(r);
  if (!a.valueAnimation || a.prevValue === a.value)
    return;
  var o = a.defaultInterpolatedText, s = me(a.interpolatedValue, a.prevValue), l = a.value;
  function u(c) {
    var f = zT(e, a.precision, s, l, c);
    a.interpolatedValue = c === 1 ? null : f;
    var h = gm({
      labelDataIndex: t,
      labelFetcher: i,
      defaultText: o ? o(f) : f + ""
    }, a.statesModels, f);
    xM(r, h);
  }
  r.percent = 0, (a.prevValue == null ? st : Ne)(r, {
    // percent is used to prevent animation from being aborted #15916
    percent: 1
  }, n, t, null, u);
}
var Kz = ["textStyle", "color"], Fd = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "padding", "lineHeight", "rich", "width", "height", "overflow"], Bd = new Fe(), Jz = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getTextColor = function(t) {
      var e = this.ecModel;
      return this.getShallow("color") || (!t && e ? e.get(Kz) : null);
    }, r.prototype.getFont = function() {
      return y0({
        fontStyle: this.getShallow("fontStyle"),
        fontWeight: this.getShallow("fontWeight"),
        fontSize: this.getShallow("fontSize"),
        fontFamily: this.getShallow("fontFamily")
      }, this.ecModel);
    }, r.prototype.getTextRect = function(t) {
      for (var e = {
        text: t,
        verticalAlign: this.getShallow("verticalAlign") || this.getShallow("baseline")
      }, n = 0; n < Fd.length; n++)
        e[Fd[n]] = this.getShallow(Fd[n]);
      return Bd.useStyle(e), Bd.update(), Bd.getBoundingRect();
    }, r;
  }()
), AM = [
  ["lineWidth", "width"],
  ["stroke", "color"],
  ["opacity"],
  ["shadowBlur"],
  ["shadowOffsetX"],
  ["shadowOffsetY"],
  ["shadowColor"],
  ["lineDash", "type"],
  ["lineDashOffset", "dashOffset"],
  ["lineCap", "cap"],
  ["lineJoin", "join"],
  ["miterLimit"]
  // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
  // So do not transfer decal directly.
], Qz = po(AM), eV = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getLineStyle = function(t) {
      return Qz(this, t);
    }, r;
  }()
), DM = [
  ["fill", "color"],
  ["stroke", "borderColor"],
  ["lineWidth", "borderWidth"],
  ["opacity"],
  ["shadowBlur"],
  ["shadowOffsetX"],
  ["shadowOffsetY"],
  ["shadowColor"],
  ["lineDash", "borderType"],
  ["lineDashOffset", "borderDashOffset"],
  ["lineCap", "borderCap"],
  ["lineJoin", "borderJoin"],
  ["miterLimit", "borderMiterLimit"]
  // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
  // So do not transfer decal directly.
], tV = po(DM), rV = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getItemStyle = function(t, e) {
      return tV(this, t, e);
    }, r;
  }()
), Ze = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.parentModel = e, this.ecModel = n, this.option = t;
    }
    return r.prototype.init = function(t, e, n) {
    }, r.prototype.mergeOption = function(t, e) {
      _e(this.option, t, !0);
    }, r.prototype.get = function(t, e) {
      return t == null ? this.option : this._doGet(this.parsePath(t), !e && this.parentModel);
    }, r.prototype.getShallow = function(t, e) {
      var n = this.option, i = n == null ? n : n[t];
      if (i == null && !e) {
        var a = this.parentModel;
        a && (i = a.getShallow(t));
      }
      return i;
    }, r.prototype.getModel = function(t, e) {
      var n = t != null, i = n ? this.parsePath(t) : null, a = n ? this._doGet(i) : this.option;
      return e = e || this.parentModel && this.parentModel.getModel(this.resolveParentPath(i)), new r(a, e, this.ecModel);
    }, r.prototype.isEmpty = function() {
      return this.option == null;
    }, r.prototype.restoreData = function() {
    }, r.prototype.clone = function() {
      var t = this.constructor;
      return new t(ce(this.option));
    }, r.prototype.parsePath = function(t) {
      return typeof t == "string" ? t.split(".") : t;
    }, r.prototype.resolveParentPath = function(t) {
      return t;
    }, r.prototype.isAnimationEnabled = function() {
      if (!Ie.node && this.option) {
        if (this.option.animation != null)
          return !!this.option.animation;
        if (this.parentModel)
          return this.parentModel.isAnimationEnabled();
      }
    }, r.prototype._doGet = function(t, e) {
      var n = this.option;
      if (!t)
        return n;
      for (var i = 0; i < t.length && !(t[i] && (n = n && typeof n == "object" ? n[t[i]] : null, n == null)); i++)
        ;
      return n == null && e && (n = e._doGet(this.resolveParentPath(t), e.parentModel)), n;
    }, r;
  }()
);
o0(Ze);
hN(Ze);
_t(Ze, eV);
_t(Ze, rV);
_t(Ze, mN);
_t(Ze, Jz);
var nV = Math.round(Math.random() * 10);
function Os(r) {
  return [r || "", nV++].join("_");
}
function iV(r) {
  var t = {};
  r.registerSubTypeDefaulter = function(e, n) {
    var i = Tn(e);
    t[i.main] = n;
  }, r.determineSubType = function(e, n) {
    var i = n.type;
    if (!i) {
      var a = Tn(e).main;
      r.hasSubTypes(e) && t[a] && (i = t[a](n));
    }
    return i;
  };
}
function aV(r, t) {
  r.topologicalTravel = function(a, o, s, l) {
    if (!a.length)
      return;
    var u = e(o), c = u.graph, f = u.noEntryList, h = {};
    for (M(a, function(y) {
      h[y] = !0;
    }); f.length; ) {
      var v = f.pop(), d = c[v], p = !!h[v];
      p && (s.call(l, v, d.originalDeps.slice()), delete h[v]), M(d.successor, p ? m : g);
    }
    M(h, function() {
      var y = "";
      throw new Error(y);
    });
    function g(y) {
      c[y].entryCount--, c[y].entryCount === 0 && f.push(y);
    }
    function m(y) {
      h[y] = !0, g(y);
    }
  };
  function e(a) {
    var o = {}, s = [];
    return M(a, function(l) {
      var u = n(o, l), c = u.originalDeps = t(l), f = i(c, a);
      u.entryCount = f.length, u.entryCount === 0 && s.push(l), M(f, function(h) {
        we(u.predecessor, h) < 0 && u.predecessor.push(h);
        var v = n(o, h);
        we(v.successor, h) < 0 && v.successor.push(l);
      });
    }), {
      graph: o,
      noEntryList: s
    };
  }
  function n(a, o) {
    return a[o] || (a[o] = {
      predecessor: [],
      successor: []
    }), a[o];
  }
  function i(a, o) {
    var s = [];
    return M(a, function(l) {
      we(o, l) >= 0 && s.push(l);
    }), s;
  }
}
function la(r, t) {
  return _e(_e({}, r, !0), t, !0);
}
const oV = {
  time: {
    month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    monthAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
    dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    dayOfWeekAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
  },
  legend: {
    selector: {
      all: "All",
      inverse: "Inv"
    }
  },
  toolbox: {
    brush: {
      title: {
        rect: "Box Select",
        polygon: "Lasso Select",
        lineX: "Horizontally Select",
        lineY: "Vertically Select",
        keep: "Keep Selections",
        clear: "Clear Selections"
      }
    },
    dataView: {
      title: "Data View",
      lang: ["Data View", "Close", "Refresh"]
    },
    dataZoom: {
      title: {
        zoom: "Zoom",
        back: "Zoom Reset"
      }
    },
    magicType: {
      title: {
        line: "Switch to Line Chart",
        bar: "Switch to Bar Chart",
        stack: "Stack",
        tiled: "Tile"
      }
    },
    restore: {
      title: "Restore"
    },
    saveAsImage: {
      title: "Save as Image",
      lang: ["Right Click to Save Image"]
    }
  },
  series: {
    typeNames: {
      pie: "Pie chart",
      bar: "Bar chart",
      line: "Line chart",
      scatter: "Scatter plot",
      effectScatter: "Ripple scatter plot",
      radar: "Radar chart",
      tree: "Tree",
      treemap: "Treemap",
      boxplot: "Boxplot",
      candlestick: "Candlestick",
      k: "K line chart",
      heatmap: "Heat map",
      map: "Map",
      parallel: "Parallel coordinate map",
      lines: "Line graph",
      graph: "Relationship graph",
      sankey: "Sankey diagram",
      funnel: "Funnel chart",
      gauge: "Gauge",
      pictorialBar: "Pictorial bar",
      themeRiver: "Theme River Map",
      sunburst: "Sunburst",
      custom: "Custom chart",
      chart: "Chart"
    }
  },
  aria: {
    general: {
      withTitle: 'This is a chart about "{title}"',
      withoutTitle: "This is a chart"
    },
    series: {
      single: {
        prefix: "",
        withName: " with type {seriesType} named {seriesName}.",
        withoutName: " with type {seriesType}."
      },
      multiple: {
        prefix: ". It consists of {seriesCount} series count.",
        withName: " The {seriesId} series is a {seriesType} representing {seriesName}.",
        withoutName: " The {seriesId} series is a {seriesType}.",
        separator: {
          middle: "",
          end: ""
        }
      }
    },
    data: {
      allData: "The data is as follows: ",
      partialData: "The first {displayCnt} items are: ",
      withName: "the data for {name} is {value}",
      withoutName: "{value}",
      separator: {
        middle: ", ",
        end: ". "
      }
    }
  }
}, sV = {
  time: {
    month: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    monthAbbr: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
    dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
    dayOfWeekAbbr: ["日", "一", "二", "三", "四", "五", "六"]
  },
  legend: {
    selector: {
      all: "全选",
      inverse: "反选"
    }
  },
  toolbox: {
    brush: {
      title: {
        rect: "矩形选择",
        polygon: "圈选",
        lineX: "横向选择",
        lineY: "纵向选择",
        keep: "保持选择",
        clear: "清除选择"
      }
    },
    dataView: {
      title: "数据视图",
      lang: ["数据视图", "关闭", "刷新"]
    },
    dataZoom: {
      title: {
        zoom: "区域缩放",
        back: "区域缩放还原"
      }
    },
    magicType: {
      title: {
        line: "切换为折线图",
        bar: "切换为柱状图",
        stack: "切换为堆叠",
        tiled: "切换为平铺"
      }
    },
    restore: {
      title: "还原"
    },
    saveAsImage: {
      title: "保存为图片",
      lang: ["右键另存为图片"]
    }
  },
  series: {
    typeNames: {
      pie: "饼图",
      bar: "柱状图",
      line: "折线图",
      scatter: "散点图",
      effectScatter: "涟漪散点图",
      radar: "雷达图",
      tree: "树图",
      treemap: "矩形树图",
      boxplot: "箱型图",
      candlestick: "K线图",
      k: "K线图",
      heatmap: "热力图",
      map: "地图",
      parallel: "平行坐标图",
      lines: "线图",
      graph: "关系图",
      sankey: "桑基图",
      funnel: "漏斗图",
      gauge: "仪表盘图",
      pictorialBar: "象形柱图",
      themeRiver: "主题河流图",
      sunburst: "旭日图",
      custom: "自定义图表",
      chart: "图表"
    }
  },
  aria: {
    general: {
      withTitle: "这是一个关于“{title}”的图表。",
      withoutTitle: "这是一个图表，"
    },
    series: {
      single: {
        prefix: "",
        withName: "图表类型是{seriesType}，表示{seriesName}。",
        withoutName: "图表类型是{seriesType}。"
      },
      multiple: {
        prefix: "它由{seriesCount}个图表系列组成。",
        withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType}，",
        withoutName: "第{seriesId}个系列是一个{seriesType}，",
        separator: {
          middle: "；",
          end: "。"
        }
      }
    },
    data: {
      allData: "其数据是——",
      partialData: "其中，前{displayCnt}项是——",
      withName: "{name}的数据是{value}",
      withoutName: "{value}",
      separator: {
        middle: "，",
        end: ""
      }
    }
  }
};
var fh = "ZH", _0 = "EN", fs = _0, kf = {}, b0 = {}, TM = Ie.domSupported ? function() {
  var r = (
    /* eslint-disable-next-line */
    (document.documentElement.lang || navigator.language || navigator.browserLanguage || fs).toUpperCase()
  );
  return r.indexOf(fh) > -1 ? fh : fs;
}() : fs;
function MM(r, t) {
  r = r.toUpperCase(), b0[r] = new Ze(t), kf[r] = t;
}
function lV(r) {
  if (J(r)) {
    var t = kf[r.toUpperCase()] || {};
    return r === fh || r === _0 ? ce(t) : _e(ce(t), ce(kf[fs]), !1);
  } else
    return _e(ce(r), ce(kf[fs]), !1);
}
function mm(r) {
  return b0[r];
}
function uV() {
  return b0[fs];
}
MM(_0, oV);
MM(fh, sV);
var S0 = 1e3, x0 = S0 * 60, Kl = x0 * 60, $r = Kl * 24, bS = $r * 365, kl = {
  year: "{yyyy}",
  month: "{MMM}",
  day: "{d}",
  hour: "{HH}:{mm}",
  minute: "{HH}:{mm}",
  second: "{HH}:{mm}:{ss}",
  millisecond: "{HH}:{mm}:{ss} {SSS}",
  none: "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"
}, Ec = "{yyyy}-{MM}-{dd}", SS = {
  year: "{yyyy}",
  month: "{yyyy}-{MM}",
  day: Ec,
  hour: Ec + " " + kl.hour,
  minute: Ec + " " + kl.minute,
  second: Ec + " " + kl.second,
  millisecond: kl.none
}, Nd = ["year", "month", "day", "hour", "minute", "second", "millisecond"], IM = ["year", "half-year", "quarter", "month", "week", "half-week", "day", "half-day", "quarter-day", "hour", "minute", "second", "millisecond"];
function Si(r, t) {
  return r += "", "0000".substr(0, t - r.length) + r;
}
function hs(r) {
  switch (r) {
    case "half-year":
    case "quarter":
      return "month";
    case "week":
    case "half-week":
      return "day";
    case "half-day":
    case "quarter-day":
      return "hour";
    default:
      return r;
  }
}
function cV(r) {
  return r === hs(r);
}
function fV(r) {
  switch (r) {
    case "year":
    case "month":
      return "day";
    case "millisecond":
      return "millisecond";
    default:
      return "second";
  }
}
function mv(r, t, e, n) {
  var i = Fn(r), a = i[w0(e)](), o = i[vs(e)]() + 1, s = Math.floor((o - 1) / 3) + 1, l = i[yv(e)](), u = i["get" + (e ? "UTC" : "") + "Day"](), c = i[_u(e)](), f = (c - 1) % 12 + 1, h = i[_v(e)](), v = i[bv(e)](), d = i[Sv(e)](), p = c >= 12 ? "pm" : "am", g = p.toUpperCase(), m = n instanceof Ze ? n : mm(n || TM) || uV(), y = m.getModel("time"), _ = y.get("month"), b = y.get("monthAbbr"), S = y.get("dayOfWeek"), x = y.get("dayOfWeekAbbr");
  return (t || "").replace(/{a}/g, p + "").replace(/{A}/g, g + "").replace(/{yyyy}/g, a + "").replace(/{yy}/g, Si(a % 100 + "", 2)).replace(/{Q}/g, s + "").replace(/{MMMM}/g, _[o - 1]).replace(/{MMM}/g, b[o - 1]).replace(/{MM}/g, Si(o, 2)).replace(/{M}/g, o + "").replace(/{dd}/g, Si(l, 2)).replace(/{d}/g, l + "").replace(/{eeee}/g, S[u]).replace(/{ee}/g, x[u]).replace(/{e}/g, u + "").replace(/{HH}/g, Si(c, 2)).replace(/{H}/g, c + "").replace(/{hh}/g, Si(f + "", 2)).replace(/{h}/g, f + "").replace(/{mm}/g, Si(h, 2)).replace(/{m}/g, h + "").replace(/{ss}/g, Si(v, 2)).replace(/{s}/g, v + "").replace(/{SSS}/g, Si(d, 3)).replace(/{S}/g, d + "");
}
function hV(r, t, e, n, i) {
  var a = null;
  if (J(e))
    a = e;
  else if (oe(e))
    a = e(r.value, t, {
      level: r.level
    });
  else {
    var o = H({}, kl);
    if (r.level > 0)
      for (var s = 0; s < Nd.length; ++s)
        o[Nd[s]] = "{primary|" + o[Nd[s]] + "}";
    var l = e ? e.inherit === !1 ? e : se(e, o) : o, u = LM(r.value, i);
    if (l[u])
      a = l[u];
    else if (l.inherit) {
      for (var c = IM.indexOf(u), s = c - 1; s >= 0; --s)
        if (l[u]) {
          a = l[u];
          break;
        }
      a = a || o.none;
    }
    if (q(a)) {
      var f = r.level == null ? 0 : r.level >= 0 ? r.level : a.length + r.level;
      f = Math.min(f, a.length - 1), a = a[f];
    }
  }
  return mv(new Date(r.value), a, i, n);
}
function LM(r, t) {
  var e = Fn(r), n = e[vs(t)]() + 1, i = e[yv(t)](), a = e[_u(t)](), o = e[_v(t)](), s = e[bv(t)](), l = e[Sv(t)](), u = l === 0, c = u && s === 0, f = c && o === 0, h = f && a === 0, v = h && i === 1, d = v && n === 1;
  return d ? "year" : v ? "month" : h ? "day" : f ? "hour" : c ? "minute" : u ? "second" : "millisecond";
}
function xS(r, t, e) {
  var n = Be(r) ? Fn(r) : r;
  switch (t = t || LM(r, e), t) {
    case "year":
      return n[w0(e)]();
    case "half-year":
      return n[vs(e)]() >= 6 ? 1 : 0;
    case "quarter":
      return Math.floor((n[vs(e)]() + 1) / 4);
    case "month":
      return n[vs(e)]();
    case "day":
      return n[yv(e)]();
    case "half-day":
      return n[_u(e)]() / 24;
    case "hour":
      return n[_u(e)]();
    case "minute":
      return n[_v(e)]();
    case "second":
      return n[bv(e)]();
    case "millisecond":
      return n[Sv(e)]();
  }
}
function w0(r) {
  return r ? "getUTCFullYear" : "getFullYear";
}
function vs(r) {
  return r ? "getUTCMonth" : "getMonth";
}
function yv(r) {
  return r ? "getUTCDate" : "getDate";
}
function _u(r) {
  return r ? "getUTCHours" : "getHours";
}
function _v(r) {
  return r ? "getUTCMinutes" : "getMinutes";
}
function bv(r) {
  return r ? "getUTCSeconds" : "getSeconds";
}
function Sv(r) {
  return r ? "getUTCMilliseconds" : "getMilliseconds";
}
function vV(r) {
  return r ? "setUTCFullYear" : "setFullYear";
}
function EM(r) {
  return r ? "setUTCMonth" : "setMonth";
}
function PM(r) {
  return r ? "setUTCDate" : "setDate";
}
function kM(r) {
  return r ? "setUTCHours" : "setHours";
}
function RM(r) {
  return r ? "setUTCMinutes" : "setMinutes";
}
function OM(r) {
  return r ? "setUTCSeconds" : "setSeconds";
}
function FM(r) {
  return r ? "setUTCMilliseconds" : "setMilliseconds";
}
function BM(r) {
  if (!ET(r))
    return J(r) ? r : "-";
  var t = (r + "").split(".");
  return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (t.length > 1 ? "." + t[1] : "");
}
function NM(r, t) {
  return r = (r || "").toLowerCase().replace(/-(.)/g, function(e, n) {
    return n.toUpperCase();
  }), t && r && (r = r.charAt(0).toUpperCase() + r.slice(1)), r;
}
var Fs = jy;
function ym(r, t, e) {
  var n = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";
  function i(c) {
    return c && tn(c) ? c : "-";
  }
  function a(c) {
    return !!(c != null && !isNaN(c) && isFinite(c));
  }
  var o = t === "time", s = r instanceof Date;
  if (o || s) {
    var l = o ? Fn(r) : r;
    if (isNaN(+l)) {
      if (s)
        return "-";
    } else return mv(l, n, e);
  }
  if (t === "ordinal")
    return Fg(r) ? i(r) : Be(r) && a(r) ? r + "" : "-";
  var u = ai(r);
  return a(u) ? BM(u) : Fg(r) ? i(r) : typeof r == "boolean" ? r + "" : "-";
}
var wS = ["a", "b", "c", "d", "e", "f", "g"], zd = function(r, t) {
  return "{" + r + (t ?? "") + "}";
};
function zM(r, t, e) {
  q(t) || (t = [t]);
  var n = t.length;
  if (!n)
    return "";
  for (var i = t[0].$vars || [], a = 0; a < i.length; a++) {
    var o = wS[a];
    r = r.replace(zd(o), zd(o, 0));
  }
  for (var s = 0; s < n; s++)
    for (var l = 0; l < i.length; l++) {
      var u = t[s][i[l]];
      r = r.replace(zd(wS[l], s), e ? Jt(u) : u);
    }
  return r;
}
function dV(r, t, e) {
  return M(t, function(n, i) {
    r = r.replace("{" + i + "}", n);
  }), r;
}
function pV(r, t) {
  var e = J(r) ? {
    color: r,
    extraCssText: t
  } : r || {}, n = e.color, i = e.type;
  t = e.extraCssText;
  var a = e.renderMode || "html";
  if (!n)
    return "";
  if (a === "html")
    return i === "subItem" ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + Jt(n) + ";" + (t || "") + '"></span>' : '<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:' + Jt(n) + ";" + (t || "") + '"></span>';
  var o = e.markerId || "markerX";
  return {
    renderMode: a,
    content: "{" + o + "|}  ",
    style: i === "subItem" ? {
      width: 4,
      height: 4,
      borderRadius: 2,
      backgroundColor: n
    } : {
      width: 10,
      height: 10,
      borderRadius: 5,
      backgroundColor: n
    }
  };
}
function mo(r, t) {
  return t = t || "transparent", J(r) ? r : ue(r) && r.colorStops && (r.colorStops[0] || {}).color || t;
}
function hh(r, t) {
  if (t === "_blank" || t === "blank") {
    var e = window.open();
    e.opener = null, e.location.href = r;
  } else
    window.open(r, t);
}
var Rf = M, VM = ["left", "right", "top", "bottom", "width", "height"], Za = [["width", "left", "right"], ["height", "top", "bottom"]];
function C0(r, t, e, n, i) {
  var a = 0, o = 0;
  n == null && (n = 1 / 0), i == null && (i = 1 / 0);
  var s = 0;
  t.eachChild(function(l, u) {
    var c = l.getBoundingRect(), f = t.childAt(u + 1), h = f && f.getBoundingRect(), v, d;
    if (r === "horizontal") {
      var p = c.width + (h ? -h.x + c.x : 0);
      v = a + p, v > n || l.newline ? (a = 0, v = p, o += s + e, s = c.height) : s = Math.max(s, c.height);
    } else {
      var g = c.height + (h ? -h.y + c.y : 0);
      d = o + g, d > i || l.newline ? (a += s + e, o = 0, d = g, s = c.width) : s = Math.max(s, c.width);
    }
    l.newline || (l.x = a, l.y = o, l.markRedraw(), r === "horizontal" ? a = v + e : o = d + e);
  });
}
var so = C0;
ye(C0, "vertical");
ye(C0, "horizontal");
function gV(r, t, e) {
  var n = t.width, i = t.height, a = X(r.left, n), o = X(r.top, i), s = X(r.right, n), l = X(r.bottom, i);
  return (isNaN(a) || isNaN(parseFloat(r.left))) && (a = 0), (isNaN(s) || isNaN(parseFloat(r.right))) && (s = n), (isNaN(o) || isNaN(parseFloat(r.top))) && (o = 0), (isNaN(l) || isNaN(parseFloat(r.bottom))) && (l = i), e = Fs(e || 0), {
    width: Math.max(s - a - e[1] - e[3], 0),
    height: Math.max(l - o - e[0] - e[2], 0)
  };
}
function St(r, t, e) {
  e = Fs(e || 0);
  var n = t.width, i = t.height, a = X(r.left, n), o = X(r.top, i), s = X(r.right, n), l = X(r.bottom, i), u = X(r.width, n), c = X(r.height, i), f = e[2] + e[0], h = e[1] + e[3], v = r.aspect;
  switch (isNaN(u) && (u = n - s - h - a), isNaN(c) && (c = i - l - f - o), v != null && (isNaN(u) && isNaN(c) && (v > n / i ? u = n * 0.8 : c = i * 0.8), isNaN(u) && (u = v * c), isNaN(c) && (c = u / v)), isNaN(a) && (a = n - s - u - h), isNaN(o) && (o = i - l - c - f), r.left || r.right) {
    case "center":
      a = n / 2 - u / 2 - e[3];
      break;
    case "right":
      a = n - u - h;
      break;
  }
  switch (r.top || r.bottom) {
    case "middle":
    case "center":
      o = i / 2 - c / 2 - e[0];
      break;
    case "bottom":
      o = i - c - f;
      break;
  }
  a = a || 0, o = o || 0, isNaN(u) && (u = n - h - a - (s || 0)), isNaN(c) && (c = i - f - o - (l || 0));
  var d = new xe(a + e[3], o + e[0], u, c);
  return d.margin = e, d;
}
function xv(r, t, e, n, i, a) {
  var o = !i || !i.hv || i.hv[0], s = !i || !i.hv || i.hv[1], l = i && i.boundingMode || "all";
  if (a = a || r, a.x = r.x, a.y = r.y, !o && !s)
    return !1;
  var u;
  if (l === "raw")
    u = r.type === "group" ? new xe(0, 0, +t.width || 0, +t.height || 0) : r.getBoundingRect();
  else if (u = r.getBoundingRect(), r.needLocalTransform()) {
    var c = r.getLocalTransform();
    u = u.clone(), u.applyTransform(c);
  }
  var f = St(se({
    width: u.width,
    height: u.height
  }, t), e, n), h = o ? f.x - u.x : 0, v = s ? f.y - u.y : 0;
  return l === "raw" ? (a.x = h, a.y = v) : (a.x += h, a.y += v), a === r && r.markRedraw(), !0;
}
function mV(r, t) {
  return r[Za[t][0]] != null || r[Za[t][1]] != null && r[Za[t][2]] != null;
}
function bu(r) {
  var t = r.layoutMode || r.constructor.layoutMode;
  return ue(t) ? t : t ? {
    type: t
  } : null;
}
function Qi(r, t, e) {
  var n = e && e.ignoreSize;
  !q(n) && (n = [n, n]);
  var i = o(Za[0], 0), a = o(Za[1], 1);
  u(Za[0], r, i), u(Za[1], r, a);
  function o(c, f) {
    var h = {}, v = 0, d = {}, p = 0, g = 2;
    if (Rf(c, function(_) {
      d[_] = r[_];
    }), Rf(c, function(_) {
      s(t, _) && (h[_] = d[_] = t[_]), l(h, _) && v++, l(d, _) && p++;
    }), n[f])
      return l(t, c[1]) ? d[c[2]] = null : l(t, c[2]) && (d[c[1]] = null), d;
    if (p === g || !v)
      return d;
    if (v >= g)
      return h;
    for (var m = 0; m < c.length; m++) {
      var y = c[m];
      if (!s(h, y) && s(r, y)) {
        h[y] = r[y];
        break;
      }
    }
    return h;
  }
  function s(c, f) {
    return c.hasOwnProperty(f);
  }
  function l(c, f) {
    return c[f] != null && c[f] !== "auto";
  }
  function u(c, f, h) {
    Rf(c, function(v) {
      f[v] = h[v];
    });
  }
}
function Bs(r) {
  return $M({}, r);
}
function $M(r, t) {
  return t && r && Rf(VM, function(e) {
    t.hasOwnProperty(e) && (r[e] = t[e]);
  }), r;
}
var yV = Oe(), Le = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this, e, n, i) || this;
      return a.uid = Os("ec_cpt_model"), a;
    }
    return t.prototype.init = function(e, n, i) {
      this.mergeDefaultAndTheme(e, i);
    }, t.prototype.mergeDefaultAndTheme = function(e, n) {
      var i = bu(this), a = i ? Bs(e) : {}, o = n.getTheme();
      _e(e, o.get(this.mainType)), _e(e, this.getDefaultOption()), i && Qi(e, a, i);
    }, t.prototype.mergeOption = function(e, n) {
      _e(this.option, e, !0);
      var i = bu(this);
      i && Qi(this.option, e, i);
    }, t.prototype.optionUpdated = function(e, n) {
    }, t.prototype.getDefaultOption = function() {
      var e = this.constructor;
      if (!uN(e))
        return e.defaultOption;
      var n = yV(this);
      if (!n.defaultOption) {
        for (var i = [], a = e; a; ) {
          var o = a.prototype.defaultOption;
          o && i.push(o), a = a.superClass;
        }
        for (var s = {}, l = i.length - 1; l >= 0; l--)
          s = _e(s, i[l], !0);
        n.defaultOption = s;
      }
      return n.defaultOption;
    }, t.prototype.getReferringComponents = function(e, n) {
      var i = e + "Index", a = e + "Id";
      return $u(this.ecModel, e, {
        index: this.get(i, !0),
        id: this.get(a, !0)
      }, n);
    }, t.prototype.getBoxLayoutParams = function() {
      var e = this;
      return {
        left: e.get("left"),
        top: e.get("top"),
        right: e.get("right"),
        bottom: e.get("bottom"),
        width: e.get("width"),
        height: e.get("height")
      };
    }, t.prototype.getZLevelKey = function() {
      return "";
    }, t.prototype.setZLevel = function(e) {
      this.option.zlevel = e;
    }, t.protoInitialize = function() {
      var e = t.prototype;
      e.type = "component", e.id = "", e.name = "", e.mainType = "", e.subType = "", e.componentIndex = 0;
    }(), t;
  }(Ze)
);
$T(Le, Ze);
ov(Le);
iV(Le);
aV(Le, _V);
function _V(r) {
  var t = [];
  return M(Le.getClassesByMainType(r), function(e) {
    t = t.concat(e.dependencies || e.prototype.dependencies || []);
  }), t = U(t, function(e) {
    return Tn(e).main;
  }), r !== "dataset" && we(t, "dataset") <= 0 && t.unshift("dataset"), t;
}
var GM = "";
typeof navigator < "u" && (GM = navigator.platform || "");
var No = "rgba(0, 0, 0, 0.2)";
const bV = {
  darkMode: "auto",
  // backgroundColor: 'rgba(0,0,0,0)',
  colorBy: "series",
  color: ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc"],
  gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
  aria: {
    decal: {
      decals: [{
        color: No,
        dashArrayX: [1, 0],
        dashArrayY: [2, 5],
        symbolSize: 1,
        rotation: Math.PI / 6
      }, {
        color: No,
        symbol: "circle",
        dashArrayX: [[8, 8], [0, 8, 8, 0]],
        dashArrayY: [6, 0],
        symbolSize: 0.8
      }, {
        color: No,
        dashArrayX: [1, 0],
        dashArrayY: [4, 3],
        rotation: -Math.PI / 4
      }, {
        color: No,
        dashArrayX: [[6, 6], [0, 6, 6, 0]],
        dashArrayY: [6, 0]
      }, {
        color: No,
        dashArrayX: [[1, 0], [1, 6]],
        dashArrayY: [1, 0, 6, 0],
        rotation: Math.PI / 4
      }, {
        color: No,
        symbol: "triangle",
        dashArrayX: [[9, 9], [0, 9, 9, 0]],
        dashArrayY: [7, 2],
        symbolSize: 0.75
      }]
    }
  },
  // If xAxis and yAxis declared, grid is created by default.
  // grid: {},
  textStyle: {
    // color: '#000',
    // decoration: 'none',
    // PENDING
    fontFamily: GM.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
    // fontFamily: 'Arial, Verdana, sans-serif',
    fontSize: 12,
    fontStyle: "normal",
    fontWeight: "normal"
  },
  // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/
  // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
  // Default is source-over
  blendMode: null,
  stateAnimation: {
    duration: 300,
    easing: "cubicOut"
  },
  animation: "auto",
  animationDuration: 1e3,
  animationDurationUpdate: 500,
  animationEasing: "cubicInOut",
  animationEasingUpdate: "cubicInOut",
  animationThreshold: 2e3,
  // Configuration for progressive/incremental rendering
  progressiveThreshold: 3e3,
  progressive: 400,
  // Threshold of if use single hover layer to optimize.
  // It is recommended that `hoverLayerThreshold` is equivalent to or less than
  // `progressiveThreshold`, otherwise hover will cause restart of progressive,
  // which is unexpected.
  // see example <echarts/test/heatmap-large.html>.
  hoverLayerThreshold: 3e3,
  // See: module:echarts/scale/Time
  useUTC: !1
};
var HM = re(["tooltip", "label", "itemName", "itemId", "itemGroupId", "itemChildGroupId", "seriesName"]), Ur = "original", Wt = "arrayRows", Yr = "objectRows", zn = "keyedColumns", Ui = "typedArray", qM = "unknown", Pn = "column", Ns = "row", kt = {
  Must: 1,
  Might: 2,
  Not: 3
  // Other cases
}, WM = Oe();
function SV(r) {
  WM(r).datasetMap = re();
}
function UM(r, t, e) {
  var n = {}, i = D0(t);
  if (!i || !r)
    return n;
  var a = [], o = [], s = t.ecModel, l = WM(s).datasetMap, u = i.uid + "_" + e.seriesLayoutBy, c, f;
  r = r.slice(), M(r, function(p, g) {
    var m = ue(p) ? p : r[g] = {
      name: p
    };
    m.type === "ordinal" && c == null && (c = g, f = d(m)), n[m.name] = [];
  });
  var h = l.get(u) || l.set(u, {
    categoryWayDim: f,
    valueWayDim: 0
  });
  M(r, function(p, g) {
    var m = p.name, y = d(p);
    if (c == null) {
      var _ = h.valueWayDim;
      v(n[m], _, y), v(o, _, y), h.valueWayDim += y;
    } else if (c === g)
      v(n[m], 0, y), v(a, 0, y);
    else {
      var _ = h.categoryWayDim;
      v(n[m], _, y), v(o, _, y), h.categoryWayDim += y;
    }
  });
  function v(p, g, m) {
    for (var y = 0; y < m; y++)
      p.push(g + y);
  }
  function d(p) {
    var g = p.dimsDef;
    return g ? g.length : 1;
  }
  return a.length && (n.itemName = a), o.length && (n.seriesName = o), n;
}
function A0(r, t, e) {
  var n = {}, i = D0(r);
  if (!i)
    return n;
  var a = t.sourceFormat, o = t.dimensionsDefine, s;
  (a === Yr || a === zn) && M(o, function(c, f) {
    (ue(c) ? c.name : c) === "name" && (s = f);
  });
  var l = function() {
    for (var c = {}, f = {}, h = [], v = 0, d = Math.min(5, e); v < d; v++) {
      var p = ZM(t.data, a, t.seriesLayoutBy, o, t.startIndex, v);
      h.push(p);
      var g = p === kt.Not;
      if (g && c.v == null && v !== s && (c.v = v), (c.n == null || c.n === c.v || !g && h[c.n] === kt.Not) && (c.n = v), m(c) && h[c.n] !== kt.Not)
        return c;
      g || (p === kt.Might && f.v == null && v !== s && (f.v = v), (f.n == null || f.n === f.v) && (f.n = v));
    }
    function m(y) {
      return y.v != null && y.n != null;
    }
    return m(c) ? c : m(f) ? f : null;
  }();
  if (l) {
    n.value = [l.v];
    var u = s ?? l.n;
    n.itemName = [u], n.seriesName = [u];
  }
  return n;
}
function D0(r) {
  var t = r.get("data", !0);
  if (!t)
    return $u(r.ecModel, "dataset", {
      index: r.get("datasetIndex", !0),
      id: r.get("datasetId", !0)
    }, mt).models[0];
}
function xV(r) {
  return !r.get("transform", !0) && !r.get("fromTransformResult", !0) ? [] : $u(r.ecModel, "dataset", {
    index: r.get("fromDatasetIndex", !0),
    id: r.get("fromDatasetId", !0)
  }, mt).models;
}
function YM(r, t) {
  return ZM(r.data, r.sourceFormat, r.seriesLayoutBy, r.dimensionsDefine, r.startIndex, t);
}
function ZM(r, t, e, n, i, a) {
  var o, s = 5;
  if (gr(r))
    return kt.Not;
  var l, u;
  if (n) {
    var c = n[a];
    ue(c) ? (l = c.name, u = c.type) : J(c) && (l = c);
  }
  if (u != null)
    return u === "ordinal" ? kt.Must : kt.Not;
  if (t === Wt) {
    var f = r;
    if (e === Ns) {
      for (var h = f[a], v = 0; v < (h || []).length && v < s; v++)
        if ((o = b(h[i + v])) != null)
          return o;
    } else
      for (var v = 0; v < f.length && v < s; v++) {
        var d = f[i + v];
        if (d && (o = b(d[a])) != null)
          return o;
      }
  } else if (t === Yr) {
    var p = r;
    if (!l)
      return kt.Not;
    for (var v = 0; v < p.length && v < s; v++) {
      var g = p[v];
      if (g && (o = b(g[l])) != null)
        return o;
    }
  } else if (t === zn) {
    var m = r;
    if (!l)
      return kt.Not;
    var h = m[l];
    if (!h || gr(h))
      return kt.Not;
    for (var v = 0; v < h.length && v < s; v++)
      if ((o = b(h[v])) != null)
        return o;
  } else if (t === Ur)
    for (var y = r, v = 0; v < y.length && v < s; v++) {
      var g = y[v], _ = Es(g);
      if (!q(_))
        return kt.Not;
      if ((o = b(_[a])) != null)
        return o;
    }
  function b(S) {
    var x = J(S);
    if (S != null && Number.isFinite(Number(S)) && S !== "")
      return x ? kt.Might : kt.Not;
    if (x && S !== "-")
      return kt.Must;
  }
  return kt.Not;
}
var _m = re();
function wV(r, t) {
  rr(_m.get(r) == null && t), _m.set(r, t);
}
function CV(r, t, e) {
  var n = _m.get(t);
  if (!n)
    return e;
  var i = n(r);
  return i ? e.concat(i) : e;
}
var CS = Oe(), AV = Oe(), T0 = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getColorFromPalette = function(t, e, n) {
      var i = je(this.get("color", !0)), a = this.get("colorLayer", !0);
      return XM(this, CS, i, a, t, e, n);
    }, r.prototype.clearColorPalette = function() {
      TV(this, CS);
    }, r;
  }()
);
function bm(r, t, e, n) {
  var i = je(r.get(["aria", "decal", "decals"]));
  return XM(r, AV, i, null, t, e, n);
}
function DV(r, t) {
  for (var e = r.length, n = 0; n < e; n++)
    if (r[n].length > t)
      return r[n];
  return r[e - 1];
}
function XM(r, t, e, n, i, a, o) {
  a = a || r;
  var s = t(a), l = s.paletteIdx || 0, u = s.paletteNameMap = s.paletteNameMap || {};
  if (u.hasOwnProperty(i))
    return u[i];
  var c = o == null || !n ? e : DV(n, o);
  if (c = c || e, !(!c || !c.length)) {
    var f = c[l];
    return i && (u[i] = f), s.paletteIdx = (l + 1) % c.length, f;
  }
}
function TV(r, t) {
  t(r).paletteIdx = 0, t(r).paletteNameMap = {};
}
var Pc, il, AS, DS = "\0_ec_inner", MV = 1, M0 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.init = function(e, n, i, a, o, s) {
      a = a || {}, this.option = null, this._theme = new Ze(a), this._locale = new Ze(o), this._optionManager = s;
    }, t.prototype.setOption = function(e, n, i) {
      var a = IS(n);
      this._optionManager.setOption(e, i, a), this._resetOption(null, a);
    }, t.prototype.resetOption = function(e, n) {
      return this._resetOption(e, IS(n));
    }, t.prototype._resetOption = function(e, n) {
      var i = !1, a = this._optionManager;
      if (!e || e === "recreate") {
        var o = a.mountOption(e === "recreate");
        !this.option || e === "recreate" ? AS(this, o) : (this.restoreData(), this._mergeOption(o, n)), i = !0;
      }
      if ((e === "timeline" || e === "media") && this.restoreData(), !e || e === "recreate" || e === "timeline") {
        var s = a.getTimelineOption(this);
        s && (i = !0, this._mergeOption(s, n));
      }
      if (!e || e === "recreate" || e === "media") {
        var l = a.getMediaOption(this);
        l.length && M(l, function(u) {
          i = !0, this._mergeOption(u, n);
        }, this);
      }
      return i;
    }, t.prototype.mergeOption = function(e) {
      this._mergeOption(e, null);
    }, t.prototype._mergeOption = function(e, n) {
      var i = this.option, a = this._componentsMap, o = this._componentsCount, s = [], l = re(), u = n && n.replaceMergeMainTypeMap;
      SV(this), M(e, function(f, h) {
        f != null && (Le.hasClass(h) ? h && (s.push(h), l.set(h, !0)) : i[h] = i[h] == null ? ce(f) : _e(i[h], f, !0));
      }), u && u.each(function(f, h) {
        Le.hasClass(h) && !l.get(h) && (s.push(h), l.set(h, !0));
      }), Le.topologicalTravel(s, Le.getAllClassMainTypes(), c, this);
      function c(f) {
        var h = CV(this, f, je(e[f])), v = a.get(f), d = (
          // `!oldCmptList` means init. See the comment in `mappingToExists`
          v ? u && u.get(f) ? "replaceMerge" : "normalMerge" : "replaceAll"
        ), p = FT(v, h, d);
        eN(p, f, Le), i[f] = null, a.set(f, null), o.set(f, 0);
        var g = [], m = [], y = 0, _;
        M(p, function(b, S) {
          var x = b.existing, w = b.newOption;
          if (!w)
            x && (x.mergeOption({}, this), x.optionUpdated({}, !1));
          else {
            var C = f === "series", D = Le.getClass(
              f,
              b.keyInfo.subType,
              !C
              // Give a more detailed warn later if series don't exists
            );
            if (!D)
              return;
            if (f === "tooltip") {
              if (_)
                return;
              _ = !0;
            }
            if (x && x.constructor === D)
              x.name = b.keyInfo.name, x.mergeOption(w, this), x.optionUpdated(w, !1);
            else {
              var A = H({
                componentIndex: S
              }, b.keyInfo);
              x = new D(w, this, this, A), H(x, A), b.brandNew && (x.__requireNewView = !0), x.init(w, this, this), x.optionUpdated(null, !0);
            }
          }
          x ? (g.push(x.option), m.push(x), y++) : (g.push(void 0), m.push(void 0));
        }, this), i[f] = g, a.set(f, m), o.set(f, y), f === "series" && Pc(this);
      }
      this._seriesIndices || Pc(this);
    }, t.prototype.getOption = function() {
      var e = ce(this.option);
      return M(e, function(n, i) {
        if (Le.hasClass(i)) {
          for (var a = je(n), o = a.length, s = !1, l = o - 1; l >= 0; l--)
            a[l] && !pu(a[l]) ? s = !0 : (a[l] = null, !s && o--);
          a.length = o, e[i] = a;
        }
      }), delete e[DS], e;
    }, t.prototype.getTheme = function() {
      return this._theme;
    }, t.prototype.getLocaleModel = function() {
      return this._locale;
    }, t.prototype.setUpdatePayload = function(e) {
      this._payload = e;
    }, t.prototype.getUpdatePayload = function() {
      return this._payload;
    }, t.prototype.getComponent = function(e, n) {
      var i = this._componentsMap.get(e);
      if (i) {
        var a = i[n || 0];
        if (a)
          return a;
        if (n == null) {
          for (var o = 0; o < i.length; o++)
            if (i[o])
              return i[o];
        }
      }
    }, t.prototype.queryComponents = function(e) {
      var n = e.mainType;
      if (!n)
        return [];
      var i = e.index, a = e.id, o = e.name, s = this._componentsMap.get(n);
      if (!s || !s.length)
        return [];
      var l;
      return i != null ? (l = [], M(je(i), function(u) {
        s[u] && l.push(s[u]);
      })) : a != null ? l = TS("id", a, s) : o != null ? l = TS("name", o, s) : l = qe(s, function(u) {
        return !!u;
      }), MS(l, e);
    }, t.prototype.findComponents = function(e) {
      var n = e.query, i = e.mainType, a = s(n), o = a ? this.queryComponents(a) : qe(this._componentsMap.get(i), function(u) {
        return !!u;
      });
      return l(MS(o, e));
      function s(u) {
        var c = i + "Index", f = i + "Id", h = i + "Name";
        return u && (u[c] != null || u[f] != null || u[h] != null) ? {
          mainType: i,
          // subType will be filtered finally.
          index: u[c],
          id: u[f],
          name: u[h]
        } : null;
      }
      function l(u) {
        return e.filter ? qe(u, e.filter) : u;
      }
    }, t.prototype.eachComponent = function(e, n, i) {
      var a = this._componentsMap;
      if (oe(e)) {
        var o = n, s = e;
        a.each(function(f, h) {
          for (var v = 0; f && v < f.length; v++) {
            var d = f[v];
            d && s.call(o, h, d, d.componentIndex);
          }
        });
      } else
        for (var l = J(e) ? a.get(e) : ue(e) ? this.findComponents(e) : null, u = 0; l && u < l.length; u++) {
          var c = l[u];
          c && n.call(i, c, c.componentIndex);
        }
    }, t.prototype.getSeriesByName = function(e) {
      var n = bt(e, null);
      return qe(this._componentsMap.get("series"), function(i) {
        return !!i && n != null && i.name === n;
      });
    }, t.prototype.getSeriesByIndex = function(e) {
      return this._componentsMap.get("series")[e];
    }, t.prototype.getSeriesByType = function(e) {
      return qe(this._componentsMap.get("series"), function(n) {
        return !!n && n.subType === e;
      });
    }, t.prototype.getSeries = function() {
      return qe(this._componentsMap.get("series"), function(e) {
        return !!e;
      });
    }, t.prototype.getSeriesCount = function() {
      return this._componentsCount.get("series");
    }, t.prototype.eachSeries = function(e, n) {
      il(this), M(this._seriesIndices, function(i) {
        var a = this._componentsMap.get("series")[i];
        e.call(n, a, i);
      }, this);
    }, t.prototype.eachRawSeries = function(e, n) {
      M(this._componentsMap.get("series"), function(i) {
        i && e.call(n, i, i.componentIndex);
      });
    }, t.prototype.eachSeriesByType = function(e, n, i) {
      il(this), M(this._seriesIndices, function(a) {
        var o = this._componentsMap.get("series")[a];
        o.subType === e && n.call(i, o, a);
      }, this);
    }, t.prototype.eachRawSeriesByType = function(e, n, i) {
      return M(this.getSeriesByType(e), n, i);
    }, t.prototype.isSeriesFiltered = function(e) {
      return il(this), this._seriesIndicesMap.get(e.componentIndex) == null;
    }, t.prototype.getCurrentSeriesIndices = function() {
      return (this._seriesIndices || []).slice();
    }, t.prototype.filterSeries = function(e, n) {
      il(this);
      var i = [];
      M(this._seriesIndices, function(a) {
        var o = this._componentsMap.get("series")[a];
        e.call(n, o, a) && i.push(a);
      }, this), this._seriesIndices = i, this._seriesIndicesMap = re(i);
    }, t.prototype.restoreData = function(e) {
      Pc(this);
      var n = this._componentsMap, i = [];
      n.each(function(a, o) {
        Le.hasClass(o) && i.push(o);
      }), Le.topologicalTravel(i, Le.getAllClassMainTypes(), function(a) {
        M(n.get(a), function(o) {
          o && (a !== "series" || !IV(o, e)) && o.restoreData();
        });
      });
    }, t.internalField = function() {
      Pc = function(e) {
        var n = e._seriesIndices = [];
        M(e._componentsMap.get("series"), function(i) {
          i && n.push(i.componentIndex);
        }), e._seriesIndicesMap = re(n);
      }, il = function(e) {
      }, AS = function(e, n) {
        e.option = {}, e.option[DS] = MV, e._componentsMap = re({
          series: []
        }), e._componentsCount = re();
        var i = n.aria;
        ue(i) && i.enabled == null && (i.enabled = !0), LV(n, e._theme.option), _e(n, bV, !1), e._mergeOption(n, null);
      };
    }(), t;
  }(Ze)
);
function IV(r, t) {
  if (t) {
    var e = t.seriesIndex, n = t.seriesId, i = t.seriesName;
    return e != null && r.componentIndex !== e || n != null && r.id !== n || i != null && r.name !== i;
  }
}
function LV(r, t) {
  var e = r.color && !r.colorLayer;
  M(t, function(n, i) {
    i === "colorLayer" && e || Le.hasClass(i) || (typeof n == "object" ? r[i] = r[i] ? _e(r[i], n, !1) : ce(n) : r[i] == null && (r[i] = n));
  });
}
function TS(r, t, e) {
  if (q(t)) {
    var n = re();
    return M(t, function(a) {
      if (a != null) {
        var o = bt(a, null);
        o != null && n.set(a, !0);
      }
    }), qe(e, function(a) {
      return a && n.get(a[r]);
    });
  } else {
    var i = bt(t, null);
    return qe(e, function(a) {
      return a && i != null && a[r] === i;
    });
  }
}
function MS(r, t) {
  return t.hasOwnProperty("subType") ? qe(r, function(e) {
    return e && e.subType === t.subType;
  }) : r;
}
function IS(r) {
  var t = re();
  return r && M(je(r.replaceMerge), function(e) {
    t.set(e, !0);
  }), {
    replaceMergeMainTypeMap: t
  };
}
_t(M0, T0);
var EV = [
  "getDom",
  "getZr",
  "getWidth",
  "getHeight",
  "getDevicePixelRatio",
  "dispatchAction",
  "isSSR",
  "isDisposed",
  "on",
  "off",
  "getDataURL",
  "getConnectedDataURL",
  // 'getModel',
  "getOption",
  // 'getViewOfComponentModel',
  // 'getViewOfSeriesModel',
  "getId",
  "updateLabelLayout"
], jM = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t) {
      M(EV, function(e) {
        this[e] = Q(t[e], t);
      }, this);
    }
    return r;
  }()
), Vd = {}, Zu = (
  /** @class */
  function() {
    function r() {
      this._coordinateSystems = [];
    }
    return r.prototype.create = function(t, e) {
      var n = [];
      M(Vd, function(i, a) {
        var o = i.create(t, e);
        n = n.concat(o || []);
      }), this._coordinateSystems = n;
    }, r.prototype.update = function(t, e) {
      M(this._coordinateSystems, function(n) {
        n.update && n.update(t, e);
      });
    }, r.prototype.getCoordinateSystems = function() {
      return this._coordinateSystems.slice();
    }, r.register = function(t, e) {
      Vd[t] = e;
    }, r.get = function(t) {
      return Vd[t];
    }, r;
  }()
), PV = /^(min|max)?(.+)$/, kV = (
  /** @class */
  function() {
    function r(t) {
      this._timelineOptions = [], this._mediaList = [], this._currentMediaIndices = [], this._api = t;
    }
    return r.prototype.setOption = function(t, e, n) {
      t && (M(je(t.series), function(o) {
        o && o.data && gr(o.data) && jf(o.data);
      }), M(je(t.dataset), function(o) {
        o && o.source && gr(o.source) && jf(o.source);
      })), t = ce(t);
      var i = this._optionBackup, a = RV(t, e, !i);
      this._newBaseOption = a.baseOption, i ? (a.timelineOptions.length && (i.timelineOptions = a.timelineOptions), a.mediaList.length && (i.mediaList = a.mediaList), a.mediaDefault && (i.mediaDefault = a.mediaDefault)) : this._optionBackup = a;
    }, r.prototype.mountOption = function(t) {
      var e = this._optionBackup;
      return this._timelineOptions = e.timelineOptions, this._mediaList = e.mediaList, this._mediaDefault = e.mediaDefault, this._currentMediaIndices = [], ce(t ? e.baseOption : this._newBaseOption);
    }, r.prototype.getTimelineOption = function(t) {
      var e, n = this._timelineOptions;
      if (n.length) {
        var i = t.getComponent("timeline");
        i && (e = ce(
          // FIXME:TS as TimelineModel or quivlant interface
          n[i.getCurrentIndex()]
        ));
      }
      return e;
    }, r.prototype.getMediaOption = function(t) {
      var e = this._api.getWidth(), n = this._api.getHeight(), i = this._mediaList, a = this._mediaDefault, o = [], s = [];
      if (!i.length && !a)
        return s;
      for (var l = 0, u = i.length; l < u; l++)
        OV(i[l].query, e, n) && o.push(l);
      return !o.length && a && (o = [-1]), o.length && !BV(o, this._currentMediaIndices) && (s = U(o, function(c) {
        return ce(c === -1 ? a.option : i[c].option);
      })), this._currentMediaIndices = o, s;
    }, r;
  }()
);
function RV(r, t, e) {
  var n = [], i, a, o = r.baseOption, s = r.timeline, l = r.options, u = r.media, c = !!r.media, f = !!(l || s || o && o.timeline);
  o ? (a = o, a.timeline || (a.timeline = s)) : ((f || c) && (r.options = r.media = null), a = r), c && q(u) && M(u, function(v) {
    v && v.option && (v.query ? n.push(v) : i || (i = v));
  }), h(a), M(l, function(v) {
    return h(v);
  }), M(n, function(v) {
    return h(v.option);
  });
  function h(v) {
    M(t, function(d) {
      d(v, e);
    });
  }
  return {
    baseOption: a,
    timelineOptions: l || [],
    mediaDefault: i,
    mediaList: n
  };
}
function OV(r, t, e) {
  var n = {
    width: t,
    height: e,
    aspectratio: t / e
    // lower case for convenience.
  }, i = !0;
  return M(r, function(a, o) {
    var s = o.match(PV);
    if (!(!s || !s[1] || !s[2])) {
      var l = s[1], u = s[2].toLowerCase();
      FV(n[u], a, l) || (i = !1);
    }
  }), i;
}
function FV(r, t, e) {
  return e === "min" ? r >= t : e === "max" ? r <= t : r === t;
}
function BV(r, t) {
  return r.join(",") === t.join(",");
}
var Xr = M, Su = ue, LS = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];
function $d(r) {
  var t = r && r.itemStyle;
  if (t)
    for (var e = 0, n = LS.length; e < n; e++) {
      var i = LS[e], a = t.normal, o = t.emphasis;
      a && a[i] && (r[i] = r[i] || {}, r[i].normal ? _e(r[i].normal, a[i]) : r[i].normal = a[i], a[i] = null), o && o[i] && (r[i] = r[i] || {}, r[i].emphasis ? _e(r[i].emphasis, o[i]) : r[i].emphasis = o[i], o[i] = null);
    }
}
function Ht(r, t, e) {
  if (r && r[t] && (r[t].normal || r[t].emphasis)) {
    var n = r[t].normal, i = r[t].emphasis;
    n && (e ? (r[t].normal = r[t].emphasis = null, se(r[t], n)) : r[t] = n), i && (r.emphasis = r.emphasis || {}, r.emphasis[t] = i, i.focus && (r.emphasis.focus = i.focus), i.blurScope && (r.emphasis.blurScope = i.blurScope));
  }
}
function Rl(r) {
  Ht(r, "itemStyle"), Ht(r, "lineStyle"), Ht(r, "areaStyle"), Ht(r, "label"), Ht(r, "labelLine"), Ht(r, "upperLabel"), Ht(r, "edgeLabel");
}
function gt(r, t) {
  var e = Su(r) && r[t], n = Su(e) && e.textStyle;
  if (n)
    for (var i = 0, a = Fb.length; i < a; i++) {
      var o = Fb[i];
      n.hasOwnProperty(o) && (e[o] = n[o]);
    }
}
function Or(r) {
  r && (Rl(r), gt(r, "label"), r.emphasis && gt(r.emphasis, "label"));
}
function NV(r) {
  if (Su(r)) {
    $d(r), Rl(r), gt(r, "label"), gt(r, "upperLabel"), gt(r, "edgeLabel"), r.emphasis && (gt(r.emphasis, "label"), gt(r.emphasis, "upperLabel"), gt(r.emphasis, "edgeLabel"));
    var t = r.markPoint;
    t && ($d(t), Or(t));
    var e = r.markLine;
    e && ($d(e), Or(e));
    var n = r.markArea;
    n && Or(n);
    var i = r.data;
    if (r.type === "graph") {
      i = i || r.nodes;
      var a = r.links || r.edges;
      if (a && !gr(a))
        for (var o = 0; o < a.length; o++)
          Or(a[o]);
      M(r.categories, function(u) {
        Rl(u);
      });
    }
    if (i && !gr(i))
      for (var o = 0; o < i.length; o++)
        Or(i[o]);
    if (t = r.markPoint, t && t.data)
      for (var s = t.data, o = 0; o < s.length; o++)
        Or(s[o]);
    if (e = r.markLine, e && e.data)
      for (var l = e.data, o = 0; o < l.length; o++)
        q(l[o]) ? (Or(l[o][0]), Or(l[o][1])) : Or(l[o]);
    r.type === "gauge" ? (gt(r, "axisLabel"), gt(r, "title"), gt(r, "detail")) : r.type === "treemap" ? (Ht(r.breadcrumb, "itemStyle"), M(r.levels, function(u) {
      Rl(u);
    })) : r.type === "tree" && Rl(r.leaves);
  }
}
function Wn(r) {
  return q(r) ? r : r ? [r] : [];
}
function ES(r) {
  return (q(r) ? r[0] : r) || {};
}
function zV(r, t) {
  Xr(Wn(r.series), function(n) {
    Su(n) && NV(n);
  });
  var e = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
  t && e.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"), Xr(e, function(n) {
    Xr(Wn(r[n]), function(i) {
      i && (gt(i, "axisLabel"), gt(i.axisPointer, "label"));
    });
  }), Xr(Wn(r.parallel), function(n) {
    var i = n && n.parallelAxisDefault;
    gt(i, "axisLabel"), gt(i && i.axisPointer, "label");
  }), Xr(Wn(r.calendar), function(n) {
    Ht(n, "itemStyle"), gt(n, "dayLabel"), gt(n, "monthLabel"), gt(n, "yearLabel");
  }), Xr(Wn(r.radar), function(n) {
    gt(n, "name"), n.name && n.axisName == null && (n.axisName = n.name, delete n.name), n.nameGap != null && n.axisNameGap == null && (n.axisNameGap = n.nameGap, delete n.nameGap);
  }), Xr(Wn(r.geo), function(n) {
    Su(n) && (Or(n), Xr(Wn(n.regions), function(i) {
      Or(i);
    }));
  }), Xr(Wn(r.timeline), function(n) {
    Or(n), Ht(n, "label"), Ht(n, "itemStyle"), Ht(n, "controlStyle", !0);
    var i = n.data;
    q(i) && M(i, function(a) {
      ue(a) && (Ht(a, "label"), Ht(a, "itemStyle"));
    });
  }), Xr(Wn(r.toolbox), function(n) {
    Ht(n, "iconStyle"), Xr(n.feature, function(i) {
      Ht(i, "iconStyle");
    });
  }), gt(ES(r.axisPointer), "label"), gt(ES(r.tooltip).axisPointer, "label");
}
function VV(r, t) {
  for (var e = t.split(","), n = r, i = 0; i < e.length && (n = n && n[e[i]], n != null); i++)
    ;
  return n;
}
function $V(r, t, e, n) {
  for (var i = t.split(","), a = r, o, s = 0; s < i.length - 1; s++)
    o = i[s], a[o] == null && (a[o] = {}), a = a[o];
  a[i[s]] == null && (a[i[s]] = e);
}
function PS(r) {
  r && M(GV, function(t) {
    t[0] in r && !(t[1] in r) && (r[t[1]] = r[t[0]]);
  });
}
var GV = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]], HV = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"], Gd = [["borderRadius", "barBorderRadius"], ["borderColor", "barBorderColor"], ["borderWidth", "barBorderWidth"]];
function al(r) {
  var t = r && r.itemStyle;
  if (t)
    for (var e = 0; e < Gd.length; e++) {
      var n = Gd[e][1], i = Gd[e][0];
      t[n] != null && (t[i] = t[n]);
    }
}
function kS(r) {
  r && r.alignTo === "edge" && r.margin != null && r.edgeDistance == null && (r.edgeDistance = r.margin);
}
function RS(r) {
  r && r.downplay && !r.blur && (r.blur = r.downplay);
}
function qV(r) {
  r && r.focusNodeAdjacency != null && (r.emphasis = r.emphasis || {}, r.emphasis.focus == null && (r.emphasis.focus = "adjacency"));
}
function KM(r, t) {
  if (r)
    for (var e = 0; e < r.length; e++)
      t(r[e]), r[e] && KM(r[e].children, t);
}
function JM(r, t) {
  zV(r, t), r.series = je(r.series), M(r.series, function(e) {
    if (ue(e)) {
      var n = e.type;
      if (n === "line")
        e.clipOverflow != null && (e.clip = e.clipOverflow);
      else if (n === "pie" || n === "gauge") {
        e.clockWise != null && (e.clockwise = e.clockWise), kS(e.label);
        var i = e.data;
        if (i && !gr(i))
          for (var a = 0; a < i.length; a++)
            kS(i[a]);
        e.hoverOffset != null && (e.emphasis = e.emphasis || {}, (e.emphasis.scaleSize = null) && (e.emphasis.scaleSize = e.hoverOffset));
      } else if (n === "gauge") {
        var o = VV(e, "pointer.color");
        o != null && $V(e, "itemStyle.color", o);
      } else if (n === "bar") {
        al(e), al(e.backgroundStyle), al(e.emphasis);
        var i = e.data;
        if (i && !gr(i))
          for (var a = 0; a < i.length; a++)
            typeof i[a] == "object" && (al(i[a]), al(i[a] && i[a].emphasis));
      } else if (n === "sunburst") {
        var s = e.highlightPolicy;
        s && (e.emphasis = e.emphasis || {}, e.emphasis.focus || (e.emphasis.focus = s)), RS(e), KM(e.data, RS);
      } else n === "graph" || n === "sankey" ? qV(e) : n === "map" && (e.mapType && !e.map && (e.map = e.mapType), e.mapLocation && se(e, e.mapLocation));
      e.hoverAnimation != null && (e.emphasis = e.emphasis || {}, e.emphasis && e.emphasis.scale == null && (e.emphasis.scale = e.hoverAnimation)), PS(e);
    }
  }), r.dataRange && (r.visualMap = r.dataRange), M(HV, function(e) {
    var n = r[e];
    n && (q(n) || (n = [n]), M(n, function(i) {
      PS(i);
    }));
  });
}
function WV(r) {
  var t = re();
  r.eachSeries(function(e) {
    var n = e.get("stack");
    if (n) {
      var i = t.get(n) || t.set(n, []), a = e.getData(), o = {
        // Used for calculate axis extent automatically.
        // TODO: Type getCalculationInfo return more specific type?
        stackResultDimension: a.getCalculationInfo("stackResultDimension"),
        stackedOverDimension: a.getCalculationInfo("stackedOverDimension"),
        stackedDimension: a.getCalculationInfo("stackedDimension"),
        stackedByDimension: a.getCalculationInfo("stackedByDimension"),
        isStackedByIndex: a.getCalculationInfo("isStackedByIndex"),
        data: a,
        seriesModel: e
      };
      if (!o.stackedDimension || !(o.isStackedByIndex || o.stackedByDimension))
        return;
      i.length && a.setCalculationInfo("stackedOnSeries", i[i.length - 1].seriesModel), i.push(o);
    }
  }), t.each(UV);
}
function UV(r) {
  M(r, function(t, e) {
    var n = [], i = [NaN, NaN], a = [t.stackResultDimension, t.stackedOverDimension], o = t.data, s = t.isStackedByIndex, l = t.seriesModel.get("stackStrategy") || "samesign";
    o.modify(a, function(u, c, f) {
      var h = o.get(t.stackedDimension, f);
      if (isNaN(h))
        return i;
      var v, d;
      s ? d = o.getRawIndex(f) : v = o.get(t.stackedByDimension, f);
      for (var p = NaN, g = e - 1; g >= 0; g--) {
        var m = r[g];
        if (s || (d = m.data.rawIndexOf(m.stackedByDimension, v)), d >= 0) {
          var y = m.data.getByRawIndex(m.stackResultDimension, d);
          if (l === "all" || l === "positive" && y > 0 || l === "negative" && y < 0 || l === "samesign" && h >= 0 && y > 0 || l === "samesign" && h <= 0 && y < 0) {
            h = HB(h, y), p = y;
            break;
          }
        }
      }
      return n[0] = h, n[1] = p, n;
    });
  });
}
var wv = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t) {
      this.data = t.data || (t.sourceFormat === zn ? {} : []), this.sourceFormat = t.sourceFormat || qM, this.seriesLayoutBy = t.seriesLayoutBy || Pn, this.startIndex = t.startIndex || 0, this.dimensionsDetectedCount = t.dimensionsDetectedCount, this.metaRawOption = t.metaRawOption;
      var e = this.dimensionsDefine = t.dimensionsDefine;
      if (e)
        for (var n = 0; n < e.length; n++) {
          var i = e[n];
          i.type == null && YM(this, n) === kt.Must && (i.type = "ordinal");
        }
    }
    return r;
  }()
);
function I0(r) {
  return r instanceof wv;
}
function Sm(r, t, e) {
  e = e || QM(r);
  var n = t.seriesLayoutBy, i = ZV(r, e, n, t.sourceHeader, t.dimensions), a = new wv({
    data: r,
    sourceFormat: e,
    seriesLayoutBy: n,
    dimensionsDefine: i.dimensionsDefine,
    startIndex: i.startIndex,
    dimensionsDetectedCount: i.dimensionsDetectedCount,
    metaRawOption: ce(t)
  });
  return a;
}
function L0(r) {
  return new wv({
    data: r,
    sourceFormat: gr(r) ? Ui : Ur
  });
}
function YV(r) {
  return new wv({
    data: r.data,
    sourceFormat: r.sourceFormat,
    seriesLayoutBy: r.seriesLayoutBy,
    dimensionsDefine: ce(r.dimensionsDefine),
    startIndex: r.startIndex,
    dimensionsDetectedCount: r.dimensionsDetectedCount
  });
}
function QM(r) {
  var t = qM;
  if (gr(r))
    t = Ui;
  else if (q(r)) {
    r.length === 0 && (t = Wt);
    for (var e = 0, n = r.length; e < n; e++) {
      var i = r[e];
      if (i != null) {
        if (q(i) || gr(i)) {
          t = Wt;
          break;
        } else if (ue(i)) {
          t = Yr;
          break;
        }
      }
    }
  } else if (ue(r)) {
    for (var a in r)
      if (te(r, a) && qt(r[a])) {
        t = zn;
        break;
      }
  }
  return t;
}
function ZV(r, t, e, n, i) {
  var a, o;
  if (!r)
    return {
      dimensionsDefine: OS(i),
      startIndex: o,
      dimensionsDetectedCount: a
    };
  if (t === Wt) {
    var s = r;
    n === "auto" || n == null ? FS(function(u) {
      u != null && u !== "-" && (J(u) ? o == null && (o = 1) : o = 0);
    }, e, s, 10) : o = Be(n) ? n : n ? 1 : 0, !i && o === 1 && (i = [], FS(function(u, c) {
      i[c] = u != null ? u + "" : "";
    }, e, s, 1 / 0)), a = i ? i.length : e === Ns ? s.length : s[0] ? s[0].length : null;
  } else if (t === Yr)
    i || (i = XV(r));
  else if (t === zn)
    i || (i = [], M(r, function(u, c) {
      i.push(c);
    }));
  else if (t === Ur) {
    var l = Es(r[0]);
    a = q(l) && l.length || 1;
  }
  return {
    startIndex: o,
    dimensionsDefine: OS(i),
    dimensionsDetectedCount: a
  };
}
function XV(r) {
  for (var t = 0, e; t < r.length && !(e = r[t++]); )
    ;
  if (e)
    return Ee(e);
}
function OS(r) {
  if (r) {
    var t = re();
    return U(r, function(e, n) {
      e = ue(e) ? e : {
        name: e
      };
      var i = {
        name: e.name,
        displayName: e.displayName,
        type: e.type
      };
      if (i.name == null)
        return i;
      i.name += "", i.displayName == null && (i.displayName = i.name);
      var a = t.get(i.name);
      return a ? i.name += "-" + a.count++ : t.set(i.name, {
        count: 1
      }), i;
    });
  }
}
function FS(r, t, e, n) {
  if (t === Ns)
    for (var i = 0; i < e.length && i < n; i++)
      r(e[i] ? e[i][0] : null, i);
  else
    for (var a = e[0] || [], i = 0; i < a.length && i < n; i++)
      r(a[i], i);
}
function eI(r) {
  var t = r.sourceFormat;
  return t === Yr || t === zn;
}
var Da, Ta, Ma, BS, NS, tI = (
  /** @class */
  function() {
    function r(t, e) {
      var n = I0(t) ? t : L0(t);
      this._source = n;
      var i = this._data = n.data;
      n.sourceFormat === Ui && (this._offset = 0, this._dimSize = e, this._data = i), NS(this, i, n);
    }
    return r.prototype.getSource = function() {
      return this._source;
    }, r.prototype.count = function() {
      return 0;
    }, r.prototype.getItem = function(t, e) {
    }, r.prototype.appendData = function(t) {
    }, r.prototype.clean = function() {
    }, r.protoInitialize = function() {
      var t = r.prototype;
      t.pure = !1, t.persistent = !0;
    }(), r.internalField = function() {
      var t;
      NS = function(o, s, l) {
        var u = l.sourceFormat, c = l.seriesLayoutBy, f = l.startIndex, h = l.dimensionsDefine, v = BS[E0(u, c)];
        if (H(o, v), u === Ui)
          o.getItem = e, o.count = i, o.fillStorage = n;
        else {
          var d = rI(u, c);
          o.getItem = Q(d, null, s, f, h);
          var p = nI(u, c);
          o.count = Q(p, null, s, f, h);
        }
      };
      var e = function(o, s) {
        o = o - this._offset, s = s || [];
        for (var l = this._data, u = this._dimSize, c = u * o, f = 0; f < u; f++)
          s[f] = l[c + f];
        return s;
      }, n = function(o, s, l, u) {
        for (var c = this._data, f = this._dimSize, h = 0; h < f; h++) {
          for (var v = u[h], d = v[0] == null ? 1 / 0 : v[0], p = v[1] == null ? -1 / 0 : v[1], g = s - o, m = l[h], y = 0; y < g; y++) {
            var _ = c[y * f + h];
            m[o + y] = _, _ < d && (d = _), _ > p && (p = _);
          }
          v[0] = d, v[1] = p;
        }
      }, i = function() {
        return this._data ? this._data.length / this._dimSize : 0;
      };
      BS = (t = {}, t[Wt + "_" + Pn] = {
        pure: !0,
        appendData: a
      }, t[Wt + "_" + Ns] = {
        pure: !0,
        appendData: function() {
          throw new Error('Do not support appendData when set seriesLayoutBy: "row".');
        }
      }, t[Yr] = {
        pure: !0,
        appendData: a
      }, t[zn] = {
        pure: !0,
        appendData: function(o) {
          var s = this._data;
          M(o, function(l, u) {
            for (var c = s[u] || (s[u] = []), f = 0; f < (l || []).length; f++)
              c.push(l[f]);
          });
        }
      }, t[Ur] = {
        appendData: a
      }, t[Ui] = {
        persistent: !1,
        pure: !0,
        appendData: function(o) {
          this._data = o;
        },
        // Clean self if data is already used.
        clean: function() {
          this._offset += this.count(), this._data = null;
        }
      }, t);
      function a(o) {
        for (var s = 0; s < o.length; s++)
          this._data.push(o[s]);
      }
    }(), r;
  }()
), zS = function(r, t, e, n) {
  return r[n];
}, jV = (Da = {}, Da[Wt + "_" + Pn] = function(r, t, e, n) {
  return r[n + t];
}, Da[Wt + "_" + Ns] = function(r, t, e, n, i) {
  n += t;
  for (var a = i || [], o = r, s = 0; s < o.length; s++) {
    var l = o[s];
    a[s] = l ? l[n] : null;
  }
  return a;
}, Da[Yr] = zS, Da[zn] = function(r, t, e, n, i) {
  for (var a = i || [], o = 0; o < e.length; o++) {
    var s = e[o].name, l = r[s];
    a[o] = l ? l[n] : null;
  }
  return a;
}, Da[Ur] = zS, Da);
function rI(r, t) {
  var e = jV[E0(r, t)];
  return e;
}
var VS = function(r, t, e) {
  return r.length;
}, KV = (Ta = {}, Ta[Wt + "_" + Pn] = function(r, t, e) {
  return Math.max(0, r.length - t);
}, Ta[Wt + "_" + Ns] = function(r, t, e) {
  var n = r[0];
  return n ? Math.max(0, n.length - t) : 0;
}, Ta[Yr] = VS, Ta[zn] = function(r, t, e) {
  var n = e[0].name, i = r[n];
  return i ? i.length : 0;
}, Ta[Ur] = VS, Ta);
function nI(r, t) {
  var e = KV[E0(r, t)];
  return e;
}
var Hd = function(r, t, e) {
  return r[t];
}, JV = (Ma = {}, Ma[Wt] = Hd, Ma[Yr] = function(r, t, e) {
  return r[e];
}, Ma[zn] = Hd, Ma[Ur] = function(r, t, e) {
  var n = Es(r);
  return n instanceof Array ? n[t] : n;
}, Ma[Ui] = Hd, Ma);
function iI(r) {
  var t = JV[r];
  return t;
}
function E0(r, t) {
  return r === Wt ? r + "_" + t : r;
}
function _s(r, t, e) {
  if (r) {
    var n = r.getRawDataItem(t);
    if (n != null) {
      var i = r.getStore(), a = i.getSource().sourceFormat;
      if (e != null) {
        var o = r.getDimensionIndex(e), s = i.getDimensionProperty(o);
        return iI(a)(n, o, s);
      } else {
        var l = n;
        return a === Ur && (l = Es(n)), l;
      }
    }
  }
}
var QV = /\{@(.+?)\}/g, Cv = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getDataParams = function(t, e) {
      var n = this.getData(e), i = this.getRawValue(t, e), a = n.getRawIndex(t), o = n.getName(t), s = n.getRawDataItem(t), l = n.getItemVisual(t, "style"), u = l && l[n.getItemVisual(t, "drawType") || "fill"], c = l && l.stroke, f = this.mainType, h = f === "series", v = n.userOutput && n.userOutput.get();
      return {
        componentType: f,
        componentSubType: this.subType,
        componentIndex: this.componentIndex,
        seriesType: h ? this.subType : null,
        seriesIndex: this.seriesIndex,
        seriesId: h ? this.id : null,
        seriesName: h ? this.name : null,
        name: o,
        dataIndex: a,
        data: s,
        dataType: e,
        value: i,
        color: u,
        borderColor: c,
        dimensionNames: v ? v.fullDimensions : null,
        encode: v ? v.encode : null,
        // Param name list for mapping `a`, `b`, `c`, `d`, `e`
        $vars: ["seriesName", "name", "value"]
      };
    }, r.prototype.getFormattedLabel = function(t, e, n, i, a, o) {
      e = e || "normal";
      var s = this.getData(n), l = this.getDataParams(t, n);
      if (o && (l.value = o.interpolatedValue), i != null && q(l.value) && (l.value = l.value[i]), !a) {
        var u = s.getItemModel(t);
        a = u.get(e === "normal" ? ["label", "formatter"] : [e, "label", "formatter"]);
      }
      if (oe(a))
        return l.status = e, l.dimensionIndex = i, a(l);
      if (J(a)) {
        var c = zM(a, l);
        return c.replace(QV, function(f, h) {
          var v = h.length, d = h;
          d.charAt(0) === "[" && d.charAt(v - 1) === "]" && (d = +d.slice(1, v - 1));
          var p = _s(s, t, d);
          if (o && q(o.interpolatedValue)) {
            var g = s.getDimensionIndex(d);
            g >= 0 && (p = o.interpolatedValue[g]);
          }
          return p != null ? p + "" : "";
        });
      }
    }, r.prototype.getRawValue = function(t, e) {
      return _s(this.getData(e), t);
    }, r.prototype.formatTooltip = function(t, e, n) {
    }, r;
  }()
);
function $S(r) {
  var t, e;
  return ue(r) ? r.type && (e = r) : t = r, {
    text: t,
    // markers: markers || markersExisting,
    frag: e
  };
}
function Jl(r) {
  return new e4(r);
}
var e4 = (
  /** @class */
  function() {
    function r(t) {
      t = t || {}, this._reset = t.reset, this._plan = t.plan, this._count = t.count, this._onDirty = t.onDirty, this._dirty = !0;
    }
    return r.prototype.perform = function(t) {
      var e = this._upstream, n = t && t.skip;
      if (this._dirty && e) {
        var i = this.context;
        i.data = i.outputData = e.context.outputData;
      }
      this.__pipeline && (this.__pipeline.currentTask = this);
      var a;
      this._plan && !n && (a = this._plan(this.context));
      var o = c(this._modBy), s = this._modDataCount || 0, l = c(t && t.modBy), u = t && t.modDataCount || 0;
      (o !== l || s !== u) && (a = "reset");
      function c(y) {
        return !(y >= 1) && (y = 1), y;
      }
      var f;
      (this._dirty || a === "reset") && (this._dirty = !1, f = this._doReset(n)), this._modBy = l, this._modDataCount = u;
      var h = t && t.step;
      if (e ? this._dueEnd = e._outputDueEnd : this._dueEnd = this._count ? this._count(this.context) : 1 / 0, this._progress) {
        var v = this._dueIndex, d = Math.min(h != null ? this._dueIndex + h : 1 / 0, this._dueEnd);
        if (!n && (f || v < d)) {
          var p = this._progress;
          if (q(p))
            for (var g = 0; g < p.length; g++)
              this._doProgress(p[g], v, d, l, u);
          else
            this._doProgress(p, v, d, l, u);
        }
        this._dueIndex = d;
        var m = this._settedOutputEnd != null ? this._settedOutputEnd : d;
        this._outputDueEnd = m;
      } else
        this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;
      return this.unfinished();
    }, r.prototype.dirty = function() {
      this._dirty = !0, this._onDirty && this._onDirty(this.context);
    }, r.prototype._doProgress = function(t, e, n, i, a) {
      GS.reset(e, n, i, a), this._callingProgress = t, this._callingProgress({
        start: e,
        end: n,
        count: n - e,
        next: GS.next
      }, this.context);
    }, r.prototype._doReset = function(t) {
      this._dueIndex = this._outputDueEnd = this._dueEnd = 0, this._settedOutputEnd = null;
      var e, n;
      !t && this._reset && (e = this._reset(this.context), e && e.progress && (n = e.forceFirstProgress, e = e.progress), q(e) && !e.length && (e = null)), this._progress = e, this._modBy = this._modDataCount = null;
      var i = this._downstream;
      return i && i.dirty(), n;
    }, r.prototype.unfinished = function() {
      return this._progress && this._dueIndex < this._dueEnd;
    }, r.prototype.pipe = function(t) {
      (this._downstream !== t || this._dirty) && (this._downstream = t, t._upstream = this, t.dirty());
    }, r.prototype.dispose = function() {
      this._disposed || (this._upstream && (this._upstream._downstream = null), this._downstream && (this._downstream._upstream = null), this._dirty = !1, this._disposed = !0);
    }, r.prototype.getUpstream = function() {
      return this._upstream;
    }, r.prototype.getDownstream = function() {
      return this._downstream;
    }, r.prototype.setOutputEnd = function(t) {
      this._outputDueEnd = this._settedOutputEnd = t;
    }, r;
  }()
), GS = /* @__PURE__ */ function() {
  var r, t, e, n, i, a = {
    reset: function(l, u, c, f) {
      t = l, r = u, e = c, n = f, i = Math.ceil(n / e), a.next = e > 1 && n > 0 ? s : o;
    }
  };
  return a;
  function o() {
    return t < r ? t++ : null;
  }
  function s() {
    var l = t % i * e + Math.ceil(t / i), u = t >= r ? null : l < n ? l : t;
    return t++, u;
  }
}();
function Yi(r, t) {
  var e = t && t.type;
  return e === "ordinal" ? r : (e === "time" && !Be(r) && r != null && r !== "-" && (r = +Fn(r)), r == null || r === "" ? NaN : Number(r));
}
var t4 = re({
  number: function(r) {
    return parseFloat(r);
  },
  time: function(r) {
    return +Fn(r);
  },
  trim: function(r) {
    return J(r) ? tn(r) : r;
  }
});
function aI(r) {
  return t4.get(r);
}
var oI = {
  lt: function(r, t) {
    return r < t;
  },
  lte: function(r, t) {
    return r <= t;
  },
  gt: function(r, t) {
    return r > t;
  },
  gte: function(r, t) {
    return r >= t;
  }
}, r4 = (
  /** @class */
  function() {
    function r(t, e) {
      if (!Be(e)) {
        var n = "";
        He(n);
      }
      this._opFn = oI[t], this._rvalFloat = ai(e);
    }
    return r.prototype.evaluate = function(t) {
      return Be(t) ? this._opFn(t, this._rvalFloat) : this._opFn(ai(t), this._rvalFloat);
    }, r;
  }()
), sI = (
  /** @class */
  function() {
    function r(t, e) {
      var n = t === "desc";
      this._resultLT = n ? 1 : -1, e == null && (e = n ? "min" : "max"), this._incomparable = e === "min" ? -1 / 0 : 1 / 0;
    }
    return r.prototype.evaluate = function(t, e) {
      var n = Be(t) ? t : ai(t), i = Be(e) ? e : ai(e), a = isNaN(n), o = isNaN(i);
      if (a && (n = this._incomparable), o && (i = this._incomparable), a && o) {
        var s = J(t), l = J(e);
        s && (n = l ? t : 0), l && (i = s ? e : 0);
      }
      return n < i ? this._resultLT : n > i ? -this._resultLT : 0;
    }, r;
  }()
), n4 = (
  /** @class */
  function() {
    function r(t, e) {
      this._rval = e, this._isEQ = t, this._rvalTypeof = typeof e, this._rvalFloat = ai(e);
    }
    return r.prototype.evaluate = function(t) {
      var e = t === this._rval;
      if (!e) {
        var n = typeof t;
        n !== this._rvalTypeof && (n === "number" || this._rvalTypeof === "number") && (e = ai(t) === this._rvalFloat);
      }
      return this._isEQ ? e : !e;
    }, r;
  }()
);
function i4(r, t) {
  return r === "eq" || r === "ne" ? new n4(r === "eq", t) : te(oI, r) ? new r4(r, t) : null;
}
var a4 = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getRawData = function() {
      throw new Error("not supported");
    }, r.prototype.getRawDataItem = function(t) {
      throw new Error("not supported");
    }, r.prototype.cloneRawData = function() {
    }, r.prototype.getDimensionInfo = function(t) {
    }, r.prototype.cloneAllDimensionInfo = function() {
    }, r.prototype.count = function() {
    }, r.prototype.retrieveValue = function(t, e) {
    }, r.prototype.retrieveValueFromItem = function(t, e) {
    }, r.prototype.convertValue = function(t, e) {
      return Yi(t, e);
    }, r;
  }()
);
function o4(r, t) {
  var e = new a4(), n = r.data, i = e.sourceFormat = r.sourceFormat, a = r.startIndex, o = "";
  r.seriesLayoutBy !== Pn && He(o);
  var s = [], l = {}, u = r.dimensionsDefine;
  if (u)
    M(u, function(p, g) {
      var m = p.name, y = {
        index: g,
        name: m,
        displayName: p.displayName
      };
      if (s.push(y), m != null) {
        var _ = "";
        te(l, m) && He(_), l[m] = y;
      }
    });
  else
    for (var c = 0; c < r.dimensionsDetectedCount; c++)
      s.push({
        index: c
      });
  var f = rI(i, Pn);
  t.__isBuiltIn && (e.getRawDataItem = function(p) {
    return f(n, a, s, p);
  }, e.getRawData = Q(s4, null, r)), e.cloneRawData = Q(l4, null, r);
  var h = nI(i, Pn);
  e.count = Q(h, null, n, a, s);
  var v = iI(i);
  e.retrieveValue = function(p, g) {
    var m = f(n, a, s, p);
    return d(m, g);
  };
  var d = e.retrieveValueFromItem = function(p, g) {
    if (p != null) {
      var m = s[g];
      if (m)
        return v(p, g, m.name);
    }
  };
  return e.getDimensionInfo = Q(u4, null, s, l), e.cloneAllDimensionInfo = Q(c4, null, s), e;
}
function s4(r) {
  var t = r.sourceFormat;
  if (!P0(t)) {
    var e = "";
    He(e);
  }
  return r.data;
}
function l4(r) {
  var t = r.sourceFormat, e = r.data;
  if (!P0(t)) {
    var n = "";
    He(n);
  }
  if (t === Wt) {
    for (var i = [], a = 0, o = e.length; a < o; a++)
      i.push(e[a].slice());
    return i;
  } else if (t === Yr) {
    for (var i = [], a = 0, o = e.length; a < o; a++)
      i.push(H({}, e[a]));
    return i;
  }
}
function u4(r, t, e) {
  if (e != null) {
    if (Be(e) || !isNaN(e) && !te(t, e))
      return r[e];
    if (te(t, e))
      return t[e];
  }
}
function c4(r) {
  return ce(r);
}
var lI = re();
function f4(r) {
  r = ce(r);
  var t = r.type, e = "";
  t || He(e);
  var n = t.split(":");
  n.length !== 2 && He(e);
  var i = !1;
  n[0] === "echarts" && (t = n[1], i = !0), r.__isBuiltIn = i, lI.set(t, r);
}
function h4(r, t, e) {
  var n = je(r), i = n.length, a = "";
  i || He(a);
  for (var o = 0, s = i; o < s; o++) {
    var l = n[o];
    t = v4(l, t), o !== s - 1 && (t.length = Math.max(t.length, 1));
  }
  return t;
}
function v4(r, t, e, n) {
  var i = "";
  t.length || He(i), ue(r) || He(i);
  var a = r.type, o = lI.get(a);
  o || He(i);
  var s = U(t, function(u) {
    return o4(u, o);
  }), l = je(o.transform({
    upstream: s[0],
    upstreamList: s,
    config: ce(r.config)
  }));
  return U(l, function(u, c) {
    var f = "";
    ue(u) || He(f), u.data || He(f);
    var h = QM(u.data);
    P0(h) || He(f);
    var v, d = t[0];
    if (d && c === 0 && !u.dimensions) {
      var p = d.startIndex;
      p && (u.data = d.data.slice(0, p).concat(u.data)), v = {
        seriesLayoutBy: Pn,
        sourceHeader: p,
        dimensions: d.metaRawOption.dimensions
      };
    } else
      v = {
        seriesLayoutBy: Pn,
        sourceHeader: 0,
        dimensions: u.dimensions
      };
    return Sm(u.data, v, null);
  });
}
function P0(r) {
  return r === Wt || r === Yr;
}
var Av = "undefined", d4 = typeof Uint32Array === Av ? Array : Uint32Array, p4 = typeof Uint16Array === Av ? Array : Uint16Array, uI = typeof Int32Array === Av ? Array : Int32Array, HS = typeof Float64Array === Av ? Array : Float64Array, cI = {
  float: HS,
  int: uI,
  // Ordinal data type can be string or int
  ordinal: Array,
  number: Array,
  time: HS
}, qd;
function zo(r) {
  return r > 65535 ? d4 : p4;
}
function Vo() {
  return [1 / 0, -1 / 0];
}
function g4(r) {
  var t = r.constructor;
  return t === Array ? r.slice() : new t(r);
}
function qS(r, t, e, n, i) {
  var a = cI[e || "float"];
  if (i) {
    var o = r[t], s = o && o.length;
    if (s !== n) {
      for (var l = new a(n), u = 0; u < s; u++)
        l[u] = o[u];
      r[t] = l;
    }
  } else
    r[t] = new a(n);
}
var xm = (
  /** @class */
  function() {
    function r() {
      this._chunks = [], this._rawExtent = [], this._extent = [], this._count = 0, this._rawCount = 0, this._calcDimNameToIdx = re();
    }
    return r.prototype.initData = function(t, e, n) {
      this._provider = t, this._chunks = [], this._indices = null, this.getRawIndex = this._getRawIdxIdentity;
      var i = t.getSource(), a = this.defaultDimValueGetter = qd[i.sourceFormat];
      this._dimValueGetter = n || a, this._rawExtent = [], eI(i), this._dimensions = U(e, function(o) {
        return {
          // Only pick these two props. Not leak other properties like orderMeta.
          type: o.type,
          property: o.property
        };
      }), this._initDataFromProvider(0, t.count());
    }, r.prototype.getProvider = function() {
      return this._provider;
    }, r.prototype.getSource = function() {
      return this._provider.getSource();
    }, r.prototype.ensureCalculationDimension = function(t, e) {
      var n = this._calcDimNameToIdx, i = this._dimensions, a = n.get(t);
      if (a != null) {
        if (i[a].type === e)
          return a;
      } else
        a = i.length;
      return i[a] = {
        type: e
      }, n.set(t, a), this._chunks[a] = new cI[e || "float"](this._rawCount), this._rawExtent[a] = Vo(), a;
    }, r.prototype.collectOrdinalMeta = function(t, e) {
      var n = this._chunks[t], i = this._dimensions[t], a = this._rawExtent, o = i.ordinalOffset || 0, s = n.length;
      o === 0 && (a[t] = Vo());
      for (var l = a[t], u = o; u < s; u++) {
        var c = n[u] = e.parseAndCollect(n[u]);
        isNaN(c) || (l[0] = Math.min(c, l[0]), l[1] = Math.max(c, l[1]));
      }
      i.ordinalMeta = e, i.ordinalOffset = s, i.type = "ordinal";
    }, r.prototype.getOrdinalMeta = function(t) {
      var e = this._dimensions[t], n = e.ordinalMeta;
      return n;
    }, r.prototype.getDimensionProperty = function(t) {
      var e = this._dimensions[t];
      return e && e.property;
    }, r.prototype.appendData = function(t) {
      var e = this._provider, n = this.count();
      e.appendData(t);
      var i = e.count();
      return e.persistent || (i += n), n < i && this._initDataFromProvider(n, i, !0), [n, i];
    }, r.prototype.appendValues = function(t, e) {
      for (var n = this._chunks, i = this._dimensions, a = i.length, o = this._rawExtent, s = this.count(), l = s + Math.max(t.length, e || 0), u = 0; u < a; u++) {
        var c = i[u];
        qS(n, u, c.type, l, !0);
      }
      for (var f = [], h = s; h < l; h++)
        for (var v = h - s, d = 0; d < a; d++) {
          var c = i[d], p = qd.arrayRows.call(this, t[v] || f, c.property, v, d);
          n[d][h] = p;
          var g = o[d];
          p < g[0] && (g[0] = p), p > g[1] && (g[1] = p);
        }
      return this._rawCount = this._count = l, {
        start: s,
        end: l
      };
    }, r.prototype._initDataFromProvider = function(t, e, n) {
      for (var i = this._provider, a = this._chunks, o = this._dimensions, s = o.length, l = this._rawExtent, u = U(o, function(y) {
        return y.property;
      }), c = 0; c < s; c++) {
        var f = o[c];
        l[c] || (l[c] = Vo()), qS(a, c, f.type, e, n);
      }
      if (i.fillStorage)
        i.fillStorage(t, e, a, l);
      else
        for (var h = [], v = t; v < e; v++) {
          h = i.getItem(v, h);
          for (var d = 0; d < s; d++) {
            var p = a[d], g = this._dimValueGetter(h, u[d], v, d);
            p[v] = g;
            var m = l[d];
            g < m[0] && (m[0] = g), g > m[1] && (m[1] = g);
          }
        }
      !i.persistent && i.clean && i.clean(), this._rawCount = this._count = e, this._extent = [];
    }, r.prototype.count = function() {
      return this._count;
    }, r.prototype.get = function(t, e) {
      if (!(e >= 0 && e < this._count))
        return NaN;
      var n = this._chunks[t];
      return n ? n[this.getRawIndex(e)] : NaN;
    }, r.prototype.getValues = function(t, e) {
      var n = [], i = [];
      if (e == null) {
        e = t, t = [];
        for (var a = 0; a < this._dimensions.length; a++)
          i.push(a);
      } else
        i = t;
      for (var a = 0, o = i.length; a < o; a++)
        n.push(this.get(i[a], e));
      return n;
    }, r.prototype.getByRawIndex = function(t, e) {
      if (!(e >= 0 && e < this._rawCount))
        return NaN;
      var n = this._chunks[t];
      return n ? n[e] : NaN;
    }, r.prototype.getSum = function(t) {
      var e = this._chunks[t], n = 0;
      if (e)
        for (var i = 0, a = this.count(); i < a; i++) {
          var o = this.get(t, i);
          isNaN(o) || (n += o);
        }
      return n;
    }, r.prototype.getMedian = function(t) {
      var e = [];
      this.each([t], function(a) {
        isNaN(a) || e.push(a);
      });
      var n = e.sort(function(a, o) {
        return a - o;
      }), i = this.count();
      return i === 0 ? 0 : i % 2 === 1 ? n[(i - 1) / 2] : (n[i / 2] + n[i / 2 - 1]) / 2;
    }, r.prototype.indexOfRawIndex = function(t) {
      if (t >= this._rawCount || t < 0)
        return -1;
      if (!this._indices)
        return t;
      var e = this._indices, n = e[t];
      if (n != null && n < this._count && n === t)
        return t;
      for (var i = 0, a = this._count - 1; i <= a; ) {
        var o = (i + a) / 2 | 0;
        if (e[o] < t)
          i = o + 1;
        else if (e[o] > t)
          a = o - 1;
        else
          return o;
      }
      return -1;
    }, r.prototype.indicesOfNearest = function(t, e, n) {
      var i = this._chunks, a = i[t], o = [];
      if (!a)
        return o;
      n == null && (n = 1 / 0);
      for (var s = 1 / 0, l = -1, u = 0, c = 0, f = this.count(); c < f; c++) {
        var h = this.getRawIndex(c), v = e - a[h], d = Math.abs(v);
        d <= n && ((d < s || d === s && v >= 0 && l < 0) && (s = d, l = v, u = 0), v === l && (o[u++] = c));
      }
      return o.length = u, o;
    }, r.prototype.getIndices = function() {
      var t, e = this._indices;
      if (e) {
        var n = e.constructor, i = this._count;
        if (n === Array) {
          t = new n(i);
          for (var a = 0; a < i; a++)
            t[a] = e[a];
        } else
          t = new n(e.buffer, 0, i);
      } else {
        var n = zo(this._rawCount);
        t = new n(this.count());
        for (var a = 0; a < t.length; a++)
          t[a] = a;
      }
      return t;
    }, r.prototype.filter = function(t, e) {
      if (!this._count)
        return this;
      for (var n = this.clone(), i = n.count(), a = zo(n._rawCount), o = new a(i), s = [], l = t.length, u = 0, c = t[0], f = n._chunks, h = 0; h < i; h++) {
        var v = void 0, d = n.getRawIndex(h);
        if (l === 0)
          v = e(h);
        else if (l === 1) {
          var p = f[c][d];
          v = e(p, h);
        } else {
          for (var g = 0; g < l; g++)
            s[g] = f[t[g]][d];
          s[g] = h, v = e.apply(null, s);
        }
        v && (o[u++] = d);
      }
      return u < i && (n._indices = o), n._count = u, n._extent = [], n._updateGetRawIdx(), n;
    }, r.prototype.selectRange = function(t) {
      var e = this.clone(), n = e._count;
      if (!n)
        return this;
      var i = Ee(t), a = i.length;
      if (!a)
        return this;
      var o = e.count(), s = zo(e._rawCount), l = new s(o), u = 0, c = i[0], f = t[c][0], h = t[c][1], v = e._chunks, d = !1;
      if (!e._indices) {
        var p = 0;
        if (a === 1) {
          for (var g = v[i[0]], m = 0; m < n; m++) {
            var y = g[m];
            (y >= f && y <= h || isNaN(y)) && (l[u++] = p), p++;
          }
          d = !0;
        } else if (a === 2) {
          for (var g = v[i[0]], _ = v[i[1]], b = t[i[1]][0], S = t[i[1]][1], m = 0; m < n; m++) {
            var y = g[m], x = _[m];
            (y >= f && y <= h || isNaN(y)) && (x >= b && x <= S || isNaN(x)) && (l[u++] = p), p++;
          }
          d = !0;
        }
      }
      if (!d)
        if (a === 1)
          for (var m = 0; m < o; m++) {
            var w = e.getRawIndex(m), y = v[i[0]][w];
            (y >= f && y <= h || isNaN(y)) && (l[u++] = w);
          }
        else
          for (var m = 0; m < o; m++) {
            for (var C = !0, w = e.getRawIndex(m), D = 0; D < a; D++) {
              var A = i[D], y = v[A][w];
              (y < t[A][0] || y > t[A][1]) && (C = !1);
            }
            C && (l[u++] = e.getRawIndex(m));
          }
      return u < o && (e._indices = l), e._count = u, e._extent = [], e._updateGetRawIdx(), e;
    }, r.prototype.map = function(t, e) {
      var n = this.clone(t);
      return this._updateDims(n, t, e), n;
    }, r.prototype.modify = function(t, e) {
      this._updateDims(this, t, e);
    }, r.prototype._updateDims = function(t, e, n) {
      for (var i = t._chunks, a = [], o = e.length, s = t.count(), l = [], u = t._rawExtent, c = 0; c < e.length; c++)
        u[e[c]] = Vo();
      for (var f = 0; f < s; f++) {
        for (var h = t.getRawIndex(f), v = 0; v < o; v++)
          l[v] = i[e[v]][h];
        l[o] = f;
        var d = n && n.apply(null, l);
        if (d != null) {
          typeof d != "object" && (a[0] = d, d = a);
          for (var c = 0; c < d.length; c++) {
            var p = e[c], g = d[c], m = u[p], y = i[p];
            y && (y[h] = g), g < m[0] && (m[0] = g), g > m[1] && (m[1] = g);
          }
        }
      }
    }, r.prototype.lttbDownSample = function(t, e) {
      var n = this.clone([t], !0), i = n._chunks, a = i[t], o = this.count(), s = 0, l = Math.floor(1 / e), u = this.getRawIndex(0), c, f, h, v = new (zo(this._rawCount))(Math.min((Math.ceil(o / l) + 2) * 2, o));
      v[s++] = u;
      for (var d = 1; d < o - 1; d += l) {
        for (var p = Math.min(d + l, o - 1), g = Math.min(d + l * 2, o), m = (g + p) / 2, y = 0, _ = p; _ < g; _++) {
          var b = this.getRawIndex(_), S = a[b];
          isNaN(S) || (y += S);
        }
        y /= g - p;
        var x = d, w = Math.min(d + l, o), C = d - 1, D = a[u];
        c = -1, h = x;
        for (var A = -1, T = 0, _ = x; _ < w; _++) {
          var b = this.getRawIndex(_), S = a[b];
          if (isNaN(S)) {
            T++, A < 0 && (A = b);
            continue;
          }
          f = Math.abs((C - m) * (S - D) - (C - _) * (y - D)), f > c && (c = f, h = b);
        }
        T > 0 && T < w - x && (v[s++] = Math.min(A, h), h = Math.max(A, h)), v[s++] = h, u = h;
      }
      return v[s++] = this.getRawIndex(o - 1), n._count = s, n._indices = v, n.getRawIndex = this._getRawIdx, n;
    }, r.prototype.minmaxDownSample = function(t, e) {
      for (var n = this.clone([t], !0), i = n._chunks, a = Math.floor(1 / e), o = i[t], s = this.count(), l = new (zo(this._rawCount))(Math.ceil(s / a) * 2), u = 0, c = 0; c < s; c += a) {
        var f = c, h = o[this.getRawIndex(f)], v = c, d = o[this.getRawIndex(v)], p = a;
        c + a > s && (p = s - c);
        for (var g = 0; g < p; g++) {
          var m = this.getRawIndex(c + g), y = o[m];
          y < h && (h = y, f = c + g), y > d && (d = y, v = c + g);
        }
        var _ = this.getRawIndex(f), b = this.getRawIndex(v);
        f < v ? (l[u++] = _, l[u++] = b) : (l[u++] = b, l[u++] = _);
      }
      return n._count = u, n._indices = l, n._updateGetRawIdx(), n;
    }, r.prototype.downSample = function(t, e, n, i) {
      for (var a = this.clone([t], !0), o = a._chunks, s = [], l = Math.floor(1 / e), u = o[t], c = this.count(), f = a._rawExtent[t] = Vo(), h = new (zo(this._rawCount))(Math.ceil(c / l)), v = 0, d = 0; d < c; d += l) {
        l > c - d && (l = c - d, s.length = l);
        for (var p = 0; p < l; p++) {
          var g = this.getRawIndex(d + p);
          s[p] = u[g];
        }
        var m = n(s), y = this.getRawIndex(Math.min(d + i(s, m) || 0, c - 1));
        u[y] = m, m < f[0] && (f[0] = m), m > f[1] && (f[1] = m), h[v++] = y;
      }
      return a._count = v, a._indices = h, a._updateGetRawIdx(), a;
    }, r.prototype.each = function(t, e) {
      if (this._count)
        for (var n = t.length, i = this._chunks, a = 0, o = this.count(); a < o; a++) {
          var s = this.getRawIndex(a);
          switch (n) {
            case 0:
              e(a);
              break;
            case 1:
              e(i[t[0]][s], a);
              break;
            case 2:
              e(i[t[0]][s], i[t[1]][s], a);
              break;
            default:
              for (var l = 0, u = []; l < n; l++)
                u[l] = i[t[l]][s];
              u[l] = a, e.apply(null, u);
          }
        }
    }, r.prototype.getDataExtent = function(t) {
      var e = this._chunks[t], n = Vo();
      if (!e)
        return n;
      var i = this.count(), a = !this._indices, o;
      if (a)
        return this._rawExtent[t].slice();
      if (o = this._extent[t], o)
        return o.slice();
      o = n;
      for (var s = o[0], l = o[1], u = 0; u < i; u++) {
        var c = this.getRawIndex(u), f = e[c];
        f < s && (s = f), f > l && (l = f);
      }
      return o = [s, l], this._extent[t] = o, o;
    }, r.prototype.getRawDataItem = function(t) {
      var e = this.getRawIndex(t);
      if (this._provider.persistent)
        return this._provider.getItem(e);
      for (var n = [], i = this._chunks, a = 0; a < i.length; a++)
        n.push(i[a][e]);
      return n;
    }, r.prototype.clone = function(t, e) {
      var n = new r(), i = this._chunks, a = t && kn(t, function(s, l) {
        return s[l] = !0, s;
      }, {});
      if (a)
        for (var o = 0; o < i.length; o++)
          n._chunks[o] = a[o] ? g4(i[o]) : i[o];
      else
        n._chunks = i;
      return this._copyCommonProps(n), e || (n._indices = this._cloneIndices()), n._updateGetRawIdx(), n;
    }, r.prototype._copyCommonProps = function(t) {
      t._count = this._count, t._rawCount = this._rawCount, t._provider = this._provider, t._dimensions = this._dimensions, t._extent = ce(this._extent), t._rawExtent = ce(this._rawExtent);
    }, r.prototype._cloneIndices = function() {
      if (this._indices) {
        var t = this._indices.constructor, e = void 0;
        if (t === Array) {
          var n = this._indices.length;
          e = new t(n);
          for (var i = 0; i < n; i++)
            e[i] = this._indices[i];
        } else
          e = new t(this._indices);
        return e;
      }
      return null;
    }, r.prototype._getRawIdxIdentity = function(t) {
      return t;
    }, r.prototype._getRawIdx = function(t) {
      return t < this._count && t >= 0 ? this._indices[t] : -1;
    }, r.prototype._updateGetRawIdx = function() {
      this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;
    }, r.internalField = function() {
      function t(e, n, i, a) {
        return Yi(e[a], this._dimensions[a]);
      }
      qd = {
        arrayRows: t,
        objectRows: function(e, n, i, a) {
          return Yi(e[n], this._dimensions[a]);
        },
        keyedColumns: t,
        original: function(e, n, i, a) {
          var o = e && (e.value == null ? e : e.value);
          return Yi(o instanceof Array ? o[a] : o, this._dimensions[a]);
        },
        typedArray: function(e, n, i, a) {
          return e[a];
        }
      };
    }(), r;
  }()
), fI = (
  /** @class */
  function() {
    function r(t) {
      this._sourceList = [], this._storeList = [], this._upstreamSignList = [], this._versionSignBase = 0, this._dirty = !0, this._sourceHost = t;
    }
    return r.prototype.dirty = function() {
      this._setLocalSource([], []), this._storeList = [], this._dirty = !0;
    }, r.prototype._setLocalSource = function(t, e) {
      this._sourceList = t, this._upstreamSignList = e, this._versionSignBase++, this._versionSignBase > 9e10 && (this._versionSignBase = 0);
    }, r.prototype._getVersionSign = function() {
      return this._sourceHost.uid + "_" + this._versionSignBase;
    }, r.prototype.prepareSource = function() {
      this._isDirty() && (this._createSource(), this._dirty = !1);
    }, r.prototype._createSource = function() {
      this._setLocalSource([], []);
      var t = this._sourceHost, e = this._getUpstreamSourceManagers(), n = !!e.length, i, a;
      if (kc(t)) {
        var o = t, s = void 0, l = void 0, u = void 0;
        if (n) {
          var c = e[0];
          c.prepareSource(), u = c.getSource(), s = u.data, l = u.sourceFormat, a = [c._getVersionSign()];
        } else
          s = o.get("data", !0), l = gr(s) ? Ui : Ur, a = [];
        var f = this._getSourceMetaRawOption() || {}, h = u && u.metaRawOption || {}, v = me(f.seriesLayoutBy, h.seriesLayoutBy) || null, d = me(f.sourceHeader, h.sourceHeader), p = me(f.dimensions, h.dimensions), g = v !== h.seriesLayoutBy || !!d != !!h.sourceHeader || p;
        i = g ? [Sm(s, {
          seriesLayoutBy: v,
          sourceHeader: d,
          dimensions: p
        }, l)] : [];
      } else {
        var m = t;
        if (n) {
          var y = this._applyTransform(e);
          i = y.sourceList, a = y.upstreamSignList;
        } else {
          var _ = m.get("source", !0);
          i = [Sm(_, this._getSourceMetaRawOption(), null)], a = [];
        }
      }
      this._setLocalSource(i, a);
    }, r.prototype._applyTransform = function(t) {
      var e = this._sourceHost, n = e.get("transform", !0), i = e.get("fromTransformResult", !0);
      if (i != null) {
        var a = "";
        t.length !== 1 && US(a);
      }
      var o, s = [], l = [];
      return M(t, function(u) {
        u.prepareSource();
        var c = u.getSource(i || 0), f = "";
        i != null && !c && US(f), s.push(c), l.push(u._getVersionSign());
      }), n ? o = h4(n, s, {
        datasetIndex: e.componentIndex
      }) : i != null && (o = [YV(s[0])]), {
        sourceList: o,
        upstreamSignList: l
      };
    }, r.prototype._isDirty = function() {
      if (this._dirty)
        return !0;
      for (var t = this._getUpstreamSourceManagers(), e = 0; e < t.length; e++) {
        var n = t[e];
        if (
          // Consider the case that there is ancestor diry, call it recursively.
          // The performance is probably not an issue because usually the chain is not long.
          n._isDirty() || this._upstreamSignList[e] !== n._getVersionSign()
        )
          return !0;
      }
    }, r.prototype.getSource = function(t) {
      t = t || 0;
      var e = this._sourceList[t];
      if (!e) {
        var n = this._getUpstreamSourceManagers();
        return n[0] && n[0].getSource(t);
      }
      return e;
    }, r.prototype.getSharedDataStore = function(t) {
      var e = t.makeStoreSchema();
      return this._innerGetDataStore(e.dimensions, t.source, e.hash);
    }, r.prototype._innerGetDataStore = function(t, e, n) {
      var i = 0, a = this._storeList, o = a[i];
      o || (o = a[i] = {});
      var s = o[n];
      if (!s) {
        var l = this._getUpstreamSourceManagers()[0];
        kc(this._sourceHost) && l ? s = l._innerGetDataStore(t, e, n) : (s = new xm(), s.initData(new tI(e, t.length), t)), o[n] = s;
      }
      return s;
    }, r.prototype._getUpstreamSourceManagers = function() {
      var t = this._sourceHost;
      if (kc(t)) {
        var e = D0(t);
        return e ? [e.getSourceManager()] : [];
      } else
        return U(xV(t), function(n) {
          return n.getSourceManager();
        });
    }, r.prototype._getSourceMetaRawOption = function() {
      var t = this._sourceHost, e, n, i;
      if (kc(t))
        e = t.get("seriesLayoutBy", !0), n = t.get("sourceHeader", !0), i = t.get("dimensions", !0);
      else if (!this._getUpstreamSourceManagers().length) {
        var a = t;
        e = a.get("seriesLayoutBy", !0), n = a.get("sourceHeader", !0), i = a.get("dimensions", !0);
      }
      return {
        seriesLayoutBy: e,
        sourceHeader: n,
        dimensions: i
      };
    }, r;
  }()
);
function WS(r) {
  var t = r.option.transform;
  t && jf(r.option.transform);
}
function kc(r) {
  return r.mainType === "series";
}
function US(r) {
  throw new Error(r);
}
var m4 = "line-height:1";
function hI(r) {
  var t = r.lineHeight;
  return t == null ? m4 : "line-height:" + Jt(t + "") + "px";
}
function vI(r, t) {
  var e = r.color || "#6e7079", n = r.fontSize || 12, i = r.fontWeight || "400", a = r.color || "#464646", o = r.fontSize || 14, s = r.fontWeight || "900";
  return t === "html" ? {
    // eslint-disable-next-line max-len
    nameStyle: "font-size:" + Jt(n + "") + "px;color:" + Jt(e) + ";font-weight:" + Jt(i + ""),
    // eslint-disable-next-line max-len
    valueStyle: "font-size:" + Jt(o + "") + "px;color:" + Jt(a) + ";font-weight:" + Jt(s + "")
  } : {
    nameStyle: {
      fontSize: n,
      fill: e,
      fontWeight: i
    },
    valueStyle: {
      fontSize: o,
      fill: a,
      fontWeight: s
    }
  };
}
var y4 = [0, 10, 20, 30], _4 = ["", `
`, `

`, `


`];
function It(r, t) {
  return t.type = r, t;
}
function wm(r) {
  return r.type === "section";
}
function dI(r) {
  return wm(r) ? b4 : S4;
}
function pI(r) {
  if (wm(r)) {
    var t = 0, e = r.blocks.length, n = e > 1 || e > 0 && !r.noHeader;
    return M(r.blocks, function(i) {
      var a = pI(i);
      a >= t && (t = a + +(n && // 0 always can not be readable gap level.
      (!a || wm(i) && !i.noHeader)));
    }), t;
  }
  return 0;
}
function b4(r, t, e, n) {
  var i = t.noHeader, a = x4(pI(t)), o = [], s = t.blocks || [];
  rr(!s || q(s)), s = s || [];
  var l = r.orderMode;
  if (t.sortBlocks && l) {
    s = s.slice();
    var u = {
      valueAsc: "asc",
      valueDesc: "desc"
    };
    if (te(u, l)) {
      var c = new sI(u[l], null);
      s.sort(function(p, g) {
        return c.evaluate(p.sortParam, g.sortParam);
      });
    } else l === "seriesDesc" && s.reverse();
  }
  M(s, function(p, g) {
    var m = t.valueFormatter, y = dI(p)(
      // Inherit valueFormatter
      m ? H(H({}, r), {
        valueFormatter: m
      }) : r,
      p,
      g > 0 ? a.html : 0,
      n
    );
    y != null && o.push(y);
  });
  var f = r.renderMode === "richText" ? o.join(a.richText) : Cm(n, o.join(""), i ? e : a.html);
  if (i)
    return f;
  var h = ym(t.header, "ordinal", r.useUTC), v = vI(n, r.renderMode).nameStyle, d = hI(n);
  return r.renderMode === "richText" ? gI(r, h, v) + a.richText + f : Cm(n, '<div style="' + v + ";" + d + ';">' + Jt(h) + "</div>" + f, e);
}
function S4(r, t, e, n) {
  var i = r.renderMode, a = t.noName, o = t.noValue, s = !t.markerType, l = t.name, u = r.useUTC, c = t.valueFormatter || r.valueFormatter || function(b) {
    return b = q(b) ? b : [b], U(b, function(S, x) {
      return ym(S, q(v) ? v[x] : v, u);
    });
  };
  if (!(a && o)) {
    var f = s ? "" : r.markupStyleCreator.makeTooltipMarker(t.markerType, t.markerColor || "#333", i), h = a ? "" : ym(l, "ordinal", u), v = t.valueType, d = o ? [] : c(t.value, t.dataIndex), p = !s || !a, g = !s && a, m = vI(n, i), y = m.nameStyle, _ = m.valueStyle;
    return i === "richText" ? (s ? "" : f) + (a ? "" : gI(r, h, y)) + (o ? "" : A4(r, d, p, g, _)) : Cm(n, (s ? "" : f) + (a ? "" : w4(h, !s, y)) + (o ? "" : C4(d, p, g, _)), e);
  }
}
function YS(r, t, e, n, i, a) {
  if (r) {
    var o = dI(r), s = {
      useUTC: i,
      renderMode: e,
      orderMode: n,
      markupStyleCreator: t,
      valueFormatter: r.valueFormatter
    };
    return o(s, r, 0, a);
  }
}
function x4(r) {
  return {
    html: y4[r],
    richText: _4[r]
  };
}
function Cm(r, t, e) {
  var n = '<div style="clear:both"></div>', i = "margin: " + e + "px 0 0", a = hI(r);
  return '<div style="' + i + ";" + a + ';">' + t + n + "</div>";
}
function w4(r, t, e) {
  var n = t ? "margin-left:2px" : "";
  return '<span style="' + e + ";" + n + '">' + Jt(r) + "</span>";
}
function C4(r, t, e, n) {
  var i = e ? "10px" : "20px", a = t ? "float:right;margin-left:" + i : "";
  return r = q(r) ? r : [r], '<span style="' + a + ";" + n + '">' + U(r, function(o) {
    return Jt(o);
  }).join("&nbsp;&nbsp;") + "</span>";
}
function gI(r, t, e) {
  return r.markupStyleCreator.wrapRichTextStyle(t, e);
}
function A4(r, t, e, n, i) {
  var a = [i], o = n ? 10 : 20;
  return e && a.push({
    padding: [0, 0, 0, o],
    align: "right"
  }), r.markupStyleCreator.wrapRichTextStyle(q(t) ? t.join("  ") : t, a);
}
function mI(r, t) {
  var e = r.getData().getItemVisual(t, "style"), n = e[r.visualDrawType];
  return mo(n);
}
function yI(r, t) {
  var e = r.get("padding");
  return e ?? (t === "richText" ? [8, 10] : 10);
}
var Wd = (
  /** @class */
  function() {
    function r() {
      this.richTextStyles = {}, this._nextStyleNameId = PT();
    }
    return r.prototype._generateStyleName = function() {
      return "__EC_aUTo_" + this._nextStyleNameId++;
    }, r.prototype.makeTooltipMarker = function(t, e, n) {
      var i = n === "richText" ? this._generateStyleName() : null, a = pV({
        color: e,
        type: t,
        renderMode: n,
        markerId: i
      });
      return J(a) ? a : (this.richTextStyles[i] = a.style, a.content);
    }, r.prototype.wrapRichTextStyle = function(t, e) {
      var n = {};
      q(e) ? M(e, function(a) {
        return H(n, a);
      }) : H(n, e);
      var i = this._generateStyleName();
      return this.richTextStyles[i] = n, "{" + i + "|" + t + "}";
    }, r;
  }()
);
function _I(r) {
  var t = r.series, e = r.dataIndex, n = r.multipleSeries, i = t.getData(), a = i.mapDimensionsAll("defaultedTooltip"), o = a.length, s = t.getRawValue(e), l = q(s), u = mI(t, e), c, f, h, v;
  if (o > 1 || l && !o) {
    var d = D4(s, t, e, a, u);
    c = d.inlineValues, f = d.inlineValueTypes, h = d.blocks, v = d.inlineValues[0];
  } else if (o) {
    var p = i.getDimensionInfo(a[0]);
    v = c = _s(i, e, a[0]), f = p.type;
  } else
    v = c = l ? s[0] : s;
  var g = i0(t), m = g && t.name || "", y = i.getName(e), _ = n ? m : y;
  return It("section", {
    header: m,
    // When series name is not specified, do not show a header line with only '-'.
    // This case always happens in tooltip.trigger: 'item'.
    noHeader: n || !g,
    sortParam: v,
    blocks: [It("nameValue", {
      markerType: "item",
      markerColor: u,
      // Do not mix display seriesName and itemName in one tooltip,
      // which might confuses users.
      name: _,
      // name dimension might be auto assigned, where the name might
      // be not readable. So we check trim here.
      noName: !tn(_),
      value: c,
      valueType: f,
      dataIndex: e
    })].concat(h || [])
  });
}
function D4(r, t, e, n, i) {
  var a = t.getData(), o = kn(r, function(f, h, v) {
    var d = a.getDimensionInfo(v);
    return f = f || d && d.tooltip !== !1 && d.displayName != null;
  }, !1), s = [], l = [], u = [];
  n.length ? M(n, function(f) {
    c(_s(a, e, f), f);
  }) : M(r, c);
  function c(f, h) {
    var v = a.getDimensionInfo(h);
    !v || v.otherDims.tooltip === !1 || (o ? u.push(It("nameValue", {
      markerType: "subItem",
      markerColor: i,
      name: v.displayName,
      value: f,
      valueType: v.type
    })) : (s.push(f), l.push(v.type)));
  }
  return {
    inlineValues: s,
    inlineValueTypes: l,
    blocks: u
  };
}
var xi = Oe();
function Rc(r, t) {
  return r.getName(t) || r.getId(t);
}
var Of = "__universalTransitionEnabled", it = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e._selectedDataIndicesMap = {}, e;
    }
    return t.prototype.init = function(e, n, i) {
      this.seriesIndex = this.componentIndex, this.dataTask = Jl({
        count: M4,
        reset: I4
      }), this.dataTask.context = {
        model: this
      }, this.mergeDefaultAndTheme(e, i);
      var a = xi(this).sourceManager = new fI(this);
      a.prepareSource();
      var o = this.getInitialData(e, i);
      XS(o, this), this.dataTask.context.data = o, xi(this).dataBeforeProcessed = o, ZS(this), this._initSelectedMapFromData(o);
    }, t.prototype.mergeDefaultAndTheme = function(e, n) {
      var i = bu(this), a = i ? Bs(e) : {}, o = this.subType;
      Le.hasClass(o) && (o += "Series"), _e(e, n.getTheme().get(this.subType)), _e(e, this.getDefaultOption()), ho(e, "label", ["show"]), this.fillDataTextStyle(e.data), i && Qi(e, a, i);
    }, t.prototype.mergeOption = function(e, n) {
      e = _e(this.option, e, !0), this.fillDataTextStyle(e.data);
      var i = bu(this);
      i && Qi(this.option, e, i);
      var a = xi(this).sourceManager;
      a.dirty(), a.prepareSource();
      var o = this.getInitialData(e, n);
      XS(o, this), this.dataTask.dirty(), this.dataTask.context.data = o, xi(this).dataBeforeProcessed = o, ZS(this), this._initSelectedMapFromData(o);
    }, t.prototype.fillDataTextStyle = function(e) {
      if (e && !gr(e))
        for (var n = ["show"], i = 0; i < e.length; i++)
          e[i] && e[i].label && ho(e[i], "label", n);
    }, t.prototype.getInitialData = function(e, n) {
    }, t.prototype.appendData = function(e) {
      var n = this.getRawData();
      n.appendData(e.data);
    }, t.prototype.getData = function(e) {
      var n = Am(this);
      if (n) {
        var i = n.context.data;
        return e == null || !i.getLinkedData ? i : i.getLinkedData(e);
      } else
        return xi(this).data;
    }, t.prototype.getAllData = function() {
      var e = this.getData();
      return e && e.getLinkedDataAll ? e.getLinkedDataAll() : [{
        data: e
      }];
    }, t.prototype.setData = function(e) {
      var n = Am(this);
      if (n) {
        var i = n.context;
        i.outputData = e, n !== this.dataTask && (i.data = e);
      }
      xi(this).data = e;
    }, t.prototype.getEncode = function() {
      var e = this.get("encode", !0);
      if (e)
        return re(e);
    }, t.prototype.getSourceManager = function() {
      return xi(this).sourceManager;
    }, t.prototype.getSource = function() {
      return this.getSourceManager().getSource();
    }, t.prototype.getRawData = function() {
      return xi(this).dataBeforeProcessed;
    }, t.prototype.getColorBy = function() {
      var e = this.get("colorBy");
      return e || "series";
    }, t.prototype.isColorBySeries = function() {
      return this.getColorBy() === "series";
    }, t.prototype.getBaseAxis = function() {
      var e = this.coordinateSystem;
      return e && e.getBaseAxis && e.getBaseAxis();
    }, t.prototype.formatTooltip = function(e, n, i) {
      return _I({
        series: this,
        dataIndex: e,
        multipleSeries: n
      });
    }, t.prototype.isAnimationEnabled = function() {
      var e = this.ecModel;
      if (Ie.node && !(e && e.ssr))
        return !1;
      var n = this.getShallow("animation");
      return n && this.getData().count() > this.getShallow("animationThreshold") && (n = !1), !!n;
    }, t.prototype.restoreData = function() {
      this.dataTask.dirty();
    }, t.prototype.getColorFromPalette = function(e, n, i) {
      var a = this.ecModel, o = T0.prototype.getColorFromPalette.call(this, e, n, i);
      return o || (o = a.getColorFromPalette(e, n, i)), o;
    }, t.prototype.coordDimToDataDim = function(e) {
      return this.getRawData().mapDimensionsAll(e);
    }, t.prototype.getProgressive = function() {
      return this.get("progressive");
    }, t.prototype.getProgressiveThreshold = function() {
      return this.get("progressiveThreshold");
    }, t.prototype.select = function(e, n) {
      this._innerSelect(this.getData(n), e);
    }, t.prototype.unselect = function(e, n) {
      var i = this.option.selectedMap;
      if (i) {
        var a = this.option.selectedMode, o = this.getData(n);
        if (a === "series" || i === "all") {
          this.option.selectedMap = {}, this._selectedDataIndicesMap = {};
          return;
        }
        for (var s = 0; s < e.length; s++) {
          var l = e[s], u = Rc(o, l);
          i[u] = !1, this._selectedDataIndicesMap[u] = -1;
        }
      }
    }, t.prototype.toggleSelect = function(e, n) {
      for (var i = [], a = 0; a < e.length; a++)
        i[0] = e[a], this.isSelected(e[a], n) ? this.unselect(i, n) : this.select(i, n);
    }, t.prototype.getSelectedDataIndices = function() {
      if (this.option.selectedMap === "all")
        return [].slice.call(this.getData().getIndices());
      for (var e = this._selectedDataIndicesMap, n = Ee(e), i = [], a = 0; a < n.length; a++) {
        var o = e[n[a]];
        o >= 0 && i.push(o);
      }
      return i;
    }, t.prototype.isSelected = function(e, n) {
      var i = this.option.selectedMap;
      if (!i)
        return !1;
      var a = this.getData(n);
      return (i === "all" || i[Rc(a, e)]) && !a.getItemModel(e).get(["select", "disabled"]);
    }, t.prototype.isUniversalTransitionEnabled = function() {
      if (this[Of])
        return !0;
      var e = this.option.universalTransition;
      return e ? e === !0 ? !0 : e && e.enabled : !1;
    }, t.prototype._innerSelect = function(e, n) {
      var i, a, o = this.option, s = o.selectedMode, l = n.length;
      if (!(!s || !l)) {
        if (s === "series")
          o.selectedMap = "all";
        else if (s === "multiple") {
          ue(o.selectedMap) || (o.selectedMap = {});
          for (var u = o.selectedMap, c = 0; c < l; c++) {
            var f = n[c], h = Rc(e, f);
            u[h] = !0, this._selectedDataIndicesMap[h] = e.getRawIndex(f);
          }
        } else if (s === "single" || s === !0) {
          var v = n[l - 1], h = Rc(e, v);
          o.selectedMap = (i = {}, i[h] = !0, i), this._selectedDataIndicesMap = (a = {}, a[h] = e.getRawIndex(v), a);
        }
      }
    }, t.prototype._initSelectedMapFromData = function(e) {
      if (!this.option.selectedMap) {
        var n = [];
        e.hasItemOption && e.each(function(i) {
          var a = e.getRawDataItem(i);
          a && a.selected && n.push(i);
        }), n.length > 0 && this._innerSelect(e, n);
      }
    }, t.registerClass = function(e) {
      return Le.registerClass(e);
    }, t.protoInitialize = function() {
      var e = t.prototype;
      e.type = "series.__base__", e.seriesIndex = 0, e.ignoreStyleOnData = !1, e.hasSymbolVisual = !1, e.defaultSymbol = "circle", e.visualStyleAccessPath = "itemStyle", e.visualDrawType = "fill";
    }(), t;
  }(Le)
);
_t(it, Cv);
_t(it, T0);
$T(it, Le);
function ZS(r) {
  var t = r.name;
  i0(r) || (r.name = T4(r) || t);
}
function T4(r) {
  var t = r.getRawData(), e = t.mapDimensionsAll("seriesName"), n = [];
  return M(e, function(i) {
    var a = t.getDimensionInfo(i);
    a.displayName && n.push(a.displayName);
  }), n.join(" ");
}
function M4(r) {
  return r.model.getRawData().count();
}
function I4(r) {
  var t = r.model;
  return t.setData(t.getRawData().cloneShallow()), L4;
}
function L4(r, t) {
  t.outputData && r.end > t.outputData.count() && t.model.getRawData().cloneShallow(t.outputData);
}
function XS(r, t) {
  M(cu(r.CHANGABLE_METHODS, r.DOWNSAMPLE_METHODS), function(e) {
    r.wrapMethod(e, ye(E4, t));
  });
}
function E4(r, t) {
  var e = Am(r);
  return e && e.setOutputEnd((t || this).count()), t;
}
function Am(r) {
  var t = (r.ecModel || {}).scheduler, e = t && t.getPipeline(r.uid);
  if (e) {
    var n = e.currentTask;
    if (n) {
      var i = n.agentStubMap;
      i && (n = i.get(r.uid));
    }
    return n;
  }
}
var lt = (
  /** @class */
  function() {
    function r() {
      this.group = new fe(), this.uid = Os("viewComponent");
    }
    return r.prototype.init = function(t, e) {
    }, r.prototype.render = function(t, e, n, i) {
    }, r.prototype.dispose = function(t, e) {
    }, r.prototype.updateView = function(t, e, n, i) {
    }, r.prototype.updateLayout = function(t, e, n, i) {
    }, r.prototype.updateVisual = function(t, e, n, i) {
    }, r.prototype.toggleBlurSeries = function(t, e, n) {
    }, r.prototype.eachRendered = function(t) {
      var e = this.group;
      e && e.traverse(t);
    }, r;
  }()
);
o0(lt);
ov(lt);
function zs() {
  var r = Oe();
  return function(t) {
    var e = r(t), n = t.pipelineContext, i = !!e.large, a = !!e.progressiveRender, o = e.large = !!(n && n.large), s = e.progressiveRender = !!(n && n.progressiveRender);
    return (i !== o || a !== s) && "reset";
  };
}
var bI = Oe(), P4 = zs(), Qe = (
  /** @class */
  function() {
    function r() {
      this.group = new fe(), this.uid = Os("viewChart"), this.renderTask = Jl({
        plan: k4,
        reset: R4
      }), this.renderTask.context = {
        view: this
      };
    }
    return r.prototype.init = function(t, e) {
    }, r.prototype.render = function(t, e, n, i) {
    }, r.prototype.highlight = function(t, e, n, i) {
      var a = t.getData(i && i.dataType);
      a && KS(a, i, "emphasis");
    }, r.prototype.downplay = function(t, e, n, i) {
      var a = t.getData(i && i.dataType);
      a && KS(a, i, "normal");
    }, r.prototype.remove = function(t, e) {
      this.group.removeAll();
    }, r.prototype.dispose = function(t, e) {
    }, r.prototype.updateView = function(t, e, n, i) {
      this.render(t, e, n, i);
    }, r.prototype.updateLayout = function(t, e, n, i) {
      this.render(t, e, n, i);
    }, r.prototype.updateVisual = function(t, e, n, i) {
      this.render(t, e, n, i);
    }, r.prototype.eachRendered = function(t) {
      sa(this.group, t);
    }, r.markUpdateMethod = function(t, e) {
      bI(t).updateMethod = e;
    }, r.protoInitialize = function() {
      var t = r.prototype;
      t.type = "chart";
    }(), r;
  }()
);
function jS(r, t, e) {
  r && mu(r) && (t === "emphasis" ? oi : si)(r, e);
}
function KS(r, t, e) {
  var n = vo(r, t), i = t && t.highlightKey != null ? gz(t.highlightKey) : null;
  n != null ? M(je(n), function(a) {
    jS(r.getItemGraphicEl(a), e, i);
  }) : r.eachItemGraphicEl(function(a) {
    jS(a, e, i);
  });
}
o0(Qe);
ov(Qe);
function k4(r) {
  return P4(r.model);
}
function R4(r) {
  var t = r.model, e = r.ecModel, n = r.api, i = r.payload, a = t.pipelineContext.progressiveRender, o = r.view, s = i && bI(i).updateMethod, l = a ? "incrementalPrepareRender" : s && o[s] ? s : "render";
  return l !== "render" && o[l](t, e, n, i), O4[l];
}
var O4 = {
  incrementalPrepareRender: {
    progress: function(r, t) {
      t.view.incrementalRender(r, t.model, t.ecModel, t.api, t.payload);
    }
  },
  render: {
    // Put view.render in `progress` to support appendData. But in this case
    // view.render should not be called in reset, otherwise it will be called
    // twise. Use `forceFirstProgress` to make sure that view.render is called
    // in any cases.
    forceFirstProgress: !0,
    progress: function(r, t) {
      t.view.render(t.model, t.ecModel, t.api, t.payload);
    }
  }
}, vh = "\0__throttleOriginMethod", JS = "\0__throttleRate", QS = "\0__throttleType";
function k0(r, t, e) {
  var n, i = 0, a = 0, o = null, s, l, u, c;
  t = t || 0;
  function f() {
    a = (/* @__PURE__ */ new Date()).getTime(), o = null, r.apply(l, u || []);
  }
  var h = function() {
    for (var v = [], d = 0; d < arguments.length; d++)
      v[d] = arguments[d];
    n = (/* @__PURE__ */ new Date()).getTime(), l = this, u = v;
    var p = c || t, g = c || e;
    c = null, s = n - (g ? i : a) - p, clearTimeout(o), g ? o = setTimeout(f, p) : s >= 0 ? f() : o = setTimeout(f, -s), i = n;
  };
  return h.clear = function() {
    o && (clearTimeout(o), o = null);
  }, h.debounceNextCall = function(v) {
    c = v;
  }, h;
}
function Vs(r, t, e, n) {
  var i = r[t];
  if (i) {
    var a = i[vh] || i, o = i[QS], s = i[JS];
    if (s !== e || o !== n) {
      if (e == null || !n)
        return r[t] = a;
      i = r[t] = k0(a, e, n === "debounce"), i[vh] = a, i[QS] = n, i[JS] = e;
    }
    return i;
  }
}
function xu(r, t) {
  var e = r[t];
  e && e[vh] && (e.clear && e.clear(), r[t] = e[vh]);
}
var ex = Oe(), tx = {
  itemStyle: po(DM, !0),
  lineStyle: po(AM, !0)
}, F4 = {
  lineStyle: "stroke",
  itemStyle: "fill"
};
function SI(r, t) {
  var e = r.visualStyleMapper || tx[t];
  return e || (console.warn("Unknown style type '" + t + "'."), tx.itemStyle);
}
function xI(r, t) {
  var e = r.visualDrawType || F4[t];
  return e || (console.warn("Unknown style type '" + t + "'."), "fill");
}
var B4 = {
  createOnAllSeries: !0,
  performRawSeries: !0,
  reset: function(r, t) {
    var e = r.getData(), n = r.visualStyleAccessPath || "itemStyle", i = r.getModel(n), a = SI(r, n), o = a(i), s = i.getShallow("decal");
    s && (e.setVisual("decal", s), s.dirty = !0);
    var l = xI(r, n), u = o[l], c = oe(u) ? u : null, f = o.fill === "auto" || o.stroke === "auto";
    if (!o[l] || c || f) {
      var h = r.getColorFromPalette(
        // TODO series count changed.
        r.name,
        null,
        t.getSeriesCount()
      );
      o[l] || (o[l] = h, e.setVisual("colorFromPalette", !0)), o.fill = o.fill === "auto" || oe(o.fill) ? h : o.fill, o.stroke = o.stroke === "auto" || oe(o.stroke) ? h : o.stroke;
    }
    if (e.setVisual("style", o), e.setVisual("drawType", l), !t.isSeriesFiltered(r) && c)
      return e.setVisual("colorFromPalette", !1), {
        dataEach: function(v, d) {
          var p = r.getDataParams(d), g = H({}, o);
          g[l] = c(p), v.setItemVisual(d, "style", g);
        }
      };
  }
}, ol = new Ze(), N4 = {
  createOnAllSeries: !0,
  performRawSeries: !0,
  reset: function(r, t) {
    if (!(r.ignoreStyleOnData || t.isSeriesFiltered(r))) {
      var e = r.getData(), n = r.visualStyleAccessPath || "itemStyle", i = SI(r, n), a = e.getVisual("drawType");
      return {
        dataEach: e.hasItemOption ? function(o, s) {
          var l = o.getRawDataItem(s);
          if (l && l[n]) {
            ol.option = l[n];
            var u = i(ol), c = o.ensureUniqueItemVisual(s, "style");
            H(c, u), ol.option.decal && (o.setItemVisual(s, "decal", ol.option.decal), ol.option.decal.dirty = !0), a in u && o.setItemVisual(s, "colorFromPalette", !1);
          }
        } : null
      };
    }
  }
}, z4 = {
  performRawSeries: !0,
  overallReset: function(r) {
    var t = re();
    r.eachSeries(function(e) {
      var n = e.getColorBy();
      if (!e.isColorBySeries()) {
        var i = e.type + "-" + n, a = t.get(i);
        a || (a = {}, t.set(i, a)), ex(e).scope = a;
      }
    }), r.eachSeries(function(e) {
      if (!(e.isColorBySeries() || r.isSeriesFiltered(e))) {
        var n = e.getRawData(), i = {}, a = e.getData(), o = ex(e).scope, s = e.visualStyleAccessPath || "itemStyle", l = xI(e, s);
        a.each(function(u) {
          var c = a.getRawIndex(u);
          i[c] = u;
        }), n.each(function(u) {
          var c = i[u], f = a.getItemVisual(c, "colorFromPalette");
          if (f) {
            var h = a.ensureUniqueItemVisual(c, "style"), v = n.getName(u) || u + "", d = n.count();
            h[l] = e.getColorFromPalette(v, o, d);
          }
        });
      }
    });
  }
}, Oc = Math.PI;
function V4(r, t) {
  t = t || {}, se(t, {
    text: "loading",
    textColor: "#000",
    fontSize: 12,
    fontWeight: "normal",
    fontStyle: "normal",
    fontFamily: "sans-serif",
    maskColor: "rgba(255, 255, 255, 0.8)",
    showSpinner: !0,
    color: "#5470c6",
    spinnerRadius: 10,
    lineWidth: 5,
    zlevel: 0
  });
  var e = new fe(), n = new ke({
    style: {
      fill: t.maskColor
    },
    zlevel: t.zlevel,
    z: 1e4
  });
  e.add(n);
  var i = new Fe({
    style: {
      text: t.text,
      fill: t.textColor,
      fontSize: t.fontSize,
      fontWeight: t.fontWeight,
      fontStyle: t.fontStyle,
      fontFamily: t.fontFamily
    },
    zlevel: t.zlevel,
    z: 10001
  }), a = new ke({
    style: {
      fill: "none"
    },
    textContent: i,
    textConfig: {
      position: "right",
      distance: 10
    },
    zlevel: t.zlevel,
    z: 10001
  });
  e.add(a);
  var o;
  return t.showSpinner && (o = new vv({
    shape: {
      startAngle: -Oc / 2,
      endAngle: -Oc / 2 + 0.1,
      r: t.spinnerRadius
    },
    style: {
      stroke: t.color,
      lineCap: "round",
      lineWidth: t.lineWidth
    },
    zlevel: t.zlevel,
    z: 10001
  }), o.animateShape(!0).when(1e3, {
    endAngle: Oc * 3 / 2
  }).start("circularInOut"), o.animateShape(!0).when(1e3, {
    startAngle: Oc * 3 / 2
  }).delay(300).start("circularInOut"), e.add(o)), e.resize = function() {
    var s = i.getBoundingRect().width, l = t.showSpinner ? t.spinnerRadius : 0, u = (r.getWidth() - l * 2 - (t.showSpinner && s ? 10 : 0) - s) / 2 - (t.showSpinner && s ? 0 : 5 + s / 2) + (t.showSpinner ? 0 : s / 2) + (s ? 0 : l), c = r.getHeight() / 2;
    t.showSpinner && o.setShape({
      cx: u,
      cy: c
    }), a.setShape({
      x: u - l,
      y: c - l,
      width: l * 2,
      height: l * 2
    }), n.setShape({
      x: 0,
      y: 0,
      width: r.getWidth(),
      height: r.getHeight()
    });
  }, e.resize(), e;
}
var wI = (
  /** @class */
  function() {
    function r(t, e, n, i) {
      this._stageTaskMap = re(), this.ecInstance = t, this.api = e, n = this._dataProcessorHandlers = n.slice(), i = this._visualHandlers = i.slice(), this._allHandlers = n.concat(i);
    }
    return r.prototype.restoreData = function(t, e) {
      t.restoreData(e), this._stageTaskMap.each(function(n) {
        var i = n.overallTask;
        i && i.dirty();
      });
    }, r.prototype.getPerformArgs = function(t, e) {
      if (t.__pipeline) {
        var n = this._pipelineMap.get(t.__pipeline.id), i = n.context, a = !e && n.progressiveEnabled && (!i || i.progressiveRender) && t.__idxInPipeline > n.blockIndex, o = a ? n.step : null, s = i && i.modDataCount, l = s != null ? Math.ceil(s / o) : null;
        return {
          step: o,
          modBy: l,
          modDataCount: s
        };
      }
    }, r.prototype.getPipeline = function(t) {
      return this._pipelineMap.get(t);
    }, r.prototype.updateStreamModes = function(t, e) {
      var n = this._pipelineMap.get(t.uid), i = t.getData(), a = i.count(), o = n.progressiveEnabled && e.incrementalPrepareRender && a >= n.threshold, s = t.get("large") && a >= t.get("largeThreshold"), l = t.get("progressiveChunkMode") === "mod" ? a : null;
      t.pipelineContext = n.context = {
        progressiveRender: o,
        modDataCount: l,
        large: s
      };
    }, r.prototype.restorePipelines = function(t) {
      var e = this, n = e._pipelineMap = re();
      t.eachSeries(function(i) {
        var a = i.getProgressive(), o = i.uid;
        n.set(o, {
          id: o,
          head: null,
          tail: null,
          threshold: i.getProgressiveThreshold(),
          progressiveEnabled: a && !(i.preventIncremental && i.preventIncremental()),
          blockIndex: -1,
          step: Math.round(a || 700),
          count: 0
        }), e._pipe(i, i.dataTask);
      });
    }, r.prototype.prepareStageTasks = function() {
      var t = this._stageTaskMap, e = this.api.getModel(), n = this.api;
      M(this._allHandlers, function(i) {
        var a = t.get(i.uid) || t.set(i.uid, {}), o = "";
        rr(!(i.reset && i.overallReset), o), i.reset && this._createSeriesStageTask(i, a, e, n), i.overallReset && this._createOverallStageTask(i, a, e, n);
      }, this);
    }, r.prototype.prepareView = function(t, e, n, i) {
      var a = t.renderTask, o = a.context;
      o.model = e, o.ecModel = n, o.api = i, a.__block = !t.incrementalPrepareRender, this._pipe(e, a);
    }, r.prototype.performDataProcessorTasks = function(t, e) {
      this._performStageTasks(this._dataProcessorHandlers, t, e, {
        block: !0
      });
    }, r.prototype.performVisualTasks = function(t, e, n) {
      this._performStageTasks(this._visualHandlers, t, e, n);
    }, r.prototype._performStageTasks = function(t, e, n, i) {
      i = i || {};
      var a = !1, o = this;
      M(t, function(l, u) {
        if (!(i.visualType && i.visualType !== l.visualType)) {
          var c = o._stageTaskMap.get(l.uid), f = c.seriesTaskMap, h = c.overallTask;
          if (h) {
            var v, d = h.agentStubMap;
            d.each(function(g) {
              s(i, g) && (g.dirty(), v = !0);
            }), v && h.dirty(), o.updatePayload(h, n);
            var p = o.getPerformArgs(h, i.block);
            d.each(function(g) {
              g.perform(p);
            }), h.perform(p) && (a = !0);
          } else f && f.each(function(g, m) {
            s(i, g) && g.dirty();
            var y = o.getPerformArgs(g, i.block);
            y.skip = !l.performRawSeries && e.isSeriesFiltered(g.context.model), o.updatePayload(g, n), g.perform(y) && (a = !0);
          });
        }
      });
      function s(l, u) {
        return l.setDirty && (!l.dirtyMap || l.dirtyMap.get(u.__pipeline.id));
      }
      this.unfinished = a || this.unfinished;
    }, r.prototype.performSeriesTasks = function(t) {
      var e;
      t.eachSeries(function(n) {
        e = n.dataTask.perform() || e;
      }), this.unfinished = e || this.unfinished;
    }, r.prototype.plan = function() {
      this._pipelineMap.each(function(t) {
        var e = t.tail;
        do {
          if (e.__block) {
            t.blockIndex = e.__idxInPipeline;
            break;
          }
          e = e.getUpstream();
        } while (e);
      });
    }, r.prototype.updatePayload = function(t, e) {
      e !== "remain" && (t.context.payload = e);
    }, r.prototype._createSeriesStageTask = function(t, e, n, i) {
      var a = this, o = e.seriesTaskMap, s = e.seriesTaskMap = re(), l = t.seriesType, u = t.getTargetSeries;
      t.createOnAllSeries ? n.eachRawSeries(c) : l ? n.eachRawSeriesByType(l, c) : u && u(n, i).each(c);
      function c(f) {
        var h = f.uid, v = s.set(h, o && o.get(h) || Jl({
          plan: W4,
          reset: U4,
          count: Z4
        }));
        v.context = {
          model: f,
          ecModel: n,
          api: i,
          // PENDING: `useClearVisual` not used?
          useClearVisual: t.isVisual && !t.isLayout,
          plan: t.plan,
          reset: t.reset,
          scheduler: a
        }, a._pipe(f, v);
      }
    }, r.prototype._createOverallStageTask = function(t, e, n, i) {
      var a = this, o = e.overallTask = e.overallTask || Jl({
        reset: $4
      });
      o.context = {
        ecModel: n,
        api: i,
        overallReset: t.overallReset,
        scheduler: a
      };
      var s = o.agentStubMap, l = o.agentStubMap = re(), u = t.seriesType, c = t.getTargetSeries, f = !0, h = !1, v = "";
      rr(!t.createOnAllSeries, v), u ? n.eachRawSeriesByType(u, d) : c ? c(n, i).each(d) : (f = !1, M(n.getSeries(), d));
      function d(p) {
        var g = p.uid, m = l.set(g, s && s.get(g) || // When the result of `getTargetSeries` changed, the overallTask
        // should be set as dirty and re-performed.
        (h = !0, Jl({
          reset: G4,
          onDirty: q4
        })));
        m.context = {
          model: p,
          overallProgress: f
          // FIXME:TS never used, so comment it
          // modifyOutputEnd: modifyOutputEnd
        }, m.agent = o, m.__block = f, a._pipe(p, m);
      }
      h && o.dirty();
    }, r.prototype._pipe = function(t, e) {
      var n = t.uid, i = this._pipelineMap.get(n);
      !i.head && (i.head = e), i.tail && i.tail.pipe(e), i.tail = e, e.__idxInPipeline = i.count++, e.__pipeline = i;
    }, r.wrapStageHandler = function(t, e) {
      return oe(t) && (t = {
        overallReset: t,
        seriesType: X4(t)
      }), t.uid = Os("stageHandler"), e && (t.visualType = e), t;
    }, r;
  }()
);
function $4(r) {
  r.overallReset(r.ecModel, r.api, r.payload);
}
function G4(r) {
  return r.overallProgress && H4;
}
function H4() {
  this.agent.dirty(), this.getDownstream().dirty();
}
function q4() {
  this.agent && this.agent.dirty();
}
function W4(r) {
  return r.plan ? r.plan(r.model, r.ecModel, r.api, r.payload) : null;
}
function U4(r) {
  r.useClearVisual && r.data.clearAllVisual();
  var t = r.resetDefines = je(r.reset(r.model, r.ecModel, r.api, r.payload));
  return t.length > 1 ? U(t, function(e, n) {
    return CI(n);
  }) : Y4;
}
var Y4 = CI(0);
function CI(r) {
  return function(t, e) {
    var n = e.data, i = e.resetDefines[r];
    if (i && i.dataEach)
      for (var a = t.start; a < t.end; a++)
        i.dataEach(n, a);
    else i && i.progress && i.progress(t, n);
  };
}
function Z4(r) {
  return r.data.count();
}
function X4(r) {
  dh = null;
  try {
    r(wu, AI);
  } catch {
  }
  return dh;
}
var wu = {}, AI = {}, dh;
DI(wu, M0);
DI(AI, jM);
wu.eachSeriesByType = wu.eachRawSeriesByType = function(r) {
  dh = r;
};
wu.eachComponent = function(r) {
  r.mainType === "series" && r.subType && (dh = r.subType);
};
function DI(r, t) {
  for (var e in t.prototype)
    r[e] = dt;
}
var rx = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"];
const j4 = {
  color: rx,
  colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], rx]
};
var Gt = "#B9B8CE", nx = "#100C2A", Fc = function() {
  return {
    axisLine: {
      lineStyle: {
        color: Gt
      }
    },
    splitLine: {
      lineStyle: {
        color: "#484753"
      }
    },
    splitArea: {
      areaStyle: {
        color: ["rgba(255,255,255,0.02)", "rgba(255,255,255,0.05)"]
      }
    },
    minorSplitLine: {
      lineStyle: {
        color: "#20203B"
      }
    }
  };
}, ix = ["#4992ff", "#7cffb2", "#fddd60", "#ff6e76", "#58d9f9", "#05c091", "#ff8a45", "#8d48e3", "#dd79ff"], TI = {
  darkMode: !0,
  color: ix,
  backgroundColor: nx,
  axisPointer: {
    lineStyle: {
      color: "#817f91"
    },
    crossStyle: {
      color: "#817f91"
    },
    label: {
      // TODO Contrast of label backgorundColor
      color: "#fff"
    }
  },
  legend: {
    textStyle: {
      color: Gt
    },
    pageTextStyle: {
      color: Gt
    }
  },
  textStyle: {
    color: Gt
  },
  title: {
    textStyle: {
      color: "#EEF1FA"
    },
    subtextStyle: {
      color: "#B9B8CE"
    }
  },
  toolbox: {
    iconStyle: {
      borderColor: Gt
    }
  },
  dataZoom: {
    borderColor: "#71708A",
    textStyle: {
      color: Gt
    },
    brushStyle: {
      color: "rgba(135,163,206,0.3)"
    },
    handleStyle: {
      color: "#353450",
      borderColor: "#C5CBE3"
    },
    moveHandleStyle: {
      color: "#B0B6C3",
      opacity: 0.3
    },
    fillerColor: "rgba(135,163,206,0.2)",
    emphasis: {
      handleStyle: {
        borderColor: "#91B7F2",
        color: "#4D587D"
      },
      moveHandleStyle: {
        color: "#636D9A",
        opacity: 0.7
      }
    },
    dataBackground: {
      lineStyle: {
        color: "#71708A",
        width: 1
      },
      areaStyle: {
        color: "#71708A"
      }
    },
    selectedDataBackground: {
      lineStyle: {
        color: "#87A3CE"
      },
      areaStyle: {
        color: "#87A3CE"
      }
    }
  },
  visualMap: {
    textStyle: {
      color: Gt
    }
  },
  timeline: {
    lineStyle: {
      color: Gt
    },
    label: {
      color: Gt
    },
    controlStyle: {
      color: Gt,
      borderColor: Gt
    }
  },
  calendar: {
    itemStyle: {
      color: nx
    },
    dayLabel: {
      color: Gt
    },
    monthLabel: {
      color: Gt
    },
    yearLabel: {
      color: Gt
    }
  },
  timeAxis: Fc(),
  logAxis: Fc(),
  valueAxis: Fc(),
  categoryAxis: Fc(),
  line: {
    symbol: "circle"
  },
  graph: {
    color: ix
  },
  gauge: {
    title: {
      color: Gt
    },
    axisLine: {
      lineStyle: {
        color: [[1, "rgba(207,212,219,0.2)"]]
      }
    },
    axisLabel: {
      color: Gt
    },
    detail: {
      color: "#EEF1FA"
    }
  },
  candlestick: {
    itemStyle: {
      color: "#f64e56",
      color0: "#54ea92",
      borderColor: "#f64e56",
      borderColor0: "#54ea92"
      // borderColor: '#ca2824',
      // borderColor0: '#09a443'
    }
  }
};
TI.categoryAxis.splitLine.show = !1;
var K4 = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.normalizeQuery = function(t) {
      var e = {}, n = {}, i = {};
      if (J(t)) {
        var a = Tn(t);
        e.mainType = a.main || null, e.subType = a.sub || null;
      } else {
        var o = ["Index", "Name", "Id"], s = {
          name: 1,
          dataIndex: 1,
          dataType: 1
        };
        M(t, function(l, u) {
          for (var c = !1, f = 0; f < o.length; f++) {
            var h = o[f], v = u.lastIndexOf(h);
            if (v > 0 && v === u.length - h.length) {
              var d = u.slice(0, v);
              d !== "data" && (e.mainType = d, e[h.toLowerCase()] = l, c = !0);
            }
          }
          s.hasOwnProperty(u) && (n[u] = l, c = !0), c || (i[u] = l);
        });
      }
      return {
        cptQuery: e,
        dataQuery: n,
        otherQuery: i
      };
    }, r.prototype.filter = function(t, e) {
      var n = this.eventInfo;
      if (!n)
        return !0;
      var i = n.targetEl, a = n.packedEvent, o = n.model, s = n.view;
      if (!o || !s)
        return !0;
      var l = e.cptQuery, u = e.dataQuery;
      return c(l, o, "mainType") && c(l, o, "subType") && c(l, o, "index", "componentIndex") && c(l, o, "name") && c(l, o, "id") && c(u, a, "name") && c(u, a, "dataIndex") && c(u, a, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(t, e.otherQuery, i, a));
      function c(f, h, v, d) {
        return f[v] == null || h[d || v] === f[v];
      }
    }, r.prototype.afterTrigger = function() {
      this.eventInfo = null;
    }, r;
  }()
), Dm = ["symbol", "symbolSize", "symbolRotate", "symbolOffset"], ax = Dm.concat(["symbolKeepAspect"]), J4 = {
  createOnAllSeries: !0,
  // For legend.
  performRawSeries: !0,
  reset: function(r, t) {
    var e = r.getData();
    if (r.legendIcon && e.setVisual("legendIcon", r.legendIcon), !r.hasSymbolVisual)
      return;
    for (var n = {}, i = {}, a = !1, o = 0; o < Dm.length; o++) {
      var s = Dm[o], l = r.get(s);
      oe(l) ? (a = !0, i[s] = l) : n[s] = l;
    }
    if (n.symbol = n.symbol || r.defaultSymbol, e.setVisual(H({
      legendIcon: r.legendIcon || n.symbol,
      symbolKeepAspect: r.get("symbolKeepAspect")
    }, n)), t.isSeriesFiltered(r))
      return;
    var u = Ee(i);
    function c(f, h) {
      for (var v = r.getRawValue(h), d = r.getDataParams(h), p = 0; p < u.length; p++) {
        var g = u[p];
        f.setItemVisual(h, g, i[g](v, d));
      }
    }
    return {
      dataEach: a ? c : null
    };
  }
}, Q4 = {
  createOnAllSeries: !0,
  // For legend.
  performRawSeries: !0,
  reset: function(r, t) {
    if (!r.hasSymbolVisual || t.isSeriesFiltered(r))
      return;
    var e = r.getData();
    function n(i, a) {
      for (var o = i.getItemModel(a), s = 0; s < ax.length; s++) {
        var l = ax[s], u = o.getShallow(l, !0);
        u != null && i.setItemVisual(a, l, u);
      }
    }
    return {
      dataEach: e.hasItemOption ? n : null
    };
  }
};
function R0(r, t, e) {
  switch (e) {
    case "color":
      var n = r.getItemVisual(t, "style");
      return n[r.getVisual("drawType")];
    case "opacity":
      return r.getItemVisual(t, "style").opacity;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      return r.getItemVisual(t, e);
  }
}
function Xu(r, t) {
  switch (t) {
    case "color":
      var e = r.getVisual("style");
      return e[r.getVisual("drawType")];
    case "opacity":
      return r.getVisual("style").opacity;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      return r.getVisual(t);
  }
}
function MI(r, t, e, n) {
  switch (e) {
    case "color":
      var i = r.ensureUniqueItemVisual(t, "style");
      i[r.getVisual("drawType")] = n, r.setItemVisual(t, "colorFromPalette", !1);
      break;
    case "opacity":
      r.ensureUniqueItemVisual(t, "style").opacity = n;
      break;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      r.setItemVisual(t, e, n);
      break;
  }
}
function II(r, t) {
  function e(n, i) {
    var a = [];
    return n.eachComponent({
      mainType: "series",
      subType: r,
      query: i
    }, function(o) {
      a.push(o.seriesIndex);
    }), a;
  }
  M([[r + "ToggleSelect", "toggleSelect"], [r + "Select", "select"], [r + "UnSelect", "unselect"]], function(n) {
    t(n[0], function(i, a, o) {
      i = H({}, i), o.dispatchAction(H(i, {
        type: n[1],
        seriesIndex: e(a, i)
      }));
    });
  });
}
function $o(r, t, e, n, i) {
  var a = r + t;
  e.isSilent(a) || n.eachComponent({
    mainType: "series",
    subType: "pie"
  }, function(o) {
    for (var s = o.seriesIndex, l = o.option.selectedMap, u = i.selected, c = 0; c < u.length; c++)
      if (u[c].seriesIndex === s) {
        var f = o.getData(), h = vo(f, i.fromActionPayload);
        e.trigger(a, {
          type: a,
          seriesId: o.id,
          name: q(h) ? f.getName(h[0]) : f.getName(h),
          selected: J(l) ? l : H({}, l)
        });
      }
  });
}
function e$(r, t, e) {
  r.on("selectchanged", function(n) {
    var i = e.getModel();
    n.isFromClick ? ($o("map", "selectchanged", t, i, n), $o("pie", "selectchanged", t, i, n)) : n.fromAction === "select" ? ($o("map", "selected", t, i, n), $o("pie", "selected", t, i, n)) : n.fromAction === "unselect" && ($o("map", "unselected", t, i, n), $o("pie", "unselected", t, i, n));
  });
}
function Xa(r, t, e) {
  for (var n; r && !(t(r) && (n = r, e)); )
    r = r.__hostTarget || r.parent;
  return n;
}
var t$ = Math.round(Math.random() * 9), r$ = typeof Object.defineProperty == "function", n$ = function() {
  function r() {
    this._id = "__ec_inner_" + t$++;
  }
  return r.prototype.get = function(t) {
    return this._guard(t)[this._id];
  }, r.prototype.set = function(t, e) {
    var n = this._guard(t);
    return r$ ? Object.defineProperty(n, this._id, {
      value: e,
      enumerable: !1,
      configurable: !0
    }) : n[this._id] = e, this;
  }, r.prototype.delete = function(t) {
    return this.has(t) ? (delete this._guard(t)[this._id], !0) : !1;
  }, r.prototype.has = function(t) {
    return !!this._guard(t)[this._id];
  }, r.prototype._guard = function(t) {
    if (t !== Object(t))
      throw TypeError("Value of WeakMap is not a non-null object.");
    return t;
  }, r;
}(), i$ = Te.extend({
  type: "triangle",
  shape: {
    cx: 0,
    cy: 0,
    width: 0,
    height: 0
  },
  buildPath: function(r, t) {
    var e = t.cx, n = t.cy, i = t.width / 2, a = t.height / 2;
    r.moveTo(e, n - a), r.lineTo(e + i, n + a), r.lineTo(e - i, n + a), r.closePath();
  }
}), a$ = Te.extend({
  type: "diamond",
  shape: {
    cx: 0,
    cy: 0,
    width: 0,
    height: 0
  },
  buildPath: function(r, t) {
    var e = t.cx, n = t.cy, i = t.width / 2, a = t.height / 2;
    r.moveTo(e, n - a), r.lineTo(e + i, n), r.lineTo(e, n + a), r.lineTo(e - i, n), r.closePath();
  }
}), o$ = Te.extend({
  type: "pin",
  shape: {
    // x, y on the cusp
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  buildPath: function(r, t) {
    var e = t.x, n = t.y, i = t.width / 5 * 3, a = Math.max(i, t.height), o = i / 2, s = o * o / (a - o), l = n - a + o + s, u = Math.asin(s / o), c = Math.cos(u) * o, f = Math.sin(u), h = Math.cos(u), v = o * 0.6, d = o * 0.7;
    r.moveTo(e - c, l + s), r.arc(e, l, o, Math.PI - u, Math.PI * 2 + u), r.bezierCurveTo(e + c - f * v, l + s + h * v, e, n - d, e, n), r.bezierCurveTo(e, n - d, e - c + f * v, l + s + h * v, e - c, l + s), r.closePath();
  }
}), s$ = Te.extend({
  type: "arrow",
  shape: {
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  buildPath: function(r, t) {
    var e = t.height, n = t.width, i = t.x, a = t.y, o = n / 3 * 2;
    r.moveTo(i, a), r.lineTo(i + o, a + e), r.lineTo(i, a + e / 4 * 3), r.lineTo(i - o, a + e), r.lineTo(i, a), r.closePath();
  }
}), l$ = {
  line: Ct,
  rect: ke,
  roundRect: ke,
  square: ke,
  circle: pi,
  diamond: a$,
  pin: o$,
  arrow: s$,
  triangle: i$
}, u$ = {
  line: function(r, t, e, n, i) {
    i.x1 = r, i.y1 = t + n / 2, i.x2 = r + e, i.y2 = t + n / 2;
  },
  rect: function(r, t, e, n, i) {
    i.x = r, i.y = t, i.width = e, i.height = n;
  },
  roundRect: function(r, t, e, n, i) {
    i.x = r, i.y = t, i.width = e, i.height = n, i.r = Math.min(e, n) / 4;
  },
  square: function(r, t, e, n, i) {
    var a = Math.min(e, n);
    i.x = r, i.y = t, i.width = a, i.height = a;
  },
  circle: function(r, t, e, n, i) {
    i.cx = r + e / 2, i.cy = t + n / 2, i.r = Math.min(e, n) / 2;
  },
  diamond: function(r, t, e, n, i) {
    i.cx = r + e / 2, i.cy = t + n / 2, i.width = e, i.height = n;
  },
  pin: function(r, t, e, n, i) {
    i.x = r + e / 2, i.y = t + n / 2, i.width = e, i.height = n;
  },
  arrow: function(r, t, e, n, i) {
    i.x = r + e / 2, i.y = t + n / 2, i.width = e, i.height = n;
  },
  triangle: function(r, t, e, n, i) {
    i.cx = r + e / 2, i.cy = t + n / 2, i.width = e, i.height = n;
  }
}, ph = {};
M(l$, function(r, t) {
  ph[t] = new r();
});
var c$ = Te.extend({
  type: "symbol",
  shape: {
    symbolType: "",
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  calculateTextPosition: function(r, t, e) {
    var n = ih(r, t, e), i = this.shape;
    return i && i.symbolType === "pin" && t.position === "inside" && (n.y = e.y + e.height * 0.4), n;
  },
  buildPath: function(r, t, e) {
    var n = t.symbolType;
    if (n !== "none") {
      var i = ph[n];
      i || (n = "rect", i = ph[n]), u$[n](t.x, t.y, t.width, t.height, i.shape), i.buildPath(r, i.shape, e);
    }
  }
});
function f$(r, t) {
  if (this.type !== "image") {
    var e = this.style;
    this.__isEmptyBrush ? (e.stroke = r, e.fill = t || "#fff", e.lineWidth = 2) : this.shape.symbolType === "line" ? e.stroke = r : e.fill = r, this.markRedraw();
  }
}
function yt(r, t, e, n, i, a, o) {
  var s = r.indexOf("empty") === 0;
  s && (r = r.substr(5, 1).toLowerCase() + r.substr(6));
  var l;
  return r.indexOf("image://") === 0 ? l = gM(r.slice(8), new xe(t, e, n, i), o ? "center" : "cover") : r.indexOf("path://") === 0 ? l = dv(r.slice(7), {}, new xe(t, e, n, i), o ? "center" : "cover") : l = new c$({
    shape: {
      symbolType: r,
      x: t,
      y: e,
      width: n,
      height: i
    }
  }), l.__isEmptyBrush = s, l.setColor = f$, a && l.setColor(a), l;
}
function $s(r) {
  return q(r) || (r = [+r, +r]), [r[0] || 0, r[1] || 0];
}
function Co(r, t) {
  if (r != null)
    return q(r) || (r = [r, r]), [X(r[0], t[0]) || 0, X(me(r[1], r[0]), t[1]) || 0];
}
function ja(r) {
  return isFinite(r);
}
function h$(r, t, e) {
  var n = t.x == null ? 0 : t.x, i = t.x2 == null ? 1 : t.x2, a = t.y == null ? 0 : t.y, o = t.y2 == null ? 0 : t.y2;
  t.global || (n = n * e.width + e.x, i = i * e.width + e.x, a = a * e.height + e.y, o = o * e.height + e.y), n = ja(n) ? n : 0, i = ja(i) ? i : 1, a = ja(a) ? a : 0, o = ja(o) ? o : 0;
  var s = r.createLinearGradient(n, a, i, o);
  return s;
}
function v$(r, t, e) {
  var n = e.width, i = e.height, a = Math.min(n, i), o = t.x == null ? 0.5 : t.x, s = t.y == null ? 0.5 : t.y, l = t.r == null ? 0.5 : t.r;
  t.global || (o = o * n + e.x, s = s * i + e.y, l = l * a), o = ja(o) ? o : 0.5, s = ja(s) ? s : 0.5, l = l >= 0 && ja(l) ? l : 0.5;
  var u = r.createRadialGradient(o, s, 0, o, s, l);
  return u;
}
function Tm(r, t, e) {
  for (var n = t.type === "radial" ? v$(r, t, e) : h$(r, t, e), i = t.colorStops, a = 0; a < i.length; a++)
    n.addColorStop(i[a].offset, i[a].color);
  return n;
}
function d$(r, t) {
  if (r === t || !r && !t)
    return !1;
  if (!r || !t || r.length !== t.length)
    return !0;
  for (var e = 0; e < r.length; e++)
    if (r[e] !== t[e])
      return !0;
  return !1;
}
function Bc(r) {
  return parseInt(r, 10);
}
function ss(r, t, e) {
  var n = ["width", "height"][t], i = ["clientWidth", "clientHeight"][t], a = ["paddingLeft", "paddingTop"][t], o = ["paddingRight", "paddingBottom"][t];
  if (e[n] != null && e[n] !== "auto")
    return parseFloat(e[n]);
  var s = document.defaultView.getComputedStyle(r);
  return (r[i] || Bc(s[n]) || Bc(r.style[n])) - (Bc(s[a]) || 0) - (Bc(s[o]) || 0) | 0;
}
function p$(r, t) {
  return !r || r === "solid" || !(t > 0) ? null : r === "dashed" ? [4 * t, 2 * t] : r === "dotted" ? [t] : Be(r) ? [r] : q(r) ? r : null;
}
function O0(r) {
  var t = r.style, e = t.lineDash && t.lineWidth > 0 && p$(t.lineDash, t.lineWidth), n = t.lineDashOffset;
  if (e) {
    var i = t.strokeNoScale && r.getLineScale ? r.getLineScale() : 1;
    i && i !== 1 && (e = U(e, function(a) {
      return a / i;
    }), n /= i);
  }
  return [e, n];
}
var g$ = new Bn(!0);
function gh(r) {
  var t = r.stroke;
  return !(t == null || t === "none" || !(r.lineWidth > 0));
}
function ox(r) {
  return typeof r == "string" && r !== "none";
}
function mh(r) {
  var t = r.fill;
  return t != null && t !== "none";
}
function sx(r, t) {
  if (t.fillOpacity != null && t.fillOpacity !== 1) {
    var e = r.globalAlpha;
    r.globalAlpha = t.fillOpacity * t.opacity, r.fill(), r.globalAlpha = e;
  } else
    r.fill();
}
function lx(r, t) {
  if (t.strokeOpacity != null && t.strokeOpacity !== 1) {
    var e = r.globalAlpha;
    r.globalAlpha = t.strokeOpacity * t.opacity, r.stroke(), r.globalAlpha = e;
  } else
    r.stroke();
}
function Mm(r, t, e) {
  var n = s0(t.image, t.__image, e);
  if (sv(n)) {
    var i = r.createPattern(n, t.repeat || "repeat");
    if (typeof DOMMatrix == "function" && i && i.setTransform) {
      var a = new DOMMatrix();
      a.translateSelf(t.x || 0, t.y || 0), a.rotateSelf(0, 0, (t.rotation || 0) * xf), a.scaleSelf(t.scaleX || 1, t.scaleY || 1), i.setTransform(a);
    }
    return i;
  }
}
function m$(r, t, e, n) {
  var i, a = gh(e), o = mh(e), s = e.strokePercent, l = s < 1, u = !t.path;
  (!t.silent || l) && u && t.createPathProxy();
  var c = t.path || g$, f = t.__dirty;
  if (!n) {
    var h = e.fill, v = e.stroke, d = o && !!h.colorStops, p = a && !!v.colorStops, g = o && !!h.image, m = a && !!v.image, y = void 0, _ = void 0, b = void 0, S = void 0, x = void 0;
    (d || p) && (x = t.getBoundingRect()), d && (y = f ? Tm(r, h, x) : t.__canvasFillGradient, t.__canvasFillGradient = y), p && (_ = f ? Tm(r, v, x) : t.__canvasStrokeGradient, t.__canvasStrokeGradient = _), g && (b = f || !t.__canvasFillPattern ? Mm(r, h, t) : t.__canvasFillPattern, t.__canvasFillPattern = b), m && (S = f || !t.__canvasStrokePattern ? Mm(r, v, t) : t.__canvasStrokePattern, t.__canvasStrokePattern = b), d ? r.fillStyle = y : g && (b ? r.fillStyle = b : o = !1), p ? r.strokeStyle = _ : m && (S ? r.strokeStyle = S : a = !1);
  }
  var w = t.getGlobalScale();
  c.setScale(w[0], w[1], t.segmentIgnoreThreshold);
  var C, D;
  r.setLineDash && e.lineDash && (i = O0(t), C = i[0], D = i[1]);
  var A = !0;
  (u || f & es) && (c.setDPR(r.dpr), l ? c.setContext(null) : (c.setContext(r), A = !1), c.reset(), t.buildPath(c, t.shape, n), c.toStatic(), t.pathUpdated()), A && c.rebuildPath(r, l ? s : 1), C && (r.setLineDash(C), r.lineDashOffset = D), n || (e.strokeFirst ? (a && lx(r, e), o && sx(r, e)) : (o && sx(r, e), a && lx(r, e))), C && r.setLineDash([]);
}
function y$(r, t, e) {
  var n = t.__image = s0(e.image, t.__image, t, t.onload);
  if (!(!n || !sv(n))) {
    var i = e.x || 0, a = e.y || 0, o = t.getWidth(), s = t.getHeight(), l = n.width / n.height;
    if (o == null && s != null ? o = s * l : s == null && o != null ? s = o / l : o == null && s == null && (o = n.width, s = n.height), e.sWidth && e.sHeight) {
      var u = e.sx || 0, c = e.sy || 0;
      r.drawImage(n, u, c, e.sWidth, e.sHeight, i, a, o, s);
    } else if (e.sx && e.sy) {
      var u = e.sx, c = e.sy, f = o - u, h = s - c;
      r.drawImage(n, u, c, f, h, i, a, o, s);
    } else
      r.drawImage(n, i, a, o, s);
  }
}
function _$(r, t, e) {
  var n, i = e.text;
  if (i != null && (i += ""), i) {
    r.font = e.font || Xi, r.textAlign = e.textAlign, r.textBaseline = e.textBaseline;
    var a = void 0, o = void 0;
    r.setLineDash && e.lineDash && (n = O0(t), a = n[0], o = n[1]), a && (r.setLineDash(a), r.lineDashOffset = o), e.strokeFirst ? (gh(e) && r.strokeText(i, e.x, e.y), mh(e) && r.fillText(i, e.x, e.y)) : (mh(e) && r.fillText(i, e.x, e.y), gh(e) && r.strokeText(i, e.x, e.y)), a && r.setLineDash([]);
  }
}
var ux = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"], cx = [
  ["lineCap", "butt"],
  ["lineJoin", "miter"],
  ["miterLimit", 10]
];
function LI(r, t, e, n, i) {
  var a = !1;
  if (!n && (e = e || {}, t === e))
    return !1;
  if (n || t.opacity !== e.opacity) {
    dr(r, i), a = !0;
    var o = Math.max(Math.min(t.opacity, 1), 0);
    r.globalAlpha = isNaN(o) ? no.opacity : o;
  }
  (n || t.blend !== e.blend) && (a || (dr(r, i), a = !0), r.globalCompositeOperation = t.blend || no.blend);
  for (var s = 0; s < ux.length; s++) {
    var l = ux[s];
    (n || t[l] !== e[l]) && (a || (dr(r, i), a = !0), r[l] = r.dpr * (t[l] || 0));
  }
  return (n || t.shadowColor !== e.shadowColor) && (a || (dr(r, i), a = !0), r.shadowColor = t.shadowColor || no.shadowColor), a;
}
function fx(r, t, e, n, i) {
  var a = Cu(t, i.inHover), o = n ? null : e && Cu(e, i.inHover) || {};
  if (a === o)
    return !1;
  var s = LI(r, a, o, n, i);
  if ((n || a.fill !== o.fill) && (s || (dr(r, i), s = !0), ox(a.fill) && (r.fillStyle = a.fill)), (n || a.stroke !== o.stroke) && (s || (dr(r, i), s = !0), ox(a.stroke) && (r.strokeStyle = a.stroke)), (n || a.opacity !== o.opacity) && (s || (dr(r, i), s = !0), r.globalAlpha = a.opacity == null ? 1 : a.opacity), t.hasStroke()) {
    var l = a.lineWidth, u = l / (a.strokeNoScale && t.getLineScale ? t.getLineScale() : 1);
    r.lineWidth !== u && (s || (dr(r, i), s = !0), r.lineWidth = u);
  }
  for (var c = 0; c < cx.length; c++) {
    var f = cx[c], h = f[0];
    (n || a[h] !== o[h]) && (s || (dr(r, i), s = !0), r[h] = a[h] || f[1]);
  }
  return s;
}
function b$(r, t, e, n, i) {
  return LI(r, Cu(t, i.inHover), e && Cu(e, i.inHover), n, i);
}
function EI(r, t) {
  var e = t.transform, n = r.dpr || 1;
  e ? r.setTransform(n * e[0], n * e[1], n * e[2], n * e[3], n * e[4], n * e[5]) : r.setTransform(n, 0, 0, n, 0, 0);
}
function S$(r, t, e) {
  for (var n = !1, i = 0; i < r.length; i++) {
    var a = r[i];
    n = n || a.isZeroArea(), EI(t, a), t.beginPath(), a.buildPath(t, a.shape), t.clip();
  }
  e.allClipped = n;
}
function x$(r, t) {
  return r && t ? r[0] !== t[0] || r[1] !== t[1] || r[2] !== t[2] || r[3] !== t[3] || r[4] !== t[4] || r[5] !== t[5] : !(!r && !t);
}
var hx = 1, vx = 2, dx = 3, px = 4;
function w$(r) {
  var t = mh(r), e = gh(r);
  return !(r.lineDash || !(+t ^ +e) || t && typeof r.fill != "string" || e && typeof r.stroke != "string" || r.strokePercent < 1 || r.strokeOpacity < 1 || r.fillOpacity < 1);
}
function dr(r, t) {
  t.batchFill && r.fill(), t.batchStroke && r.stroke(), t.batchFill = "", t.batchStroke = "";
}
function Cu(r, t) {
  return t && r.__hoverStyle || r.style;
}
function PI(r, t) {
  Ka(r, t, { inHover: !1, viewWidth: 0, viewHeight: 0 }, !0);
}
function Ka(r, t, e, n) {
  var i = t.transform;
  if (!t.shouldBePainted(e.viewWidth, e.viewHeight, !1, !1)) {
    t.__dirty &= ~br, t.__isRendered = !1;
    return;
  }
  var a = t.__clipPaths, o = e.prevElClipPaths, s = !1, l = !1;
  if ((!o || d$(a, o)) && (o && o.length && (dr(r, e), r.restore(), l = s = !0, e.prevElClipPaths = null, e.allClipped = !1, e.prevEl = null), a && a.length && (dr(r, e), r.save(), S$(a, r, e), s = !0), e.prevElClipPaths = a), e.allClipped) {
    t.__isRendered = !1;
    return;
  }
  t.beforeBrush && t.beforeBrush(), t.innerBeforeBrush();
  var u = e.prevEl;
  u || (l = s = !0);
  var c = t instanceof Te && t.autoBatch && w$(t.style);
  s || x$(i, u.transform) ? (dr(r, e), EI(r, t)) : c || dr(r, e);
  var f = Cu(t, e.inHover);
  t instanceof Te ? (e.lastDrawType !== hx && (l = !0, e.lastDrawType = hx), fx(r, t, u, l, e), (!c || !e.batchFill && !e.batchStroke) && r.beginPath(), m$(r, t, f, c), c && (e.batchFill = f.fill || "", e.batchStroke = f.stroke || "")) : t instanceof ms ? (e.lastDrawType !== dx && (l = !0, e.lastDrawType = dx), fx(r, t, u, l, e), _$(r, t, f)) : t instanceof Pt ? (e.lastDrawType !== vx && (l = !0, e.lastDrawType = vx), b$(r, t, u, l, e), y$(r, t, f)) : t.getTemporalDisplayables && (e.lastDrawType !== px && (l = !0, e.lastDrawType = px), C$(r, t, e)), c && n && dr(r, e), t.innerAfterBrush(), t.afterBrush && t.afterBrush(), e.prevEl = t, t.__dirty = 0, t.__isRendered = !0;
}
function C$(r, t, e) {
  var n = t.getDisplayables(), i = t.getTemporalDisplayables();
  r.save();
  var a = {
    prevElClipPaths: null,
    prevEl: null,
    allClipped: !1,
    viewWidth: e.viewWidth,
    viewHeight: e.viewHeight,
    inHover: e.inHover
  }, o, s;
  for (o = t.getCursor(), s = n.length; o < s; o++) {
    var l = n[o];
    l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), Ka(r, l, a, o === s - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), a.prevEl = l;
  }
  for (var u = 0, c = i.length; u < c; u++) {
    var l = i[u];
    l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), Ka(r, l, a, u === c - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), a.prevEl = l;
  }
  t.clearTemporalDisplayables(), t.notClear = !0, r.restore();
}
var Ud = new n$(), gx = new zu(100), mx = ["symbol", "symbolSize", "symbolKeepAspect", "color", "backgroundColor", "dashArrayX", "dashArrayY", "maxTileWidth", "maxTileHeight"];
function bs(r, t) {
  if (r === "none")
    return null;
  var e = t.getDevicePixelRatio(), n = t.getZr(), i = n.painter.type === "svg";
  r.dirty && Ud.delete(r);
  var a = Ud.get(r);
  if (a)
    return a;
  var o = se(r, {
    symbol: "rect",
    symbolSize: 1,
    symbolKeepAspect: !0,
    color: "rgba(0, 0, 0, 0.2)",
    backgroundColor: null,
    dashArrayX: 5,
    dashArrayY: 5,
    rotation: 0,
    maxTileWidth: 512,
    maxTileHeight: 512
  });
  o.backgroundColor === "none" && (o.backgroundColor = null);
  var s = {
    repeat: "repeat"
  };
  return l(s), s.rotation = o.rotation, s.scaleX = s.scaleY = i ? 1 : 1 / e, Ud.set(r, s), r.dirty = !1, s;
  function l(u) {
    for (var c = [e], f = !0, h = 0; h < mx.length; ++h) {
      var v = o[mx[h]];
      if (v != null && !q(v) && !J(v) && !Be(v) && typeof v != "boolean") {
        f = !1;
        break;
      }
      c.push(v);
    }
    var d;
    if (f) {
      d = c.join(",") + (i ? "-svg" : "");
      var p = gx.get(d);
      p && (i ? u.svgElement = p : u.image = p);
    }
    var g = RI(o.dashArrayX), m = A$(o.dashArrayY), y = kI(o.symbol), _ = D$(g), b = OI(m), S = !i && ji.createCanvas(), x = i && {
      tag: "g",
      attrs: {},
      key: "dcl",
      children: []
    }, w = D(), C;
    S && (S.width = w.width * e, S.height = w.height * e, C = S.getContext("2d")), A(), f && gx.put(d, S || x), u.image = S, u.svgElement = x, u.svgWidth = w.width, u.svgHeight = w.height;
    function D() {
      for (var T = 1, L = 0, E = _.length; L < E; ++L)
        T = Rb(T, _[L]);
      for (var I = 1, L = 0, E = y.length; L < E; ++L)
        I = Rb(I, y[L].length);
      T *= I;
      var P = b * _.length * y.length;
      return {
        width: Math.max(1, Math.min(T, o.maxTileWidth)),
        height: Math.max(1, Math.min(P, o.maxTileHeight))
      };
    }
    function A() {
      C && (C.clearRect(0, 0, S.width, S.height), o.backgroundColor && (C.fillStyle = o.backgroundColor, C.fillRect(0, 0, S.width, S.height)));
      for (var T = 0, L = 0; L < m.length; ++L)
        T += m[L];
      if (T <= 0)
        return;
      for (var E = -b, I = 0, P = 0, R = 0; E < w.height; ) {
        if (I % 2 === 0) {
          for (var F = P / 2 % y.length, O = 0, z = 0, G = 0; O < w.width * 2; ) {
            for (var W = 0, L = 0; L < g[R].length; ++L)
              W += g[R][L];
            if (W <= 0)
              break;
            if (z % 2 === 0) {
              var Y = (1 - o.symbolSize) * 0.5, j = O + g[R][z] * Y, ee = E + m[I] * Y, ie = g[R][z] * o.symbolSize, Me = m[I] * o.symbolSize, We = G / 2 % y[F].length;
              ve(j, ee, ie, Me, y[F][We]);
            }
            O += g[R][z], ++G, ++z, z === g[R].length && (z = 0);
          }
          ++R, R === g.length && (R = 0);
        }
        E += m[I], ++P, ++I, I === m.length && (I = 0);
      }
      function ve(ae, be, ne, de, Ke) {
        var Ge = i ? 1 : e, Xe = yt(Ke, ae * Ge, be * Ge, ne * Ge, de * Ge, o.color, o.symbolKeepAspect);
        if (i) {
          var at = n.painter.renderOneToVNode(Xe);
          at && x.children.push(at);
        } else
          PI(C, Xe);
      }
    }
  }
}
function kI(r) {
  if (!r || r.length === 0)
    return [["rect"]];
  if (J(r))
    return [[r]];
  for (var t = !0, e = 0; e < r.length; ++e)
    if (!J(r[e])) {
      t = !1;
      break;
    }
  if (t)
    return kI([r]);
  for (var n = [], e = 0; e < r.length; ++e)
    J(r[e]) ? n.push([r[e]]) : n.push(r[e]);
  return n;
}
function RI(r) {
  if (!r || r.length === 0)
    return [[0, 0]];
  if (Be(r)) {
    var t = Math.ceil(r);
    return [[t, t]];
  }
  for (var e = !0, n = 0; n < r.length; ++n)
    if (!Be(r[n])) {
      e = !1;
      break;
    }
  if (e)
    return RI([r]);
  for (var i = [], n = 0; n < r.length; ++n)
    if (Be(r[n])) {
      var t = Math.ceil(r[n]);
      i.push([t, t]);
    } else {
      var t = U(r[n], function(s) {
        return Math.ceil(s);
      });
      t.length % 2 === 1 ? i.push(t.concat(t)) : i.push(t);
    }
  return i;
}
function A$(r) {
  if (!r || typeof r == "object" && r.length === 0)
    return [0, 0];
  if (Be(r)) {
    var t = Math.ceil(r);
    return [t, t];
  }
  var e = U(r, function(n) {
    return Math.ceil(n);
  });
  return r.length % 2 ? e.concat(e) : e;
}
function D$(r) {
  return U(r, function(t) {
    return OI(t);
  });
}
function OI(r) {
  for (var t = 0, e = 0; e < r.length; ++e)
    t += r[e];
  return r.length % 2 === 1 ? t * 2 : t;
}
function T$(r, t) {
  r.eachRawSeries(function(e) {
    if (!r.isSeriesFiltered(e)) {
      var n = e.getData();
      n.hasItemVisual() && n.each(function(o) {
        var s = n.getItemVisual(o, "decal");
        if (s) {
          var l = n.ensureUniqueItemVisual(o, "style");
          l.decal = bs(s, t);
        }
      });
      var i = n.getVisual("decal");
      if (i) {
        var a = n.getVisual("style");
        a.decal = bs(i, t);
      }
    }
  });
}
var Qr = new Wr(), FI = {};
function M$(r, t) {
  FI[r] = t;
}
function I$(r) {
  return FI[r];
}
var L$ = 1, E$ = 800, P$ = 900, k$ = 1e3, R$ = 2e3, O$ = 5e3, BI = 1e3, F$ = 1100, F0 = 2e3, NI = 3e3, B$ = 4e3, Dv = 4500, N$ = 4600, z$ = 5e3, V$ = 6e3, zI = 7e3, $$ = {
  PROCESSOR: {
    FILTER: k$,
    SERIES_FILTER: E$,
    STATISTIC: O$
  },
  VISUAL: {
    LAYOUT: BI,
    PROGRESSIVE_LAYOUT: F$,
    GLOBAL: F0,
    CHART: NI,
    POST_CHART_LAYOUT: N$,
    COMPONENT: B$,
    BRUSH: z$,
    CHART_ITEM: Dv,
    ARIA: V$,
    DECAL: zI
  }
}, Vt = "__flagInMainProcess", fr = "__pendingUpdate", Yd = "__needsUpdateStatus", yx = /^[a-zA-Z0-9_]+$/, Zd = "__connectUpdateStatus", _x = 0, G$ = 1, H$ = 2;
function VI(r) {
  return function() {
    for (var t = [], e = 0; e < arguments.length; e++)
      t[e] = arguments[e];
    if (this.isDisposed()) {
      this.id;
      return;
    }
    return GI(this, r, t);
  };
}
function $I(r) {
  return function() {
    for (var t = [], e = 0; e < arguments.length; e++)
      t[e] = arguments[e];
    return GI(this, r, t);
  };
}
function GI(r, t, e) {
  return e[0] = e[0] && e[0].toLowerCase(), Wr.prototype[t].apply(r, e);
}
var HI = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t;
  }(Wr)
), qI = HI.prototype;
qI.on = $I("on");
qI.off = $I("off");
var Go, Xd, Nc, wi, jd, Kd, Jd, sl, ll, bx, Sx, Qd, xx, zc, Cx, WI, Ir, Ax, UI = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this, new K4()) || this;
      a._chartsViews = [], a._chartsMap = {}, a._componentsViews = [], a._componentsMap = {}, a._pendingActions = [], i = i || {}, J(n) && (n = YI[n]), a._dom = e;
      var o = "canvas", s = "auto", l = !1;
      i.ssr && zB(function(h) {
        var v = pe(h), d = v.dataIndex;
        if (d != null) {
          var p = re();
          return p.set("series_index", v.seriesIndex), p.set("data_index", d), v.ssrType && p.set("ssr_type", v.ssrType), p;
        }
      });
      var u = a._zr = Lb(e, {
        renderer: i.renderer || o,
        devicePixelRatio: i.devicePixelRatio,
        width: i.width,
        height: i.height,
        ssr: i.ssr,
        useDirtyRect: me(i.useDirtyRect, l),
        useCoarsePointer: me(i.useCoarsePointer, s),
        pointerSize: i.pointerSize
      });
      a._ssr = i.ssr, a._throttledZrFlush = k0(Q(u.flush, u), 17), n = ce(n), n && JM(n, !0), a._theme = n, a._locale = lV(i.locale || TM), a._coordSysMgr = new Zu();
      var c = a._api = Cx(a);
      function f(h, v) {
        return h.__prio - v.__prio;
      }
      return Af(_h, f), Af(Im, f), a._scheduler = new wI(a, c, Im, _h), a._messageCenter = new HI(), a._initEvents(), a.resize = Q(a.resize, a), u.animation.on("frame", a._onframe, a), bx(u, a), Sx(u, a), jf(a), a;
    }
    return t.prototype._onframe = function() {
      if (!this._disposed) {
        Ax(this);
        var e = this._scheduler;
        if (this[fr]) {
          var n = this[fr].silent;
          this[Vt] = !0;
          try {
            Go(this), wi.update.call(this, null, this[fr].updateParams);
          } catch (l) {
            throw this[Vt] = !1, this[fr] = null, l;
          }
          this._zr.flush(), this[Vt] = !1, this[fr] = null, sl.call(this, n), ll.call(this, n);
        } else if (e.unfinished) {
          var i = L$, a = this._model, o = this._api;
          e.unfinished = !1;
          do {
            var s = +/* @__PURE__ */ new Date();
            e.performSeriesTasks(a), e.performDataProcessorTasks(a), Kd(this, a), e.performVisualTasks(a), zc(this, this._model, o, "remain", {}), i -= +/* @__PURE__ */ new Date() - s;
          } while (i > 0 && e.unfinished);
          e.unfinished || this._zr.flush();
        }
      }
    }, t.prototype.getDom = function() {
      return this._dom;
    }, t.prototype.getId = function() {
      return this.id;
    }, t.prototype.getZr = function() {
      return this._zr;
    }, t.prototype.isSSR = function() {
      return this._ssr;
    }, t.prototype.setOption = function(e, n, i) {
      if (!this[Vt]) {
        if (this._disposed) {
          this.id;
          return;
        }
        var a, o, s;
        if (ue(n) && (i = n.lazyUpdate, a = n.silent, o = n.replaceMerge, s = n.transition, n = n.notMerge), this[Vt] = !0, !this._model || n) {
          var l = new kV(this._api), u = this._theme, c = this._model = new M0();
          c.scheduler = this._scheduler, c.ssr = this._ssr, c.init(null, null, null, u, this._locale, l);
        }
        this._model.setOption(e, {
          replaceMerge: o
        }, Lm);
        var f = {
          seriesTransition: s,
          optionChanged: !0
        };
        if (i)
          this[fr] = {
            silent: a,
            updateParams: f
          }, this[Vt] = !1, this.getZr().wakeUp();
        else {
          try {
            Go(this), wi.update.call(this, null, f);
          } catch (h) {
            throw this[fr] = null, this[Vt] = !1, h;
          }
          this._ssr || this._zr.flush(), this[fr] = null, this[Vt] = !1, sl.call(this, a), ll.call(this, a);
        }
      }
    }, t.prototype.setTheme = function() {
    }, t.prototype.getModel = function() {
      return this._model;
    }, t.prototype.getOption = function() {
      return this._model && this._model.getOption();
    }, t.prototype.getWidth = function() {
      return this._zr.getWidth();
    }, t.prototype.getHeight = function() {
      return this._zr.getHeight();
    }, t.prototype.getDevicePixelRatio = function() {
      return this._zr.painter.dpr || Ie.hasGlobalWindow && window.devicePixelRatio || 1;
    }, t.prototype.getRenderedCanvas = function(e) {
      return this.renderToCanvas(e);
    }, t.prototype.renderToCanvas = function(e) {
      e = e || {};
      var n = this._zr.painter;
      return n.getRenderedCanvas({
        backgroundColor: e.backgroundColor || this._model.get("backgroundColor"),
        pixelRatio: e.pixelRatio || this.getDevicePixelRatio()
      });
    }, t.prototype.renderToSVGString = function(e) {
      e = e || {};
      var n = this._zr.painter;
      return n.renderToString({
        useViewBox: e.useViewBox
      });
    }, t.prototype.getSvgDataURL = function() {
      if (Ie.svgSupported) {
        var e = this._zr, n = e.storage.getDisplayList();
        return M(n, function(i) {
          i.stopAnimation(null, !0);
        }), e.painter.toDataURL();
      }
    }, t.prototype.getDataURL = function(e) {
      if (this._disposed) {
        this.id;
        return;
      }
      e = e || {};
      var n = e.excludeComponents, i = this._model, a = [], o = this;
      M(n, function(l) {
        i.eachComponent({
          mainType: l
        }, function(u) {
          var c = o._componentsMap[u.__viewId];
          c.group.ignore || (a.push(c), c.group.ignore = !0);
        });
      });
      var s = this._zr.painter.getType() === "svg" ? this.getSvgDataURL() : this.renderToCanvas(e).toDataURL("image/" + (e && e.type || "png"));
      return M(a, function(l) {
        l.group.ignore = !1;
      }), s;
    }, t.prototype.getConnectedDataURL = function(e) {
      if (this._disposed) {
        this.id;
        return;
      }
      var n = e.type === "svg", i = this.group, a = Math.min, o = Math.max, s = 1 / 0;
      if (Dx[i]) {
        var l = s, u = s, c = -s, f = -s, h = [], v = e && e.pixelRatio || this.getDevicePixelRatio();
        M(eu, function(_, b) {
          if (_.group === i) {
            var S = n ? _.getZr().painter.getSvgDom().innerHTML : _.renderToCanvas(ce(e)), x = _.getDom().getBoundingClientRect();
            l = a(x.left, l), u = a(x.top, u), c = o(x.right, c), f = o(x.bottom, f), h.push({
              dom: S,
              left: x.left,
              top: x.top
            });
          }
        }), l *= v, u *= v, c *= v, f *= v;
        var d = c - l, p = f - u, g = ji.createCanvas(), m = Lb(g, {
          renderer: n ? "svg" : "canvas"
        });
        if (m.resize({
          width: d,
          height: p
        }), n) {
          var y = "";
          return M(h, function(_) {
            var b = _.left - l, S = _.top - u;
            y += '<g transform="translate(' + b + "," + S + ')">' + _.dom + "</g>";
          }), m.painter.getSvgRoot().innerHTML = y, e.connectedBackgroundColor && m.painter.setBackgroundColor(e.connectedBackgroundColor), m.refreshImmediately(), m.painter.toDataURL();
        } else
          return e.connectedBackgroundColor && m.add(new ke({
            shape: {
              x: 0,
              y: 0,
              width: d,
              height: p
            },
            style: {
              fill: e.connectedBackgroundColor
            }
          })), M(h, function(_) {
            var b = new Pt({
              style: {
                x: _.left * v - l,
                y: _.top * v - u,
                image: _.dom
              }
            });
            m.add(b);
          }), m.refreshImmediately(), g.toDataURL("image/" + (e && e.type || "png"));
      } else
        return this.getDataURL(e);
    }, t.prototype.convertToPixel = function(e, n) {
      return jd(this, "convertToPixel", e, n);
    }, t.prototype.convertFromPixel = function(e, n) {
      return jd(this, "convertFromPixel", e, n);
    }, t.prototype.containPixel = function(e, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      var i = this._model, a, o = Yl(i, e);
      return M(o, function(s, l) {
        l.indexOf("Models") >= 0 && M(s, function(u) {
          var c = u.coordinateSystem;
          if (c && c.containPoint)
            a = a || !!c.containPoint(n);
          else if (l === "seriesModels") {
            var f = this._chartsMap[u.__viewId];
            f && f.containPoint && (a = a || f.containPoint(n, u));
          }
        }, this);
      }, this), !!a;
    }, t.prototype.getVisual = function(e, n) {
      var i = this._model, a = Yl(i, e, {
        defaultMainType: "series"
      }), o = a.seriesModel, s = o.getData(), l = a.hasOwnProperty("dataIndexInside") ? a.dataIndexInside : a.hasOwnProperty("dataIndex") ? s.indexOfRawIndex(a.dataIndex) : null;
      return l != null ? R0(s, l, n) : Xu(s, n);
    }, t.prototype.getViewOfComponentModel = function(e) {
      return this._componentsMap[e.__viewId];
    }, t.prototype.getViewOfSeriesModel = function(e) {
      return this._chartsMap[e.__viewId];
    }, t.prototype._initEvents = function() {
      var e = this;
      M(q$, function(n) {
        var i = function(a) {
          var o = e.getModel(), s = a.target, l, u = n === "globalout";
          if (u ? l = {} : s && Xa(s, function(d) {
            var p = pe(d);
            if (p && p.dataIndex != null) {
              var g = p.dataModel || o.getSeriesByIndex(p.seriesIndex);
              return l = g && g.getDataParams(p.dataIndex, p.dataType, s) || {}, !0;
            } else if (p.eventData)
              return l = H({}, p.eventData), !0;
          }, !0), l) {
            var c = l.componentType, f = l.componentIndex;
            (c === "markLine" || c === "markPoint" || c === "markArea") && (c = "series", f = l.seriesIndex);
            var h = c && f != null && o.getComponent(c, f), v = h && e[h.mainType === "series" ? "_chartsMap" : "_componentsMap"][h.__viewId];
            l.event = a, l.type = n, e._$eventProcessor.eventInfo = {
              targetEl: s,
              packedEvent: l,
              model: h,
              view: v
            }, e.trigger(n, l);
          }
        };
        i.zrEventfulCallAtLast = !0, e._zr.on(n, i, e);
      }), M(Ql, function(n, i) {
        e._messageCenter.on(i, function(a) {
          this.trigger(i, a);
        }, e);
      }), M(["selectchanged"], function(n) {
        e._messageCenter.on(n, function(i) {
          this.trigger(n, i);
        }, e);
      }), e$(this._messageCenter, this, this._api);
    }, t.prototype.isDisposed = function() {
      return this._disposed;
    }, t.prototype.clear = function() {
      if (this._disposed) {
        this.id;
        return;
      }
      this.setOption({
        series: []
      }, !0);
    }, t.prototype.dispose = function() {
      if (this._disposed) {
        this.id;
        return;
      }
      this._disposed = !0;
      var e = this.getDom();
      e && NT(this.getDom(), N0, "");
      var n = this, i = n._api, a = n._model;
      M(n._componentsViews, function(o) {
        o.dispose(a, i);
      }), M(n._chartsViews, function(o) {
        o.dispose(a, i);
      }), n._zr.dispose(), n._dom = n._model = n._chartsMap = n._componentsMap = n._chartsViews = n._componentsViews = n._scheduler = n._api = n._zr = n._throttledZrFlush = n._theme = n._coordSysMgr = n._messageCenter = null, delete eu[n.id];
    }, t.prototype.resize = function(e) {
      if (!this[Vt]) {
        if (this._disposed) {
          this.id;
          return;
        }
        this._zr.resize(e);
        var n = this._model;
        if (this._loadingFX && this._loadingFX.resize(), !!n) {
          var i = n.resetOption("media"), a = e && e.silent;
          this[fr] && (a == null && (a = this[fr].silent), i = !0, this[fr] = null), this[Vt] = !0;
          try {
            i && Go(this), wi.update.call(this, {
              type: "resize",
              animation: H({
                // Disable animation
                duration: 0
              }, e && e.animation)
            });
          } catch (o) {
            throw this[Vt] = !1, o;
          }
          this[Vt] = !1, sl.call(this, a), ll.call(this, a);
        }
      }
    }, t.prototype.showLoading = function(e, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      if (ue(e) && (n = e, e = ""), e = e || "default", this.hideLoading(), !!Em[e]) {
        var i = Em[e](this._api, n), a = this._zr;
        this._loadingFX = i, a.add(i);
      }
    }, t.prototype.hideLoading = function() {
      if (this._disposed) {
        this.id;
        return;
      }
      this._loadingFX && this._zr.remove(this._loadingFX), this._loadingFX = null;
    }, t.prototype.makeActionFromEvent = function(e) {
      var n = H({}, e);
      return n.type = Ql[e.type], n;
    }, t.prototype.dispatchAction = function(e, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      if (ue(n) || (n = {
        silent: !!n
      }), !!yh[e.type] && this._model) {
        if (this[Vt]) {
          this._pendingActions.push(e);
          return;
        }
        var i = n.silent;
        Jd.call(this, e, i);
        var a = n.flush;
        a ? this._zr.flush() : a !== !1 && Ie.browser.weChat && this._throttledZrFlush(), sl.call(this, i), ll.call(this, i);
      }
    }, t.prototype.updateLabelLayout = function() {
      Qr.trigger("series:layoutlabels", this._model, this._api, {
        // Not adding series labels.
        // TODO
        updatedSeries: []
      });
    }, t.prototype.appendData = function(e) {
      if (this._disposed) {
        this.id;
        return;
      }
      var n = e.seriesIndex, i = this.getModel(), a = i.getSeriesByIndex(n);
      a.appendData(e), this._scheduler.unfinished = !0, this.getZr().wakeUp();
    }, t.internalField = function() {
      Go = function(f) {
        var h = f._scheduler;
        h.restorePipelines(f._model), h.prepareStageTasks(), Xd(f, !0), Xd(f, !1), h.plan();
      }, Xd = function(f, h) {
        for (var v = f._model, d = f._scheduler, p = h ? f._componentsViews : f._chartsViews, g = h ? f._componentsMap : f._chartsMap, m = f._zr, y = f._api, _ = 0; _ < p.length; _++)
          p[_].__alive = !1;
        h ? v.eachComponent(function(x, w) {
          x !== "series" && b(w);
        }) : v.eachSeries(b);
        function b(x) {
          var w = x.__requireNewView;
          x.__requireNewView = !1;
          var C = "_ec_" + x.id + "_" + x.type, D = !w && g[C];
          if (!D) {
            var A = Tn(x.type), T = h ? lt.getClass(A.main, A.sub) : (
              // FIXME:TS
              // (ChartView as ChartViewConstructor).getClass('series', classType.sub)
              // For backward compat, still support a chart type declared as only subType
              // like "liquidfill", but recommend "series.liquidfill"
              // But need a base class to make a type series.
              Qe.getClass(A.sub)
            );
            D = new T(), D.init(v, y), g[C] = D, p.push(D), m.add(D.group);
          }
          x.__viewId = D.__id = C, D.__alive = !0, D.__model = x, D.group.__ecComponentInfo = {
            mainType: x.mainType,
            index: x.componentIndex
          }, !h && d.prepareView(D, x, v, y);
        }
        for (var _ = 0; _ < p.length; ) {
          var S = p[_];
          S.__alive ? _++ : (!h && S.renderTask.dispose(), m.remove(S.group), S.dispose(v, y), p.splice(_, 1), g[S.__id] === S && delete g[S.__id], S.__id = S.group.__ecComponentInfo = null);
        }
      }, Nc = function(f, h, v, d, p) {
        var g = f._model;
        if (g.setUpdatePayload(v), !d) {
          M([].concat(f._componentsViews).concat(f._chartsViews), S);
          return;
        }
        var m = {};
        m[d + "Id"] = v[d + "Id"], m[d + "Index"] = v[d + "Index"], m[d + "Name"] = v[d + "Name"];
        var y = {
          mainType: d,
          query: m
        };
        p && (y.subType = p);
        var _ = v.excludeSeriesId, b;
        _ != null && (b = re(), M(je(_), function(x) {
          var w = bt(x, null);
          w != null && b.set(w, !0);
        })), g && g.eachComponent(y, function(x) {
          var w = b && b.get(x.id) != null;
          if (!w)
            if (oS(v))
              if (x instanceof it)
                v.type === io && !v.notBlur && !x.get(["emphasis", "disabled"]) && lz(x, v, f._api);
              else {
                var C = v0(x.mainType, x.componentIndex, v.name, f._api), D = C.focusSelf, A = C.dispatchers;
                v.type === io && D && !v.notBlur && fm(x.mainType, x.componentIndex, f._api), A && M(A, function(T) {
                  v.type === io ? oi(T) : si(T);
                });
              }
            else vm(v) && x instanceof it && (fz(x, v, f._api), iS(x), Ir(f));
        }, f), g && g.eachComponent(y, function(x) {
          var w = b && b.get(x.id) != null;
          w || S(f[d === "series" ? "_chartsMap" : "_componentsMap"][x.__viewId]);
        }, f);
        function S(x) {
          x && x.__alive && x[h] && x[h](x.__model, g, f._api, v);
        }
      }, wi = {
        prepareAndUpdate: function(f) {
          Go(this), wi.update.call(this, f, {
            // Needs to mark option changed if newOption is given.
            // It's from MagicType.
            // TODO If use a separate flag optionChanged in payload?
            optionChanged: f.newOption != null
          });
        },
        update: function(f, h) {
          var v = this._model, d = this._api, p = this._zr, g = this._coordSysMgr, m = this._scheduler;
          if (v) {
            v.setUpdatePayload(f), m.restoreData(v, f), m.performSeriesTasks(v), g.create(v, d), m.performDataProcessorTasks(v, f), Kd(this, v), g.update(v, d), e(v), m.performVisualTasks(v, f), Qd(this, v, d, f, h);
            var y = v.get("backgroundColor") || "transparent", _ = v.get("darkMode");
            p.setBackgroundColor(y), _ != null && _ !== "auto" && p.setDarkMode(_), Qr.trigger("afterupdate", v, d);
          }
        },
        updateTransform: function(f) {
          var h = this, v = this._model, d = this._api;
          if (v) {
            v.setUpdatePayload(f);
            var p = [];
            v.eachComponent(function(m, y) {
              if (m !== "series") {
                var _ = h.getViewOfComponentModel(y);
                if (_ && _.__alive)
                  if (_.updateTransform) {
                    var b = _.updateTransform(y, v, d, f);
                    b && b.update && p.push(_);
                  } else
                    p.push(_);
              }
            });
            var g = re();
            v.eachSeries(function(m) {
              var y = h._chartsMap[m.__viewId];
              if (y.updateTransform) {
                var _ = y.updateTransform(m, v, d, f);
                _ && _.update && g.set(m.uid, 1);
              } else
                g.set(m.uid, 1);
            }), e(v), this._scheduler.performVisualTasks(v, f, {
              setDirty: !0,
              dirtyMap: g
            }), zc(this, v, d, f, {}, g), Qr.trigger("afterupdate", v, d);
          }
        },
        updateView: function(f) {
          var h = this._model;
          h && (h.setUpdatePayload(f), Qe.markUpdateMethod(f, "updateView"), e(h), this._scheduler.performVisualTasks(h, f, {
            setDirty: !0
          }), Qd(this, h, this._api, f, {}), Qr.trigger("afterupdate", h, this._api));
        },
        updateVisual: function(f) {
          var h = this, v = this._model;
          v && (v.setUpdatePayload(f), v.eachSeries(function(d) {
            d.getData().clearAllVisual();
          }), Qe.markUpdateMethod(f, "updateVisual"), e(v), this._scheduler.performVisualTasks(v, f, {
            visualType: "visual",
            setDirty: !0
          }), v.eachComponent(function(d, p) {
            if (d !== "series") {
              var g = h.getViewOfComponentModel(p);
              g && g.__alive && g.updateVisual(p, v, h._api, f);
            }
          }), v.eachSeries(function(d) {
            var p = h._chartsMap[d.__viewId];
            p.updateVisual(d, v, h._api, f);
          }), Qr.trigger("afterupdate", v, this._api));
        },
        updateLayout: function(f) {
          wi.update.call(this, f);
        }
      }, jd = function(f, h, v, d) {
        if (f._disposed) {
          f.id;
          return;
        }
        for (var p = f._model, g = f._coordSysMgr.getCoordinateSystems(), m, y = Yl(p, v), _ = 0; _ < g.length; _++) {
          var b = g[_];
          if (b[h] && (m = b[h](p, y, d)) != null)
            return m;
        }
      }, Kd = function(f, h) {
        var v = f._chartsMap, d = f._scheduler;
        h.eachSeries(function(p) {
          d.updateStreamModes(p, v[p.__viewId]);
        });
      }, Jd = function(f, h) {
        var v = this, d = this.getModel(), p = f.type, g = f.escapeConnect, m = yh[p], y = m.actionInfo, _ = (y.update || "update").split(":"), b = _.pop(), S = _[0] != null && Tn(_[0]);
        this[Vt] = !0;
        var x = [f], w = !1;
        f.batch && (w = !0, x = U(f.batch, function(I) {
          return I = se(H({}, I), f), I.batch = null, I;
        }));
        var C = [], D, A = vm(f), T = oS(f);
        if (T && aM(this._api), M(x, function(I) {
          if (D = m.action(I, v._model, v._api), D = D || H({}, I), D.type = y.event || D.type, C.push(D), T) {
            var P = a0(f), R = P.queryOptionMap, F = P.mainTypeSpecified, O = F ? R.keys()[0] : "series";
            Nc(v, b, I, O), Ir(v);
          } else A ? (Nc(v, b, I, "series"), Ir(v)) : S && Nc(v, b, I, S.main, S.sub);
        }), b !== "none" && !T && !A && !S)
          try {
            this[fr] ? (Go(this), wi.update.call(this, f), this[fr] = null) : wi[b].call(this, f);
          } catch (I) {
            throw this[Vt] = !1, I;
          }
        if (w ? D = {
          type: y.event || p,
          escapeConnect: g,
          batch: C
        } : D = C[0], this[Vt] = !1, !h) {
          var L = this._messageCenter;
          if (L.trigger(D.type, D), A) {
            var E = {
              type: "selectchanged",
              escapeConnect: g,
              selected: hz(d),
              isFromClick: f.isFromClick || !1,
              fromAction: f.type,
              fromActionPayload: f
            };
            L.trigger(E.type, E);
          }
        }
      }, sl = function(f) {
        for (var h = this._pendingActions; h.length; ) {
          var v = h.shift();
          Jd.call(this, v, f);
        }
      }, ll = function(f) {
        !f && this.trigger("updated");
      }, bx = function(f, h) {
        f.on("rendered", function(v) {
          h.trigger("rendered", v), // Although zr is dirty if initial animation is not finished
          // and this checking is called on frame, we also check
          // animation finished for robustness.
          f.animation.isFinished() && !h[fr] && !h._scheduler.unfinished && !h._pendingActions.length && h.trigger("finished");
        });
      }, Sx = function(f, h) {
        f.on("mouseover", function(v) {
          var d = v.target, p = Xa(d, mu);
          p && (uz(p, v, h._api), Ir(h));
        }).on("mouseout", function(v) {
          var d = v.target, p = Xa(d, mu);
          p && (cz(p, v, h._api), Ir(h));
        }).on("click", function(v) {
          var d = v.target, p = Xa(d, function(y) {
            return pe(y).dataIndex != null;
          }, !0);
          if (p) {
            var g = p.selected ? "unselect" : "select", m = pe(p);
            h._api.dispatchAction({
              type: g,
              dataType: m.dataType,
              dataIndexInside: m.dataIndex,
              seriesIndex: m.seriesIndex,
              isFromClick: !0
            });
          }
        });
      };
      function e(f) {
        f.clearColorPalette(), f.eachSeries(function(h) {
          h.clearColorPalette();
        });
      }
      function n(f) {
        var h = [], v = [], d = !1;
        if (f.eachComponent(function(y, _) {
          var b = _.get("zlevel") || 0, S = _.get("z") || 0, x = _.getZLevelKey();
          d = d || !!x, (y === "series" ? v : h).push({
            zlevel: b,
            z: S,
            idx: _.componentIndex,
            type: y,
            key: x
          });
        }), d) {
          var p = h.concat(v), g, m;
          Af(p, function(y, _) {
            return y.zlevel === _.zlevel ? y.z - _.z : y.zlevel - _.zlevel;
          }), M(p, function(y) {
            var _ = f.getComponent(y.type, y.idx), b = y.zlevel, S = y.key;
            g != null && (b = Math.max(g, b)), S ? (b === g && S !== m && b++, m = S) : m && (b === g && b++, m = ""), g = b, _.setZLevel(b);
          });
        }
      }
      Qd = function(f, h, v, d, p) {
        n(h), xx(f, h, v, d, p), M(f._chartsViews, function(g) {
          g.__alive = !1;
        }), zc(f, h, v, d, p), M(f._chartsViews, function(g) {
          g.__alive || g.remove(h, v);
        });
      }, xx = function(f, h, v, d, p, g) {
        M(g || f._componentsViews, function(m) {
          var y = m.__model;
          u(y, m), m.render(y, h, v, d), s(y, m), c(y, m);
        });
      }, zc = function(f, h, v, d, p, g) {
        var m = f._scheduler;
        p = H(p || {}, {
          updatedSeries: h.getSeries()
        }), Qr.trigger("series:beforeupdate", h, v, p);
        var y = !1;
        h.eachSeries(function(_) {
          var b = f._chartsMap[_.__viewId];
          b.__alive = !0;
          var S = b.renderTask;
          m.updatePayload(S, d), u(_, b), g && g.get(_.uid) && S.dirty(), S.perform(m.getPerformArgs(S)) && (y = !0), b.group.silent = !!_.get("silent"), o(_, b), iS(_);
        }), m.unfinished = y || m.unfinished, Qr.trigger("series:layoutlabels", h, v, p), Qr.trigger("series:transition", h, v, p), h.eachSeries(function(_) {
          var b = f._chartsMap[_.__viewId];
          s(_, b), c(_, b);
        }), a(f, h), Qr.trigger("series:afterupdate", h, v, p);
      }, Ir = function(f) {
        f[Yd] = !0, f.getZr().wakeUp();
      }, Ax = function(f) {
        f[Yd] && (f.getZr().storage.traverse(function(h) {
          cs(h) || i(h);
        }), f[Yd] = !1);
      };
      function i(f) {
        for (var h = [], v = f.currentStates, d = 0; d < v.length; d++) {
          var p = v[d];
          p === "emphasis" || p === "blur" || p === "select" || h.push(p);
        }
        f.selected && f.states.select && h.push("select"), f.hoverState === cv && f.states.emphasis ? h.push("emphasis") : f.hoverState === Gu && f.states.blur && h.push("blur"), f.useStates(h);
      }
      function a(f, h) {
        var v = f._zr, d = v.storage, p = 0;
        d.traverse(function(g) {
          g.isGroup || p++;
        }), p > h.get("hoverLayerThreshold") && !Ie.node && !Ie.worker && h.eachSeries(function(g) {
          if (!g.preventUsingHoverLayer) {
            var m = f._chartsMap[g.__viewId];
            m.__alive && m.eachRendered(function(y) {
              y.states.emphasis && (y.states.emphasis.hoverLayer = !0);
            });
          }
        });
      }
      function o(f, h) {
        var v = f.get("blendMode") || null;
        h.eachRendered(function(d) {
          d.isGroup || (d.style.blend = v);
        });
      }
      function s(f, h) {
        if (!f.preventAutoZ) {
          var v = f.get("z") || 0, d = f.get("zlevel") || 0;
          h.eachRendered(function(p) {
            return l(p, v, d, -1 / 0), !0;
          });
        }
      }
      function l(f, h, v, d) {
        var p = f.getTextContent(), g = f.getTextGuideLine(), m = f.isGroup;
        if (m)
          for (var y = f.childrenRef(), _ = 0; _ < y.length; _++)
            d = Math.max(l(y[_], h, v, d), d);
        else
          f.z = h, f.zlevel = v, d = Math.max(f.z2, d);
        if (p && (p.z = h, p.zlevel = v, isFinite(d) && (p.z2 = d + 2)), g) {
          var b = f.textGuideLineConfig;
          g.z = h, g.zlevel = v, isFinite(d) && (g.z2 = d + (b && b.showAbove ? 1 : -1));
        }
        return d;
      }
      function u(f, h) {
        h.eachRendered(function(v) {
          if (!cs(v)) {
            var d = v.getTextContent(), p = v.getTextGuideLine();
            v.stateTransition && (v.stateTransition = null), d && d.stateTransition && (d.stateTransition = null), p && p.stateTransition && (p.stateTransition = null), v.hasState() ? (v.prevStates = v.currentStates, v.clearStates()) : v.prevStates && (v.prevStates = null);
          }
        });
      }
      function c(f, h) {
        var v = f.getModel("stateAnimation"), d = f.isAnimationEnabled(), p = v.get("duration"), g = p > 0 ? {
          duration: p,
          delay: v.get("delay"),
          easing: v.get("easing")
          // additive: stateAnimationModel.get('additive')
        } : null;
        h.eachRendered(function(m) {
          if (m.states && m.states.emphasis) {
            if (cs(m))
              return;
            if (m instanceof Te && mz(m), m.__dirty) {
              var y = m.prevStates;
              y && m.useStates(y);
            }
            if (d) {
              m.stateTransition = g;
              var _ = m.getTextContent(), b = m.getTextGuideLine();
              _ && (_.stateTransition = g), b && (b.stateTransition = g);
            }
            m.__dirty && i(m);
          }
        });
      }
      Cx = function(f) {
        return new /** @class */
        (function(h) {
          N(v, h);
          function v() {
            return h !== null && h.apply(this, arguments) || this;
          }
          return v.prototype.getCoordinateSystems = function() {
            return f._coordSysMgr.getCoordinateSystems();
          }, v.prototype.getComponentByElement = function(d) {
            for (; d; ) {
              var p = d.__ecComponentInfo;
              if (p != null)
                return f._model.getComponent(p.mainType, p.index);
              d = d.parent;
            }
          }, v.prototype.enterEmphasis = function(d, p) {
            oi(d, p), Ir(f);
          }, v.prototype.leaveEmphasis = function(d, p) {
            si(d, p), Ir(f);
          }, v.prototype.enterBlur = function(d) {
            tM(d), Ir(f);
          }, v.prototype.leaveBlur = function(d) {
            h0(d), Ir(f);
          }, v.prototype.enterSelect = function(d) {
            rM(d), Ir(f);
          }, v.prototype.leaveSelect = function(d) {
            nM(d), Ir(f);
          }, v.prototype.getModel = function() {
            return f.getModel();
          }, v.prototype.getViewOfComponentModel = function(d) {
            return f.getViewOfComponentModel(d);
          }, v.prototype.getViewOfSeriesModel = function(d) {
            return f.getViewOfSeriesModel(d);
          }, v;
        }(jM))(f);
      }, WI = function(f) {
        function h(v, d) {
          for (var p = 0; p < v.length; p++) {
            var g = v[p];
            g[Zd] = d;
          }
        }
        M(Ql, function(v, d) {
          f._messageCenter.on(d, function(p) {
            if (Dx[f.group] && f[Zd] !== _x) {
              if (p && p.escapeConnect)
                return;
              var g = f.makeActionFromEvent(p), m = [];
              M(eu, function(y) {
                y !== f && y.group === f.group && m.push(y);
              }), h(m, _x), M(m, function(y) {
                y[Zd] !== G$ && y.dispatchAction(g);
              }), h(m, H$);
            }
          });
        });
      };
    }(), t;
  }(Wr)
), B0 = UI.prototype;
B0.on = VI("on");
B0.off = VI("off");
B0.one = function(r, t, e) {
  var n = this;
  function i() {
    for (var a = [], o = 0; o < arguments.length; o++)
      a[o] = arguments[o];
    t && t.apply && t.apply(this, a), n.off(r, i);
  }
  this.on.call(this, r, i, e);
};
var q$ = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
var yh = {}, Ql = {}, Im = [], Lm = [], _h = [], YI = {}, Em = {}, eu = {}, Dx = {}, W$ = +/* @__PURE__ */ new Date() - 0, N0 = "_echarts_instance_";
function z0(r, t, e) {
  {
    var n = U$(r);
    if (n)
      return n;
  }
  var i = new UI(r, t, e);
  return i.id = "ec_" + W$++, eu[i.id] = i, NT(r, N0, i.id), WI(i), Qr.trigger("afterinit", i), i;
}
function U$(r) {
  return eu[aN(r, N0)];
}
function ZI(r, t) {
  YI[r] = t;
}
function XI(r) {
  we(Lm, r) < 0 && Lm.push(r);
}
function jI(r, t) {
  $0(Im, r, t, R$);
}
function Y$(r) {
  V0("afterinit", r);
}
function Z$(r) {
  V0("afterupdate", r);
}
function V0(r, t) {
  Qr.on(r, t);
}
function Vn(r, t, e) {
  oe(t) && (e = t, t = "");
  var n = ue(r) ? r.type : [r, r = {
    event: t
  }][0];
  r.event = (r.event || n).toLowerCase(), t = r.event, !Ql[t] && (rr(yx.test(n) && yx.test(t)), yh[n] || (yh[n] = {
    action: e,
    actionInfo: r
  }), Ql[t] = n);
}
function X$(r, t) {
  Zu.register(r, t);
}
function j$(r, t) {
  $0(_h, r, t, BI, "layout");
}
function Ao(r, t) {
  $0(_h, r, t, NI, "visual");
}
var Tx = [];
function $0(r, t, e, n, i) {
  if ((oe(t) || ue(t)) && (e = t, t = n), !(we(Tx, e) >= 0)) {
    Tx.push(e);
    var a = wI.wrapStageHandler(e, i);
    a.__prio = t, a.__raw = e, r.push(a);
  }
}
function KI(r, t) {
  Em[r] = t;
}
function K$(r, t, e) {
  var n = I$("registerMap");
  n && n(r, t, e);
}
var J$ = f4;
Ao(F0, B4);
Ao(Dv, N4);
Ao(Dv, z4);
Ao(F0, J4);
Ao(Dv, Q4);
Ao(zI, T$);
XI(JM);
jI(P$, WV);
KI("default", V4);
Vn({
  type: io,
  event: io,
  update: io
}, dt);
Vn({
  type: Lf,
  event: Lf,
  update: Lf
}, dt);
Vn({
  type: Zl,
  event: Zl,
  update: Zl
}, dt);
Vn({
  type: Ef,
  event: Ef,
  update: Ef
}, dt);
Vn({
  type: Xl,
  event: Xl,
  update: Xl
}, dt);
ZI("light", j4);
ZI("dark", TI);
var Mx = [], Q$ = {
  registerPreprocessor: XI,
  registerProcessor: jI,
  registerPostInit: Y$,
  registerPostUpdate: Z$,
  registerUpdateLifecycle: V0,
  registerAction: Vn,
  registerCoordinateSystem: X$,
  registerLayout: j$,
  registerVisual: Ao,
  registerTransform: J$,
  registerLoading: KI,
  registerMap: K$,
  registerImpl: M$,
  PRIORITY: $$,
  ComponentModel: Le,
  ComponentView: lt,
  SeriesModel: it,
  ChartView: Qe,
  // TODO Use ComponentModel and SeriesModel instead of Constructor
  registerComponentModel: function(r) {
    Le.registerClass(r);
  },
  registerComponentView: function(r) {
    lt.registerClass(r);
  },
  registerSeriesModel: function(r) {
    it.registerClass(r);
  },
  registerChartView: function(r) {
    Qe.registerClass(r);
  },
  registerSubTypeDefaulter: function(r, t) {
    Le.registerSubTypeDefaulter(r, t);
  },
  registerPainter: function(r, t) {
    BB(r, t);
  }
};
function De(r) {
  if (q(r)) {
    M(r, function(t) {
      De(t);
    });
    return;
  }
  we(Mx, r) >= 0 || (Mx.push(r), oe(r) && (r = {
    install: r
  }), r.install(Q$));
}
function ul(r) {
  return r == null ? 0 : r.length || 1;
}
function Ix(r) {
  return r;
}
var li = (
  /** @class */
  function() {
    function r(t, e, n, i, a, o) {
      this._old = t, this._new = e, this._oldKeyGetter = n || Ix, this._newKeyGetter = i || Ix, this.context = a, this._diffModeMultiple = o === "multiple";
    }
    return r.prototype.add = function(t) {
      return this._add = t, this;
    }, r.prototype.update = function(t) {
      return this._update = t, this;
    }, r.prototype.updateManyToOne = function(t) {
      return this._updateManyToOne = t, this;
    }, r.prototype.updateOneToMany = function(t) {
      return this._updateOneToMany = t, this;
    }, r.prototype.updateManyToMany = function(t) {
      return this._updateManyToMany = t, this;
    }, r.prototype.remove = function(t) {
      return this._remove = t, this;
    }, r.prototype.execute = function() {
      this[this._diffModeMultiple ? "_executeMultiple" : "_executeOneToOne"]();
    }, r.prototype._executeOneToOne = function() {
      var t = this._old, e = this._new, n = {}, i = new Array(t.length), a = new Array(e.length);
      this._initIndexMap(t, null, i, "_oldKeyGetter"), this._initIndexMap(e, n, a, "_newKeyGetter");
      for (var o = 0; o < t.length; o++) {
        var s = i[o], l = n[s], u = ul(l);
        if (u > 1) {
          var c = l.shift();
          l.length === 1 && (n[s] = l[0]), this._update && this._update(c, o);
        } else u === 1 ? (n[s] = null, this._update && this._update(l, o)) : this._remove && this._remove(o);
      }
      this._performRestAdd(a, n);
    }, r.prototype._executeMultiple = function() {
      var t = this._old, e = this._new, n = {}, i = {}, a = [], o = [];
      this._initIndexMap(t, n, a, "_oldKeyGetter"), this._initIndexMap(e, i, o, "_newKeyGetter");
      for (var s = 0; s < a.length; s++) {
        var l = a[s], u = n[l], c = i[l], f = ul(u), h = ul(c);
        if (f > 1 && h === 1)
          this._updateManyToOne && this._updateManyToOne(c, u), i[l] = null;
        else if (f === 1 && h > 1)
          this._updateOneToMany && this._updateOneToMany(c, u), i[l] = null;
        else if (f === 1 && h === 1)
          this._update && this._update(c, u), i[l] = null;
        else if (f > 1 && h > 1)
          this._updateManyToMany && this._updateManyToMany(c, u), i[l] = null;
        else if (f > 1)
          for (var v = 0; v < f; v++)
            this._remove && this._remove(u[v]);
        else
          this._remove && this._remove(u);
      }
      this._performRestAdd(o, i);
    }, r.prototype._performRestAdd = function(t, e) {
      for (var n = 0; n < t.length; n++) {
        var i = t[n], a = e[i], o = ul(a);
        if (o > 1)
          for (var s = 0; s < o; s++)
            this._add && this._add(a[s]);
        else o === 1 && this._add && this._add(a);
        e[i] = null;
      }
    }, r.prototype._initIndexMap = function(t, e, n, i) {
      for (var a = this._diffModeMultiple, o = 0; o < t.length; o++) {
        var s = "_ec_" + this[i](t[o], o);
        if (a || (n[o] = s), !!e) {
          var l = e[s], u = ul(l);
          u === 0 ? (e[s] = o, a && n.push(s)) : u === 1 ? e[s] = [l, o] : l.push(o);
        }
      }
    }, r;
  }()
), eG = (
  /** @class */
  function() {
    function r(t, e) {
      this._encode = t, this._schema = e;
    }
    return r.prototype.get = function() {
      return {
        // Do not generate full dimension name until fist used.
        fullDimensions: this._getFullDimensionNames(),
        encode: this._encode
      };
    }, r.prototype._getFullDimensionNames = function() {
      return this._cachedDimNames || (this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []), this._cachedDimNames;
    }, r;
  }()
);
function tG(r, t) {
  var e = {}, n = e.encode = {}, i = re(), a = [], o = [], s = {};
  M(r.dimensions, function(h) {
    var v = r.getDimensionInfo(h), d = v.coordDim;
    if (d) {
      var p = v.coordDimIndex;
      ep(n, d)[p] = h, v.isExtraCoord || (i.set(d, 1), rG(v.type) && (a[0] = h), ep(s, d)[p] = r.getDimensionIndex(v.name)), v.defaultTooltip && o.push(h);
    }
    HM.each(function(g, m) {
      var y = ep(n, m), _ = v.otherDims[m];
      _ != null && _ !== !1 && (y[_] = v.name);
    });
  });
  var l = [], u = {};
  i.each(function(h, v) {
    var d = n[v];
    u[v] = d[0], l = l.concat(d);
  }), e.dataDimsOnCoord = l, e.dataDimIndicesOnCoord = U(l, function(h) {
    return r.getDimensionInfo(h).storeDimIndex;
  }), e.encodeFirstDimNotExtra = u;
  var c = n.label;
  c && c.length && (a = c.slice());
  var f = n.tooltip;
  return f && f.length ? o = f.slice() : o.length || (o = a.slice()), n.defaultedLabel = a, n.defaultedTooltip = o, e.userOutput = new eG(s, t), e;
}
function ep(r, t) {
  return r.hasOwnProperty(t) || (r[t] = []), r[t];
}
function bh(r) {
  return r === "category" ? "ordinal" : r === "time" ? "time" : "float";
}
function rG(r) {
  return !(r === "ordinal" || r === "time");
}
var Ff = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t) {
      this.otherDims = {}, t != null && H(this, t);
    }
    return r;
  }()
), nG = Oe(), iG = {
  float: "f",
  int: "i",
  ordinal: "o",
  number: "n",
  time: "t"
}, JI = (
  /** @class */
  function() {
    function r(t) {
      this.dimensions = t.dimensions, this._dimOmitted = t.dimensionOmitted, this.source = t.source, this._fullDimCount = t.fullDimensionCount, this._updateDimOmitted(t.dimensionOmitted);
    }
    return r.prototype.isDimensionOmitted = function() {
      return this._dimOmitted;
    }, r.prototype._updateDimOmitted = function(t) {
      this._dimOmitted = t, t && (this._dimNameMap || (this._dimNameMap = tL(this.source)));
    }, r.prototype.getSourceDimensionIndex = function(t) {
      return me(this._dimNameMap.get(t), -1);
    }, r.prototype.getSourceDimension = function(t) {
      var e = this.source.dimensionsDefine;
      if (e)
        return e[t];
    }, r.prototype.makeStoreSchema = function() {
      for (var t = this._fullDimCount, e = eI(this.source), n = !rL(t), i = "", a = [], o = 0, s = 0; o < t; o++) {
        var l = void 0, u = void 0, c = void 0, f = this.dimensions[s];
        if (f && f.storeDimIndex === o)
          l = e ? f.name : null, u = f.type, c = f.ordinalMeta, s++;
        else {
          var h = this.getSourceDimension(o);
          h && (l = e ? h.name : null, u = h.type);
        }
        a.push({
          property: l,
          type: u,
          ordinalMeta: c
        }), e && l != null && (!f || !f.isCalculationCoord) && (i += n ? l.replace(/\`/g, "`1").replace(/\$/g, "`2") : l), i += "$", i += iG[u] || "f", c && (i += c.uid), i += "$";
      }
      var v = this.source, d = [v.seriesLayoutBy, v.startIndex, i].join("$$");
      return {
        dimensions: a,
        hash: d
      };
    }, r.prototype.makeOutputDimensionNames = function() {
      for (var t = [], e = 0, n = 0; e < this._fullDimCount; e++) {
        var i = void 0, a = this.dimensions[n];
        if (a && a.storeDimIndex === e)
          a.isCalculationCoord || (i = a.name), n++;
        else {
          var o = this.getSourceDimension(e);
          o && (i = o.name);
        }
        t.push(i);
      }
      return t;
    }, r.prototype.appendCalculationDimension = function(t) {
      this.dimensions.push(t), t.isCalculationCoord = !0, this._fullDimCount++, this._updateDimOmitted(!0);
    }, r;
  }()
);
function QI(r) {
  return r instanceof JI;
}
function eL(r) {
  for (var t = re(), e = 0; e < (r || []).length; e++) {
    var n = r[e], i = ue(n) ? n.name : n;
    i != null && t.get(i) == null && t.set(i, e);
  }
  return t;
}
function tL(r) {
  var t = nG(r);
  return t.dimNameMap || (t.dimNameMap = eL(r.dimensionsDefine));
}
function rL(r) {
  return r > 30;
}
var cl = ue, Ci = U, aG = typeof Int32Array > "u" ? Array : Int32Array, oG = "e\0\0", Lx = -1, sG = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_dimSummary", "userOutput", "_rawData", "_dimValueGetter", "_nameDimIdx", "_idDimIdx", "_nameRepeatCount"], lG = ["_approximateExtent"], Ex, Vc, fl, hl, tp, vl, rp, er = (
  /** @class */
  function() {
    function r(t, e) {
      this.type = "list", this._dimOmitted = !1, this._nameList = [], this._idList = [], this._visual = {}, this._layout = {}, this._itemVisuals = [], this._itemLayouts = [], this._graphicEls = [], this._approximateExtent = {}, this._calculationInfo = {}, this.hasItemOption = !1, this.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "minmaxDownSample", "lttbDownSample", "map"], this.CHANGABLE_METHODS = ["filterSelf", "selectRange"], this.DOWNSAMPLE_METHODS = ["downSample", "minmaxDownSample", "lttbDownSample"];
      var n, i = !1;
      QI(t) ? (n = t.dimensions, this._dimOmitted = t.isDimensionOmitted(), this._schema = t) : (i = !0, n = t), n = n || ["x", "y"];
      for (var a = {}, o = [], s = {}, l = !1, u = {}, c = 0; c < n.length; c++) {
        var f = n[c], h = J(f) ? new Ff({
          name: f
        }) : f instanceof Ff ? f : new Ff(f), v = h.name;
        h.type = h.type || "float", h.coordDim || (h.coordDim = v, h.coordDimIndex = 0);
        var d = h.otherDims = h.otherDims || {};
        o.push(v), a[v] = h, u[v] != null && (l = !0), h.createInvertedIndices && (s[v] = []), d.itemName === 0 && (this._nameDimIdx = c), d.itemId === 0 && (this._idDimIdx = c), i && (h.storeDimIndex = c);
      }
      if (this.dimensions = o, this._dimInfos = a, this._initGetDimensionInfo(l), this.hostModel = e, this._invertedIndicesMap = s, this._dimOmitted) {
        var p = this._dimIdxToName = re();
        M(o, function(g) {
          p.set(a[g].storeDimIndex, g);
        });
      }
    }
    return r.prototype.getDimension = function(t) {
      var e = this._recognizeDimIndex(t);
      if (e == null)
        return t;
      if (e = t, !this._dimOmitted)
        return this.dimensions[e];
      var n = this._dimIdxToName.get(e);
      if (n != null)
        return n;
      var i = this._schema.getSourceDimension(e);
      if (i)
        return i.name;
    }, r.prototype.getDimensionIndex = function(t) {
      var e = this._recognizeDimIndex(t);
      if (e != null)
        return e;
      if (t == null)
        return -1;
      var n = this._getDimInfo(t);
      return n ? n.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(t) : -1;
    }, r.prototype._recognizeDimIndex = function(t) {
      if (Be(t) || t != null && !isNaN(t) && !this._getDimInfo(t) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(t) < 0))
        return +t;
    }, r.prototype._getStoreDimIndex = function(t) {
      var e = this.getDimensionIndex(t);
      return e;
    }, r.prototype.getDimensionInfo = function(t) {
      return this._getDimInfo(this.getDimension(t));
    }, r.prototype._initGetDimensionInfo = function(t) {
      var e = this._dimInfos;
      this._getDimInfo = t ? function(n) {
        return e.hasOwnProperty(n) ? e[n] : void 0;
      } : function(n) {
        return e[n];
      };
    }, r.prototype.getDimensionsOnCoord = function() {
      return this._dimSummary.dataDimsOnCoord.slice();
    }, r.prototype.mapDimension = function(t, e) {
      var n = this._dimSummary;
      if (e == null)
        return n.encodeFirstDimNotExtra[t];
      var i = n.encode[t];
      return i ? i[e] : null;
    }, r.prototype.mapDimensionsAll = function(t) {
      var e = this._dimSummary, n = e.encode[t];
      return (n || []).slice();
    }, r.prototype.getStore = function() {
      return this._store;
    }, r.prototype.initData = function(t, e, n) {
      var i = this, a;
      if (t instanceof xm && (a = t), !a) {
        var o = this.dimensions, s = I0(t) || qt(t) ? new tI(t, o.length) : t;
        a = new xm();
        var l = Ci(o, function(u) {
          return {
            type: i._dimInfos[u].type,
            property: u
          };
        });
        a.initData(s, l, n);
      }
      this._store = a, this._nameList = (e || []).slice(), this._idList = [], this._nameRepeatCount = {}, this._doInit(0, a.count()), this._dimSummary = tG(this, this._schema), this.userOutput = this._dimSummary.userOutput;
    }, r.prototype.appendData = function(t) {
      var e = this._store.appendData(t);
      this._doInit(e[0], e[1]);
    }, r.prototype.appendValues = function(t, e) {
      var n = this._store.appendValues(t, e && e.length), i = n.start, a = n.end, o = this._shouldMakeIdFromName();
      if (this._updateOrdinalMeta(), e)
        for (var s = i; s < a; s++) {
          var l = s - i;
          this._nameList[s] = e[l], o && rp(this, s);
        }
    }, r.prototype._updateOrdinalMeta = function() {
      for (var t = this._store, e = this.dimensions, n = 0; n < e.length; n++) {
        var i = this._dimInfos[e[n]];
        i.ordinalMeta && t.collectOrdinalMeta(i.storeDimIndex, i.ordinalMeta);
      }
    }, r.prototype._shouldMakeIdFromName = function() {
      var t = this._store.getProvider();
      return this._idDimIdx == null && t.getSource().sourceFormat !== Ui && !t.fillStorage;
    }, r.prototype._doInit = function(t, e) {
      if (!(t >= e)) {
        var n = this._store, i = n.getProvider();
        this._updateOrdinalMeta();
        var a = this._nameList, o = this._idList, s = i.getSource().sourceFormat, l = s === Ur;
        if (l && !i.pure)
          for (var u = [], c = t; c < e; c++) {
            var f = i.getItem(c, u);
            if (!this.hasItemOption && UB(f) && (this.hasItemOption = !0), f) {
              var h = f.name;
              a[c] == null && h != null && (a[c] = bt(h, null));
              var v = f.id;
              o[c] == null && v != null && (o[c] = bt(v, null));
            }
          }
        if (this._shouldMakeIdFromName())
          for (var c = t; c < e; c++)
            rp(this, c);
        Ex(this);
      }
    }, r.prototype.getApproximateExtent = function(t) {
      return this._approximateExtent[t] || this._store.getDataExtent(this._getStoreDimIndex(t));
    }, r.prototype.setApproximateExtent = function(t, e) {
      e = this.getDimension(e), this._approximateExtent[e] = t.slice();
    }, r.prototype.getCalculationInfo = function(t) {
      return this._calculationInfo[t];
    }, r.prototype.setCalculationInfo = function(t, e) {
      cl(t) ? H(this._calculationInfo, t) : this._calculationInfo[t] = e;
    }, r.prototype.getName = function(t) {
      var e = this.getRawIndex(t), n = this._nameList[e];
      return n == null && this._nameDimIdx != null && (n = fl(this, this._nameDimIdx, e)), n == null && (n = ""), n;
    }, r.prototype._getCategory = function(t, e) {
      var n = this._store.get(t, e), i = this._store.getOrdinalMeta(t);
      return i ? i.categories[n] : n;
    }, r.prototype.getId = function(t) {
      return Vc(this, this.getRawIndex(t));
    }, r.prototype.count = function() {
      return this._store.count();
    }, r.prototype.get = function(t, e) {
      var n = this._store, i = this._dimInfos[t];
      if (i)
        return n.get(i.storeDimIndex, e);
    }, r.prototype.getByRawIndex = function(t, e) {
      var n = this._store, i = this._dimInfos[t];
      if (i)
        return n.getByRawIndex(i.storeDimIndex, e);
    }, r.prototype.getIndices = function() {
      return this._store.getIndices();
    }, r.prototype.getDataExtent = function(t) {
      return this._store.getDataExtent(this._getStoreDimIndex(t));
    }, r.prototype.getSum = function(t) {
      return this._store.getSum(this._getStoreDimIndex(t));
    }, r.prototype.getMedian = function(t) {
      return this._store.getMedian(this._getStoreDimIndex(t));
    }, r.prototype.getValues = function(t, e) {
      var n = this, i = this._store;
      return q(t) ? i.getValues(Ci(t, function(a) {
        return n._getStoreDimIndex(a);
      }), e) : i.getValues(t);
    }, r.prototype.hasValue = function(t) {
      for (var e = this._dimSummary.dataDimIndicesOnCoord, n = 0, i = e.length; n < i; n++)
        if (isNaN(this._store.get(e[n], t)))
          return !1;
      return !0;
    }, r.prototype.indexOfName = function(t) {
      for (var e = 0, n = this._store.count(); e < n; e++)
        if (this.getName(e) === t)
          return e;
      return -1;
    }, r.prototype.getRawIndex = function(t) {
      return this._store.getRawIndex(t);
    }, r.prototype.indexOfRawIndex = function(t) {
      return this._store.indexOfRawIndex(t);
    }, r.prototype.rawIndexOf = function(t, e) {
      var n = t && this._invertedIndicesMap[t], i = n && n[e];
      return i == null || isNaN(i) ? Lx : i;
    }, r.prototype.indicesOfNearest = function(t, e, n) {
      return this._store.indicesOfNearest(this._getStoreDimIndex(t), e, n);
    }, r.prototype.each = function(t, e, n) {
      oe(t) && (n = e, e = t, t = []);
      var i = n || this, a = Ci(hl(t), this._getStoreDimIndex, this);
      this._store.each(a, i ? Q(e, i) : e);
    }, r.prototype.filterSelf = function(t, e, n) {
      oe(t) && (n = e, e = t, t = []);
      var i = n || this, a = Ci(hl(t), this._getStoreDimIndex, this);
      return this._store = this._store.filter(a, i ? Q(e, i) : e), this;
    }, r.prototype.selectRange = function(t) {
      var e = this, n = {}, i = Ee(t);
      return M(i, function(a) {
        var o = e._getStoreDimIndex(a);
        n[o] = t[a];
      }), this._store = this._store.selectRange(n), this;
    }, r.prototype.mapArray = function(t, e, n) {
      oe(t) && (n = e, e = t, t = []), n = n || this;
      var i = [];
      return this.each(t, function() {
        i.push(e && e.apply(this, arguments));
      }, n), i;
    }, r.prototype.map = function(t, e, n, i) {
      var a = n || i || this, o = Ci(hl(t), this._getStoreDimIndex, this), s = vl(this);
      return s._store = this._store.map(o, a ? Q(e, a) : e), s;
    }, r.prototype.modify = function(t, e, n, i) {
      var a = n || i || this, o = Ci(hl(t), this._getStoreDimIndex, this);
      this._store.modify(o, a ? Q(e, a) : e);
    }, r.prototype.downSample = function(t, e, n, i) {
      var a = vl(this);
      return a._store = this._store.downSample(this._getStoreDimIndex(t), e, n, i), a;
    }, r.prototype.minmaxDownSample = function(t, e) {
      var n = vl(this);
      return n._store = this._store.minmaxDownSample(this._getStoreDimIndex(t), e), n;
    }, r.prototype.lttbDownSample = function(t, e) {
      var n = vl(this);
      return n._store = this._store.lttbDownSample(this._getStoreDimIndex(t), e), n;
    }, r.prototype.getRawDataItem = function(t) {
      return this._store.getRawDataItem(t);
    }, r.prototype.getItemModel = function(t) {
      var e = this.hostModel, n = this.getRawDataItem(t);
      return new Ze(n, e, e && e.ecModel);
    }, r.prototype.diff = function(t) {
      var e = this;
      return new li(t ? t.getStore().getIndices() : [], this.getStore().getIndices(), function(n) {
        return Vc(t, n);
      }, function(n) {
        return Vc(e, n);
      });
    }, r.prototype.getVisual = function(t) {
      var e = this._visual;
      return e && e[t];
    }, r.prototype.setVisual = function(t, e) {
      this._visual = this._visual || {}, cl(t) ? H(this._visual, t) : this._visual[t] = e;
    }, r.prototype.getItemVisual = function(t, e) {
      var n = this._itemVisuals[t], i = n && n[e];
      return i ?? this.getVisual(e);
    }, r.prototype.hasItemVisual = function() {
      return this._itemVisuals.length > 0;
    }, r.prototype.ensureUniqueItemVisual = function(t, e) {
      var n = this._itemVisuals, i = n[t];
      i || (i = n[t] = {});
      var a = i[e];
      return a == null && (a = this.getVisual(e), q(a) ? a = a.slice() : cl(a) && (a = H({}, a)), i[e] = a), a;
    }, r.prototype.setItemVisual = function(t, e, n) {
      var i = this._itemVisuals[t] || {};
      this._itemVisuals[t] = i, cl(e) ? H(i, e) : i[e] = n;
    }, r.prototype.clearAllVisual = function() {
      this._visual = {}, this._itemVisuals = [];
    }, r.prototype.setLayout = function(t, e) {
      cl(t) ? H(this._layout, t) : this._layout[t] = e;
    }, r.prototype.getLayout = function(t) {
      return this._layout[t];
    }, r.prototype.getItemLayout = function(t) {
      return this._itemLayouts[t];
    }, r.prototype.setItemLayout = function(t, e, n) {
      this._itemLayouts[t] = n ? H(this._itemLayouts[t] || {}, e) : e;
    }, r.prototype.clearItemLayouts = function() {
      this._itemLayouts.length = 0;
    }, r.prototype.setItemGraphicEl = function(t, e) {
      var n = this.hostModel && this.hostModel.seriesIndex;
      um(n, this.dataType, t, e), this._graphicEls[t] = e;
    }, r.prototype.getItemGraphicEl = function(t) {
      return this._graphicEls[t];
    }, r.prototype.eachItemGraphicEl = function(t, e) {
      M(this._graphicEls, function(n, i) {
        n && t && t.call(e, n, i);
      });
    }, r.prototype.cloneShallow = function(t) {
      return t || (t = new r(this._schema ? this._schema : Ci(this.dimensions, this._getDimInfo, this), this.hostModel)), tp(t, this), t._store = this._store, t;
    }, r.prototype.wrapMethod = function(t, e) {
      var n = this[t];
      oe(n) && (this.__wrappedMethods = this.__wrappedMethods || [], this.__wrappedMethods.push(t), this[t] = function() {
        var i = n.apply(this, arguments);
        return e.apply(this, [i].concat(Xy(arguments)));
      });
    }, r.internalField = function() {
      Ex = function(t) {
        var e = t._invertedIndicesMap;
        M(e, function(n, i) {
          var a = t._dimInfos[i], o = a.ordinalMeta, s = t._store;
          if (o) {
            n = e[i] = new aG(o.categories.length);
            for (var l = 0; l < n.length; l++)
              n[l] = Lx;
            for (var l = 0; l < s.count(); l++)
              n[s.get(a.storeDimIndex, l)] = l;
          }
        });
      }, fl = function(t, e, n) {
        return bt(t._getCategory(e, n), null);
      }, Vc = function(t, e) {
        var n = t._idList[e];
        return n == null && t._idDimIdx != null && (n = fl(t, t._idDimIdx, e)), n == null && (n = oG + e), n;
      }, hl = function(t) {
        return q(t) || (t = t != null ? [t] : []), t;
      }, vl = function(t) {
        var e = new r(t._schema ? t._schema : Ci(t.dimensions, t._getDimInfo, t), t.hostModel);
        return tp(e, t), e;
      }, tp = function(t, e) {
        M(sG.concat(e.__wrappedMethods || []), function(n) {
          e.hasOwnProperty(n) && (t[n] = e[n]);
        }), t.__wrappedMethods = e.__wrappedMethods, M(lG, function(n) {
          t[n] = ce(e[n]);
        }), t._calculationInfo = H({}, e._calculationInfo);
      }, rp = function(t, e) {
        var n = t._nameList, i = t._idList, a = t._nameDimIdx, o = t._idDimIdx, s = n[e], l = i[e];
        if (s == null && a != null && (n[e] = s = fl(t, a, e)), l == null && o != null && (i[e] = l = fl(t, o, e)), l == null && s != null) {
          var u = t._nameRepeatCount, c = u[s] = (u[s] || 0) + 1;
          l = s, c > 1 && (l += "__ec__" + c), i[e] = l;
        }
      };
    }(), r;
  }()
);
function ju(r, t) {
  I0(r) || (r = L0(r)), t = t || {};
  var e = t.coordDimensions || [], n = t.dimensionsDefine || r.dimensionsDefine || [], i = re(), a = [], o = cG(r, e, n, t.dimensionsCount), s = t.canOmitUnusedDimensions && rL(o), l = n === r.dimensionsDefine, u = l ? tL(r) : eL(n), c = t.encodeDefine;
  !c && t.encodeDefaulter && (c = t.encodeDefaulter(r, o));
  for (var f = re(c), h = new uI(o), v = 0; v < h.length; v++)
    h[v] = -1;
  function d(D) {
    var A = h[D];
    if (A < 0) {
      var T = n[D], L = ue(T) ? T : {
        name: T
      }, E = new Ff(), I = L.name;
      I != null && u.get(I) != null && (E.name = E.displayName = I), L.type != null && (E.type = L.type), L.displayName != null && (E.displayName = L.displayName);
      var P = a.length;
      return h[D] = P, E.storeDimIndex = D, a.push(E), E;
    }
    return a[A];
  }
  if (!s)
    for (var v = 0; v < o; v++)
      d(v);
  f.each(function(D, A) {
    var T = je(D).slice();
    if (T.length === 1 && !J(T[0]) && T[0] < 0) {
      f.set(A, !1);
      return;
    }
    var L = f.set(A, []);
    M(T, function(E, I) {
      var P = J(E) ? u.get(E) : E;
      P != null && P < o && (L[I] = P, g(d(P), A, I));
    });
  });
  var p = 0;
  M(e, function(D) {
    var A, T, L, E;
    if (J(D))
      A = D, E = {};
    else {
      E = D, A = E.name;
      var I = E.ordinalMeta;
      E.ordinalMeta = null, E = H({}, E), E.ordinalMeta = I, T = E.dimsDef, L = E.otherDims, E.name = E.coordDim = E.coordDimIndex = E.dimsDef = E.otherDims = null;
    }
    var P = f.get(A);
    if (P !== !1) {
      if (P = je(P), !P.length)
        for (var R = 0; R < (T && T.length || 1); R++) {
          for (; p < o && d(p).coordDim != null; )
            p++;
          p < o && P.push(p++);
        }
      M(P, function(F, O) {
        var z = d(F);
        if (l && E.type != null && (z.type = E.type), g(se(z, E), A, O), z.name == null && T) {
          var G = T[O];
          !ue(G) && (G = {
            name: G
          }), z.name = z.displayName = G.name, z.defaultTooltip = G.defaultTooltip;
        }
        L && se(z.otherDims, L);
      });
    }
  });
  function g(D, A, T) {
    HM.get(A) != null ? D.otherDims[A] = T : (D.coordDim = A, D.coordDimIndex = T, i.set(A, !0));
  }
  var m = t.generateCoord, y = t.generateCoordCount, _ = y != null;
  y = m ? y || 1 : 0;
  var b = m || "value";
  function S(D) {
    D.name == null && (D.name = D.coordDim);
  }
  if (s)
    M(a, function(D) {
      S(D);
    }), a.sort(function(D, A) {
      return D.storeDimIndex - A.storeDimIndex;
    });
  else
    for (var x = 0; x < o; x++) {
      var w = d(x), C = w.coordDim;
      C == null && (w.coordDim = fG(b, i, _), w.coordDimIndex = 0, (!m || y <= 0) && (w.isExtraCoord = !0), y--), S(w), w.type == null && (YM(r, x) === kt.Must || w.isExtraCoord && (w.otherDims.itemName != null || w.otherDims.seriesName != null)) && (w.type = "ordinal");
    }
  return uG(a), new JI({
    source: r,
    dimensions: a,
    fullDimensionCount: o,
    dimensionOmitted: s
  });
}
function uG(r) {
  for (var t = re(), e = 0; e < r.length; e++) {
    var n = r[e], i = n.name, a = t.get(i) || 0;
    a > 0 && (n.name = i + (a - 1)), a++, t.set(i, a);
  }
}
function cG(r, t, e, n) {
  var i = Math.max(r.dimensionsDetectedCount || 1, t.length, e.length, n || 0);
  return M(t, function(a) {
    var o;
    ue(a) && (o = a.dimsDef) && (i = Math.max(i, o.length));
  }), i;
}
function fG(r, t, e) {
  if (e || t.hasKey(r)) {
    for (var n = 0; t.hasKey(r + n); )
      n++;
    r += n;
  }
  return t.set(r, !0), r;
}
var hG = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t) {
      this.coordSysDims = [], this.axisMap = re(), this.categoryAxisMap = re(), this.coordSysName = t;
    }
    return r;
  }()
);
function vG(r) {
  var t = r.get("coordinateSystem"), e = new hG(t), n = dG[t];
  if (n)
    return n(r, e, e.axisMap, e.categoryAxisMap), e;
}
var dG = {
  cartesian2d: function(r, t, e, n) {
    var i = r.getReferringComponents("xAxis", mt).models[0], a = r.getReferringComponents("yAxis", mt).models[0];
    t.coordSysDims = ["x", "y"], e.set("x", i), e.set("y", a), Ho(i) && (n.set("x", i), t.firstCategoryDimIndex = 0), Ho(a) && (n.set("y", a), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = 1));
  },
  singleAxis: function(r, t, e, n) {
    var i = r.getReferringComponents("singleAxis", mt).models[0];
    t.coordSysDims = ["single"], e.set("single", i), Ho(i) && (n.set("single", i), t.firstCategoryDimIndex = 0);
  },
  polar: function(r, t, e, n) {
    var i = r.getReferringComponents("polar", mt).models[0], a = i.findAxisModel("radiusAxis"), o = i.findAxisModel("angleAxis");
    t.coordSysDims = ["radius", "angle"], e.set("radius", a), e.set("angle", o), Ho(a) && (n.set("radius", a), t.firstCategoryDimIndex = 0), Ho(o) && (n.set("angle", o), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = 1));
  },
  geo: function(r, t, e, n) {
    t.coordSysDims = ["lng", "lat"];
  },
  parallel: function(r, t, e, n) {
    var i = r.ecModel, a = i.getComponent("parallel", r.get("parallelIndex")), o = t.coordSysDims = a.dimensions.slice();
    M(a.parallelAxisIndex, function(s, l) {
      var u = i.getComponent("parallelAxis", s), c = o[l];
      e.set(c, u), Ho(u) && (n.set(c, u), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = l));
    });
  }
};
function Ho(r) {
  return r.get("type") === "category";
}
function pG(r, t, e) {
  e = e || {};
  var n = e.byIndex, i = e.stackedCoordDimension, a, o, s;
  gG(t) ? a = t : (o = t.schema, a = o.dimensions, s = t.store);
  var l = !!(r && r.get("stack")), u, c, f, h;
  if (M(a, function(y, _) {
    J(y) && (a[_] = y = {
      name: y
    }), l && !y.isExtraCoord && (!n && !u && y.ordinalMeta && (u = y), !c && y.type !== "ordinal" && y.type !== "time" && (!i || i === y.coordDim) && (c = y));
  }), c && !n && !u && (n = !0), c) {
    f = "__\0ecstackresult_" + r.id, h = "__\0ecstackedover_" + r.id, u && (u.createInvertedIndices = !0);
    var v = c.coordDim, d = c.type, p = 0;
    M(a, function(y) {
      y.coordDim === v && p++;
    });
    var g = {
      name: f,
      coordDim: v,
      coordDimIndex: p,
      type: d,
      isExtraCoord: !0,
      isCalculationCoord: !0,
      storeDimIndex: a.length
    }, m = {
      name: h,
      // This dimension contains stack base (generally, 0), so do not set it as
      // `stackedDimCoordDim` to avoid extent calculation, consider log scale.
      coordDim: h,
      coordDimIndex: p + 1,
      type: d,
      isExtraCoord: !0,
      isCalculationCoord: !0,
      storeDimIndex: a.length + 1
    };
    o ? (s && (g.storeDimIndex = s.ensureCalculationDimension(h, d), m.storeDimIndex = s.ensureCalculationDimension(f, d)), o.appendCalculationDimension(g), o.appendCalculationDimension(m)) : (a.push(g), a.push(m));
  }
  return {
    stackedDimension: c && c.name,
    stackedByDimension: u && u.name,
    isStackedByIndex: n,
    stackedOverDimension: h,
    stackResultDimension: f
  };
}
function gG(r) {
  return !QI(r.schema);
}
function ea(r, t) {
  return !!t && t === r.getCalculationInfo("stackedDimension");
}
function nL(r, t) {
  return ea(r, t) ? r.getCalculationInfo("stackResultDimension") : t;
}
function mG(r, t) {
  var e = r.get("coordinateSystem"), n = Zu.get(e), i;
  return t && t.coordSysDims && (i = U(t.coordSysDims, function(a) {
    var o = {
      name: a
    }, s = t.axisMap.get(a);
    if (s) {
      var l = s.get("type");
      o.type = bh(l);
    }
    return o;
  })), i || (i = n && (n.getDimensionsInfo ? n.getDimensionsInfo() : n.dimensions.slice()) || ["x", "y"]), i;
}
function yG(r, t, e) {
  var n, i;
  return e && M(r, function(a, o) {
    var s = a.coordDim, l = e.categoryAxisMap.get(s);
    l && (n == null && (n = o), a.ordinalMeta = l.getOrdinalMeta(), t && (a.createInvertedIndices = !0)), a.otherDims.itemName != null && (i = !0);
  }), !i && n != null && (r[n].otherDims.itemName = 0), n;
}
function gi(r, t, e) {
  e = e || {};
  var n = t.getSourceManager(), i, a = !1;
  r ? (a = !0, i = L0(r)) : (i = n.getSource(), a = i.sourceFormat === Ur);
  var o = vG(t), s = mG(t, o), l = e.useEncodeDefaulter, u = oe(l) ? l : l ? ye(UM, s, t) : null, c = {
    coordDimensions: s,
    generateCoord: e.generateCoord,
    encodeDefine: t.getEncode(),
    encodeDefaulter: u,
    canOmitUnusedDimensions: !a
  }, f = ju(i, c), h = yG(f.dimensions, e.createInvertedIndices, o), v = a ? null : n.getSharedDataStore(f), d = pG(t, {
    schema: f,
    store: v
  }), p = new er(f, t);
  p.setCalculationInfo(d);
  var g = h != null && _G(i) ? function(m, y, _, b) {
    return b === h ? _ : this.defaultDimValueGetter(m, y, _, b);
  } : null;
  return p.hasItemOption = !1, p.initData(
    // Try to reuse the data store in sourceManager if using dataset.
    a ? i : v,
    null,
    g
  ), p;
}
function _G(r) {
  if (r.sourceFormat === Ur) {
    var t = bG(r.data || []);
    return !q(Es(t));
  }
}
function bG(r) {
  for (var t = 0; t < r.length && r[t] == null; )
    t++;
  return r[t];
}
var $n = (
  /** @class */
  function() {
    function r(t) {
      this._setting = t || {}, this._extent = [1 / 0, -1 / 0];
    }
    return r.prototype.getSetting = function(t) {
      return this._setting[t];
    }, r.prototype.unionExtent = function(t) {
      var e = this._extent;
      t[0] < e[0] && (e[0] = t[0]), t[1] > e[1] && (e[1] = t[1]);
    }, r.prototype.unionExtentFromData = function(t, e) {
      this.unionExtent(t.getApproximateExtent(e));
    }, r.prototype.getExtent = function() {
      return this._extent.slice();
    }, r.prototype.setExtent = function(t, e) {
      var n = this._extent;
      isNaN(t) || (n[0] = t), isNaN(e) || (n[1] = e);
    }, r.prototype.isInExtentRange = function(t) {
      return this._extent[0] <= t && this._extent[1] >= t;
    }, r.prototype.isBlank = function() {
      return this._isBlank;
    }, r.prototype.setBlank = function(t) {
      this._isBlank = t;
    }, r;
  }()
);
ov($n);
var SG = 0, Pm = (
  /** @class */
  function() {
    function r(t) {
      this.categories = t.categories || [], this._needCollect = t.needCollect, this._deduplication = t.deduplication, this.uid = ++SG;
    }
    return r.createByAxisModel = function(t) {
      var e = t.option, n = e.data, i = n && U(n, xG);
      return new r({
        categories: i,
        needCollect: !i,
        // deduplication is default in axis.
        deduplication: e.dedplication !== !1
      });
    }, r.prototype.getOrdinal = function(t) {
      return this._getOrCreateMap().get(t);
    }, r.prototype.parseAndCollect = function(t) {
      var e, n = this._needCollect;
      if (!J(t) && !n)
        return t;
      if (n && !this._deduplication)
        return e = this.categories.length, this.categories[e] = t, e;
      var i = this._getOrCreateMap();
      return e = i.get(t), e == null && (n ? (e = this.categories.length, this.categories[e] = t, i.set(t, e)) : e = NaN), e;
    }, r.prototype._getOrCreateMap = function() {
      return this._map || (this._map = re(this.categories));
    }, r;
  }()
);
function xG(r) {
  return ue(r) && r.value != null ? r.value : r + "";
}
function km(r) {
  return r.type === "interval" || r.type === "log";
}
function wG(r, t, e, n) {
  var i = {}, a = r[1] - r[0], o = i.interval = LT(a / t);
  e != null && o < e && (o = i.interval = e), n != null && o > n && (o = i.interval = n);
  var s = i.intervalPrecision = iL(o), l = i.niceTickExtent = [ht(Math.ceil(r[0] / o) * o, s), ht(Math.floor(r[1] / o) * o, s)];
  return CG(l, r), i;
}
function np(r) {
  var t = Math.pow(10, n0(r)), e = r / t;
  return e ? e === 2 ? e = 3 : e === 3 ? e = 5 : e *= 2 : e = 1, ht(e * t);
}
function iL(r) {
  return Dn(r) + 2;
}
function Px(r, t, e) {
  r[t] = Math.max(Math.min(r[t], e[1]), e[0]);
}
function CG(r, t) {
  !isFinite(r[0]) && (r[0] = t[0]), !isFinite(r[1]) && (r[1] = t[1]), Px(r, 0, t), Px(r, 1, t), r[0] > r[1] && (r[0] = r[1]);
}
function Tv(r, t) {
  return r >= t[0] && r <= t[1];
}
function Mv(r, t) {
  return t[1] === t[0] ? 0.5 : (r - t[0]) / (t[1] - t[0]);
}
function Iv(r, t) {
  return r * (t[1] - t[0]) + t[0];
}
var Lv = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      n.type = "ordinal";
      var i = n.getSetting("ordinalMeta");
      return i || (i = new Pm({})), q(i) && (i = new Pm({
        categories: U(i, function(a) {
          return ue(a) ? a.value : a;
        })
      })), n._ordinalMeta = i, n._extent = n.getSetting("extent") || [0, i.categories.length - 1], n;
    }
    return t.prototype.parse = function(e) {
      return e == null ? NaN : J(e) ? this._ordinalMeta.getOrdinal(e) : Math.round(e);
    }, t.prototype.contain = function(e) {
      return e = this.parse(e), Tv(e, this._extent) && this._ordinalMeta.categories[e] != null;
    }, t.prototype.normalize = function(e) {
      return e = this._getTickNumber(this.parse(e)), Mv(e, this._extent);
    }, t.prototype.scale = function(e) {
      return e = Math.round(Iv(e, this._extent)), this.getRawOrdinalNumber(e);
    }, t.prototype.getTicks = function() {
      for (var e = [], n = this._extent, i = n[0]; i <= n[1]; )
        e.push({
          value: i
        }), i++;
      return e;
    }, t.prototype.getMinorTicks = function(e) {
    }, t.prototype.setSortInfo = function(e) {
      if (e == null) {
        this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;
        return;
      }
      for (var n = e.ordinalNumbers, i = this._ordinalNumbersByTick = [], a = this._ticksByOrdinalNumber = [], o = 0, s = this._ordinalMeta.categories.length, l = Math.min(s, n.length); o < l; ++o) {
        var u = n[o];
        i[o] = u, a[u] = o;
      }
      for (var c = 0; o < s; ++o) {
        for (; a[c] != null; )
          c++;
        i.push(c), a[c] = o;
      }
    }, t.prototype._getTickNumber = function(e) {
      var n = this._ticksByOrdinalNumber;
      return n && e >= 0 && e < n.length ? n[e] : e;
    }, t.prototype.getRawOrdinalNumber = function(e) {
      var n = this._ordinalNumbersByTick;
      return n && e >= 0 && e < n.length ? n[e] : e;
    }, t.prototype.getLabel = function(e) {
      if (!this.isBlank()) {
        var n = this.getRawOrdinalNumber(e.value), i = this._ordinalMeta.categories[n];
        return i == null ? "" : i + "";
      }
    }, t.prototype.count = function() {
      return this._extent[1] - this._extent[0] + 1;
    }, t.prototype.unionExtentFromData = function(e, n) {
      this.unionExtent(e.getApproximateExtent(n));
    }, t.prototype.isInExtentRange = function(e) {
      return e = this._getTickNumber(e), this._extent[0] <= e && this._extent[1] >= e;
    }, t.prototype.getOrdinalMeta = function() {
      return this._ordinalMeta;
    }, t.prototype.calcNiceTicks = function() {
    }, t.prototype.calcNiceExtent = function() {
    }, t.type = "ordinal", t;
  }($n)
);
$n.registerClass(Lv);
var Ia = ht, ui = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "interval", e._interval = 0, e._intervalPrecision = 2, e;
    }
    return t.prototype.parse = function(e) {
      return e;
    }, t.prototype.contain = function(e) {
      return Tv(e, this._extent);
    }, t.prototype.normalize = function(e) {
      return Mv(e, this._extent);
    }, t.prototype.scale = function(e) {
      return Iv(e, this._extent);
    }, t.prototype.setExtent = function(e, n) {
      var i = this._extent;
      isNaN(e) || (i[0] = parseFloat(e)), isNaN(n) || (i[1] = parseFloat(n));
    }, t.prototype.unionExtent = function(e) {
      var n = this._extent;
      e[0] < n[0] && (n[0] = e[0]), e[1] > n[1] && (n[1] = e[1]), this.setExtent(n[0], n[1]);
    }, t.prototype.getInterval = function() {
      return this._interval;
    }, t.prototype.setInterval = function(e) {
      this._interval = e, this._niceExtent = this._extent.slice(), this._intervalPrecision = iL(e);
    }, t.prototype.getTicks = function(e) {
      var n = this._interval, i = this._extent, a = this._niceExtent, o = this._intervalPrecision, s = [];
      if (!n)
        return s;
      var l = 1e4;
      i[0] < a[0] && (e ? s.push({
        value: Ia(a[0] - n, o)
      }) : s.push({
        value: i[0]
      }));
      for (var u = a[0]; u <= a[1] && (s.push({
        value: u
      }), u = Ia(u + n, o), u !== s[s.length - 1].value); )
        if (s.length > l)
          return [];
      var c = s.length ? s[s.length - 1].value : a[1];
      return i[1] > c && (e ? s.push({
        value: Ia(c + n, o)
      }) : s.push({
        value: i[1]
      })), s;
    }, t.prototype.getMinorTicks = function(e) {
      for (var n = this.getTicks(!0), i = [], a = this.getExtent(), o = 1; o < n.length; o++) {
        for (var s = n[o], l = n[o - 1], u = 0, c = [], f = s.value - l.value, h = f / e; u < e - 1; ) {
          var v = Ia(l.value + (u + 1) * h);
          v > a[0] && v < a[1] && c.push(v), u++;
        }
        i.push(c);
      }
      return i;
    }, t.prototype.getLabel = function(e, n) {
      if (e == null)
        return "";
      var i = n && n.precision;
      i == null ? i = Dn(e.value) || 0 : i === "auto" && (i = this._intervalPrecision);
      var a = Ia(e.value, i, !0);
      return BM(a);
    }, t.prototype.calcNiceTicks = function(e, n, i) {
      e = e || 5;
      var a = this._extent, o = a[1] - a[0];
      if (isFinite(o)) {
        o < 0 && (o = -o, a.reverse());
        var s = wG(a, e, n, i);
        this._intervalPrecision = s.intervalPrecision, this._interval = s.interval, this._niceExtent = s.niceTickExtent;
      }
    }, t.prototype.calcNiceExtent = function(e) {
      var n = this._extent;
      if (n[0] === n[1])
        if (n[0] !== 0) {
          var i = Math.abs(n[0]);
          e.fixMax || (n[1] += i / 2), n[0] -= i / 2;
        } else
          n[1] = 1;
      var a = n[1] - n[0];
      isFinite(a) || (n[0] = 0, n[1] = 1), this.calcNiceTicks(e.splitNumber, e.minInterval, e.maxInterval);
      var o = this._interval;
      e.fixMin || (n[0] = Ia(Math.floor(n[0] / o) * o)), e.fixMax || (n[1] = Ia(Math.ceil(n[1] / o) * o));
    }, t.prototype.setNiceExtent = function(e, n) {
      this._niceExtent = [e, n];
    }, t.type = "interval", t;
  }($n)
);
$n.registerClass(ui);
var aL = typeof Float32Array < "u", AG = aL ? Float32Array : Array;
function Mn(r) {
  return q(r) ? aL ? new Float32Array(r) : r : new AG(r);
}
var Rm = "__ec_stack_";
function oL(r) {
  return r.get("stack") || Rm + r.seriesIndex;
}
function G0(r) {
  return r.dim + r.index;
}
function DG(r) {
  var t = [], e = r.axis, n = "axis0";
  if (e.type === "category") {
    for (var i = e.getBandWidth(), a = 0; a < r.count; a++)
      t.push(se({
        bandWidth: i,
        axisKey: n,
        stackId: Rm + a
      }, r));
    for (var o = uL(t), s = [], a = 0; a < r.count; a++) {
      var l = o[n][Rm + a];
      l.offsetCenter = l.offset + l.width / 2, s.push(l);
    }
    return s;
  }
}
function sL(r, t) {
  var e = [];
  return t.eachSeriesByType(r, function(n) {
    hL(n) && e.push(n);
  }), e;
}
function TG(r) {
  var t = {};
  M(r, function(l) {
    var u = l.coordinateSystem, c = u.getBaseAxis();
    if (!(c.type !== "time" && c.type !== "value"))
      for (var f = l.getData(), h = c.dim + "_" + c.index, v = f.getDimensionIndex(f.mapDimension(c.dim)), d = f.getStore(), p = 0, g = d.count(); p < g; ++p) {
        var m = d.get(v, p);
        t[h] ? t[h].push(m) : t[h] = [m];
      }
  });
  var e = {};
  for (var n in t)
    if (t.hasOwnProperty(n)) {
      var i = t[n];
      if (i) {
        i.sort(function(l, u) {
          return l - u;
        });
        for (var a = null, o = 1; o < i.length; ++o) {
          var s = i[o] - i[o - 1];
          s > 0 && (a = a === null ? s : Math.min(a, s));
        }
        e[n] = a;
      }
    }
  return e;
}
function lL(r) {
  var t = TG(r), e = [];
  return M(r, function(n) {
    var i = n.coordinateSystem, a = i.getBaseAxis(), o = a.getExtent(), s;
    if (a.type === "category")
      s = a.getBandWidth();
    else if (a.type === "value" || a.type === "time") {
      var l = a.dim + "_" + a.index, u = t[l], c = Math.abs(o[1] - o[0]), f = a.scale.getExtent(), h = Math.abs(f[1] - f[0]);
      s = u ? c / h * u : c;
    } else {
      var v = n.getData();
      s = Math.abs(o[1] - o[0]) / v.count();
    }
    var d = X(n.get("barWidth"), s), p = X(n.get("barMaxWidth"), s), g = X(
      // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,
      // the auto-calculated bar width might be less than 0.5 / 1.
      n.get("barMinWidth") || (vL(n) ? 0.5 : 1),
      s
    ), m = n.get("barGap"), y = n.get("barCategoryGap");
    e.push({
      bandWidth: s,
      barWidth: d,
      barMaxWidth: p,
      barMinWidth: g,
      barGap: m,
      barCategoryGap: y,
      axisKey: G0(a),
      stackId: oL(n)
    });
  }), uL(e);
}
function uL(r) {
  var t = {};
  M(r, function(n, i) {
    var a = n.axisKey, o = n.bandWidth, s = t[a] || {
      bandWidth: o,
      remainedWidth: o,
      autoWidthCount: 0,
      categoryGap: null,
      gap: "20%",
      stacks: {}
    }, l = s.stacks;
    t[a] = s;
    var u = n.stackId;
    l[u] || s.autoWidthCount++, l[u] = l[u] || {
      width: 0,
      maxWidth: 0
    };
    var c = n.barWidth;
    c && !l[u].width && (l[u].width = c, c = Math.min(s.remainedWidth, c), s.remainedWidth -= c);
    var f = n.barMaxWidth;
    f && (l[u].maxWidth = f);
    var h = n.barMinWidth;
    h && (l[u].minWidth = h);
    var v = n.barGap;
    v != null && (s.gap = v);
    var d = n.barCategoryGap;
    d != null && (s.categoryGap = d);
  });
  var e = {};
  return M(t, function(n, i) {
    e[i] = {};
    var a = n.stacks, o = n.bandWidth, s = n.categoryGap;
    if (s == null) {
      var l = Ee(a).length;
      s = Math.max(35 - l * 4, 15) + "%";
    }
    var u = X(s, o), c = X(n.gap, 1), f = n.remainedWidth, h = n.autoWidthCount, v = (f - u) / (h + (h - 1) * c);
    v = Math.max(v, 0), M(a, function(m) {
      var y = m.maxWidth, _ = m.minWidth;
      if (m.width) {
        var b = m.width;
        y && (b = Math.min(b, y)), _ && (b = Math.max(b, _)), m.width = b, f -= b + c * b, h--;
      } else {
        var b = v;
        y && y < b && (b = Math.min(y, f)), _ && _ > b && (b = _), b !== v && (m.width = b, f -= b + c * b, h--);
      }
    }), v = (f - u) / (h + (h - 1) * c), v = Math.max(v, 0);
    var d = 0, p;
    M(a, function(m, y) {
      m.width || (m.width = v), p = m, d += m.width * (1 + c);
    }), p && (d -= p.width * c);
    var g = -d / 2;
    M(a, function(m, y) {
      e[i][y] = e[i][y] || {
        bandWidth: o,
        offset: g,
        width: m.width
      }, g += m.width * (1 + c);
    });
  }), e;
}
function MG(r, t, e) {
  if (r && t) {
    var n = r[G0(t)];
    return n;
  }
}
function cL(r, t) {
  var e = sL(r, t), n = lL(e);
  M(e, function(i) {
    var a = i.getData(), o = i.coordinateSystem, s = o.getBaseAxis(), l = oL(i), u = n[G0(s)][l], c = u.offset, f = u.width;
    a.setLayout({
      bandWidth: u.bandWidth,
      offset: c,
      size: f
    });
  });
}
function fL(r) {
  return {
    seriesType: r,
    plan: zs(),
    reset: function(t) {
      if (hL(t)) {
        var e = t.getData(), n = t.coordinateSystem, i = n.getBaseAxis(), a = n.getOtherAxis(i), o = e.getDimensionIndex(e.mapDimension(a.dim)), s = e.getDimensionIndex(e.mapDimension(i.dim)), l = t.get("showBackground", !0), u = e.mapDimension(a.dim), c = e.getCalculationInfo("stackResultDimension"), f = ea(e, u) && !!e.getCalculationInfo("stackedOnSeries"), h = a.isHorizontal(), v = IG(i, a), d = vL(t), p = t.get("barMinHeight") || 0, g = c && e.getDimensionIndex(c), m = e.getLayout("size"), y = e.getLayout("offset");
        return {
          progress: function(_, b) {
            for (var S = _.count, x = d && Mn(S * 3), w = d && l && Mn(S * 3), C = d && Mn(S), D = n.master.getRect(), A = h ? D.width : D.height, T, L = b.getStore(), E = 0; (T = _.next()) != null; ) {
              var I = L.get(f ? g : o, T), P = L.get(s, T), R = v, F = void 0;
              f && (F = +I - L.get(o, T));
              var O = void 0, z = void 0, G = void 0, W = void 0;
              if (h) {
                var Y = n.dataToPoint([I, P]);
                if (f) {
                  var j = n.dataToPoint([F, P]);
                  R = j[0];
                }
                O = R, z = Y[1] + y, G = Y[0] - R, W = m, Math.abs(G) < p && (G = (G < 0 ? -1 : 1) * p);
              } else {
                var Y = n.dataToPoint([P, I]);
                if (f) {
                  var j = n.dataToPoint([P, F]);
                  R = j[1];
                }
                O = Y[0] + y, z = R, G = m, W = Y[1] - R, Math.abs(W) < p && (W = (W <= 0 ? -1 : 1) * p);
              }
              d ? (x[E] = O, x[E + 1] = z, x[E + 2] = h ? G : W, w && (w[E] = h ? D.x : O, w[E + 1] = h ? z : D.y, w[E + 2] = A), C[T] = T) : b.setItemLayout(T, {
                x: O,
                y: z,
                width: G,
                height: W
              }), E += 3;
            }
            d && b.setLayout({
              largePoints: x,
              largeDataIndices: C,
              largeBackgroundPoints: w,
              valueAxisHorizontal: h
            });
          }
        };
      }
    }
  };
}
function hL(r) {
  return r.coordinateSystem && r.coordinateSystem.type === "cartesian2d";
}
function vL(r) {
  return r.pipelineContext && r.pipelineContext.large;
}
function IG(r, t) {
  var e = t.model.get("startValue");
  return e || (e = 0), t.toGlobalCoord(t.dataToCoord(t.type === "log" ? e > 0 ? e : 1 : e));
}
var LG = function(r, t, e, n) {
  for (; e < n; ) {
    var i = e + n >>> 1;
    r[i][1] < t ? e = i + 1 : n = i;
  }
  return e;
}, H0 = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "time", n;
    }
    return t.prototype.getLabel = function(e) {
      var n = this.getSetting("useUTC");
      return mv(e.value, SS[fV(hs(this._minLevelUnit))] || SS.second, n, this.getSetting("locale"));
    }, t.prototype.getFormattedLabel = function(e, n, i) {
      var a = this.getSetting("useUTC"), o = this.getSetting("locale");
      return hV(e, n, i, o, a);
    }, t.prototype.getTicks = function() {
      var e = this._interval, n = this._extent, i = [];
      if (!e)
        return i;
      i.push({
        value: n[0],
        level: 0
      });
      var a = this.getSetting("useUTC"), o = BG(this._minLevelUnit, this._approxInterval, a, n);
      return i = i.concat(o), i.push({
        value: n[1],
        level: 0
      }), i;
    }, t.prototype.calcNiceExtent = function(e) {
      var n = this._extent;
      if (n[0] === n[1] && (n[0] -= $r, n[1] += $r), n[1] === -1 / 0 && n[0] === 1 / 0) {
        var i = /* @__PURE__ */ new Date();
        n[1] = +new Date(i.getFullYear(), i.getMonth(), i.getDate()), n[0] = n[1] - $r;
      }
      this.calcNiceTicks(e.splitNumber, e.minInterval, e.maxInterval);
    }, t.prototype.calcNiceTicks = function(e, n, i) {
      e = e || 10;
      var a = this._extent, o = a[1] - a[0];
      this._approxInterval = o / e, n != null && this._approxInterval < n && (this._approxInterval = n), i != null && this._approxInterval > i && (this._approxInterval = i);
      var s = $c.length, l = Math.min(LG($c, this._approxInterval, 0, s), s - 1);
      this._interval = $c[l][1], this._minLevelUnit = $c[Math.max(l - 1, 0)][0];
    }, t.prototype.parse = function(e) {
      return Be(e) ? e : +Fn(e);
    }, t.prototype.contain = function(e) {
      return Tv(this.parse(e), this._extent);
    }, t.prototype.normalize = function(e) {
      return Mv(this.parse(e), this._extent);
    }, t.prototype.scale = function(e) {
      return Iv(e, this._extent);
    }, t.type = "time", t;
  }(ui)
), $c = [
  // Format                           interval
  ["second", S0],
  ["minute", x0],
  ["hour", Kl],
  ["quarter-day", Kl * 6],
  ["half-day", Kl * 12],
  ["day", $r * 1.2],
  ["half-week", $r * 3.5],
  ["week", $r * 7],
  ["month", $r * 31],
  ["quarter", $r * 95],
  ["half-year", bS / 2],
  ["year", bS]
  // 1Y
];
function EG(r, t, e, n) {
  var i = Fn(t), a = Fn(e), o = function(d) {
    return xS(i, d, n) === xS(a, d, n);
  }, s = function() {
    return o("year");
  }, l = function() {
    return s() && o("month");
  }, u = function() {
    return l() && o("day");
  }, c = function() {
    return u() && o("hour");
  }, f = function() {
    return c() && o("minute");
  }, h = function() {
    return f() && o("second");
  }, v = function() {
    return h() && o("millisecond");
  };
  switch (r) {
    case "year":
      return s();
    case "month":
      return l();
    case "day":
      return u();
    case "hour":
      return c();
    case "minute":
      return f();
    case "second":
      return h();
    case "millisecond":
      return v();
  }
}
function PG(r, t) {
  return r /= $r, r > 16 ? 16 : r > 7.5 ? 7 : r > 3.5 ? 4 : r > 1.5 ? 2 : 1;
}
function kG(r) {
  var t = 30 * $r;
  return r /= t, r > 6 ? 6 : r > 3 ? 3 : r > 2 ? 2 : 1;
}
function RG(r) {
  return r /= Kl, r > 12 ? 12 : r > 6 ? 6 : r > 3.5 ? 4 : r > 2 ? 2 : 1;
}
function kx(r, t) {
  return r /= t ? x0 : S0, r > 30 ? 30 : r > 20 ? 20 : r > 15 ? 15 : r > 10 ? 10 : r > 5 ? 5 : r > 2 ? 2 : 1;
}
function OG(r) {
  return LT(r);
}
function FG(r, t, e) {
  var n = new Date(r);
  switch (hs(t)) {
    case "year":
    case "month":
      n[EM(e)](0);
    case "day":
      n[PM(e)](1);
    case "hour":
      n[kM(e)](0);
    case "minute":
      n[RM(e)](0);
    case "second":
      n[OM(e)](0), n[FM(e)](0);
  }
  return n.getTime();
}
function BG(r, t, e, n) {
  var i = 1e4, a = IM, o = 0;
  function s(A, T, L, E, I, P, R) {
    for (var F = new Date(T), O = T, z = F[E](); O < L && O <= n[1]; )
      R.push({
        value: O
      }), z += A, F[I](z), O = F.getTime();
    R.push({
      value: O,
      notAdd: !0
    });
  }
  function l(A, T, L) {
    var E = [], I = !T.length;
    if (!EG(hs(A), n[0], n[1], e)) {
      I && (T = [{
        // TODO Optimize. Not include so may ticks.
        value: FG(new Date(n[0]), A, e)
      }, {
        value: n[1]
      }]);
      for (var P = 0; P < T.length - 1; P++) {
        var R = T[P].value, F = T[P + 1].value;
        if (R !== F) {
          var O = void 0, z = void 0, G = void 0, W = !1;
          switch (A) {
            case "year":
              O = Math.max(1, Math.round(t / $r / 365)), z = w0(e), G = vV(e);
              break;
            case "half-year":
            case "quarter":
            case "month":
              O = kG(t), z = vs(e), G = EM(e);
              break;
            case "week":
            case "half-week":
            case "day":
              O = PG(t), z = yv(e), G = PM(e), W = !0;
              break;
            case "half-day":
            case "quarter-day":
            case "hour":
              O = RG(t), z = _u(e), G = kM(e);
              break;
            case "minute":
              O = kx(t, !0), z = _v(e), G = RM(e);
              break;
            case "second":
              O = kx(t, !1), z = bv(e), G = OM(e);
              break;
            case "millisecond":
              O = OG(t), z = Sv(e), G = FM(e);
              break;
          }
          s(O, R, F, z, G, W, E), A === "year" && L.length > 1 && P === 0 && L.unshift({
            value: L[0].value - O
          });
        }
      }
      for (var P = 0; P < E.length; P++)
        L.push(E[P]);
      return E;
    }
  }
  for (var u = [], c = [], f = 0, h = 0, v = 0; v < a.length && o++ < i; ++v) {
    var d = hs(a[v]);
    if (cV(a[v])) {
      l(a[v], u[u.length - 1] || [], c);
      var p = a[v + 1] ? hs(a[v + 1]) : null;
      if (d !== p) {
        if (c.length) {
          h = f, c.sort(function(A, T) {
            return A.value - T.value;
          });
          for (var g = [], m = 0; m < c.length; ++m) {
            var y = c[m].value;
            (m === 0 || c[m - 1].value !== y) && (g.push(c[m]), y >= n[0] && y <= n[1] && f++);
          }
          var _ = (n[1] - n[0]) / t;
          if (f > _ * 1.5 && h > _ / 1.5 || (u.push(g), f > _ || r === a[v]))
            break;
        }
        c = [];
      }
    }
  }
  for (var b = qe(U(u, function(A) {
    return qe(A, function(T) {
      return T.value >= n[0] && T.value <= n[1] && !T.notAdd;
    });
  }), function(A) {
    return A.length > 0;
  }), S = [], x = b.length - 1, v = 0; v < b.length; ++v)
    for (var w = b[v], C = 0; C < w.length; ++C)
      S.push({
        value: w[C].value,
        level: x - v
      });
  S.sort(function(A, T) {
    return A.value - T.value;
  });
  for (var D = [], v = 0; v < S.length; ++v)
    (v === 0 || S[v].value !== S[v - 1].value) && D.push(S[v]);
  return D;
}
$n.registerClass(H0);
var Rx = $n.prototype, tu = ui.prototype, NG = ht, zG = Math.floor, VG = Math.ceil, Gc = Math.pow, jr = Math.log, q0 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "log", e.base = 10, e._originalScale = new ui(), e._interval = 0, e;
    }
    return t.prototype.getTicks = function(e) {
      var n = this._originalScale, i = this._extent, a = n.getExtent(), o = tu.getTicks.call(this, e);
      return U(o, function(s) {
        var l = s.value, u = ht(Gc(this.base, l));
        return u = l === i[0] && this._fixMin ? Hc(u, a[0]) : u, u = l === i[1] && this._fixMax ? Hc(u, a[1]) : u, {
          value: u
        };
      }, this);
    }, t.prototype.setExtent = function(e, n) {
      var i = jr(this.base);
      e = jr(Math.max(0, e)) / i, n = jr(Math.max(0, n)) / i, tu.setExtent.call(this, e, n);
    }, t.prototype.getExtent = function() {
      var e = this.base, n = Rx.getExtent.call(this);
      n[0] = Gc(e, n[0]), n[1] = Gc(e, n[1]);
      var i = this._originalScale, a = i.getExtent();
      return this._fixMin && (n[0] = Hc(n[0], a[0])), this._fixMax && (n[1] = Hc(n[1], a[1])), n;
    }, t.prototype.unionExtent = function(e) {
      this._originalScale.unionExtent(e);
      var n = this.base;
      e[0] = jr(e[0]) / jr(n), e[1] = jr(e[1]) / jr(n), Rx.unionExtent.call(this, e);
    }, t.prototype.unionExtentFromData = function(e, n) {
      this.unionExtent(e.getApproximateExtent(n));
    }, t.prototype.calcNiceTicks = function(e) {
      e = e || 10;
      var n = this._extent, i = n[1] - n[0];
      if (!(i === 1 / 0 || i <= 0)) {
        var a = WB(i), o = e / i * a;
        for (o <= 0.5 && (a *= 10); !isNaN(a) && Math.abs(a) < 1 && Math.abs(a) > 0; )
          a *= 10;
        var s = [ht(VG(n[0] / a) * a), ht(zG(n[1] / a) * a)];
        this._interval = a, this._niceExtent = s;
      }
    }, t.prototype.calcNiceExtent = function(e) {
      tu.calcNiceExtent.call(this, e), this._fixMin = e.fixMin, this._fixMax = e.fixMax;
    }, t.prototype.parse = function(e) {
      return e;
    }, t.prototype.contain = function(e) {
      return e = jr(e) / jr(this.base), Tv(e, this._extent);
    }, t.prototype.normalize = function(e) {
      return e = jr(e) / jr(this.base), Mv(e, this._extent);
    }, t.prototype.scale = function(e) {
      return e = Iv(e, this._extent), Gc(this.base, e);
    }, t.type = "log", t;
  }($n)
), dL = q0.prototype;
dL.getMinorTicks = tu.getMinorTicks;
dL.getLabel = tu.getLabel;
function Hc(r, t) {
  return NG(r, Dn(t));
}
$n.registerClass(q0);
var $G = (
  /** @class */
  function() {
    function r(t, e, n) {
      this._prepareParams(t, e, n);
    }
    return r.prototype._prepareParams = function(t, e, n) {
      n[1] < n[0] && (n = [NaN, NaN]), this._dataMin = n[0], this._dataMax = n[1];
      var i = this._isOrdinal = t.type === "ordinal";
      this._needCrossZero = t.type === "interval" && e.getNeedCrossZero && e.getNeedCrossZero();
      var a = e.get("min", !0);
      a == null && (a = e.get("startValue", !0));
      var o = this._modelMinRaw = a;
      oe(o) ? this._modelMinNum = qc(t, o({
        min: n[0],
        max: n[1]
      })) : o !== "dataMin" && (this._modelMinNum = qc(t, o));
      var s = this._modelMaxRaw = e.get("max", !0);
      if (oe(s) ? this._modelMaxNum = qc(t, s({
        min: n[0],
        max: n[1]
      })) : s !== "dataMax" && (this._modelMaxNum = qc(t, s)), i)
        this._axisDataLen = e.getCategories().length;
      else {
        var l = e.get("boundaryGap"), u = q(l) ? l : [l || 0, l || 0];
        typeof u[0] == "boolean" || typeof u[1] == "boolean" ? this._boundaryGapInner = [0, 0] : this._boundaryGapInner = [ln(u[0], 1), ln(u[1], 1)];
      }
    }, r.prototype.calculate = function() {
      var t = this._isOrdinal, e = this._dataMin, n = this._dataMax, i = this._axisDataLen, a = this._boundaryGapInner, o = t ? null : n - e || Math.abs(e), s = this._modelMinRaw === "dataMin" ? e : this._modelMinNum, l = this._modelMaxRaw === "dataMax" ? n : this._modelMaxNum, u = s != null, c = l != null;
      s == null && (s = t ? i ? 0 : NaN : e - a[0] * o), l == null && (l = t ? i ? i - 1 : NaN : n + a[1] * o), (s == null || !isFinite(s)) && (s = NaN), (l == null || !isFinite(l)) && (l = NaN);
      var f = uu(s) || uu(l) || t && !i;
      this._needCrossZero && (s > 0 && l > 0 && !u && (s = 0), s < 0 && l < 0 && !c && (l = 0));
      var h = this._determinedMin, v = this._determinedMax;
      return h != null && (s = h, u = !0), v != null && (l = v, c = !0), {
        min: s,
        max: l,
        minFixed: u,
        maxFixed: c,
        isBlank: f
      };
    }, r.prototype.modifyDataMinMax = function(t, e) {
      this[HG[t]] = e;
    }, r.prototype.setDeterminedMinMax = function(t, e) {
      var n = GG[t];
      this[n] = e;
    }, r.prototype.freeze = function() {
      this.frozen = !0;
    }, r;
  }()
), GG = {
  min: "_determinedMin",
  max: "_determinedMax"
}, HG = {
  min: "_dataMin",
  max: "_dataMax"
};
function pL(r, t, e) {
  var n = r.rawExtentInfo;
  return n || (n = new $G(r, t, e), r.rawExtentInfo = n, n);
}
function qc(r, t) {
  return t == null ? null : uu(t) ? NaN : r.parse(t);
}
function gL(r, t) {
  var e = r.type, n = pL(r, t, r.getExtent()).calculate();
  r.setBlank(n.isBlank);
  var i = n.min, a = n.max, o = t.ecModel;
  if (o && e === "time") {
    var s = sL("bar", o), l = !1;
    if (M(s, function(f) {
      l = l || f.getBaseAxis() === t.axis;
    }), l) {
      var u = lL(s), c = qG(i, a, t, u);
      i = c.min, a = c.max;
    }
  }
  return {
    extent: [i, a],
    // "fix" means "fixed", the value should not be
    // changed in the subsequent steps.
    fixMin: n.minFixed,
    fixMax: n.maxFixed
  };
}
function qG(r, t, e, n) {
  var i = e.axis.getExtent(), a = Math.abs(i[1] - i[0]), o = MG(n, e.axis);
  if (o === void 0)
    return {
      min: r,
      max: t
    };
  var s = 1 / 0;
  M(o, function(v) {
    s = Math.min(v.offset, s);
  });
  var l = -1 / 0;
  M(o, function(v) {
    l = Math.max(v.offset + v.width, l);
  }), s = Math.abs(s), l = Math.abs(l);
  var u = s + l, c = t - r, f = 1 - (s + l) / a, h = c / f - c;
  return t += h * (l / u), r -= h * (s / u), {
    min: r,
    max: t
  };
}
function Ss(r, t) {
  var e = t, n = gL(r, e), i = n.extent, a = e.get("splitNumber");
  r instanceof q0 && (r.base = e.get("logBase"));
  var o = r.type, s = e.get("interval"), l = o === "interval" || o === "time";
  r.setExtent(i[0], i[1]), r.calcNiceExtent({
    splitNumber: a,
    fixMin: n.fixMin,
    fixMax: n.fixMax,
    minInterval: l ? e.get("minInterval") : null,
    maxInterval: l ? e.get("maxInterval") : null
  }), s != null && r.setInterval && r.setInterval(s);
}
function Ev(r, t) {
  if (t = t || r.get("type"), t)
    switch (t) {
      case "category":
        return new Lv({
          ordinalMeta: r.getOrdinalMeta ? r.getOrdinalMeta() : r.getCategories(),
          extent: [1 / 0, -1 / 0]
        });
      case "time":
        return new H0({
          locale: r.ecModel.getLocaleModel(),
          useUTC: r.ecModel.get("useUTC")
        });
      default:
        return new ($n.getClass(t) || ui)();
    }
}
function WG(r) {
  var t = r.scale.getExtent(), e = t[0], n = t[1];
  return !(e > 0 && n > 0 || e < 0 && n < 0);
}
function Gs(r) {
  var t = r.getLabelModel().get("formatter"), e = r.type === "category" ? r.scale.getExtent()[0] : null;
  return r.scale.type === "time" ? /* @__PURE__ */ function(n) {
    return function(i, a) {
      return r.scale.getFormattedLabel(i, a, n);
    };
  }(t) : J(t) ? /* @__PURE__ */ function(n) {
    return function(i) {
      var a = r.scale.getLabel(i), o = n.replace("{value}", a ?? "");
      return o;
    };
  }(t) : oe(t) ? /* @__PURE__ */ function(n) {
    return function(i, a) {
      return e != null && (a = i.value - e), n(W0(r, i), a, i.level != null ? {
        level: i.level
      } : null);
    };
  }(t) : function(n) {
    return r.scale.getLabel(n);
  };
}
function W0(r, t) {
  return r.type === "category" ? r.scale.getLabel(t) : t.value;
}
function UG(r) {
  var t = r.model, e = r.scale;
  if (!(!t.get(["axisLabel", "show"]) || e.isBlank())) {
    var n, i, a = e.getExtent();
    e instanceof Lv ? i = e.count() : (n = e.getTicks(), i = n.length);
    var o = r.getLabelModel(), s = Gs(r), l, u = 1;
    i > 40 && (u = Math.ceil(i / 40));
    for (var c = 0; c < i; c += u) {
      var f = n ? n[c] : {
        value: a[0] + c
      }, h = s(f, c), v = o.getTextRect(h), d = YG(v, o.get("rotate") || 0);
      l ? l.union(d) : l = d;
    }
    return l;
  }
}
function YG(r, t) {
  var e = t * Math.PI / 180, n = r.width, i = r.height, a = n * Math.abs(Math.cos(e)) + Math.abs(i * Math.sin(e)), o = n * Math.abs(Math.sin(e)) + Math.abs(i * Math.cos(e)), s = new xe(r.x, r.y, a, o);
  return s;
}
function U0(r) {
  var t = r.get("interval");
  return t ?? "auto";
}
function mL(r) {
  return r.type === "category" && U0(r.getLabelModel()) === 0;
}
function Sh(r, t) {
  var e = {};
  return M(r.mapDimensionsAll(t), function(n) {
    e[nL(r, n)] = !0;
  }), Ee(e);
}
function ZG(r, t, e) {
  t && M(Sh(t, e), function(n) {
    var i = t.getApproximateExtent(n);
    i[0] < r[0] && (r[0] = i[0]), i[1] > r[1] && (r[1] = i[1]);
  });
}
var Ku = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.getNeedCrossZero = function() {
      var t = this.option;
      return !t.scale;
    }, r.prototype.getCoordSysModel = function() {
    }, r;
  }()
), XG = 1e-8;
function Ox(r, t) {
  return Math.abs(r - t) < XG;
}
function Va(r, t, e) {
  var n = 0, i = r[0];
  if (!i)
    return !1;
  for (var a = 1; a < r.length; a++) {
    var o = r[a];
    n += Zn(i[0], i[1], o[0], o[1], t, e), i = o;
  }
  var s = r[0];
  return (!Ox(i[0], s[0]) || !Ox(i[1], s[1])) && (n += Zn(i[0], i[1], s[0], s[1], t, e)), n !== 0;
}
var jG = [];
function ip(r, t) {
  for (var e = 0; e < r.length; e++)
    Rt(r[e], r[e], t);
}
function Fx(r, t, e, n) {
  for (var i = 0; i < r.length; i++) {
    var a = r[i];
    n && (a = n.project(a)), a && isFinite(a[0]) && isFinite(a[1]) && (Oi(t, t, a), Fi(e, e, a));
  }
}
function KG(r) {
  for (var t = 0, e = 0, n = 0, i = r.length, a = r[i - 1][0], o = r[i - 1][1], s = 0; s < i; s++) {
    var l = r[s][0], u = r[s][1], c = a * u - l * o;
    t += c, e += (a + l) * c, n += (o + u) * c, a = l, o = u;
  }
  return t ? [e / t / 3, n / t / 3, t] : [r[0][0] || 0, r[0][1] || 0];
}
var yL = (
  /** @class */
  function() {
    function r(t) {
      this.name = t;
    }
    return r.prototype.setCenter = function(t) {
      this._center = t;
    }, r.prototype.getCenter = function() {
      var t = this._center;
      return t || (t = this._center = this.calcCenter()), t;
    }, r;
  }()
), Bx = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t, e) {
      this.type = "polygon", this.exterior = t, this.interiors = e;
    }
    return r;
  }()
), Nx = (
  /** @class */
  /* @__PURE__ */ function() {
    function r(t) {
      this.type = "linestring", this.points = t;
    }
    return r;
  }()
), _L = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this, e) || this;
      return a.type = "geoJSON", a.geometries = n, a._center = i && [i[0], i[1]], a;
    }
    return t.prototype.calcCenter = function() {
      for (var e = this.geometries, n, i = 0, a = 0; a < e.length; a++) {
        var o = e[a], s = o.exterior, l = s && s.length;
        l > i && (n = o, i = l);
      }
      if (n)
        return KG(n.exterior);
      var u = this.getBoundingRect();
      return [u.x + u.width / 2, u.y + u.height / 2];
    }, t.prototype.getBoundingRect = function(e) {
      var n = this._rect;
      if (n && !e)
        return n;
      var i = [1 / 0, 1 / 0], a = [-1 / 0, -1 / 0], o = this.geometries;
      return M(o, function(s) {
        s.type === "polygon" ? Fx(s.exterior, i, a, e) : M(s.points, function(l) {
          Fx(l, i, a, e);
        });
      }), isFinite(i[0]) && isFinite(i[1]) && isFinite(a[0]) && isFinite(a[1]) || (i[0] = i[1] = a[0] = a[1] = 0), n = new xe(i[0], i[1], a[0] - i[0], a[1] - i[1]), e || (this._rect = n), n;
    }, t.prototype.contain = function(e) {
      var n = this.getBoundingRect(), i = this.geometries;
      if (!n.contain(e[0], e[1]))
        return !1;
      e: for (var a = 0, o = i.length; a < o; a++) {
        var s = i[a];
        if (s.type === "polygon") {
          var l = s.exterior, u = s.interiors;
          if (Va(l, e[0], e[1])) {
            for (var c = 0; c < (u ? u.length : 0); c++)
              if (Va(u[c], e[0], e[1]))
                continue e;
            return !0;
          }
        }
      }
      return !1;
    }, t.prototype.transformTo = function(e, n, i, a) {
      var o = this.getBoundingRect(), s = o.width / o.height;
      i ? a || (a = i / s) : i = s * a;
      for (var l = new xe(e, n, i, a), u = o.calculateTransform(l), c = this.geometries, f = 0; f < c.length; f++) {
        var h = c[f];
        h.type === "polygon" ? (ip(h.exterior, u), M(h.interiors, function(v) {
          ip(v, u);
        })) : M(h.points, function(v) {
          ip(v, u);
        });
      }
      o = this._rect, o.copy(l), this._center = [o.x + o.width / 2, o.y + o.height / 2];
    }, t.prototype.cloneShallow = function(e) {
      e == null && (e = this.name);
      var n = new t(e, this.geometries, this._center);
      return n._rect = this._rect, n.transformTo = null, n;
    }, t;
  }(yL)
), JG = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n) {
      var i = r.call(this, e) || this;
      return i.type = "geoSVG", i._elOnlyForCalculate = n, i;
    }
    return t.prototype.calcCenter = function() {
      for (var e = this._elOnlyForCalculate, n = e.getBoundingRect(), i = [n.x + n.width / 2, n.y + n.height / 2], a = rv(jG), o = e; o && !o.isGeoSVGGraphicRoot; )
        ei(a, o.getLocalTransform(), a), o = o.parent;
      return Ls(a, a), Rt(i, i, a), i;
    }, t;
  }(yL)
);
function QG(r) {
  if (!r.UTF8Encoding)
    return r;
  var t = r, e = t.UTF8Scale;
  e == null && (e = 1024);
  var n = t.features;
  return M(n, function(i) {
    var a = i.geometry, o = a.encodeOffsets, s = a.coordinates;
    if (o)
      switch (a.type) {
        case "LineString":
          a.coordinates = bL(s, o, e);
          break;
        case "Polygon":
          ap(s, o, e);
          break;
        case "MultiLineString":
          ap(s, o, e);
          break;
        case "MultiPolygon":
          M(s, function(l, u) {
            return ap(l, o[u], e);
          });
      }
  }), t.UTF8Encoding = !1, t;
}
function ap(r, t, e) {
  for (var n = 0; n < r.length; n++)
    r[n] = bL(r[n], t[n], e);
}
function bL(r, t, e) {
  for (var n = [], i = t[0], a = t[1], o = 0; o < r.length; o += 2) {
    var s = r.charCodeAt(o) - 64, l = r.charCodeAt(o + 1) - 64;
    s = s >> 1 ^ -(s & 1), l = l >> 1 ^ -(l & 1), s += i, l += a, i = s, a = l, n.push([s / e, l / e]);
  }
  return n;
}
function e6(r, t) {
  return r = QG(r), U(qe(r.features, function(e) {
    return e.geometry && e.properties && e.geometry.coordinates.length > 0;
  }), function(e) {
    var n = e.properties, i = e.geometry, a = [];
    switch (i.type) {
      case "Polygon":
        var o = i.coordinates;
        a.push(new Bx(o[0], o.slice(1)));
        break;
      case "MultiPolygon":
        M(i.coordinates, function(l) {
          l[0] && a.push(new Bx(l[0], l.slice(1)));
        });
        break;
      case "LineString":
        a.push(new Nx([i.coordinates]));
        break;
      case "MultiLineString":
        a.push(new Nx(i.coordinates));
    }
    var s = new _L(n[t || "name"], a, n.cp);
    return s.properties = n, s;
  });
}
var Au = Oe();
function SL(r, t) {
  var e = U(t, function(n) {
    return r.scale.parse(n);
  });
  return r.type === "time" && e.length > 0 && (e.sort(), e.unshift(e[0]), e.push(e[e.length - 1])), e;
}
function t6(r) {
  var t = r.getLabelModel().get("customValues");
  if (t) {
    var e = Gs(r), n = r.scale.getExtent(), i = SL(r, t), a = qe(i, function(o) {
      return o >= n[0] && o <= n[1];
    });
    return {
      labels: U(a, function(o) {
        var s = {
          value: o
        };
        return {
          formattedLabel: e(s),
          rawLabel: r.scale.getLabel(s),
          tickValue: o
        };
      })
    };
  }
  return r.type === "category" ? n6(r) : a6(r);
}
function r6(r, t) {
  var e = r.getTickModel().get("customValues");
  if (e) {
    var n = r.scale.getExtent(), i = SL(r, e);
    return {
      ticks: qe(i, function(a) {
        return a >= n[0] && a <= n[1];
      })
    };
  }
  return r.type === "category" ? i6(r, t) : {
    ticks: U(r.scale.getTicks(), function(a) {
      return a.value;
    })
  };
}
function n6(r) {
  var t = r.getLabelModel(), e = xL(r, t);
  return !t.get("show") || r.scale.isBlank() ? {
    labels: [],
    labelCategoryInterval: e.labelCategoryInterval
  } : e;
}
function xL(r, t) {
  var e = wL(r, "labels"), n = U0(t), i = CL(e, n);
  if (i)
    return i;
  var a, o;
  return oe(n) ? a = TL(r, n) : (o = n === "auto" ? o6(r) : n, a = DL(r, o)), AL(e, n, {
    labels: a,
    labelCategoryInterval: o
  });
}
function i6(r, t) {
  var e = wL(r, "ticks"), n = U0(t), i = CL(e, n);
  if (i)
    return i;
  var a, o;
  if ((!t.get("show") || r.scale.isBlank()) && (a = []), oe(n))
    a = TL(r, n, !0);
  else if (n === "auto") {
    var s = xL(r, r.getLabelModel());
    o = s.labelCategoryInterval, a = U(s.labels, function(l) {
      return l.tickValue;
    });
  } else
    o = n, a = DL(r, o, !0);
  return AL(e, n, {
    ticks: a,
    tickCategoryInterval: o
  });
}
function a6(r) {
  var t = r.scale.getTicks(), e = Gs(r);
  return {
    labels: U(t, function(n, i) {
      return {
        level: n.level,
        formattedLabel: e(n, i),
        rawLabel: r.scale.getLabel(n),
        tickValue: n.value
      };
    })
  };
}
function wL(r, t) {
  return Au(r)[t] || (Au(r)[t] = []);
}
function CL(r, t) {
  for (var e = 0; e < r.length; e++)
    if (r[e].key === t)
      return r[e].value;
}
function AL(r, t, e) {
  return r.push({
    key: t,
    value: e
  }), e;
}
function o6(r) {
  var t = Au(r).autoInterval;
  return t ?? (Au(r).autoInterval = r.calculateCategoryInterval());
}
function s6(r) {
  var t = l6(r), e = Gs(r), n = (t.axisRotate - t.labelRotate) / 180 * Math.PI, i = r.scale, a = i.getExtent(), o = i.count();
  if (a[1] - a[0] < 1)
    return 0;
  var s = 1;
  o > 40 && (s = Math.max(1, Math.floor(o / 40)));
  for (var l = a[0], u = r.dataToCoord(l + 1) - r.dataToCoord(l), c = Math.abs(u * Math.cos(n)), f = Math.abs(u * Math.sin(n)), h = 0, v = 0; l <= a[1]; l += s) {
    var d = 0, p = 0, g = Vu(e({
      value: l
    }), t.font, "center", "top");
    d = g.width * 1.3, p = g.height * 1.3, h = Math.max(h, d, 7), v = Math.max(v, p, 7);
  }
  var m = h / c, y = v / f;
  isNaN(m) && (m = 1 / 0), isNaN(y) && (y = 1 / 0);
  var _ = Math.max(0, Math.floor(Math.min(m, y))), b = Au(r.model), S = r.getExtent(), x = b.lastAutoInterval, w = b.lastTickCount;
  return x != null && w != null && Math.abs(x - _) <= 1 && Math.abs(w - o) <= 1 && x > _ && b.axisExtent0 === S[0] && b.axisExtent1 === S[1] ? _ = x : (b.lastTickCount = o, b.lastAutoInterval = _, b.axisExtent0 = S[0], b.axisExtent1 = S[1]), _;
}
function l6(r) {
  var t = r.getLabelModel();
  return {
    axisRotate: r.getRotate ? r.getRotate() : r.isHorizontal && !r.isHorizontal() ? 90 : 0,
    labelRotate: t.get("rotate") || 0,
    font: t.getFont()
  };
}
function DL(r, t, e) {
  var n = Gs(r), i = r.scale, a = i.getExtent(), o = r.getLabelModel(), s = [], l = Math.max((t || 0) + 1, 1), u = a[0], c = i.count();
  u !== 0 && l > 1 && c / l > 2 && (u = Math.round(Math.ceil(u / l) * l));
  var f = mL(r), h = o.get("showMinLabel") || f, v = o.get("showMaxLabel") || f;
  h && u !== a[0] && p(a[0]);
  for (var d = u; d <= a[1]; d += l)
    p(d);
  v && d - l !== a[1] && p(a[1]);
  function p(g) {
    var m = {
      value: g
    };
    s.push(e ? g : {
      formattedLabel: n(m),
      rawLabel: i.getLabel(m),
      tickValue: g
    });
  }
  return s;
}
function TL(r, t, e) {
  var n = r.scale, i = Gs(r), a = [];
  return M(n.getTicks(), function(o) {
    var s = n.getLabel(o), l = o.value;
    t(o.value, s) && a.push(e ? l : {
      formattedLabel: i(o),
      rawLabel: s,
      tickValue: l
    });
  }), a;
}
var zx = [0, 1], hn = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.onBand = !1, this.inverse = !1, this.dim = t, this.scale = e, this._extent = n || [0, 0];
    }
    return r.prototype.contain = function(t) {
      var e = this._extent, n = Math.min(e[0], e[1]), i = Math.max(e[0], e[1]);
      return t >= n && t <= i;
    }, r.prototype.containData = function(t) {
      return this.scale.contain(t);
    }, r.prototype.getExtent = function() {
      return this._extent.slice();
    }, r.prototype.getPixelPrecision = function(t) {
      return MT(t || this.scale.getExtent(), this._extent);
    }, r.prototype.setExtent = function(t, e) {
      var n = this._extent;
      n[0] = t, n[1] = e;
    }, r.prototype.dataToCoord = function(t, e) {
      var n = this._extent, i = this.scale;
      return t = i.normalize(t), this.onBand && i.type === "ordinal" && (n = n.slice(), Vx(n, i.count())), Ye(t, zx, n, e);
    }, r.prototype.coordToData = function(t, e) {
      var n = this._extent, i = this.scale;
      this.onBand && i.type === "ordinal" && (n = n.slice(), Vx(n, i.count()));
      var a = Ye(t, n, zx, e);
      return this.scale.scale(a);
    }, r.prototype.pointToData = function(t, e) {
    }, r.prototype.getTicksCoords = function(t) {
      t = t || {};
      var e = t.tickModel || this.getTickModel(), n = r6(this, e), i = n.ticks, a = U(i, function(s) {
        return {
          coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(s) : s),
          tickValue: s
        };
      }, this), o = e.get("alignWithLabel");
      return u6(this, a, o, t.clamp), a;
    }, r.prototype.getMinorTicksCoords = function() {
      if (this.scale.type === "ordinal")
        return [];
      var t = this.model.getModel("minorTick"), e = t.get("splitNumber");
      e > 0 && e < 100 || (e = 5);
      var n = this.scale.getMinorTicks(e), i = U(n, function(a) {
        return U(a, function(o) {
          return {
            coord: this.dataToCoord(o),
            tickValue: o
          };
        }, this);
      }, this);
      return i;
    }, r.prototype.getViewLabels = function() {
      return t6(this).labels;
    }, r.prototype.getLabelModel = function() {
      return this.model.getModel("axisLabel");
    }, r.prototype.getTickModel = function() {
      return this.model.getModel("axisTick");
    }, r.prototype.getBandWidth = function() {
      var t = this._extent, e = this.scale.getExtent(), n = e[1] - e[0] + (this.onBand ? 1 : 0);
      n === 0 && (n = 1);
      var i = Math.abs(t[1] - t[0]);
      return Math.abs(i) / n;
    }, r.prototype.calculateCategoryInterval = function() {
      return s6(this);
    }, r;
  }()
);
function Vx(r, t) {
  var e = r[1] - r[0], n = t, i = e / n / 2;
  r[0] += i, r[1] -= i;
}
function u6(r, t, e, n) {
  var i = t.length;
  if (!r.onBand || e || !i)
    return;
  var a = r.getExtent(), o, s;
  if (i === 1)
    t[0].coord = a[0], o = t[1] = {
      coord: a[1],
      tickValue: t[0].tickValue
    };
  else {
    var l = t[i - 1].tickValue - t[0].tickValue, u = (t[i - 1].coord - t[0].coord) / l;
    M(t, function(v) {
      v.coord -= u / 2;
    });
    var c = r.scale.getExtent();
    s = 1 + c[1] - t[i - 1].tickValue, o = {
      coord: t[i - 1].coord + u * s,
      tickValue: c[1] + 1
    }, t.push(o);
  }
  var f = a[0] > a[1];
  h(t[0].coord, a[0]) && (n ? t[0].coord = a[0] : t.shift()), n && h(a[0], t[0].coord) && t.unshift({
    coord: a[0]
  }), h(a[1], o.coord) && (n ? o.coord = a[1] : t.pop()), n && h(o.coord, a[1]) && t.push({
    coord: a[1]
  });
  function h(v, d) {
    return v = ht(v), d = ht(d), f ? v > d : v < d;
  }
}
var dl = Math.PI * 2, La = Bn.CMD, c6 = ["top", "right", "bottom", "left"];
function f6(r, t, e, n, i) {
  var a = e.width, o = e.height;
  switch (r) {
    case "top":
      n.set(e.x + a / 2, e.y - t), i.set(0, -1);
      break;
    case "bottom":
      n.set(e.x + a / 2, e.y + o + t), i.set(0, 1);
      break;
    case "left":
      n.set(e.x - t, e.y + o / 2), i.set(-1, 0);
      break;
    case "right":
      n.set(e.x + a + t, e.y + o / 2), i.set(1, 0);
      break;
  }
}
function h6(r, t, e, n, i, a, o, s, l) {
  o -= r, s -= t;
  var u = Math.sqrt(o * o + s * s);
  o /= u, s /= u;
  var c = o * e + r, f = s * e + t;
  if (Math.abs(n - i) % dl < 1e-4)
    return l[0] = c, l[1] = f, u - e;
  if (a) {
    var h = n;
    n = xr(i), i = xr(h);
  } else
    n = xr(n), i = xr(i);
  n > i && (i += dl);
  var v = Math.atan2(s, o);
  if (v < 0 && (v += dl), v >= n && v <= i || v + dl >= n && v + dl <= i)
    return l[0] = c, l[1] = f, u - e;
  var d = e * Math.cos(n) + r, p = e * Math.sin(n) + t, g = e * Math.cos(i) + r, m = e * Math.sin(i) + t, y = (d - o) * (d - o) + (p - s) * (p - s), _ = (g - o) * (g - o) + (m - s) * (m - s);
  return y < _ ? (l[0] = d, l[1] = p, Math.sqrt(y)) : (l[0] = g, l[1] = m, Math.sqrt(_));
}
function xh(r, t, e, n, i, a, o, s) {
  var l = i - r, u = a - t, c = e - r, f = n - t, h = Math.sqrt(c * c + f * f);
  c /= h, f /= h;
  var v = l * c + u * f, d = v / h;
  s && (d = Math.min(Math.max(d, 0), 1)), d *= h;
  var p = o[0] = r + d * c, g = o[1] = t + d * f;
  return Math.sqrt((p - i) * (p - i) + (g - a) * (g - a));
}
function ML(r, t, e, n, i, a, o) {
  e < 0 && (r = r + e, e = -e), n < 0 && (t = t + n, n = -n);
  var s = r + e, l = t + n, u = o[0] = Math.min(Math.max(i, r), s), c = o[1] = Math.min(Math.max(a, t), l);
  return Math.sqrt((u - i) * (u - i) + (c - a) * (c - a));
}
var en = [];
function v6(r, t, e) {
  var n = ML(t.x, t.y, t.width, t.height, r.x, r.y, en);
  return e.set(en[0], en[1]), n;
}
function d6(r, t, e) {
  for (var n = 0, i = 0, a = 0, o = 0, s, l, u = 1 / 0, c = t.data, f = r.x, h = r.y, v = 0; v < c.length; ) {
    var d = c[v++];
    v === 1 && (n = c[v], i = c[v + 1], a = n, o = i);
    var p = u;
    switch (d) {
      case La.M:
        a = c[v++], o = c[v++], n = a, i = o;
        break;
      case La.L:
        p = xh(n, i, c[v], c[v + 1], f, h, en, !0), n = c[v++], i = c[v++];
        break;
      case La.C:
        p = cT(n, i, c[v++], c[v++], c[v++], c[v++], c[v], c[v + 1], f, h, en), n = c[v++], i = c[v++];
        break;
      case La.Q:
        p = hT(n, i, c[v++], c[v++], c[v], c[v + 1], f, h, en), n = c[v++], i = c[v++];
        break;
      case La.A:
        var g = c[v++], m = c[v++], y = c[v++], _ = c[v++], b = c[v++], S = c[v++];
        v += 1;
        var x = !!(1 - c[v++]);
        s = Math.cos(b) * y + g, l = Math.sin(b) * _ + m, v <= 1 && (a = s, o = l);
        var w = (f - g) * _ / y + g;
        p = h6(g, m, _, b, b + S, x, w, h, en), n = Math.cos(b + S) * y + g, i = Math.sin(b + S) * _ + m;
        break;
      case La.R:
        a = n = c[v++], o = i = c[v++];
        var C = c[v++], D = c[v++];
        p = ML(a, o, C, D, f, h, en);
        break;
      case La.Z:
        p = xh(n, i, a, o, f, h, en, !0), n = a, i = o;
        break;
    }
    p < u && (u = p, e.set(en[0], en[1]));
  }
  return u;
}
var rn = new Se(), rt = new Se(), vt = new Se(), In = new Se(), An = new Se();
function $x(r, t) {
  if (r) {
    var e = r.getTextGuideLine(), n = r.getTextContent();
    if (n && e) {
      var i = r.textGuideLineConfig || {}, a = [[0, 0], [0, 0], [0, 0]], o = i.candidates || c6, s = n.getBoundingRect().clone();
      s.applyTransform(n.getComputedTransform());
      var l = 1 / 0, u = i.anchor, c = r.getComputedTransform(), f = c && Ls([], c), h = t.get("length2") || 0;
      u && vt.copy(u);
      for (var v = 0; v < o.length; v++) {
        var d = o[v];
        f6(d, 0, s, rn, In), Se.scaleAndAdd(rt, rn, In, h), rt.transform(f);
        var p = r.getBoundingRect(), g = u ? u.distance(rt) : r instanceof Te ? d6(rt, r.path, vt) : v6(rt, p, vt);
        g < l && (l = g, rt.transform(c), vt.transform(c), vt.toArray(a[0]), rt.toArray(a[1]), rn.toArray(a[2]));
      }
      IL(a, t.get("minTurnAngle")), e.setShape({
        points: a
      });
    }
  }
}
var wh = [], Kt = new Se();
function IL(r, t) {
  if (t <= 180 && t > 0) {
    t = t / 180 * Math.PI, rn.fromArray(r[0]), rt.fromArray(r[1]), vt.fromArray(r[2]), Se.sub(In, rn, rt), Se.sub(An, vt, rt);
    var e = In.len(), n = An.len();
    if (!(e < 1e-3 || n < 1e-3)) {
      In.scale(1 / e), An.scale(1 / n);
      var i = In.dot(An), a = Math.cos(t);
      if (a < i) {
        var o = xh(rt.x, rt.y, vt.x, vt.y, rn.x, rn.y, wh, !1);
        Kt.fromArray(wh), Kt.scaleAndAdd(An, o / Math.tan(Math.PI - t));
        var s = vt.x !== rt.x ? (Kt.x - rt.x) / (vt.x - rt.x) : (Kt.y - rt.y) / (vt.y - rt.y);
        if (isNaN(s))
          return;
        s < 0 ? Se.copy(Kt, rt) : s > 1 && Se.copy(Kt, vt), Kt.toArray(r[1]);
      }
    }
  }
}
function p6(r, t, e) {
  if (e <= 180 && e > 0) {
    e = e / 180 * Math.PI, rn.fromArray(r[0]), rt.fromArray(r[1]), vt.fromArray(r[2]), Se.sub(In, rt, rn), Se.sub(An, vt, rt);
    var n = In.len(), i = An.len();
    if (!(n < 1e-3 || i < 1e-3)) {
      In.scale(1 / n), An.scale(1 / i);
      var a = In.dot(t), o = Math.cos(e);
      if (a < o) {
        var s = xh(rt.x, rt.y, vt.x, vt.y, rn.x, rn.y, wh, !1);
        Kt.fromArray(wh);
        var l = Math.PI / 2, u = Math.acos(An.dot(t)), c = l + u - e;
        if (c >= l)
          Se.copy(Kt, vt);
        else {
          Kt.scaleAndAdd(An, s / Math.tan(Math.PI / 2 - c));
          var f = vt.x !== rt.x ? (Kt.x - rt.x) / (vt.x - rt.x) : (Kt.y - rt.y) / (vt.y - rt.y);
          if (isNaN(f))
            return;
          f < 0 ? Se.copy(Kt, rt) : f > 1 && Se.copy(Kt, vt);
        }
        Kt.toArray(r[1]);
      }
    }
  }
}
function op(r, t, e, n) {
  var i = e === "normal", a = i ? r : r.ensureState(e);
  a.ignore = t;
  var o = n.get("smooth");
  o && o === !0 && (o = 0.3), a.shape = a.shape || {}, o > 0 && (a.shape.smooth = o);
  var s = n.getModel("lineStyle").getLineStyle();
  i ? r.useStyle(s) : a.style = s;
}
function g6(r, t) {
  var e = t.smooth, n = t.points;
  if (n)
    if (r.moveTo(n[0][0], n[0][1]), e > 0 && n.length >= 3) {
      var i = Ri(n[0], n[1]), a = Ri(n[1], n[2]);
      if (!i || !a) {
        r.lineTo(n[1][0], n[1][1]), r.lineTo(n[2][0], n[2][1]);
        return;
      }
      var o = Math.min(i, a) * e, s = Cf([], n[1], n[0], o / i), l = Cf([], n[1], n[2], o / a), u = Cf([], s, l, 0.5);
      r.bezierCurveTo(s[0], s[1], s[0], s[1], u[0], u[1]), r.bezierCurveTo(l[0], l[1], l[0], l[1], n[2][0], n[2][1]);
    } else
      for (var c = 1; c < n.length; c++)
        r.lineTo(n[c][0], n[c][1]);
}
function Y0(r, t, e) {
  var n = r.getTextGuideLine(), i = r.getTextContent();
  if (!i) {
    n && r.removeTextGuideLine();
    return;
  }
  for (var a = t.normal, o = a.get("show"), s = i.ignore, l = 0; l < gu.length; l++) {
    var u = gu[l], c = t[u], f = u === "normal";
    if (c) {
      var h = c.get("show"), v = f ? s : me(i.states[u] && i.states[u].ignore, s);
      if (v || !me(h, o)) {
        var d = f ? n : n && n.states[u];
        d && (d.ignore = !0), n && op(n, !0, u, c);
        continue;
      }
      n || (n = new sr(), r.setTextGuideLine(n), !f && (s || !o) && op(n, !0, "normal", t.normal), r.stateProxy && (n.stateProxy = r.stateProxy)), op(n, !1, u, c);
    }
  }
  if (n) {
    se(n.style, e), n.style.fill = null;
    var p = a.get("showAbove"), g = r.textGuideLineConfig = r.textGuideLineConfig || {};
    g.showAbove = p || !1, n.buildPath = g6;
  }
}
function Z0(r, t) {
  t = t || "labelLine";
  for (var e = {
    normal: r.getModel(t)
  }, n = 0; n < nr.length; n++) {
    var i = nr[n];
    e[i] = r.getModel([i, t]);
  }
  return e;
}
function LL(r) {
  for (var t = [], e = 0; e < r.length; e++) {
    var n = r[e];
    if (!n.defaultAttr.ignore) {
      var i = n.label, a = i.getComputedTransform(), o = i.getBoundingRect(), s = !a || a[1] < 1e-5 && a[2] < 1e-5, l = i.style.margin || 0, u = o.clone();
      u.applyTransform(a), u.x -= l / 2, u.y -= l / 2, u.width += l, u.height += l;
      var c = s ? new sh(o, a) : null;
      t.push({
        label: i,
        labelLine: n.labelLine,
        rect: u,
        localRect: o,
        obb: c,
        priority: n.priority,
        defaultAttr: n.defaultAttr,
        layoutOption: n.computedLayoutOption,
        axisAligned: s,
        transform: a
      });
    }
  }
  return t;
}
function EL(r, t, e, n, i, a) {
  var o = r.length;
  if (o < 2)
    return;
  r.sort(function(x, w) {
    return x.rect[t] - w.rect[t];
  });
  for (var s = 0, l, u = !1, c = 0; c < o; c++) {
    var f = r[c], h = f.rect;
    l = h[t] - s, l < 0 && (h[t] -= l, f.label[t] -= l, u = !0), s = h[t] + h[e];
  }
  var v = r[0], d = r[o - 1], p, g;
  m(), p < 0 && b(-p, 0.8), g < 0 && b(g, 0.8), m(), y(p, g, 1), y(g, p, -1), m(), p < 0 && S(-p), g < 0 && S(g);
  function m() {
    p = v.rect[t] - n, g = i - d.rect[t] - d.rect[e];
  }
  function y(x, w, C) {
    if (x < 0) {
      var D = Math.min(w, -x);
      if (D > 0) {
        _(D * C, 0, o);
        var A = D + x;
        A < 0 && b(-A * C, 1);
      } else
        b(-x * C, 1);
    }
  }
  function _(x, w, C) {
    x !== 0 && (u = !0);
    for (var D = w; D < C; D++) {
      var A = r[D], T = A.rect;
      T[t] += x, A.label[t] += x;
    }
  }
  function b(x, w) {
    for (var C = [], D = 0, A = 1; A < o; A++) {
      var T = r[A - 1].rect, L = Math.max(r[A].rect[t] - T[t] - T[e], 0);
      C.push(L), D += L;
    }
    if (D) {
      var E = Math.min(Math.abs(x) / D, w);
      if (x > 0)
        for (var A = 0; A < o - 1; A++) {
          var I = C[A] * E;
          _(I, 0, A + 1);
        }
      else
        for (var A = o - 1; A > 0; A--) {
          var I = C[A - 1] * E;
          _(-I, A, o);
        }
    }
  }
  function S(x) {
    var w = x < 0 ? -1 : 1;
    x = Math.abs(x);
    for (var C = Math.ceil(x / (o - 1)), D = 0; D < o - 1; D++)
      if (w > 0 ? _(C, 0, D + 1) : _(-C, o - D - 1, o), x -= C, x <= 0)
        return;
  }
  return u;
}
function m6(r, t, e, n) {
  return EL(r, "x", "width", t, e);
}
function PL(r, t, e, n) {
  return EL(r, "y", "height", t, e);
}
function kL(r) {
  var t = [];
  r.sort(function(p, g) {
    return g.priority - p.priority;
  });
  var e = new xe(0, 0, 0, 0);
  function n(p) {
    if (!p.ignore) {
      var g = p.ensureState("emphasis");
      g.ignore == null && (g.ignore = !1);
    }
    p.ignore = !0;
  }
  for (var i = 0; i < r.length; i++) {
    var a = r[i], o = a.axisAligned, s = a.localRect, l = a.transform, u = a.label, c = a.labelLine;
    e.copy(a.rect), e.width -= 0.1, e.height -= 0.1, e.x += 0.05, e.y += 0.05;
    for (var f = a.obb, h = !1, v = 0; v < t.length; v++) {
      var d = t[v];
      if (e.intersect(d.rect)) {
        if (o && d.axisAligned) {
          h = !0;
          break;
        }
        if (d.obb || (d.obb = new sh(d.localRect, d.transform)), f || (f = new sh(s, l)), f.intersect(d.obb)) {
          h = !0;
          break;
        }
      }
    }
    h ? (n(u), c && n(c)) : (u.attr("ignore", a.defaultAttr.ignore), c && c.attr("ignore", a.defaultAttr.labelGuideIgnore), t.push(a));
  }
}
function y6(r) {
  if (r) {
    for (var t = [], e = 0; e < r.length; e++)
      t.push(r[e].slice());
    return t;
  }
}
function _6(r, t) {
  var e = r.label, n = t && t.getTextGuideLine();
  return {
    dataIndex: r.dataIndex,
    dataType: r.dataType,
    seriesIndex: r.seriesModel.seriesIndex,
    text: r.label.style.text,
    rect: r.hostRect,
    labelRect: r.rect,
    // x: labelAttr.x,
    // y: labelAttr.y,
    align: e.style.align,
    verticalAlign: e.style.verticalAlign,
    labelLinePoints: y6(n && n.shape.points)
  };
}
var Gx = ["align", "verticalAlign", "width", "height", "fontSize"], Zt = new Kn(), sp = Oe(), b6 = Oe();
function Wc(r, t, e) {
  for (var n = 0; n < e.length; n++) {
    var i = e[n];
    t[i] != null && (r[i] = t[i]);
  }
}
var Uc = ["x", "y", "rotation"], S6 = (
  /** @class */
  function() {
    function r() {
      this._labelList = [], this._chartViewList = [];
    }
    return r.prototype.clearLabels = function() {
      this._labelList = [], this._chartViewList = [];
    }, r.prototype._addLabel = function(t, e, n, i, a) {
      var o = i.style, s = i.__hostTarget, l = s.textConfig || {}, u = i.getComputedTransform(), c = i.getBoundingRect().plain();
      xe.applyTransform(c, c, u), u ? Zt.setLocalTransform(u) : (Zt.x = Zt.y = Zt.rotation = Zt.originX = Zt.originY = 0, Zt.scaleX = Zt.scaleY = 1), Zt.rotation = xr(Zt.rotation);
      var f = i.__hostTarget, h;
      if (f) {
        h = f.getBoundingRect().plain();
        var v = f.getComputedTransform();
        xe.applyTransform(h, h, v);
      }
      var d = h && f.getTextGuideLine();
      this._labelList.push({
        label: i,
        labelLine: d,
        seriesModel: n,
        dataIndex: t,
        dataType: e,
        layoutOption: a,
        computedLayoutOption: null,
        rect: c,
        hostRect: h,
        // Label with lower priority will be hidden when overlapped
        // Use rect size as default priority
        priority: h ? h.width * h.height : 0,
        // Save default label attributes.
        // For restore if developers want get back to default value in callback.
        defaultAttr: {
          ignore: i.ignore,
          labelGuideIgnore: d && d.ignore,
          x: Zt.x,
          y: Zt.y,
          scaleX: Zt.scaleX,
          scaleY: Zt.scaleY,
          rotation: Zt.rotation,
          style: {
            x: o.x,
            y: o.y,
            align: o.align,
            verticalAlign: o.verticalAlign,
            width: o.width,
            height: o.height,
            fontSize: o.fontSize
          },
          cursor: i.cursor,
          attachedPos: l.position,
          attachedRot: l.rotation
        }
      });
    }, r.prototype.addLabelsOfSeries = function(t) {
      var e = this;
      this._chartViewList.push(t);
      var n = t.__model, i = n.get("labelLayout");
      (oe(i) || Ee(i).length) && t.group.traverse(function(a) {
        if (a.ignore)
          return !0;
        var o = a.getTextContent(), s = pe(a);
        o && !o.disableLabelLayout && e._addLabel(s.dataIndex, s.dataType, n, o, i);
      });
    }, r.prototype.updateLayoutConfig = function(t) {
      var e = t.getWidth(), n = t.getHeight();
      function i(_, b) {
        return function() {
          $x(_, b);
        };
      }
      for (var a = 0; a < this._labelList.length; a++) {
        var o = this._labelList[a], s = o.label, l = s.__hostTarget, u = o.defaultAttr, c = void 0;
        oe(o.layoutOption) ? c = o.layoutOption(_6(o, l)) : c = o.layoutOption, c = c || {}, o.computedLayoutOption = c;
        var f = Math.PI / 180;
        l && l.setTextConfig({
          // Force to set local false.
          local: !1,
          // Ignore position and rotation config on the host el if x or y is changed.
          position: c.x != null || c.y != null ? null : u.attachedPos,
          // Ignore rotation config on the host el if rotation is changed.
          rotation: c.rotate != null ? c.rotate * f : u.attachedRot,
          offset: [c.dx || 0, c.dy || 0]
        });
        var h = !1;
        if (c.x != null ? (s.x = X(c.x, e), s.setStyle("x", 0), h = !0) : (s.x = u.x, s.setStyle("x", u.style.x)), c.y != null ? (s.y = X(c.y, n), s.setStyle("y", 0), h = !0) : (s.y = u.y, s.setStyle("y", u.style.y)), c.labelLinePoints) {
          var v = l.getTextGuideLine();
          v && (v.setShape({
            points: c.labelLinePoints
          }), h = !1);
        }
        var d = sp(s);
        d.needsUpdateLabelLine = h, s.rotation = c.rotate != null ? c.rotate * f : u.rotation, s.scaleX = u.scaleX, s.scaleY = u.scaleY;
        for (var p = 0; p < Gx.length; p++) {
          var g = Gx[p];
          s.setStyle(g, c[g] != null ? c[g] : u.style[g]);
        }
        if (c.draggable) {
          if (s.draggable = !0, s.cursor = "move", l) {
            var m = o.seriesModel;
            if (o.dataIndex != null) {
              var y = o.seriesModel.getData(o.dataType);
              m = y.getItemModel(o.dataIndex);
            }
            s.on("drag", i(l, m.getModel("labelLine")));
          }
        } else
          s.off("drag"), s.cursor = u.cursor;
      }
    }, r.prototype.layout = function(t) {
      var e = t.getWidth(), n = t.getHeight(), i = LL(this._labelList), a = qe(i, function(l) {
        return l.layoutOption.moveOverlap === "shiftX";
      }), o = qe(i, function(l) {
        return l.layoutOption.moveOverlap === "shiftY";
      });
      m6(a, 0, e), PL(o, 0, n);
      var s = qe(i, function(l) {
        return l.layoutOption.hideOverlap;
      });
      kL(s);
    }, r.prototype.processLabelsOverall = function() {
      var t = this;
      M(this._chartViewList, function(e) {
        var n = e.__model, i = e.ignoreLabelLineUpdate, a = n.isAnimationEnabled();
        e.group.traverse(function(o) {
          if (o.ignore && !o.forceLabelAnimation)
            return !0;
          var s = !i, l = o.getTextContent();
          !s && l && (s = sp(l).needsUpdateLabelLine), s && t._updateLabelLine(o, n), a && t._animateLabels(o, n);
        });
      });
    }, r.prototype._updateLabelLine = function(t, e) {
      var n = t.getTextContent(), i = pe(t), a = i.dataIndex;
      if (n && a != null) {
        var o = e.getData(i.dataType), s = o.getItemModel(a), l = {}, u = o.getItemVisual(a, "style");
        if (u) {
          var c = o.getVisual("drawType");
          l.stroke = u[c];
        }
        var f = s.getModel("labelLine");
        Y0(t, Z0(s), l), $x(t, f);
      }
    }, r.prototype._animateLabels = function(t, e) {
      var n = t.getTextContent(), i = t.getTextGuideLine();
      if (n && (t.forceLabelAnimation || !n.ignore && !n.invisible && !t.disableLabelAnimation && !cs(t))) {
        var a = sp(n), o = a.oldLayout, s = pe(t), l = s.dataIndex, u = {
          x: n.x,
          y: n.y,
          rotation: n.rotation
        }, c = e.getData(s.dataType);
        if (o) {
          n.attr(o);
          var h = t.prevStates;
          h && (we(h, "select") >= 0 && n.attr(a.oldLayoutSelect), we(h, "emphasis") >= 0 && n.attr(a.oldLayoutEmphasis)), Ne(n, u, e, l);
        } else if (n.attr(u), !Rs(n).valueAnimation) {
          var f = me(n.style.opacity, 1);
          n.style.opacity = 0, st(n, {
            style: {
              opacity: f
            }
          }, e, l);
        }
        if (a.oldLayout = u, n.states.select) {
          var v = a.oldLayoutSelect = {};
          Wc(v, u, Uc), Wc(v, n.states.select, Uc);
        }
        if (n.states.emphasis) {
          var d = a.oldLayoutEmphasis = {};
          Wc(d, u, Uc), Wc(d, n.states.emphasis, Uc);
        }
        CM(n, l, c, e, e);
      }
      if (i && !i.ignore && !i.invisible) {
        var a = b6(i), o = a.oldLayout, p = {
          points: i.shape.points
        };
        o ? (i.attr({
          shape: o
        }), Ne(i, {
          shape: p
        }, e)) : (i.setShape(p), i.style.strokePercent = 0, st(i, {
          style: {
            strokePercent: 1
          }
        }, e)), a.oldLayout = p;
      }
    }, r;
  }()
), lp = Oe();
function x6(r) {
  r.registerUpdateLifecycle("series:beforeupdate", function(t, e, n) {
    var i = lp(e).labelManager;
    i || (i = lp(e).labelManager = new S6()), i.clearLabels();
  }), r.registerUpdateLifecycle("series:layoutlabels", function(t, e, n) {
    var i = lp(e).labelManager;
    n.updatedSeries.forEach(function(a) {
      i.addLabelsOfSeries(e.getViewOfSeriesModel(a));
    }), i.updateLayoutConfig(e), i.layout(e), i.processLabelsOverall();
  });
}
var up = Math.sin, cp = Math.cos, RL = Math.PI, Ea = Math.PI * 2, w6 = 180 / RL, OL = function() {
  function r() {
  }
  return r.prototype.reset = function(t) {
    this._start = !0, this._d = [], this._str = "", this._p = Math.pow(10, t || 4);
  }, r.prototype.moveTo = function(t, e) {
    this._add("M", t, e);
  }, r.prototype.lineTo = function(t, e) {
    this._add("L", t, e);
  }, r.prototype.bezierCurveTo = function(t, e, n, i, a, o) {
    this._add("C", t, e, n, i, a, o);
  }, r.prototype.quadraticCurveTo = function(t, e, n, i) {
    this._add("Q", t, e, n, i);
  }, r.prototype.arc = function(t, e, n, i, a, o) {
    this.ellipse(t, e, n, n, 0, i, a, o);
  }, r.prototype.ellipse = function(t, e, n, i, a, o, s, l) {
    var u = s - o, c = !l, f = Math.abs(u), h = zi(f - Ea) || (c ? u >= Ea : -u >= Ea), v = u > 0 ? u % Ea : u % Ea + Ea, d = !1;
    h ? d = !0 : zi(f) ? d = !1 : d = v >= RL == !!c;
    var p = t + n * cp(o), g = e + i * up(o);
    this._start && this._add("M", p, g);
    var m = Math.round(a * w6);
    if (h) {
      var y = 1 / this._p, _ = (c ? 1 : -1) * (Ea - y);
      this._add("A", n, i, m, 1, +c, t + n * cp(o + _), e + i * up(o + _)), y > 0.01 && this._add("A", n, i, m, 0, +c, p, g);
    } else {
      var b = t + n * cp(s), S = e + i * up(s);
      this._add("A", n, i, m, +d, +c, b, S);
    }
  }, r.prototype.rect = function(t, e, n, i) {
    this._add("M", t, e), this._add("l", n, 0), this._add("l", 0, i), this._add("l", -n, 0), this._add("Z");
  }, r.prototype.closePath = function() {
    this._d.length > 0 && this._add("Z");
  }, r.prototype._add = function(t, e, n, i, a, o, s, l, u) {
    for (var c = [], f = this._p, h = 1; h < arguments.length; h++) {
      var v = arguments[h];
      if (isNaN(v)) {
        this._invalid = !0;
        return;
      }
      c.push(Math.round(v * f) / f);
    }
    this._d.push(t + c.join(" ")), this._start = t === "Z";
  }, r.prototype.generateStr = function() {
    this._str = this._invalid ? "" : this._d.join(""), this._d = [];
  }, r.prototype.getStr = function() {
    return this._str;
  }, r;
}(), X0 = "none", C6 = Math.round;
function A6(r) {
  var t = r.fill;
  return t != null && t !== X0;
}
function D6(r) {
  var t = r.stroke;
  return t != null && t !== X0;
}
var Om = ["lineCap", "miterLimit", "lineJoin"], T6 = U(Om, function(r) {
  return "stroke-" + r.toLowerCase();
});
function M6(r, t, e, n) {
  var i = t.opacity == null ? 1 : t.opacity;
  if (e instanceof Pt) {
    r("opacity", i);
    return;
  }
  if (A6(t)) {
    var a = vu(t.fill);
    r("fill", a.color);
    var o = t.fillOpacity != null ? t.fillOpacity * a.opacity * i : a.opacity * i;
    o < 1 && r("fill-opacity", o);
  } else
    r("fill", X0);
  if (D6(t)) {
    var s = vu(t.stroke);
    r("stroke", s.color);
    var l = t.strokeNoScale ? e.getLineScale() : 1, u = l ? (t.lineWidth || 0) / l : 0, c = t.strokeOpacity != null ? t.strokeOpacity * s.opacity * i : s.opacity * i, f = t.strokeFirst;
    if (u !== 1 && r("stroke-width", u), f && r("paint-order", f ? "stroke" : "fill"), c < 1 && r("stroke-opacity", c), t.lineDash) {
      var h = O0(e), v = h[0], d = h[1];
      v && (d = C6(d || 0), r("stroke-dasharray", v.join(",")), (d || n) && r("stroke-dashoffset", d));
    }
    for (var p = 0; p < Om.length; p++) {
      var g = Om[p];
      if (t[g] !== ah[g]) {
        var m = t[g] || ah[g];
        m && r(T6[p], m);
      }
    }
  }
}
var FL = "http://www.w3.org/2000/svg", BL = "http://www.w3.org/1999/xlink", I6 = "http://www.w3.org/2000/xmlns/", L6 = "http://www.w3.org/XML/1998/namespace", Hx = "ecmeta_";
function NL(r) {
  return document.createElementNS(FL, r);
}
function At(r, t, e, n, i) {
  return {
    tag: r,
    attrs: e || {},
    children: n,
    text: i,
    key: t
  };
}
function E6(r, t) {
  var e = [];
  if (t)
    for (var n in t) {
      var i = t[n], a = n;
      i !== !1 && (i !== !0 && i != null && (a += '="' + i + '"'), e.push(a));
    }
  return "<" + r + " " + e.join(" ") + ">";
}
function P6(r) {
  return "</" + r + ">";
}
function j0(r, t) {
  t = t || {};
  var e = t.newline ? `
` : "";
  function n(i) {
    var a = i.children, o = i.tag, s = i.attrs, l = i.text;
    return E6(o, s) + (o !== "style" ? Jt(l) : l || "") + (a ? "" + e + U(a, function(u) {
      return n(u);
    }).join(e) + e : "") + P6(o);
  }
  return n(r);
}
function k6(r, t, e) {
  e = e || {};
  var n = e.newline ? `
` : "", i = " {" + n, a = n + "}", o = U(Ee(r), function(l) {
    return l + i + U(Ee(r[l]), function(u) {
      return u + ":" + r[l][u] + ";";
    }).join(n) + a;
  }).join(n), s = U(Ee(t), function(l) {
    return "@keyframes " + l + i + U(Ee(t[l]), function(u) {
      return u + i + U(Ee(t[l][u]), function(c) {
        var f = t[l][u][c];
        return c === "d" && (f = 'path("' + f + '")'), c + ":" + f + ";";
      }).join(n) + a;
    }).join(n) + a;
  }).join(n);
  return !o && !s ? "" : ["<![CDATA[", o, s, "]]>"].join(n);
}
function Fm(r) {
  return {
    zrId: r,
    shadowCache: {},
    patternCache: {},
    gradientCache: {},
    clipPathCache: {},
    defs: {},
    cssNodes: {},
    cssAnims: {},
    cssStyleCache: {},
    cssAnimIdx: 0,
    shadowIdx: 0,
    gradientIdx: 0,
    patternIdx: 0,
    clipPathIdx: 0
  };
}
function qx(r, t, e, n) {
  return At("svg", "root", {
    width: r,
    height: t,
    xmlns: FL,
    "xmlns:xlink": BL,
    version: "1.1",
    baseProfile: "full",
    viewBox: n ? "0 0 " + r + " " + t : !1
  }, e);
}
var R6 = 0;
function zL() {
  return R6++;
}
var Wx = {
  cubicIn: "0.32,0,0.67,0",
  cubicOut: "0.33,1,0.68,1",
  cubicInOut: "0.65,0,0.35,1",
  quadraticIn: "0.11,0,0.5,0",
  quadraticOut: "0.5,1,0.89,1",
  quadraticInOut: "0.45,0,0.55,1",
  quarticIn: "0.5,0,0.75,0",
  quarticOut: "0.25,1,0.5,1",
  quarticInOut: "0.76,0,0.24,1",
  quinticIn: "0.64,0,0.78,0",
  quinticOut: "0.22,1,0.36,1",
  quinticInOut: "0.83,0,0.17,1",
  sinusoidalIn: "0.12,0,0.39,0",
  sinusoidalOut: "0.61,1,0.88,1",
  sinusoidalInOut: "0.37,0,0.63,1",
  exponentialIn: "0.7,0,0.84,0",
  exponentialOut: "0.16,1,0.3,1",
  exponentialInOut: "0.87,0,0.13,1",
  circularIn: "0.55,0,1,0.45",
  circularOut: "0,0.55,0.45,1",
  circularInOut: "0.85,0,0.15,1"
}, Ra = "transform-origin";
function O6(r, t, e) {
  var n = H({}, r.shape);
  H(n, t), r.buildPath(e, n);
  var i = new OL();
  return i.reset(_T(r)), e.rebuildPath(i, 1), i.generateStr(), i.getStr();
}
function F6(r, t) {
  var e = t.originX, n = t.originY;
  (e || n) && (r[Ra] = e + "px " + n + "px");
}
var B6 = {
  fill: "fill",
  opacity: "opacity",
  lineWidth: "stroke-width",
  lineDashOffset: "stroke-dashoffset"
};
function VL(r, t) {
  var e = t.zrId + "-ani-" + t.cssAnimIdx++;
  return t.cssAnims[e] = r, e;
}
function N6(r, t, e) {
  var n = r.shape.paths, i = {}, a, o;
  if (M(n, function(l) {
    var u = Fm(e.zrId);
    u.animation = !0, Pv(l, {}, u, !0);
    var c = u.cssAnims, f = u.cssNodes, h = Ee(c), v = h.length;
    if (v) {
      o = h[v - 1];
      var d = c[o];
      for (var p in d) {
        var g = d[p];
        i[p] = i[p] || { d: "" }, i[p].d += g.d || "";
      }
      for (var m in f) {
        var y = f[m].animation;
        y.indexOf(o) >= 0 && (a = y);
      }
    }
  }), !!a) {
    t.d = !1;
    var s = VL(i, e);
    return a.replace(o, s);
  }
}
function Ux(r) {
  return J(r) ? Wx[r] ? "cubic-bezier(" + Wx[r] + ")" : e0(r) ? r : "" : "";
}
function Pv(r, t, e, n) {
  var i = r.animators, a = i.length, o = [];
  if (r instanceof p0) {
    var s = N6(r, t, e);
    if (s)
      o.push(s);
    else if (!a)
      return;
  } else if (!a)
    return;
  for (var l = {}, u = 0; u < a; u++) {
    var c = i[u], f = [c.getMaxTime() / 1e3 + "s"], h = Ux(c.getClip().easing), v = c.getDelay();
    h ? f.push(h) : f.push("linear"), v && f.push(v / 1e3 + "s"), c.getLoop() && f.push("infinite");
    var d = f.join(" ");
    l[d] = l[d] || [d, []], l[d][1].push(c);
  }
  function p(y) {
    var _ = y[1], b = _.length, S = {}, x = {}, w = {}, C = "animation-timing-function";
    function D(ve, ae, be) {
      for (var ne = ve.getTracks(), de = ve.getMaxTime(), Ke = 0; Ke < ne.length; Ke++) {
        var Ge = ne[Ke];
        if (Ge.needsAnimate()) {
          var Xe = Ge.keyframes, at = Ge.propName;
          if (be && (at = be(at)), at)
            for (var pt = 0; pt < Xe.length; pt++) {
              var Yt = Xe[pt], Nt = Math.round(Yt.time / de * 100) + "%", Gn = Ux(Yt.easing), vn = Yt.rawValue;
              (J(vn) || Be(vn)) && (ae[Nt] = ae[Nt] || {}, ae[Nt][at] = Yt.rawValue, Gn && (ae[Nt][C] = Gn));
            }
        }
      }
    }
    for (var A = 0; A < b; A++) {
      var T = _[A], L = T.targetName;
      L ? L === "shape" && D(T, x) : !n && D(T, S);
    }
    for (var E in S) {
      var I = {};
      CT(I, r), H(I, S[E]);
      var P = bT(I), R = S[E][C];
      w[E] = P ? {
        transform: P
      } : {}, F6(w[E], I), R && (w[E][C] = R);
    }
    var F, O = !0;
    for (var E in x) {
      w[E] = w[E] || {};
      var z = !F, R = x[E][C];
      z && (F = new Bn());
      var G = F.len();
      F.reset(), w[E].d = O6(r, x[E], F);
      var W = F.len();
      if (!z && G !== W) {
        O = !1;
        break;
      }
      R && (w[E][C] = R);
    }
    if (!O)
      for (var E in w)
        delete w[E].d;
    if (!n)
      for (var A = 0; A < b; A++) {
        var T = _[A], L = T.targetName;
        L === "style" && D(T, w, function(ne) {
          return B6[ne];
        });
      }
    for (var Y = Ee(w), j = !0, ee, A = 1; A < Y.length; A++) {
      var ie = Y[A - 1], Me = Y[A];
      if (w[ie][Ra] !== w[Me][Ra]) {
        j = !1;
        break;
      }
      ee = w[ie][Ra];
    }
    if (j && ee) {
      for (var E in w)
        w[E][Ra] && delete w[E][Ra];
      t[Ra] = ee;
    }
    if (qe(Y, function(ve) {
      return Ee(w[ve]).length > 0;
    }).length) {
      var We = VL(w, e);
      return We + " " + y[0] + " both";
    }
  }
  for (var g in l) {
    var s = p(l[g]);
    s && o.push(s);
  }
  if (o.length) {
    var m = e.zrId + "-cls-" + zL();
    e.cssNodes["." + m] = {
      animation: o.join(",")
    }, t.class = m;
  }
}
function z6(r, t, e) {
  if (!r.ignore)
    if (r.isSilent()) {
      var n = {
        "pointer-events": "none"
      };
      Yx(n, t, e);
    } else {
      var i = r.states.emphasis && r.states.emphasis.style ? r.states.emphasis.style : {}, a = i.fill;
      if (!a) {
        var o = r.style && r.style.fill, s = r.states.select && r.states.select.style && r.states.select.style.fill, l = r.currentStates.indexOf("select") >= 0 && s || o;
        l && (a = Zg(l));
      }
      var u = i.lineWidth;
      if (u) {
        var c = !i.strokeNoScale && r.transform ? r.transform[0] : 1;
        u = u / c;
      }
      var n = {
        cursor: "pointer"
      };
      a && (n.fill = a), i.stroke && (n.stroke = i.stroke), u && (n["stroke-width"] = u), Yx(n, t, e);
    }
}
function Yx(r, t, e, n) {
  var i = JSON.stringify(r), a = e.cssStyleCache[i];
  a || (a = e.zrId + "-cls-" + zL(), e.cssStyleCache[i] = a, e.cssNodes["." + a + ":hover"] = r), t.class = t.class ? t.class + " " + a : a;
}
var Du = Math.round;
function $L(r) {
  return r && J(r.src);
}
function GL(r) {
  return r && oe(r.toDataURL);
}
function K0(r, t, e, n) {
  M6(function(i, a) {
    var o = i === "fill" || i === "stroke";
    o && yT(a) ? qL(t, r, i, n) : o && t0(a) ? WL(e, r, i, n) : r[i] = a, o && n.ssr && a === "none" && (r["pointer-events"] = "visible");
  }, t, e, !1), U6(e, r, n);
}
function J0(r, t) {
  var e = NB(t);
  e && (e.each(function(n, i) {
    n != null && (r[(Hx + i).toLowerCase()] = n + "");
  }), t.isSilent() && (r[Hx + "silent"] = "true"));
}
function Zx(r) {
  return zi(r[0] - 1) && zi(r[1]) && zi(r[2]) && zi(r[3] - 1);
}
function V6(r) {
  return zi(r[4]) && zi(r[5]);
}
function Q0(r, t, e) {
  if (t && !(V6(t) && Zx(t))) {
    var n = 1e4;
    r.transform = Zx(t) ? "translate(" + Du(t[4] * n) / n + " " + Du(t[5] * n) / n + ")" : sB(t);
  }
}
function Xx(r, t, e) {
  for (var n = r.points, i = [], a = 0; a < n.length; a++)
    i.push(Du(n[a][0] * e) / e), i.push(Du(n[a][1] * e) / e);
  t.points = i.join(" ");
}
function jx(r) {
  return !r.smooth;
}
function $6(r) {
  var t = U(r, function(e) {
    return typeof e == "string" ? [e, e] : e;
  });
  return function(e, n, i) {
    for (var a = 0; a < t.length; a++) {
      var o = t[a], s = e[o[0]];
      s != null && (n[o[1]] = Du(s * i) / i);
    }
  };
}
var G6 = {
  circle: [$6(["cx", "cy", "r"])],
  polyline: [Xx, jx],
  polygon: [Xx, jx]
};
function H6(r) {
  for (var t = r.animators, e = 0; e < t.length; e++)
    if (t[e].targetName === "shape")
      return !0;
  return !1;
}
function HL(r, t) {
  var e = r.style, n = r.shape, i = G6[r.type], a = {}, o = t.animation, s = "path", l = r.style.strokePercent, u = t.compress && _T(r) || 4;
  if (i && !t.willUpdate && !(i[1] && !i[1](n)) && !(o && H6(r)) && !(l < 1)) {
    s = r.type;
    var c = Math.pow(10, u);
    i[0](n, a, c);
  } else {
    var f = !r.path || r.shapeChanged();
    r.path || r.createPathProxy();
    var h = r.path;
    f && (h.beginPath(), r.buildPath(h, r.shape), r.pathUpdated());
    var v = h.getVersion(), d = r, p = d.__svgPathBuilder;
    (d.__svgPathVersion !== v || !p || l !== d.__svgPathStrokePercent) && (p || (p = d.__svgPathBuilder = new OL()), p.reset(u), h.rebuildPath(p, l), p.generateStr(), d.__svgPathVersion = v, d.__svgPathStrokePercent = l), a.d = p.getStr();
  }
  return Q0(a, r.transform), K0(a, e, r, t), J0(a, r), t.animation && Pv(r, a, t), t.emphasis && z6(r, a, t), At(s, r.id + "", a);
}
function q6(r, t) {
  var e = r.style, n = e.image;
  if (n && !J(n) && ($L(n) ? n = n.src : GL(n) && (n = n.toDataURL())), !!n) {
    var i = e.x || 0, a = e.y || 0, o = e.width, s = e.height, l = {
      href: n,
      width: o,
      height: s
    };
    return i && (l.x = i), a && (l.y = a), Q0(l, r.transform), K0(l, e, r, t), J0(l, r), t.animation && Pv(r, l, t), At("image", r.id + "", l);
  }
}
function W6(r, t) {
  var e = r.style, n = e.text;
  if (n != null && (n += ""), !(!n || isNaN(e.x) || isNaN(e.y))) {
    var i = e.font || Xi, a = e.x || 0, o = uB(e.y || 0, iv(i), e.textBaseline), s = lB[e.textAlign] || e.textAlign, l = {
      "dominant-baseline": "central",
      "text-anchor": s
    };
    if (jT(e)) {
      var u = "", c = e.fontStyle, f = XT(e.fontSize);
      if (!parseFloat(f))
        return;
      var h = e.fontFamily || XD, v = e.fontWeight;
      u += "font-size:" + f + ";font-family:" + h + ";", c && c !== "normal" && (u += "font-style:" + c + ";"), v && v !== "normal" && (u += "font-weight:" + v + ";"), l.style = u;
    } else
      l.style = "font: " + i;
    return n.match(/\s/) && (l["xml:space"] = "preserve"), a && (l.x = a), o && (l.y = o), Q0(l, r.transform), K0(l, e, r, t), J0(l, r), t.animation && Pv(r, l, t), At("text", r.id + "", l, void 0, n);
  }
}
function Kx(r, t) {
  if (r instanceof Te)
    return HL(r, t);
  if (r instanceof Pt)
    return q6(r, t);
  if (r instanceof ms)
    return W6(r, t);
}
function U6(r, t, e) {
  var n = r.style;
  if (cB(n)) {
    var i = fB(r), a = e.shadowCache, o = a[i];
    if (!o) {
      var s = r.getGlobalScale(), l = s[0], u = s[1];
      if (!l || !u)
        return;
      var c = n.shadowOffsetX || 0, f = n.shadowOffsetY || 0, h = n.shadowBlur, v = vu(n.shadowColor), d = v.opacity, p = v.color, g = h / 2 / l, m = h / 2 / u, y = g + " " + m;
      o = e.zrId + "-s" + e.shadowIdx++, e.defs[o] = At("filter", o, {
        id: o,
        x: "-100%",
        y: "-100%",
        width: "300%",
        height: "300%"
      }, [
        At("feDropShadow", "", {
          dx: c / l,
          dy: f / u,
          stdDeviation: y,
          "flood-color": p,
          "flood-opacity": d
        })
      ]), a[i] = o;
    }
    t.filter = nv(o);
  }
}
function qL(r, t, e, n) {
  var i = r[e], a, o = {
    gradientUnits: i.global ? "userSpaceOnUse" : "objectBoundingBox"
  };
  if (gT(i))
    a = "linearGradient", o.x1 = i.x, o.y1 = i.y, o.x2 = i.x2, o.y2 = i.y2;
  else if (mT(i))
    a = "radialGradient", o.cx = me(i.x, 0.5), o.cy = me(i.y, 0.5), o.r = me(i.r, 0.5);
  else
    return;
  for (var s = i.colorStops, l = [], u = 0, c = s.length; u < c; ++u) {
    var f = Xg(s[u].offset) * 100 + "%", h = s[u].color, v = vu(h), d = v.color, p = v.opacity, g = {
      offset: f
    };
    g["stop-color"] = d, p < 1 && (g["stop-opacity"] = p), l.push(At("stop", u + "", g));
  }
  var m = At(a, "", o, l), y = j0(m), _ = n.gradientCache, b = _[y];
  b || (b = n.zrId + "-g" + n.gradientIdx++, _[y] = b, o.id = b, n.defs[b] = At(a, b, o, l)), t[e] = nv(b);
}
function WL(r, t, e, n) {
  var i = r.style[e], a = r.getBoundingRect(), o = {}, s = i.repeat, l = s === "no-repeat", u = s === "repeat-x", c = s === "repeat-y", f;
  if (pT(i)) {
    var h = i.imageWidth, v = i.imageHeight, d = void 0, p = i.image;
    if (J(p) ? d = p : $L(p) ? d = p.src : GL(p) && (d = p.toDataURL()), typeof Image > "u") {
      var g = "Image width/height must been given explictly in svg-ssr renderer.";
      rr(h, g), rr(v, g);
    } else if (h == null || v == null) {
      var m = function(A, T) {
        if (A) {
          var L = A.elm, E = h || T.width, I = v || T.height;
          A.tag === "pattern" && (u ? (I = 1, E /= a.width) : c && (E = 1, I /= a.height)), A.attrs.width = E, A.attrs.height = I, L && (L.setAttribute("width", E), L.setAttribute("height", I));
        }
      }, y = s0(d, null, r, function(A) {
        l || m(x, A), m(f, A);
      });
      y && y.width && y.height && (h = h || y.width, v = v || y.height);
    }
    f = At("image", "img", {
      href: d,
      width: h,
      height: v
    }), o.width = h, o.height = v;
  } else i.svgElement && (f = ce(i.svgElement), o.width = i.svgWidth, o.height = i.svgHeight);
  if (f) {
    var _, b;
    l ? _ = b = 1 : u ? (b = 1, _ = o.width / a.width) : c ? (_ = 1, b = o.height / a.height) : o.patternUnits = "userSpaceOnUse", _ != null && !isNaN(_) && (o.width = _), b != null && !isNaN(b) && (o.height = b);
    var S = bT(i);
    S && (o.patternTransform = S);
    var x = At("pattern", "", o, [f]), w = j0(x), C = n.patternCache, D = C[w];
    D || (D = n.zrId + "-p" + n.patternIdx++, C[w] = D, o.id = D, x = n.defs[D] = At("pattern", D, o, [f])), t[e] = nv(D);
  }
}
function Y6(r, t, e) {
  var n = e.clipPathCache, i = e.defs, a = n[r.id];
  if (!a) {
    a = e.zrId + "-c" + e.clipPathIdx++;
    var o = {
      id: a
    };
    n[r.id] = a, i[a] = At("clipPath", a, o, [HL(r, e)]);
  }
  t["clip-path"] = nv(a);
}
function Jx(r) {
  return document.createTextNode(r);
}
function $a(r, t, e) {
  r.insertBefore(t, e);
}
function Qx(r, t) {
  r.removeChild(t);
}
function e2(r, t) {
  r.appendChild(t);
}
function UL(r) {
  return r.parentNode;
}
function YL(r) {
  return r.nextSibling;
}
function fp(r, t) {
  r.textContent = t;
}
var t2 = 58, Z6 = 120, X6 = At("", "");
function Bm(r) {
  return r === void 0;
}
function wn(r) {
  return r !== void 0;
}
function j6(r, t, e) {
  for (var n = {}, i = t; i <= e; ++i) {
    var a = r[i].key;
    a !== void 0 && (n[a] = i);
  }
  return n;
}
function Ol(r, t) {
  var e = r.key === t.key, n = r.tag === t.tag;
  return n && e;
}
function Tu(r) {
  var t, e = r.children, n = r.tag;
  if (wn(n)) {
    var i = r.elm = NL(n);
    if (e_(X6, r), q(e))
      for (t = 0; t < e.length; ++t) {
        var a = e[t];
        a != null && e2(i, Tu(a));
      }
    else wn(r.text) && !ue(r.text) && e2(i, Jx(r.text));
  } else
    r.elm = Jx(r.text);
  return r.elm;
}
function ZL(r, t, e, n, i) {
  for (; n <= i; ++n) {
    var a = e[n];
    a != null && $a(r, Tu(a), t);
  }
}
function Ch(r, t, e, n) {
  for (; e <= n; ++e) {
    var i = t[e];
    if (i != null)
      if (wn(i.tag)) {
        var a = UL(i.elm);
        Qx(a, i.elm);
      } else
        Qx(r, i.elm);
  }
}
function e_(r, t) {
  var e, n = t.elm, i = r && r.attrs || {}, a = t.attrs || {};
  if (i !== a) {
    for (e in a) {
      var o = a[e], s = i[e];
      s !== o && (o === !0 ? n.setAttribute(e, "") : o === !1 ? n.removeAttribute(e) : e === "style" ? n.style.cssText = o : e.charCodeAt(0) !== Z6 ? n.setAttribute(e, o) : e === "xmlns:xlink" || e === "xmlns" ? n.setAttributeNS(I6, e, o) : e.charCodeAt(3) === t2 ? n.setAttributeNS(L6, e, o) : e.charCodeAt(5) === t2 ? n.setAttributeNS(BL, e, o) : n.setAttribute(e, o));
    }
    for (e in i)
      e in a || n.removeAttribute(e);
  }
}
function K6(r, t, e) {
  for (var n = 0, i = 0, a = t.length - 1, o = t[0], s = t[a], l = e.length - 1, u = e[0], c = e[l], f, h, v, d; n <= a && i <= l; )
    o == null ? o = t[++n] : s == null ? s = t[--a] : u == null ? u = e[++i] : c == null ? c = e[--l] : Ol(o, u) ? (rs(o, u), o = t[++n], u = e[++i]) : Ol(s, c) ? (rs(s, c), s = t[--a], c = e[--l]) : Ol(o, c) ? (rs(o, c), $a(r, o.elm, YL(s.elm)), o = t[++n], c = e[--l]) : Ol(s, u) ? (rs(s, u), $a(r, s.elm, o.elm), s = t[--a], u = e[++i]) : (Bm(f) && (f = j6(t, n, a)), h = f[u.key], Bm(h) ? $a(r, Tu(u), o.elm) : (v = t[h], v.tag !== u.tag ? $a(r, Tu(u), o.elm) : (rs(v, u), t[h] = void 0, $a(r, v.elm, o.elm))), u = e[++i]);
  (n <= a || i <= l) && (n > a ? (d = e[l + 1] == null ? null : e[l + 1].elm, ZL(r, d, e, i, l)) : Ch(r, t, n, a));
}
function rs(r, t) {
  var e = t.elm = r.elm, n = r.children, i = t.children;
  r !== t && (e_(r, t), Bm(t.text) ? wn(n) && wn(i) ? n !== i && K6(e, n, i) : wn(i) ? (wn(r.text) && fp(e, ""), ZL(e, null, i, 0, i.length - 1)) : wn(n) ? Ch(e, n, 0, n.length - 1) : wn(r.text) && fp(e, "") : r.text !== t.text && (wn(n) && Ch(e, n, 0, n.length - 1), fp(e, t.text)));
}
function J6(r, t) {
  if (Ol(r, t))
    rs(r, t);
  else {
    var e = r.elm, n = UL(e);
    Tu(t), n !== null && ($a(n, t.elm, YL(e)), Ch(n, [r], 0, 0));
  }
  return t;
}
var Q6 = 0, e9 = function() {
  function r(t, e, n) {
    if (this.type = "svg", this.refreshHover = r2(), this.configLayer = r2(), this.storage = e, this._opts = n = H({}, n), this.root = t, this._id = "zr" + Q6++, this._oldVNode = qx(n.width, n.height), t && !n.ssr) {
      var i = this._viewport = document.createElement("div");
      i.style.cssText = "position:relative;overflow:hidden";
      var a = this._svgDom = this._oldVNode.elm = NL("svg");
      e_(null, this._oldVNode), i.appendChild(a), t.appendChild(i);
    }
    this.resize(n.width, n.height);
  }
  return r.prototype.getType = function() {
    return this.type;
  }, r.prototype.getViewportRoot = function() {
    return this._viewport;
  }, r.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, r.prototype.getSvgDom = function() {
    return this._svgDom;
  }, r.prototype.refresh = function() {
    if (this.root) {
      var t = this.renderToVNode({
        willUpdate: !0
      });
      t.attrs.style = "position:absolute;left:0;top:0;user-select:none", J6(this._oldVNode, t), this._oldVNode = t;
    }
  }, r.prototype.renderOneToVNode = function(t) {
    return Kx(t, Fm(this._id));
  }, r.prototype.renderToVNode = function(t) {
    t = t || {};
    var e = this.storage.getDisplayList(!0), n = this._width, i = this._height, a = Fm(this._id);
    a.animation = t.animation, a.willUpdate = t.willUpdate, a.compress = t.compress, a.emphasis = t.emphasis, a.ssr = this._opts.ssr;
    var o = [], s = this._bgVNode = t9(n, i, this._backgroundColor, a);
    s && o.push(s);
    var l = t.compress ? null : this._mainVNode = At("g", "main", {}, []);
    this._paintList(e, a, l ? l.children : o), l && o.push(l);
    var u = U(Ee(a.defs), function(h) {
      return a.defs[h];
    });
    if (u.length && o.push(At("defs", "defs", {}, u)), t.animation) {
      var c = k6(a.cssNodes, a.cssAnims, { newline: !0 });
      if (c) {
        var f = At("style", "stl", {}, [], c);
        o.push(f);
      }
    }
    return qx(n, i, o, t.useViewBox);
  }, r.prototype.renderToString = function(t) {
    return t = t || {}, j0(this.renderToVNode({
      animation: me(t.cssAnimation, !0),
      emphasis: me(t.cssEmphasis, !0),
      willUpdate: !1,
      compress: !0,
      useViewBox: me(t.useViewBox, !0)
    }), { newline: !0 });
  }, r.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t;
  }, r.prototype.getSvgRoot = function() {
    return this._mainVNode && this._mainVNode.elm;
  }, r.prototype._paintList = function(t, e, n) {
    for (var i = t.length, a = [], o = 0, s, l, u = 0, c = 0; c < i; c++) {
      var f = t[c];
      if (!f.invisible) {
        var h = f.__clipPaths, v = h && h.length || 0, d = l && l.length || 0, p = void 0;
        for (p = Math.max(v - 1, d - 1); p >= 0 && !(h && l && h[p] === l[p]); p--)
          ;
        for (var g = d - 1; g > p; g--)
          o--, s = a[o - 1];
        for (var m = p + 1; m < v; m++) {
          var y = {};
          Y6(h[m], y, e);
          var _ = At("g", "clip-g-" + u++, y, []);
          (s ? s.children : n).push(_), a[o++] = _, s = _;
        }
        l = h;
        var b = Kx(f, e);
        b && (s ? s.children : n).push(b);
      }
    }
  }, r.prototype.resize = function(t, e) {
    var n = this._opts, i = this.root, a = this._viewport;
    if (t != null && (n.width = t), e != null && (n.height = e), i && a && (a.style.display = "none", t = ss(i, 0, n), e = ss(i, 1, n), a.style.display = ""), this._width !== t || this._height !== e) {
      if (this._width = t, this._height = e, a) {
        var o = a.style;
        o.width = t + "px", o.height = e + "px";
      }
      if (t0(this._backgroundColor))
        this.refresh();
      else {
        var s = this._svgDom;
        s && (s.setAttribute("width", t), s.setAttribute("height", e));
        var l = this._bgVNode && this._bgVNode.elm;
        l && (l.setAttribute("width", t), l.setAttribute("height", e));
      }
    }
  }, r.prototype.getWidth = function() {
    return this._width;
  }, r.prototype.getHeight = function() {
    return this._height;
  }, r.prototype.dispose = function() {
    this.root && (this.root.innerHTML = ""), this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null;
  }, r.prototype.clear = function() {
    this._svgDom && (this._svgDom.innerHTML = null), this._oldVNode = null;
  }, r.prototype.toDataURL = function(t) {
    var e = this.renderToString(), n = "data:image/svg+xml;";
    return t ? (e = vB(e), e && n + "base64," + e) : n + "charset=UTF-8," + encodeURIComponent(e);
  }, r;
}();
function r2(r) {
  return function() {
  };
}
function t9(r, t, e, n) {
  var i;
  if (e && e !== "none")
    if (i = At("rect", "bg", {
      width: r,
      height: t,
      x: "0",
      y: "0"
    }), yT(e))
      qL({ fill: e }, i.attrs, "fill", n);
    else if (t0(e))
      WL({
        style: {
          fill: e
        },
        dirty: dt,
        getBoundingRect: function() {
          return { width: r, height: t };
        }
      }, i.attrs, "fill", n);
    else {
      var a = vu(e), o = a.color, s = a.opacity;
      i.attrs.fill = o, s < 1 && (i.attrs["fill-opacity"] = s);
    }
  return i;
}
function r9(r) {
  r.registerPainter("svg", e9);
}
function n2(r, t, e) {
  var n = ji.createCanvas(), i = t.getWidth(), a = t.getHeight(), o = n.style;
  return o && (o.position = "absolute", o.left = "0", o.top = "0", o.width = i + "px", o.height = a + "px", n.setAttribute("data-zr-dom-id", r)), n.width = i * e, n.height = a * e, n;
}
var hp = function(r) {
  N(t, r);
  function t(e, n, i) {
    var a = r.call(this) || this;
    a.motionBlur = !1, a.lastFrameAlpha = 0.7, a.dpr = 1, a.virtual = !1, a.config = {}, a.incremental = !1, a.zlevel = 0, a.maxRepaintRectCount = 5, a.__dirty = !0, a.__firstTimePaint = !0, a.__used = !1, a.__drawIndex = 0, a.__startIndex = 0, a.__endIndex = 0, a.__prevStartIndex = null, a.__prevEndIndex = null;
    var o;
    i = i || nh, typeof e == "string" ? o = n2(e, n, i) : ue(e) && (o = e, e = o.id), a.id = e, a.dom = o;
    var s = o.style;
    return s && (tT(o), o.onselectstart = function() {
      return !1;
    }, s.padding = "0", s.margin = "0", s.borderWidth = "0"), a.painter = n, a.dpr = i, a;
  }
  return t.prototype.getElementCount = function() {
    return this.__endIndex - this.__startIndex;
  }, t.prototype.afterBrush = function() {
    this.__prevStartIndex = this.__startIndex, this.__prevEndIndex = this.__endIndex;
  }, t.prototype.initContext = function() {
    this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr;
  }, t.prototype.setUnpainted = function() {
    this.__firstTimePaint = !0;
  }, t.prototype.createBackBuffer = function() {
    var e = this.dpr;
    this.domBack = n2("back-" + this.id, this.painter, e), this.ctxBack = this.domBack.getContext("2d"), e !== 1 && this.ctxBack.scale(e, e);
  }, t.prototype.createRepaintRects = function(e, n, i, a) {
    if (this.__firstTimePaint)
      return this.__firstTimePaint = !1, null;
    var o = [], s = this.maxRepaintRectCount, l = !1, u = new xe(0, 0, 0, 0);
    function c(y) {
      if (!(!y.isFinite() || y.isZero()))
        if (o.length === 0) {
          var _ = new xe(0, 0, 0, 0);
          _.copy(y), o.push(_);
        } else {
          for (var b = !1, S = 1 / 0, x = 0, w = 0; w < o.length; ++w) {
            var C = o[w];
            if (C.intersect(y)) {
              var D = new xe(0, 0, 0, 0);
              D.copy(C), D.union(y), o[w] = D, b = !0;
              break;
            } else if (l) {
              u.copy(y), u.union(C);
              var A = y.width * y.height, T = C.width * C.height, L = u.width * u.height, E = L - A - T;
              E < S && (S = E, x = w);
            }
          }
          if (l && (o[x].union(y), b = !0), !b) {
            var _ = new xe(0, 0, 0, 0);
            _.copy(y), o.push(_);
          }
          l || (l = o.length >= s);
        }
    }
    for (var f = this.__startIndex; f < this.__endIndex; ++f) {
      var h = e[f];
      if (h) {
        var v = h.shouldBePainted(i, a, !0, !0), d = h.__isRendered && (h.__dirty & br || !v) ? h.getPrevPaintRect() : null;
        d && c(d);
        var p = v && (h.__dirty & br || !h.__isRendered) ? h.getPaintRect() : null;
        p && c(p);
      }
    }
    for (var f = this.__prevStartIndex; f < this.__prevEndIndex; ++f) {
      var h = n[f], v = h && h.shouldBePainted(i, a, !0, !0);
      if (h && (!v || !h.__zr) && h.__isRendered) {
        var d = h.getPrevPaintRect();
        d && c(d);
      }
    }
    var g;
    do {
      g = !1;
      for (var f = 0; f < o.length; ) {
        if (o[f].isZero()) {
          o.splice(f, 1);
          continue;
        }
        for (var m = f + 1; m < o.length; )
          o[f].intersect(o[m]) ? (g = !0, o[f].union(o[m]), o.splice(m, 1)) : m++;
        f++;
      }
    } while (g);
    return this._paintRects = o, o;
  }, t.prototype.debugGetPaintRects = function() {
    return (this._paintRects || []).slice();
  }, t.prototype.resize = function(e, n) {
    var i = this.dpr, a = this.dom, o = a.style, s = this.domBack;
    o && (o.width = e + "px", o.height = n + "px"), a.width = e * i, a.height = n * i, s && (s.width = e * i, s.height = n * i, i !== 1 && this.ctxBack.scale(i, i));
  }, t.prototype.clear = function(e, n, i) {
    var a = this.dom, o = this.ctx, s = a.width, l = a.height;
    n = n || this.clearColor;
    var u = this.motionBlur && !e, c = this.lastFrameAlpha, f = this.dpr, h = this;
    u && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(a, 0, 0, s / f, l / f));
    var v = this.domBack;
    function d(p, g, m, y) {
      if (o.clearRect(p, g, m, y), n && n !== "transparent") {
        var _ = void 0;
        if (ev(n)) {
          var b = n.global || n.__width === m && n.__height === y;
          _ = b && n.__canvasGradient || Tm(o, n, {
            x: 0,
            y: 0,
            width: m,
            height: y
          }), n.__canvasGradient = _, n.__width = m, n.__height = y;
        } else S3(n) && (n.scaleX = n.scaleX || f, n.scaleY = n.scaleY || f, _ = Mm(o, n, {
          dirty: function() {
            h.setUnpainted(), h.painter.refresh();
          }
        }));
        o.save(), o.fillStyle = _ || n, o.fillRect(p, g, m, y), o.restore();
      }
      u && (o.save(), o.globalAlpha = c, o.drawImage(v, p, g, m, y), o.restore());
    }
    !i || u ? d(0, 0, s, l) : i.length && M(i, function(p) {
      d(p.x * f, p.y * f, p.width * f, p.height * f);
    });
  }, t;
}(Wr), i2 = 1e5, Pa = 314159, Yc = 0.01, n9 = 1e-3;
function i9(r) {
  return r ? r.__builtin__ ? !0 : !(typeof r.resize != "function" || typeof r.refresh != "function") : !1;
}
function a9(r, t) {
  var e = document.createElement("div");
  return e.style.cssText = [
    "position:relative",
    "width:" + r + "px",
    "height:" + t + "px",
    "padding:0",
    "margin:0",
    "border-width:0"
  ].join(";") + ";", e;
}
var o9 = function() {
  function r(t, e, n, i) {
    this.type = "canvas", this._zlevelList = [], this._prevDisplayList = [], this._layers = {}, this._layerConfig = {}, this._needsManuallyCompositing = !1, this.type = "canvas";
    var a = !t.nodeName || t.nodeName.toUpperCase() === "CANVAS";
    this._opts = n = H({}, n || {}), this.dpr = n.devicePixelRatio || nh, this._singleCanvas = a, this.root = t;
    var o = t.style;
    o && (tT(t), t.innerHTML = ""), this.storage = e;
    var s = this._zlevelList;
    this._prevDisplayList = [];
    var l = this._layers;
    if (a) {
      var c = t, f = c.width, h = c.height;
      n.width != null && (f = n.width), n.height != null && (h = n.height), this.dpr = n.devicePixelRatio || 1, c.width = f * this.dpr, c.height = h * this.dpr, this._width = f, this._height = h;
      var v = new hp(c, this, this.dpr);
      v.__builtin__ = !0, v.initContext(), l[Pa] = v, v.zlevel = Pa, s.push(Pa), this._domRoot = t;
    } else {
      this._width = ss(t, 0, n), this._height = ss(t, 1, n);
      var u = this._domRoot = a9(this._width, this._height);
      t.appendChild(u);
    }
  }
  return r.prototype.getType = function() {
    return "canvas";
  }, r.prototype.isSingleCanvas = function() {
    return this._singleCanvas;
  }, r.prototype.getViewportRoot = function() {
    return this._domRoot;
  }, r.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, r.prototype.refresh = function(t) {
    var e = this.storage.getDisplayList(!0), n = this._prevDisplayList, i = this._zlevelList;
    this._redrawId = Math.random(), this._paintList(e, n, t, this._redrawId);
    for (var a = 0; a < i.length; a++) {
      var o = i[a], s = this._layers[o];
      if (!s.__builtin__ && s.refresh) {
        var l = a === 0 ? this._backgroundColor : null;
        s.refresh(l);
      }
    }
    return this._opts.useDirtyRect && (this._prevDisplayList = e.slice()), this;
  }, r.prototype.refreshHover = function() {
    this._paintHoverList(this.storage.getDisplayList(!1));
  }, r.prototype._paintHoverList = function(t) {
    var e = t.length, n = this._hoverlayer;
    if (n && n.clear(), !!e) {
      for (var i = {
        inHover: !0,
        viewWidth: this._width,
        viewHeight: this._height
      }, a, o = 0; o < e; o++) {
        var s = t[o];
        s.__inHover && (n || (n = this._hoverlayer = this.getLayer(i2)), a || (a = n.ctx, a.save()), Ka(a, s, i, o === e - 1));
      }
      a && a.restore();
    }
  }, r.prototype.getHoverLayer = function() {
    return this.getLayer(i2);
  }, r.prototype.paintOne = function(t, e) {
    PI(t, e);
  }, r.prototype._paintList = function(t, e, n, i) {
    if (this._redrawId === i) {
      n = n || !1, this._updateLayerStatus(t);
      var a = this._doPaintList(t, e, n), o = a.finished, s = a.needsRefreshHover;
      if (this._needsManuallyCompositing && this._compositeManually(), s && this._paintHoverList(t), o)
        this.eachLayer(function(u) {
          u.afterBrush && u.afterBrush();
        });
      else {
        var l = this;
        Kf(function() {
          l._paintList(t, e, n, i);
        });
      }
    }
  }, r.prototype._compositeManually = function() {
    var t = this.getLayer(Pa).ctx, e = this._domRoot.width, n = this._domRoot.height;
    t.clearRect(0, 0, e, n), this.eachBuiltinLayer(function(i) {
      i.virtual && t.drawImage(i.dom, 0, 0, e, n);
    });
  }, r.prototype._doPaintList = function(t, e, n) {
    for (var i = this, a = [], o = this._opts.useDirtyRect, s = 0; s < this._zlevelList.length; s++) {
      var l = this._zlevelList[s], u = this._layers[l];
      u.__builtin__ && u !== this._hoverlayer && (u.__dirty || n) && a.push(u);
    }
    for (var c = !0, f = !1, h = function(p) {
      var g = a[p], m = g.ctx, y = o && g.createRepaintRects(t, e, v._width, v._height), _ = n ? g.__startIndex : g.__drawIndex, b = !n && g.incremental && Date.now, S = b && Date.now(), x = g.zlevel === v._zlevelList[0] ? v._backgroundColor : null;
      if (g.__startIndex === g.__endIndex)
        g.clear(!1, x, y);
      else if (_ === g.__startIndex) {
        var w = t[_];
        (!w.incremental || !w.notClear || n) && g.clear(!1, x, y);
      }
      _ === -1 && (console.error("For some unknown reason. drawIndex is -1"), _ = g.__startIndex);
      var C, D = function(E) {
        var I = {
          inHover: !1,
          allClipped: !1,
          prevEl: null,
          viewWidth: i._width,
          viewHeight: i._height
        };
        for (C = _; C < g.__endIndex; C++) {
          var P = t[C];
          if (P.__inHover && (f = !0), i._doPaintEl(P, g, o, E, I, C === g.__endIndex - 1), b) {
            var R = Date.now() - S;
            if (R > 15)
              break;
          }
        }
        I.prevElClipPaths && m.restore();
      };
      if (y)
        if (y.length === 0)
          C = g.__endIndex;
        else
          for (var A = v.dpr, T = 0; T < y.length; ++T) {
            var L = y[T];
            m.save(), m.beginPath(), m.rect(L.x * A, L.y * A, L.width * A, L.height * A), m.clip(), D(L), m.restore();
          }
      else
        m.save(), D(), m.restore();
      g.__drawIndex = C, g.__drawIndex < g.__endIndex && (c = !1);
    }, v = this, d = 0; d < a.length; d++)
      h(d);
    return Ie.wxa && M(this._layers, function(p) {
      p && p.ctx && p.ctx.draw && p.ctx.draw();
    }), {
      finished: c,
      needsRefreshHover: f
    };
  }, r.prototype._doPaintEl = function(t, e, n, i, a, o) {
    var s = e.ctx;
    if (n) {
      var l = t.getPaintRect();
      (!i || l && l.intersect(i)) && (Ka(s, t, a, o), t.setPrevPaintRect(l));
    } else
      Ka(s, t, a, o);
  }, r.prototype.getLayer = function(t, e) {
    this._singleCanvas && !this._needsManuallyCompositing && (t = Pa);
    var n = this._layers[t];
    return n || (n = new hp("zr_" + t, this, this.dpr), n.zlevel = t, n.__builtin__ = !0, this._layerConfig[t] ? _e(n, this._layerConfig[t], !0) : this._layerConfig[t - Yc] && _e(n, this._layerConfig[t - Yc], !0), e && (n.virtual = e), this.insertLayer(t, n), n.initContext()), n;
  }, r.prototype.insertLayer = function(t, e) {
    var n = this._layers, i = this._zlevelList, a = i.length, o = this._domRoot, s = null, l = -1;
    if (!n[t] && i9(e)) {
      if (a > 0 && t > i[0]) {
        for (l = 0; l < a - 1 && !(i[l] < t && i[l + 1] > t); l++)
          ;
        s = n[i[l]];
      }
      if (i.splice(l + 1, 0, t), n[t] = e, !e.virtual)
        if (s) {
          var u = s.dom;
          u.nextSibling ? o.insertBefore(e.dom, u.nextSibling) : o.appendChild(e.dom);
        } else
          o.firstChild ? o.insertBefore(e.dom, o.firstChild) : o.appendChild(e.dom);
      e.painter || (e.painter = this);
    }
  }, r.prototype.eachLayer = function(t, e) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i];
      t.call(e, this._layers[a], a);
    }
  }, r.prototype.eachBuiltinLayer = function(t, e) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i], o = this._layers[a];
      o.__builtin__ && t.call(e, o, a);
    }
  }, r.prototype.eachOtherLayer = function(t, e) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i], o = this._layers[a];
      o.__builtin__ || t.call(e, o, a);
    }
  }, r.prototype.getLayers = function() {
    return this._layers;
  }, r.prototype._updateLayerStatus = function(t) {
    this.eachBuiltinLayer(function(f, h) {
      f.__dirty = f.__used = !1;
    });
    function e(f) {
      a && (a.__endIndex !== f && (a.__dirty = !0), a.__endIndex = f);
    }
    if (this._singleCanvas)
      for (var n = 1; n < t.length; n++) {
        var i = t[n];
        if (i.zlevel !== t[n - 1].zlevel || i.incremental) {
          this._needsManuallyCompositing = !0;
          break;
        }
      }
    var a = null, o = 0, s, l;
    for (l = 0; l < t.length; l++) {
      var i = t[l], u = i.zlevel, c = void 0;
      s !== u && (s = u, o = 0), i.incremental ? (c = this.getLayer(u + n9, this._needsManuallyCompositing), c.incremental = !0, o = 1) : c = this.getLayer(u + (o > 0 ? Yc : 0), this._needsManuallyCompositing), c.__builtin__ || Yy("ZLevel " + u + " has been used by unkown layer " + c.id), c !== a && (c.__used = !0, c.__startIndex !== l && (c.__dirty = !0), c.__startIndex = l, c.incremental ? c.__drawIndex = -1 : c.__drawIndex = l, e(l), a = c), i.__dirty & br && !i.__inHover && (c.__dirty = !0, c.incremental && c.__drawIndex < 0 && (c.__drawIndex = l));
    }
    e(l), this.eachBuiltinLayer(function(f, h) {
      !f.__used && f.getElementCount() > 0 && (f.__dirty = !0, f.__startIndex = f.__endIndex = f.__drawIndex = 0), f.__dirty && f.__drawIndex < 0 && (f.__drawIndex = f.__startIndex);
    });
  }, r.prototype.clear = function() {
    return this.eachBuiltinLayer(this._clearLayer), this;
  }, r.prototype._clearLayer = function(t) {
    t.clear();
  }, r.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t, M(this._layers, function(e) {
      e.setUnpainted();
    });
  }, r.prototype.configLayer = function(t, e) {
    if (e) {
      var n = this._layerConfig;
      n[t] ? _e(n[t], e, !0) : n[t] = e;
      for (var i = 0; i < this._zlevelList.length; i++) {
        var a = this._zlevelList[i];
        if (a === t || a === t + Yc) {
          var o = this._layers[a];
          _e(o, n[t], !0);
        }
      }
    }
  }, r.prototype.delLayer = function(t) {
    var e = this._layers, n = this._zlevelList, i = e[t];
    i && (i.dom.parentNode.removeChild(i.dom), delete e[t], n.splice(we(n, t), 1));
  }, r.prototype.resize = function(t, e) {
    if (this._domRoot.style) {
      var n = this._domRoot;
      n.style.display = "none";
      var i = this._opts, a = this.root;
      if (t != null && (i.width = t), e != null && (i.height = e), t = ss(a, 0, i), e = ss(a, 1, i), n.style.display = "", this._width !== t || e !== this._height) {
        n.style.width = t + "px", n.style.height = e + "px";
        for (var o in this._layers)
          this._layers.hasOwnProperty(o) && this._layers[o].resize(t, e);
        this.refresh(!0);
      }
      this._width = t, this._height = e;
    } else {
      if (t == null || e == null)
        return;
      this._width = t, this._height = e, this.getLayer(Pa).resize(t, e);
    }
    return this;
  }, r.prototype.clearLayer = function(t) {
    var e = this._layers[t];
    e && e.clear();
  }, r.prototype.dispose = function() {
    this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null;
  }, r.prototype.getRenderedCanvas = function(t) {
    if (t = t || {}, this._singleCanvas && !this._compositeManually)
      return this._layers[Pa].dom;
    var e = new hp("image", this, t.pixelRatio || this.dpr);
    e.initContext(), e.clear(!1, t.backgroundColor || this._backgroundColor);
    var n = e.ctx;
    if (t.pixelRatio <= this.dpr) {
      this.refresh();
      var i = e.dom.width, a = e.dom.height;
      this.eachLayer(function(f) {
        f.__builtin__ ? n.drawImage(f.dom, 0, 0, i, a) : f.renderToCanvas && (n.save(), f.renderToCanvas(n), n.restore());
      });
    } else
      for (var o = {
        inHover: !1,
        viewWidth: this._width,
        viewHeight: this._height
      }, s = this.storage.getDisplayList(!0), l = 0, u = s.length; l < u; l++) {
        var c = s[l];
        Ka(n, c, o, l === u - 1);
      }
    return e.dom;
  }, r.prototype.getWidth = function() {
    return this._width;
  }, r.prototype.getHeight = function() {
    return this._height;
  }, r;
}();
function s9(r) {
  r.registerPainter("canvas", o9);
}
var l9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e;
    }
    return t.prototype.getInitialData = function(e) {
      return gi(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getLegendIcon = function(e) {
      var n = new fe(), i = yt("line", 0, e.itemHeight / 2, e.itemWidth, 0, e.lineStyle.stroke, !1);
      n.add(i), i.setStyle(e.lineStyle);
      var a = this.getData().getVisual("symbol"), o = this.getData().getVisual("symbolRotate"), s = a === "none" ? "circle" : a, l = e.itemHeight * 0.8, u = yt(s, (e.itemWidth - l) / 2, (e.itemHeight - l) / 2, l, l, e.itemStyle.fill);
      n.add(u), u.setStyle(e.itemStyle);
      var c = e.iconRotate === "inherit" ? o : e.iconRotate || 0;
      return u.rotation = c * Math.PI / 180, u.setOrigin([e.itemWidth / 2, e.itemHeight / 2]), s.indexOf("empty") > -1 && (u.style.stroke = u.style.fill, u.style.fill = "#fff", u.style.lineWidth = 2), n;
    }, t.type = "series.line", t.dependencies = ["grid", "polar"], t.defaultOption = {
      // zlevel: 0,
      z: 3,
      coordinateSystem: "cartesian2d",
      legendHoverLink: !0,
      clip: !0,
      label: {
        position: "top"
      },
      // itemStyle: {
      // },
      endLabel: {
        show: !1,
        valueAnimation: !0,
        distance: 8
      },
      lineStyle: {
        width: 2,
        type: "solid"
      },
      emphasis: {
        scale: !0
      },
      // areaStyle: {
      // origin of areaStyle. Valid values:
      // `'auto'/null/undefined`: from axisLine to data
      // `'start'`: from min to data
      // `'end'`: from data to max
      // origin: 'auto'
      // },
      // false, 'start', 'end', 'middle'
      step: !1,
      // Disabled if step is true
      smooth: !1,
      smoothMonotone: null,
      symbol: "emptyCircle",
      symbolSize: 4,
      symbolRotate: null,
      showSymbol: !0,
      // `false`: follow the label interval strategy.
      // `true`: show all symbols.
      // `'auto'`: If possible, show all symbols, otherwise
      //           follow the label interval strategy.
      showAllSymbol: "auto",
      // Whether to connect break point.
      connectNulls: !1,
      // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
      sampling: "none",
      animationEasing: "linear",
      // Disable progressive
      progressive: 0,
      hoverLayerThreshold: 1 / 0,
      universalTransition: {
        divideShape: "clone"
      },
      triggerLineEvent: !1
    }, t;
  }(it)
);
function xs(r, t) {
  var e = r.mapDimensionsAll("defaultedLabel"), n = e.length;
  if (n === 1) {
    var i = _s(r, t, e[0]);
    return i != null ? i + "" : null;
  } else if (n) {
    for (var a = [], o = 0; o < e.length; o++)
      a.push(_s(r, t, e[o]));
    return a.join(" ");
  }
}
function XL(r, t) {
  var e = r.mapDimensionsAll("defaultedLabel");
  if (!q(t))
    return t + "";
  for (var n = [], i = 0; i < e.length; i++) {
    var a = r.getDimensionIndex(e[i]);
    a >= 0 && n.push(t[a]);
  }
  return n.join(" ");
}
var Ju = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a) {
      var o = r.call(this) || this;
      return o.updateData(e, n, i, a), o;
    }
    return t.prototype._createSymbol = function(e, n, i, a, o) {
      this.removeAll();
      var s = yt(e, -1, -1, 2, 2, null, o);
      s.attr({
        z2: 100,
        culling: !0,
        scaleX: a[0] / 2,
        scaleY: a[1] / 2
      }), s.drift = u9, this._symbolType = e, this.add(s);
    }, t.prototype.stopSymbolAnimation = function(e) {
      this.childAt(0).stopAnimation(null, e);
    }, t.prototype.getSymbolType = function() {
      return this._symbolType;
    }, t.prototype.getSymbolPath = function() {
      return this.childAt(0);
    }, t.prototype.highlight = function() {
      oi(this.childAt(0));
    }, t.prototype.downplay = function() {
      si(this.childAt(0));
    }, t.prototype.setZ = function(e, n) {
      var i = this.childAt(0);
      i.zlevel = e, i.z = n;
    }, t.prototype.setDraggable = function(e, n) {
      var i = this.childAt(0);
      i.draggable = e, i.cursor = !n && e ? "move" : i.cursor;
    }, t.prototype.updateData = function(e, n, i, a) {
      this.silent = !1;
      var o = e.getItemVisual(n, "symbol") || "circle", s = e.hostModel, l = t.getSymbolSize(e, n), u = o !== this._symbolType, c = a && a.disableAnimation;
      if (u) {
        var f = e.getItemVisual(n, "symbolKeepAspect");
        this._createSymbol(o, e, n, l, f);
      } else {
        var h = this.childAt(0);
        h.silent = !1;
        var v = {
          scaleX: l[0] / 2,
          scaleY: l[1] / 2
        };
        c ? h.attr(v) : Ne(h, v, s, n), un(h);
      }
      if (this._updateCommon(e, n, l, i, a), u) {
        var h = this.childAt(0);
        if (!c) {
          var v = {
            scaleX: this._sizeX,
            scaleY: this._sizeY,
            style: {
              // Always fadeIn. Because it has fadeOut animation when symbol is removed..
              opacity: h.style.opacity
            }
          };
          h.scaleX = h.scaleY = 0, h.style.opacity = 0, st(h, v, s, n);
        }
      }
      c && this.childAt(0).stopAnimation("leave");
    }, t.prototype._updateCommon = function(e, n, i, a, o) {
      var s = this.childAt(0), l = e.hostModel, u, c, f, h, v, d, p, g, m;
      if (a && (u = a.emphasisItemStyle, c = a.blurItemStyle, f = a.selectItemStyle, h = a.focus, v = a.blurScope, p = a.labelStatesModels, g = a.hoverScale, m = a.cursorStyle, d = a.emphasisDisabled), !a || e.hasItemOption) {
        var y = a && a.itemModel ? a.itemModel : e.getItemModel(n), _ = y.getModel("emphasis");
        u = _.getModel("itemStyle").getItemStyle(), f = y.getModel(["select", "itemStyle"]).getItemStyle(), c = y.getModel(["blur", "itemStyle"]).getItemStyle(), h = _.get("focus"), v = _.get("blurScope"), d = _.get("disabled"), p = Mt(y), g = _.getShallow("scale"), m = y.getShallow("cursor");
      }
      var b = e.getItemVisual(n, "symbolRotate");
      s.attr("rotation", (b || 0) * Math.PI / 180 || 0);
      var S = Co(e.getItemVisual(n, "symbolOffset"), i);
      S && (s.x = S[0], s.y = S[1]), m && s.attr("cursor", m);
      var x = e.getItemVisual(n, "style"), w = x.fill;
      if (s instanceof Pt) {
        var C = s.style;
        s.useStyle(H({
          // TODO other properties like x, y ?
          image: C.image,
          x: C.x,
          y: C.y,
          width: C.width,
          height: C.height
        }, x));
      } else
        s.__isEmptyBrush ? s.useStyle(H({}, x)) : s.useStyle(x), s.style.decal = null, s.setColor(w, o && o.symbolInnerColor), s.style.strokeNoScale = !0;
      var D = e.getItemVisual(n, "liftZ"), A = this._z2;
      D != null ? A == null && (this._z2 = s.z2, s.z2 += D) : A != null && (s.z2 = A, this._z2 = null);
      var T = o && o.useNameLabel;
      Bt(s, p, {
        labelFetcher: l,
        labelDataIndex: n,
        defaultText: L,
        inheritColor: w,
        defaultOpacity: x.opacity
      });
      function L(P) {
        return T ? e.getName(P) : xs(e, P);
      }
      this._sizeX = i[0] / 2, this._sizeY = i[1] / 2;
      var E = s.ensureState("emphasis");
      E.style = u, s.ensureState("select").style = f, s.ensureState("blur").style = c;
      var I = g == null || g === !0 ? Math.max(1.1, 3 / this._sizeY) : isFinite(g) && g > 0 ? +g : 1;
      E.scaleX = this._sizeX * I, E.scaleY = this._sizeY * I, this.setSymbolScale(1), ut(this, h, v, d);
    }, t.prototype.setSymbolScale = function(e) {
      this.scaleX = this.scaleY = e;
    }, t.prototype.fadeOut = function(e, n, i) {
      var a = this.childAt(0), o = pe(this).dataIndex, s = i && i.animation;
      if (this.silent = a.silent = !0, i && i.fadeLabel) {
        var l = a.getTextContent();
        l && Ji(l, {
          style: {
            opacity: 0
          }
        }, n, {
          dataIndex: o,
          removeOpt: s,
          cb: function() {
            a.removeTextContent();
          }
        });
      } else
        a.removeTextContent();
      Ji(a, {
        style: {
          opacity: 0
        },
        scaleX: 0,
        scaleY: 0
      }, n, {
        dataIndex: o,
        cb: e,
        removeOpt: s
      });
    }, t.getSymbolSize = function(e, n) {
      return $s(e.getItemVisual(n, "symbolSize"));
    }, t;
  }(fe)
);
function u9(r, t) {
  this.parent.drift(r, t);
}
function vp(r, t, e, n) {
  return t && !isNaN(t[0]) && !isNaN(t[1]) && !(n.isIgnore && n.isIgnore(e)) && !(n.clipShape && !n.clipShape.contain(t[0], t[1])) && r.getItemVisual(e, "symbol") !== "none";
}
function a2(r) {
  return r != null && !ue(r) && (r = {
    isIgnore: r
  }), r || {};
}
function o2(r) {
  var t = r.hostModel, e = t.getModel("emphasis");
  return {
    emphasisItemStyle: e.getModel("itemStyle").getItemStyle(),
    blurItemStyle: t.getModel(["blur", "itemStyle"]).getItemStyle(),
    selectItemStyle: t.getModel(["select", "itemStyle"]).getItemStyle(),
    focus: e.get("focus"),
    blurScope: e.get("blurScope"),
    emphasisDisabled: e.get("disabled"),
    hoverScale: e.get("scale"),
    labelStatesModels: Mt(t),
    cursorStyle: t.get("cursor")
  };
}
var Qu = (
  /** @class */
  function() {
    function r(t) {
      this.group = new fe(), this._SymbolCtor = t || Ju;
    }
    return r.prototype.updateData = function(t, e) {
      this._progressiveEls = null, e = a2(e);
      var n = this.group, i = t.hostModel, a = this._data, o = this._SymbolCtor, s = e.disableAnimation, l = o2(t), u = {
        disableAnimation: s
      }, c = e.getSymbolPoint || function(f) {
        return t.getItemLayout(f);
      };
      a || n.removeAll(), t.diff(a).add(function(f) {
        var h = c(f);
        if (vp(t, h, f, e)) {
          var v = new o(t, f, l, u);
          v.setPosition(h), t.setItemGraphicEl(f, v), n.add(v);
        }
      }).update(function(f, h) {
        var v = a.getItemGraphicEl(h), d = c(f);
        if (!vp(t, d, f, e)) {
          n.remove(v);
          return;
        }
        var p = t.getItemVisual(f, "symbol") || "circle", g = v && v.getSymbolType && v.getSymbolType();
        if (!v || g && g !== p)
          n.remove(v), v = new o(t, f, l, u), v.setPosition(d);
        else {
          v.updateData(t, f, l, u);
          var m = {
            x: d[0],
            y: d[1]
          };
          s ? v.attr(m) : Ne(v, m, i);
        }
        n.add(v), t.setItemGraphicEl(f, v);
      }).remove(function(f) {
        var h = a.getItemGraphicEl(f);
        h && h.fadeOut(function() {
          n.remove(h);
        }, i);
      }).execute(), this._getSymbolPoint = c, this._data = t;
    }, r.prototype.updateLayout = function() {
      var t = this, e = this._data;
      e && e.eachItemGraphicEl(function(n, i) {
        var a = t._getSymbolPoint(i);
        n.setPosition(a), n.markRedraw();
      });
    }, r.prototype.incrementalPrepareUpdate = function(t) {
      this._seriesScope = o2(t), this._data = null, this.group.removeAll();
    }, r.prototype.incrementalUpdate = function(t, e, n) {
      this._progressiveEls = [], n = a2(n);
      function i(l) {
        l.isGroup || (l.incremental = !0, l.ensureState("emphasis").hoverLayer = !0);
      }
      for (var a = t.start; a < t.end; a++) {
        var o = e.getItemLayout(a);
        if (vp(e, o, a, n)) {
          var s = new this._SymbolCtor(e, a, this._seriesScope);
          s.traverse(i), s.setPosition(o), this.group.add(s), e.setItemGraphicEl(a, s), this._progressiveEls.push(s);
        }
      }
    }, r.prototype.eachRendered = function(t) {
      sa(this._progressiveEls || this.group, t);
    }, r.prototype.remove = function(t) {
      var e = this.group, n = this._data;
      n && t ? n.eachItemGraphicEl(function(i) {
        i.fadeOut(function() {
          e.remove(i);
        }, n.hostModel);
      }) : e.removeAll();
    }, r;
  }()
);
function jL(r, t, e) {
  var n = r.getBaseAxis(), i = r.getOtherAxis(n), a = c9(i, e), o = n.dim, s = i.dim, l = t.mapDimension(s), u = t.mapDimension(o), c = s === "x" || s === "radius" ? 1 : 0, f = U(r.dimensions, function(d) {
    return t.mapDimension(d);
  }), h = !1, v = t.getCalculationInfo("stackResultDimension");
  return ea(
    t,
    f[0]
    /* , dims[1] */
  ) && (h = !0, f[0] = v), ea(
    t,
    f[1]
    /* , dims[0] */
  ) && (h = !0, f[1] = v), {
    dataDimsForPoint: f,
    valueStart: a,
    valueAxisDim: s,
    baseAxisDim: o,
    stacked: !!h,
    valueDim: l,
    baseDim: u,
    baseDataOffset: c,
    stackedOverDimension: t.getCalculationInfo("stackedOverDimension")
  };
}
function c9(r, t) {
  var e = 0, n = r.scale.getExtent();
  return t === "start" ? e = n[0] : t === "end" ? e = n[1] : Be(t) && !isNaN(t) ? e = t : n[0] > 0 ? e = n[0] : n[1] < 0 && (e = n[1]), e;
}
function KL(r, t, e, n) {
  var i = NaN;
  r.stacked && (i = e.get(e.getCalculationInfo("stackedOverDimension"), n)), isNaN(i) && (i = r.valueStart);
  var a = r.baseDataOffset, o = [];
  return o[a] = e.get(r.baseDim, n), o[1 - a] = i, t.dataToPoint(o);
}
function f9(r, t) {
  var e = [];
  return t.diff(r).add(function(n) {
    e.push({
      cmd: "+",
      idx: n
    });
  }).update(function(n, i) {
    e.push({
      cmd: "=",
      idx: i,
      idx1: n
    });
  }).remove(function(n) {
    e.push({
      cmd: "-",
      idx: n
    });
  }).execute(), e;
}
function h9(r, t, e, n, i, a, o, s) {
  for (var l = f9(r, t), u = [], c = [], f = [], h = [], v = [], d = [], p = [], g = jL(i, t, o), m = r.getLayout("points") || [], y = t.getLayout("points") || [], _ = 0; _ < l.length; _++) {
    var b = l[_], S = !0, x = void 0, w = void 0;
    switch (b.cmd) {
      case "=":
        x = b.idx * 2, w = b.idx1 * 2;
        var C = m[x], D = m[x + 1], A = y[w], T = y[w + 1];
        (isNaN(C) || isNaN(D)) && (C = A, D = T), u.push(C, D), c.push(A, T), f.push(e[x], e[x + 1]), h.push(n[w], n[w + 1]), p.push(t.getRawIndex(b.idx1));
        break;
      case "+":
        var L = b.idx, E = g.dataDimsForPoint, I = i.dataToPoint([t.get(E[0], L), t.get(E[1], L)]);
        w = L * 2, u.push(I[0], I[1]), c.push(y[w], y[w + 1]);
        var P = KL(g, i, t, L);
        f.push(P[0], P[1]), h.push(n[w], n[w + 1]), p.push(t.getRawIndex(L));
        break;
      case "-":
        S = !1;
    }
    S && (v.push(b), d.push(d.length));
  }
  d.sort(function(ie, Me) {
    return p[ie] - p[Me];
  });
  for (var R = u.length, F = Mn(R), O = Mn(R), z = Mn(R), G = Mn(R), W = [], _ = 0; _ < d.length; _++) {
    var Y = d[_], j = _ * 2, ee = Y * 2;
    F[j] = u[ee], F[j + 1] = u[ee + 1], O[j] = c[ee], O[j + 1] = c[ee + 1], z[j] = f[ee], z[j + 1] = f[ee + 1], G[j] = h[ee], G[j + 1] = h[ee + 1], W[_] = v[Y];
  }
  return {
    current: F,
    next: O,
    stackedOnCurrent: z,
    stackedOnNext: G,
    status: W
  };
}
var Ai = Math.min, Di = Math.max;
function lo(r, t) {
  return isNaN(r) || isNaN(t);
}
function Nm(r, t, e, n, i, a, o, s, l) {
  for (var u, c, f, h, v, d, p = e, g = 0; g < n; g++) {
    var m = t[p * 2], y = t[p * 2 + 1];
    if (p >= i || p < 0)
      break;
    if (lo(m, y)) {
      if (l) {
        p += a;
        continue;
      }
      break;
    }
    if (p === e)
      r[a > 0 ? "moveTo" : "lineTo"](m, y), f = m, h = y;
    else {
      var _ = m - u, b = y - c;
      if (_ * _ + b * b < 0.5) {
        p += a;
        continue;
      }
      if (o > 0) {
        for (var S = p + a, x = t[S * 2], w = t[S * 2 + 1]; x === m && w === y && g < n; )
          g++, S += a, p += a, x = t[S * 2], w = t[S * 2 + 1], m = t[p * 2], y = t[p * 2 + 1], _ = m - u, b = y - c;
        var C = g + 1;
        if (l)
          for (; lo(x, w) && C < n; )
            C++, S += a, x = t[S * 2], w = t[S * 2 + 1];
        var D = 0.5, A = 0, T = 0, L = void 0, E = void 0;
        if (C >= n || lo(x, w))
          v = m, d = y;
        else {
          A = x - u, T = w - c;
          var I = m - u, P = x - m, R = y - c, F = w - y, O = void 0, z = void 0;
          if (s === "x") {
            O = Math.abs(I), z = Math.abs(P);
            var G = A > 0 ? 1 : -1;
            v = m - G * O * o, d = y, L = m + G * z * o, E = y;
          } else if (s === "y") {
            O = Math.abs(R), z = Math.abs(F);
            var W = T > 0 ? 1 : -1;
            v = m, d = y - W * O * o, L = m, E = y + W * z * o;
          } else
            O = Math.sqrt(I * I + R * R), z = Math.sqrt(P * P + F * F), D = z / (z + O), v = m - A * o * (1 - D), d = y - T * o * (1 - D), L = m + A * o * D, E = y + T * o * D, L = Ai(L, Di(x, m)), E = Ai(E, Di(w, y)), L = Di(L, Ai(x, m)), E = Di(E, Ai(w, y)), A = L - m, T = E - y, v = m - A * O / z, d = y - T * O / z, v = Ai(v, Di(u, m)), d = Ai(d, Di(c, y)), v = Di(v, Ai(u, m)), d = Di(d, Ai(c, y)), A = m - v, T = y - d, L = m + A * z / O, E = y + T * z / O;
        }
        r.bezierCurveTo(f, h, v, d, m, y), f = L, h = E;
      } else
        r.lineTo(m, y);
    }
    u = m, c = y, p += a;
  }
  return g;
}
var JL = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.smooth = 0, this.smoothConstraint = !0;
    }
    return r;
  }()
), v9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "ec-polyline", n;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: "#000",
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new JL();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.points, a = 0, o = i.length / 2;
      if (n.connectNulls) {
        for (; o > 0 && lo(i[o * 2 - 2], i[o * 2 - 1]); o--)
          ;
        for (; a < o && lo(i[a * 2], i[a * 2 + 1]); a++)
          ;
      }
      for (; a < o; )
        a += Nm(e, i, a, o, o, 1, n.smooth, n.smoothMonotone, n.connectNulls) + 1;
    }, t.prototype.getPointOn = function(e, n) {
      this.path || (this.createPathProxy(), this.buildPath(this.path, this.shape));
      for (var i = this.path, a = i.data, o = Bn.CMD, s, l, u = n === "x", c = [], f = 0; f < a.length; ) {
        var h = a[f++], v = void 0, d = void 0, p = void 0, g = void 0, m = void 0, y = void 0, _ = void 0;
        switch (h) {
          case o.M:
            s = a[f++], l = a[f++];
            break;
          case o.L:
            if (v = a[f++], d = a[f++], _ = u ? (e - s) / (v - s) : (e - l) / (d - l), _ <= 1 && _ >= 0) {
              var b = u ? (d - l) * _ + l : (v - s) * _ + s;
              return u ? [e, b] : [b, e];
            }
            s = v, l = d;
            break;
          case o.C:
            v = a[f++], d = a[f++], p = a[f++], g = a[f++], m = a[f++], y = a[f++];
            var S = u ? Qf(s, v, p, m, e, c) : Qf(l, d, g, y, e, c);
            if (S > 0)
              for (var x = 0; x < S; x++) {
                var w = c[x];
                if (w <= 1 && w >= 0) {
                  var b = u ? wt(l, d, g, y, w) : wt(s, v, p, m, w);
                  return u ? [e, b] : [b, e];
                }
              }
            s = m, l = y;
            break;
        }
      }
    }, t;
  }(Te)
), d9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t;
  }(JL)
), QL = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "ec-polygon", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new d9();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.points, a = n.stackedOnPoints, o = 0, s = i.length / 2, l = n.smoothMonotone;
      if (n.connectNulls) {
        for (; s > 0 && lo(i[s * 2 - 2], i[s * 2 - 1]); s--)
          ;
        for (; o < s && lo(i[o * 2], i[o * 2 + 1]); o++)
          ;
      }
      for (; o < s; ) {
        var u = Nm(e, i, o, s, s, 1, n.smooth, l, n.connectNulls);
        Nm(e, a, o + u - 1, u, s, -1, n.stackedOnSmooth, l, n.connectNulls), o += u + 1, e.closePath();
      }
    }, t;
  }(Te)
);
function eE(r, t, e, n, i) {
  var a = r.getArea(), o = a.x, s = a.y, l = a.width, u = a.height, c = e.get(["lineStyle", "width"]) || 0;
  o -= c / 2, s -= c / 2, l += c, u += c, l = Math.ceil(l), o !== Math.floor(o) && (o = Math.floor(o), l++);
  var f = new ke({
    shape: {
      x: o,
      y: s,
      width: l,
      height: u
    }
  });
  if (t) {
    var h = r.getBaseAxis(), v = h.isHorizontal(), d = h.inverse;
    v ? (d && (f.shape.x += l), f.shape.width = 0) : (d || (f.shape.y += u), f.shape.height = 0);
    var p = oe(i) ? function(g) {
      i(g, f);
    } : null;
    st(f, {
      shape: {
        width: l,
        height: u,
        x: o,
        y: s
      }
    }, e, null, n, p);
  }
  return f;
}
function tE(r, t, e) {
  var n = r.getArea(), i = ht(n.r0, 1), a = ht(n.r, 1), o = new ir({
    shape: {
      cx: ht(r.cx, 1),
      cy: ht(r.cy, 1),
      r0: i,
      r: a,
      startAngle: n.startAngle,
      endAngle: n.endAngle,
      clockwise: n.clockwise
    }
  });
  if (t) {
    var s = r.getBaseAxis().dim === "angle";
    s ? o.shape.endAngle = n.startAngle : o.shape.r = i, st(o, {
      shape: {
        endAngle: n.endAngle,
        r: a
      }
    }, e);
  }
  return o;
}
function ec(r, t, e, n, i) {
  if (r) {
    if (r.type === "polar")
      return tE(r, t, e);
    if (r.type === "cartesian2d")
      return eE(r, t, e, n, i);
  } else return null;
  return null;
}
function Do(r, t) {
  return r.type === t;
}
function s2(r, t) {
  if (r.length === t.length) {
    for (var e = 0; e < r.length; e++)
      if (r[e] !== t[e])
        return;
    return !0;
  }
}
function l2(r) {
  for (var t = 1 / 0, e = 1 / 0, n = -1 / 0, i = -1 / 0, a = 0; a < r.length; ) {
    var o = r[a++], s = r[a++];
    isNaN(o) || (t = Math.min(o, t), n = Math.max(o, n)), isNaN(s) || (e = Math.min(s, e), i = Math.max(s, i));
  }
  return [[t, e], [n, i]];
}
function u2(r, t) {
  var e = l2(r), n = e[0], i = e[1], a = l2(t), o = a[0], s = a[1];
  return Math.max(Math.abs(n[0] - o[0]), Math.abs(n[1] - o[1]), Math.abs(i[0] - s[0]), Math.abs(i[1] - s[1]));
}
function c2(r) {
  return Be(r) ? r : r ? 0.5 : 0;
}
function p9(r, t, e) {
  if (!e.valueDim)
    return [];
  for (var n = t.count(), i = Mn(n * 2), a = 0; a < n; a++) {
    var o = KL(e, r, t, a);
    i[a * 2] = o[0], i[a * 2 + 1] = o[1];
  }
  return i;
}
function Ti(r, t, e, n, i) {
  var a = e.getBaseAxis(), o = a.dim === "x" || a.dim === "radius" ? 0 : 1, s = [], l = 0, u = [], c = [], f = [], h = [];
  if (i) {
    for (l = 0; l < r.length; l += 2) {
      var v = t || r;
      !isNaN(v[l]) && !isNaN(v[l + 1]) && h.push(r[l], r[l + 1]);
    }
    r = h;
  }
  for (l = 0; l < r.length - 2; l += 2)
    switch (f[0] = r[l + 2], f[1] = r[l + 3], c[0] = r[l], c[1] = r[l + 1], s.push(c[0], c[1]), n) {
      case "end":
        u[o] = f[o], u[1 - o] = c[1 - o], s.push(u[0], u[1]);
        break;
      case "middle":
        var d = (c[o] + f[o]) / 2, p = [];
        u[o] = p[o] = d, u[1 - o] = c[1 - o], p[1 - o] = f[1 - o], s.push(u[0], u[1]), s.push(p[0], p[1]);
        break;
      default:
        u[o] = c[o], u[1 - o] = f[1 - o], s.push(u[0], u[1]);
    }
  return s.push(r[l++], r[l++]), s;
}
function g9(r, t) {
  var e = [], n = r.length, i, a;
  function o(c, f, h) {
    var v = c.coord, d = (h - v) / (f.coord - v), p = oB(d, [c.color, f.color]);
    return {
      coord: h,
      color: p
    };
  }
  for (var s = 0; s < n; s++) {
    var l = r[s], u = l.coord;
    if (u < 0)
      i = l;
    else if (u > t) {
      a ? e.push(o(a, l, t)) : i && e.push(o(i, l, 0), o(i, l, t));
      break;
    } else
      i && (e.push(o(i, l, 0)), i = null), e.push(l), a = l;
  }
  return e;
}
function m9(r, t, e) {
  var n = r.getVisual("visualMeta");
  if (!(!n || !n.length || !r.count()) && t.type === "cartesian2d") {
    for (var i, a, o = n.length - 1; o >= 0; o--) {
      var s = r.getDimensionInfo(n[o].dimension);
      if (i = s && s.coordDim, i === "x" || i === "y") {
        a = n[o];
        break;
      }
    }
    if (a) {
      var l = t.getAxis(i), u = U(a.stops, function(_) {
        return {
          coord: l.toGlobalCoord(l.dataToCoord(_.value)),
          color: _.color
        };
      }), c = u.length, f = a.outerColors.slice();
      c && u[0].coord > u[c - 1].coord && (u.reverse(), f.reverse());
      var h = g9(u, i === "x" ? e.getWidth() : e.getHeight()), v = h.length;
      if (!v && c)
        return u[0].coord < 0 ? f[1] ? f[1] : u[c - 1].color : f[0] ? f[0] : u[0].color;
      var d = 10, p = h[0].coord - d, g = h[v - 1].coord + d, m = g - p;
      if (m < 1e-3)
        return "transparent";
      M(h, function(_) {
        _.offset = (_.coord - p) / m;
      }), h.push({
        // NOTE: inRangeStopLen may still be 0 if stoplen is zero.
        offset: v ? h[v - 1].offset : 0.5,
        color: f[1] || "transparent"
      }), h.unshift({
        offset: v ? h[0].offset : 0.5,
        color: f[0] || "transparent"
      });
      var y = new Wu(0, 0, 0, 0, h, !0);
      return y[i] = p, y[i + "2"] = g, y;
    }
  }
}
function y9(r, t, e) {
  var n = r.get("showAllSymbol"), i = n === "auto";
  if (!(n && !i)) {
    var a = e.getAxesByScale("ordinal")[0];
    if (a && !(i && _9(a, t))) {
      var o = t.mapDimension(a.dim), s = {};
      return M(a.getViewLabels(), function(l) {
        var u = a.scale.getRawOrdinalNumber(l.tickValue);
        s[u] = 1;
      }), function(l) {
        return !s.hasOwnProperty(t.get(o, l));
      };
    }
  }
}
function _9(r, t) {
  var e = r.getExtent(), n = Math.abs(e[1] - e[0]) / r.scale.count();
  isNaN(n) && (n = 0);
  for (var i = t.count(), a = Math.max(1, Math.round(i / 5)), o = 0; o < i; o += a)
    if (Ju.getSymbolSize(
      t,
      o
      // Only for cartesian, where `isHorizontal` exists.
    )[r.isHorizontal() ? 1 : 0] * 1.5 > n)
      return !1;
  return !0;
}
function b9(r, t) {
  return isNaN(r) || isNaN(t);
}
function S9(r) {
  for (var t = r.length / 2; t > 0 && b9(r[t * 2 - 2], r[t * 2 - 1]); t--)
    ;
  return t - 1;
}
function f2(r, t) {
  return [r[t * 2], r[t * 2 + 1]];
}
function x9(r, t, e) {
  for (var n = r.length / 2, i = e === "x" ? 0 : 1, a, o, s = 0, l = -1, u = 0; u < n; u++)
    if (o = r[u * 2 + i], !(isNaN(o) || isNaN(r[u * 2 + 1 - i]))) {
      if (u === 0) {
        a = o;
        continue;
      }
      if (a <= t && o >= t || a >= t && o <= t) {
        l = u;
        break;
      }
      s = u, a = o;
    }
  return {
    range: [s, l],
    t: (t - a) / (o - a)
  };
}
function rE(r) {
  if (r.get(["endLabel", "show"]))
    return !0;
  for (var t = 0; t < nr.length; t++)
    if (r.get([nr[t], "endLabel", "show"]))
      return !0;
  return !1;
}
function dp(r, t, e, n) {
  if (Do(t, "cartesian2d")) {
    var i = n.getModel("endLabel"), a = i.get("valueAnimation"), o = n.getData(), s = {
      lastFrameIndex: 0
    }, l = rE(n) ? function(v, d) {
      r._endLabelOnDuring(v, d, o, s, a, i, t);
    } : null, u = t.getBaseAxis().isHorizontal(), c = eE(t, e, n, function() {
      var v = r._endLabel;
      v && e && s.originalX != null && v.attr({
        x: s.originalX,
        y: s.originalY
      });
    }, l);
    if (!n.get("clip", !0)) {
      var f = c.shape, h = Math.max(f.width, f.height);
      u ? (f.y -= h, f.height += h * 2) : (f.x -= h, f.width += h * 2);
    }
    return l && l(1, c), c;
  } else
    return tE(t, e, n);
}
function w9(r, t) {
  var e = t.getBaseAxis(), n = e.isHorizontal(), i = e.inverse, a = n ? i ? "right" : "left" : "center", o = n ? "middle" : i ? "top" : "bottom";
  return {
    normal: {
      align: r.get("align") || a,
      verticalAlign: r.get("verticalAlign") || o
    }
  };
}
var C9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.init = function() {
      var e = new fe(), n = new Qu();
      this.group.add(n.group), this._symbolDraw = n, this._lineGroup = e, this._changePolyState = Q(this._changePolyState, this);
    }, t.prototype.render = function(e, n, i) {
      var a = e.coordinateSystem, o = this.group, s = e.getData(), l = e.getModel("lineStyle"), u = e.getModel("areaStyle"), c = s.getLayout("points") || [], f = a.type === "polar", h = this._coordSys, v = this._symbolDraw, d = this._polyline, p = this._polygon, g = this._lineGroup, m = !n.ssr && e.get("animation"), y = !u.isEmpty(), _ = u.get("origin"), b = jL(a, s, _), S = y && p9(a, s, b), x = e.get("showSymbol"), w = e.get("connectNulls"), C = x && !f && y9(e, s, a), D = this._data;
      D && D.eachItemGraphicEl(function(ie, Me) {
        ie.__temp && (o.remove(ie), D.setItemGraphicEl(Me, null));
      }), x || v.remove(), o.add(g);
      var A = f ? !1 : e.get("step"), T;
      a && a.getArea && e.get("clip", !0) && (T = a.getArea(), T.width != null ? (T.x -= 0.1, T.y -= 0.1, T.width += 0.2, T.height += 0.2) : T.r0 && (T.r0 -= 0.5, T.r += 0.5)), this._clipShapeForSymbol = T;
      var L = m9(s, a, i) || s.getVisual("style")[s.getVisual("drawType")];
      if (!(d && h.type === a.type && A === this._step))
        x && v.updateData(s, {
          isIgnore: C,
          clipShape: T,
          disableAnimation: !0,
          getSymbolPoint: function(ie) {
            return [c[ie * 2], c[ie * 2 + 1]];
          }
        }), m && this._initSymbolLabelAnimation(s, a, T), A && (S && (S = Ti(S, c, a, A, w)), c = Ti(c, null, a, A, w)), d = this._newPolyline(c), y ? p = this._newPolygon(c, S) : p && (g.remove(p), p = this._polygon = null), f || this._initOrUpdateEndLabel(e, a, mo(L)), g.setClipPath(dp(this, a, !0, e));
      else {
        y && !p ? p = this._newPolygon(c, S) : p && !y && (g.remove(p), p = this._polygon = null), f || this._initOrUpdateEndLabel(e, a, mo(L));
        var E = g.getClipPath();
        if (E) {
          var I = dp(this, a, !1, e);
          st(E, {
            shape: I.shape
          }, e);
        } else
          g.setClipPath(dp(this, a, !0, e));
        x && v.updateData(s, {
          isIgnore: C,
          clipShape: T,
          disableAnimation: !0,
          getSymbolPoint: function(ie) {
            return [c[ie * 2], c[ie * 2 + 1]];
          }
        }), (!s2(this._stackedOnPoints, S) || !s2(this._points, c)) && (m ? this._doUpdateAnimation(s, S, a, i, A, _, w) : (A && (S && (S = Ti(S, c, a, A, w)), c = Ti(c, null, a, A, w)), d.setShape({
          points: c
        }), p && p.setShape({
          points: c,
          stackedOnPoints: S
        })));
      }
      var P = e.getModel("emphasis"), R = P.get("focus"), F = P.get("blurScope"), O = P.get("disabled");
      if (d.useStyle(se(
        // Use color in lineStyle first
        l.getLineStyle(),
        {
          fill: "none",
          stroke: L,
          lineJoin: "bevel"
        }
      )), Ft(d, e, "lineStyle"), d.style.lineWidth > 0 && e.get(["emphasis", "lineStyle", "width"]) === "bolder") {
        var z = d.getState("emphasis").style;
        z.lineWidth = +d.style.lineWidth + 1;
      }
      pe(d).seriesIndex = e.seriesIndex, ut(d, R, F, O);
      var G = c2(e.get("smooth")), W = e.get("smoothMonotone");
      if (d.setShape({
        smooth: G,
        smoothMonotone: W,
        connectNulls: w
      }), p) {
        var Y = s.getCalculationInfo("stackedOnSeries"), j = 0;
        p.useStyle(se(u.getAreaStyle(), {
          fill: L,
          opacity: 0.7,
          lineJoin: "bevel",
          decal: s.getVisual("style").decal
        })), Y && (j = c2(Y.get("smooth"))), p.setShape({
          smooth: G,
          stackedOnSmooth: j,
          smoothMonotone: W,
          connectNulls: w
        }), Ft(p, e, "areaStyle"), pe(p).seriesIndex = e.seriesIndex, ut(p, R, F, O);
      }
      var ee = this._changePolyState;
      s.eachItemGraphicEl(function(ie) {
        ie && (ie.onHoverStateChange = ee);
      }), this._polyline.onHoverStateChange = ee, this._data = s, this._coordSys = a, this._stackedOnPoints = S, this._points = c, this._step = A, this._valueOrigin = _, e.get("triggerLineEvent") && (this.packEventData(e, d), p && this.packEventData(e, p));
    }, t.prototype.packEventData = function(e, n) {
      pe(n).eventData = {
        componentType: "series",
        componentSubType: "line",
        componentIndex: e.componentIndex,
        seriesIndex: e.seriesIndex,
        seriesName: e.name,
        seriesType: "line"
      };
    }, t.prototype.highlight = function(e, n, i, a) {
      var o = e.getData(), s = vo(o, a);
      if (this._changePolyState("emphasis"), !(s instanceof Array) && s != null && s >= 0) {
        var l = o.getLayout("points"), u = o.getItemGraphicEl(s);
        if (!u) {
          var c = l[s * 2], f = l[s * 2 + 1];
          if (isNaN(c) || isNaN(f) || this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(c, f))
            return;
          var h = e.get("zlevel") || 0, v = e.get("z") || 0;
          u = new Ju(o, s), u.x = c, u.y = f, u.setZ(h, v);
          var d = u.getSymbolPath().getTextContent();
          d && (d.zlevel = h, d.z = v, d.z2 = this._polyline.z2 + 1), u.__temp = !0, o.setItemGraphicEl(s, u), u.stopSymbolAnimation(!0), this.group.add(u);
        }
        u.highlight();
      } else
        Qe.prototype.highlight.call(this, e, n, i, a);
    }, t.prototype.downplay = function(e, n, i, a) {
      var o = e.getData(), s = vo(o, a);
      if (this._changePolyState("normal"), s != null && s >= 0) {
        var l = o.getItemGraphicEl(s);
        l && (l.__temp ? (o.setItemGraphicEl(s, null), this.group.remove(l)) : l.downplay());
      } else
        Qe.prototype.downplay.call(this, e, n, i, a);
    }, t.prototype._changePolyState = function(e) {
      var n = this._polygon;
      oh(this._polyline, e), n && oh(n, e);
    }, t.prototype._newPolyline = function(e) {
      var n = this._polyline;
      return n && this._lineGroup.remove(n), n = new v9({
        shape: {
          points: e
        },
        segmentIgnoreThreshold: 2,
        z2: 10
      }), this._lineGroup.add(n), this._polyline = n, n;
    }, t.prototype._newPolygon = function(e, n) {
      var i = this._polygon;
      return i && this._lineGroup.remove(i), i = new QL({
        shape: {
          points: e,
          stackedOnPoints: n
        },
        segmentIgnoreThreshold: 2
      }), this._lineGroup.add(i), this._polygon = i, i;
    }, t.prototype._initSymbolLabelAnimation = function(e, n, i) {
      var a, o, s = n.getBaseAxis(), l = s.inverse;
      n.type === "cartesian2d" ? (a = s.isHorizontal(), o = !1) : n.type === "polar" && (a = s.dim === "angle", o = !0);
      var u = e.hostModel, c = u.get("animationDuration");
      oe(c) && (c = c(null));
      var f = u.get("animationDelay") || 0, h = oe(f) ? f(null) : f;
      e.eachItemGraphicEl(function(v, d) {
        var p = v;
        if (p) {
          var g = [v.x, v.y], m = void 0, y = void 0, _ = void 0;
          if (i)
            if (o) {
              var b = i, S = n.pointToCoord(g);
              a ? (m = b.startAngle, y = b.endAngle, _ = -S[1] / 180 * Math.PI) : (m = b.r0, y = b.r, _ = S[0]);
            } else {
              var x = i;
              a ? (m = x.x, y = x.x + x.width, _ = v.x) : (m = x.y + x.height, y = x.y, _ = v.y);
            }
          var w = y === m ? 0 : (_ - m) / (y - m);
          l && (w = 1 - w);
          var C = oe(f) ? f(d) : c * w + h, D = p.getSymbolPath(), A = D.getTextContent();
          p.attr({
            scaleX: 0,
            scaleY: 0
          }), p.animateTo({
            scaleX: 1,
            scaleY: 1
          }, {
            duration: 200,
            setToFinal: !0,
            delay: C
          }), A && A.animateFrom({
            style: {
              opacity: 0
            }
          }, {
            duration: 300,
            delay: C
          }), D.disableLabelAnimation = !0;
        }
      });
    }, t.prototype._initOrUpdateEndLabel = function(e, n, i) {
      var a = e.getModel("endLabel");
      if (rE(e)) {
        var o = e.getData(), s = this._polyline, l = o.getLayout("points");
        if (!l) {
          s.removeTextContent(), this._endLabel = null;
          return;
        }
        var u = this._endLabel;
        u || (u = this._endLabel = new Fe({
          z2: 200
          // should be higher than item symbol
        }), u.ignoreClip = !0, s.setTextContent(this._endLabel), s.disableLabelAnimation = !0);
        var c = S9(l);
        c >= 0 && (Bt(s, Mt(e, "endLabel"), {
          inheritColor: i,
          labelFetcher: e,
          labelDataIndex: c,
          defaultText: function(f, h, v) {
            return v != null ? XL(o, v) : xs(o, f);
          },
          enableTextSetter: !0
        }, w9(a, n)), s.textConfig.position = null);
      } else this._endLabel && (this._polyline.removeTextContent(), this._endLabel = null);
    }, t.prototype._endLabelOnDuring = function(e, n, i, a, o, s, l) {
      var u = this._endLabel, c = this._polyline;
      if (u) {
        e < 1 && a.originalX == null && (a.originalX = u.x, a.originalY = u.y);
        var f = i.getLayout("points"), h = i.hostModel, v = h.get("connectNulls"), d = s.get("precision"), p = s.get("distance") || 0, g = l.getBaseAxis(), m = g.isHorizontal(), y = g.inverse, _ = n.shape, b = y ? m ? _.x : _.y + _.height : m ? _.x + _.width : _.y, S = (m ? p : 0) * (y ? -1 : 1), x = (m ? 0 : -p) * (y ? -1 : 1), w = m ? "x" : "y", C = x9(f, b, w), D = C.range, A = D[1] - D[0], T = void 0;
        if (A >= 1) {
          if (A > 1 && !v) {
            var L = f2(f, D[0]);
            u.attr({
              x: L[0] + S,
              y: L[1] + x
            }), o && (T = h.getRawValue(D[0]));
          } else {
            var L = c.getPointOn(b, w);
            L && u.attr({
              x: L[0] + S,
              y: L[1] + x
            });
            var E = h.getRawValue(D[0]), I = h.getRawValue(D[1]);
            o && (T = zT(i, d, E, I, C.t));
          }
          a.lastFrameIndex = D[0];
        } else {
          var P = e === 1 || a.lastFrameIndex > 0 ? D[0] : 0, L = f2(f, P);
          o && (T = h.getRawValue(P)), u.attr({
            x: L[0] + S,
            y: L[1] + x
          });
        }
        if (o) {
          var R = Rs(u);
          typeof R.setLabelText == "function" && R.setLabelText(T);
        }
      }
    }, t.prototype._doUpdateAnimation = function(e, n, i, a, o, s, l) {
      var u = this._polyline, c = this._polygon, f = e.hostModel, h = h9(this._data, e, this._stackedOnPoints, n, this._coordSys, i, this._valueOrigin), v = h.current, d = h.stackedOnCurrent, p = h.next, g = h.stackedOnNext;
      if (o && (d = Ti(h.stackedOnCurrent, h.current, i, o, l), v = Ti(h.current, null, i, o, l), g = Ti(h.stackedOnNext, h.next, i, o, l), p = Ti(h.next, null, i, o, l)), u2(v, p) > 3e3 || c && u2(d, g) > 3e3) {
        u.stopAnimation(), u.setShape({
          points: p
        }), c && (c.stopAnimation(), c.setShape({
          points: p,
          stackedOnPoints: g
        }));
        return;
      }
      u.shape.__points = h.current, u.shape.points = v;
      var m = {
        shape: {
          points: p
        }
      };
      h.current !== v && (m.shape.__points = h.next), u.stopAnimation(), Ne(u, m, f), c && (c.setShape({
        // Reuse the points with polyline.
        points: v,
        stackedOnPoints: d
      }), c.stopAnimation(), Ne(c, {
        shape: {
          stackedOnPoints: g
        }
      }, f), u.shape.points !== c.shape.points && (c.shape.points = u.shape.points));
      for (var y = [], _ = h.status, b = 0; b < _.length; b++) {
        var S = _[b].cmd;
        if (S === "=") {
          var x = e.getItemGraphicEl(_[b].idx1);
          x && y.push({
            el: x,
            ptIdx: b
            // Index of points
          });
        }
      }
      u.animators && u.animators.length && u.animators[0].during(function() {
        c && c.dirtyShape();
        for (var w = u.shape.__points, C = 0; C < y.length; C++) {
          var D = y[C].el, A = y[C].ptIdx * 2;
          D.x = w[A], D.y = w[A + 1], D.markRedraw();
        }
      });
    }, t.prototype.remove = function(e) {
      var n = this.group, i = this._data;
      this._lineGroup.removeAll(), this._symbolDraw.remove(!0), i && i.eachItemGraphicEl(function(a, o) {
        a.__temp && (n.remove(a), i.setItemGraphicEl(o, null));
      }), this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;
    }, t.type = "line", t;
  }(Qe)
);
function tc(r, t) {
  return {
    seriesType: r,
    plan: zs(),
    reset: function(e) {
      var n = e.getData(), i = e.coordinateSystem, a = e.pipelineContext, o = t || a.large;
      if (i) {
        var s = U(i.dimensions, function(v) {
          return n.mapDimension(v);
        }).slice(0, 2), l = s.length, u = n.getCalculationInfo("stackResultDimension");
        ea(n, s[0]) && (s[0] = u), ea(n, s[1]) && (s[1] = u);
        var c = n.getStore(), f = n.getDimensionIndex(s[0]), h = n.getDimensionIndex(s[1]);
        return l && {
          progress: function(v, d) {
            for (var p = v.end - v.start, g = o && Mn(p * l), m = [], y = [], _ = v.start, b = 0; _ < v.end; _++) {
              var S = void 0;
              if (l === 1) {
                var x = c.get(f, _);
                S = i.dataToPoint(x, null, y);
              } else
                m[0] = c.get(f, _), m[1] = c.get(h, _), S = i.dataToPoint(m, null, y);
              o ? (g[b++] = S[0], g[b++] = S[1]) : d.setItemLayout(_, S.slice());
            }
            o && d.setLayout("points", g);
          }
        };
      }
    }
  };
}
var A9 = {
  average: function(r) {
    for (var t = 0, e = 0, n = 0; n < r.length; n++)
      isNaN(r[n]) || (t += r[n], e++);
    return e === 0 ? NaN : t / e;
  },
  sum: function(r) {
    for (var t = 0, e = 0; e < r.length; e++)
      t += r[e] || 0;
    return t;
  },
  max: function(r) {
    for (var t = -1 / 0, e = 0; e < r.length; e++)
      r[e] > t && (t = r[e]);
    return isFinite(t) ? t : NaN;
  },
  min: function(r) {
    for (var t = 1 / 0, e = 0; e < r.length; e++)
      r[e] < t && (t = r[e]);
    return isFinite(t) ? t : NaN;
  },
  // TODO
  // Median
  nearest: function(r) {
    return r[0];
  }
}, D9 = function(r) {
  return Math.round(r.length / 2);
};
function nE(r) {
  return {
    seriesType: r,
    // FIXME:TS never used, so comment it
    // modifyOutputEnd: true,
    reset: function(t, e, n) {
      var i = t.getData(), a = t.get("sampling"), o = t.coordinateSystem, s = i.count();
      if (s > 10 && o.type === "cartesian2d" && a) {
        var l = o.getBaseAxis(), u = o.getOtherAxis(l), c = l.getExtent(), f = n.getDevicePixelRatio(), h = Math.abs(c[1] - c[0]) * (f || 1), v = Math.round(s / h);
        if (isFinite(v) && v > 1) {
          a === "lttb" ? t.setData(i.lttbDownSample(i.mapDimension(u.dim), 1 / v)) : a === "minmax" && t.setData(i.minmaxDownSample(i.mapDimension(u.dim), 1 / v));
          var d = void 0;
          J(a) ? d = A9[a] : oe(a) && (d = a), d && t.setData(i.downSample(i.mapDimension(u.dim), 1 / v, d, D9));
        }
      }
    }
  };
}
function T9(r) {
  r.registerChartView(C9), r.registerSeriesModel(l9), r.registerLayout(tc("line", !0)), r.registerVisual({
    seriesType: "line",
    reset: function(t) {
      var e = t.getData(), n = t.getModel("lineStyle").getLineStyle();
      n && !n.stroke && (n.stroke = e.getVisual("style").fill), e.setVisual("legendLineStyle", n);
    }
  }), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, nE("line"));
}
var Mu = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return gi(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getMarkerPosition = function(e, n, i) {
      var a = this.coordinateSystem;
      if (a && a.clampData) {
        var o = a.clampData(e), s = a.dataToPoint(o);
        if (i)
          M(a.getAxes(), function(h, v) {
            if (h.type === "category" && n != null) {
              var d = h.getTicksCoords(), p = h.getTickModel().get("alignWithLabel"), g = o[v], m = n[v] === "x1" || n[v] === "y1";
              if (m && !p && (g += 1), d.length < 2)
                return;
              if (d.length === 2) {
                s[v] = h.toGlobalCoord(h.getExtent()[m ? 1 : 0]);
                return;
              }
              for (var y = void 0, _ = void 0, b = 1, S = 0; S < d.length; S++) {
                var x = d[S].coord, w = S === d.length - 1 ? d[S - 1].tickValue + b : d[S].tickValue;
                if (w === g) {
                  _ = x;
                  break;
                } else if (w < g)
                  y = x;
                else if (y != null && w > g) {
                  _ = (x + y) / 2;
                  break;
                }
                S === 1 && (b = w - d[0].tickValue);
              }
              _ == null && (y ? y && (_ = d[d.length - 1].coord) : _ = d[0].coord), s[v] = h.toGlobalCoord(_);
            }
          });
        else {
          var l = this.getData(), u = l.getLayout("offset"), c = l.getLayout("size"), f = a.getBaseAxis().isHorizontal() ? 0 : 1;
          s[f] += u + c / 2;
        }
        return s;
      }
      return [NaN, NaN];
    }, t.type = "series.__base_bar__", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "cartesian2d",
      legendHoverLink: !0,
      // stack: null
      // Cartesian coordinate system
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      barMinHeight: 0,
      barMinAngle: 0,
      // cursor: null,
      large: !1,
      largeThreshold: 400,
      progressive: 3e3,
      progressiveChunkMode: "mod"
    }, t;
  }(it)
);
it.registerClass(Mu);
var M9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.getInitialData = function() {
      return gi(null, this, {
        useEncodeDefaulter: !0,
        createInvertedIndices: !!this.get("realtimeSort", !0) || null
      });
    }, t.prototype.getProgressive = function() {
      return this.get("large") ? this.get("progressive") : !1;
    }, t.prototype.getProgressiveThreshold = function() {
      var e = this.get("progressiveThreshold"), n = this.get("largeThreshold");
      return n > e && (e = n), e;
    }, t.prototype.brushSelector = function(e, n, i) {
      return i.rect(n.getItemLayout(e));
    }, t.type = "series.bar", t.dependencies = ["grid", "polar"], t.defaultOption = la(Mu.defaultOption, {
      // If clipped
      // Only available on cartesian2d
      clip: !0,
      roundCap: !1,
      showBackground: !1,
      backgroundStyle: {
        color: "rgba(180, 180, 180, 0.2)",
        borderColor: null,
        borderWidth: 0,
        borderType: "solid",
        borderRadius: 0,
        shadowBlur: 0,
        shadowColor: null,
        shadowOffsetX: 0,
        shadowOffsetY: 0,
        opacity: 1
      },
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      },
      realtimeSort: !1
    }), t;
  }(Mu)
), I9 = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.cx = 0, this.cy = 0, this.r0 = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
    }
    return r;
  }()
), Ah = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "sausage", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new I9();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.cx, a = n.cy, o = Math.max(n.r0 || 0, 0), s = Math.max(n.r, 0), l = (s - o) * 0.5, u = o + l, c = n.startAngle, f = n.endAngle, h = n.clockwise, v = Math.PI * 2, d = h ? f - c < v : c - f < v;
      d || (c = f - (h ? v : -v));
      var p = Math.cos(c), g = Math.sin(c), m = Math.cos(f), y = Math.sin(f);
      d ? (e.moveTo(p * o + i, g * o + a), e.arc(p * u + i, g * u + a, l, -Math.PI + c, c, !h)) : e.moveTo(p * s + i, g * s + a), e.arc(i, a, s, c, f, !h), e.arc(m * u + i, y * u + a, l, f - Math.PI * 2, f - Math.PI, !h), o !== 0 && e.arc(i, a, o, f, c, h);
    }, t;
  }(Te)
);
function L9(r, t) {
  t = t || {};
  var e = t.isRoundCap;
  return function(n, i, a) {
    var o = i.position;
    if (!o || o instanceof Array)
      return ih(n, i, a);
    var s = r(o), l = i.distance != null ? i.distance : 5, u = this.shape, c = u.cx, f = u.cy, h = u.r, v = u.r0, d = (h + v) / 2, p = u.startAngle, g = u.endAngle, m = (p + g) / 2, y = e ? Math.abs(h - v) / 2 : 0, _ = Math.cos, b = Math.sin, S = c + h * _(p), x = f + h * b(p), w = "left", C = "top";
    switch (s) {
      case "startArc":
        S = c + (v - l) * _(m), x = f + (v - l) * b(m), w = "center", C = "top";
        break;
      case "insideStartArc":
        S = c + (v + l) * _(m), x = f + (v + l) * b(m), w = "center", C = "bottom";
        break;
      case "startAngle":
        S = c + d * _(p) + Zc(p, l + y, !1), x = f + d * b(p) + Xc(p, l + y, !1), w = "right", C = "middle";
        break;
      case "insideStartAngle":
        S = c + d * _(p) + Zc(p, -l + y, !1), x = f + d * b(p) + Xc(p, -l + y, !1), w = "left", C = "middle";
        break;
      case "middle":
        S = c + d * _(m), x = f + d * b(m), w = "center", C = "middle";
        break;
      case "endArc":
        S = c + (h + l) * _(m), x = f + (h + l) * b(m), w = "center", C = "bottom";
        break;
      case "insideEndArc":
        S = c + (h - l) * _(m), x = f + (h - l) * b(m), w = "center", C = "top";
        break;
      case "endAngle":
        S = c + d * _(g) + Zc(g, l + y, !0), x = f + d * b(g) + Xc(g, l + y, !0), w = "left", C = "middle";
        break;
      case "insideEndAngle":
        S = c + d * _(g) + Zc(g, -l + y, !0), x = f + d * b(g) + Xc(g, -l + y, !0), w = "right", C = "middle";
        break;
      default:
        return ih(n, i, a);
    }
    return n = n || {}, n.x = S, n.y = x, n.align = w, n.verticalAlign = C, n;
  };
}
function E9(r, t, e, n) {
  if (Be(n)) {
    r.setTextConfig({
      rotation: n
    });
    return;
  } else if (q(t)) {
    r.setTextConfig({
      rotation: 0
    });
    return;
  }
  var i = r.shape, a = i.clockwise ? i.startAngle : i.endAngle, o = i.clockwise ? i.endAngle : i.startAngle, s = (a + o) / 2, l, u = e(t);
  switch (u) {
    case "startArc":
    case "insideStartArc":
    case "middle":
    case "insideEndArc":
    case "endArc":
      l = s;
      break;
    case "startAngle":
    case "insideStartAngle":
      l = a;
      break;
    case "endAngle":
    case "insideEndAngle":
      l = o;
      break;
    default:
      r.setTextConfig({
        rotation: 0
      });
      return;
  }
  var c = Math.PI * 1.5 - l;
  u === "middle" && c > Math.PI / 2 && c < Math.PI * 1.5 && (c -= Math.PI), r.setTextConfig({
    rotation: c
  });
}
function Zc(r, t, e) {
  return t * Math.sin(r) * (e ? -1 : 1);
}
function Xc(r, t, e) {
  return t * Math.cos(r) * (e ? 1 : -1);
}
function Ja(r, t, e) {
  var n = r.get("borderRadius");
  if (n == null)
    return e ? {
      cornerRadius: 0
    } : null;
  q(n) || (n = [n, n, n, n]);
  var i = Math.abs(t.r || 0 - t.r0 || 0);
  return {
    cornerRadius: U(n, function(a) {
      return ln(a, i);
    })
  };
}
var pp = Math.max, gp = Math.min;
function P9(r, t) {
  var e = r.getArea && r.getArea();
  if (Do(r, "cartesian2d")) {
    var n = r.getBaseAxis();
    if (n.type !== "category" || !n.onBand) {
      var i = t.getLayout("bandWidth");
      n.isHorizontal() ? (e.x -= i, e.width += i * 2) : (e.y -= i, e.height += i * 2);
    }
  }
  return e;
}
var k9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r.call(this) || this;
      return e.type = t.type, e._isFirstFrame = !0, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      this._model = e, this._removeOnRenderedListener(i), this._updateDrawMode(e);
      var o = e.get("coordinateSystem");
      (o === "cartesian2d" || o === "polar") && (this._progressiveEls = null, this._isLargeDraw ? this._renderLarge(e, n, i) : this._renderNormal(e, n, i, a));
    }, t.prototype.incrementalPrepareRender = function(e) {
      this._clear(), this._updateDrawMode(e), this._updateLargeClip(e);
    }, t.prototype.incrementalRender = function(e, n) {
      this._progressiveEls = [], this._incrementalRenderLarge(e, n);
    }, t.prototype.eachRendered = function(e) {
      sa(this._progressiveEls || this.group, e);
    }, t.prototype._updateDrawMode = function(e) {
      var n = e.pipelineContext.large;
      (this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
    }, t.prototype._renderNormal = function(e, n, i, a) {
      var o = this.group, s = e.getData(), l = this._data, u = e.coordinateSystem, c = u.getBaseAxis(), f;
      u.type === "cartesian2d" ? f = c.isHorizontal() : u.type === "polar" && (f = c.dim === "angle");
      var h = e.isAnimationEnabled() ? e : null, v = R9(e, u);
      v && this._enableRealtimeSort(v, s, i);
      var d = e.get("clip", !0) || v, p = P9(u, s);
      o.removeClipPath();
      var g = e.get("roundCap", !0), m = e.get("showBackground", !0), y = e.getModel("backgroundStyle"), _ = y.get("borderRadius") || 0, b = [], S = this._backgroundEls, x = a && a.isInitSort, w = a && a.type === "changeAxisOrder";
      function C(T) {
        var L = jc[u.type](s, T), E = $9(u, f, L);
        return E.useStyle(y.getItemStyle()), u.type === "cartesian2d" ? E.setShape("r", _) : E.setShape("cornerRadius", _), b[T] = E, E;
      }
      s.diff(l).add(function(T) {
        var L = s.getItemModel(T), E = jc[u.type](s, T, L);
        if (m && C(T), !(!s.hasValue(T) || !g2[u.type](E))) {
          var I = !1;
          d && (I = h2[u.type](p, E));
          var P = v2[u.type](e, s, T, E, f, h, c.model, !1, g);
          v && (P.forceLabelAnimation = !0), m2(P, s, T, L, E, e, f, u.type === "polar"), x ? P.attr({
            shape: E
          }) : v ? d2(v, h, P, E, T, f, !1, !1) : st(P, {
            shape: E
          }, e, T), s.setItemGraphicEl(T, P), o.add(P), P.ignore = I;
        }
      }).update(function(T, L) {
        var E = s.getItemModel(T), I = jc[u.type](s, T, E);
        if (m) {
          var P = void 0;
          S.length === 0 ? P = C(L) : (P = S[L], P.useStyle(y.getItemStyle()), u.type === "cartesian2d" ? P.setShape("r", _) : P.setShape("cornerRadius", _), b[T] = P);
          var R = jc[u.type](s, T), F = aE(f, R, u);
          Ne(P, {
            shape: F
          }, h, T);
        }
        var O = l.getItemGraphicEl(L);
        if (!s.hasValue(T) || !g2[u.type](I)) {
          o.remove(O);
          return;
        }
        var z = !1;
        if (d && (z = h2[u.type](p, I), z && o.remove(O)), O ? un(O) : O = v2[u.type](e, s, T, I, f, h, c.model, !!O, g), v && (O.forceLabelAnimation = !0), w) {
          var G = O.getTextContent();
          if (G) {
            var W = Rs(G);
            W.prevValue != null && (W.prevValue = W.value);
          }
        } else
          m2(O, s, T, E, I, e, f, u.type === "polar");
        x ? O.attr({
          shape: I
        }) : v ? d2(v, h, O, I, T, f, !0, w) : Ne(O, {
          shape: I
        }, e, T, null), s.setItemGraphicEl(T, O), O.ignore = z, o.add(O);
      }).remove(function(T) {
        var L = l.getItemGraphicEl(T);
        L && yu(L, e, T);
      }).execute();
      var D = this._backgroundGroup || (this._backgroundGroup = new fe());
      D.removeAll();
      for (var A = 0; A < b.length; ++A)
        D.add(b[A]);
      o.add(D), this._backgroundEls = b, this._data = s;
    }, t.prototype._renderLarge = function(e, n, i) {
      this._clear(), _2(e, this.group), this._updateLargeClip(e);
    }, t.prototype._incrementalRenderLarge = function(e, n) {
      this._removeBackground(), _2(n, this.group, this._progressiveEls, !0);
    }, t.prototype._updateLargeClip = function(e) {
      var n = e.get("clip", !0) && ec(e.coordinateSystem, !1, e), i = this.group;
      n ? i.setClipPath(n) : i.removeClipPath();
    }, t.prototype._enableRealtimeSort = function(e, n, i) {
      var a = this;
      if (n.count()) {
        var o = e.baseAxis;
        if (this._isFirstFrame)
          this._dispatchInitSort(n, e, i), this._isFirstFrame = !1;
        else {
          var s = function(l) {
            var u = n.getItemGraphicEl(l), c = u && u.shape;
            return c && // The result should be consistent with the initial sort by data value.
            // Do not support the case that both positive and negative exist.
            Math.abs(o.isHorizontal() ? c.height : c.width) || 0;
          };
          this._onRendered = function() {
            a._updateSortWithinSameData(n, s, o, i);
          }, i.getZr().on("rendered", this._onRendered);
        }
      }
    }, t.prototype._dataSort = function(e, n, i) {
      var a = [];
      return e.each(e.mapDimension(n.dim), function(o, s) {
        var l = i(s);
        l = l ?? NaN, a.push({
          dataIndex: s,
          mappedValue: l,
          ordinalNumber: o
        });
      }), a.sort(function(o, s) {
        return s.mappedValue - o.mappedValue;
      }), {
        ordinalNumbers: U(a, function(o) {
          return o.ordinalNumber;
        })
      };
    }, t.prototype._isOrderChangedWithinSameData = function(e, n, i) {
      for (var a = i.scale, o = e.mapDimension(i.dim), s = Number.MAX_VALUE, l = 0, u = a.getOrdinalMeta().categories.length; l < u; ++l) {
        var c = e.rawIndexOf(o, a.getRawOrdinalNumber(l)), f = c < 0 ? Number.MIN_VALUE : n(e.indexOfRawIndex(c));
        if (f > s)
          return !0;
        s = f;
      }
      return !1;
    }, t.prototype._isOrderDifferentInView = function(e, n) {
      for (var i = n.scale, a = i.getExtent(), o = Math.max(0, a[0]), s = Math.min(a[1], i.getOrdinalMeta().categories.length - 1); o <= s; ++o)
        if (e.ordinalNumbers[o] !== i.getRawOrdinalNumber(o))
          return !0;
    }, t.prototype._updateSortWithinSameData = function(e, n, i, a) {
      if (this._isOrderChangedWithinSameData(e, n, i)) {
        var o = this._dataSort(e, i, n);
        this._isOrderDifferentInView(o, i) && (this._removeOnRenderedListener(a), a.dispatchAction({
          type: "changeAxisOrder",
          componentType: i.dim + "Axis",
          axisId: i.index,
          sortInfo: o
        }));
      }
    }, t.prototype._dispatchInitSort = function(e, n, i) {
      var a = n.baseAxis, o = this._dataSort(e, a, function(s) {
        return e.get(e.mapDimension(n.otherAxis.dim), s);
      });
      i.dispatchAction({
        type: "changeAxisOrder",
        componentType: a.dim + "Axis",
        isInitSort: !0,
        axisId: a.index,
        sortInfo: o
      });
    }, t.prototype.remove = function(e, n) {
      this._clear(this._model), this._removeOnRenderedListener(n);
    }, t.prototype.dispose = function(e, n) {
      this._removeOnRenderedListener(n);
    }, t.prototype._removeOnRenderedListener = function(e) {
      this._onRendered && (e.getZr().off("rendered", this._onRendered), this._onRendered = null);
    }, t.prototype._clear = function(e) {
      var n = this.group, i = this._data;
      e && e.isAnimationEnabled() && i && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], i.eachItemGraphicEl(function(a) {
        yu(a, e, pe(a).dataIndex);
      })) : n.removeAll(), this._data = null, this._isFirstFrame = !0;
    }, t.prototype._removeBackground = function() {
      this.group.remove(this._backgroundGroup), this._backgroundGroup = null;
    }, t.type = "bar", t;
  }(Qe)
), h2 = {
  cartesian2d: function(r, t) {
    var e = t.width < 0 ? -1 : 1, n = t.height < 0 ? -1 : 1;
    e < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height);
    var i = r.x + r.width, a = r.y + r.height, o = pp(t.x, r.x), s = gp(t.x + t.width, i), l = pp(t.y, r.y), u = gp(t.y + t.height, a), c = s < o, f = u < l;
    return t.x = c && o > i ? s : o, t.y = f && l > a ? u : l, t.width = c ? 0 : s - o, t.height = f ? 0 : u - l, e < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height), c || f;
  },
  polar: function(r, t) {
    var e = t.r0 <= t.r ? 1 : -1;
    if (e < 0) {
      var n = t.r;
      t.r = t.r0, t.r0 = n;
    }
    var i = gp(t.r, r.r), a = pp(t.r0, r.r0);
    t.r = i, t.r0 = a;
    var o = i - a < 0;
    if (e < 0) {
      var n = t.r;
      t.r = t.r0, t.r0 = n;
    }
    return o;
  }
}, v2 = {
  cartesian2d: function(r, t, e, n, i, a, o, s, l) {
    var u = new ke({
      shape: H({}, n),
      z2: 1
    });
    if (u.__dataIndex = e, u.name = "item", a) {
      var c = u.shape, f = i ? "height" : "width";
      c[f] = 0;
    }
    return u;
  },
  polar: function(r, t, e, n, i, a, o, s, l) {
    var u = !i && l ? Ah : ir, c = new u({
      shape: n,
      z2: 1
    });
    c.name = "item";
    var f = iE(i);
    if (c.calculateTextPosition = L9(f, {
      isRoundCap: u === Ah
    }), a) {
      var h = c.shape, v = i ? "r" : "endAngle", d = {};
      h[v] = i ? n.r0 : n.startAngle, d[v] = n[v], (s ? Ne : st)(c, {
        shape: d
        // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue
      }, a);
    }
    return c;
  }
};
function R9(r, t) {
  var e = r.get("realtimeSort", !0), n = t.getBaseAxis();
  if (e && n.type === "category" && t.type === "cartesian2d")
    return {
      baseAxis: n,
      otherAxis: t.getOtherAxis(n)
    };
}
function d2(r, t, e, n, i, a, o, s) {
  var l, u;
  a ? (u = {
    x: n.x,
    width: n.width
  }, l = {
    y: n.y,
    height: n.height
  }) : (u = {
    y: n.y,
    height: n.height
  }, l = {
    x: n.x,
    width: n.width
  }), s || (o ? Ne : st)(e, {
    shape: l
  }, t, i, null);
  var c = t ? r.baseAxis.model : null;
  (o ? Ne : st)(e, {
    shape: u
  }, c, i);
}
function p2(r, t) {
  for (var e = 0; e < t.length; e++)
    if (!isFinite(r[t[e]]))
      return !0;
  return !1;
}
var O9 = ["x", "y", "width", "height"], F9 = ["cx", "cy", "r", "startAngle", "endAngle"], g2 = {
  cartesian2d: function(r) {
    return !p2(r, O9);
  },
  polar: function(r) {
    return !p2(r, F9);
  }
}, jc = {
  // itemModel is only used to get borderWidth, which is not needed
  // when calculating bar background layout.
  cartesian2d: function(r, t, e) {
    var n = r.getItemLayout(t), i = e ? N9(e, n) : 0, a = n.width > 0 ? 1 : -1, o = n.height > 0 ? 1 : -1;
    return {
      x: n.x + a * i / 2,
      y: n.y + o * i / 2,
      width: n.width - a * i,
      height: n.height - o * i
    };
  },
  polar: function(r, t, e) {
    var n = r.getItemLayout(t);
    return {
      cx: n.cx,
      cy: n.cy,
      r0: n.r0,
      r: n.r,
      startAngle: n.startAngle,
      endAngle: n.endAngle,
      clockwise: n.clockwise
    };
  }
};
function B9(r) {
  return r.startAngle != null && r.endAngle != null && r.startAngle === r.endAngle;
}
function iE(r) {
  return /* @__PURE__ */ function(t) {
    var e = t ? "Arc" : "Angle";
    return function(n) {
      switch (n) {
        case "start":
        case "insideStart":
        case "end":
        case "insideEnd":
          return n + e;
        default:
          return n;
      }
    };
  }(r);
}
function m2(r, t, e, n, i, a, o, s) {
  var l = t.getItemVisual(e, "style");
  if (s) {
    if (!a.get("roundCap")) {
      var c = r.shape, f = Ja(n.getModel("itemStyle"), c, !0);
      H(c, f), r.setShape(c);
    }
  } else {
    var u = n.get(["itemStyle", "borderRadius"]) || 0;
    r.setShape("r", u);
  }
  r.useStyle(l);
  var h = n.getShallow("cursor");
  h && r.attr("cursor", h);
  var v = s ? o ? i.r >= i.r0 ? "endArc" : "startArc" : i.endAngle >= i.startAngle ? "endAngle" : "startAngle" : o ? i.height >= 0 ? "bottom" : "top" : i.width >= 0 ? "right" : "left", d = Mt(n);
  Bt(r, d, {
    labelFetcher: a,
    labelDataIndex: e,
    defaultText: xs(a.getData(), e),
    inheritColor: l.fill,
    defaultOpacity: l.opacity,
    defaultOutsidePosition: v
  });
  var p = r.getTextContent();
  if (s && p) {
    var g = n.get(["label", "position"]);
    r.textConfig.inside = g === "middle" ? !0 : null, E9(r, g === "outside" ? v : g, iE(o), n.get(["label", "rotate"]));
  }
  wM(p, d, a.getRawValue(e), function(y) {
    return XL(t, y);
  });
  var m = n.getModel(["emphasis"]);
  ut(r, m.get("focus"), m.get("blurScope"), m.get("disabled")), Ft(r, n), B9(i) && (r.style.fill = "none", r.style.stroke = "none", M(r.states, function(y) {
    y.style && (y.style.fill = y.style.stroke = "none");
  }));
}
function N9(r, t) {
  var e = r.get(["itemStyle", "borderColor"]);
  if (!e || e === "none")
    return 0;
  var n = r.get(["itemStyle", "borderWidth"]) || 0, i = isNaN(t.width) ? Number.MAX_VALUE : Math.abs(t.width), a = isNaN(t.height) ? Number.MAX_VALUE : Math.abs(t.height);
  return Math.min(n, i, a);
}
var z9 = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), y2 = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "largeBar", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new z9();
    }, t.prototype.buildPath = function(e, n) {
      for (var i = n.points, a = this.baseDimIdx, o = 1 - this.baseDimIdx, s = [], l = [], u = this.barWidth, c = 0; c < i.length; c += 3)
        l[a] = u, l[o] = i[c + 2], s[a] = i[c + a], s[o] = i[c + o], e.rect(s[0], s[1], l[0], l[1]);
    }, t;
  }(Te)
);
function _2(r, t, e, n) {
  var i = r.getData(), a = i.getLayout("valueAxisHorizontal") ? 1 : 0, o = i.getLayout("largeDataIndices"), s = i.getLayout("size"), l = r.getModel("backgroundStyle"), u = i.getLayout("largeBackgroundPoints");
  if (u) {
    var c = new y2({
      shape: {
        points: u
      },
      incremental: !!n,
      silent: !0,
      z2: 0
    });
    c.baseDimIdx = a, c.largeDataIndices = o, c.barWidth = s, c.useStyle(l.getItemStyle()), t.add(c), e && e.push(c);
  }
  var f = new y2({
    shape: {
      points: i.getLayout("largePoints")
    },
    incremental: !!n,
    ignoreCoarsePointer: !0,
    z2: 1
  });
  f.baseDimIdx = a, f.largeDataIndices = o, f.barWidth = s, t.add(f), f.useStyle(i.getVisual("style")), f.style.stroke = null, pe(f).seriesIndex = r.seriesIndex, r.get("silent") || (f.on("mousedown", b2), f.on("mousemove", b2)), e && e.push(f);
}
var b2 = k0(function(r) {
  var t = this, e = V9(t, r.offsetX, r.offsetY);
  pe(t).dataIndex = e >= 0 ? e : null;
}, 30, !1);
function V9(r, t, e) {
  for (var n = r.baseDimIdx, i = 1 - n, a = r.shape.points, o = r.largeDataIndices, s = [], l = [], u = r.barWidth, c = 0, f = a.length / 3; c < f; c++) {
    var h = c * 3;
    if (l[n] = u, l[i] = a[h + 2], s[n] = a[h + n], s[i] = a[h + i], l[i] < 0 && (s[i] += l[i], l[i] = -l[i]), t >= s[0] && t <= s[0] + l[0] && e >= s[1] && e <= s[1] + l[1])
      return o[c];
  }
  return -1;
}
function aE(r, t, e) {
  if (Do(e, "cartesian2d")) {
    var n = t, i = e.getArea();
    return {
      x: r ? n.x : i.x,
      y: r ? i.y : n.y,
      width: r ? n.width : i.width,
      height: r ? i.height : n.height
    };
  } else {
    var i = e.getArea(), a = t;
    return {
      cx: i.cx,
      cy: i.cy,
      r0: r ? i.r0 : a.r0,
      r: r ? i.r : a.r,
      startAngle: r ? a.startAngle : 0,
      endAngle: r ? a.endAngle : Math.PI * 2
    };
  }
}
function $9(r, t, e) {
  var n = r.type === "polar" ? ir : ke;
  return new n({
    shape: aE(t, e, r),
    silent: !0,
    z2: 0
  });
}
function G9(r) {
  r.registerChartView(k9), r.registerSeriesModel(M9), r.registerLayout(r.PRIORITY.VISUAL.LAYOUT, ye(cL, "bar")), r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, fL("bar")), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, nE("bar")), r.registerAction({
    type: "changeAxisOrder",
    event: "changeAxisOrder",
    update: "update"
  }, function(t, e) {
    var n = t.componentType || "series";
    e.eachComponent({
      mainType: n,
      query: t
    }, function(i) {
      t.sortInfo && i.axis.setCategorySortInfo(t.sortInfo);
    });
  });
}
var S2 = Math.PI * 2, Kc = Math.PI / 180;
function oE(r, t) {
  return St(r.getBoxLayoutParams(), {
    width: t.getWidth(),
    height: t.getHeight()
  });
}
function sE(r, t) {
  var e = oE(r, t), n = r.get("center"), i = r.get("radius");
  q(i) || (i = [0, i]);
  var a = X(e.width, t.getWidth()), o = X(e.height, t.getHeight()), s = Math.min(a, o), l = X(i[0], s / 2), u = X(i[1], s / 2), c, f, h = r.coordinateSystem;
  if (h) {
    var v = h.dataToPoint(n);
    c = v[0] || 0, f = v[1] || 0;
  } else
    q(n) || (n = [n, n]), c = X(n[0], a) + e.x, f = X(n[1], o) + e.y;
  return {
    cx: c,
    cy: f,
    r0: l,
    r: u
  };
}
function H9(r, t, e) {
  t.eachSeriesByType(r, function(n) {
    var i = n.getData(), a = i.mapDimension("value"), o = oE(n, e), s = sE(n, e), l = s.cx, u = s.cy, c = s.r, f = s.r0, h = -n.get("startAngle") * Kc, v = n.get("endAngle"), d = n.get("padAngle") * Kc;
    v = v === "auto" ? h - S2 : -v * Kc;
    var p = n.get("minAngle") * Kc, g = p + d, m = 0;
    i.each(a, function(F) {
      !isNaN(F) && m++;
    });
    var y = i.getSum(a), _ = Math.PI / (y || m) * 2, b = n.get("clockwise"), S = n.get("roseType"), x = n.get("stillShowZeroSum"), w = i.getDataExtent(a);
    w[0] = 0;
    var C = b ? 1 : -1, D = [h, v], A = C * d / 2;
    l0(D, !b), h = D[0], v = D[1];
    var T = lE(n);
    T.startAngle = h, T.endAngle = v, T.clockwise = b;
    var L = Math.abs(v - h), E = L, I = 0, P = h;
    if (i.setLayout({
      viewRect: o,
      r: c
    }), i.each(a, function(F, O) {
      var z;
      if (isNaN(F)) {
        i.setItemLayout(O, {
          angle: NaN,
          startAngle: NaN,
          endAngle: NaN,
          clockwise: b,
          cx: l,
          cy: u,
          r0: f,
          r: S ? NaN : c
        });
        return;
      }
      S !== "area" ? z = y === 0 && x ? _ : F * _ : z = L / m, z < g ? (z = g, E -= g) : I += F;
      var G = P + C * z, W = 0, Y = 0;
      d > z ? (W = P + C * z / 2, Y = W) : (W = P + A, Y = G - A), i.setItemLayout(O, {
        angle: z,
        startAngle: W,
        endAngle: Y,
        clockwise: b,
        cx: l,
        cy: u,
        r0: f,
        r: S ? Ye(F, w, [f, c]) : c
      }), P = G;
    }), E < S2 && m)
      if (E <= 1e-3) {
        var R = L / m;
        i.each(a, function(F, O) {
          if (!isNaN(F)) {
            var z = i.getItemLayout(O);
            z.angle = R;
            var G = 0, W = 0;
            R < d ? (G = h + C * (O + 1 / 2) * R, W = G) : (G = h + C * O * R + A, W = h + C * (O + 1) * R - A), z.startAngle = G, z.endAngle = W;
          }
        });
      } else
        _ = E / I, P = h, i.each(a, function(F, O) {
          if (!isNaN(F)) {
            var z = i.getItemLayout(O), G = z.angle === g ? g : F * _, W = 0, Y = 0;
            G < d ? (W = P + C * G / 2, Y = W) : (W = P + A, Y = P + C * G - A), z.startAngle = W, z.endAngle = Y, P += C * G;
          }
        });
  });
}
var lE = Oe();
function rc(r) {
  return {
    seriesType: r,
    reset: function(t, e) {
      var n = e.findComponents({
        mainType: "legend"
      });
      if (!(!n || !n.length)) {
        var i = t.getData();
        i.filterSelf(function(a) {
          for (var o = i.getName(a), s = 0; s < n.length; s++)
            if (!n[s].isSelected(o))
              return !1;
          return !0;
        });
      }
    }
  };
}
var q9 = Math.PI / 180;
function x2(r, t, e, n, i, a, o, s, l, u) {
  if (r.length < 2)
    return;
  function c(p) {
    for (var g = p.rB, m = g * g, y = 0; y < p.list.length; y++) {
      var _ = p.list[y], b = Math.abs(_.label.y - e), S = n + _.len, x = S * S, w = Math.sqrt(Math.abs((1 - b * b / m) * x)), C = t + (w + _.len2) * i, D = C - _.label.x, A = _.targetTextWidth - D * i;
      uE(_, A, !0), _.label.x = C;
    }
  }
  function f(p) {
    for (var g = {
      list: [],
      maxY: 0
    }, m = {
      list: [],
      maxY: 0
    }, y = 0; y < p.length; y++)
      if (p[y].labelAlignTo === "none") {
        var _ = p[y], b = _.label.y > e ? m : g, S = Math.abs(_.label.y - e);
        if (S >= b.maxY) {
          var x = _.label.x - t - _.len2 * i, w = n + _.len, C = Math.abs(x) < w ? Math.sqrt(S * S / (1 - x * x / w / w)) : w;
          b.rB = C, b.maxY = S;
        }
        b.list.push(_);
      }
    c(g), c(m);
  }
  for (var h = r.length, v = 0; v < h; v++)
    if (r[v].position === "outer" && r[v].labelAlignTo === "labelLine") {
      var d = r[v].label.x - u;
      r[v].linePoints[1][0] += d, r[v].label.x = u;
    }
  PL(r, l, l + o) && f(r);
}
function W9(r, t, e, n, i, a, o, s) {
  for (var l = [], u = [], c = Number.MAX_VALUE, f = -Number.MAX_VALUE, h = 0; h < r.length; h++) {
    var v = r[h].label;
    mp(r[h]) || (v.x < t ? (c = Math.min(c, v.x), l.push(r[h])) : (f = Math.max(f, v.x), u.push(r[h])));
  }
  for (var h = 0; h < r.length; h++) {
    var d = r[h];
    if (!mp(d) && d.linePoints) {
      if (d.labelStyleWidth != null)
        continue;
      var v = d.label, p = d.linePoints, g = void 0;
      d.labelAlignTo === "edge" ? v.x < t ? g = p[2][0] - d.labelDistance - o - d.edgeDistance : g = o + i - d.edgeDistance - p[2][0] - d.labelDistance : d.labelAlignTo === "labelLine" ? v.x < t ? g = c - o - d.bleedMargin : g = o + i - f - d.bleedMargin : v.x < t ? g = v.x - o - d.bleedMargin : g = o + i - v.x - d.bleedMargin, d.targetTextWidth = g, uE(d, g);
    }
  }
  x2(u, t, e, n, 1, i, a, o, s, f), x2(l, t, e, n, -1, i, a, o, s, c);
  for (var h = 0; h < r.length; h++) {
    var d = r[h];
    if (!mp(d) && d.linePoints) {
      var v = d.label, p = d.linePoints, m = d.labelAlignTo === "edge", y = v.style.padding, _ = y ? y[1] + y[3] : 0, b = v.style.backgroundColor ? 0 : _, S = d.rect.width + b, x = p[1][0] - p[2][0];
      m ? v.x < t ? p[2][0] = o + d.edgeDistance + S + d.labelDistance : p[2][0] = o + i - d.edgeDistance - S - d.labelDistance : (v.x < t ? p[2][0] = v.x + d.labelDistance : p[2][0] = v.x - d.labelDistance, p[1][0] = p[2][0] + x), p[1][1] = p[2][1] = v.y;
    }
  }
}
function uE(r, t, e) {
  if (e === void 0 && (e = !1), r.labelStyleWidth == null) {
    var n = r.label, i = n.style, a = r.rect, o = i.backgroundColor, s = i.padding, l = s ? s[1] + s[3] : 0, u = i.overflow, c = a.width + (o ? 0 : l);
    if (t < c || e) {
      var f = a.height;
      if (u && u.match("break")) {
        n.setStyle("backgroundColor", null), n.setStyle("width", t - l);
        var h = n.getBoundingRect();
        n.setStyle("width", Math.ceil(h.width)), n.setStyle("backgroundColor", o);
      } else {
        var v = t - l, d = t < c ? v : (
          // Current available width is enough, but the text may have
          // already been wrapped with a smaller available width.
          e ? v > r.unconstrainedWidth ? null : v : null
        );
        n.setStyle("width", d);
      }
      var p = n.getBoundingRect();
      a.width = p.width;
      var g = (n.style.margin || 0) + 2.1;
      a.height = p.height + g, a.y -= (a.height - f) / 2;
    }
  }
}
function mp(r) {
  return r.position === "center";
}
function U9(r) {
  var t = r.getData(), e = [], n, i, a = !1, o = (r.get("minShowLabelAngle") || 0) * q9, s = t.getLayout("viewRect"), l = t.getLayout("r"), u = s.width, c = s.x, f = s.y, h = s.height;
  function v(x) {
    x.ignore = !0;
  }
  function d(x) {
    if (!x.ignore)
      return !0;
    for (var w in x.states)
      if (x.states[w].ignore === !1)
        return !0;
    return !1;
  }
  t.each(function(x) {
    var w = t.getItemGraphicEl(x), C = w.shape, D = w.getTextContent(), A = w.getTextGuideLine(), T = t.getItemModel(x), L = T.getModel("label"), E = L.get("position") || T.get(["emphasis", "label", "position"]), I = L.get("distanceToLabelLine"), P = L.get("alignTo"), R = X(L.get("edgeDistance"), u), F = L.get("bleedMargin"), O = T.getModel("labelLine"), z = O.get("length");
    z = X(z, u);
    var G = O.get("length2");
    if (G = X(G, u), Math.abs(C.endAngle - C.startAngle) < o) {
      M(D.states, v), D.ignore = !0, A && (M(A.states, v), A.ignore = !0);
      return;
    }
    if (d(D)) {
      var W = (C.startAngle + C.endAngle) / 2, Y = Math.cos(W), j = Math.sin(W), ee, ie, Me, We;
      n = C.cx, i = C.cy;
      var ve = E === "inside" || E === "inner";
      if (E === "center")
        ee = C.cx, ie = C.cy, We = "center";
      else {
        var ae = (ve ? (C.r + C.r0) / 2 * Y : C.r * Y) + n, be = (ve ? (C.r + C.r0) / 2 * j : C.r * j) + i;
        if (ee = ae + Y * 3, ie = be + j * 3, !ve) {
          var ne = ae + Y * (z + l - C.r), de = be + j * (z + l - C.r), Ke = ne + (Y < 0 ? -1 : 1) * G, Ge = de;
          P === "edge" ? ee = Y < 0 ? c + R : c + u - R : ee = Ke + (Y < 0 ? -I : I), ie = Ge, Me = [[ae, be], [ne, de], [Ke, Ge]];
        }
        We = ve ? "center" : P === "edge" ? Y > 0 ? "right" : "left" : Y > 0 ? "left" : "right";
      }
      var Xe = Math.PI, at = 0, pt = L.get("rotate");
      if (Be(pt))
        at = pt * (Xe / 180);
      else if (E === "center")
        at = 0;
      else if (pt === "radial" || pt === !0) {
        var Yt = Y < 0 ? -W + Xe : -W;
        at = Yt;
      } else if (pt === "tangential" && E !== "outside" && E !== "outer") {
        var Nt = Math.atan2(Y, j);
        Nt < 0 && (Nt = Xe * 2 + Nt);
        var Gn = j > 0;
        Gn && (Nt = Xe + Nt), at = Nt - Xe;
      }
      if (a = !!at, D.x = ee, D.y = ie, D.rotation = at, D.setStyle({
        verticalAlign: "middle"
      }), ve) {
        D.setStyle({
          align: We
        });
        var Ys = D.states.select;
        Ys && (Ys.x += D.x, Ys.y += D.y);
      } else {
        var vn = D.getBoundingRect().clone();
        vn.applyTransform(D.getComputedTransform());
        var sc = (D.style.margin || 0) + 2.1;
        vn.y -= sc / 2, vn.height += sc, e.push({
          label: D,
          labelLine: A,
          position: E,
          len: z,
          len2: G,
          minTurnAngle: O.get("minTurnAngle"),
          maxSurfaceAngle: O.get("maxSurfaceAngle"),
          surfaceNormal: new Se(Y, j),
          linePoints: Me,
          textAlign: We,
          labelDistance: I,
          labelAlignTo: P,
          edgeDistance: R,
          bleedMargin: F,
          rect: vn,
          unconstrainedWidth: vn.width,
          labelStyleWidth: D.style.width
        });
      }
      w.setTextConfig({
        inside: ve
      });
    }
  }), !a && r.get("avoidLabelOverlap") && W9(e, n, i, l, u, h, c, f);
  for (var p = 0; p < e.length; p++) {
    var g = e[p], m = g.label, y = g.labelLine, _ = isNaN(m.x) || isNaN(m.y);
    if (m) {
      m.setStyle({
        align: g.textAlign
      }), _ && (M(m.states, v), m.ignore = !0);
      var b = m.states.select;
      b && (b.x += m.x, b.y += m.y);
    }
    if (y) {
      var S = g.linePoints;
      _ || !S ? (M(y.states, v), y.ignore = !0) : (IL(S, g.minTurnAngle), p6(S, g.surfaceNormal, g.maxSurfaceAngle), y.setShape({
        points: S
      }), m.__hostTarget.textGuideLineConfig = {
        anchor: new Se(S[0][0], S[0][1])
      });
    }
  }
}
var Y9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this) || this;
      a.z2 = 2;
      var o = new Fe();
      return a.setTextContent(o), a.updateData(e, n, i, !0), a;
    }
    return t.prototype.updateData = function(e, n, i, a) {
      var o = this, s = e.hostModel, l = e.getItemModel(n), u = l.getModel("emphasis"), c = e.getItemLayout(n), f = H(Ja(l.getModel("itemStyle"), c, !0), c);
      if (isNaN(f.startAngle)) {
        o.setShape(f);
        return;
      }
      if (a) {
        o.setShape(f);
        var h = s.getShallow("animationType");
        s.ecModel.ssr ? (st(o, {
          scaleX: 0,
          scaleY: 0
        }, s, {
          dataIndex: n,
          isFrom: !0
        }), o.originX = f.cx, o.originY = f.cy) : h === "scale" ? (o.shape.r = c.r0, st(o, {
          shape: {
            r: c.r
          }
        }, s, n)) : i != null ? (o.setShape({
          startAngle: i,
          endAngle: i
        }), st(o, {
          shape: {
            startAngle: c.startAngle,
            endAngle: c.endAngle
          }
        }, s, n)) : (o.shape.endAngle = c.startAngle, Ne(o, {
          shape: {
            endAngle: c.endAngle
          }
        }, s, n));
      } else
        un(o), Ne(o, {
          shape: f
        }, s, n);
      o.useStyle(e.getItemVisual(n, "style")), Ft(o, l);
      var v = (c.startAngle + c.endAngle) / 2, d = s.get("selectedOffset"), p = Math.cos(v) * d, g = Math.sin(v) * d, m = l.getShallow("cursor");
      m && o.attr("cursor", m), this._updateLabel(s, e, n), o.ensureState("emphasis").shape = H({
        r: c.r + (u.get("scale") && u.get("scaleSize") || 0)
      }, Ja(u.getModel("itemStyle"), c)), H(o.ensureState("select"), {
        x: p,
        y: g,
        shape: Ja(l.getModel(["select", "itemStyle"]), c)
      }), H(o.ensureState("blur"), {
        shape: Ja(l.getModel(["blur", "itemStyle"]), c)
      });
      var y = o.getTextGuideLine(), _ = o.getTextContent();
      y && H(y.ensureState("select"), {
        x: p,
        y: g
      }), H(_.ensureState("select"), {
        x: p,
        y: g
      }), ut(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(e, n, i) {
      var a = this, o = n.getItemModel(i), s = o.getModel("labelLine"), l = n.getItemVisual(i, "style"), u = l && l.fill, c = l && l.opacity;
      Bt(a, Mt(o), {
        labelFetcher: n.hostModel,
        labelDataIndex: i,
        inheritColor: u,
        defaultOpacity: c,
        defaultText: e.getFormattedLabel(i, "normal") || n.getName(i)
      });
      var f = a.getTextContent();
      a.setTextConfig({
        // reset position, rotation
        position: null,
        rotation: null
      }), f.attr({
        z2: 10
      });
      var h = e.get(["label", "position"]);
      if (h !== "outside" && h !== "outer")
        a.removeTextGuideLine();
      else {
        var v = this.getTextGuideLine();
        v || (v = new sr(), this.setTextGuideLine(v)), Y0(this, Z0(o), {
          stroke: u,
          opacity: En(s.get(["lineStyle", "opacity"]), c, 1)
        });
      }
    }, t;
  }(ir)
), Z9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.ignoreLabelLineUpdate = !0, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      var o = e.getData(), s = this._data, l = this.group, u;
      if (!s && o.count() > 0) {
        for (var c = o.getItemLayout(0), f = 1; isNaN(c && c.startAngle) && f < o.count(); ++f)
          c = o.getItemLayout(f);
        c && (u = c.startAngle);
      }
      if (this._emptyCircleSector && l.remove(this._emptyCircleSector), o.count() === 0 && e.get("showEmptyCircle")) {
        var h = lE(e), v = new ir({
          shape: H(sE(e, i), h)
        });
        v.useStyle(e.getModel("emptyCircleStyle").getItemStyle()), this._emptyCircleSector = v, l.add(v);
      }
      o.diff(s).add(function(d) {
        var p = new Y9(o, d, u);
        o.setItemGraphicEl(d, p), l.add(p);
      }).update(function(d, p) {
        var g = s.getItemGraphicEl(p);
        g.updateData(o, d, u), g.off("click"), l.add(g), o.setItemGraphicEl(d, g);
      }).remove(function(d) {
        var p = s.getItemGraphicEl(d);
        yu(p, e, d);
      }).execute(), U9(e), e.get("animationTypeUpdate") !== "expansion" && (this._data = o);
    }, t.prototype.dispose = function() {
    }, t.prototype.containPoint = function(e, n) {
      var i = n.getData(), a = i.getItemLayout(0);
      if (a) {
        var o = e[0] - a.cx, s = e[1] - a.cy, l = Math.sqrt(o * o + s * s);
        return l <= a.r && l >= a.r0;
      }
    }, t.type = "pie", t;
  }(Qe)
);
function Hs(r, t, e) {
  t = q(t) && {
    coordDimensions: t
  } || H({
    encodeDefine: r.getEncode()
  }, t);
  var n = r.getSource(), i = ju(n, t).dimensions, a = new er(i, r);
  return a.initData(n, e), a;
}
var nc = (
  /** @class */
  function() {
    function r(t, e) {
      this._getDataWithEncodedVisual = t, this._getRawData = e;
    }
    return r.prototype.getAllNames = function() {
      var t = this._getRawData();
      return t.mapArray(t.getName);
    }, r.prototype.containName = function(t) {
      var e = this._getRawData();
      return e.indexOfName(t) >= 0;
    }, r.prototype.indexOfName = function(t) {
      var e = this._getDataWithEncodedVisual();
      return e.indexOfName(t);
    }, r.prototype.getItemVisual = function(t, e) {
      var n = this._getDataWithEncodedVisual();
      return n.getItemVisual(t, e);
    }, r;
  }()
), X9 = Oe(), j9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.init = function(e) {
      r.prototype.init.apply(this, arguments), this.legendVisualProvider = new nc(Q(this.getData, this), Q(this.getRawData, this)), this._defaultLabelLine(e);
    }, t.prototype.mergeOption = function() {
      r.prototype.mergeOption.apply(this, arguments);
    }, t.prototype.getInitialData = function() {
      return Hs(this, {
        coordDimensions: ["value"],
        encodeDefaulter: ye(A0, this)
      });
    }, t.prototype.getDataParams = function(e) {
      var n = this.getData(), i = X9(n), a = i.seats;
      if (!a) {
        var o = [];
        n.each(n.mapDimension("value"), function(l) {
          o.push(l);
        }), a = i.seats = GB(o, n.hostModel.get("percentPrecision"));
      }
      var s = r.prototype.getDataParams.call(this, e);
      return s.percent = a[e] || 0, s.$vars.push("percent"), s;
    }, t.prototype._defaultLabelLine = function(e) {
      ho(e, "labelLine", ["show"]);
      var n = e.labelLine, i = e.emphasis.labelLine;
      n.show = n.show && e.label.show, i.show = i.show && e.emphasis.label.show;
    }, t.type = "series.pie", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      colorBy: "data",
      // 默认全局居中
      center: ["50%", "50%"],
      radius: [0, "75%"],
      // 默认顺时针
      clockwise: !0,
      startAngle: 90,
      endAngle: "auto",
      padAngle: 0,
      // 最小角度改为0
      minAngle: 0,
      // If the angle of a sector less than `minShowLabelAngle`,
      // the label will not be displayed.
      minShowLabelAngle: 0,
      // 选中时扇区偏移量
      selectedOffset: 10,
      // 选择模式，默认关闭，可选single，multiple
      // selectedMode: false,
      // 南丁格尔玫瑰图模式，'radius'（半径） | 'area'（面积）
      // roseType: null,
      percentPrecision: 2,
      // If still show when all data zero.
      stillShowZeroSum: !0,
      // cursor: null,
      left: 0,
      top: 0,
      right: 0,
      bottom: 0,
      width: null,
      height: null,
      label: {
        // color: 'inherit',
        // If rotate around circle
        rotate: 0,
        show: !0,
        overflow: "truncate",
        // 'outer', 'inside', 'center'
        position: "outer",
        // 'none', 'labelLine', 'edge'. Works only when position is 'outer'
        alignTo: "none",
        // Closest distance between label and chart edge.
        // Works only position is 'outer' and alignTo is 'edge'.
        edgeDistance: "25%",
        // Works only position is 'outer' and alignTo is not 'edge'.
        bleedMargin: 10,
        // Distance between text and label line.
        distanceToLabelLine: 5
        // formatter: 标签文本格式器，同 tooltip.formatter，不支持异步回调
        // 默认使用全局文本样式，详见 textStyle
        // distance: 当position为inner时有效，为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
      },
      // Enabled when label.normal.position is 'outer'
      labelLine: {
        show: !0,
        // 引导线两段中的第一段长度
        length: 15,
        // 引导线两段中的第二段长度
        length2: 15,
        smooth: !1,
        minTurnAngle: 90,
        maxSurfaceAngle: 90,
        lineStyle: {
          // color: 各异,
          width: 1,
          type: "solid"
        }
      },
      itemStyle: {
        borderWidth: 1,
        borderJoin: "round"
      },
      showEmptyCircle: !0,
      emptyCircleStyle: {
        color: "lightgray",
        opacity: 1
      },
      labelLayout: {
        // Hide the overlapped label.
        hideOverlap: !0
      },
      emphasis: {
        scale: !0,
        scaleSize: 5
      },
      // If use strategy to avoid label overlapping
      avoidLabelOverlap: !0,
      // Animation type. Valid values: expansion, scale
      animationType: "expansion",
      animationDuration: 1e3,
      // Animation type when update. Valid values: transition, expansion
      animationTypeUpdate: "transition",
      animationEasingUpdate: "cubicInOut",
      animationDurationUpdate: 500,
      animationEasing: "cubicInOut"
    }, t;
  }(it)
);
function K9(r) {
  return {
    seriesType: r,
    reset: function(t, e) {
      var n = t.getData();
      n.filterSelf(function(i) {
        var a = n.mapDimension("value"), o = n.get(a, i);
        return !(Be(o) && !isNaN(o) && o < 0);
      });
    }
  };
}
function J9(r) {
  r.registerChartView(Z9), r.registerSeriesModel(j9), II("pie", r.registerAction), r.registerLayout(ye(H9, "pie")), r.registerProcessor(rc("pie")), r.registerProcessor(K9("pie"));
}
var Q9 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return gi(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getProgressive = function() {
      var e = this.option.progressive;
      return e ?? (this.option.large ? 5e3 : this.get("progressive"));
    }, t.prototype.getProgressiveThreshold = function() {
      var e = this.option.progressiveThreshold;
      return e ?? (this.option.large ? 1e4 : this.get("progressiveThreshold"));
    }, t.prototype.brushSelector = function(e, n, i) {
      return i.point(n.getItemLayout(e));
    }, t.prototype.getZLevelKey = function() {
      return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
    }, t.type = "series.scatter", t.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], t.defaultOption = {
      coordinateSystem: "cartesian2d",
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      symbolSize: 10,
      // symbolRotate: null,  // 图形旋转控制
      large: !1,
      // Available when large is true
      largeThreshold: 2e3,
      // cursor: null,
      itemStyle: {
        opacity: 0.8
        // color: 各异
      },
      emphasis: {
        scale: !0
      },
      // If clip the overflow graphics
      // Works on cartesian / polar series
      clip: !0,
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      },
      universalTransition: {
        divideShape: "clone"
      }
      // progressive: null
    }, t;
  }(it)
), cE = 4, eH = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), tH = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n._off = 0, n.hoverDataIdx = -1, n;
    }
    return t.prototype.getDefaultShape = function() {
      return new eH();
    }, t.prototype.reset = function() {
      this.notClear = !1, this._off = 0;
    }, t.prototype.buildPath = function(e, n) {
      var i = n.points, a = n.size, o = this.symbolProxy, s = o.shape, l = e.getContext ? e.getContext() : e, u = l && a[0] < cE, c = this.softClipShape, f;
      if (u) {
        this._ctx = l;
        return;
      }
      for (this._ctx = null, f = this._off; f < i.length; ) {
        var h = i[f++], v = i[f++];
        isNaN(h) || isNaN(v) || c && !c.contain(h, v) || (s.x = h - a[0] / 2, s.y = v - a[1] / 2, s.width = a[0], s.height = a[1], o.buildPath(e, s, !0));
      }
      this.incremental && (this._off = f, this.notClear = !0);
    }, t.prototype.afterBrush = function() {
      var e = this.shape, n = e.points, i = e.size, a = this._ctx, o = this.softClipShape, s;
      if (a) {
        for (s = this._off; s < n.length; ) {
          var l = n[s++], u = n[s++];
          isNaN(l) || isNaN(u) || o && !o.contain(l, u) || a.fillRect(l - i[0] / 2, u - i[1] / 2, i[0], i[1]);
        }
        this.incremental && (this._off = s, this.notClear = !0);
      }
    }, t.prototype.findDataIndex = function(e, n) {
      for (var i = this.shape, a = i.points, o = i.size, s = Math.max(o[0], 4), l = Math.max(o[1], 4), u = a.length / 2 - 1; u >= 0; u--) {
        var c = u * 2, f = a[c] - s / 2, h = a[c + 1] - l / 2;
        if (e >= f && n >= h && e <= f + s && n <= h + l)
          return u;
      }
      return -1;
    }, t.prototype.contain = function(e, n) {
      var i = this.transformCoordToLocal(e, n), a = this.getBoundingRect();
      if (e = i[0], n = i[1], a.contain(e, n)) {
        var o = this.hoverDataIdx = this.findDataIndex(e, n);
        return o >= 0;
      }
      return this.hoverDataIdx = -1, !1;
    }, t.prototype.getBoundingRect = function() {
      var e = this._rect;
      if (!e) {
        for (var n = this.shape, i = n.points, a = n.size, o = a[0], s = a[1], l = 1 / 0, u = 1 / 0, c = -1 / 0, f = -1 / 0, h = 0; h < i.length; ) {
          var v = i[h++], d = i[h++];
          l = Math.min(v, l), c = Math.max(v, c), u = Math.min(d, u), f = Math.max(d, f);
        }
        e = this._rect = new xe(l - o / 2, u - s / 2, c - l + o, f - u + s);
      }
      return e;
    }, t;
  }(Te)
), rH = (
  /** @class */
  function() {
    function r() {
      this.group = new fe();
    }
    return r.prototype.updateData = function(t, e) {
      this._clear();
      var n = this._create();
      n.setShape({
        points: t.getLayout("points")
      }), this._setCommon(n, t, e);
    }, r.prototype.updateLayout = function(t) {
      var e = t.getLayout("points");
      this.group.eachChild(function(n) {
        if (n.startIndex != null) {
          var i = (n.endIndex - n.startIndex) * 2, a = n.startIndex * 4 * 2;
          e = new Float32Array(e.buffer, a, i);
        }
        n.setShape("points", e), n.reset();
      });
    }, r.prototype.incrementalPrepareUpdate = function(t) {
      this._clear();
    }, r.prototype.incrementalUpdate = function(t, e, n) {
      var i = this._newAdded[0], a = e.getLayout("points"), o = i && i.shape.points;
      if (o && o.length < 2e4) {
        var s = o.length, l = new Float32Array(s + a.length);
        l.set(o), l.set(a, s), i.endIndex = t.end, i.setShape({
          points: l
        });
      } else {
        this._newAdded = [];
        var u = this._create();
        u.startIndex = t.start, u.endIndex = t.end, u.incremental = !0, u.setShape({
          points: a
        }), this._setCommon(u, e, n);
      }
    }, r.prototype.eachRendered = function(t) {
      this._newAdded[0] && t(this._newAdded[0]);
    }, r.prototype._create = function() {
      var t = new tH({
        cursor: "default"
      });
      return t.ignoreCoarsePointer = !0, this.group.add(t), this._newAdded.push(t), t;
    }, r.prototype._setCommon = function(t, e, n) {
      var i = e.hostModel;
      n = n || {};
      var a = e.getVisual("symbolSize");
      t.setShape("size", a instanceof Array ? a : [a, a]), t.softClipShape = n.clipShape || null, t.symbolProxy = yt(e.getVisual("symbol"), 0, 0, 0, 0), t.setColor = t.symbolProxy.setColor;
      var o = t.shape.size[0] < cE;
      t.useStyle(
        // Draw shadow when doing fillRect is extremely slow.
        i.getModel("itemStyle").getItemStyle(o ? ["color", "shadowBlur", "shadowColor"] : ["color"])
      );
      var s = e.getVisual("style"), l = s && s.fill;
      l && t.setColor(l);
      var u = pe(t);
      u.seriesIndex = i.seriesIndex, t.on("mousemove", function(c) {
        u.dataIndex = null;
        var f = t.hoverDataIdx;
        f >= 0 && (u.dataIndex = f + (t.startIndex || 0));
      });
    }, r.prototype.remove = function() {
      this._clear();
    }, r.prototype._clear = function() {
      this._newAdded = [], this.group.removeAll();
    }, r;
  }()
), nH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this._updateSymbolDraw(a, e);
      o.updateData(a, {
        // TODO
        // If this parameter should be a shape or a bounding volume
        // shape will be more general.
        // But bounding volume like bounding rect will be much faster in the contain calculation
        clipShape: this._getClipShape(e)
      }), this._finished = !0;
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      var a = e.getData(), o = this._updateSymbolDraw(a, e);
      o.incrementalPrepareUpdate(a), this._finished = !1;
    }, t.prototype.incrementalRender = function(e, n, i) {
      this._symbolDraw.incrementalUpdate(e, n.getData(), {
        clipShape: this._getClipShape(n)
      }), this._finished = e.end === n.getData().count();
    }, t.prototype.updateTransform = function(e, n, i) {
      var a = e.getData();
      if (this.group.dirty(), !this._finished || a.count() > 1e4)
        return {
          update: !0
        };
      var o = tc("").reset(e, n, i);
      o.progress && o.progress({
        start: 0,
        end: a.count(),
        count: a.count()
      }, a), this._symbolDraw.updateLayout(a);
    }, t.prototype.eachRendered = function(e) {
      this._symbolDraw && this._symbolDraw.eachRendered(e);
    }, t.prototype._getClipShape = function(e) {
      if (e.get("clip", !0)) {
        var n = e.coordinateSystem;
        return n && n.getArea && n.getArea(0.1);
      }
    }, t.prototype._updateSymbolDraw = function(e, n) {
      var i = this._symbolDraw, a = n.pipelineContext, o = a.large;
      return (!i || o !== this._isLargeDraw) && (i && i.remove(), i = this._symbolDraw = o ? new rH() : new Qu(), this._isLargeDraw = o, this.group.removeAll()), this.group.add(i.group), i;
    }, t.prototype.remove = function(e, n) {
      this._symbolDraw && this._symbolDraw.remove(!0), this._symbolDraw = null;
    }, t.prototype.dispose = function() {
    }, t.type = "scatter", t;
  }(Qe)
), iH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.type = "grid", t.dependencies = ["xAxis", "yAxis"], t.layoutMode = "box", t.defaultOption = {
      show: !1,
      // zlevel: 0,
      z: 0,
      left: "10%",
      top: 60,
      right: "10%",
      bottom: 70,
      // If grid size contain label
      containLabel: !1,
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      backgroundColor: "rgba(0,0,0,0)",
      borderWidth: 1,
      borderColor: "#ccc"
    }, t;
  }(Le)
), zm = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("grid", mt).models[0];
    }, t.type = "cartesian2dAxis", t;
  }(Le)
);
_t(zm, Ku);
var fE = {
  show: !0,
  // zlevel: 0,
  z: 0,
  // Inverse the axis.
  inverse: !1,
  // Axis name displayed.
  name: "",
  // 'start' | 'middle' | 'end'
  nameLocation: "end",
  // By degree. By default auto rotate by nameLocation.
  nameRotate: null,
  nameTruncate: {
    maxWidth: null,
    ellipsis: "...",
    placeholder: "."
  },
  // Use global text style by default.
  nameTextStyle: {},
  // The gap between axisName and axisLine.
  nameGap: 15,
  // Default `false` to support tooltip.
  silent: !1,
  // Default `false` to avoid legacy user event listener fail.
  triggerEvent: !1,
  tooltip: {
    show: !1
  },
  axisPointer: {},
  axisLine: {
    show: !0,
    onZero: !0,
    onZeroAxisIndex: null,
    lineStyle: {
      color: "#6E7079",
      width: 1,
      type: "solid"
    },
    // The arrow at both ends the the axis.
    symbol: ["none", "none"],
    symbolSize: [10, 15]
  },
  axisTick: {
    show: !0,
    // Whether axisTick is inside the grid or outside the grid.
    inside: !1,
    // The length of axisTick.
    length: 5,
    lineStyle: {
      width: 1
    }
  },
  axisLabel: {
    show: !0,
    // Whether axisLabel is inside the grid or outside the grid.
    inside: !1,
    rotate: 0,
    // true | false | null/undefined (auto)
    showMinLabel: null,
    // true | false | null/undefined (auto)
    showMaxLabel: null,
    margin: 8,
    // formatter: null,
    fontSize: 12
  },
  splitLine: {
    show: !0,
    showMinLine: !0,
    showMaxLine: !0,
    lineStyle: {
      color: ["#E0E6F1"],
      width: 1,
      type: "solid"
    }
  },
  splitArea: {
    show: !1,
    areaStyle: {
      color: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
    }
  }
}, aH = _e({
  // The gap at both ends of the axis. For categoryAxis, boolean.
  boundaryGap: !0,
  // Set false to faster category collection.
  deduplication: null,
  // splitArea: {
  // show: false
  // },
  splitLine: {
    show: !1
  },
  axisTick: {
    // If tick is align with label when boundaryGap is true
    alignWithLabel: !1,
    interval: "auto"
  },
  axisLabel: {
    interval: "auto"
  }
}, fE), t_ = _e({
  boundaryGap: [0, 0],
  axisLine: {
    // Not shown when other axis is categoryAxis in cartesian
    show: "auto"
  },
  axisTick: {
    // Not shown when other axis is categoryAxis in cartesian
    show: "auto"
  },
  // TODO
  // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
  splitNumber: 5,
  minorTick: {
    // Minor tick, not available for cateogry axis.
    show: !1,
    // Split number of minor ticks. The value should be in range of (0, 100)
    splitNumber: 5,
    // Length of minor tick
    length: 3,
    // Line style
    lineStyle: {
      // Default to be same with axisTick
    }
  },
  minorSplitLine: {
    show: !1,
    lineStyle: {
      color: "#F4F7FD",
      width: 1
    }
  }
}, fE), oH = _e({
  splitNumber: 6,
  axisLabel: {
    // To eliminate labels that are not nice
    showMinLabel: !1,
    showMaxLabel: !1,
    rich: {
      primary: {
        fontWeight: "bold"
      }
    }
  },
  splitLine: {
    show: !1
  }
}, t_), sH = se({
  logBase: 10
}, t_);
const hE = {
  category: aH,
  value: t_,
  time: oH,
  log: sH
};
var lH = {
  value: 1,
  category: 1,
  time: 1,
  log: 1
};
function ws(r, t, e, n) {
  M(lH, function(i, a) {
    var o = _e(_e({}, hE[a], !0), n, !0), s = (
      /** @class */
      function(l) {
        N(u, l);
        function u() {
          var c = l !== null && l.apply(this, arguments) || this;
          return c.type = t + "Axis." + a, c;
        }
        return u.prototype.mergeDefaultAndTheme = function(c, f) {
          var h = bu(this), v = h ? Bs(c) : {}, d = f.getTheme();
          _e(c, d.get(a + "Axis")), _e(c, this.getDefaultOption()), c.type = w2(c), h && Qi(c, v, h);
        }, u.prototype.optionUpdated = function() {
          var c = this.option;
          c.type === "category" && (this.__ordinalMeta = Pm.createByAxisModel(this));
        }, u.prototype.getCategories = function(c) {
          var f = this.option;
          if (f.type === "category")
            return c ? f.data : this.__ordinalMeta.categories;
        }, u.prototype.getOrdinalMeta = function() {
          return this.__ordinalMeta;
        }, u.type = t + "Axis." + a, u.defaultOption = o, u;
      }(e)
    );
    r.registerComponentModel(s);
  }), r.registerSubTypeDefaulter(t + "Axis", w2);
}
function w2(r) {
  return r.type || (r.data ? "category" : "value");
}
var uH = (
  /** @class */
  function() {
    function r(t) {
      this.type = "cartesian", this._dimList = [], this._axes = {}, this.name = t || "";
    }
    return r.prototype.getAxis = function(t) {
      return this._axes[t];
    }, r.prototype.getAxes = function() {
      return U(this._dimList, function(t) {
        return this._axes[t];
      }, this);
    }, r.prototype.getAxesByScale = function(t) {
      return t = t.toLowerCase(), qe(this.getAxes(), function(e) {
        return e.scale.type === t;
      });
    }, r.prototype.addAxis = function(t) {
      var e = t.dim;
      this._axes[e] = t, this._dimList.push(e);
    }, r;
  }()
), Vm = ["x", "y"];
function C2(r) {
  return r.type === "interval" || r.type === "time";
}
var cH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "cartesian2d", e.dimensions = Vm, e;
    }
    return t.prototype.calcAffineTransform = function() {
      this._transform = this._invTransform = null;
      var e = this.getAxis("x").scale, n = this.getAxis("y").scale;
      if (!(!C2(e) || !C2(n))) {
        var i = e.getExtent(), a = n.getExtent(), o = this.dataToPoint([i[0], a[0]]), s = this.dataToPoint([i[1], a[1]]), l = i[1] - i[0], u = a[1] - a[0];
        if (!(!l || !u)) {
          var c = (s[0] - o[0]) / l, f = (s[1] - o[1]) / u, h = o[0] - i[0] * c, v = o[1] - a[0] * f, d = this._transform = [c, 0, 0, f, h, v];
          this._invTransform = Ls([], d);
        }
      }
    }, t.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
    }, t.prototype.containPoint = function(e) {
      var n = this.getAxis("x"), i = this.getAxis("y");
      return n.contain(n.toLocalCoord(e[0])) && i.contain(i.toLocalCoord(e[1]));
    }, t.prototype.containData = function(e) {
      return this.getAxis("x").containData(e[0]) && this.getAxis("y").containData(e[1]);
    }, t.prototype.containZone = function(e, n) {
      var i = this.dataToPoint(e), a = this.dataToPoint(n), o = this.getArea(), s = new xe(i[0], i[1], a[0] - i[0], a[1] - i[1]);
      return o.intersect(s);
    }, t.prototype.dataToPoint = function(e, n, i) {
      i = i || [];
      var a = e[0], o = e[1];
      if (this._transform && a != null && isFinite(a) && o != null && isFinite(o))
        return Rt(i, e, this._transform);
      var s = this.getAxis("x"), l = this.getAxis("y");
      return i[0] = s.toGlobalCoord(s.dataToCoord(a, n)), i[1] = l.toGlobalCoord(l.dataToCoord(o, n)), i;
    }, t.prototype.clampData = function(e, n) {
      var i = this.getAxis("x").scale, a = this.getAxis("y").scale, o = i.getExtent(), s = a.getExtent(), l = i.parse(e[0]), u = a.parse(e[1]);
      return n = n || [], n[0] = Math.min(Math.max(Math.min(o[0], o[1]), l), Math.max(o[0], o[1])), n[1] = Math.min(Math.max(Math.min(s[0], s[1]), u), Math.max(s[0], s[1])), n;
    }, t.prototype.pointToData = function(e, n) {
      var i = [];
      if (this._invTransform)
        return Rt(i, e, this._invTransform);
      var a = this.getAxis("x"), o = this.getAxis("y");
      return i[0] = a.coordToData(a.toLocalCoord(e[0]), n), i[1] = o.coordToData(o.toLocalCoord(e[1]), n), i;
    }, t.prototype.getOtherAxis = function(e) {
      return this.getAxis(e.dim === "x" ? "y" : "x");
    }, t.prototype.getArea = function(e) {
      e = e || 0;
      var n = this.getAxis("x").getGlobalExtent(), i = this.getAxis("y").getGlobalExtent(), a = Math.min(n[0], n[1]) - e, o = Math.min(i[0], i[1]) - e, s = Math.max(n[0], n[1]) - a + e, l = Math.max(i[0], i[1]) - o + e;
      return new xe(a, o, s, l);
    }, t;
  }(uH)
), fH = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a, o) {
      var s = r.call(this, e, n, i) || this;
      return s.index = 0, s.type = a || "value", s.position = o || "bottom", s;
    }
    return t.prototype.isHorizontal = function() {
      var e = this.position;
      return e === "top" || e === "bottom";
    }, t.prototype.getGlobalExtent = function(e) {
      var n = this.getExtent();
      return n[0] = this.toGlobalCoord(n[0]), n[1] = this.toGlobalCoord(n[1]), e && n[0] > n[1] && n.reverse(), n;
    }, t.prototype.pointToData = function(e, n) {
      return this.coordToData(this.toLocalCoord(e[this.dim === "x" ? 0 : 1]), n);
    }, t.prototype.setCategorySortInfo = function(e) {
      if (this.type !== "category")
        return !1;
      this.model.option.categorySortInfo = e, this.scale.setSortInfo(e);
    }, t;
  }(hn)
);
function $m(r, t, e) {
  e = e || {};
  var n = r.coordinateSystem, i = t.axis, a = {}, o = i.getAxesOnZeroOf()[0], s = i.position, l = o ? "onZero" : s, u = i.dim, c = n.getRect(), f = [c.x, c.x + c.width, c.y, c.y + c.height], h = {
    left: 0,
    right: 1,
    top: 0,
    bottom: 1,
    onZero: 2
  }, v = t.get("offset") || 0, d = u === "x" ? [f[2] - v, f[3] + v] : [f[0] - v, f[1] + v];
  if (o) {
    var p = o.toGlobalCoord(o.dataToCoord(0));
    d[h.onZero] = Math.max(Math.min(p, d[1]), d[0]);
  }
  a.position = [u === "y" ? d[h[l]] : f[0], u === "x" ? d[h[l]] : f[3]], a.rotation = Math.PI / 2 * (u === "x" ? 0 : 1);
  var g = {
    top: -1,
    bottom: 1,
    left: -1,
    right: 1
  };
  a.labelDirection = a.tickDirection = a.nameDirection = g[s], a.labelOffset = o ? d[h[s]] - d[h.onZero] : 0, t.get(["axisTick", "inside"]) && (a.tickDirection = -a.tickDirection), Et(e.labelInside, t.get(["axisLabel", "inside"])) && (a.labelDirection = -a.labelDirection);
  var m = t.get(["axisLabel", "rotate"]);
  return a.labelRotate = l === "top" ? -m : m, a.z2 = 1, a;
}
function A2(r) {
  return r.get("coordinateSystem") === "cartesian2d";
}
function D2(r) {
  var t = {
    xAxisModel: null,
    yAxisModel: null
  };
  return M(t, function(e, n) {
    var i = n.replace(/Model$/, ""), a = r.getReferringComponents(i, mt).models[0];
    t[n] = a;
  }), t;
}
var yp = Math.log;
function vE(r, t, e) {
  var n = ui.prototype, i = n.getTicks.call(e), a = n.getTicks.call(e, !0), o = i.length - 1, s = n.getInterval.call(e), l = gL(r, t), u = l.extent, c = l.fixMin, f = l.fixMax;
  if (r.type === "log") {
    var h = yp(r.base);
    u = [yp(u[0]) / h, yp(u[1]) / h];
  }
  r.setExtent(u[0], u[1]), r.calcNiceExtent({
    splitNumber: o,
    fixMin: c,
    fixMax: f
  });
  var v = n.getExtent.call(r);
  c && (u[0] = v[0]), f && (u[1] = v[1]);
  var d = n.getInterval.call(r), p = u[0], g = u[1];
  if (c && f)
    d = (g - p) / o;
  else if (c)
    for (g = u[0] + d * o; g < u[1] && isFinite(g) && isFinite(u[1]); )
      d = np(d), g = u[0] + d * o;
  else if (f)
    for (p = u[1] - d * o; p > u[0] && isFinite(p) && isFinite(u[0]); )
      d = np(d), p = u[1] - d * o;
  else {
    var m = r.getTicks().length - 1;
    m > o && (d = np(d));
    var y = d * o;
    g = Math.ceil(u[1] / d) * d, p = ht(g - y), p < 0 && u[0] >= 0 ? (p = 0, g = ht(y)) : g > 0 && u[1] <= 0 && (g = 0, p = -ht(y));
  }
  var _ = (i[0].value - a[0].value) / s, b = (i[o].value - a[o].value) / s;
  n.setExtent.call(r, p + d * _, g + d * b), n.setInterval.call(r, d), (_ || b) && n.setNiceExtent.call(r, p + d, g - d);
}
var hH = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.type = "grid", this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this.axisPointerEnabled = !0, this.dimensions = Vm, this._initCartesian(t, e, n), this.model = t;
    }
    return r.prototype.getRect = function() {
      return this._rect;
    }, r.prototype.update = function(t, e) {
      var n = this._axesMap;
      this._updateScale(t, this.model);
      function i(o) {
        var s, l = Ee(o), u = l.length;
        if (u) {
          for (var c = [], f = u - 1; f >= 0; f--) {
            var h = +l[f], v = o[h], d = v.model, p = v.scale;
            // Only value and log axis without interval support alignTicks.
            km(p) && d.get("alignTicks") && d.get("interval") == null ? c.push(v) : (Ss(p, d), km(p) && (s = v));
          }
          c.length && (s || (s = c.pop(), Ss(s.scale, s.model)), M(c, function(g) {
            vE(g.scale, g.model, s.scale);
          }));
        }
      }
      i(n.x), i(n.y);
      var a = {};
      M(n.x, function(o) {
        T2(n, "y", o, a);
      }), M(n.y, function(o) {
        T2(n, "x", o, a);
      }), this.resize(this.model, e);
    }, r.prototype.resize = function(t, e, n) {
      var i = t.getBoxLayoutParams(), a = !n && t.get("containLabel"), o = St(i, {
        width: e.getWidth(),
        height: e.getHeight()
      });
      this._rect = o;
      var s = this._axesList;
      l(), a && (M(s, function(u) {
        if (!u.model.get(["axisLabel", "inside"])) {
          var c = UG(u);
          if (c) {
            var f = u.isHorizontal() ? "height" : "width", h = u.model.get(["axisLabel", "margin"]);
            o[f] -= c[f] + h, u.position === "top" ? o.y += c.height + h : u.position === "left" && (o.x += c.width + h);
          }
        }
      }), l()), M(this._coordsList, function(u) {
        u.calcAffineTransform();
      });
      function l() {
        M(s, function(u) {
          var c = u.isHorizontal(), f = c ? [0, o.width] : [0, o.height], h = u.inverse ? 1 : 0;
          u.setExtent(f[h], f[1 - h]), vH(u, c ? o.x : o.y);
        });
      }
    }, r.prototype.getAxis = function(t, e) {
      var n = this._axesMap[t];
      if (n != null)
        return n[e || 0];
    }, r.prototype.getAxes = function() {
      return this._axesList.slice();
    }, r.prototype.getCartesian = function(t, e) {
      if (t != null && e != null) {
        var n = "x" + t + "y" + e;
        return this._coordsMap[n];
      }
      ue(t) && (e = t.yAxisIndex, t = t.xAxisIndex);
      for (var i = 0, a = this._coordsList; i < a.length; i++)
        if (a[i].getAxis("x").index === t || a[i].getAxis("y").index === e)
          return a[i];
    }, r.prototype.getCartesians = function() {
      return this._coordsList.slice();
    }, r.prototype.convertToPixel = function(t, e, n) {
      var i = this._findConvertTarget(e);
      return i.cartesian ? i.cartesian.dataToPoint(n) : i.axis ? i.axis.toGlobalCoord(i.axis.dataToCoord(n)) : null;
    }, r.prototype.convertFromPixel = function(t, e, n) {
      var i = this._findConvertTarget(e);
      return i.cartesian ? i.cartesian.pointToData(n) : i.axis ? i.axis.coordToData(i.axis.toLocalCoord(n)) : null;
    }, r.prototype._findConvertTarget = function(t) {
      var e = t.seriesModel, n = t.xAxisModel || e && e.getReferringComponents("xAxis", mt).models[0], i = t.yAxisModel || e && e.getReferringComponents("yAxis", mt).models[0], a = t.gridModel, o = this._coordsList, s, l;
      if (e)
        s = e.coordinateSystem, we(o, s) < 0 && (s = null);
      else if (n && i)
        s = this.getCartesian(n.componentIndex, i.componentIndex);
      else if (n)
        l = this.getAxis("x", n.componentIndex);
      else if (i)
        l = this.getAxis("y", i.componentIndex);
      else if (a) {
        var u = a.coordinateSystem;
        u === this && (s = this._coordsList[0]);
      }
      return {
        cartesian: s,
        axis: l
      };
    }, r.prototype.containPoint = function(t) {
      var e = this._coordsList[0];
      if (e)
        return e.containPoint(t);
    }, r.prototype._initCartesian = function(t, e, n) {
      var i = this, a = this, o = {
        left: !1,
        right: !1,
        top: !1,
        bottom: !1
      }, s = {
        x: {},
        y: {}
      }, l = {
        x: 0,
        y: 0
      };
      if (e.eachComponent("xAxis", u("x"), this), e.eachComponent("yAxis", u("y"), this), !l.x || !l.y) {
        this._axesMap = {}, this._axesList = [];
        return;
      }
      this._axesMap = s, M(s.x, function(c, f) {
        M(s.y, function(h, v) {
          var d = "x" + f + "y" + v, p = new cH(d);
          p.master = i, p.model = t, i._coordsMap[d] = p, i._coordsList.push(p), p.addAxis(c), p.addAxis(h);
        });
      });
      function u(c) {
        return function(f, h) {
          if (_p(f, t)) {
            var v = f.get("position");
            c === "x" ? v !== "top" && v !== "bottom" && (v = o.bottom ? "top" : "bottom") : v !== "left" && v !== "right" && (v = o.left ? "right" : "left"), o[v] = !0;
            var d = new fH(c, Ev(f), [0, 0], f.get("type"), v), p = d.type === "category";
            d.onBand = p && f.get("boundaryGap"), d.inverse = f.get("inverse"), f.axis = d, d.model = f, d.grid = a, d.index = h, a._axesList.push(d), s[c][h] = d, l[c]++;
          }
        };
      }
    }, r.prototype._updateScale = function(t, e) {
      M(this._axesList, function(i) {
        if (i.scale.setExtent(1 / 0, -1 / 0), i.type === "category") {
          var a = i.model.get("categorySortInfo");
          i.scale.setSortInfo(a);
        }
      }), t.eachSeries(function(i) {
        if (A2(i)) {
          var a = D2(i), o = a.xAxisModel, s = a.yAxisModel;
          if (!_p(o, e) || !_p(s, e))
            return;
          var l = this.getCartesian(o.componentIndex, s.componentIndex), u = i.getData(), c = l.getAxis("x"), f = l.getAxis("y");
          n(u, c), n(u, f);
        }
      }, this);
      function n(i, a) {
        M(Sh(i, a.dim), function(o) {
          a.scale.unionExtentFromData(i, o);
        });
      }
    }, r.prototype.getTooltipAxes = function(t) {
      var e = [], n = [];
      return M(this.getCartesians(), function(i) {
        var a = t != null && t !== "auto" ? i.getAxis(t) : i.getBaseAxis(), o = i.getOtherAxis(a);
        we(e, a) < 0 && e.push(a), we(n, o) < 0 && n.push(o);
      }), {
        baseAxes: e,
        otherAxes: n
      };
    }, r.create = function(t, e) {
      var n = [];
      return t.eachComponent("grid", function(i, a) {
        var o = new r(i, t, e);
        o.name = "grid_" + a, o.resize(i, e, !0), i.coordinateSystem = o, n.push(o);
      }), t.eachSeries(function(i) {
        if (A2(i)) {
          var a = D2(i), o = a.xAxisModel, s = a.yAxisModel, l = o.getCoordSysModel(), u = l.coordinateSystem;
          i.coordinateSystem = u.getCartesian(o.componentIndex, s.componentIndex);
        }
      }), n;
    }, r.dimensions = Vm, r;
  }()
);
function _p(r, t) {
  return r.getCoordSysModel() === t;
}
function T2(r, t, e, n) {
  e.getAxesOnZeroOf = function() {
    return a ? [a] : [];
  };
  var i = r[t], a, o = e.model, s = o.get(["axisLine", "onZero"]), l = o.get(["axisLine", "onZeroAxisIndex"]);
  if (!s)
    return;
  if (l != null)
    M2(i[l]) && (a = i[l]);
  else
    for (var u in i)
      if (i.hasOwnProperty(u) && M2(i[u]) && !n[c(i[u])]) {
        a = i[u];
        break;
      }
  a && (n[c(a)] = !0);
  function c(f) {
    return f.dim + "_" + f.index;
  }
}
function M2(r) {
  return r && r.type !== "category" && r.type !== "time" && WG(r);
}
function vH(r, t) {
  var e = r.getExtent(), n = e[0] + e[1];
  r.toGlobalCoord = r.dim === "x" ? function(i) {
    return i + t;
  } : function(i) {
    return n - i + t;
  }, r.toLocalCoord = r.dim === "x" ? function(i) {
    return i - t;
  } : function(i) {
    return n - i + t;
  };
}
var Vi = Math.PI, tr = (
  /** @class */
  function() {
    function r(t, e) {
      this.group = new fe(), this.opt = e, this.axisModel = t, se(e, {
        labelOffset: 0,
        nameDirection: 1,
        tickDirection: 1,
        labelDirection: 1,
        silent: !0,
        handleAutoShown: function() {
          return !0;
        }
      });
      var n = new fe({
        x: e.position[0],
        y: e.position[1],
        rotation: e.rotation
      });
      n.updateTransform(), this._transformGroup = n;
    }
    return r.prototype.hasBuilder = function(t) {
      return !!I2[t];
    }, r.prototype.add = function(t) {
      I2[t](this.opt, this.axisModel, this.group, this._transformGroup);
    }, r.prototype.getGroup = function() {
      return this.group;
    }, r.innerTextLayout = function(t, e, n) {
      var i = IT(e - t), a, o;
      return du(i) ? (o = n > 0 ? "top" : "bottom", a = "center") : du(i - Vi) ? (o = n > 0 ? "bottom" : "top", a = "center") : (o = "middle", i > 0 && i < Vi ? a = n > 0 ? "right" : "left" : a = n > 0 ? "left" : "right"), {
        rotation: i,
        textAlign: a,
        textVerticalAlign: o
      };
    }, r.makeAxisEventDataBase = function(t) {
      var e = {
        componentType: t.mainType,
        componentIndex: t.componentIndex
      };
      return e[t.mainType + "Index"] = t.componentIndex, e;
    }, r.isLabelSilent = function(t) {
      var e = t.get("tooltip");
      return t.get("silent") || !(t.get("triggerEvent") || e && e.show);
    }, r;
  }()
), I2 = {
  axisLine: function(r, t, e, n) {
    var i = t.get(["axisLine", "show"]);
    if (i === "auto" && r.handleAutoShown && (i = r.handleAutoShown("axisLine")), !!i) {
      var a = t.axis.getExtent(), o = n.transform, s = [a[0], 0], l = [a[1], 0], u = s[0] > l[0];
      o && (Rt(s, s, o), Rt(l, l, o));
      var c = H({
        lineCap: "round"
      }, t.getModel(["axisLine", "lineStyle"]).getLineStyle()), f = new Ct({
        shape: {
          x1: s[0],
          y1: s[1],
          x2: l[0],
          y2: l[1]
        },
        style: c,
        strokeContainThreshold: r.strokeContainThreshold || 5,
        silent: !0,
        z2: 1
      });
      ys(f.shape, f.style.lineWidth), f.anid = "line", e.add(f);
      var h = t.get(["axisLine", "symbol"]);
      if (h != null) {
        var v = t.get(["axisLine", "symbolSize"]);
        J(h) && (h = [h, h]), (J(v) || Be(v)) && (v = [v, v]);
        var d = Co(t.get(["axisLine", "symbolOffset"]) || 0, v), p = v[0], g = v[1];
        M([{
          rotate: r.rotation + Math.PI / 2,
          offset: d[0],
          r: 0
        }, {
          rotate: r.rotation - Math.PI / 2,
          offset: d[1],
          r: Math.sqrt((s[0] - l[0]) * (s[0] - l[0]) + (s[1] - l[1]) * (s[1] - l[1]))
        }], function(m, y) {
          if (h[y] !== "none" && h[y] != null) {
            var _ = yt(h[y], -p / 2, -g / 2, p, g, c.stroke, !0), b = m.r + m.offset, S = u ? l : s;
            _.attr({
              rotation: m.rotate,
              x: S[0] + b * Math.cos(r.rotation),
              y: S[1] - b * Math.sin(r.rotation),
              silent: !0,
              z2: 11
            }), e.add(_);
          }
        });
      }
    }
  },
  axisTickLabel: function(r, t, e, n) {
    var i = gH(e, n, t, r), a = yH(e, n, t, r);
    if (pH(t, a, i), mH(e, n, t, r.tickDirection), t.get(["axisLabel", "hideOverlap"])) {
      var o = LL(U(a, function(s) {
        return {
          label: s,
          priority: s.z2,
          defaultAttr: {
            ignore: s.ignore
          }
        };
      }));
      kL(o);
    }
  },
  axisName: function(r, t, e, n) {
    var i = Et(r.axisName, t.get("name"));
    if (i) {
      var a = t.get("nameLocation"), o = r.nameDirection, s = t.getModel("nameTextStyle"), l = t.get("nameGap") || 0, u = t.axis.getExtent(), c = u[0] > u[1] ? -1 : 1, f = [
        a === "start" ? u[0] - c * l : a === "end" ? u[1] + c * l : (u[0] + u[1]) / 2,
        // Reuse labelOffset.
        E2(a) ? r.labelOffset + o * l : 0
      ], h, v = t.get("nameRotate");
      v != null && (v = v * Vi / 180);
      var d;
      E2(a) ? h = tr.innerTextLayout(
        r.rotation,
        v ?? r.rotation,
        // Adapt to axis.
        o
      ) : (h = dH(r.rotation, a, v || 0, u), d = r.axisNameAvailableWidth, d != null && (d = Math.abs(d / Math.sin(h.rotation)), !isFinite(d) && (d = null)));
      var p = s.getFont(), g = t.get("nameTruncate", !0) || {}, m = g.ellipsis, y = Et(r.nameTruncateMaxWidth, g.maxWidth, d), _ = new Fe({
        x: f[0],
        y: f[1],
        rotation: h.rotation,
        silent: tr.isLabelSilent(t),
        style: nt(s, {
          text: i,
          font: p,
          overflow: "truncate",
          width: y,
          ellipsis: m,
          fill: s.getTextColor() || t.get(["axisLine", "lineStyle", "color"]),
          align: s.get("align") || h.textAlign,
          verticalAlign: s.get("verticalAlign") || h.textVerticalAlign
        }),
        z2: 1
      });
      if (xo({
        el: _,
        componentModel: t,
        itemName: i
      }), _.__fullText = i, _.anid = "name", t.get("triggerEvent")) {
        var b = tr.makeAxisEventDataBase(t);
        b.targetType = "axisName", b.name = i, pe(_).eventData = b;
      }
      n.add(_), _.updateTransform(), e.add(_), _.decomposeTransform();
    }
  }
};
function dH(r, t, e, n) {
  var i = IT(e - r), a, o, s = n[0] > n[1], l = t === "start" && !s || t !== "start" && s;
  return du(i - Vi / 2) ? (o = l ? "bottom" : "top", a = "center") : du(i - Vi * 1.5) ? (o = l ? "top" : "bottom", a = "center") : (o = "middle", i < Vi * 1.5 && i > Vi / 2 ? a = l ? "left" : "right" : a = l ? "right" : "left"), {
    rotation: i,
    textAlign: a,
    textVerticalAlign: o
  };
}
function pH(r, t, e) {
  if (!mL(r.axis)) {
    var n = r.get(["axisLabel", "showMinLabel"]), i = r.get(["axisLabel", "showMaxLabel"]);
    t = t || [], e = e || [];
    var a = t[0], o = t[1], s = t[t.length - 1], l = t[t.length - 2], u = e[0], c = e[1], f = e[e.length - 1], h = e[e.length - 2];
    n === !1 ? (Lr(a), Lr(u)) : L2(a, o) && (n ? (Lr(o), Lr(c)) : (Lr(a), Lr(u))), i === !1 ? (Lr(s), Lr(f)) : L2(l, s) && (i ? (Lr(l), Lr(h)) : (Lr(s), Lr(f)));
  }
}
function Lr(r) {
  r && (r.ignore = !0);
}
function L2(r, t) {
  var e = r && r.getBoundingRect().clone(), n = t && t.getBoundingRect().clone();
  if (!(!e || !n)) {
    var i = rv([]);
    return So(i, i, -r.rotation), e.applyTransform(ei([], i, r.getLocalTransform())), n.applyTransform(ei([], i, t.getLocalTransform())), e.intersect(n);
  }
}
function E2(r) {
  return r === "middle" || r === "center";
}
function dE(r, t, e, n, i) {
  for (var a = [], o = [], s = [], l = 0; l < r.length; l++) {
    var u = r[l].coord;
    o[0] = u, o[1] = 0, s[0] = u, s[1] = e, t && (Rt(o, o, t), Rt(s, s, t));
    var c = new Ct({
      shape: {
        x1: o[0],
        y1: o[1],
        x2: s[0],
        y2: s[1]
      },
      style: n,
      z2: 2,
      autoBatch: !0,
      silent: !0
    });
    ys(c.shape, c.style.lineWidth), c.anid = i + "_" + r[l].tickValue, a.push(c);
  }
  return a;
}
function gH(r, t, e, n) {
  var i = e.axis, a = e.getModel("axisTick"), o = a.get("show");
  if (o === "auto" && n.handleAutoShown && (o = n.handleAutoShown("axisTick")), !(!o || i.scale.isBlank())) {
    for (var s = a.getModel("lineStyle"), l = n.tickDirection * a.get("length"), u = i.getTicksCoords(), c = dE(u, t.transform, l, se(s.getLineStyle(), {
      stroke: e.get(["axisLine", "lineStyle", "color"])
    }), "ticks"), f = 0; f < c.length; f++)
      r.add(c[f]);
    return c;
  }
}
function mH(r, t, e, n) {
  var i = e.axis, a = e.getModel("minorTick");
  if (!(!a.get("show") || i.scale.isBlank())) {
    var o = i.getMinorTicksCoords();
    if (o.length)
      for (var s = a.getModel("lineStyle"), l = n * a.get("length"), u = se(s.getLineStyle(), se(e.getModel("axisTick").getLineStyle(), {
        stroke: e.get(["axisLine", "lineStyle", "color"])
      })), c = 0; c < o.length; c++)
        for (var f = dE(o[c], t.transform, l, u, "minorticks_" + c), h = 0; h < f.length; h++)
          r.add(f[h]);
  }
}
function yH(r, t, e, n) {
  var i = e.axis, a = Et(n.axisLabelShow, e.get(["axisLabel", "show"]));
  if (!(!a || i.scale.isBlank())) {
    var o = e.getModel("axisLabel"), s = o.get("margin"), l = i.getViewLabels(), u = (Et(n.labelRotate, o.get("rotate")) || 0) * Vi / 180, c = tr.innerTextLayout(n.rotation, u, n.labelDirection), f = e.getCategories && e.getCategories(!0), h = [], v = tr.isLabelSilent(e), d = e.get("triggerEvent");
    return M(l, function(p, g) {
      var m = i.scale.type === "ordinal" ? i.scale.getRawOrdinalNumber(p.tickValue) : p.tickValue, y = p.formattedLabel, _ = p.rawLabel, b = o;
      if (f && f[m]) {
        var S = f[m];
        ue(S) && S.textStyle && (b = new Ze(S.textStyle, o, e.ecModel));
      }
      var x = b.getTextColor() || e.get(["axisLine", "lineStyle", "color"]), w = i.dataToCoord(m), C = b.getShallow("align", !0) || c.textAlign, D = me(b.getShallow("alignMinLabel", !0), C), A = me(b.getShallow("alignMaxLabel", !0), C), T = b.getShallow("verticalAlign", !0) || b.getShallow("baseline", !0) || c.textVerticalAlign, L = me(b.getShallow("verticalAlignMinLabel", !0), T), E = me(b.getShallow("verticalAlignMaxLabel", !0), T), I = new Fe({
        x: w,
        y: n.labelOffset + n.labelDirection * s,
        rotation: c.rotation,
        silent: v,
        z2: 10 + (p.level || 0),
        style: nt(b, {
          text: y,
          align: g === 0 ? D : g === l.length - 1 ? A : C,
          verticalAlign: g === 0 ? L : g === l.length - 1 ? E : T,
          fill: oe(x) ? x(
            // (1) In category axis with data zoom, tick is not the original
            // index of axis.data. So tick should not be exposed to user
            // in category axis.
            // (2) Compatible with previous version, which always use formatted label as
            // input. But in interval scale the formatted label is like '223,445', which
            // maked user replace ','. So we modify it to return original val but remain
            // it as 'string' to avoid error in replacing.
            i.type === "category" ? _ : i.type === "value" ? m + "" : m,
            g
          ) : x
        })
      });
      if (I.anid = "label_" + m, xo({
        el: I,
        componentModel: e,
        itemName: y,
        formatterParamsExtra: {
          isTruncated: function() {
            return I.isTruncated;
          },
          value: _,
          tickIndex: g
        }
      }), d) {
        var P = tr.makeAxisEventDataBase(e);
        P.targetType = "axisLabel", P.value = _, P.tickIndex = g, i.type === "category" && (P.dataIndex = m), pe(I).eventData = P;
      }
      t.add(I), I.updateTransform(), h.push(I), r.add(I), I.decomposeTransform();
    }), h;
  }
}
function _H(r, t) {
  var e = {
    /**
     * key: makeKey(axis.model)
     * value: {
     *      axis,
     *      coordSys,
     *      axisPointerModel,
     *      triggerTooltip,
     *      triggerEmphasis,
     *      involveSeries,
     *      snap,
     *      seriesModels,
     *      seriesDataCount
     * }
     */
    axesInfo: {},
    seriesInvolved: !1,
    /**
     * key: makeKey(coordSys.model)
     * value: Object: key makeKey(axis.model), value: axisInfo
     */
    coordSysAxesInfo: {},
    coordSysMap: {}
  };
  return bH(e, r, t), e.seriesInvolved && xH(e, r), e;
}
function bH(r, t, e) {
  var n = t.getComponent("tooltip"), i = t.getComponent("axisPointer"), a = i.get("link", !0) || [], o = [];
  M(e.getCoordinateSystems(), function(s) {
    if (!s.axisPointerEnabled)
      return;
    var l = Iu(s.model), u = r.coordSysAxesInfo[l] = {};
    r.coordSysMap[l] = s;
    var c = s.model, f = c.getModel("tooltip", n);
    if (M(s.getAxes(), ye(p, !1, null)), s.getTooltipAxes && n && f.get("show")) {
      var h = f.get("trigger") === "axis", v = f.get(["axisPointer", "type"]) === "cross", d = s.getTooltipAxes(f.get(["axisPointer", "axis"]));
      (h || v) && M(d.baseAxes, ye(p, v ? "cross" : !0, h)), v && M(d.otherAxes, ye(p, "cross", !1));
    }
    function p(g, m, y) {
      var _ = y.model.getModel("axisPointer", i), b = _.get("show");
      if (!(!b || b === "auto" && !g && !Gm(_))) {
        m == null && (m = _.get("triggerTooltip")), _ = g ? SH(y, f, i, t, g, m) : _;
        var S = _.get("snap"), x = _.get("triggerEmphasis"), w = Iu(y.model), C = m || S || y.type === "category", D = r.axesInfo[w] = {
          key: w,
          axis: y,
          coordSys: s,
          axisPointerModel: _,
          triggerTooltip: m,
          triggerEmphasis: x,
          involveSeries: C,
          snap: S,
          useHandle: Gm(_),
          seriesModels: [],
          linkGroup: null
        };
        u[w] = D, r.seriesInvolved = r.seriesInvolved || C;
        var A = wH(a, y);
        if (A != null) {
          var T = o[A] || (o[A] = {
            axesInfo: {}
          });
          T.axesInfo[w] = D, T.mapper = a[A].mapper, D.linkGroup = T;
        }
      }
    }
  });
}
function SH(r, t, e, n, i, a) {
  var o = t.getModel("axisPointer"), s = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], l = {};
  M(s, function(h) {
    l[h] = ce(o.get(h));
  }), l.snap = r.type !== "category" && !!a, o.get("type") === "cross" && (l.type = "line");
  var u = l.label || (l.label = {});
  if (u.show == null && (u.show = !1), i === "cross") {
    var c = o.get(["label", "show"]);
    if (u.show = c ?? !0, !a) {
      var f = l.lineStyle = o.get("crossStyle");
      f && se(u, f.textStyle);
    }
  }
  return r.model.getModel("axisPointer", new Ze(l, e, n));
}
function xH(r, t) {
  t.eachSeries(function(e) {
    var n = e.coordinateSystem, i = e.get(["tooltip", "trigger"], !0), a = e.get(["tooltip", "show"], !0);
    !n || i === "none" || i === !1 || i === "item" || a === !1 || e.get(["axisPointer", "show"], !0) === !1 || M(r.coordSysAxesInfo[Iu(n.model)], function(o) {
      var s = o.axis;
      n.getAxis(s.dim) === s && (o.seriesModels.push(e), o.seriesDataCount == null && (o.seriesDataCount = 0), o.seriesDataCount += e.getData().count());
    });
  });
}
function wH(r, t) {
  for (var e = t.model, n = t.dim, i = 0; i < r.length; i++) {
    var a = r[i] || {};
    if (bp(a[n + "AxisId"], e.id) || bp(a[n + "AxisIndex"], e.componentIndex) || bp(a[n + "AxisName"], e.name))
      return i;
  }
}
function bp(r, t) {
  return r === "all" || q(r) && we(r, t) >= 0 || r === t;
}
function CH(r) {
  var t = r_(r);
  if (t) {
    var e = t.axisPointerModel, n = t.axis.scale, i = e.option, a = e.get("status"), o = e.get("value");
    o != null && (o = n.parse(o));
    var s = Gm(e);
    a == null && (i.status = s ? "show" : "hide");
    var l = n.getExtent().slice();
    l[0] > l[1] && l.reverse(), // Pick a value on axis when initializing.
    (o == null || o > l[1]) && (o = l[1]), o < l[0] && (o = l[0]), i.value = o, s && (i.status = t.axis.scale.isBlank() ? "hide" : "show");
  }
}
function r_(r) {
  var t = (r.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
  return t && t.axesInfo[Iu(r)];
}
function AH(r) {
  var t = r_(r);
  return t && t.axisPointerModel;
}
function Gm(r) {
  return !!r.get(["handle", "show"]);
}
function Iu(r) {
  return r.type + "||" + r.id;
}
var P2 = {}, To = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      this.axisPointerClass && CH(e), r.prototype.render.apply(this, arguments), this._doUpdateAxisPointerClass(e, i, !0);
    }, t.prototype.updateAxisPointer = function(e, n, i, a) {
      this._doUpdateAxisPointerClass(e, i, !1);
    }, t.prototype.remove = function(e, n) {
      var i = this._axisPointer;
      i && i.remove(n);
    }, t.prototype.dispose = function(e, n) {
      this._disposeAxisPointer(n), r.prototype.dispose.apply(this, arguments);
    }, t.prototype._doUpdateAxisPointerClass = function(e, n, i) {
      var a = t.getAxisPointerClass(this.axisPointerClass);
      if (a) {
        var o = AH(e);
        o ? (this._axisPointer || (this._axisPointer = new a())).render(e, o, n, i) : this._disposeAxisPointer(n);
      }
    }, t.prototype._disposeAxisPointer = function(e) {
      this._axisPointer && this._axisPointer.dispose(e), this._axisPointer = null;
    }, t.registerAxisPointerClass = function(e, n) {
      P2[e] = n;
    }, t.getAxisPointerClass = function(e) {
      return e && P2[e];
    }, t.type = "axis", t;
  }(lt)
), Hm = Oe();
function pE(r, t, e, n) {
  var i = e.axis;
  if (!i.scale.isBlank()) {
    var a = e.getModel("splitArea"), o = a.getModel("areaStyle"), s = o.get("color"), l = n.coordinateSystem.getRect(), u = i.getTicksCoords({
      tickModel: a,
      clamp: !0
    });
    if (u.length) {
      var c = s.length, f = Hm(r).splitAreaColors, h = re(), v = 0;
      if (f)
        for (var d = 0; d < u.length; d++) {
          var p = f.get(u[d].tickValue);
          if (p != null) {
            v = (p + (c - 1) * d) % c;
            break;
          }
        }
      var g = i.toGlobalCoord(u[0].coord), m = o.getAreaStyle();
      s = q(s) ? s : [s];
      for (var d = 1; d < u.length; d++) {
        var y = i.toGlobalCoord(u[d].coord), _ = void 0, b = void 0, S = void 0, x = void 0;
        i.isHorizontal() ? (_ = g, b = l.y, S = y - _, x = l.height, g = _ + S) : (_ = l.x, b = g, S = l.width, x = y - b, g = b + x);
        var w = u[d - 1].tickValue;
        w != null && h.set(w, v), t.add(new ke({
          anid: w != null ? "area_" + w : null,
          shape: {
            x: _,
            y: b,
            width: S,
            height: x
          },
          style: se({
            fill: s[v]
          }, m),
          autoBatch: !0,
          silent: !0
        })), v = (v + 1) % c;
      }
      Hm(r).splitAreaColors = h;
    }
  }
}
function gE(r) {
  Hm(r).splitAreaColors = null;
}
var DH = ["axisLine", "axisTickLabel", "axisName"], TH = ["splitArea", "splitLine", "minorSplitLine"], mE = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.axisPointerClass = "CartesianAxisPointer", e;
    }
    return t.prototype.render = function(e, n, i, a) {
      this.group.removeAll();
      var o = this._axisGroup;
      if (this._axisGroup = new fe(), this.group.add(this._axisGroup), !!e.get("show")) {
        var s = e.getCoordSysModel(), l = $m(s, e), u = new tr(e, H({
          handleAutoShown: function(f) {
            for (var h = s.coordinateSystem.getCartesians(), v = 0; v < h.length; v++)
              if (km(h[v].getOtherAxis(e.axis).scale))
                return !0;
            return !1;
          }
        }, l));
        M(DH, u.add, u), this._axisGroup.add(u.getGroup()), M(TH, function(f) {
          e.get([f, "show"]) && MH[f](this, this._axisGroup, e, s);
        }, this);
        var c = a && a.type === "changeAxisOrder" && a.isInitSort;
        c || Uu(o, this._axisGroup, e), r.prototype.render.call(this, e, n, i, a);
      }
    }, t.prototype.remove = function() {
      gE(this);
    }, t.type = "cartesianAxis", t;
  }(To)
), MH = {
  splitLine: function(r, t, e, n) {
    var i = e.axis;
    if (!i.scale.isBlank()) {
      var a = e.getModel("splitLine"), o = a.getModel("lineStyle"), s = o.get("color"), l = a.get("showMinLine") !== !1, u = a.get("showMaxLine") !== !1;
      s = q(s) ? s : [s];
      for (var c = n.coordinateSystem.getRect(), f = i.isHorizontal(), h = 0, v = i.getTicksCoords({
        tickModel: a
      }), d = [], p = [], g = o.getLineStyle(), m = 0; m < v.length; m++) {
        var y = i.toGlobalCoord(v[m].coord);
        if (!(m === 0 && !l || m === v.length - 1 && !u)) {
          var _ = v[m].tickValue;
          f ? (d[0] = y, d[1] = c.y, p[0] = y, p[1] = c.y + c.height) : (d[0] = c.x, d[1] = y, p[0] = c.x + c.width, p[1] = y);
          var b = h++ % s.length, S = new Ct({
            anid: _ != null ? "line_" + _ : null,
            autoBatch: !0,
            shape: {
              x1: d[0],
              y1: d[1],
              x2: p[0],
              y2: p[1]
            },
            style: se({
              stroke: s[b]
            }, g),
            silent: !0
          });
          ys(S.shape, g.lineWidth), t.add(S);
        }
      }
    }
  },
  minorSplitLine: function(r, t, e, n) {
    var i = e.axis, a = e.getModel("minorSplitLine"), o = a.getModel("lineStyle"), s = n.coordinateSystem.getRect(), l = i.isHorizontal(), u = i.getMinorTicksCoords();
    if (u.length)
      for (var c = [], f = [], h = o.getLineStyle(), v = 0; v < u.length; v++)
        for (var d = 0; d < u[v].length; d++) {
          var p = i.toGlobalCoord(u[v][d].coord);
          l ? (c[0] = p, c[1] = s.y, f[0] = p, f[1] = s.y + s.height) : (c[0] = s.x, c[1] = p, f[0] = s.x + s.width, f[1] = p);
          var g = new Ct({
            anid: "minor_line_" + u[v][d].tickValue,
            autoBatch: !0,
            shape: {
              x1: c[0],
              y1: c[1],
              x2: f[0],
              y2: f[1]
            },
            style: h,
            silent: !0
          });
          ys(g.shape, h.lineWidth), t.add(g);
        }
  },
  splitArea: function(r, t, e, n) {
    pE(r, t, e, n);
  }
}, yE = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "xAxis", t;
  }(mE)
), IH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = yE.type, e;
    }
    return t.type = "yAxis", t;
  }(mE)
), LH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "grid", e;
    }
    return t.prototype.render = function(e, n) {
      this.group.removeAll(), e.get("show") && this.group.add(new ke({
        shape: e.coordinateSystem.getRect(),
        style: se({
          fill: e.get("backgroundColor")
        }, e.getItemStyle()),
        silent: !0,
        z2: -1
      }));
    }, t.type = "grid", t;
  }(lt)
), k2 = {
  // gridIndex: 0,
  // gridId: '',
  offset: 0
};
function _E(r) {
  r.registerComponentView(LH), r.registerComponentModel(iH), r.registerCoordinateSystem("cartesian2d", hH), ws(r, "x", zm, k2), ws(r, "y", zm, k2), r.registerComponentView(yE), r.registerComponentView(IH), r.registerPreprocessor(function(t) {
    t.xAxis && t.yAxis && !t.grid && (t.grid = {});
  });
}
function EH(r) {
  De(_E), r.registerSeriesModel(Q9), r.registerChartView(nH), r.registerLayout(tc("scatter"));
}
function PH(r) {
  r.eachSeriesByType("radar", function(t) {
    var e = t.getData(), n = [], i = t.coordinateSystem;
    if (i) {
      var a = i.getIndicatorAxes();
      M(a, function(o, s) {
        e.each(e.mapDimension(a[s].dim), function(l, u) {
          n[u] = n[u] || [];
          var c = i.dataToPoint(l, s);
          n[u][s] = R2(c) ? c : O2(i);
        });
      }), e.each(function(o) {
        var s = _3(n[o], function(l) {
          return R2(l);
        }) || O2(i);
        n[o].push(s.slice()), e.setItemLayout(o, n[o]);
      });
    }
  });
}
function R2(r) {
  return !isNaN(r[0]) && !isNaN(r[1]);
}
function O2(r) {
  return [r.cx, r.cy];
}
function kH(r) {
  var t = r.polar;
  if (t) {
    q(t) || (t = [t]);
    var e = [];
    M(t, function(n, i) {
      n.indicator ? (n.type && !n.shape && (n.shape = n.type), r.radar = r.radar || [], q(r.radar) || (r.radar = [r.radar]), r.radar.push(n)) : e.push(n);
    }), r.polar = e;
  }
  M(r.series, function(n) {
    n && n.type === "radar" && n.polarIndex && (n.radarIndex = n.polarIndex);
  });
}
var RH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.coordinateSystem, o = this.group, s = e.getData(), l = this._data;
      function u(h, v) {
        var d = h.getItemVisual(v, "symbol") || "circle";
        if (d !== "none") {
          var p = $s(h.getItemVisual(v, "symbolSize")), g = yt(d, -1, -1, 2, 2), m = h.getItemVisual(v, "symbolRotate") || 0;
          return g.attr({
            style: {
              strokeNoScale: !0
            },
            z2: 100,
            scaleX: p[0] / 2,
            scaleY: p[1] / 2,
            rotation: m * Math.PI / 180 || 0
          }), g;
        }
      }
      function c(h, v, d, p, g, m) {
        d.removeAll();
        for (var y = 0; y < v.length - 1; y++) {
          var _ = u(p, g);
          _ && (_.__dimIdx = y, h[y] ? (_.setPosition(h[y]), wo[m ? "initProps" : "updateProps"](_, {
            x: v[y][0],
            y: v[y][1]
          }, e, g)) : _.setPosition(v[y]), d.add(_));
        }
      }
      function f(h) {
        return U(h, function(v) {
          return [a.cx, a.cy];
        });
      }
      s.diff(l).add(function(h) {
        var v = s.getItemLayout(h);
        if (v) {
          var d = new ar(), p = new sr(), g = {
            shape: {
              points: v
            }
          };
          d.shape.points = f(v), p.shape.points = f(v), st(d, g, e, h), st(p, g, e, h);
          var m = new fe(), y = new fe();
          m.add(p), m.add(d), m.add(y), c(p.shape.points, v, y, s, h, !0), s.setItemGraphicEl(h, m);
        }
      }).update(function(h, v) {
        var d = l.getItemGraphicEl(v), p = d.childAt(0), g = d.childAt(1), m = d.childAt(2), y = {
          shape: {
            points: s.getItemLayout(h)
          }
        };
        y.shape.points && (c(p.shape.points, y.shape.points, m, s, h, !1), un(g), un(p), Ne(p, y, e), Ne(g, y, e), s.setItemGraphicEl(h, d));
      }).remove(function(h) {
        o.remove(l.getItemGraphicEl(h));
      }).execute(), s.eachItemGraphicEl(function(h, v) {
        var d = s.getItemModel(v), p = h.childAt(0), g = h.childAt(1), m = h.childAt(2), y = s.getItemVisual(v, "style"), _ = y.fill;
        o.add(h), p.useStyle(se(d.getModel("lineStyle").getLineStyle(), {
          fill: "none",
          stroke: _
        })), Ft(p, d, "lineStyle"), Ft(g, d, "areaStyle");
        var b = d.getModel("areaStyle"), S = b.isEmpty() && b.parentModel.isEmpty();
        g.ignore = S, M(["emphasis", "select", "blur"], function(C) {
          var D = d.getModel([C, "areaStyle"]), A = D.isEmpty() && D.parentModel.isEmpty();
          g.ensureState(C).ignore = A && S;
        }), g.useStyle(se(b.getAreaStyle(), {
          fill: _,
          opacity: 0.7,
          decal: y.decal
        }));
        var x = d.getModel("emphasis"), w = x.getModel("itemStyle").getItemStyle();
        m.eachChild(function(C) {
          if (C instanceof Pt) {
            var D = C.style;
            C.useStyle(H({
              // TODO other properties like x, y ?
              image: D.image,
              x: D.x,
              y: D.y,
              width: D.width,
              height: D.height
            }, y));
          } else
            C.useStyle(y), C.setColor(_), C.style.strokeNoScale = !0;
          var A = C.ensureState("emphasis");
          A.style = ce(w);
          var T = s.getStore().get(s.getDimensionIndex(C.__dimIdx), v);
          (T == null || isNaN(T)) && (T = ""), Bt(C, Mt(d), {
            labelFetcher: s.hostModel,
            labelDataIndex: v,
            labelDimIndex: C.__dimIdx,
            defaultText: T,
            inheritColor: _,
            defaultOpacity: y.opacity
          });
        }), ut(h, x.get("focus"), x.get("blurScope"), x.get("disabled"));
      }), this._data = s;
    }, t.prototype.remove = function() {
      this.group.removeAll(), this._data = null;
    }, t.type = "radar", t;
  }(Qe)
), OH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e;
    }
    return t.prototype.init = function(e) {
      r.prototype.init.apply(this, arguments), this.legendVisualProvider = new nc(Q(this.getData, this), Q(this.getRawData, this));
    }, t.prototype.getInitialData = function(e, n) {
      return Hs(this, {
        generateCoord: "indicator_",
        generateCoordCount: 1 / 0
      });
    }, t.prototype.formatTooltip = function(e, n, i) {
      var a = this.getData(), o = this.coordinateSystem, s = o.getIndicatorAxes(), l = this.getData().getName(e), u = l === "" ? this.name : l, c = mI(this, e);
      return It("section", {
        header: u,
        sortBlocks: !0,
        blocks: U(s, function(f) {
          var h = a.get(a.mapDimension(f.dim), e);
          return It("nameValue", {
            markerType: "subItem",
            markerColor: c,
            name: f.name,
            value: h,
            sortParam: h
          });
        })
      });
    }, t.prototype.getTooltipPosition = function(e) {
      if (e != null) {
        for (var n = this.getData(), i = this.coordinateSystem, a = n.getValues(U(i.dimensions, function(u) {
          return n.mapDimension(u);
        }), e), o = 0, s = a.length; o < s; o++)
          if (!isNaN(a[o])) {
            var l = i.getIndicatorAxes();
            return i.coordToPoint(l[o].dataToCoord(a[o]), o);
          }
      }
    }, t.type = "series.radar", t.dependencies = ["radar"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      colorBy: "data",
      coordinateSystem: "radar",
      legendHoverLink: !0,
      radarIndex: 0,
      lineStyle: {
        width: 2,
        type: "solid",
        join: "round"
      },
      label: {
        position: "top"
      },
      // areaStyle: {
      // },
      // itemStyle: {}
      symbolSize: 8
      // symbolRotate: null
    }, t;
  }(it)
), pl = hE.value;
function Jc(r, t) {
  return se({
    show: t
  }, r);
}
var FH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.optionUpdated = function() {
      var e = this.get("boundaryGap"), n = this.get("splitNumber"), i = this.get("scale"), a = this.get("axisLine"), o = this.get("axisTick"), s = this.get("axisLabel"), l = this.get("axisName"), u = this.get(["axisName", "show"]), c = this.get(["axisName", "formatter"]), f = this.get("axisNameGap"), h = this.get("triggerEvent"), v = U(this.get("indicator") || [], function(d) {
        d.max != null && d.max > 0 && !d.min ? d.min = 0 : d.min != null && d.min < 0 && !d.max && (d.max = 0);
        var p = l;
        d.color != null && (p = se({
          color: d.color
        }, l));
        var g = _e(ce(d), {
          boundaryGap: e,
          splitNumber: n,
          scale: i,
          axisLine: a,
          axisTick: o,
          // axisType: axisType,
          axisLabel: s,
          // Compatible with 2 and use text
          name: d.text,
          showName: u,
          nameLocation: "end",
          nameGap: f,
          // min: 0,
          nameTextStyle: p,
          triggerEvent: h
        }, !1);
        if (J(c)) {
          var m = g.name;
          g.name = c.replace("{value}", m ?? "");
        } else oe(c) && (g.name = c(g.name, g));
        var y = new Ze(g, null, this.ecModel);
        return _t(y, Ku.prototype), y.mainType = "radar", y.componentIndex = this.componentIndex, y;
      }, this);
      this._indicatorModels = v;
    }, t.prototype.getIndicatorModels = function() {
      return this._indicatorModels;
    }, t.type = "radar", t.defaultOption = {
      // zlevel: 0,
      z: 0,
      center: ["50%", "50%"],
      radius: "75%",
      startAngle: 90,
      axisName: {
        show: !0
        // formatter: null
        // textStyle: {}
      },
      boundaryGap: [0, 0],
      splitNumber: 5,
      axisNameGap: 15,
      scale: !1,
      // Polygon or circle
      shape: "polygon",
      axisLine: _e({
        lineStyle: {
          color: "#bbb"
        }
      }, pl.axisLine),
      axisLabel: Jc(pl.axisLabel, !1),
      axisTick: Jc(pl.axisTick, !1),
      // axisType: 'value',
      splitLine: Jc(pl.splitLine, !0),
      splitArea: Jc(pl.splitArea, !0),
      // {text, min, max}
      indicator: []
    }, t;
  }(Le)
), BH = ["axisLine", "axisTickLabel", "axisName"], NH = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = this.group;
      a.removeAll(), this._buildAxes(e), this._buildSplitLineAndArea(e);
    }, t.prototype._buildAxes = function(e) {
      var n = e.coordinateSystem, i = n.getIndicatorAxes(), a = U(i, function(o) {
        var s = o.model.get("showName") ? o.name : "", l = new tr(o.model, {
          axisName: s,
          position: [n.cx, n.cy],
          rotation: o.angle,
          labelDirection: -1,
          tickDirection: -1,
          nameDirection: 1
        });
        return l;
      });
      M(a, function(o) {
        M(BH, o.add, o), this.group.add(o.getGroup());
      }, this);
    }, t.prototype._buildSplitLineAndArea = function(e) {
      var n = e.coordinateSystem, i = n.getIndicatorAxes();
      if (!i.length)
        return;
      var a = e.get("shape"), o = e.getModel("splitLine"), s = e.getModel("splitArea"), l = o.getModel("lineStyle"), u = s.getModel("areaStyle"), c = o.get("show"), f = s.get("show"), h = l.get("color"), v = u.get("color"), d = q(h) ? h : [h], p = q(v) ? v : [v], g = [], m = [];
      function y(P, R, F) {
        var O = F % R.length;
        return P[O] = P[O] || [], O;
      }
      if (a === "circle")
        for (var _ = i[0].getTicksCoords(), b = n.cx, S = n.cy, x = 0; x < _.length; x++) {
          if (c) {
            var w = y(g, d, x);
            g[w].push(new pi({
              shape: {
                cx: b,
                cy: S,
                r: _[x].coord
              }
            }));
          }
          if (f && x < _.length - 1) {
            var w = y(m, p, x);
            m[w].push(new Hu({
              shape: {
                cx: b,
                cy: S,
                r0: _[x].coord,
                r: _[x + 1].coord
              }
            }));
          }
        }
      else
        for (var C, D = U(i, function(P, R) {
          var F = P.getTicksCoords();
          return C = C == null ? F.length - 1 : Math.min(F.length - 1, C), U(F, function(O) {
            return n.coordToPoint(O.coord, R);
          });
        }), A = [], x = 0; x <= C; x++) {
          for (var T = [], L = 0; L < i.length; L++)
            T.push(D[L][x]);
          if (T[0] && T.push(T[0].slice()), c) {
            var w = y(g, d, x);
            g[w].push(new sr({
              shape: {
                points: T
              }
            }));
          }
          if (f && A) {
            var w = y(m, p, x - 1);
            m[w].push(new ar({
              shape: {
                points: T.concat(A)
              }
            }));
          }
          A = T.slice().reverse();
        }
      var E = l.getLineStyle(), I = u.getAreaStyle();
      M(m, function(P, R) {
        this.group.add(Vr(P, {
          style: se({
            stroke: "none",
            fill: p[R % p.length]
          }, I),
          silent: !0
        }));
      }, this), M(g, function(P, R) {
        this.group.add(Vr(P, {
          style: se({
            fill: "none",
            stroke: d[R % d.length]
          }, E),
          silent: !0
        }));
      }, this);
    }, t.type = "radar", t;
  }(lt)
), zH = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this, e, n, i) || this;
      return a.type = "value", a.angle = 0, a.name = "", a;
    }
    return t;
  }(hn)
), VH = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.dimensions = [], this._model = t, this._indicatorAxes = U(t.getIndicatorModels(), function(i, a) {
        var o = "indicator_" + a, s = new zH(
          o,
          new ui()
          // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()
        );
        return s.name = i.get("name"), s.model = i, i.axis = s, this.dimensions.push(o), s;
      }, this), this.resize(t, n);
    }
    return r.prototype.getIndicatorAxes = function() {
      return this._indicatorAxes;
    }, r.prototype.dataToPoint = function(t, e) {
      var n = this._indicatorAxes[e];
      return this.coordToPoint(n.dataToCoord(t), e);
    }, r.prototype.coordToPoint = function(t, e) {
      var n = this._indicatorAxes[e], i = n.angle, a = this.cx + t * Math.cos(i), o = this.cy - t * Math.sin(i);
      return [a, o];
    }, r.prototype.pointToData = function(t) {
      var e = t[0] - this.cx, n = t[1] - this.cy, i = Math.sqrt(e * e + n * n);
      e /= i, n /= i;
      for (var a = Math.atan2(-n, e), o = 1 / 0, s, l = -1, u = 0; u < this._indicatorAxes.length; u++) {
        var c = this._indicatorAxes[u], f = Math.abs(a - c.angle);
        f < o && (s = c, l = u, o = f);
      }
      return [l, +(s && s.coordToData(i))];
    }, r.prototype.resize = function(t, e) {
      var n = t.get("center"), i = e.getWidth(), a = e.getHeight(), o = Math.min(i, a) / 2;
      this.cx = X(n[0], i), this.cy = X(n[1], a), this.startAngle = t.get("startAngle") * Math.PI / 180;
      var s = t.get("radius");
      (J(s) || Be(s)) && (s = [0, s]), this.r0 = X(s[0], o), this.r = X(s[1], o), M(this._indicatorAxes, function(l, u) {
        l.setExtent(this.r0, this.r);
        var c = this.startAngle + u * Math.PI * 2 / this._indicatorAxes.length;
        c = Math.atan2(Math.sin(c), Math.cos(c)), l.angle = c;
      }, this);
    }, r.prototype.update = function(t, e) {
      var n = this._indicatorAxes, i = this._model;
      M(n, function(s) {
        s.scale.setExtent(1 / 0, -1 / 0);
      }), t.eachSeriesByType("radar", function(s, l) {
        if (!(s.get("coordinateSystem") !== "radar" || t.getComponent("radar", s.get("radarIndex")) !== i)) {
          var u = s.getData();
          M(n, function(c) {
            c.scale.unionExtentFromData(u, u.mapDimension(c.dim));
          });
        }
      }, this);
      var a = i.get("splitNumber"), o = new ui();
      o.setExtent(0, a), o.setInterval(1), M(n, function(s, l) {
        vE(s.scale, s.model, o);
      });
    }, r.prototype.convertToPixel = function(t, e, n) {
      return console.warn("Not implemented."), null;
    }, r.prototype.convertFromPixel = function(t, e, n) {
      return console.warn("Not implemented."), null;
    }, r.prototype.containPoint = function(t) {
      return console.warn("Not implemented."), !1;
    }, r.create = function(t, e) {
      var n = [];
      return t.eachComponent("radar", function(i) {
        var a = new r(i, t, e);
        n.push(a), i.coordinateSystem = a;
      }), t.eachSeriesByType("radar", function(i) {
        i.get("coordinateSystem") === "radar" && (i.coordinateSystem = n[i.get("radarIndex") || 0]);
      }), n;
    }, r.dimensions = [], r;
  }()
);
function $H(r) {
  r.registerCoordinateSystem("radar", VH), r.registerComponentModel(FH), r.registerComponentView(NH), r.registerVisual({
    seriesType: "radar",
    reset: function(t) {
      var e = t.getData();
      e.each(function(n) {
        e.setItemVisual(n, "legendIcon", "roundRect");
      }), e.setVisual("legendIcon", "roundRect");
    }
  });
}
function GH(r) {
  De($H), r.registerChartView(RH), r.registerSeriesModel(OH), r.registerLayout(PH), r.registerProcessor(rc("radar")), r.registerPreprocessor(kH);
}
var F2 = "\0_ec_interaction_mutex";
function HH(r, t, e) {
  var n = n_(r);
  n[t] = e;
}
function qH(r, t, e) {
  var n = n_(r), i = n[t];
  i === e && (n[t] = null);
}
function B2(r, t) {
  return !!n_(r)[t];
}
function n_(r) {
  return r[F2] || (r[F2] = {});
}
Vn({
  type: "takeGlobalCursor",
  event: "globalCursorTaken",
  update: "update"
}, dt);
var ic = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this) || this;
      n._zr = e;
      var i = Q(n._mousedownHandler, n), a = Q(n._mousemoveHandler, n), o = Q(n._mouseupHandler, n), s = Q(n._mousewheelHandler, n), l = Q(n._pinchHandler, n);
      return n.enable = function(u, c) {
        this.disable(), this._opt = se(ce(c) || {}, {
          zoomOnMouseWheel: !0,
          moveOnMouseMove: !0,
          // By default, wheel do not trigger move.
          moveOnMouseWheel: !1,
          preventDefaultMouseMove: !0
        }), u == null && (u = !0), (u === !0 || u === "move" || u === "pan") && (e.on("mousedown", i), e.on("mousemove", a), e.on("mouseup", o)), (u === !0 || u === "scale" || u === "zoom") && (e.on("mousewheel", s), e.on("pinch", l));
      }, n.disable = function() {
        e.off("mousedown", i), e.off("mousemove", a), e.off("mouseup", o), e.off("mousewheel", s), e.off("pinch", l);
      }, n;
    }
    return t.prototype.isDragging = function() {
      return this._dragging;
    }, t.prototype.isPinching = function() {
      return this._pinching;
    }, t.prototype.setPointerChecker = function(e) {
      this.pointerChecker = e;
    }, t.prototype.dispose = function() {
      this.disable();
    }, t.prototype._mousedownHandler = function(e) {
      if (!lb(e)) {
        for (var n = e.target; n; ) {
          if (n.draggable)
            return;
          n = n.__hostTarget || n.parent;
        }
        var i = e.offsetX, a = e.offsetY;
        this.pointerChecker && this.pointerChecker(e, i, a) && (this._x = i, this._y = a, this._dragging = !0);
      }
    }, t.prototype._mousemoveHandler = function(e) {
      if (!(!this._dragging || !Bf("moveOnMouseMove", e, this._opt) || e.gestureEvent === "pinch" || B2(this._zr, "globalPan"))) {
        var n = e.offsetX, i = e.offsetY, a = this._x, o = this._y, s = n - a, l = i - o;
        this._x = n, this._y = i, this._opt.preventDefaultMouseMove && ii(e.event), bE(this, "pan", "moveOnMouseMove", e, {
          dx: s,
          dy: l,
          oldX: a,
          oldY: o,
          newX: n,
          newY: i,
          isAvailableBehavior: null
        });
      }
    }, t.prototype._mouseupHandler = function(e) {
      lb(e) || (this._dragging = !1);
    }, t.prototype._mousewheelHandler = function(e) {
      var n = Bf("zoomOnMouseWheel", e, this._opt), i = Bf("moveOnMouseWheel", e, this._opt), a = e.wheelDelta, o = Math.abs(a), s = e.offsetX, l = e.offsetY;
      if (!(a === 0 || !n && !i)) {
        if (n) {
          var u = o > 3 ? 1.4 : o > 1 ? 1.2 : 1.1, c = a > 0 ? u : 1 / u;
          Sp(this, "zoom", "zoomOnMouseWheel", e, {
            scale: c,
            originX: s,
            originY: l,
            isAvailableBehavior: null
          });
        }
        if (i) {
          var f = Math.abs(a), h = (a > 0 ? 1 : -1) * (f > 3 ? 0.4 : f > 1 ? 0.15 : 0.05);
          Sp(this, "scrollMove", "moveOnMouseWheel", e, {
            scrollDelta: h,
            originX: s,
            originY: l,
            isAvailableBehavior: null
          });
        }
      }
    }, t.prototype._pinchHandler = function(e) {
      if (!B2(this._zr, "globalPan")) {
        var n = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
        Sp(this, "zoom", null, e, {
          scale: n,
          originX: e.pinchX,
          originY: e.pinchY,
          isAvailableBehavior: null
        });
      }
    }, t;
  }(Wr)
);
function Sp(r, t, e, n, i) {
  r.pointerChecker && r.pointerChecker(n, i.originX, i.originY) && (ii(n.event), bE(r, t, e, n, i));
}
function bE(r, t, e, n, i) {
  i.isAvailableBehavior = Q(Bf, null, e, n), r.trigger(t, i);
}
function Bf(r, t, e) {
  var n = e[r];
  return !r || n && (!J(n) || t.event[n + "Key"]);
}
function i_(r, t, e) {
  var n = r.target;
  n.x += t, n.y += e, n.dirty();
}
function a_(r, t, e, n) {
  var i = r.target, a = r.zoomLimit, o = r.zoom = r.zoom || 1;
  if (o *= t, a) {
    var s = a.min || 0, l = a.max || 1 / 0;
    o = Math.max(Math.min(l, o), s);
  }
  var u = o / r.zoom;
  r.zoom = o, i.x -= (e - i.x) * (u - 1), i.y -= (n - i.y) * (u - 1), i.scaleX *= u, i.scaleY *= u, i.dirty();
}
var WH = {
  axisPointer: 1,
  tooltip: 1,
  brush: 1
};
function kv(r, t, e) {
  var n = t.getComponentByElement(r.topTarget), i = n && n.coordinateSystem;
  return n && n !== e && !WH.hasOwnProperty(n.mainType) && i && i.model !== e;
}
function SE(r) {
  if (J(r)) {
    var t = new DOMParser();
    r = t.parseFromString(r, "text/xml");
  }
  var e = r;
  for (e.nodeType === 9 && (e = e.firstChild); e.nodeName.toLowerCase() !== "svg" || e.nodeType !== 1; )
    e = e.nextSibling;
  return e;
}
var xp, Dh = {
  fill: "fill",
  stroke: "stroke",
  "stroke-width": "lineWidth",
  opacity: "opacity",
  "fill-opacity": "fillOpacity",
  "stroke-opacity": "strokeOpacity",
  "stroke-dasharray": "lineDash",
  "stroke-dashoffset": "lineDashOffset",
  "stroke-linecap": "lineCap",
  "stroke-linejoin": "lineJoin",
  "stroke-miterlimit": "miterLimit",
  "font-family": "fontFamily",
  "font-size": "fontSize",
  "font-style": "fontStyle",
  "font-weight": "fontWeight",
  "text-anchor": "textAlign",
  visibility: "visibility",
  display: "display"
}, N2 = Ee(Dh), Th = {
  "alignment-baseline": "textBaseline",
  "stop-color": "stopColor"
}, z2 = Ee(Th), UH = function() {
  function r() {
    this._defs = {}, this._root = null;
  }
  return r.prototype.parse = function(t, e) {
    e = e || {};
    var n = SE(t);
    this._defsUsePending = [];
    var i = new fe();
    this._root = i;
    var a = [], o = n.getAttribute("viewBox") || "", s = parseFloat(n.getAttribute("width") || e.width), l = parseFloat(n.getAttribute("height") || e.height);
    isNaN(s) && (s = null), isNaN(l) && (l = null), _r(n, i, null, !0, !1);
    for (var u = n.firstChild; u; )
      this._parseNode(u, i, a, null, !1, !1), u = u.nextSibling;
    XH(this._defs, this._defsUsePending), this._defsUsePending = [];
    var c, f;
    if (o) {
      var h = Rv(o);
      h.length >= 4 && (c = {
        x: parseFloat(h[0] || 0),
        y: parseFloat(h[1] || 0),
        width: parseFloat(h[2]),
        height: parseFloat(h[3])
      });
    }
    if (c && s != null && l != null && (f = wE(c, { x: 0, y: 0, width: s, height: l }), !e.ignoreViewBox)) {
      var v = i;
      i = new fe(), i.add(v), v.scaleX = v.scaleY = f.scale, v.x = f.x, v.y = f.y;
    }
    return !e.ignoreRootClip && s != null && l != null && i.setClipPath(new ke({
      shape: { x: 0, y: 0, width: s, height: l }
    })), {
      root: i,
      width: s,
      height: l,
      viewBoxRect: c,
      viewBoxTransform: f,
      named: a
    };
  }, r.prototype._parseNode = function(t, e, n, i, a, o) {
    var s = t.nodeName.toLowerCase(), l, u = i;
    if (s === "defs" && (a = !0), s === "text" && (o = !0), s === "defs" || s === "switch")
      l = e;
    else {
      if (!a) {
        var c = xp[s];
        if (c && te(xp, s)) {
          l = c.call(this, t, e);
          var f = t.getAttribute("name");
          if (f) {
            var h = {
              name: f,
              namedFrom: null,
              svgNodeTagLower: s,
              el: l
            };
            n.push(h), s === "g" && (u = h);
          } else i && n.push({
            name: i.name,
            namedFrom: i,
            svgNodeTagLower: s,
            el: l
          });
          e.add(l);
        }
      }
      var v = V2[s];
      if (v && te(V2, s)) {
        var d = v.call(this, t), p = t.getAttribute("id");
        p && (this._defs[p] = d);
      }
    }
    if (l && l.isGroup)
      for (var g = t.firstChild; g; )
        g.nodeType === 1 ? this._parseNode(g, l, n, u, a, o) : g.nodeType === 3 && o && this._parseText(g, l), g = g.nextSibling;
  }, r.prototype._parseText = function(t, e) {
    var n = new ms({
      style: {
        text: t.textContent
      },
      silent: !0,
      x: this._textX || 0,
      y: this._textY || 0
    });
    Er(e, n), _r(t, n, this._defsUsePending, !1, !1), YH(n, e);
    var i = n.style, a = i.fontSize;
    a && a < 9 && (i.fontSize = 9, n.scaleX *= a / 9, n.scaleY *= a / 9);
    var o = (i.fontSize || i.fontFamily) && [
      i.fontStyle,
      i.fontWeight,
      (i.fontSize || 12) + "px",
      i.fontFamily || "sans-serif"
    ].join(" ");
    i.font = o;
    var s = n.getBoundingRect();
    return this._textX += s.width, e.add(n), n;
  }, r.internalField = function() {
    xp = {
      g: function(t, e) {
        var n = new fe();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n;
      },
      rect: function(t, e) {
        var n = new ke();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n.setShape({
          x: parseFloat(t.getAttribute("x") || "0"),
          y: parseFloat(t.getAttribute("y") || "0"),
          width: parseFloat(t.getAttribute("width") || "0"),
          height: parseFloat(t.getAttribute("height") || "0")
        }), n.silent = !0, n;
      },
      circle: function(t, e) {
        var n = new pi();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n.setShape({
          cx: parseFloat(t.getAttribute("cx") || "0"),
          cy: parseFloat(t.getAttribute("cy") || "0"),
          r: parseFloat(t.getAttribute("r") || "0")
        }), n.silent = !0, n;
      },
      line: function(t, e) {
        var n = new Ct();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n.setShape({
          x1: parseFloat(t.getAttribute("x1") || "0"),
          y1: parseFloat(t.getAttribute("y1") || "0"),
          x2: parseFloat(t.getAttribute("x2") || "0"),
          y2: parseFloat(t.getAttribute("y2") || "0")
        }), n.silent = !0, n;
      },
      ellipse: function(t, e) {
        var n = new hv();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n.setShape({
          cx: parseFloat(t.getAttribute("cx") || "0"),
          cy: parseFloat(t.getAttribute("cy") || "0"),
          rx: parseFloat(t.getAttribute("rx") || "0"),
          ry: parseFloat(t.getAttribute("ry") || "0")
        }), n.silent = !0, n;
      },
      polygon: function(t, e) {
        var n = t.getAttribute("points"), i;
        n && (i = H2(n));
        var a = new ar({
          shape: {
            points: i || []
          },
          silent: !0
        });
        return Er(e, a), _r(t, a, this._defsUsePending, !1, !1), a;
      },
      polyline: function(t, e) {
        var n = t.getAttribute("points"), i;
        n && (i = H2(n));
        var a = new sr({
          shape: {
            points: i || []
          },
          silent: !0
        });
        return Er(e, a), _r(t, a, this._defsUsePending, !1, !1), a;
      },
      image: function(t, e) {
        var n = new Pt();
        return Er(e, n), _r(t, n, this._defsUsePending, !1, !1), n.setStyle({
          image: t.getAttribute("xlink:href") || t.getAttribute("href"),
          x: +t.getAttribute("x"),
          y: +t.getAttribute("y"),
          width: +t.getAttribute("width"),
          height: +t.getAttribute("height")
        }), n.silent = !0, n;
      },
      text: function(t, e) {
        var n = t.getAttribute("x") || "0", i = t.getAttribute("y") || "0", a = t.getAttribute("dx") || "0", o = t.getAttribute("dy") || "0";
        this._textX = parseFloat(n) + parseFloat(a), this._textY = parseFloat(i) + parseFloat(o);
        var s = new fe();
        return Er(e, s), _r(t, s, this._defsUsePending, !1, !0), s;
      },
      tspan: function(t, e) {
        var n = t.getAttribute("x"), i = t.getAttribute("y");
        n != null && (this._textX = parseFloat(n)), i != null && (this._textY = parseFloat(i));
        var a = t.getAttribute("dx") || "0", o = t.getAttribute("dy") || "0", s = new fe();
        return Er(e, s), _r(t, s, this._defsUsePending, !1, !0), this._textX += parseFloat(a), this._textY += parseFloat(o), s;
      },
      path: function(t, e) {
        var n = t.getAttribute("d") || "", i = cM(n);
        return Er(e, i), _r(t, i, this._defsUsePending, !1, !1), i.silent = !0, i;
      }
    };
  }(), r;
}(), V2 = {
  lineargradient: function(r) {
    var t = parseInt(r.getAttribute("x1") || "0", 10), e = parseInt(r.getAttribute("y1") || "0", 10), n = parseInt(r.getAttribute("x2") || "10", 10), i = parseInt(r.getAttribute("y2") || "0", 10), a = new Wu(t, e, n, i);
    return $2(r, a), G2(r, a), a;
  },
  radialgradient: function(r) {
    var t = parseInt(r.getAttribute("cx") || "0", 10), e = parseInt(r.getAttribute("cy") || "0", 10), n = parseInt(r.getAttribute("r") || "0", 10), i = new dM(t, e, n);
    return $2(r, i), G2(r, i), i;
  }
};
function $2(r, t) {
  var e = r.getAttribute("gradientUnits");
  e === "userSpaceOnUse" && (t.global = !0);
}
function G2(r, t) {
  for (var e = r.firstChild; e; ) {
    if (e.nodeType === 1 && e.nodeName.toLocaleLowerCase() === "stop") {
      var n = e.getAttribute("offset"), i = void 0;
      n && n.indexOf("%") > 0 ? i = parseInt(n, 10) / 100 : n ? i = parseFloat(n) : i = 0;
      var a = {};
      xE(e, a, a);
      var o = a.stopColor || e.getAttribute("stop-color") || "#000000";
      t.colorStops.push({
        offset: i,
        color: o
      });
    }
    e = e.nextSibling;
  }
}
function Er(r, t) {
  r && r.__inheritedStyle && (t.__inheritedStyle || (t.__inheritedStyle = {}), se(t.__inheritedStyle, r.__inheritedStyle));
}
function H2(r) {
  for (var t = Rv(r), e = [], n = 0; n < t.length; n += 2) {
    var i = parseFloat(t[n]), a = parseFloat(t[n + 1]);
    e.push([i, a]);
  }
  return e;
}
function _r(r, t, e, n, i) {
  var a = t, o = a.__inheritedStyle = a.__inheritedStyle || {}, s = {};
  r.nodeType === 1 && (JH(r, t), xE(r, o, s), n || QH(r, o, s)), a.style = a.style || {}, o.fill != null && (a.style.fill = q2(a, "fill", o.fill, e)), o.stroke != null && (a.style.stroke = q2(a, "stroke", o.stroke, e)), M([
    "lineWidth",
    "opacity",
    "fillOpacity",
    "strokeOpacity",
    "miterLimit",
    "fontSize"
  ], function(l) {
    o[l] != null && (a.style[l] = parseFloat(o[l]));
  }), M([
    "lineDashOffset",
    "lineCap",
    "lineJoin",
    "fontWeight",
    "fontFamily",
    "fontStyle",
    "textAlign"
  ], function(l) {
    o[l] != null && (a.style[l] = o[l]);
  }), i && (a.__selfStyle = s), o.lineDash && (a.style.lineDash = U(Rv(o.lineDash), function(l) {
    return parseFloat(l);
  })), (o.visibility === "hidden" || o.visibility === "collapse") && (a.invisible = !0), o.display === "none" && (a.ignore = !0);
}
function YH(r, t) {
  var e = t.__selfStyle;
  if (e) {
    var n = e.textBaseline, i = n;
    !n || n === "auto" || n === "baseline" ? i = "alphabetic" : n === "before-edge" || n === "text-before-edge" ? i = "top" : n === "after-edge" || n === "text-after-edge" ? i = "bottom" : (n === "central" || n === "mathematical") && (i = "middle"), r.style.textBaseline = i;
  }
  var a = t.__inheritedStyle;
  if (a) {
    var o = a.textAlign, s = o;
    o && (o === "middle" && (s = "center"), r.style.textAlign = s);
  }
}
var ZH = /^url\(\s*#(.*?)\)/;
function q2(r, t, e, n) {
  var i = e && e.match(ZH);
  if (i) {
    var a = tn(i[1]);
    n.push([r, t, a]);
    return;
  }
  return e === "none" && (e = null), e;
}
function XH(r, t) {
  for (var e = 0; e < t.length; e++) {
    var n = t[e];
    n[0].style[n[1]] = r[n[2]];
  }
}
var jH = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function Rv(r) {
  return r.match(jH) || [];
}
var KH = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g, wp = Math.PI / 180;
function JH(r, t) {
  var e = r.getAttribute("transform");
  if (e) {
    e = e.replace(/,/g, " ");
    var n = [], i = null;
    e.replace(KH, function(f, h, v) {
      return n.push(h, v), "";
    });
    for (var a = n.length - 1; a > 0; a -= 2) {
      var o = n[a], s = n[a - 1], l = Rv(o);
      switch (i = i || Cr(), s) {
        case "translate":
          Rn(i, i, [parseFloat(l[0]), parseFloat(l[1] || "0")]);
          break;
        case "scale":
          Qy(i, i, [parseFloat(l[0]), parseFloat(l[1] || l[0])]);
          break;
        case "rotate":
          So(i, i, -parseFloat(l[0]) * wp, [
            parseFloat(l[1] || "0"),
            parseFloat(l[2] || "0")
          ]);
          break;
        case "skewX":
          var u = Math.tan(parseFloat(l[0]) * wp);
          ei(i, [1, 0, u, 1, 0, 0], i);
          break;
        case "skewY":
          var c = Math.tan(parseFloat(l[0]) * wp);
          ei(i, [1, c, 0, 1, 0, 0], i);
          break;
        case "matrix":
          i[0] = parseFloat(l[0]), i[1] = parseFloat(l[1]), i[2] = parseFloat(l[2]), i[3] = parseFloat(l[3]), i[4] = parseFloat(l[4]), i[5] = parseFloat(l[5]);
          break;
      }
    }
    t.setLocalTransform(i);
  }
}
var W2 = /([^\s:;]+)\s*:\s*([^:;]+)/g;
function xE(r, t, e) {
  var n = r.getAttribute("style");
  if (n) {
    W2.lastIndex = 0;
    for (var i; (i = W2.exec(n)) != null; ) {
      var a = i[1], o = te(Dh, a) ? Dh[a] : null;
      o && (t[o] = i[2]);
      var s = te(Th, a) ? Th[a] : null;
      s && (e[s] = i[2]);
    }
  }
}
function QH(r, t, e) {
  for (var n = 0; n < N2.length; n++) {
    var i = N2[n], a = r.getAttribute(i);
    a != null && (t[Dh[i]] = a);
  }
  for (var n = 0; n < z2.length; n++) {
    var i = z2[n], a = r.getAttribute(i);
    a != null && (e[Th[i]] = a);
  }
}
function wE(r, t) {
  var e = t.width / r.width, n = t.height / r.height, i = Math.min(e, n);
  return {
    scale: i,
    x: -(r.x + r.width / 2) * i + (t.x + t.width / 2),
    y: -(r.y + r.height / 2) * i + (t.y + t.height / 2)
  };
}
function e8(r, t) {
  var e = new UH();
  return e.parse(r, t);
}
var t8 = re([
  "rect",
  "circle",
  "line",
  "ellipse",
  "polygon",
  "polyline",
  "path",
  // <text> <tspan> are also enabled because some SVG might paint text itself,
  // but still need to trigger events or tooltip.
  "text",
  "tspan",
  // <g> is also enabled because this case: if multiple tags share one name
  // and need label displayed, every tags will display the name, which is not
  // expected. So we can put them into a <g name="xxx">. Thereby only one label
  // displayed and located based on the bounding rect of the <g>.
  "g"
]), r8 = (
  /** @class */
  function() {
    function r(t, e) {
      this.type = "geoSVG", this._usedGraphicMap = re(), this._freedGraphics = [], this._mapName = t, this._parsedXML = SE(e);
    }
    return r.prototype.load = function() {
      var t = this._firstGraphic;
      if (!t) {
        t = this._firstGraphic = this._buildGraphic(this._parsedXML), this._freedGraphics.push(t), this._boundingRect = this._firstGraphic.boundingRect.clone();
        var e = i8(t.named), n = e.regions, i = e.regionsMap;
        this._regions = n, this._regionsMap = i;
      }
      return {
        boundingRect: this._boundingRect,
        regions: this._regions,
        regionsMap: this._regionsMap
      };
    }, r.prototype._buildGraphic = function(t) {
      var e, n;
      try {
        e = t && e8(t, {
          ignoreViewBox: !0,
          ignoreRootClip: !0
        }) || {}, n = e.root, rr(n != null);
      } catch (g) {
        throw new Error(`Invalid svg format
` + g.message);
      }
      var i = new fe();
      i.add(n), i.isGeoSVGGraphicRoot = !0;
      var a = e.width, o = e.height, s = e.viewBoxRect, l = this._boundingRect;
      if (!l) {
        var u = void 0, c = void 0, f = void 0, h = void 0;
        if (a != null ? (u = 0, f = a) : s && (u = s.x, f = s.width), o != null ? (c = 0, h = o) : s && (c = s.y, h = s.height), u == null || c == null) {
          var v = n.getBoundingRect();
          u == null && (u = v.x, f = v.width), c == null && (c = v.y, h = v.height);
        }
        l = this._boundingRect = new xe(u, c, f, h);
      }
      if (s) {
        var d = wE(s, l);
        n.scaleX = n.scaleY = d.scale, n.x = d.x, n.y = d.y;
      }
      i.setClipPath(new ke({
        shape: l.plain()
      }));
      var p = [];
      return M(e.named, function(g) {
        t8.get(g.svgNodeTagLower) != null && (p.push(g), n8(g.el));
      }), {
        root: i,
        boundingRect: l,
        named: p
      };
    }, r.prototype.useGraphic = function(t) {
      var e = this._usedGraphicMap, n = e.get(t);
      return n || (n = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML), e.set(t, n), n);
    }, r.prototype.freeGraphic = function(t) {
      var e = this._usedGraphicMap, n = e.get(t);
      n && (e.removeKey(t), this._freedGraphics.push(n));
    }, r;
  }()
);
function n8(r) {
  r.silent = !1, r.isGroup && r.traverse(function(t) {
    t.silent = !1;
  });
}
function i8(r) {
  var t = [], e = re();
  return M(r, function(n) {
    if (n.namedFrom == null) {
      var i = new JG(n.name, n.el);
      t.push(i), e.set(n.name, i);
    }
  }), {
    regions: t,
    regionsMap: e
  };
}
var qm = [126, 25], U2 = "南海诸岛", Oa = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];
for (var ka = 0; ka < Oa.length; ka++)
  for (var qo = 0; qo < Oa[ka].length; qo++)
    Oa[ka][qo][0] /= 10.5, Oa[ka][qo][1] /= -10.5 / 0.75, Oa[ka][qo][0] += qm[0], Oa[ka][qo][1] += qm[1];
function a8(r, t) {
  if (r === "china") {
    for (var e = 0; e < t.length; e++)
      if (t[e].name === U2)
        return;
    t.push(new _L(U2, U(Oa, function(n) {
      return {
        type: "polygon",
        exterior: n
      };
    }), qm));
  }
}
var o8 = {
  南海诸岛: [32, 80],
  // 全国
  广东: [0, -10],
  香港: [10, 5],
  澳门: [-10, 10],
  // '北京': [-10, 0],
  天津: [5, 5]
};
function s8(r, t) {
  if (r === "china") {
    var e = o8[t.name];
    if (e) {
      var n = t.getCenter();
      n[0] += e[0] / 10.5, n[1] += -e[1] / (10.5 / 0.75), t.setCenter(n);
    }
  }
}
var l8 = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
function u8(r, t) {
  r === "china" && t.name === "台湾" && t.geometries.push({
    type: "polygon",
    exterior: l8[0]
  });
}
var c8 = "name", f8 = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.type = "geoJSON", this._parsedMap = re(), this._mapName = t, this._specialAreas = n, this._geoJSON = v8(e);
    }
    return r.prototype.load = function(t, e) {
      e = e || c8;
      var n = this._parsedMap.get(e);
      if (!n) {
        var i = this._parseToRegions(e);
        n = this._parsedMap.set(e, {
          regions: i,
          boundingRect: h8(i)
        });
      }
      var a = re(), o = [];
      return M(n.regions, function(s) {
        var l = s.name;
        t && te(t, l) && (s = s.cloneShallow(l = t[l])), o.push(s), a.set(l, s);
      }), {
        regions: o,
        boundingRect: n.boundingRect || new xe(0, 0, 0, 0),
        regionsMap: a
      };
    }, r.prototype._parseToRegions = function(t) {
      var e = this._mapName, n = this._geoJSON, i;
      try {
        i = n ? e6(n, t) : [];
      } catch (a) {
        throw new Error(`Invalid geoJson format
` + a.message);
      }
      return a8(e, i), M(i, function(a) {
        var o = a.name;
        s8(e, a), u8(e, a);
        var s = this._specialAreas && this._specialAreas[o];
        s && a.transformTo(s.left, s.top, s.width, s.height);
      }, this), i;
    }, r.prototype.getMapForUser = function() {
      return {
        // For backward compatibility, use geoJson
        // PENDING: it has been returning them without clone.
        // do we need to avoid outsite modification?
        geoJson: this._geoJSON,
        geoJSON: this._geoJSON,
        specialAreas: this._specialAreas
      };
    }, r;
  }()
);
function h8(r) {
  for (var t, e = 0; e < r.length; e++) {
    var n = r[e].getBoundingRect();
    t = t || n.clone(), t.union(n);
  }
  return t;
}
function v8(r) {
  return J(r) ? typeof JSON < "u" && JSON.parse ? JSON.parse(r) : new Function("return (" + r + ");")() : r;
}
var gl = re();
const ci = {
  /**
   * Compatible with previous `echarts.registerMap`.
   *
   * @usage
   * ```js
   *
   * echarts.registerMap('USA', geoJson, specialAreas);
   *
   * echarts.registerMap('USA', {
   *     geoJson: geoJson,
   *     specialAreas: {...}
   * });
   * echarts.registerMap('USA', {
   *     geoJSON: geoJson,
   *     specialAreas: {...}
   * });
   *
   * echarts.registerMap('airport', {
   *     svg: svg
   * }
   * ```
   *
   * Note:
   * Do not support that register multiple geoJSON or SVG
   * one map name. Because different geoJSON and SVG have
   * different unit. It's not easy to make sure how those
   * units are mapping/normalize.
   * If intending to use multiple geoJSON or SVG, we can
   * use multiple geo coordinate system.
   */
  registerMap: function(r, t, e) {
    if (t.svg) {
      var n = new r8(r, t.svg);
      gl.set(r, n);
    } else {
      var i = t.geoJson || t.geoJSON;
      i && !t.features ? e = t.specialAreas : i = t;
      var n = new f8(r, i, e);
      gl.set(r, n);
    }
  },
  getGeoResource: function(r) {
    return gl.get(r);
  },
  /**
   * Only for exporting to users.
   * **MUST NOT** used internally.
   */
  getMapForUser: function(r) {
    var t = gl.get(r);
    return t && t.type === "geoJSON" && t.getMapForUser();
  },
  load: function(r, t, e) {
    var n = gl.get(r);
    if (n)
      return n.load(t, e);
  }
};
var o_ = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"], d8 = re(o_), p8 = re(o_.concat(["g"])), g8 = re(o_.concat(["g"])), CE = Oe();
function Qc(r) {
  var t = r.getItemStyle(), e = r.get("areaColor");
  return e != null && (t.fill = e), t;
}
function Y2(r) {
  var t = r.style;
  t && (t.stroke = t.stroke || t.fill, t.fill = null);
}
var AE = (
  /** @class */
  function() {
    function r(t) {
      var e = new fe();
      this.uid = Os("ec_map_draw"), this._controller = new ic(t.getZr()), this._controllerHost = {
        target: e
      }, this.group = e, e.add(this._regionsGroup = new fe()), e.add(this._svgGroup = new fe());
    }
    return r.prototype.draw = function(t, e, n, i, a) {
      var o = t.mainType === "geo", s = t.getData && t.getData();
      o && e.eachComponent({
        mainType: "series",
        subType: "map"
      }, function(m) {
        !s && m.getHostGeoModel() === t && (s = m.getData());
      });
      var l = t.coordinateSystem, u = this._regionsGroup, c = this.group, f = l.getTransformInfo(), h = f.raw, v = f.roam, d = !u.childAt(0) || a;
      d ? (c.x = v.x, c.y = v.y, c.scaleX = v.scaleX, c.scaleY = v.scaleY, c.dirty()) : Ne(c, v, t);
      var p = s && s.getVisual("visualMeta") && s.getVisual("visualMeta").length > 0, g = {
        api: n,
        geo: l,
        mapOrGeoModel: t,
        data: s,
        isVisualEncodedByVisualMap: p,
        isGeo: o,
        transformInfoRaw: h
      };
      l.resourceType === "geoJSON" ? this._buildGeoJSON(g) : l.resourceType === "geoSVG" && this._buildSVG(g), this._updateController(t, e, n), this._updateMapSelectHandler(t, u, n, i);
    }, r.prototype._buildGeoJSON = function(t) {
      var e = this._regionsGroupByName = re(), n = re(), i = this._regionsGroup, a = t.transformInfoRaw, o = t.mapOrGeoModel, s = t.data, l = t.geo.projection, u = l && l.stream;
      function c(v, d) {
        return d && (v = d(v)), v && [v[0] * a.scaleX + a.x, v[1] * a.scaleY + a.y];
      }
      function f(v) {
        for (var d = [], p = !u && l && l.project, g = 0; g < v.length; ++g) {
          var m = c(v[g], p);
          m && d.push(m);
        }
        return d;
      }
      function h(v) {
        return {
          shape: {
            points: f(v)
          }
        };
      }
      i.removeAll(), M(t.geo.regions, function(v) {
        var d = v.name, p = e.get(d), g = n.get(d) || {}, m = g.dataIdx, y = g.regionModel;
        if (!p) {
          p = e.set(d, new fe()), i.add(p), m = s ? s.indexOfName(d) : null, y = t.isGeo ? o.getRegionModel(d) : s ? s.getItemModel(m) : null;
          var _ = y.get("silent", !0);
          _ != null && (p.silent = _), n.set(d, {
            dataIdx: m,
            regionModel: y
          });
        }
        var b = [], S = [];
        M(v.geometries, function(C) {
          if (C.type === "polygon") {
            var D = [C.exterior].concat(C.interiors || []);
            u && (D = Q2(D, u)), M(D, function(T) {
              b.push(new ar(h(T)));
            });
          } else {
            var A = C.points;
            u && (A = Q2(A, u, !0)), M(A, function(T) {
              S.push(new sr(h(T)));
            });
          }
        });
        var x = c(v.getCenter(), l && l.project);
        function w(C, D) {
          if (C.length) {
            var A = new p0({
              culling: !0,
              segmentIgnoreThreshold: 1,
              shape: {
                paths: C
              }
            });
            p.add(A), Z2(t, A, m, y), X2(t, A, d, y, o, m, x), D && (Y2(A), M(A.states, Y2));
          }
        }
        w(b), w(S, !0);
      }), e.each(function(v, d) {
        var p = n.get(d), g = p.dataIdx, m = p.regionModel;
        j2(t, v, d, m, o, g), K2(t, v, d, m, o), J2(t, v, d, m, o);
      }, this);
    }, r.prototype._buildSVG = function(t) {
      var e = t.geo.map, n = t.transformInfoRaw;
      this._svgGroup.x = n.x, this._svgGroup.y = n.y, this._svgGroup.scaleX = n.scaleX, this._svgGroup.scaleY = n.scaleY, this._svgResourceChanged(e) && (this._freeSVG(), this._useSVG(e));
      var i = this._svgDispatcherMap = re(), a = !1;
      M(this._svgGraphicRecord.named, function(o) {
        var s = o.name, l = t.mapOrGeoModel, u = t.data, c = o.svgNodeTagLower, f = o.el, h = u ? u.indexOfName(s) : null, v = l.getRegionModel(s);
        d8.get(c) != null && f instanceof qr && Z2(t, f, h, v), f instanceof qr && (f.culling = !0);
        var d = v.get("silent", !0);
        if (d != null && (f.silent = d), f.z2EmphasisLift = 0, !o.namedFrom && (g8.get(c) != null && X2(t, f, s, v, l, h, null), j2(t, f, s, v, l, h), K2(t, f, s, v, l), p8.get(c) != null)) {
          var p = J2(t, f, s, v, l);
          p === "self" && (a = !0);
          var g = i.get(s) || i.set(s, []);
          g.push(f);
        }
      }, this), this._enableBlurEntireSVG(a, t);
    }, r.prototype._enableBlurEntireSVG = function(t, e) {
      if (t && e.isGeo) {
        var n = e.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(), i = n.opacity;
        this._svgGraphicRecord.root.traverse(function(a) {
          if (!a.isGroup) {
            go(a);
            var o = a.ensureState("blur").style || {};
            o.opacity == null && i != null && (o.opacity = i), a.ensureState("emphasis");
          }
        });
      }
    }, r.prototype.remove = function() {
      this._regionsGroup.removeAll(), this._regionsGroupByName = null, this._svgGroup.removeAll(), this._freeSVG(), this._controller.dispose(), this._controllerHost = null;
    }, r.prototype.findHighDownDispatchers = function(t, e) {
      if (t == null)
        return [];
      var n = e.coordinateSystem;
      if (n.resourceType === "geoJSON") {
        var i = this._regionsGroupByName;
        if (i) {
          var a = i.get(t);
          return a ? [a] : [];
        }
      } else if (n.resourceType === "geoSVG")
        return this._svgDispatcherMap && this._svgDispatcherMap.get(t) || [];
    }, r.prototype._svgResourceChanged = function(t) {
      return this._svgMapName !== t;
    }, r.prototype._useSVG = function(t) {
      var e = ci.getGeoResource(t);
      if (e && e.type === "geoSVG") {
        var n = e.useGraphic(this.uid);
        this._svgGroup.add(n.root), this._svgGraphicRecord = n, this._svgMapName = t;
      }
    }, r.prototype._freeSVG = function() {
      var t = this._svgMapName;
      if (t != null) {
        var e = ci.getGeoResource(t);
        e && e.type === "geoSVG" && e.freeGraphic(this.uid), this._svgGraphicRecord = null, this._svgDispatcherMap = null, this._svgGroup.removeAll(), this._svgMapName = null;
      }
    }, r.prototype._updateController = function(t, e, n) {
      var i = t.coordinateSystem, a = this._controller, o = this._controllerHost;
      o.zoomLimit = t.get("scaleLimit"), o.zoom = i.getZoom(), a.enable(t.get("roam") || !1);
      var s = t.mainType;
      function l() {
        var u = {
          type: "geoRoam",
          componentType: s
        };
        return u[s + "Id"] = t.id, u;
      }
      a.off("pan").on("pan", function(u) {
        this._mouseDownFlag = !1, i_(o, u.dx, u.dy), n.dispatchAction(H(l(), {
          dx: u.dx,
          dy: u.dy,
          animation: {
            duration: 0
          }
        }));
      }, this), a.off("zoom").on("zoom", function(u) {
        this._mouseDownFlag = !1, a_(o, u.scale, u.originX, u.originY), n.dispatchAction(H(l(), {
          totalZoom: o.zoom,
          zoom: u.scale,
          originX: u.originX,
          originY: u.originY,
          animation: {
            duration: 0
          }
        }));
      }, this), a.setPointerChecker(function(u, c, f) {
        return i.containPoint([c, f]) && !kv(u, n, t);
      });
    }, r.prototype.resetForLabelLayout = function() {
      this.group.traverse(function(t) {
        var e = t.getTextContent();
        e && (e.ignore = CE(e).ignore);
      });
    }, r.prototype._updateMapSelectHandler = function(t, e, n, i) {
      var a = this;
      e.off("mousedown"), e.off("click"), t.get("selectedMode") && (e.on("mousedown", function() {
        a._mouseDownFlag = !0;
      }), e.on("click", function(o) {
        a._mouseDownFlag && (a._mouseDownFlag = !1);
      }));
    }, r;
  }()
);
function Z2(r, t, e, n) {
  var i = n.getModel("itemStyle"), a = n.getModel(["emphasis", "itemStyle"]), o = n.getModel(["blur", "itemStyle"]), s = n.getModel(["select", "itemStyle"]), l = Qc(i), u = Qc(a), c = Qc(s), f = Qc(o), h = r.data;
  if (h) {
    var v = h.getItemVisual(e, "style"), d = h.getItemVisual(e, "decal");
    r.isVisualEncodedByVisualMap && v.fill && (l.fill = v.fill), d && (l.decal = bs(d, r.api));
  }
  t.setStyle(l), t.style.strokeNoScale = !0, t.ensureState("emphasis").style = u, t.ensureState("select").style = c, t.ensureState("blur").style = f, go(t);
}
function X2(r, t, e, n, i, a, o) {
  var s = r.data, l = r.isGeo, u = s && isNaN(s.get(s.mapDimension("value"), a)), c = s && s.getItemLayout(a);
  if (l || u || c && c.showLabel) {
    var f = l ? e : a, h = void 0;
    (!s || a >= 0) && (h = i);
    var v = o ? {
      normal: {
        align: "center",
        verticalAlign: "middle"
      }
    } : null;
    Bt(t, Mt(n), {
      labelFetcher: h,
      labelDataIndex: f,
      defaultText: e
    }, v);
    var d = t.getTextContent();
    if (d && (CE(d).ignore = d.ignore, t.textConfig && o)) {
      var p = t.getBoundingRect().clone();
      t.textConfig.layoutRect = p, t.textConfig.position = [(o[0] - p.x) / p.width * 100 + "%", (o[1] - p.y) / p.height * 100 + "%"];
    }
    t.disableLabelAnimation = !0;
  } else
    t.removeTextContent(), t.removeTextConfig(), t.disableLabelAnimation = null;
}
function j2(r, t, e, n, i, a) {
  r.data ? r.data.setItemGraphicEl(a, t) : pe(t).eventData = {
    componentType: "geo",
    componentIndex: i.componentIndex,
    geoIndex: i.componentIndex,
    name: e,
    region: n && n.option || {}
  };
}
function K2(r, t, e, n, i) {
  r.data || xo({
    el: t,
    componentModel: i,
    itemName: e,
    // @ts-ignore FIXME:TS fix the "compatible with each other"?
    itemTooltipOption: n.get("tooltip")
  });
}
function J2(r, t, e, n, i) {
  t.highDownSilentOnTouch = !!i.get("selectedMode");
  var a = n.getModel("emphasis"), o = a.get("focus");
  return ut(t, o, a.get("blurScope"), a.get("disabled")), r.isGeo && pz(t, i, e), o;
}
function Q2(r, t, e) {
  var n = [], i;
  function a() {
    i = [];
  }
  function o() {
    i.length && (n.push(i), i = []);
  }
  var s = t({
    polygonStart: a,
    polygonEnd: o,
    lineStart: a,
    lineEnd: o,
    point: function(l, u) {
      isFinite(l) && isFinite(u) && i.push([l, u]);
    },
    sphere: function() {
    }
  });
  return !e && s.polygonStart(), M(r, function(l) {
    s.lineStart();
    for (var u = 0; u < l.length; u++)
      s.point(l[u][0], l[u][1]);
    s.lineEnd();
  }), !e && s.polygonEnd(), n;
}
var m8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      if (!(a && a.type === "mapToggleSelect" && a.from === this.uid)) {
        var o = this.group;
        if (o.removeAll(), !e.getHostGeoModel()) {
          if (this._mapDraw && a && a.type === "geoRoam" && this._mapDraw.resetForLabelLayout(), a && a.type === "geoRoam" && a.componentType === "series" && a.seriesId === e.id) {
            var s = this._mapDraw;
            s && o.add(s.group);
          } else if (e.needsDrawMap) {
            var s = this._mapDraw || new AE(i);
            o.add(s.group), s.draw(e, n, i, this, a), this._mapDraw = s;
          } else
            this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
          e.get("showLegendSymbol") && n.getComponent("legend") && this._renderSymbols(e, n, i);
        }
      }
    }, t.prototype.remove = function() {
      this._mapDraw && this._mapDraw.remove(), this._mapDraw = null, this.group.removeAll();
    }, t.prototype.dispose = function() {
      this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
    }, t.prototype._renderSymbols = function(e, n, i) {
      var a = e.originalData, o = this.group;
      a.each(a.mapDimension("value"), function(s, l) {
        if (!isNaN(s)) {
          var u = a.getItemLayout(l);
          if (!(!u || !u.point)) {
            var c = u.point, f = u.offset, h = new pi({
              style: {
                // Because the special of map draw.
                // Which needs statistic of multiple series and draw on one map.
                // And each series also need a symbol with legend color
                //
                // Layout and visual are put one the different data
                // TODO
                fill: e.getData().getVisual("style").fill
              },
              shape: {
                cx: c[0] + f * 9,
                cy: c[1],
                r: 3
              },
              silent: !0,
              // Do not overlap the first series, on which labels are displayed.
              z2: 8 + (f ? 0 : Ps + 1)
            });
            if (!f) {
              var v = e.mainSeries.getData(), d = a.getName(l), p = v.indexOfName(d), g = a.getItemModel(l), m = g.getModel("label"), y = v.getItemGraphicEl(p);
              Bt(h, Mt(g), {
                labelFetcher: {
                  getFormattedLabel: function(_, b) {
                    return e.getFormattedLabel(p, b);
                  }
                },
                defaultText: d
              }), h.disableLabelAnimation = !0, m.get("position") || h.setTextConfig({
                position: "bottom"
              }), y.onHoverStateChange = function(_) {
                oh(h, _);
              };
            }
            o.add(h);
          }
        }
      });
    }, t.type = "map", t;
  }(Qe)
), y8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.needsDrawMap = !1, e.seriesGroup = [], e.getTooltipPosition = function(n) {
        if (n != null) {
          var i = this.getData().getName(n), a = this.coordinateSystem, o = a.getRegion(i);
          return o && a.dataToPoint(o.getCenter());
        }
      }, e;
    }
    return t.prototype.getInitialData = function(e) {
      for (var n = Hs(this, {
        coordDimensions: ["value"],
        encodeDefaulter: ye(A0, this)
      }), i = re(), a = [], o = 0, s = n.count(); o < s; o++) {
        var l = n.getName(o);
        i.set(l, o);
      }
      var u = ci.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);
      return M(u.regions, function(c) {
        var f = c.name, h = i.get(f), v = c.properties && c.properties.echartsStyle, d;
        h == null ? (d = {
          name: f
        }, a.push(d)) : d = n.getRawDataItem(h), v && _e(d, v);
      }), n.appendData(a), n;
    }, t.prototype.getHostGeoModel = function() {
      var e = this.option.geoIndex;
      return e != null ? this.ecModel.getComponent("geo", e) : null;
    }, t.prototype.getMapType = function() {
      return (this.getHostGeoModel() || this).option.map;
    }, t.prototype.getRawValue = function(e) {
      var n = this.getData();
      return n.get(n.mapDimension("value"), e);
    }, t.prototype.getRegionModel = function(e) {
      var n = this.getData();
      return n.getItemModel(n.indexOfName(e));
    }, t.prototype.formatTooltip = function(e, n, i) {
      for (var a = this.getData(), o = this.getRawValue(e), s = a.getName(e), l = this.seriesGroup, u = [], c = 0; c < l.length; c++) {
        var f = l[c].originalData.indexOfName(s), h = a.mapDimension("value");
        isNaN(l[c].originalData.get(h, f)) || u.push(l[c].name);
      }
      return It("section", {
        header: u.join(", "),
        noHeader: !u.length,
        blocks: [It("nameValue", {
          name: s,
          value: o
        })]
      });
    }, t.prototype.setZoom = function(e) {
      this.option.zoom = e;
    }, t.prototype.setCenter = function(e) {
      this.option.center = e;
    }, t.prototype.getLegendIcon = function(e) {
      var n = e.icon || "roundRect", i = yt(n, 0, 0, e.itemWidth, e.itemHeight, e.itemStyle.fill);
      return i.setStyle(e.itemStyle), i.style.stroke = "none", n.indexOf("empty") > -1 && (i.style.stroke = i.style.fill, i.style.fill = "#fff", i.style.lineWidth = 2), i;
    }, t.type = "series.map", t.dependencies = ["geo"], t.layoutMode = "box", t.defaultOption = {
      // 一级层叠
      // zlevel: 0,
      // 二级层叠
      z: 2,
      coordinateSystem: "geo",
      // map should be explicitly specified since ec3.
      map: "",
      // If `geoIndex` is not specified, a exclusive geo will be
      // created. Otherwise use the specified geo component, and
      // `map` and `mapType` are ignored.
      // geoIndex: 0,
      // 'center' | 'left' | 'right' | 'x%' | {number}
      left: "center",
      // 'center' | 'top' | 'bottom' | 'x%' | {number}
      top: "center",
      // right
      // bottom
      // width:
      // height
      // Aspect is width / height. Inited to be geoJson bbox aspect
      // This parameter is used for scale this aspect
      // Default value:
      // for geoSVG source: 1,
      // for geoJSON source: 0.75.
      aspectScale: null,
      // Layout with center and size
      // If you want to put map in a fixed size box with right aspect ratio
      // This two properties may be more convenient.
      // layoutCenter: [50%, 50%]
      // layoutSize: 100
      showLegendSymbol: !0,
      // Define left-top, right-bottom coords to control view
      // For example, [ [180, 90], [-180, -90] ],
      // higher priority than center and zoom
      boundingCoords: null,
      // Default on center of map
      center: null,
      zoom: 1,
      scaleLimit: null,
      selectedMode: !0,
      label: {
        show: !1,
        color: "#000"
      },
      // scaleLimit: null,
      itemStyle: {
        borderWidth: 0.5,
        borderColor: "#444",
        areaColor: "#eee"
      },
      emphasis: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          areaColor: "rgba(255,215,0,0.8)"
        }
      },
      select: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          color: "rgba(255,215,0,0.8)"
        }
      },
      nameProperty: "name"
    }, t;
  }(it)
);
function _8(r, t) {
  var e = {};
  return M(r, function(n) {
    n.each(n.mapDimension("value"), function(i, a) {
      var o = "ec-" + n.getName(a);
      e[o] = e[o] || [], isNaN(i) || e[o].push(i);
    });
  }), r[0].map(r[0].mapDimension("value"), function(n, i) {
    for (var a = "ec-" + r[0].getName(i), o = 0, s = 1 / 0, l = -1 / 0, u = e[a].length, c = 0; c < u; c++)
      s = Math.min(s, e[a][c]), l = Math.max(l, e[a][c]), o += e[a][c];
    var f;
    return t === "min" ? f = s : t === "max" ? f = l : t === "average" ? f = o / u : f = o, u === 0 ? NaN : f;
  });
}
function b8(r) {
  var t = {};
  r.eachSeriesByType("map", function(e) {
    var n = e.getHostGeoModel(), i = n ? "o" + n.id : "i" + e.getMapType();
    (t[i] = t[i] || []).push(e);
  }), M(t, function(e, n) {
    for (var i = _8(U(e, function(o) {
      return o.getData();
    }), e[0].get("mapValueCalculation")), a = 0; a < e.length; a++)
      e[a].originalData = e[a].getData();
    for (var a = 0; a < e.length; a++)
      e[a].seriesGroup = e, e[a].needsDrawMap = a === 0 && !e[a].getHostGeoModel(), e[a].setData(i.cloneShallow()), e[a].mainSeries = e[0];
  });
}
function S8(r) {
  var t = {};
  r.eachSeriesByType("map", function(e) {
    var n = e.getMapType();
    if (!(e.getHostGeoModel() || t[n])) {
      var i = {};
      M(e.seriesGroup, function(o) {
        var s = o.coordinateSystem, l = o.originalData;
        o.get("showLegendSymbol") && r.getComponent("legend") && l.each(l.mapDimension("value"), function(u, c) {
          var f = l.getName(c), h = s.getRegion(f);
          if (!(!h || isNaN(u))) {
            var v = i[f] || 0, d = s.dataToPoint(h.getCenter());
            i[f] = v + 1, l.setItemLayout(c, {
              point: d,
              offset: v
            });
          }
        });
      });
      var a = e.getData();
      a.each(function(o) {
        var s = a.getName(o), l = a.getItemLayout(o) || {};
        l.showLabel = !i[s], a.setItemLayout(o, l);
      }), t[n] = !0;
    }
  });
}
var ew = Rt, ac = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this) || this;
      return n.type = "view", n.dimensions = ["x", "y"], n._roamTransformable = new Kn(), n._rawTransformable = new Kn(), n.name = e, n;
    }
    return t.prototype.setBoundingRect = function(e, n, i, a) {
      return this._rect = new xe(e, n, i, a), this._rect;
    }, t.prototype.getBoundingRect = function() {
      return this._rect;
    }, t.prototype.setViewRect = function(e, n, i, a) {
      this._transformTo(e, n, i, a), this._viewRect = new xe(e, n, i, a);
    }, t.prototype._transformTo = function(e, n, i, a) {
      var o = this.getBoundingRect(), s = this._rawTransformable;
      s.transform = o.calculateTransform(new xe(e, n, i, a));
      var l = s.parent;
      s.parent = null, s.decomposeTransform(), s.parent = l, this._updateTransform();
    }, t.prototype.setCenter = function(e, n) {
      e && (this._center = [X(e[0], n.getWidth()), X(e[1], n.getHeight())], this._updateCenterAndZoom());
    }, t.prototype.setZoom = function(e) {
      e = e || 1;
      var n = this.zoomLimit;
      n && (n.max != null && (e = Math.min(n.max, e)), n.min != null && (e = Math.max(n.min, e))), this._zoom = e, this._updateCenterAndZoom();
    }, t.prototype.getDefaultCenter = function() {
      var e = this.getBoundingRect(), n = e.x + e.width / 2, i = e.y + e.height / 2;
      return [n, i];
    }, t.prototype.getCenter = function() {
      return this._center || this.getDefaultCenter();
    }, t.prototype.getZoom = function() {
      return this._zoom || 1;
    }, t.prototype.getRoamTransform = function() {
      return this._roamTransformable.getLocalTransform();
    }, t.prototype._updateCenterAndZoom = function() {
      var e = this._rawTransformable.getLocalTransform(), n = this._roamTransformable, i = this.getDefaultCenter(), a = this.getCenter(), o = this.getZoom();
      a = Rt([], a, e), i = Rt([], i, e), n.originX = a[0], n.originY = a[1], n.x = i[0] - a[0], n.y = i[1] - a[1], n.scaleX = n.scaleY = o, this._updateTransform();
    }, t.prototype._updateTransform = function() {
      var e = this._roamTransformable, n = this._rawTransformable;
      n.parent = e, e.updateTransform(), n.updateTransform(), Jy(this.transform || (this.transform = []), n.transform || Cr()), this._rawTransform = n.getLocalTransform(), this.invTransform = this.invTransform || [], Ls(this.invTransform, this.transform), this.decomposeTransform();
    }, t.prototype.getTransformInfo = function() {
      var e = this._rawTransformable, n = this._roamTransformable, i = new Kn();
      return i.transform = n.transform, i.decomposeTransform(), {
        roam: {
          x: i.x,
          y: i.y,
          scaleX: i.scaleX,
          scaleY: i.scaleY
        },
        raw: {
          x: e.x,
          y: e.y,
          scaleX: e.scaleX,
          scaleY: e.scaleY
        }
      };
    }, t.prototype.getViewRect = function() {
      return this._viewRect;
    }, t.prototype.getViewRectAfterRoam = function() {
      var e = this.getBoundingRect().clone();
      return e.applyTransform(this.transform), e;
    }, t.prototype.dataToPoint = function(e, n, i) {
      var a = n ? this._rawTransform : this.transform;
      return i = i || [], a ? ew(i, e, a) : Xt(i, e);
    }, t.prototype.pointToData = function(e) {
      var n = this.invTransform;
      return n ? ew([], e, n) : [e[0], e[1]];
    }, t.prototype.convertToPixel = function(e, n, i) {
      var a = tw(n);
      return a === this ? a.dataToPoint(i) : null;
    }, t.prototype.convertFromPixel = function(e, n, i) {
      var a = tw(n);
      return a === this ? a.pointToData(i) : null;
    }, t.prototype.containPoint = function(e) {
      return this.getViewRectAfterRoam().contain(e[0], e[1]);
    }, t.dimensions = ["x", "y"], t;
  }(Kn)
);
function tw(r) {
  var t = r.seriesModel;
  return t ? t.coordinateSystem : null;
}
var x8 = {
  geoJSON: {
    aspectScale: 0.75,
    invertLongitute: !0
  },
  geoSVG: {
    aspectScale: 1,
    invertLongitute: !1
  }
}, DE = ["lng", "lat"], Wm = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this, e) || this;
      a.dimensions = DE, a.type = "geo", a._nameCoordMap = re(), a.map = n;
      var o = i.projection, s = ci.load(n, i.nameMap, i.nameProperty), l = ci.getGeoResource(n);
      a.resourceType = l ? l.type : null;
      var u = a.regions = s.regions, c = x8[l.type];
      a._regionsMap = s.regionsMap, a.regions = s.regions, a.projection = o;
      var f;
      if (o)
        for (var h = 0; h < u.length; h++) {
          var v = u[h].getBoundingRect(o);
          f = f || v.clone(), f.union(v);
        }
      else
        f = s.boundingRect;
      return a.setBoundingRect(f.x, f.y, f.width, f.height), a.aspectScale = o ? 1 : me(i.aspectScale, c.aspectScale), a._invertLongitute = o ? !1 : c.invertLongitute, a;
    }
    return t.prototype._transformTo = function(e, n, i, a) {
      var o = this.getBoundingRect(), s = this._invertLongitute;
      o = o.clone(), s && (o.y = -o.y - o.height);
      var l = this._rawTransformable;
      l.transform = o.calculateTransform(new xe(e, n, i, a));
      var u = l.parent;
      l.parent = null, l.decomposeTransform(), l.parent = u, s && (l.scaleY = -l.scaleY), this._updateTransform();
    }, t.prototype.getRegion = function(e) {
      return this._regionsMap.get(e);
    }, t.prototype.getRegionByCoord = function(e) {
      for (var n = this.regions, i = 0; i < n.length; i++) {
        var a = n[i];
        if (a.type === "geoJSON" && a.contain(e))
          return n[i];
      }
    }, t.prototype.addGeoCoord = function(e, n) {
      this._nameCoordMap.set(e, n);
    }, t.prototype.getGeoCoord = function(e) {
      var n = this._regionsMap.get(e);
      return this._nameCoordMap.get(e) || n && n.getCenter();
    }, t.prototype.dataToPoint = function(e, n, i) {
      if (J(e) && (e = this.getGeoCoord(e)), e) {
        var a = this.projection;
        return a && (e = a.project(e)), e && this.projectedToPoint(e, n, i);
      }
    }, t.prototype.pointToData = function(e) {
      var n = this.projection;
      return n && (e = n.unproject(e)), e && this.pointToProjected(e);
    }, t.prototype.pointToProjected = function(e) {
      return r.prototype.pointToData.call(this, e);
    }, t.prototype.projectedToPoint = function(e, n, i) {
      return r.prototype.dataToPoint.call(this, e, n, i);
    }, t.prototype.convertToPixel = function(e, n, i) {
      var a = rw(n);
      return a === this ? a.dataToPoint(i) : null;
    }, t.prototype.convertFromPixel = function(e, n, i) {
      var a = rw(n);
      return a === this ? a.pointToData(i) : null;
    }, t;
  }(ac)
);
_t(Wm, ac);
function rw(r) {
  var t = r.geoModel, e = r.seriesModel;
  return t ? t.coordinateSystem : e ? e.coordinateSystem || (e.getReferringComponents("geo", mt).models[0] || {}).coordinateSystem : null;
}
function nw(r, t) {
  var e = r.get("boundingCoords");
  if (e != null) {
    var n = e[0], i = e[1];
    if (isFinite(n[0]) && isFinite(n[1]) && isFinite(i[0]) && isFinite(i[1])) {
      var a = this.projection;
      if (a) {
        var o = n[0], s = n[1], l = i[0], u = i[1];
        n = [1 / 0, 1 / 0], i = [-1 / 0, -1 / 0];
        var c = function(x, w, C, D) {
          for (var A = C - x, T = D - w, L = 0; L <= 100; L++) {
            var E = L / 100, I = a.project([x + A * E, w + T * E]);
            Oi(n, n, I), Fi(i, i, I);
          }
        };
        c(o, s, l, s), c(l, s, l, u), c(l, u, o, u), c(o, u, l, s);
      }
      this.setBoundingRect(n[0], n[1], i[0] - n[0], i[1] - n[1]);
    }
  }
  var f = this.getBoundingRect(), h = r.get("layoutCenter"), v = r.get("layoutSize"), d = t.getWidth(), p = t.getHeight(), g = f.width / f.height * this.aspectScale, m = !1, y, _;
  h && v && (y = [X(h[0], d), X(h[1], p)], _ = X(v, Math.min(d, p)), !isNaN(y[0]) && !isNaN(y[1]) && !isNaN(_) && (m = !0));
  var b;
  if (m)
    b = {}, g > 1 ? (b.width = _, b.height = _ / g) : (b.height = _, b.width = _ * g), b.y = y[1] - b.height / 2, b.x = y[0] - b.width / 2;
  else {
    var S = r.getBoxLayoutParams();
    S.aspect = g, b = St(S, {
      width: d,
      height: p
    });
  }
  this.setViewRect(b.x, b.y, b.width, b.height), this.setCenter(r.get("center"), t), this.setZoom(r.get("zoom"));
}
function w8(r, t) {
  M(t.get("geoCoord"), function(e, n) {
    r.addGeoCoord(n, e);
  });
}
var C8 = (
  /** @class */
  function() {
    function r() {
      this.dimensions = DE;
    }
    return r.prototype.create = function(t, e) {
      var n = [];
      function i(o) {
        return {
          nameProperty: o.get("nameProperty"),
          aspectScale: o.get("aspectScale"),
          projection: o.get("projection")
        };
      }
      t.eachComponent("geo", function(o, s) {
        var l = o.get("map"), u = new Wm(l + s, l, H({
          nameMap: o.get("nameMap")
        }, i(o)));
        u.zoomLimit = o.get("scaleLimit"), n.push(u), o.coordinateSystem = u, u.model = o, u.resize = nw, u.resize(o, e);
      }), t.eachSeries(function(o) {
        var s = o.get("coordinateSystem");
        if (s === "geo") {
          var l = o.get("geoIndex") || 0;
          o.coordinateSystem = n[l];
        }
      });
      var a = {};
      return t.eachSeriesByType("map", function(o) {
        if (!o.getHostGeoModel()) {
          var s = o.getMapType();
          a[s] = a[s] || [], a[s].push(o);
        }
      }), M(a, function(o, s) {
        var l = U(o, function(c) {
          return c.get("nameMap");
        }), u = new Wm(s, s, H({
          nameMap: Zy(l)
        }, i(o[0])));
        u.zoomLimit = Et.apply(null, U(o, function(c) {
          return c.get("scaleLimit");
        })), n.push(u), u.resize = nw, u.resize(o[0], e), M(o, function(c) {
          c.coordinateSystem = u, w8(u, c);
        });
      }), n;
    }, r.prototype.getFilledRegions = function(t, e, n, i) {
      for (var a = (t || []).slice(), o = re(), s = 0; s < a.length; s++)
        o.set(a[s].name, a[s]);
      var l = ci.load(e, n, i);
      return M(l.regions, function(u) {
        var c = u.name, f = o.get(c), h = u.properties && u.properties.echartsStyle;
        f || (f = {
          name: c
        }, a.push(f)), h && _e(f, h);
      }), a;
    }, r;
  }()
), TE = new C8(), A8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n, i) {
      var a = ci.getGeoResource(e.map);
      if (a && a.type === "geoJSON") {
        var o = e.itemStyle = e.itemStyle || {};
        "color" in o || (o.color = "#eee");
      }
      this.mergeDefaultAndTheme(e, i), ho(e, "label", ["show"]);
    }, t.prototype.optionUpdated = function() {
      var e = this, n = this.option;
      n.regions = TE.getFilledRegions(n.regions, n.map, n.nameMap, n.nameProperty);
      var i = {};
      this._optionModelMap = kn(n.regions || [], function(a, o) {
        var s = o.name;
        return s && (a.set(s, new Ze(o, e, e.ecModel)), o.selected && (i[s] = !0)), a;
      }, re()), n.selectedMap || (n.selectedMap = i);
    }, t.prototype.getRegionModel = function(e) {
      return this._optionModelMap.get(e) || new Ze(null, this, this.ecModel);
    }, t.prototype.getFormattedLabel = function(e, n) {
      var i = this.getRegionModel(e), a = n === "normal" ? i.get(["label", "formatter"]) : i.get(["emphasis", "label", "formatter"]), o = {
        name: e
      };
      if (oe(a))
        return o.status = n, a(o);
      if (J(a))
        return a.replace("{a}", e ?? "");
    }, t.prototype.setZoom = function(e) {
      this.option.zoom = e;
    }, t.prototype.setCenter = function(e) {
      this.option.center = e;
    }, t.prototype.select = function(e) {
      var n = this.option, i = n.selectedMode;
      if (i) {
        i !== "multiple" && (n.selectedMap = null);
        var a = n.selectedMap || (n.selectedMap = {});
        a[e] = !0;
      }
    }, t.prototype.unSelect = function(e) {
      var n = this.option.selectedMap;
      n && (n[e] = !1);
    }, t.prototype.toggleSelected = function(e) {
      this[this.isSelected(e) ? "unSelect" : "select"](e);
    }, t.prototype.isSelected = function(e) {
      var n = this.option.selectedMap;
      return !!(n && n[e]);
    }, t.type = "geo", t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      z: 0,
      show: !0,
      left: "center",
      top: "center",
      // Default value:
      // for geoSVG source: 1,
      // for geoJSON source: 0.75.
      aspectScale: null,
      // /// Layout with center and size
      // If you want to put map in a fixed size box with right aspect ratio
      // This two properties may be more convenient
      // layoutCenter: [50%, 50%]
      // layoutSize: 100
      silent: !1,
      // Map type
      map: "",
      // Define left-top, right-bottom coords to control view
      // For example, [ [180, 90], [-180, -90] ]
      boundingCoords: null,
      // Default on center of map
      center: null,
      zoom: 1,
      scaleLimit: null,
      // selectedMode: false
      label: {
        show: !1,
        color: "#000"
      },
      itemStyle: {
        borderWidth: 0.5,
        borderColor: "#444"
        // Default color:
        // + geoJSON: #eee
        // + geoSVG: null (use SVG original `fill`)
        // color: '#eee'
      },
      emphasis: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          color: "rgba(255,215,0,0.8)"
        }
      },
      select: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          color: "rgba(255,215,0,0.8)"
        }
      },
      regions: []
      // tooltip: {
      //     show: false
      // }
    }, t;
  }(Le)
);
function iw(r, t) {
  return r.pointToProjected ? r.pointToProjected(t) : r.pointToData(t);
}
function s_(r, t, e, n) {
  var i = r.getZoom(), a = r.getCenter(), o = t.zoom, s = r.projectedToPoint ? r.projectedToPoint(a) : r.dataToPoint(a);
  if (t.dx != null && t.dy != null && (s[0] -= t.dx, s[1] -= t.dy, r.setCenter(iw(r, s), n)), o != null) {
    if (e) {
      var l = e.min || 0, u = e.max || 1 / 0;
      o = Math.max(Math.min(i * o, u), l) / i;
    }
    r.scaleX *= o, r.scaleY *= o;
    var c = (t.originX - r.x) * (o - 1), f = (t.originY - r.y) * (o - 1);
    r.x -= c, r.y -= f, r.updateTransform(), r.setCenter(iw(r, s), n), r.setZoom(o * i);
  }
  return {
    center: r.getCenter(),
    zoom: r.getZoom()
  };
}
var D8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.focusBlurEnabled = !0, e;
    }
    return t.prototype.init = function(e, n) {
      this._api = n;
    }, t.prototype.render = function(e, n, i, a) {
      if (this._model = e, !e.get("show")) {
        this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
        return;
      }
      this._mapDraw || (this._mapDraw = new AE(i));
      var o = this._mapDraw;
      o.draw(e, n, i, this, a), o.group.on("click", this._handleRegionClick, this), o.group.silent = e.get("silent"), this.group.add(o.group), this.updateSelectStatus(e, n, i);
    }, t.prototype._handleRegionClick = function(e) {
      var n;
      Xa(e.target, function(i) {
        return (n = pe(i).eventData) != null;
      }, !0), n && this._api.dispatchAction({
        type: "geoToggleSelect",
        geoId: this._model.id,
        name: n.name
      });
    }, t.prototype.updateSelectStatus = function(e, n, i) {
      var a = this;
      this._mapDraw.group.traverse(function(o) {
        var s = pe(o).eventData;
        if (s)
          return a._model.isSelected(s.name) ? i.enterSelect(o) : i.leaveSelect(o), !0;
      });
    }, t.prototype.findHighDownDispatchers = function(e) {
      return this._mapDraw && this._mapDraw.findHighDownDispatchers(e, this._model);
    }, t.prototype.dispose = function() {
      this._mapDraw && this._mapDraw.remove();
    }, t.type = "geo", t;
  }(lt)
);
function T8(r, t, e) {
  ci.registerMap(r, t, e);
}
function ME(r) {
  r.registerCoordinateSystem("geo", TE), r.registerComponentModel(A8), r.registerComponentView(D8), r.registerImpl("registerMap", T8), r.registerImpl("getMap", function(e) {
    return ci.getMapForUser(e);
  });
  function t(e, n) {
    n.update = "geo:updateSelectStatus", r.registerAction(n, function(i, a) {
      var o = {}, s = [];
      return a.eachComponent({
        mainType: "geo",
        query: i
      }, function(l) {
        l[e](i.name);
        var u = l.coordinateSystem;
        M(u.regions, function(f) {
          o[f.name] = l.isSelected(f.name) || !1;
        });
        var c = [];
        M(o, function(f, h) {
          o[h] && c.push(h);
        }), s.push({
          geoIndex: l.componentIndex,
          // Use singular, the same naming convention as the event `selectchanged`.
          name: c
        });
      }), {
        selected: o,
        allSelected: s,
        name: i.name
      };
    });
  }
  t("toggleSelected", {
    type: "geoToggleSelect",
    event: "geoselectchanged"
  }), t("select", {
    type: "geoSelect",
    event: "geoselected"
  }), t("unSelect", {
    type: "geoUnSelect",
    event: "geounselected"
  }), r.registerAction({
    type: "geoRoam",
    event: "geoRoam",
    update: "updateTransform"
  }, function(e, n, i) {
    var a = e.componentType || "series";
    n.eachComponent({
      mainType: a,
      query: e
    }, function(o) {
      var s = o.coordinateSystem;
      if (s.type === "geo") {
        var l = s_(s, e, o.get("scaleLimit"), i);
        o.setCenter && o.setCenter(l.center), o.setZoom && o.setZoom(l.zoom), a === "series" && M(o.seriesGroup, function(u) {
          u.setCenter(l.center), u.setZoom(l.zoom);
        });
      }
    });
  });
}
function M8(r) {
  De(ME), r.registerChartView(m8), r.registerSeriesModel(y8), r.registerLayout(S8), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, b8), II("map", r.registerAction);
}
function I8(r) {
  var t = r;
  t.hierNode = {
    defaultAncestor: null,
    ancestor: t,
    prelim: 0,
    modifier: 0,
    change: 0,
    shift: 0,
    i: 0,
    thread: null
  };
  for (var e = [t], n, i; n = e.pop(); )
    if (i = n.children, n.isExpand && i.length)
      for (var a = i.length, o = a - 1; o >= 0; o--) {
        var s = i[o];
        s.hierNode = {
          defaultAncestor: null,
          ancestor: s,
          prelim: 0,
          modifier: 0,
          change: 0,
          shift: 0,
          i: o,
          thread: null
        }, e.push(s);
      }
}
function L8(r, t) {
  var e = r.isExpand ? r.children : [], n = r.parentNode.children, i = r.hierNode.i ? n[r.hierNode.i - 1] : null;
  if (e.length) {
    k8(r);
    var a = (e[0].hierNode.prelim + e[e.length - 1].hierNode.prelim) / 2;
    i ? (r.hierNode.prelim = i.hierNode.prelim + t(r, i), r.hierNode.modifier = r.hierNode.prelim - a) : r.hierNode.prelim = a;
  } else i && (r.hierNode.prelim = i.hierNode.prelim + t(r, i));
  r.parentNode.hierNode.defaultAncestor = R8(r, i, r.parentNode.hierNode.defaultAncestor || n[0], t);
}
function E8(r) {
  var t = r.hierNode.prelim + r.parentNode.hierNode.modifier;
  r.setLayout({
    x: t
  }, !0), r.hierNode.modifier += r.parentNode.hierNode.modifier;
}
function aw(r) {
  return arguments.length ? r : B8;
}
function Fl(r, t) {
  return r -= Math.PI / 2, {
    x: t * Math.cos(r),
    y: t * Math.sin(r)
  };
}
function P8(r, t) {
  return St(r.getBoxLayoutParams(), {
    width: t.getWidth(),
    height: t.getHeight()
  });
}
function k8(r) {
  for (var t = r.children, e = t.length, n = 0, i = 0; --e >= 0; ) {
    var a = t[e];
    a.hierNode.prelim += n, a.hierNode.modifier += n, i += a.hierNode.change, n += a.hierNode.shift + i;
  }
}
function R8(r, t, e, n) {
  if (t) {
    for (var i = r, a = r, o = a.parentNode.children[0], s = t, l = i.hierNode.modifier, u = a.hierNode.modifier, c = o.hierNode.modifier, f = s.hierNode.modifier; s = Cp(s), a = Ap(a), s && a; ) {
      i = Cp(i), o = Ap(o), i.hierNode.ancestor = r;
      var h = s.hierNode.prelim + f - a.hierNode.prelim - u + n(s, a);
      h > 0 && (F8(O8(s, r, e), r, h), u += h, l += h), f += s.hierNode.modifier, u += a.hierNode.modifier, l += i.hierNode.modifier, c += o.hierNode.modifier;
    }
    s && !Cp(i) && (i.hierNode.thread = s, i.hierNode.modifier += f - l), a && !Ap(o) && (o.hierNode.thread = a, o.hierNode.modifier += u - c, e = r);
  }
  return e;
}
function Cp(r) {
  var t = r.children;
  return t.length && r.isExpand ? t[t.length - 1] : r.hierNode.thread;
}
function Ap(r) {
  var t = r.children;
  return t.length && r.isExpand ? t[0] : r.hierNode.thread;
}
function O8(r, t, e) {
  return r.hierNode.ancestor.parentNode === t.parentNode ? r.hierNode.ancestor : e;
}
function F8(r, t, e) {
  var n = e / (t.hierNode.i - r.hierNode.i);
  t.hierNode.change -= n, t.hierNode.shift += e, t.hierNode.modifier += e, t.hierNode.prelim += e, r.hierNode.change += n;
}
function B8(r, t) {
  return r.parentNode === t.parentNode ? 1 : 2;
}
var N8 = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.parentPoint = [], this.childPoints = [];
    }
    return r;
  }()
), z8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      return r.call(this, e) || this;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: "#000",
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new N8();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.childPoints, a = i.length, o = n.parentPoint, s = i[0], l = i[a - 1];
      if (a === 1) {
        e.moveTo(o[0], o[1]), e.lineTo(s[0], s[1]);
        return;
      }
      var u = n.orient, c = u === "TB" || u === "BT" ? 0 : 1, f = 1 - c, h = X(n.forkPosition, 1), v = [];
      v[c] = o[c], v[f] = o[f] + (l[f] - o[f]) * h, e.moveTo(o[0], o[1]), e.lineTo(v[0], v[1]), e.moveTo(s[0], s[1]), v[c] = s[c], e.lineTo(v[0], v[1]), v[c] = l[c], e.lineTo(v[0], v[1]), e.lineTo(l[0], l[1]);
      for (var d = 1; d < a - 1; d++) {
        var p = i[d];
        e.moveTo(p[0], p[1]), v[c] = p[c], e.lineTo(v[0], v[1]);
      }
    }, t;
  }(Te)
), V8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._mainGroup = new fe(), e;
    }
    return t.prototype.init = function(e, n) {
      this._controller = new ic(n.getZr()), this._controllerHost = {
        target: this.group
      }, this.group.add(this._mainGroup);
    }, t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = e.layoutInfo, s = this._mainGroup, l = e.get("layout");
      l === "radial" ? (s.x = o.x + o.width / 2, s.y = o.y + o.height / 2) : (s.x = o.x, s.y = o.y), this._updateViewCoordSys(e, i), this._updateController(e, n, i);
      var u = this._data;
      a.diff(u).add(function(c) {
        ow(a, c) && sw(a, c, null, s, e);
      }).update(function(c, f) {
        var h = u.getItemGraphicEl(f);
        if (!ow(a, c)) {
          h && uw(u, f, h, s, e);
          return;
        }
        sw(a, c, h, s, e);
      }).remove(function(c) {
        var f = u.getItemGraphicEl(c);
        f && uw(u, c, f, s, e);
      }).execute(), this._nodeScaleRatio = e.get("nodeScaleRatio"), this._updateNodeAndLinkScale(e), e.get("expandAndCollapse") === !0 && a.eachItemGraphicEl(function(c, f) {
        c.off("click").on("click", function() {
          i.dispatchAction({
            type: "treeExpandAndCollapse",
            seriesId: e.id,
            dataIndex: f
          });
        });
      }), this._data = a;
    }, t.prototype._updateViewCoordSys = function(e, n) {
      var i = e.getData(), a = [];
      i.each(function(f) {
        var h = i.getItemLayout(f);
        h && !isNaN(h.x) && !isNaN(h.y) && a.push([+h.x, +h.y]);
      });
      var o = [], s = [];
      uv(a, o, s);
      var l = this._min, u = this._max;
      s[0] - o[0] === 0 && (o[0] = l ? l[0] : o[0] - 1, s[0] = u ? u[0] : s[0] + 1), s[1] - o[1] === 0 && (o[1] = l ? l[1] : o[1] - 1, s[1] = u ? u[1] : s[1] + 1);
      var c = e.coordinateSystem = new ac();
      c.zoomLimit = e.get("scaleLimit"), c.setBoundingRect(o[0], o[1], s[0] - o[0], s[1] - o[1]), c.setCenter(e.get("center"), n), c.setZoom(e.get("zoom")), this.group.attr({
        x: c.x,
        y: c.y,
        scaleX: c.scaleX,
        scaleY: c.scaleY
      }), this._min = o, this._max = s;
    }, t.prototype._updateController = function(e, n, i) {
      var a = this, o = this._controller, s = this._controllerHost, l = this.group;
      o.setPointerChecker(function(u, c, f) {
        var h = l.getBoundingRect();
        return h.applyTransform(l.transform), h.contain(c, f) && !kv(u, i, e);
      }), o.enable(e.get("roam")), s.zoomLimit = e.get("scaleLimit"), s.zoom = e.coordinateSystem.getZoom(), o.off("pan").off("zoom").on("pan", function(u) {
        i_(s, u.dx, u.dy), i.dispatchAction({
          seriesId: e.id,
          type: "treeRoam",
          dx: u.dx,
          dy: u.dy
        });
      }).on("zoom", function(u) {
        a_(s, u.scale, u.originX, u.originY), i.dispatchAction({
          seriesId: e.id,
          type: "treeRoam",
          zoom: u.scale,
          originX: u.originX,
          originY: u.originY
        }), a._updateNodeAndLinkScale(e), i.updateLabelLayout();
      });
    }, t.prototype._updateNodeAndLinkScale = function(e) {
      var n = e.getData(), i = this._getNodeGlobalScale(e);
      n.eachItemGraphicEl(function(a, o) {
        a.setSymbolScale(i);
      });
    }, t.prototype._getNodeGlobalScale = function(e) {
      var n = e.coordinateSystem;
      if (n.type !== "view")
        return 1;
      var i = this._nodeScaleRatio, a = n.scaleX || 1, o = n.getZoom(), s = (o - 1) * i + 1;
      return s / a;
    }, t.prototype.dispose = function() {
      this._controller && this._controller.dispose(), this._controllerHost = null;
    }, t.prototype.remove = function() {
      this._mainGroup.removeAll(), this._data = null;
    }, t.type = "tree", t;
  }(Qe)
);
function ow(r, t) {
  var e = r.getItemLayout(t);
  return e && !isNaN(e.x) && !isNaN(e.y);
}
function sw(r, t, e, n, i) {
  var a = !e, o = r.tree.getNodeByDataIndex(t), s = o.getModel(), l = o.getVisual("style").fill, u = o.isExpand === !1 && o.children.length !== 0 ? l : "#fff", c = r.tree.root, f = o.parentNode === c ? o : o.parentNode || o, h = r.getItemGraphicEl(f.dataIndex), v = f.getLayout(), d = h ? {
    x: h.__oldX,
    y: h.__oldY,
    rawX: h.__radialOldRawX,
    rawY: h.__radialOldRawY
  } : v, p = o.getLayout();
  a ? (e = new Ju(r, t, null, {
    symbolInnerColor: u,
    useNameLabel: !0
  }), e.x = d.x, e.y = d.y) : e.updateData(r, t, null, {
    symbolInnerColor: u,
    useNameLabel: !0
  }), e.__radialOldRawX = e.__radialRawX, e.__radialOldRawY = e.__radialRawY, e.__radialRawX = p.rawX, e.__radialRawY = p.rawY, n.add(e), r.setItemGraphicEl(t, e), e.__oldX = e.x, e.__oldY = e.y, Ne(e, {
    x: p.x,
    y: p.y
  }, i);
  var g = e.getSymbolPath();
  if (i.get("layout") === "radial") {
    var m = c.children[0], y = m.getLayout(), _ = m.children.length, b = void 0, S = void 0;
    if (p.x === y.x && o.isExpand === !0 && m.children.length) {
      var x = {
        x: (m.children[0].getLayout().x + m.children[_ - 1].getLayout().x) / 2,
        y: (m.children[0].getLayout().y + m.children[_ - 1].getLayout().y) / 2
      };
      b = Math.atan2(x.y - y.y, x.x - y.x), b < 0 && (b = Math.PI * 2 + b), S = x.x < y.x, S && (b = b - Math.PI);
    } else
      b = Math.atan2(p.y - y.y, p.x - y.x), b < 0 && (b = Math.PI * 2 + b), o.children.length === 0 || o.children.length !== 0 && o.isExpand === !1 ? (S = p.x < y.x, S && (b = b - Math.PI)) : (S = p.x > y.x, S || (b = b - Math.PI));
    var w = S ? "left" : "right", C = s.getModel("label"), D = C.get("rotate"), A = D * (Math.PI / 180), T = g.getTextContent();
    T && (g.setTextConfig({
      position: C.get("position") || w,
      rotation: D == null ? -b : A,
      origin: "center"
    }), T.setStyle("verticalAlign", "middle"));
  }
  var L = s.get(["emphasis", "focus"]), E = L === "relative" ? cu(o.getAncestorsIndices(), o.getDescendantIndices()) : L === "ancestor" ? o.getAncestorsIndices() : L === "descendant" ? o.getDescendantIndices() : null;
  E && (pe(e).focus = E), $8(i, o, c, e, d, v, p, n), e.__edge && (e.onHoverStateChange = function(I) {
    if (I !== "blur") {
      var P = o.parentNode && r.getItemGraphicEl(o.parentNode.dataIndex);
      P && P.hoverState === Gu || oh(e.__edge, I);
    }
  });
}
function $8(r, t, e, n, i, a, o, s) {
  var l = t.getModel(), u = r.get("edgeShape"), c = r.get("layout"), f = r.getOrient(), h = r.get(["lineStyle", "curveness"]), v = r.get("edgeForkPosition"), d = l.getModel("lineStyle").getLineStyle(), p = n.__edge;
  if (u === "curve")
    t.parentNode && t.parentNode !== e && (p || (p = n.__edge = new qu({
      shape: Um(c, f, h, i, i)
    })), Ne(p, {
      shape: Um(c, f, h, a, o)
    }, r));
  else if (u === "polyline" && c === "orthogonal" && t !== e && t.children && t.children.length !== 0 && t.isExpand === !0) {
    for (var g = t.children, m = [], y = 0; y < g.length; y++) {
      var _ = g[y].getLayout();
      m.push([_.x, _.y]);
    }
    p || (p = n.__edge = new z8({
      shape: {
        parentPoint: [o.x, o.y],
        childPoints: [[o.x, o.y]],
        orient: f,
        forkPosition: v
      }
    })), Ne(p, {
      shape: {
        parentPoint: [o.x, o.y],
        childPoints: m
      }
    }, r);
  }
  p && !(u === "polyline" && !t.isExpand) && (p.useStyle(se({
    strokeNoScale: !0,
    fill: null
  }, d)), Ft(p, l, "lineStyle"), go(p), s.add(p));
}
function lw(r, t, e, n, i) {
  var a = t.tree.root, o = IE(a, r), s = o.source, l = o.sourceLayout, u = t.getItemGraphicEl(r.dataIndex);
  if (u) {
    var c = t.getItemGraphicEl(s.dataIndex), f = c.__edge, h = u.__edge || (s.isExpand === !1 || s.children.length === 1 ? f : void 0), v = n.get("edgeShape"), d = n.get("layout"), p = n.get("orient"), g = n.get(["lineStyle", "curveness"]);
    h && (v === "curve" ? Ji(h, {
      shape: Um(d, p, g, l, l),
      style: {
        opacity: 0
      }
    }, n, {
      cb: function() {
        e.remove(h);
      },
      removeOpt: i
    }) : v === "polyline" && n.get("layout") === "orthogonal" && Ji(h, {
      shape: {
        parentPoint: [l.x, l.y],
        childPoints: [[l.x, l.y]]
      },
      style: {
        opacity: 0
      }
    }, n, {
      cb: function() {
        e.remove(h);
      },
      removeOpt: i
    }));
  }
}
function IE(r, t) {
  for (var e = t.parentNode === r ? t : t.parentNode || t, n; n = e.getLayout(), n == null; )
    e = e.parentNode === r ? e : e.parentNode || e;
  return {
    source: e,
    sourceLayout: n
  };
}
function uw(r, t, e, n, i) {
  var a = r.tree.getNodeByDataIndex(t), o = r.tree.root, s = IE(o, a).sourceLayout, l = {
    duration: i.get("animationDurationUpdate"),
    easing: i.get("animationEasingUpdate")
  };
  Ji(e, {
    x: s.x + 1,
    y: s.y + 1
  }, i, {
    cb: function() {
      n.remove(e), r.setItemGraphicEl(t, null);
    },
    removeOpt: l
  }), e.fadeOut(null, r.hostModel, {
    fadeLabel: !0,
    animation: l
  }), a.children.forEach(function(u) {
    lw(u, r, n, i, l);
  }), lw(a, r, n, i, l);
}
function Um(r, t, e, n, i) {
  var a, o, s, l, u, c, f, h;
  if (r === "radial") {
    u = n.rawX, f = n.rawY, c = i.rawX, h = i.rawY;
    var v = Fl(u, f), d = Fl(u, f + (h - f) * e), p = Fl(c, h + (f - h) * e), g = Fl(c, h);
    return {
      x1: v.x || 0,
      y1: v.y || 0,
      x2: g.x || 0,
      y2: g.y || 0,
      cpx1: d.x || 0,
      cpy1: d.y || 0,
      cpx2: p.x || 0,
      cpy2: p.y || 0
    };
  } else
    u = n.x, f = n.y, c = i.x, h = i.y, (t === "LR" || t === "RL") && (a = u + (c - u) * e, o = f, s = c + (u - c) * e, l = h), (t === "TB" || t === "BT") && (a = u, o = f + (h - f) * e, s = c, l = h + (f - h) * e);
  return {
    x1: u,
    y1: f,
    x2: c,
    y2: h,
    cpx1: a,
    cpy1: o,
    cpx2: s,
    cpy2: l
  };
}
var Hr = Oe();
function LE(r) {
  var t = r.mainData, e = r.datas;
  e || (e = {
    main: t
  }, r.datasAttr = {
    main: "data"
  }), r.datas = r.mainData = null, EE(t, e, r), M(e, function(n) {
    M(t.TRANSFERABLE_METHODS, function(i) {
      n.wrapMethod(i, ye(G8, r));
    });
  }), t.wrapMethod("cloneShallow", ye(q8, r)), M(t.CHANGABLE_METHODS, function(n) {
    t.wrapMethod(n, ye(H8, r));
  }), rr(e[t.dataType] === t);
}
function G8(r, t) {
  if (Y8(this)) {
    var e = H({}, Hr(this).datas);
    e[this.dataType] = t, EE(t, e, r);
  } else
    l_(t, this.dataType, Hr(this).mainData, r);
  return t;
}
function H8(r, t) {
  return r.struct && r.struct.update(), t;
}
function q8(r, t) {
  return M(Hr(t).datas, function(e, n) {
    e !== t && l_(e.cloneShallow(), n, t, r);
  }), t;
}
function W8(r) {
  var t = Hr(this).mainData;
  return r == null || t == null ? t : Hr(t).datas[r];
}
function U8() {
  var r = Hr(this).mainData;
  return r == null ? [{
    data: r
  }] : U(Ee(Hr(r).datas), function(t) {
    return {
      type: t,
      data: Hr(r).datas[t]
    };
  });
}
function Y8(r) {
  return Hr(r).mainData === r;
}
function EE(r, t, e) {
  Hr(r).datas = {}, M(t, function(n, i) {
    l_(n, i, r, e);
  });
}
function l_(r, t, e, n) {
  Hr(e).datas[t] = r, Hr(r).mainData = e, r.dataType = t, n.struct && (r[n.structAttr] = n.struct, n.struct[n.datasAttr[t]] = r), r.getLinkedData = W8, r.getLinkedDataAll = U8;
}
var Z8 = (
  /** @class */
  function() {
    function r(t, e) {
      this.depth = 0, this.height = 0, this.dataIndex = -1, this.children = [], this.viewChildren = [], this.isExpand = !1, this.name = t || "", this.hostTree = e;
    }
    return r.prototype.isRemoved = function() {
      return this.dataIndex < 0;
    }, r.prototype.eachNode = function(t, e, n) {
      oe(t) && (n = e, e = t, t = null), t = t || {}, J(t) && (t = {
        order: t
      });
      var i = t.order || "preorder", a = this[t.attr || "children"], o;
      i === "preorder" && (o = e.call(n, this));
      for (var s = 0; !o && s < a.length; s++)
        a[s].eachNode(t, e, n);
      i === "postorder" && e.call(n, this);
    }, r.prototype.updateDepthAndHeight = function(t) {
      var e = 0;
      this.depth = t;
      for (var n = 0; n < this.children.length; n++) {
        var i = this.children[n];
        i.updateDepthAndHeight(t + 1), i.height > e && (e = i.height);
      }
      this.height = e + 1;
    }, r.prototype.getNodeById = function(t) {
      if (this.getId() === t)
        return this;
      for (var e = 0, n = this.children, i = n.length; e < i; e++) {
        var a = n[e].getNodeById(t);
        if (a)
          return a;
      }
    }, r.prototype.contains = function(t) {
      if (t === this)
        return !0;
      for (var e = 0, n = this.children, i = n.length; e < i; e++) {
        var a = n[e].contains(t);
        if (a)
          return a;
      }
    }, r.prototype.getAncestors = function(t) {
      for (var e = [], n = t ? this : this.parentNode; n; )
        e.push(n), n = n.parentNode;
      return e.reverse(), e;
    }, r.prototype.getAncestorsIndices = function() {
      for (var t = [], e = this; e; )
        t.push(e.dataIndex), e = e.parentNode;
      return t.reverse(), t;
    }, r.prototype.getDescendantIndices = function() {
      var t = [];
      return this.eachNode(function(e) {
        t.push(e.dataIndex);
      }), t;
    }, r.prototype.getValue = function(t) {
      var e = this.hostTree.data;
      return e.getStore().get(e.getDimensionIndex(t || "value"), this.dataIndex);
    }, r.prototype.setLayout = function(t, e) {
      this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, t, e);
    }, r.prototype.getLayout = function() {
      return this.hostTree.data.getItemLayout(this.dataIndex);
    }, r.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var e = this.hostTree, n = e.data.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, r.prototype.getLevelModel = function() {
      return (this.hostTree.levelModels || [])[this.depth];
    }, r.prototype.setVisual = function(t, e) {
      this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, t, e);
    }, r.prototype.getVisual = function(t) {
      return this.hostTree.data.getItemVisual(this.dataIndex, t);
    }, r.prototype.getRawIndex = function() {
      return this.hostTree.data.getRawIndex(this.dataIndex);
    }, r.prototype.getId = function() {
      return this.hostTree.data.getId(this.dataIndex);
    }, r.prototype.getChildIndex = function() {
      if (this.parentNode) {
        for (var t = this.parentNode.children, e = 0; e < t.length; ++e)
          if (t[e] === this)
            return e;
        return -1;
      }
      return -1;
    }, r.prototype.isAncestorOf = function(t) {
      for (var e = t.parentNode; e; ) {
        if (e === this)
          return !0;
        e = e.parentNode;
      }
      return !1;
    }, r.prototype.isDescendantOf = function(t) {
      return t !== this && t.isAncestorOf(this);
    }, r;
  }()
), u_ = (
  /** @class */
  function() {
    function r(t) {
      this.type = "tree", this._nodes = [], this.hostModel = t;
    }
    return r.prototype.eachNode = function(t, e, n) {
      this.root.eachNode(t, e, n);
    }, r.prototype.getNodeByDataIndex = function(t) {
      var e = this.data.getRawIndex(t);
      return this._nodes[e];
    }, r.prototype.getNodeById = function(t) {
      return this.root.getNodeById(t);
    }, r.prototype.update = function() {
      for (var t = this.data, e = this._nodes, n = 0, i = e.length; n < i; n++)
        e[n].dataIndex = -1;
      for (var n = 0, i = t.count(); n < i; n++)
        e[t.getRawIndex(n)].dataIndex = n;
    }, r.prototype.clearLayouts = function() {
      this.data.clearItemLayouts();
    }, r.createTree = function(t, e, n) {
      var i = new r(e), a = [], o = 1;
      s(t);
      function s(c, f) {
        var h = c.value;
        o = Math.max(o, q(h) ? h.length : 1), a.push(c);
        var v = new Z8(bt(c.name, ""), i);
        f ? X8(v, f) : i.root = v, i._nodes.push(v);
        var d = c.children;
        if (d)
          for (var p = 0; p < d.length; p++)
            s(d[p], v);
      }
      i.root.updateDepthAndHeight(0);
      var l = ju(a, {
        coordDimensions: ["value"],
        dimensionsCount: o
      }).dimensions, u = new er(l, e);
      return u.initData(a), n && n(u), LE({
        mainData: u,
        struct: i,
        structAttr: "tree"
      }), i.update(), i;
    }, r;
  }()
);
function X8(r, t) {
  var e = t.children;
  r.parentNode !== t && (e.push(r), r.parentNode = t);
}
function Lu(r, t, e) {
  if (r && we(t, r.type) >= 0) {
    var n = e.getData().tree.root, i = r.targetNode;
    if (J(i) && (i = n.getNodeById(i)), i && n.contains(i))
      return {
        node: i
      };
    var a = r.targetNodeId;
    if (a != null && (i = n.getNodeById(a)))
      return {
        node: i
      };
  }
}
function PE(r) {
  for (var t = []; r; )
    r = r.parentNode, r && t.push(r);
  return t.reverse();
}
function c_(r, t) {
  var e = PE(r);
  return we(e, t) >= 0;
}
function Ov(r, t) {
  for (var e = []; r; ) {
    var n = r.dataIndex;
    e.push({
      name: r.name,
      dataIndex: n,
      value: t.getRawValue(n)
    }), r = r.parentNode;
  }
  return e.reverse(), e;
}
var j8 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.hasSymbolVisual = !0, e.ignoreStyleOnData = !0, e;
    }
    return t.prototype.getInitialData = function(e) {
      var n = {
        name: e.name,
        children: e.data
      }, i = e.leaves || {}, a = new Ze(i, this, this.ecModel), o = u_.createTree(n, this, s);
      function s(f) {
        f.wrapMethod("getItemModel", function(h, v) {
          var d = o.getNodeByDataIndex(v);
          return d && d.children.length && d.isExpand || (h.parentModel = a), h;
        });
      }
      var l = 0;
      o.eachNode("preorder", function(f) {
        f.depth > l && (l = f.depth);
      });
      var u = e.expandAndCollapse, c = u && e.initialTreeDepth >= 0 ? e.initialTreeDepth : l;
      return o.root.eachNode("preorder", function(f) {
        var h = f.hostTree.data.getRawDataItem(f.dataIndex);
        f.isExpand = h && h.collapsed != null ? !h.collapsed : f.depth <= c;
      }), o.data;
    }, t.prototype.getOrient = function() {
      var e = this.get("orient");
      return e === "horizontal" ? e = "LR" : e === "vertical" && (e = "TB"), e;
    }, t.prototype.setZoom = function(e) {
      this.option.zoom = e;
    }, t.prototype.setCenter = function(e) {
      this.option.center = e;
    }, t.prototype.formatTooltip = function(e, n, i) {
      for (var a = this.getData().tree, o = a.root.children[0], s = a.getNodeByDataIndex(e), l = s.getValue(), u = s.name; s && s !== o; )
        u = s.parentNode.name + "." + u, s = s.parentNode;
      return It("nameValue", {
        name: u,
        value: l,
        noValue: isNaN(l) || l == null
      });
    }, t.prototype.getDataParams = function(e) {
      var n = r.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(e);
      return n.treeAncestors = Ov(i, this), n.collapsed = !i.isExpand, n;
    }, t.type = "series.tree", t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "view",
      // the position of the whole view
      left: "12%",
      top: "12%",
      right: "12%",
      bottom: "12%",
      // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'
      layout: "orthogonal",
      // value can be 'polyline'
      edgeShape: "curve",
      edgeForkPosition: "50%",
      // true | false | 'move' | 'scale', see module:component/helper/RoamController.
      roam: !1,
      // Symbol size scale ratio in roam
      nodeScaleRatio: 0.4,
      // Default on center of graph
      center: null,
      zoom: 1,
      orient: "LR",
      symbol: "emptyCircle",
      symbolSize: 7,
      expandAndCollapse: !0,
      initialTreeDepth: 2,
      lineStyle: {
        color: "#ccc",
        width: 1.5,
        curveness: 0.5
      },
      itemStyle: {
        color: "lightsteelblue",
        // borderColor: '#c23531',
        borderWidth: 1.5
      },
      label: {
        show: !0
      },
      animationEasing: "linear",
      animationDuration: 700,
      animationDurationUpdate: 500
    }, t;
  }(it)
);
function K8(r, t, e) {
  for (var n = [r], i = [], a; a = n.pop(); )
    if (i.push(a), a.isExpand) {
      var o = a.children;
      if (o.length)
        for (var s = 0; s < o.length; s++)
          n.push(o[s]);
    }
  for (; a = i.pop(); )
    t(a, e);
}
function ml(r, t) {
  for (var e = [r], n; n = e.pop(); )
    if (t(n), n.isExpand) {
      var i = n.children;
      if (i.length)
        for (var a = i.length - 1; a >= 0; a--)
          e.push(i[a]);
    }
}
function J8(r, t) {
  r.eachSeriesByType("tree", function(e) {
    Q8(e, t);
  });
}
function Q8(r, t) {
  var e = P8(r, t);
  r.layoutInfo = e;
  var n = r.get("layout"), i = 0, a = 0, o = null;
  n === "radial" ? (i = 2 * Math.PI, a = Math.min(e.height, e.width) / 2, o = aw(function(_, b) {
    return (_.parentNode === b.parentNode ? 1 : 2) / _.depth;
  })) : (i = e.width, a = e.height, o = aw());
  var s = r.getData().tree.root, l = s.children[0];
  if (l) {
    I8(s), K8(l, L8, o), s.hierNode.modifier = -l.hierNode.prelim, ml(l, E8);
    var u = l, c = l, f = l;
    ml(l, function(_) {
      var b = _.getLayout().x;
      b < u.getLayout().x && (u = _), b > c.getLayout().x && (c = _), _.depth > f.depth && (f = _);
    });
    var h = u === c ? 1 : o(u, c) / 2, v = h - u.getLayout().x, d = 0, p = 0, g = 0, m = 0;
    if (n === "radial")
      d = i / (c.getLayout().x + h + v), p = a / (f.depth - 1 || 1), ml(l, function(_) {
        g = (_.getLayout().x + v) * d, m = (_.depth - 1) * p;
        var b = Fl(g, m);
        _.setLayout({
          x: b.x,
          y: b.y,
          rawX: g,
          rawY: m
        }, !0);
      });
    else {
      var y = r.getOrient();
      y === "RL" || y === "LR" ? (p = a / (c.getLayout().x + h + v), d = i / (f.depth - 1 || 1), ml(l, function(_) {
        m = (_.getLayout().x + v) * p, g = y === "LR" ? (_.depth - 1) * d : i - (_.depth - 1) * d, _.setLayout({
          x: g,
          y: m
        }, !0);
      })) : (y === "TB" || y === "BT") && (d = i / (c.getLayout().x + h + v), p = a / (f.depth - 1 || 1), ml(l, function(_) {
        g = (_.getLayout().x + v) * d, m = y === "TB" ? (_.depth - 1) * p : a - (_.depth - 1) * p, _.setLayout({
          x: g,
          y: m
        }, !0);
      }));
    }
  }
}
function e7(r) {
  r.eachSeriesByType("tree", function(t) {
    var e = t.getData(), n = e.tree;
    n.eachNode(function(i) {
      var a = i.getModel(), o = a.getModel("itemStyle").getItemStyle(), s = e.ensureUniqueItemVisual(i.dataIndex, "style");
      H(s, o);
    });
  });
}
function t7(r) {
  r.registerAction({
    type: "treeExpandAndCollapse",
    event: "treeExpandAndCollapse",
    update: "update"
  }, function(t, e) {
    e.eachComponent({
      mainType: "series",
      subType: "tree",
      query: t
    }, function(n) {
      var i = t.dataIndex, a = n.getData().tree, o = a.getNodeByDataIndex(i);
      o.isExpand = !o.isExpand;
    });
  }), r.registerAction({
    type: "treeRoam",
    event: "treeRoam",
    // Here we set 'none' instead of 'update', because roam action
    // just need to update the transform matrix without having to recalculate
    // the layout. So don't need to go through the whole update process, such
    // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.
    update: "none"
  }, function(t, e, n) {
    e.eachComponent({
      mainType: "series",
      subType: "tree",
      query: t
    }, function(i) {
      var a = i.coordinateSystem, o = s_(a, t, void 0, n);
      i.setCenter && i.setCenter(o.center), i.setZoom && i.setZoom(o.zoom);
    });
  });
}
function r7(r) {
  r.registerChartView(V8), r.registerSeriesModel(j8), r.registerLayout(J8), r.registerVisual(e7), t7(r);
}
var cw = ["treemapZoomToNode", "treemapRender", "treemapMove"];
function n7(r) {
  for (var t = 0; t < cw.length; t++)
    r.registerAction({
      type: cw[t],
      update: "updateView"
    }, dt);
  r.registerAction({
    type: "treemapRootToNode",
    update: "updateView"
  }, function(e, n) {
    n.eachComponent({
      mainType: "series",
      subType: "treemap",
      query: e
    }, i);
    function i(a, o) {
      var s = ["treemapZoomToNode", "treemapRootToNode"], l = Lu(e, s, a);
      if (l) {
        var u = a.getViewRoot();
        u && (e.direction = c_(u, l.node) ? "rollUp" : "drillDown"), a.resetViewRoot(l.node);
      }
    }
  });
}
function kE(r) {
  var t = r.getData(), e = t.tree, n = {};
  e.eachNode(function(i) {
    for (var a = i; a && a.depth > 1; )
      a = a.parentNode;
    var o = bm(r.ecModel, a.name || a.dataIndex + "", n);
    i.setVisual("decal", o);
  });
}
var i7 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.preventUsingHoverLayer = !0, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      var i = {
        name: e.name,
        children: e.data
      };
      RE(i);
      var a = e.levels || [], o = this.designatedVisualItemStyle = {}, s = new Ze({
        itemStyle: o
      }, this, n);
      a = e.levels = a7(a, n);
      var l = U(a || [], function(f) {
        return new Ze(f, s, n);
      }, this), u = u_.createTree(i, this, c);
      function c(f) {
        f.wrapMethod("getItemModel", function(h, v) {
          var d = u.getNodeByDataIndex(v), p = d ? l[d.depth] : null;
          return h.parentModel = p || s, h;
        });
      }
      return u.data;
    }, t.prototype.optionUpdated = function() {
      this.resetViewRoot();
    }, t.prototype.formatTooltip = function(e, n, i) {
      var a = this.getData(), o = this.getRawValue(e), s = a.getName(e);
      return It("nameValue", {
        name: s,
        value: o
      });
    }, t.prototype.getDataParams = function(e) {
      var n = r.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(e);
      return n.treeAncestors = Ov(i, this), n.treePathInfo = n.treeAncestors, n;
    }, t.prototype.setLayoutInfo = function(e) {
      this.layoutInfo = this.layoutInfo || {}, H(this.layoutInfo, e);
    }, t.prototype.mapIdToIndex = function(e) {
      var n = this._idIndexMap;
      n || (n = this._idIndexMap = re(), this._idIndexMapCount = 0);
      var i = n.get(e);
      return i == null && n.set(e, i = this._idIndexMapCount++), i;
    }, t.prototype.getViewRoot = function() {
      return this._viewRoot;
    }, t.prototype.resetViewRoot = function(e) {
      e ? this._viewRoot = e : e = this._viewRoot;
      var n = this.getRawData().tree.root;
      (!e || e !== n && !n.contains(e)) && (this._viewRoot = n);
    }, t.prototype.enableAriaDecal = function() {
      kE(this);
    }, t.type = "series.treemap", t.layoutMode = "box", t.defaultOption = {
      // Disable progressive rendering
      progressive: 0,
      // size: ['80%', '80%'],            // deprecated, compatible with ec2.
      left: "center",
      top: "middle",
      width: "80%",
      height: "80%",
      sort: !0,
      clipWindow: "origin",
      squareRatio: 0.5 * (1 + Math.sqrt(5)),
      leafDepth: null,
      drillDownIcon: "▶",
      // to align specialized icon. ▷▶❒❐▼✚
      zoomToNodeRatio: 0.32 * 0.32,
      scaleLimit: null,
      roam: !0,
      nodeClick: "zoomToNode",
      animation: !0,
      animationDurationUpdate: 900,
      animationEasing: "quinticInOut",
      breadcrumb: {
        show: !0,
        height: 22,
        left: "center",
        top: "bottom",
        // right
        // bottom
        emptyItemWidth: 25,
        itemStyle: {
          color: "rgba(0,0,0,0.7)",
          textStyle: {
            color: "#fff"
          }
        },
        emphasis: {
          itemStyle: {
            color: "rgba(0,0,0,0.9)"
            // '#5793f3',
          }
        }
      },
      label: {
        show: !0,
        // Do not use textDistance, for ellipsis rect just the same as treemap node rect.
        distance: 0,
        padding: 5,
        position: "inside",
        // formatter: null,
        color: "#fff",
        overflow: "truncate"
        // align
        // verticalAlign
      },
      upperLabel: {
        show: !1,
        position: [0, "50%"],
        height: 20,
        // formatter: null,
        // color: '#fff',
        overflow: "truncate",
        // align: null,
        verticalAlign: "middle"
      },
      itemStyle: {
        color: null,
        colorAlpha: null,
        colorSaturation: null,
        borderWidth: 0,
        gapWidth: 0,
        borderColor: "#fff",
        borderColorSaturation: null
        // If specified, borderColor will be ineffective, and the
        // border color is evaluated by color of current node and
        // borderColorSaturation.
      },
      emphasis: {
        upperLabel: {
          show: !0,
          position: [0, "50%"],
          overflow: "truncate",
          verticalAlign: "middle"
        }
      },
      visualDimension: 0,
      visualMin: null,
      visualMax: null,
      color: [],
      // level[n].color (if necessary).
      // + Specify color list of each level. level[0].color would be global
      // color list if not specified. (see method `setDefault`).
      // + But set as a empty array to forbid fetch color from global palette
      // when using nodeModel.get('color'), otherwise nodes on deep level
      // will always has color palette set and are not able to inherit color
      // from parent node.
      // + TreemapSeries.color can not be set as 'none', otherwise effect
      // legend color fetching (see seriesColor.js).
      colorAlpha: null,
      colorSaturation: null,
      colorMappingBy: "index",
      visibleMin: 10,
      // be rendered. Only works when sort is 'asc' or 'desc'.
      childrenVisibleMin: null,
      // grandchildren will not show.
      // Why grandchildren? If not grandchildren but children,
      // some siblings show children and some not,
      // the appearance may be mess and not consistent,
      levels: []
      // Each item: {
      //     visibleMin, itemStyle, visualDimension, label
      // }
    }, t;
  }(it)
);
function RE(r) {
  var t = 0;
  M(r.children, function(n) {
    RE(n);
    var i = n.value;
    q(i) && (i = i[0]), t += i;
  });
  var e = r.value;
  q(e) && (e = e[0]), (e == null || isNaN(e)) && (e = t), e < 0 && (e = 0), q(r.value) ? r.value[0] = e : r.value = e;
}
function a7(r, t) {
  var e = je(t.get("color")), n = je(t.get(["aria", "decal", "decals"]));
  if (e) {
    r = r || [];
    var i, a;
    M(r, function(s) {
      var l = new Ze(s), u = l.get("color"), c = l.get("decal");
      (l.get(["itemStyle", "color"]) || u && u !== "none") && (i = !0), (l.get(["itemStyle", "decal"]) || c && c !== "none") && (a = !0);
    });
    var o = r[0] || (r[0] = {});
    return i || (o.color = e.slice()), !a && n && (o.decal = n.slice()), r;
  }
}
var o7 = 8, fw = 8, Dp = 5, s7 = (
  /** @class */
  function() {
    function r(t) {
      this.group = new fe(), t.add(this.group);
    }
    return r.prototype.render = function(t, e, n, i) {
      var a = t.getModel("breadcrumb"), o = this.group;
      if (o.removeAll(), !(!a.get("show") || !n)) {
        var s = a.getModel("itemStyle"), l = a.getModel("emphasis"), u = s.getModel("textStyle"), c = l.getModel(["itemStyle", "textStyle"]), f = {
          pos: {
            left: a.get("left"),
            right: a.get("right"),
            top: a.get("top"),
            bottom: a.get("bottom")
          },
          box: {
            width: e.getWidth(),
            height: e.getHeight()
          },
          emptyItemWidth: a.get("emptyItemWidth"),
          totalWidth: 0,
          renderList: []
        };
        this._prepare(n, f, u), this._renderContent(t, f, s, l, u, c, i), xv(o, f.pos, f.box);
      }
    }, r.prototype._prepare = function(t, e, n) {
      for (var i = t; i; i = i.parentNode) {
        var a = bt(i.getModel().get("name"), ""), o = n.getTextRect(a), s = Math.max(o.width + o7 * 2, e.emptyItemWidth);
        e.totalWidth += s + fw, e.renderList.push({
          node: i,
          text: a,
          width: s
        });
      }
    }, r.prototype._renderContent = function(t, e, n, i, a, o, s) {
      for (var l = 0, u = e.emptyItemWidth, c = t.get(["breadcrumb", "height"]), f = gV(e.pos, e.box), h = e.totalWidth, v = e.renderList, d = i.getModel("itemStyle").getItemStyle(), p = v.length - 1; p >= 0; p--) {
        var g = v[p], m = g.node, y = g.width, _ = g.text;
        h > f.width && (h -= y - u, y = u, _ = null);
        var b = new ar({
          shape: {
            points: l7(l, 0, y, c, p === v.length - 1, p === 0)
          },
          style: se(n.getItemStyle(), {
            lineJoin: "bevel"
          }),
          textContent: new Fe({
            style: nt(a, {
              text: _
            })
          }),
          textConfig: {
            position: "inside"
          },
          z2: Ps * 1e4,
          onclick: ye(s, m)
        });
        b.disableLabelAnimation = !0, b.getTextContent().ensureState("emphasis").style = nt(o, {
          text: _
        }), b.ensureState("emphasis").style = d, ut(b, i.get("focus"), i.get("blurScope"), i.get("disabled")), this.group.add(b), u7(b, t, m), l += y + fw;
      }
    }, r.prototype.remove = function() {
      this.group.removeAll();
    }, r;
  }()
);
function l7(r, t, e, n, i, a) {
  var o = [[i ? r : r - Dp, t], [r + e, t], [r + e, t + n], [i ? r : r - Dp, t + n]];
  return !a && o.splice(2, 0, [r + e + Dp, t + n / 2]), !i && o.push([r, t + n / 2]), o;
}
function u7(r, t, e) {
  pe(r).eventData = {
    componentType: "series",
    componentSubType: "treemap",
    componentIndex: t.componentIndex,
    seriesIndex: t.seriesIndex,
    seriesName: t.name,
    seriesType: "treemap",
    selfType: "breadcrumb",
    nodeData: {
      dataIndex: e && e.dataIndex,
      name: e && e.name
    },
    treePathInfo: e && Ov(e, t)
  };
}
var c7 = (
  /** @class */
  function() {
    function r() {
      this._storage = [], this._elExistsMap = {};
    }
    return r.prototype.add = function(t, e, n, i, a) {
      return this._elExistsMap[t.id] ? !1 : (this._elExistsMap[t.id] = !0, this._storage.push({
        el: t,
        target: e,
        duration: n,
        delay: i,
        easing: a
      }), !0);
    }, r.prototype.finished = function(t) {
      return this._finishedCallback = t, this;
    }, r.prototype.start = function() {
      for (var t = this, e = this._storage.length, n = function() {
        e--, e <= 0 && (t._storage.length = 0, t._elExistsMap = {}, t._finishedCallback && t._finishedCallback());
      }, i = 0, a = this._storage.length; i < a; i++) {
        var o = this._storage[i];
        o.el.animateTo(o.target, {
          duration: o.duration,
          delay: o.delay,
          easing: o.easing,
          setToFinal: !0,
          done: n,
          aborted: n
        });
      }
      return this;
    }, r;
  }()
);
function f7() {
  return new c7();
}
var Ym = fe, hw = ke, vw = 3, dw = "label", pw = "upperLabel", h7 = Ps * 10, v7 = Ps * 2, d7 = Ps * 3, Fa = po([
  ["fill", "color"],
  // `borderColor` and `borderWidth` has been occupied,
  // so use `stroke` to indicate the stroke of the rect.
  ["stroke", "strokeColor"],
  ["lineWidth", "strokeWidth"],
  ["shadowBlur"],
  ["shadowOffsetX"],
  ["shadowOffsetY"],
  ["shadowColor"]
  // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
  // So do not transfer decal directly.
]), gw = function(r) {
  var t = Fa(r);
  return t.stroke = t.fill = t.lineWidth = null, t;
}, Mh = Oe(), p7 = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._state = "ready", e._storage = yl(), e;
    }
    return t.prototype.render = function(e, n, i, a) {
      var o = n.findComponents({
        mainType: "series",
        subType: "treemap",
        query: a
      });
      if (!(we(o, e) < 0)) {
        this.seriesModel = e, this.api = i, this.ecModel = n;
        var s = ["treemapZoomToNode", "treemapRootToNode"], l = Lu(a, s, e), u = a && a.type, c = e.layoutInfo, f = !this._oldTree, h = this._storage, v = u === "treemapRootToNode" && l && h ? {
          rootNodeGroup: h.nodeGroup[l.node.getRawIndex()],
          direction: a.direction
        } : null, d = this._giveContainerGroup(c), p = e.get("animation"), g = this._doRender(d, e, v);
        p && !f && (!u || u === "treemapZoomToNode" || u === "treemapRootToNode") ? this._doAnimation(d, g, e, v) : g.renderFinally(), this._resetController(i), this._renderBreadcrumb(e, i, l);
      }
    }, t.prototype._giveContainerGroup = function(e) {
      var n = this._containerGroup;
      return n || (n = this._containerGroup = new Ym(), this._initEvents(n), this.group.add(n)), n.x = e.x, n.y = e.y, n;
    }, t.prototype._doRender = function(e, n, i) {
      var a = n.getData().tree, o = this._oldTree, s = yl(), l = yl(), u = this._storage, c = [];
      function f(y, _, b, S) {
        return g7(n, l, u, i, s, c, y, _, b, S);
      }
      p(a.root ? [a.root] : [], o && o.root ? [o.root] : [], e, a === o || !o, 0);
      var h = g(u);
      if (this._oldTree = a, this._storage = l, this._controllerHost) {
        var v = this.seriesModel.layoutInfo, d = a.root.getLayout();
        d.width === v.width && d.height === v.height && (this._controllerHost.zoom = 1);
      }
      return {
        lastsForAnimation: s,
        willDeleteEls: h,
        renderFinally: m
      };
      function p(y, _, b, S, x) {
        S ? (_ = y, M(y, function(D, A) {
          !D.isRemoved() && C(A, A);
        })) : new li(_, y, w, w).add(C).update(C).remove(ye(C, null)).execute();
        function w(D) {
          return D.getId();
        }
        function C(D, A) {
          var T = D != null ? y[D] : null, L = A != null ? _[A] : null, E = f(T, L, b, x);
          E && p(T && T.viewChildren || [], L && L.viewChildren || [], E, S, x + 1);
        }
      }
      function g(y) {
        var _ = yl();
        return y && M(y, function(b, S) {
          var x = _[S];
          M(b, function(w) {
            w && (x.push(w), Mh(w).willDelete = !0);
          });
        }), _;
      }
      function m() {
        M(h, function(y) {
          M(y, function(_) {
            _.parent && _.parent.remove(_);
          });
        }), M(c, function(y) {
          y.invisible = !0, y.dirty();
        });
      }
    }, t.prototype._doAnimation = function(e, n, i, a) {
      var o = i.get("animationDurationUpdate"), s = i.get("animationEasing"), l = (oe(o) ? 0 : o) || 0, u = (oe(s) ? null : s) || "cubicOut", c = f7();
      M(n.willDeleteEls, function(f, h) {
        M(f, function(v, d) {
          if (!v.invisible) {
            var p = v.parent, g, m = Mh(p);
            if (a && a.direction === "drillDown")
              g = p === a.rootNodeGroup ? {
                shape: {
                  x: 0,
                  y: 0,
                  width: m.nodeWidth,
                  height: m.nodeHeight
                },
                style: {
                  opacity: 0
                }
              } : {
                style: {
                  opacity: 0
                }
              };
            else {
              var y = 0, _ = 0;
              m.willDelete || (y = m.nodeWidth / 2, _ = m.nodeHeight / 2), g = h === "nodeGroup" ? {
                x: y,
                y: _,
                style: {
                  opacity: 0
                }
              } : {
                shape: {
                  x: y,
                  y: _,
                  width: 0,
                  height: 0
                },
                style: {
                  opacity: 0
                }
              };
            }
            g && c.add(v, g, l, 0, u);
          }
        });
      }), M(this._storage, function(f, h) {
        M(f, function(v, d) {
          var p = n.lastsForAnimation[h][d], g = {};
          p && (v instanceof fe ? p.oldX != null && (g.x = v.x, g.y = v.y, v.x = p.oldX, v.y = p.oldY) : (p.oldShape && (g.shape = H({}, v.shape), v.setShape(p.oldShape)), p.fadein ? (v.setStyle("opacity", 0), g.style = {
            opacity: 1
          }) : v.style.opacity !== 1 && (g.style = {
            opacity: 1
          })), c.add(v, g, l, 0, u));
        });
      }, this), this._state = "animating", c.finished(Q(function() {
        this._state = "ready", n.renderFinally();
      }, this)).start();
    }, t.prototype._resetController = function(e) {
      var n = this._controller, i = this._controllerHost;
      i || (this._controllerHost = {
        target: this.group
      }, i = this._controllerHost), n || (n = this._controller = new ic(e.getZr()), n.enable(this.seriesModel.get("roam")), i.zoomLimit = this.seriesModel.get("scaleLimit"), i.zoom = this.seriesModel.get("zoom"), n.on("pan", Q(this._onPan, this)), n.on("zoom", Q(this._onZoom, this)));
      var a = new xe(0, 0, e.getWidth(), e.getHeight());
      n.setPointerChecker(function(o, s, l) {
        return a.contain(s, l);
      });
    }, t.prototype._clearController = function() {
      var e = this._controller;
      this._controllerHost = null, e && (e.dispose(), e = null);
    }, t.prototype._onPan = function(e) {
      if (this._state !== "animating" && (Math.abs(e.dx) > vw || Math.abs(e.dy) > vw)) {
        var n = this.seriesModel.getData().tree.root;
        if (!n)
          return;
        var i = n.getLayout();
        if (!i)
          return;
        this.api.dispatchAction({
          type: "treemapMove",
          from: this.uid,
          seriesId: this.seriesModel.id,
          rootRect: {
            x: i.x + e.dx,
            y: i.y + e.dy,
            width: i.width,
            height: i.height
          }
        });
      }
    }, t.prototype._onZoom = function(e) {
      var n = e.originX, i = e.originY, a = e.scale;
      if (this._state !== "animating") {
        var o = this.seriesModel.getData().tree.root;
        if (!o)
          return;
        var s = o.getLayout();
        if (!s)
          return;
        var l = new xe(s.x, s.y, s.width, s.height), u = null, c = this._controllerHost;
        u = c.zoomLimit;
        var f = c.zoom = c.zoom || 1;
        if (f *= a, u) {
          var h = u.min || 0, v = u.max || 1 / 0;
          f = Math.max(Math.min(v, f), h);
        }
        var d = f / c.zoom;
        c.zoom = f;
        var p = this.seriesModel.layoutInfo;
        n -= p.x, i -= p.y;
        var g = Cr();
        Rn(g, g, [-n, -i]), Qy(g, g, [d, d]), Rn(g, g, [n, i]), l.applyTransform(g), this.api.dispatchAction({
          type: "treemapRender",
          from: this.uid,
          seriesId: this.seriesModel.id,
          rootRect: {
            x: l.x,
            y: l.y,
            width: l.width,
            height: l.height
          }
        });
      }
    }, t.prototype._initEvents = function(e) {
      var n = this;
      e.on("click", function(i) {
        if (n._state === "ready") {
          var a = n.seriesModel.get("nodeClick", !0);
          if (a) {
            var o = n.findTarget(i.offsetX, i.offsetY);
            if (o) {
              var s = o.node;
              if (s.getLayout().isLeafRoot)
                n._rootToNode(o);
              else if (a === "zoomToNode")
                n._zoomToNode(o);
              else if (a === "link") {
                var l = s.hostTree.data.getItemModel(s.dataIndex), u = l.get("link", !0), c = l.get("target", !0) || "blank";
                u && hh(u, c);
              }
            }
          }
        }
      }, this);
    }, t.prototype._renderBreadcrumb = function(e, n, i) {
      var a = this;
      i || (i = e.get("leafDepth", !0) != null ? {
        node: e.getViewRoot()
      } : this.findTarget(n.getWidth() / 2, n.getHeight() / 2), i || (i = {
        node: e.getData().tree.root
      })), (this._breadcrumb || (this._breadcrumb = new s7(this.group))).render(e, n, i.node, function(o) {
        a._state !== "animating" && (c_(e.getViewRoot(), o) ? a._rootToNode({
          node: o
        }) : a._zoomToNode({
          node: o
        }));
      });
    }, t.prototype.remove = function() {
      this._clearController(), this._containerGroup && this._containerGroup.removeAll(), this._storage = yl(), this._state = "ready", this._breadcrumb && this._breadcrumb.remove();
    }, t.prototype.dispose = function() {
      this._clearController();
    }, t.prototype._zoomToNode = function(e) {
      this.api.dispatchAction({
        type: "treemapZoomToNode",
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: e.node
      });
    }, t.prototype._rootToNode = function(e) {
      this.api.dispatchAction({
        type: "treemapRootToNode",
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: e.node
      });
    }, t.prototype.findTarget = function(e, n) {
      var i, a = this.seriesModel.getViewRoot();
      return a.eachNode({
        attr: "viewChildren",
        order: "preorder"
      }, function(o) {
        var s = this._storage.background[o.getRawIndex()];
        if (s) {
          var l = s.transformCoordToLocal(e, n), u = s.shape;
          if (u.x <= l[0] && l[0] <= u.x + u.width && u.y <= l[1] && l[1] <= u.y + u.height)
            i = {
              node: o,
              offsetX: l[0],
              offsetY: l[1]
            };
          else
            return !1;
        }
      }, this), i;
    }, t.type = "treemap", t;
  }(Qe)
);
function yl() {
  return {
    nodeGroup: [],
    background: [],
    content: []
  };
}
function g7(r, t, e, n, i, a, o, s, l, u) {
  if (!o)
    return;
  var c = o.getLayout(), f = r.getData(), h = o.getModel();
  if (f.setItemGraphicEl(o.dataIndex, null), !c || !c.isInView)
    return;
  var v = c.width, d = c.height, p = c.borderWidth, g = c.invisible, m = o.getRawIndex(), y = s && s.getRawIndex(), _ = o.viewChildren, b = c.upperHeight, S = _ && _.length, x = h.getModel("itemStyle"), w = h.getModel(["emphasis", "itemStyle"]), C = h.getModel(["blur", "itemStyle"]), D = h.getModel(["select", "itemStyle"]), A = x.get("borderRadius") || 0, T = ie("nodeGroup", Ym);
  if (!T)
    return;
  if (l.add(T), T.x = c.x || 0, T.y = c.y || 0, T.markRedraw(), Mh(T).nodeWidth = v, Mh(T).nodeHeight = d, c.isAboveViewRoot)
    return T;
  var L = ie("background", hw, u, v7);
  L && G(T, L, S && c.upperLabelHeight);
  var E = h.getModel("emphasis"), I = E.get("focus"), P = E.get("blurScope"), R = E.get("disabled"), F = I === "ancestor" ? o.getAncestorsIndices() : I === "descendant" ? o.getDescendantIndices() : I;
  if (S)
    mu(T) && Ya(T, !1), L && (Ya(L, !R), f.setItemGraphicEl(o.dataIndex, L), hm(L, F, P));
  else {
    var O = ie("content", hw, u, d7);
    O && W(T, O), L.disableMorphing = !0, L && mu(L) && Ya(L, !1), Ya(T, !R), f.setItemGraphicEl(o.dataIndex, T);
    var z = h.getShallow("cursor");
    z && O.attr("cursor", z), hm(T, F, P);
  }
  return T;
  function G(ve, ae, be) {
    var ne = pe(ae);
    if (ne.dataIndex = o.dataIndex, ne.seriesIndex = r.seriesIndex, ae.setShape({
      x: 0,
      y: 0,
      width: v,
      height: d,
      r: A
    }), g)
      Y(ae);
    else {
      ae.invisible = !1;
      var de = o.getVisual("style"), Ke = de.stroke, Ge = gw(x);
      Ge.fill = Ke;
      var Xe = Fa(w);
      Xe.fill = w.get("borderColor");
      var at = Fa(C);
      at.fill = C.get("borderColor");
      var pt = Fa(D);
      if (pt.fill = D.get("borderColor"), be) {
        var Yt = v - 2 * p;
        j(
          // PENDING: convert ZRColor to ColorString for text.
          ae,
          Ke,
          de.opacity,
          {
            x: p,
            y: 0,
            width: Yt,
            height: b
          }
        );
      } else
        ae.removeTextContent();
      ae.setStyle(Ge), ae.ensureState("emphasis").style = Xe, ae.ensureState("blur").style = at, ae.ensureState("select").style = pt, go(ae);
    }
    ve.add(ae);
  }
  function W(ve, ae) {
    var be = pe(ae);
    be.dataIndex = o.dataIndex, be.seriesIndex = r.seriesIndex;
    var ne = Math.max(v - 2 * p, 0), de = Math.max(d - 2 * p, 0);
    if (ae.culling = !0, ae.setShape({
      x: p,
      y: p,
      width: ne,
      height: de,
      r: A
    }), g)
      Y(ae);
    else {
      ae.invisible = !1;
      var Ke = o.getVisual("style"), Ge = Ke.fill, Xe = gw(x);
      Xe.fill = Ge, Xe.decal = Ke.decal;
      var at = Fa(w), pt = Fa(C), Yt = Fa(D);
      j(ae, Ge, Ke.opacity, null), ae.setStyle(Xe), ae.ensureState("emphasis").style = at, ae.ensureState("blur").style = pt, ae.ensureState("select").style = Yt, go(ae);
    }
    ve.add(ae);
  }
  function Y(ve) {
    !ve.invisible && a.push(ve);
  }
  function j(ve, ae, be, ne) {
    var de = h.getModel(ne ? pw : dw), Ke = bt(h.get("name"), null), Ge = de.getShallow("show");
    Bt(ve, Mt(h, ne ? pw : dw), {
      defaultText: Ge ? Ke : null,
      inheritColor: ae,
      defaultOpacity: be,
      labelFetcher: r,
      labelDataIndex: o.dataIndex
    });
    var Xe = ve.getTextContent();
    if (Xe) {
      var at = Xe.style, pt = jy(at.padding || 0);
      ne && (ve.setTextConfig({
        layoutRect: ne
      }), Xe.disableLabelLayout = !0), Xe.beforeUpdate = function() {
        var Nt = Math.max((ne ? ne.width : ve.shape.width) - pt[1] - pt[3], 0), Gn = Math.max((ne ? ne.height : ve.shape.height) - pt[0] - pt[2], 0);
        (at.width !== Nt || at.height !== Gn) && Xe.setStyle({
          width: Nt,
          height: Gn
        });
      }, at.truncateMinChar = 2, at.lineOverflow = "truncate", ee(at, ne, c);
      var Yt = Xe.getState("emphasis");
      ee(Yt ? Yt.style : null, ne, c);
    }
  }
  function ee(ve, ae, be) {
    var ne = ve ? ve.text : null;
    if (!ae && be.isLeafRoot && ne != null) {
      var de = r.get("drillDownIcon", !0);
      ve.text = de ? de + " " + ne : ne;
    }
  }
  function ie(ve, ae, be, ne) {
    var de = y != null && e[ve][y], Ke = i[ve];
    return de ? (e[ve][y] = null, Me(Ke, de)) : g || (de = new ae(), de instanceof qr && (de.z2 = m7(be, ne)), We(Ke, de)), t[ve][m] = de;
  }
  function Me(ve, ae) {
    var be = ve[m] = {};
    ae instanceof Ym ? (be.oldX = ae.x, be.oldY = ae.y) : be.oldShape = H({}, ae.shape);
  }
  function We(ve, ae) {
    var be = ve[m] = {}, ne = o.parentNode, de = ae instanceof fe;
    if (ne && (!n || n.direction === "drillDown")) {
      var Ke = 0, Ge = 0, Xe = i.background[ne.getRawIndex()];
      !n && Xe && Xe.oldShape && (Ke = Xe.oldShape.width, Ge = Xe.oldShape.height), de ? (be.oldX = 0, be.oldY = Ge) : be.oldShape = {
        x: Ke,
        y: Ge,
        width: 0,
        height: 0
      };
    }
    be.fadein = !de;
  }
}
function m7(r, t) {
  return r * h7 + t;
}
var Eu = M, y7 = ue, Ih = -1, Dt = (
  /** @class */
  function() {
    function r(t) {
      var e = t.mappingMethod, n = t.type, i = this.option = ce(t);
      this.type = n, this.mappingMethod = e, this._normalizeData = S7[e];
      var a = r.visualHandlers[n];
      this.applyVisual = a.applyVisual, this.getColorMapper = a.getColorMapper, this._normalizedToVisual = a._normalizedToVisual[e], e === "piecewise" ? (Tp(i), _7(i)) : e === "category" ? i.categories ? b7(i) : Tp(i, !0) : (rr(e !== "linear" || i.dataExtent), Tp(i));
    }
    return r.prototype.mapValueToVisual = function(t) {
      var e = this._normalizeData(t);
      return this._normalizedToVisual(e, t);
    }, r.prototype.getNormalizer = function() {
      return Q(this._normalizeData, this);
    }, r.listVisualTypes = function() {
      return Ee(r.visualHandlers);
    }, r.isValidType = function(t) {
      return r.visualHandlers.hasOwnProperty(t);
    }, r.eachVisual = function(t, e, n) {
      ue(t) ? M(t, e, n) : e.call(n, t);
    }, r.mapVisual = function(t, e, n) {
      var i, a = q(t) ? [] : ue(t) ? {} : (i = !0, null);
      return r.eachVisual(t, function(o, s) {
        var l = e.call(n, o, s);
        i ? a = l : a[s] = l;
      }), a;
    }, r.retrieveVisuals = function(t) {
      var e = {}, n;
      return t && Eu(r.visualHandlers, function(i, a) {
        t.hasOwnProperty(a) && (e[a] = t[a], n = !0);
      }), n ? e : null;
    }, r.prepareVisualTypes = function(t) {
      if (q(t))
        t = t.slice();
      else if (y7(t)) {
        var e = [];
        Eu(t, function(n, i) {
          e.push(i);
        }), t = e;
      } else
        return [];
      return t.sort(function(n, i) {
        return i === "color" && n !== "color" && n.indexOf("color") === 0 ? 1 : -1;
      }), t;
    }, r.dependsOn = function(t, e) {
      return e === "color" ? !!(t && t.indexOf(e) === 0) : t === e;
    }, r.findPieceIndex = function(t, e, n) {
      for (var i, a = 1 / 0, o = 0, s = e.length; o < s; o++) {
        var l = e[o].value;
        if (l != null) {
          if (l === t || J(l) && l === t + "")
            return o;
          n && h(l, o);
        }
      }
      for (var o = 0, s = e.length; o < s; o++) {
        var u = e[o], c = u.interval, f = u.close;
        if (c) {
          if (c[0] === -1 / 0) {
            if (tf(f[1], t, c[1]))
              return o;
          } else if (c[1] === 1 / 0) {
            if (tf(f[0], c[0], t))
              return o;
          } else if (tf(f[0], c[0], t) && tf(f[1], t, c[1]))
            return o;
          n && h(c[0], o), n && h(c[1], o);
        }
      }
      if (n)
        return t === 1 / 0 ? e.length - 1 : t === -1 / 0 ? 0 : i;
      function h(v, d) {
        var p = Math.abs(v - t);
        p < a && (a = p, i = d);
      }
    }, r.visualHandlers = {
      color: {
        applyVisual: _l("color"),
        getColorMapper: function() {
          var t = this.option;
          return Q(t.mappingMethod === "category" ? function(e, n) {
            return !n && (e = this._normalizeData(e)), Bl.call(this, e);
          } : function(e, n, i) {
            var a = !!i;
            return !n && (e = this._normalizeData(e)), i = sd(e, t.parsedVisual, i), a ? i : ti(i, "rgba");
          }, this);
        },
        _normalizedToVisual: {
          linear: function(t) {
            return ti(sd(t, this.option.parsedVisual), "rgba");
          },
          category: Bl,
          piecewise: function(t, e) {
            var n = Xm.call(this, e);
            return n == null && (n = ti(sd(t, this.option.parsedVisual), "rgba")), n;
          },
          fixed: Ba
        }
      },
      colorHue: ef(function(t, e) {
        return ql(t, e);
      }),
      colorSaturation: ef(function(t, e) {
        return ql(t, null, e);
      }),
      colorLightness: ef(function(t, e) {
        return ql(t, null, null, e);
      }),
      colorAlpha: ef(function(t, e) {
        return eh(t, e);
      }),
      decal: {
        applyVisual: _l("decal"),
        _normalizedToVisual: {
          linear: null,
          category: Bl,
          piecewise: null,
          fixed: null
        }
      },
      opacity: {
        applyVisual: _l("opacity"),
        _normalizedToVisual: Zm([0, 1])
      },
      liftZ: {
        applyVisual: _l("liftZ"),
        _normalizedToVisual: {
          linear: Ba,
          category: Ba,
          piecewise: Ba,
          fixed: Ba
        }
      },
      symbol: {
        applyVisual: function(t, e, n) {
          var i = this.mapValueToVisual(t);
          n("symbol", i);
        },
        _normalizedToVisual: {
          linear: mw,
          category: Bl,
          piecewise: function(t, e) {
            var n = Xm.call(this, e);
            return n == null && (n = mw.call(this, t)), n;
          },
          fixed: Ba
        }
      },
      symbolSize: {
        applyVisual: _l("symbolSize"),
        _normalizedToVisual: Zm([0, 1])
      }
    }, r;
  }()
);
function _7(r) {
  var t = r.pieceList;
  r.hasSpecialVisual = !1, M(t, function(e, n) {
    e.originIndex = n, e.visual != null && (r.hasSpecialVisual = !0);
  });
}
function b7(r) {
  var t = r.categories, e = r.categoryMap = {}, n = r.visual;
  if (Eu(t, function(o, s) {
    e[o] = s;
  }), !q(n)) {
    var i = [];
    ue(n) ? Eu(n, function(o, s) {
      var l = e[s];
      i[l ?? Ih] = o;
    }) : i[Ih] = n, n = OE(r, i);
  }
  for (var a = t.length - 1; a >= 0; a--)
    n[a] == null && (delete e[t[a]], t.pop());
}
function Tp(r, t) {
  var e = r.visual, n = [];
  ue(e) ? Eu(e, function(a) {
    n.push(a);
  }) : e != null && n.push(e);
  var i = {
    color: 1,
    symbol: 1
  };
  !t && n.length === 1 && !i.hasOwnProperty(r.type) && (n[1] = n[0]), OE(r, n);
}
function ef(r) {
  return {
    applyVisual: function(t, e, n) {
      var i = this.mapValueToVisual(t);
      n("color", r(e("color"), i));
    },
    _normalizedToVisual: Zm([0, 1])
  };
}
function mw(r) {
  var t = this.option.visual;
  return t[Math.round(Ye(r, [0, 1], [0, t.length - 1], !0))] || {};
}
function _l(r) {
  return function(t, e, n) {
    n(r, this.mapValueToVisual(t));
  };
}
function Bl(r) {
  var t = this.option.visual;
  return t[this.option.loop && r !== Ih ? r % t.length : r];
}
function Ba() {
  return this.option.visual[0];
}
function Zm(r) {
  return {
    linear: function(t) {
      return Ye(t, r, this.option.visual, !0);
    },
    category: Bl,
    piecewise: function(t, e) {
      var n = Xm.call(this, e);
      return n == null && (n = Ye(t, r, this.option.visual, !0)), n;
    },
    fixed: Ba
  };
}
function Xm(r) {
  var t = this.option, e = t.pieceList;
  if (t.hasSpecialVisual) {
    var n = Dt.findPieceIndex(r, e), i = e[n];
    if (i && i.visual)
      return i.visual[this.type];
  }
}
function OE(r, t) {
  return r.visual = t, r.type === "color" && (r.parsedVisual = U(t, function(e) {
    var n = Ar(e);
    return n || [0, 0, 0, 1];
  })), t;
}
var S7 = {
  linear: function(r) {
    return Ye(r, this.option.dataExtent, [0, 1], !0);
  },
  piecewise: function(r) {
    var t = this.option.pieceList, e = Dt.findPieceIndex(r, t, !0);
    if (e != null)
      return Ye(e, [0, t.length - 1], [0, 1], !0);
  },
  category: function(r) {
    var t = this.option.categories ? this.option.categoryMap[r] : r;
    return t ?? Ih;
  },
  fixed: dt
};
function tf(r, t, e) {
  return r ? t <= e : t < e;
}
var x7 = "itemStyle", FE = Oe();
const w7 = {
  seriesType: "treemap",
  reset: function(r) {
    var t = r.getData().tree, e = t.root;
    e.isRemoved() || BE(
      e,
      // Visual should calculate from tree root but not view root.
      {},
      r.getViewRoot().getAncestors(),
      r
    );
  }
};
function BE(r, t, e, n) {
  var i = r.getModel(), a = r.getLayout(), o = r.hostTree.data;
  if (!(!a || a.invisible || !a.isInView)) {
    var s = i.getModel(x7), l = C7(s, t, n), u = o.ensureUniqueItemVisual(r.dataIndex, "style"), c = s.get("borderColor"), f = s.get("borderColorSaturation"), h;
    f != null && (h = yw(l), c = A7(f, h)), u.stroke = c;
    var v = r.viewChildren;
    if (!v || !v.length)
      h = yw(l), u.fill = h;
    else {
      var d = D7(r, i, a, s, l, v);
      M(v, function(p, g) {
        if (p.depth >= e.length || p === e[p.depth]) {
          var m = T7(i, l, p, g, d, n);
          BE(p, m, e, n);
        }
      });
    }
  }
}
function C7(r, t, e) {
  var n = H({}, t), i = e.designatedVisualItemStyle;
  return M(["color", "colorAlpha", "colorSaturation"], function(a) {
    i[a] = t[a];
    var o = r.get(a);
    i[a] = null, o != null && (n[a] = o);
  }), n;
}
function yw(r) {
  var t = Mp(r, "color");
  if (t) {
    var e = Mp(r, "colorAlpha"), n = Mp(r, "colorSaturation");
    return n && (t = ql(t, null, null, n)), e && (t = eh(t, e)), t;
  }
}
function A7(r, t) {
  return t != null ? ql(t, null, null, r) : null;
}
function Mp(r, t) {
  var e = r[t];
  if (e != null && e !== "none")
    return e;
}
function D7(r, t, e, n, i, a) {
  if (!(!a || !a.length)) {
    var o = Ip(t, "color") || i.color != null && i.color !== "none" && (Ip(t, "colorAlpha") || Ip(t, "colorSaturation"));
    if (o) {
      var s = t.get("visualMin"), l = t.get("visualMax"), u = e.dataExtent.slice();
      s != null && s < u[0] && (u[0] = s), l != null && l > u[1] && (u[1] = l);
      var c = t.get("colorMappingBy"), f = {
        type: o.name,
        dataExtent: u,
        visual: o.range
      };
      f.type === "color" && (c === "index" || c === "id") ? (f.mappingMethod = "category", f.loop = !0) : f.mappingMethod = "linear";
      var h = new Dt(f);
      return FE(h).drColorMappingBy = c, h;
    }
  }
}
function Ip(r, t) {
  var e = r.get(t);
  return q(e) && e.length ? {
    name: t,
    range: e
  } : null;
}
function T7(r, t, e, n, i, a) {
  var o = H({}, t);
  if (i) {
    var s = i.type, l = s === "color" && FE(i).drColorMappingBy, u = l === "index" ? n : l === "id" ? a.mapIdToIndex(e.getId()) : e.getValue(r.get("visualDimension"));
    o[s] = i.mapValueToVisual(u);
  }
  return o;
}
var Pu = Math.max, Lh = Math.min, _w = Et, f_ = M, NE = ["itemStyle", "borderWidth"], M7 = ["itemStyle", "gapWidth"], I7 = ["upperLabel", "show"], L7 = ["upperLabel", "height"];
const E7 = {
  seriesType: "treemap",
  reset: function(r, t, e, n) {
    var i = e.getWidth(), a = e.getHeight(), o = r.option, s = St(r.getBoxLayoutParams(), {
      width: e.getWidth(),
      height: e.getHeight()
    }), l = o.size || [], u = X(_w(s.width, l[0]), i), c = X(_w(s.height, l[1]), a), f = n && n.type, h = ["treemapZoomToNode", "treemapRootToNode"], v = Lu(n, h, r), d = f === "treemapRender" || f === "treemapMove" ? n.rootRect : null, p = r.getViewRoot(), g = PE(p);
    if (f !== "treemapMove") {
      var m = f === "treemapZoomToNode" ? B7(r, v, p, u, c) : d ? [d.width, d.height] : [u, c], y = o.sort;
      y && y !== "asc" && y !== "desc" && (y = "desc");
      var _ = {
        squareRatio: o.squareRatio,
        sort: y,
        leafDepth: o.leafDepth
      };
      p.hostTree.clearLayouts();
      var b = {
        x: 0,
        y: 0,
        width: m[0],
        height: m[1],
        area: m[0] * m[1]
      };
      p.setLayout(b), zE(p, _, !1, 0), b = p.getLayout(), f_(g, function(x, w) {
        var C = (g[w + 1] || p).getValue();
        x.setLayout(H({
          dataExtent: [C, C],
          borderWidth: 0,
          upperHeight: 0
        }, b));
      });
    }
    var S = r.getData().tree.root;
    S.setLayout(N7(s, d, v), !0), r.setLayoutInfo(s), VE(
      S,
      // Transform to base element coordinate system.
      new xe(-s.x, -s.y, i, a),
      g,
      p,
      0
    );
  }
};
function zE(r, t, e, n) {
  var i, a;
  if (!r.isRemoved()) {
    var o = r.getLayout();
    i = o.width, a = o.height;
    var s = r.getModel(), l = s.get(NE), u = s.get(M7) / 2, c = $E(s), f = Math.max(l, c), h = l - u, v = f - u;
    r.setLayout({
      borderWidth: l,
      upperHeight: f,
      upperLabelHeight: c
    }, !0), i = Pu(i - 2 * h, 0), a = Pu(a - h - v, 0);
    var d = i * a, p = P7(r, s, d, t, e, n);
    if (p.length) {
      var g = {
        x: h,
        y: v,
        width: i,
        height: a
      }, m = Lh(i, a), y = 1 / 0, _ = [];
      _.area = 0;
      for (var b = 0, S = p.length; b < S; ) {
        var x = p[b];
        _.push(x), _.area += x.getLayout().area;
        var w = F7(_, m, t.squareRatio);
        w <= y ? (b++, y = w) : (_.area -= _.pop().getLayout().area, bw(_, m, g, u, !1), m = Lh(g.width, g.height), _.length = _.area = 0, y = 1 / 0);
      }
      if (_.length && bw(_, m, g, u, !0), !e) {
        var C = s.get("childrenVisibleMin");
        C != null && d < C && (e = !0);
      }
      for (var b = 0, S = p.length; b < S; b++)
        zE(p[b], t, e, n + 1);
    }
  }
}
function P7(r, t, e, n, i, a) {
  var o = r.children || [], s = n.sort;
  s !== "asc" && s !== "desc" && (s = null);
  var l = n.leafDepth != null && n.leafDepth <= a;
  if (i && !l)
    return r.viewChildren = [];
  o = qe(o, function(v) {
    return !v.isRemoved();
  }), R7(o, s);
  var u = O7(t, o, s);
  if (u.sum === 0)
    return r.viewChildren = [];
  if (u.sum = k7(t, e, u.sum, s, o), u.sum === 0)
    return r.viewChildren = [];
  for (var c = 0, f = o.length; c < f; c++) {
    var h = o[c].getValue() / u.sum * e;
    o[c].setLayout({
      area: h
    });
  }
  return l && (o.length && r.setLayout({
    isLeafRoot: !0
  }, !0), o.length = 0), r.viewChildren = o, r.setLayout({
    dataExtent: u.dataExtent
  }, !0), o;
}
function k7(r, t, e, n, i) {
  if (!n)
    return e;
  for (var a = r.get("visibleMin"), o = i.length, s = o, l = o - 1; l >= 0; l--) {
    var u = i[n === "asc" ? o - l - 1 : l].getValue();
    u / e * t < a && (s = l, e -= u);
  }
  return n === "asc" ? i.splice(0, o - s) : i.splice(s, o - s), e;
}
function R7(r, t) {
  return t && r.sort(function(e, n) {
    var i = t === "asc" ? e.getValue() - n.getValue() : n.getValue() - e.getValue();
    return i === 0 ? t === "asc" ? e.dataIndex - n.dataIndex : n.dataIndex - e.dataIndex : i;
  }), r;
}
function O7(r, t, e) {
  for (var n = 0, i = 0, a = t.length; i < a; i++)
    n += t[i].getValue();
  var o = r.get("visualDimension"), s;
  return !t || !t.length ? s = [NaN, NaN] : o === "value" && e ? (s = [t[t.length - 1].getValue(), t[0].getValue()], e === "asc" && s.reverse()) : (s = [1 / 0, -1 / 0], f_(t, function(l) {
    var u = l.getValue(o);
    u < s[0] && (s[0] = u), u > s[1] && (s[1] = u);
  })), {
    sum: n,
    dataExtent: s
  };
}
function F7(r, t, e) {
  for (var n = 0, i = 1 / 0, a = 0, o = void 0, s = r.length; a < s; a++)
    o = r[a].getLayout().area, o && (o < i && (i = o), o > n && (n = o));
  var l = r.area * r.area, u = t * t * e;
  return l ? Pu(u * n / l, l / (u * i)) : 1 / 0;
}
function bw(r, t, e, n, i) {
  var a = t === e.width ? 0 : 1, o = 1 - a, s = ["x", "y"], l = ["width", "height"], u = e[s[a]], c = t ? r.area / t : 0;
  (i || c > e[l[o]]) && (c = e[l[o]]);
  for (var f = 0, h = r.length; f < h; f++) {
    var v = r[f], d = {}, p = c ? v.getLayout().area / c : 0, g = d[l[o]] = Pu(c - 2 * n, 0), m = e[s[a]] + e[l[a]] - u, y = f === h - 1 || m < p ? m : p, _ = d[l[a]] = Pu(y - 2 * n, 0);
    d[s[o]] = e[s[o]] + Lh(n, g / 2), d[s[a]] = u + Lh(n, _ / 2), u += y, v.setLayout(d, !0);
  }
  e[s[o]] += c, e[l[o]] -= c;
}
function B7(r, t, e, n, i) {
  var a = (t || {}).node, o = [n, i];
  if (!a || a === e)
    return o;
  for (var s, l = n * i, u = l * r.option.zoomToNodeRatio; s = a.parentNode; ) {
    for (var c = 0, f = s.children, h = 0, v = f.length; h < v; h++)
      c += f[h].getValue();
    var d = a.getValue();
    if (d === 0)
      return o;
    u *= c / d;
    var p = s.getModel(), g = p.get(NE), m = Math.max(g, $E(p));
    u += 4 * g * g + (3 * g + m) * Math.pow(u, 0.5), u > Pb && (u = Pb), a = s;
  }
  u < l && (u = l);
  var y = Math.pow(u / l, 0.5);
  return [n * y, i * y];
}
function N7(r, t, e) {
  if (t)
    return {
      x: t.x,
      y: t.y
    };
  var n = {
    x: 0,
    y: 0
  };
  if (!e)
    return n;
  var i = e.node, a = i.getLayout();
  if (!a)
    return n;
  for (var o = [a.width / 2, a.height / 2], s = i; s; ) {
    var l = s.getLayout();
    o[0] += l.x, o[1] += l.y, s = s.parentNode;
  }
  return {
    x: r.width / 2 - o[0],
    y: r.height / 2 - o[1]
  };
}
function VE(r, t, e, n, i) {
  var a = r.getLayout(), o = e[i], s = o && o === r;
  if (!(o && !s || i === e.length && r !== n)) {
    r.setLayout({
      // isInView means: viewRoot sub tree + viewAbovePath
      isInView: !0,
      // invisible only means: outside view clip so that the node can not
      // see but still layout for animation preparation but not render.
      invisible: !s && !t.intersect(a),
      isAboveViewRoot: s
    }, !0);
    var l = new xe(t.x - a.x, t.y - a.y, t.width, t.height);
    f_(r.viewChildren || [], function(u) {
      VE(u, l, e, n, i + 1);
    });
  }
}
function $E(r) {
  return r.get(I7) ? r.get(L7) : 0;
}
function z7(r) {
  r.registerSeriesModel(i7), r.registerChartView(p7), r.registerVisual(w7), r.registerLayout(E7), n7(r);
}
function V7(r) {
  var t = r.findComponents({
    mainType: "legend"
  });
  !t || !t.length || r.eachSeriesByType("graph", function(e) {
    var n = e.getCategoriesData(), i = e.getGraph(), a = i.data, o = n.mapArray(n.getName);
    a.filterSelf(function(s) {
      var l = a.getItemModel(s), u = l.getShallow("category");
      if (u != null) {
        Be(u) && (u = o[u]);
        for (var c = 0; c < t.length; c++)
          if (!t[c].isSelected(u))
            return !1;
      }
      return !0;
    });
  });
}
function $7(r) {
  var t = {};
  r.eachSeriesByType("graph", function(e) {
    var n = e.getCategoriesData(), i = e.getData(), a = {};
    n.each(function(o) {
      var s = n.getName(o);
      a["ec-" + s] = o;
      var l = n.getItemModel(o), u = l.getModel("itemStyle").getItemStyle();
      u.fill || (u.fill = e.getColorFromPalette(s, t)), n.setItemVisual(o, "style", u);
      for (var c = ["symbol", "symbolSize", "symbolKeepAspect"], f = 0; f < c.length; f++) {
        var h = l.getShallow(c[f], !0);
        h != null && n.setItemVisual(o, c[f], h);
      }
    }), n.count() && i.each(function(o) {
      var s = i.getItemModel(o), l = s.getShallow("category");
      if (l != null) {
        J(l) && (l = a["ec-" + l]);
        var u = n.getItemVisual(l, "style"), c = i.ensureUniqueItemVisual(o, "style");
        H(c, u);
        for (var f = ["symbol", "symbolSize", "symbolKeepAspect"], h = 0; h < f.length; h++)
          i.setItemVisual(o, f[h], n.getItemVisual(l, f[h]));
      }
    });
  });
}
function rf(r) {
  return r instanceof Array || (r = [r, r]), r;
}
function G7(r) {
  r.eachSeriesByType("graph", function(t) {
    var e = t.getGraph(), n = t.getEdgeData(), i = rf(t.get("edgeSymbol")), a = rf(t.get("edgeSymbolSize"));
    n.setVisual("fromSymbol", i && i[0]), n.setVisual("toSymbol", i && i[1]), n.setVisual("fromSymbolSize", a && a[0]), n.setVisual("toSymbolSize", a && a[1]), n.setVisual("style", t.getModel("lineStyle").getLineStyle()), n.each(function(o) {
      var s = n.getItemModel(o), l = e.getEdgeByIndex(o), u = rf(s.getShallow("symbol", !0)), c = rf(s.getShallow("symbolSize", !0)), f = s.getModel("lineStyle").getLineStyle(), h = n.ensureUniqueItemVisual(o, "style");
      switch (H(h, f), h.stroke) {
        case "source": {
          var v = l.node1.getVisual("style");
          h.stroke = v && v.fill;
          break;
        }
        case "target": {
          var v = l.node2.getVisual("style");
          h.stroke = v && v.fill;
          break;
        }
      }
      u[0] && l.setVisual("fromSymbol", u[0]), u[1] && l.setVisual("toSymbol", u[1]), c[0] && l.setVisual("fromSymbolSize", c[0]), c[1] && l.setVisual("toSymbolSize", c[1]);
    });
  });
}
var jm = "-->", Fv = function(r) {
  return r.get("autoCurveness") || null;
}, GE = function(r, t) {
  var e = Fv(r), n = 20, i = [];
  if (Be(e))
    n = e;
  else if (q(e)) {
    r.__curvenessList = e;
    return;
  }
  t > n && (n = t);
  var a = n % 2 ? n + 2 : n + 3;
  i = [];
  for (var o = 0; o < a; o++)
    i.push((o % 2 ? o + 1 : o) / 10 * (o % 2 ? -1 : 1));
  r.__curvenessList = i;
}, ku = function(r, t, e) {
  var n = [r.id, r.dataIndex].join("."), i = [t.id, t.dataIndex].join(".");
  return [e.uid, n, i].join(jm);
}, HE = function(r) {
  var t = r.split(jm);
  return [t[0], t[2], t[1]].join(jm);
}, H7 = function(r, t) {
  var e = ku(r.node1, r.node2, t);
  return t.__edgeMap[e];
}, q7 = function(r, t) {
  var e = Km(ku(r.node1, r.node2, t), t), n = Km(ku(r.node2, r.node1, t), t);
  return e + n;
}, Km = function(r, t) {
  var e = t.__edgeMap;
  return e[r] ? e[r].length : 0;
};
function W7(r) {
  Fv(r) && (r.__curvenessList = [], r.__edgeMap = {}, GE(r));
}
function U7(r, t, e, n) {
  if (Fv(e)) {
    var i = ku(r, t, e), a = e.__edgeMap, o = a[HE(i)];
    a[i] && !o ? a[i].isForward = !0 : o && a[i] && (o.isForward = !0, a[i].isForward = !1), a[i] = a[i] || [], a[i].push(n);
  }
}
function h_(r, t, e, n) {
  var i = Fv(t), a = q(i);
  if (!i)
    return null;
  var o = H7(r, t);
  if (!o)
    return null;
  for (var s = -1, l = 0; l < o.length; l++)
    if (o[l] === e) {
      s = l;
      break;
    }
  var u = q7(r, t);
  GE(t, u), r.lineStyle = r.lineStyle || {};
  var c = ku(r.node1, r.node2, t), f = t.__curvenessList, h = a || u % 2 ? 0 : 1;
  if (o.isForward)
    return f[h + s];
  var v = HE(c), d = Km(v, t), p = f[s + d + h];
  return n ? a ? i && i[0] === 0 ? (d + h) % 2 ? p : -p : ((d % 2 ? 0 : 1) + h) % 2 ? p : -p : (d + h) % 2 ? p : -p : f[s + d + h];
}
function qE(r) {
  var t = r.coordinateSystem;
  if (!(t && t.type !== "view")) {
    var e = r.getGraph();
    e.eachNode(function(n) {
      var i = n.getModel();
      n.setLayout([+i.get("x"), +i.get("y")]);
    }), v_(e, r);
  }
}
function v_(r, t) {
  r.eachEdge(function(e, n) {
    var i = En(e.getModel().get(["lineStyle", "curveness"]), -h_(e, t, n, !0), 0), a = Qn(e.node1.getLayout()), o = Qn(e.node2.getLayout()), s = [a, o];
    +i && s.push([(a[0] + o[0]) / 2 - (a[1] - o[1]) * i, (a[1] + o[1]) / 2 - (o[0] - a[0]) * i]), e.setLayout(s);
  });
}
function Y7(r, t) {
  r.eachSeriesByType("graph", function(e) {
    var n = e.get("layout"), i = e.coordinateSystem;
    if (i && i.type !== "view") {
      var a = e.getData(), o = [];
      M(i.dimensions, function(h) {
        o = o.concat(a.mapDimensionsAll(h));
      });
      for (var s = 0; s < a.count(); s++) {
        for (var l = [], u = !1, c = 0; c < o.length; c++) {
          var f = a.get(o[c], s);
          isNaN(f) || (u = !0), l.push(f);
        }
        u ? a.setItemLayout(s, i.dataToPoint(l)) : a.setItemLayout(s, [NaN, NaN]);
      }
      v_(a.graph, e);
    } else (!n || n === "none") && qE(e);
  });
}
function Nl(r) {
  var t = r.coordinateSystem;
  if (t.type !== "view")
    return 1;
  var e = r.option.nodeScaleRatio, n = t.scaleX, i = t.getZoom(), a = (i - 1) * e + 1;
  return a / n;
}
function zl(r) {
  var t = r.getVisual("symbolSize");
  return t instanceof Array && (t = (t[0] + t[1]) / 2), +t;
}
var Sw = Math.PI, Lp = [];
function d_(r, t, e, n) {
  var i = r.coordinateSystem;
  if (!(i && i.type !== "view")) {
    var a = i.getBoundingRect(), o = r.getData(), s = o.graph, l = a.width / 2 + a.x, u = a.height / 2 + a.y, c = Math.min(a.width, a.height) / 2, f = o.count();
    if (o.setLayout({
      cx: l,
      cy: u
    }), !!f) {
      if (e) {
        var h = i.pointToData(n), v = h[0], d = h[1], p = [v - l, d - u];
        Is(p, p), wf(p, p, c), e.setLayout([l + p[0], u + p[1]], !0);
        var g = r.get(["circular", "rotateLabel"]);
        WE(e, g, l, u);
      }
      Z7[t](r, s, o, c, l, u, f), s.eachEdge(function(m, y) {
        var _ = En(m.getModel().get(["lineStyle", "curveness"]), h_(m, r, y), 0), b = Qn(m.node1.getLayout()), S = Qn(m.node2.getLayout()), x, w = (b[0] + S[0]) / 2, C = (b[1] + S[1]) / 2;
        +_ && (_ *= 3, x = [l * _ + w * (1 - _), u * _ + C * (1 - _)]), m.setLayout([b, S, x]);
      });
    }
  }
}
var Z7 = {
  value: function(r, t, e, n, i, a, o) {
    var s = 0, l = e.getSum("value"), u = Math.PI * 2 / (l || o);
    t.eachNode(function(c) {
      var f = c.getValue("value"), h = u * (l ? f : 1) / 2;
      s += h, c.setLayout([n * Math.cos(s) + i, n * Math.sin(s) + a]), s += h;
    });
  },
  symbolSize: function(r, t, e, n, i, a, o) {
    var s = 0;
    Lp.length = o;
    var l = Nl(r);
    t.eachNode(function(f) {
      var h = zl(f);
      isNaN(h) && (h = 2), h < 0 && (h = 0), h *= l;
      var v = Math.asin(h / 2 / n);
      isNaN(v) && (v = Sw / 2), Lp[f.dataIndex] = v, s += v * 2;
    });
    var u = (2 * Sw - s) / o / 2, c = 0;
    t.eachNode(function(f) {
      var h = u + Lp[f.dataIndex];
      c += h, (!f.getLayout() || !f.getLayout().fixed) && f.setLayout([n * Math.cos(c) + i, n * Math.sin(c) + a]), c += h;
    });
  }
};
function WE(r, t, e, n) {
  var i = r.getGraphicEl();
  if (i) {
    var a = r.getModel(), o = a.get(["label", "rotate"]) || 0, s = i.getSymbolPath();
    if (t) {
      var l = r.getLayout(), u = Math.atan2(l[1] - n, l[0] - e);
      u < 0 && (u = Math.PI * 2 + u);
      var c = l[0] < e;
      c && (u = u - Math.PI);
      var f = c ? "left" : "right";
      s.setTextConfig({
        rotation: -u,
        position: f,
        origin: "center"
      });
      var h = s.ensureState("emphasis");
      H(h.textConfig || (h.textConfig = {}), {
        position: f
      });
    } else
      s.setTextConfig({
        rotation: o *= Math.PI / 180
      });
  }
}
function X7(r) {
  r.eachSeriesByType("graph", function(t) {
    t.get("layout") === "circular" && d_(t, "symbolSize");
  });
}
var Wo = Bg;
function j7(r, t, e) {
  for (var n = r, i = t, a = e.rect, o = a.width, s = a.height, l = [a.x + o / 2, a.y + s / 2], u = e.gravity == null ? 0.1 : e.gravity, c = 0; c < n.length; c++) {
    var f = n[c];
    f.p || (f.p = bo(o * (Math.random() - 0.5) + l[0], s * (Math.random() - 0.5) + l[1])), f.pp = Qn(f.p), f.edges = null;
  }
  var h = e.friction == null ? 0.6 : e.friction, v = h, d, p;
  return {
    warmUp: function() {
      v = h * 0.8;
    },
    setFixed: function(g) {
      n[g].fixed = !0;
    },
    setUnfixed: function(g) {
      n[g].fixed = !1;
    },
    /**
     * Before step hook
     */
    beforeStep: function(g) {
      d = g;
    },
    /**
     * After step hook
     */
    afterStep: function(g) {
      p = g;
    },
    /**
     * Some formulas were originally copied from "d3.js"
     * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
     * with some modifications made for this project.
     * See the license statement at the head of this file.
     */
    step: function(g) {
      d && d(n, i);
      for (var m = [], y = n.length, _ = 0; _ < i.length; _++) {
        var b = i[_];
        if (!b.ignoreForceLayout) {
          var S = b.n1, x = b.n2;
          Wa(m, x.p, S.p);
          var w = Ng(m) - b.d, C = x.w / (S.w + x.w);
          isNaN(C) && (C = 0), Is(m, m), !S.fixed && Wo(S.p, S.p, m, C * w * v), !x.fixed && Wo(x.p, x.p, m, -(1 - C) * w * v);
        }
      }
      for (var _ = 0; _ < y; _++) {
        var D = n[_];
        D.fixed || (Wa(m, l, D.p), Wo(D.p, D.p, m, u * v));
      }
      for (var _ = 0; _ < y; _++)
        for (var S = n[_], A = _ + 1; A < y; A++) {
          var x = n[A];
          Wa(m, x.p, S.p);
          var w = Ng(m);
          w === 0 && (D3(m, Math.random() - 0.5, Math.random() - 0.5), w = 1);
          var T = (S.rep + x.rep) / w / w;
          !S.fixed && Wo(S.pp, S.pp, m, T), !x.fixed && Wo(x.pp, x.pp, m, -T);
        }
      for (var L = [], _ = 0; _ < y; _++) {
        var D = n[_];
        D.fixed || (Wa(L, D.p, D.pp), Wo(D.p, D.p, L, v), Xt(D.pp, D.p));
      }
      v = v * 0.992;
      var E = v < 0.01;
      p && p(n, i, E), g && g(E);
    }
  };
}
function K7(r) {
  r.eachSeriesByType("graph", function(t) {
    var e = t.coordinateSystem;
    if (!(e && e.type !== "view"))
      if (t.get("layout") === "force") {
        var n = t.preservedPoints || {}, i = t.getGraph(), a = i.data, o = i.edgeData, s = t.getModel("force"), l = s.get("initLayout");
        t.preservedPoints ? a.each(function(_) {
          var b = a.getId(_);
          a.setItemLayout(_, n[b] || [NaN, NaN]);
        }) : !l || l === "none" ? qE(t) : l === "circular" && d_(t, "value");
        var u = a.getDataExtent("value"), c = o.getDataExtent("value"), f = s.get("repulsion"), h = s.get("edgeLength"), v = q(f) ? f : [f, f], d = q(h) ? h : [h, h];
        d = [d[1], d[0]];
        var p = a.mapArray("value", function(_, b) {
          var S = a.getItemLayout(b), x = Ye(_, u, v);
          return isNaN(x) && (x = (v[0] + v[1]) / 2), {
            w: x,
            rep: x,
            fixed: a.getItemModel(b).get("fixed"),
            p: !S || isNaN(S[0]) || isNaN(S[1]) ? null : S
          };
        }), g = o.mapArray("value", function(_, b) {
          var S = i.getEdgeByIndex(b), x = Ye(_, c, d);
          isNaN(x) && (x = (d[0] + d[1]) / 2);
          var w = S.getModel(), C = En(S.getModel().get(["lineStyle", "curveness"]), -h_(S, t, b, !0), 0);
          return {
            n1: p[S.node1.dataIndex],
            n2: p[S.node2.dataIndex],
            d: x,
            curveness: C,
            ignoreForceLayout: w.get("ignoreForceLayout")
          };
        }), m = e.getBoundingRect(), y = j7(p, g, {
          rect: m,
          gravity: s.get("gravity"),
          friction: s.get("friction")
        });
        y.beforeStep(function(_, b) {
          for (var S = 0, x = _.length; S < x; S++)
            _[S].fixed && Xt(_[S].p, i.getNodeByIndex(S).getLayout());
        }), y.afterStep(function(_, b, S) {
          for (var x = 0, w = _.length; x < w; x++)
            _[x].fixed || i.getNodeByIndex(x).setLayout(_[x].p), n[a.getId(x)] = _[x].p;
          for (var x = 0, w = b.length; x < w; x++) {
            var C = b[x], D = i.getEdgeByIndex(x), A = C.n1.p, T = C.n2.p, L = D.getLayout();
            L = L ? L.slice() : [], L[0] = L[0] || [], L[1] = L[1] || [], Xt(L[0], A), Xt(L[1], T), +C.curveness && (L[2] = [(A[0] + T[0]) / 2 - (A[1] - T[1]) * C.curveness, (A[1] + T[1]) / 2 - (T[0] - A[0]) * C.curveness]), D.setLayout(L);
          }
        }), t.forceLayout = y, t.preservedPoints = n, y.step();
      } else
        t.forceLayout = null;
  });
}
function J7(r, t, e) {
  var n = H(r.getBoxLayoutParams(), {
    aspect: e
  });
  return St(n, {
    width: t.getWidth(),
    height: t.getHeight()
  });
}
function Q7(r, t) {
  var e = [];
  return r.eachSeriesByType("graph", function(n) {
    var i = n.get("coordinateSystem");
    if (!i || i === "view") {
      var a = n.getData(), o = a.mapArray(function(g) {
        var m = a.getItemModel(g);
        return [+m.get("x"), +m.get("y")];
      }), s = [], l = [];
      uv(o, s, l), l[0] - s[0] === 0 && (l[0] += 1, s[0] -= 1), l[1] - s[1] === 0 && (l[1] += 1, s[1] -= 1);
      var u = (l[0] - s[0]) / (l[1] - s[1]), c = J7(n, t, u);
      isNaN(u) && (s = [c.x, c.y], l = [c.x + c.width, c.y + c.height]);
      var f = l[0] - s[0], h = l[1] - s[1], v = c.width, d = c.height, p = n.coordinateSystem = new ac();
      p.zoomLimit = n.get("scaleLimit"), p.setBoundingRect(s[0], s[1], f, h), p.setViewRect(c.x, c.y, v, d), p.setCenter(n.get("center"), t), p.setZoom(n.get("zoom")), e.push(p);
    }
  }), e;
}
var xw = Ct.prototype, Ep = qu.prototype, UE = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
    }
    return r;
  }()
);
(function(r) {
  N(t, r);
  function t() {
    return r !== null && r.apply(this, arguments) || this;
  }
  return t;
})(UE);
function Pp(r) {
  return isNaN(+r.cpx1) || isNaN(+r.cpy1);
}
var eq = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "ec-line", n;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: "#000",
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new UE();
    }, t.prototype.buildPath = function(e, n) {
      Pp(n) ? xw.buildPath.call(this, e, n) : Ep.buildPath.call(this, e, n);
    }, t.prototype.pointAt = function(e) {
      return Pp(this.shape) ? xw.pointAt.call(this, e) : Ep.pointAt.call(this, e);
    }, t.prototype.tangentAt = function(e) {
      var n = this.shape, i = Pp(n) ? [n.x2 - n.x1, n.y2 - n.y1] : Ep.tangentAt.call(this, e);
      return Is(i, i);
    }, t;
  }(Te)
), kp = ["fromSymbol", "toSymbol"];
function ww(r) {
  return "_" + r + "Type";
}
function Cw(r, t, e) {
  var n = t.getItemVisual(e, r);
  if (!n || n === "none")
    return n;
  var i = t.getItemVisual(e, r + "Size"), a = t.getItemVisual(e, r + "Rotate"), o = t.getItemVisual(e, r + "Offset"), s = t.getItemVisual(e, r + "KeepAspect"), l = $s(i), u = Co(o || 0, l);
  return n + l + u + (a || "") + (s || "");
}
function Aw(r, t, e) {
  var n = t.getItemVisual(e, r);
  if (!(!n || n === "none")) {
    var i = t.getItemVisual(e, r + "Size"), a = t.getItemVisual(e, r + "Rotate"), o = t.getItemVisual(e, r + "Offset"), s = t.getItemVisual(e, r + "KeepAspect"), l = $s(i), u = Co(o || 0, l), c = yt(n, -l[0] / 2 + u[0], -l[1] / 2 + u[1], l[0], l[1], null, s);
    return c.__specifiedRotation = a == null || isNaN(a) ? void 0 : +a * Math.PI / 180 || 0, c.name = r, c;
  }
}
function tq(r) {
  var t = new eq({
    name: "line",
    subPixelOptimize: !0
  });
  return Jm(t.shape, r), t;
}
function Jm(r, t) {
  r.x1 = t[0][0], r.y1 = t[0][1], r.x2 = t[1][0], r.y2 = t[1][1], r.percent = 1;
  var e = t[2];
  e ? (r.cpx1 = e[0], r.cpy1 = e[1]) : (r.cpx1 = NaN, r.cpy1 = NaN);
}
var p_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this) || this;
      return a._createLine(e, n, i), a;
    }
    return t.prototype._createLine = function(e, n, i) {
      var a = e.hostModel, o = e.getItemLayout(n), s = tq(o);
      s.shape.percent = 0, st(s, {
        shape: {
          percent: 1
        }
      }, a, n), this.add(s), M(kp, function(l) {
        var u = Aw(l, e, n);
        this.add(u), this[ww(l)] = Cw(l, e, n);
      }, this), this._updateCommonStl(e, n, i);
    }, t.prototype.updateData = function(e, n, i) {
      var a = e.hostModel, o = this.childOfName("line"), s = e.getItemLayout(n), l = {
        shape: {}
      };
      Jm(l.shape, s), Ne(o, l, a, n), M(kp, function(u) {
        var c = Cw(u, e, n), f = ww(u);
        if (this[f] !== c) {
          this.remove(this.childOfName(u));
          var h = Aw(u, e, n);
          this.add(h);
        }
        this[f] = c;
      }, this), this._updateCommonStl(e, n, i);
    }, t.prototype.getLinePath = function() {
      return this.childAt(0);
    }, t.prototype._updateCommonStl = function(e, n, i) {
      var a = e.hostModel, o = this.childOfName("line"), s = i && i.emphasisLineStyle, l = i && i.blurLineStyle, u = i && i.selectLineStyle, c = i && i.labelStatesModels, f = i && i.emphasisDisabled, h = i && i.focus, v = i && i.blurScope;
      if (!i || e.hasItemOption) {
        var d = e.getItemModel(n), p = d.getModel("emphasis");
        s = p.getModel("lineStyle").getLineStyle(), l = d.getModel(["blur", "lineStyle"]).getLineStyle(), u = d.getModel(["select", "lineStyle"]).getLineStyle(), f = p.get("disabled"), h = p.get("focus"), v = p.get("blurScope"), c = Mt(d);
      }
      var g = e.getItemVisual(n, "style"), m = g.stroke;
      o.useStyle(g), o.style.fill = null, o.style.strokeNoScale = !0, o.ensureState("emphasis").style = s, o.ensureState("blur").style = l, o.ensureState("select").style = u, M(kp, function(x) {
        var w = this.childOfName(x);
        if (w) {
          w.setColor(m), w.style.opacity = g.opacity;
          for (var C = 0; C < nr.length; C++) {
            var D = nr[C], A = o.getState(D);
            if (A) {
              var T = A.style || {}, L = w.ensureState(D), E = L.style || (L.style = {});
              T.stroke != null && (E[w.__isEmptyBrush ? "stroke" : "fill"] = T.stroke), T.opacity != null && (E.opacity = T.opacity);
            }
          }
          w.markRedraw();
        }
      }, this);
      var y = a.getRawValue(n);
      Bt(this, c, {
        labelDataIndex: n,
        labelFetcher: {
          getFormattedLabel: function(x, w) {
            return a.getFormattedLabel(x, w, e.dataType);
          }
        },
        inheritColor: m || "#000",
        defaultOpacity: g.opacity,
        defaultText: (y == null ? e.getName(n) : isFinite(y) ? ht(y) : y) + ""
      });
      var _ = this.getTextContent();
      if (_) {
        var b = c.normal;
        _.__align = _.style.align, _.__verticalAlign = _.style.verticalAlign, _.__position = b.get("position") || "middle";
        var S = b.get("distance");
        q(S) || (S = [S, S]), _.__labelDistance = S;
      }
      this.setTextConfig({
        position: null,
        local: !0,
        inside: !1
        // Can't be inside for stroke element.
      }), ut(this, h, v, f);
    }, t.prototype.highlight = function() {
      oi(this);
    }, t.prototype.downplay = function() {
      si(this);
    }, t.prototype.updateLayout = function(e, n) {
      this.setLinePoints(e.getItemLayout(n));
    }, t.prototype.setLinePoints = function(e) {
      var n = this.childOfName("line");
      Jm(n.shape, e), n.dirty();
    }, t.prototype.beforeUpdate = function() {
      var e = this, n = e.childOfName("fromSymbol"), i = e.childOfName("toSymbol"), a = e.getTextContent();
      if (!n && !i && (!a || a.ignore))
        return;
      for (var o = 1, s = this.parent; s; )
        s.scaleX && (o /= s.scaleX), s = s.parent;
      var l = e.childOfName("line");
      if (!this.__dirty && !l.__dirty)
        return;
      var u = l.shape.percent, c = l.pointAt(0), f = l.pointAt(u), h = Wa([], f, c);
      Is(h, h);
      function v(A, T) {
        var L = A.__specifiedRotation;
        if (L == null) {
          var E = l.tangentAt(T);
          A.attr("rotation", (T === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(E[1], E[0]));
        } else
          A.attr("rotation", L);
      }
      if (n && (n.setPosition(c), v(n, 0), n.scaleX = n.scaleY = o * u, n.markRedraw()), i && (i.setPosition(f), v(i, 1), i.scaleX = i.scaleY = o * u, i.markRedraw()), a && !a.ignore) {
        a.x = a.y = 0, a.originX = a.originY = 0;
        var d = void 0, p = void 0, g = a.__labelDistance, m = g[0] * o, y = g[1] * o, _ = u / 2, b = l.tangentAt(_), S = [b[1], -b[0]], x = l.pointAt(_);
        S[1] > 0 && (S[0] = -S[0], S[1] = -S[1]);
        var w = b[0] < 0 ? -1 : 1;
        if (a.__position !== "start" && a.__position !== "end") {
          var C = -Math.atan2(b[1], b[0]);
          f[0] < c[0] && (C = Math.PI + C), a.rotation = C;
        }
        var D = void 0;
        switch (a.__position) {
          case "insideStartTop":
          case "insideMiddleTop":
          case "insideEndTop":
          case "middle":
            D = -y, p = "bottom";
            break;
          case "insideStartBottom":
          case "insideMiddleBottom":
          case "insideEndBottom":
            D = y, p = "top";
            break;
          default:
            D = 0, p = "middle";
        }
        switch (a.__position) {
          case "end":
            a.x = h[0] * m + f[0], a.y = h[1] * y + f[1], d = h[0] > 0.8 ? "left" : h[0] < -0.8 ? "right" : "center", p = h[1] > 0.8 ? "top" : h[1] < -0.8 ? "bottom" : "middle";
            break;
          case "start":
            a.x = -h[0] * m + c[0], a.y = -h[1] * y + c[1], d = h[0] > 0.8 ? "right" : h[0] < -0.8 ? "left" : "center", p = h[1] > 0.8 ? "bottom" : h[1] < -0.8 ? "top" : "middle";
            break;
          case "insideStartTop":
          case "insideStart":
          case "insideStartBottom":
            a.x = m * w + c[0], a.y = c[1] + D, d = b[0] < 0 ? "right" : "left", a.originX = -m * w, a.originY = -D;
            break;
          case "insideMiddleTop":
          case "insideMiddle":
          case "insideMiddleBottom":
          case "middle":
            a.x = x[0], a.y = x[1] + D, d = "center", a.originY = -D;
            break;
          case "insideEndTop":
          case "insideEnd":
          case "insideEndBottom":
            a.x = -m * w + f[0], a.y = f[1] + D, d = b[0] >= 0 ? "right" : "left", a.originX = m * w, a.originY = -D;
            break;
        }
        a.scaleX = a.scaleY = o, a.setStyle({
          // Use the user specified text align and baseline first
          verticalAlign: a.__verticalAlign || p,
          align: a.__align || d
        });
      }
    }, t;
  }(fe)
), g_ = (
  /** @class */
  function() {
    function r(t) {
      this.group = new fe(), this._LineCtor = t || p_;
    }
    return r.prototype.updateData = function(t) {
      var e = this;
      this._progressiveEls = null;
      var n = this, i = n.group, a = n._lineData;
      n._lineData = t, a || i.removeAll();
      var o = Dw(t);
      t.diff(a).add(function(s) {
        e._doAdd(t, s, o);
      }).update(function(s, l) {
        e._doUpdate(a, t, l, s, o);
      }).remove(function(s) {
        i.remove(a.getItemGraphicEl(s));
      }).execute();
    }, r.prototype.updateLayout = function() {
      var t = this._lineData;
      t && t.eachItemGraphicEl(function(e, n) {
        e.updateLayout(t, n);
      }, this);
    }, r.prototype.incrementalPrepareUpdate = function(t) {
      this._seriesScope = Dw(t), this._lineData = null, this.group.removeAll();
    }, r.prototype.incrementalUpdate = function(t, e) {
      this._progressiveEls = [];
      function n(s) {
        !s.isGroup && !rq(s) && (s.incremental = !0, s.ensureState("emphasis").hoverLayer = !0);
      }
      for (var i = t.start; i < t.end; i++) {
        var a = e.getItemLayout(i);
        if (Rp(a)) {
          var o = new this._LineCtor(e, i, this._seriesScope);
          o.traverse(n), this.group.add(o), e.setItemGraphicEl(i, o), this._progressiveEls.push(o);
        }
      }
    }, r.prototype.remove = function() {
      this.group.removeAll();
    }, r.prototype.eachRendered = function(t) {
      sa(this._progressiveEls || this.group, t);
    }, r.prototype._doAdd = function(t, e, n) {
      var i = t.getItemLayout(e);
      if (Rp(i)) {
        var a = new this._LineCtor(t, e, n);
        t.setItemGraphicEl(e, a), this.group.add(a);
      }
    }, r.prototype._doUpdate = function(t, e, n, i, a) {
      var o = t.getItemGraphicEl(n);
      if (!Rp(e.getItemLayout(i))) {
        this.group.remove(o);
        return;
      }
      o ? o.updateData(e, i, a) : o = new this._LineCtor(e, i, a), e.setItemGraphicEl(i, o), this.group.add(o);
    }, r;
  }()
);
function rq(r) {
  return r.animators && r.animators.length > 0;
}
function Dw(r) {
  var t = r.hostModel, e = t.getModel("emphasis");
  return {
    lineStyle: t.getModel("lineStyle").getLineStyle(),
    emphasisLineStyle: e.getModel(["lineStyle"]).getLineStyle(),
    blurLineStyle: t.getModel(["blur", "lineStyle"]).getLineStyle(),
    selectLineStyle: t.getModel(["select", "lineStyle"]).getLineStyle(),
    emphasisDisabled: e.get("disabled"),
    blurScope: e.get("blurScope"),
    focus: e.get("focus"),
    labelStatesModels: Mt(t)
  };
}
function Tw(r) {
  return isNaN(r[0]) || isNaN(r[1]);
}
function Rp(r) {
  return r && !Tw(r[0]) && !Tw(r[1]);
}
var Op = [], Fp = [], Bp = [], Uo = Lt, Np = to, Mw = Math.abs;
function Iw(r, t, e) {
  for (var n = r[0], i = r[1], a = r[2], o = 1 / 0, s, l = e * e, u = 0.1, c = 0.1; c <= 0.9; c += 0.1) {
    Op[0] = Uo(n[0], i[0], a[0], c), Op[1] = Uo(n[1], i[1], a[1], c);
    var f = Mw(Np(Op, t) - l);
    f < o && (o = f, s = c);
  }
  for (var h = 0; h < 32; h++) {
    var v = s + u;
    Fp[0] = Uo(n[0], i[0], a[0], s), Fp[1] = Uo(n[1], i[1], a[1], s), Bp[0] = Uo(n[0], i[0], a[0], v), Bp[1] = Uo(n[1], i[1], a[1], v);
    var f = Np(Fp, t) - l;
    if (Mw(f) < 0.01)
      break;
    var d = Np(Bp, t) - l;
    u /= 2, f < 0 ? d >= 0 ? s = s + u : s = s - u : d >= 0 ? s = s - u : s = s + u;
  }
  return s;
}
function zp(r, t) {
  var e = [], n = fu, i = [[], [], []], a = [[], []], o = [];
  t /= 2, r.eachEdge(function(s, l) {
    var u = s.getLayout(), c = s.getVisual("fromSymbol"), f = s.getVisual("toSymbol");
    u.__original || (u.__original = [Qn(u[0]), Qn(u[1])], u[2] && u.__original.push(Qn(u[2])));
    var h = u.__original;
    if (u[2] != null) {
      if (Xt(i[0], h[0]), Xt(i[1], h[2]), Xt(i[2], h[1]), c && c !== "none") {
        var v = zl(s.node1), d = Iw(i, h[0], v * t);
        n(i[0][0], i[1][0], i[2][0], d, e), i[0][0] = e[3], i[1][0] = e[4], n(i[0][1], i[1][1], i[2][1], d, e), i[0][1] = e[3], i[1][1] = e[4];
      }
      if (f && f !== "none") {
        var v = zl(s.node2), d = Iw(i, h[1], v * t);
        n(i[0][0], i[1][0], i[2][0], d, e), i[1][0] = e[1], i[2][0] = e[2], n(i[0][1], i[1][1], i[2][1], d, e), i[1][1] = e[1], i[2][1] = e[2];
      }
      Xt(u[0], i[0]), Xt(u[1], i[2]), Xt(u[2], i[1]);
    } else {
      if (Xt(a[0], h[0]), Xt(a[1], h[1]), Wa(o, a[1], a[0]), Is(o, o), c && c !== "none") {
        var v = zl(s.node1);
        Bg(a[0], a[0], o, v * t);
      }
      if (f && f !== "none") {
        var v = zl(s.node2);
        Bg(a[1], a[1], o, -v * t);
      }
      Xt(u[0], a[0]), Xt(u[1], a[1]);
    }
  });
}
function Lw(r) {
  return r.type === "view";
}
var nq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n) {
      var i = new Qu(), a = new g_(), o = this.group;
      this._controller = new ic(n.getZr()), this._controllerHost = {
        target: o
      }, o.add(i.group), o.add(a.group), this._symbolDraw = i, this._lineDraw = a, this._firstRender = !0;
    }, t.prototype.render = function(e, n, i) {
      var a = this, o = e.coordinateSystem;
      this._model = e;
      var s = this._symbolDraw, l = this._lineDraw, u = this.group;
      if (Lw(o)) {
        var c = {
          x: o.x,
          y: o.y,
          scaleX: o.scaleX,
          scaleY: o.scaleY
        };
        this._firstRender ? u.attr(c) : Ne(u, c, e);
      }
      zp(e.getGraph(), Nl(e));
      var f = e.getData();
      s.updateData(f);
      var h = e.getEdgeData();
      l.updateData(h), this._updateNodeAndLinkScale(), this._updateController(e, n, i), clearTimeout(this._layoutTimeout);
      var v = e.forceLayout, d = e.get(["force", "layoutAnimation"]);
      v && this._startForceLayoutIteration(v, d);
      var p = e.get("layout");
      f.graph.eachNode(function(_) {
        var b = _.dataIndex, S = _.getGraphicEl(), x = _.getModel();
        if (S) {
          S.off("drag").off("dragend");
          var w = x.get("draggable");
          w && S.on("drag", function(D) {
            switch (p) {
              case "force":
                v.warmUp(), !a._layouting && a._startForceLayoutIteration(v, d), v.setFixed(b), f.setItemLayout(b, [S.x, S.y]);
                break;
              case "circular":
                f.setItemLayout(b, [S.x, S.y]), _.setLayout({
                  fixed: !0
                }, !0), d_(e, "symbolSize", _, [D.offsetX, D.offsetY]), a.updateLayout(e);
                break;
              case "none":
              default:
                f.setItemLayout(b, [S.x, S.y]), v_(e.getGraph(), e), a.updateLayout(e);
                break;
            }
          }).on("dragend", function() {
            v && v.setUnfixed(b);
          }), S.setDraggable(w, !!x.get("cursor"));
          var C = x.get(["emphasis", "focus"]);
          C === "adjacency" && (pe(S).focus = _.getAdjacentDataIndices());
        }
      }), f.graph.eachEdge(function(_) {
        var b = _.getGraphicEl(), S = _.getModel().get(["emphasis", "focus"]);
        b && S === "adjacency" && (pe(b).focus = {
          edge: [_.dataIndex],
          node: [_.node1.dataIndex, _.node2.dataIndex]
        });
      });
      var g = e.get("layout") === "circular" && e.get(["circular", "rotateLabel"]), m = f.getLayout("cx"), y = f.getLayout("cy");
      f.graph.eachNode(function(_) {
        WE(_, g, m, y);
      }), this._firstRender = !1;
    }, t.prototype.dispose = function() {
      this.remove(), this._controller && this._controller.dispose(), this._controllerHost = null;
    }, t.prototype._startForceLayoutIteration = function(e, n) {
      var i = this;
      (function a() {
        e.step(function(o) {
          i.updateLayout(i._model), (i._layouting = !o) && (n ? i._layoutTimeout = setTimeout(a, 16) : a());
        });
      })();
    }, t.prototype._updateController = function(e, n, i) {
      var a = this, o = this._controller, s = this._controllerHost, l = this.group;
      if (o.setPointerChecker(function(u, c, f) {
        var h = l.getBoundingRect();
        return h.applyTransform(l.transform), h.contain(c, f) && !kv(u, i, e);
      }), !Lw(e.coordinateSystem)) {
        o.disable();
        return;
      }
      o.enable(e.get("roam")), s.zoomLimit = e.get("scaleLimit"), s.zoom = e.coordinateSystem.getZoom(), o.off("pan").off("zoom").on("pan", function(u) {
        i_(s, u.dx, u.dy), i.dispatchAction({
          seriesId: e.id,
          type: "graphRoam",
          dx: u.dx,
          dy: u.dy
        });
      }).on("zoom", function(u) {
        a_(s, u.scale, u.originX, u.originY), i.dispatchAction({
          seriesId: e.id,
          type: "graphRoam",
          zoom: u.scale,
          originX: u.originX,
          originY: u.originY
        }), a._updateNodeAndLinkScale(), zp(e.getGraph(), Nl(e)), a._lineDraw.updateLayout(), i.updateLabelLayout();
      });
    }, t.prototype._updateNodeAndLinkScale = function() {
      var e = this._model, n = e.getData(), i = Nl(e);
      n.eachItemGraphicEl(function(a, o) {
        a && a.setSymbolScale(i);
      });
    }, t.prototype.updateLayout = function(e) {
      zp(e.getGraph(), Nl(e)), this._symbolDraw.updateLayout(), this._lineDraw.updateLayout();
    }, t.prototype.remove = function() {
      clearTimeout(this._layoutTimeout), this._layouting = !1, this._layoutTimeout = null, this._symbolDraw && this._symbolDraw.remove(), this._lineDraw && this._lineDraw.remove();
    }, t.type = "graph", t;
  }(Qe)
);
function Yo(r) {
  return "_EC_" + r;
}
var iq = (
  /** @class */
  function() {
    function r(t) {
      this.type = "graph", this.nodes = [], this.edges = [], this._nodesMap = {}, this._edgesMap = {}, this._directed = t || !1;
    }
    return r.prototype.isDirected = function() {
      return this._directed;
    }, r.prototype.addNode = function(t, e) {
      t = t == null ? "" + e : "" + t;
      var n = this._nodesMap;
      if (!n[Yo(t)]) {
        var i = new Na(t, e);
        return i.hostGraph = this, this.nodes.push(i), n[Yo(t)] = i, i;
      }
    }, r.prototype.getNodeByIndex = function(t) {
      var e = this.data.getRawIndex(t);
      return this.nodes[e];
    }, r.prototype.getNodeById = function(t) {
      return this._nodesMap[Yo(t)];
    }, r.prototype.addEdge = function(t, e, n) {
      var i = this._nodesMap, a = this._edgesMap;
      if (Be(t) && (t = this.nodes[t]), Be(e) && (e = this.nodes[e]), t instanceof Na || (t = i[Yo(t)]), e instanceof Na || (e = i[Yo(e)]), !(!t || !e)) {
        var o = t.id + "-" + e.id, s = new YE(t, e, n);
        return s.hostGraph = this, this._directed && (t.outEdges.push(s), e.inEdges.push(s)), t.edges.push(s), t !== e && e.edges.push(s), this.edges.push(s), a[o] = s, s;
      }
    }, r.prototype.getEdgeByIndex = function(t) {
      var e = this.edgeData.getRawIndex(t);
      return this.edges[e];
    }, r.prototype.getEdge = function(t, e) {
      t instanceof Na && (t = t.id), e instanceof Na && (e = e.id);
      var n = this._edgesMap;
      return this._directed ? n[t + "-" + e] : n[t + "-" + e] || n[e + "-" + t];
    }, r.prototype.eachNode = function(t, e) {
      for (var n = this.nodes, i = n.length, a = 0; a < i; a++)
        n[a].dataIndex >= 0 && t.call(e, n[a], a);
    }, r.prototype.eachEdge = function(t, e) {
      for (var n = this.edges, i = n.length, a = 0; a < i; a++)
        n[a].dataIndex >= 0 && n[a].node1.dataIndex >= 0 && n[a].node2.dataIndex >= 0 && t.call(e, n[a], a);
    }, r.prototype.breadthFirstTraverse = function(t, e, n, i) {
      if (e instanceof Na || (e = this._nodesMap[Yo(e)]), !!e) {
        for (var a = n === "out" ? "outEdges" : n === "in" ? "inEdges" : "edges", o = 0; o < this.nodes.length; o++)
          this.nodes[o].__visited = !1;
        if (!t.call(i, e, null))
          for (var s = [e]; s.length; )
            for (var l = s.shift(), u = l[a], o = 0; o < u.length; o++) {
              var c = u[o], f = c.node1 === l ? c.node2 : c.node1;
              if (!f.__visited) {
                if (t.call(i, f, l))
                  return;
                s.push(f), f.__visited = !0;
              }
            }
      }
    }, r.prototype.update = function() {
      for (var t = this.data, e = this.edgeData, n = this.nodes, i = this.edges, a = 0, o = n.length; a < o; a++)
        n[a].dataIndex = -1;
      for (var a = 0, o = t.count(); a < o; a++)
        n[t.getRawIndex(a)].dataIndex = a;
      e.filterSelf(function(s) {
        var l = i[e.getRawIndex(s)];
        return l.node1.dataIndex >= 0 && l.node2.dataIndex >= 0;
      });
      for (var a = 0, o = i.length; a < o; a++)
        i[a].dataIndex = -1;
      for (var a = 0, o = e.count(); a < o; a++)
        i[e.getRawIndex(a)].dataIndex = a;
    }, r.prototype.clone = function() {
      for (var t = new r(this._directed), e = this.nodes, n = this.edges, i = 0; i < e.length; i++)
        t.addNode(e[i].id, e[i].dataIndex);
      for (var i = 0; i < n.length; i++) {
        var a = n[i];
        t.addEdge(a.node1.id, a.node2.id, a.dataIndex);
      }
      return t;
    }, r;
  }()
), Na = (
  /** @class */
  function() {
    function r(t, e) {
      this.inEdges = [], this.outEdges = [], this.edges = [], this.dataIndex = -1, this.id = t ?? "", this.dataIndex = e ?? -1;
    }
    return r.prototype.degree = function() {
      return this.edges.length;
    }, r.prototype.inDegree = function() {
      return this.inEdges.length;
    }, r.prototype.outDegree = function() {
      return this.outEdges.length;
    }, r.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var e = this.hostGraph, n = e.data.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, r.prototype.getAdjacentDataIndices = function() {
      for (var t = {
        edge: [],
        node: []
      }, e = 0; e < this.edges.length; e++) {
        var n = this.edges[e];
        n.dataIndex < 0 || (t.edge.push(n.dataIndex), t.node.push(n.node1.dataIndex, n.node2.dataIndex));
      }
      return t;
    }, r.prototype.getTrajectoryDataIndices = function() {
      for (var t = re(), e = re(), n = 0; n < this.edges.length; n++) {
        var i = this.edges[n];
        if (!(i.dataIndex < 0)) {
          t.set(i.dataIndex, !0);
          for (var a = [i.node1], o = [i.node2], s = 0; s < a.length; ) {
            var l = a[s];
            s++, e.set(l.dataIndex, !0);
            for (var u = 0; u < l.inEdges.length; u++)
              t.set(l.inEdges[u].dataIndex, !0), a.push(l.inEdges[u].node1);
          }
          for (s = 0; s < o.length; ) {
            var c = o[s];
            s++, e.set(c.dataIndex, !0);
            for (var u = 0; u < c.outEdges.length; u++)
              t.set(c.outEdges[u].dataIndex, !0), o.push(c.outEdges[u].node2);
          }
        }
      }
      return {
        edge: t.keys(),
        node: e.keys()
      };
    }, r;
  }()
), YE = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.dataIndex = -1, this.node1 = t, this.node2 = e, this.dataIndex = n ?? -1;
    }
    return r.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var e = this.hostGraph, n = e.edgeData.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, r.prototype.getAdjacentDataIndices = function() {
      return {
        edge: [this.dataIndex],
        node: [this.node1.dataIndex, this.node2.dataIndex]
      };
    }, r.prototype.getTrajectoryDataIndices = function() {
      var t = re(), e = re();
      t.set(this.dataIndex, !0);
      for (var n = [this.node1], i = [this.node2], a = 0; a < n.length; ) {
        var o = n[a];
        a++, e.set(o.dataIndex, !0);
        for (var s = 0; s < o.inEdges.length; s++)
          t.set(o.inEdges[s].dataIndex, !0), n.push(o.inEdges[s].node1);
      }
      for (a = 0; a < i.length; ) {
        var l = i[a];
        a++, e.set(l.dataIndex, !0);
        for (var s = 0; s < l.outEdges.length; s++)
          t.set(l.outEdges[s].dataIndex, !0), i.push(l.outEdges[s].node2);
      }
      return {
        edge: t.keys(),
        node: e.keys()
      };
    }, r;
  }()
);
function ZE(r, t) {
  return {
    /**
     * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
     */
    getValue: function(e) {
      var n = this[r][t];
      return n.getStore().get(n.getDimensionIndex(e || "value"), this.dataIndex);
    },
    // TODO: TYPE stricter type.
    setVisual: function(e, n) {
      this.dataIndex >= 0 && this[r][t].setItemVisual(this.dataIndex, e, n);
    },
    getVisual: function(e) {
      return this[r][t].getItemVisual(this.dataIndex, e);
    },
    setLayout: function(e, n) {
      this.dataIndex >= 0 && this[r][t].setItemLayout(this.dataIndex, e, n);
    },
    getLayout: function() {
      return this[r][t].getItemLayout(this.dataIndex);
    },
    getGraphicEl: function() {
      return this[r][t].getItemGraphicEl(this.dataIndex);
    },
    getRawIndex: function() {
      return this[r][t].getRawIndex(this.dataIndex);
    }
  };
}
_t(Na, ZE("hostGraph", "data"));
_t(YE, ZE("hostGraph", "edgeData"));
function XE(r, t, e, n, i) {
  for (var a = new iq(n), o = 0; o < r.length; o++)
    a.addNode(Et(
      // Id, name, dataIndex
      r[o].id,
      r[o].name,
      o
    ), o);
  for (var s = [], l = [], u = 0, o = 0; o < t.length; o++) {
    var c = t[o], f = c.source, h = c.target;
    a.addEdge(f, h, u) && (l.push(c), s.push(Et(bt(c.id, null), f + " > " + h)), u++);
  }
  var v = e.get("coordinateSystem"), d;
  if (v === "cartesian2d" || v === "polar")
    d = gi(r, e);
  else {
    var p = Zu.get(v), g = p ? p.dimensions || [] : [];
    we(g, "value") < 0 && g.concat(["value"]);
    var m = ju(r, {
      coordDimensions: g,
      encodeDefine: e.getEncode()
    }).dimensions;
    d = new er(m, e), d.initData(r);
  }
  var y = new er(["value"], e);
  return y.initData(l, s), i && i(d, y), LE({
    mainData: d,
    struct: a,
    structAttr: "graph",
    datas: {
      node: d,
      edge: y
    },
    datasAttr: {
      node: "data",
      edge: "edgeData"
    }
  }), a.update(), a;
}
var aq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e;
    }
    return t.prototype.init = function(e) {
      r.prototype.init.apply(this, arguments);
      var n = this;
      function i() {
        return n._categoriesData;
      }
      this.legendVisualProvider = new nc(i, i), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData();
    }, t.prototype.mergeOption = function(e) {
      r.prototype.mergeOption.apply(this, arguments), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData();
    }, t.prototype.mergeDefaultAndTheme = function(e) {
      r.prototype.mergeDefaultAndTheme.apply(this, arguments), ho(e, "edgeLabel", ["show"]);
    }, t.prototype.getInitialData = function(e, n) {
      var i = e.edges || e.links || [], a = e.data || e.nodes || [], o = this;
      if (a && i) {
        W7(this);
        var s = XE(a, i, this, !0, l);
        return M(s.edges, function(u) {
          U7(u.node1, u.node2, this, u.dataIndex);
        }, this), s.data;
      }
      function l(u, c) {
        u.wrapMethod("getItemModel", function(d) {
          var p = o._categoriesModels, g = d.getShallow("category"), m = p[g];
          return m && (m.parentModel = d.parentModel, d.parentModel = m), d;
        });
        var f = Ze.prototype.getModel;
        function h(d, p) {
          var g = f.call(this, d, p);
          return g.resolveParentPath = v, g;
        }
        c.wrapMethod("getItemModel", function(d) {
          return d.resolveParentPath = v, d.getModel = h, d;
        });
        function v(d) {
          if (d && (d[0] === "label" || d[1] === "label")) {
            var p = d.slice();
            return d[0] === "label" ? p[0] = "edgeLabel" : d[1] === "label" && (p[1] = "edgeLabel"), p;
          }
          return d;
        }
      }
    }, t.prototype.getGraph = function() {
      return this.getData().graph;
    }, t.prototype.getEdgeData = function() {
      return this.getGraph().edgeData;
    }, t.prototype.getCategoriesData = function() {
      return this._categoriesData;
    }, t.prototype.formatTooltip = function(e, n, i) {
      if (i === "edge") {
        var a = this.getData(), o = this.getDataParams(e, i), s = a.graph.getEdgeByIndex(e), l = a.getName(s.node1.dataIndex), u = a.getName(s.node2.dataIndex), c = [];
        return l != null && c.push(l), u != null && c.push(u), It("nameValue", {
          name: c.join(" > "),
          value: o.value,
          noValue: o.value == null
        });
      }
      var f = _I({
        series: this,
        dataIndex: e,
        multipleSeries: n
      });
      return f;
    }, t.prototype._updateCategoriesData = function() {
      var e = U(this.option.categories || [], function(i) {
        return i.value != null ? i : H({
          value: 0
        }, i);
      }), n = new er(["value"], this);
      n.initData(e), this._categoriesData = n, this._categoriesModels = n.mapArray(function(i) {
        return n.getItemModel(i);
      });
    }, t.prototype.setZoom = function(e) {
      this.option.zoom = e;
    }, t.prototype.setCenter = function(e) {
      this.option.center = e;
    }, t.prototype.isAnimationEnabled = function() {
      return r.prototype.isAnimationEnabled.call(this) && !(this.get("layout") === "force" && this.get(["force", "layoutAnimation"]));
    }, t.type = "series.graph", t.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "view",
      // Default option for all coordinate systems
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      // polarIndex: 0,
      // geoIndex: 0,
      legendHoverLink: !0,
      layout: null,
      // Configuration of circular layout
      circular: {
        rotateLabel: !1
      },
      // Configuration of force directed layout
      force: {
        initLayout: null,
        // Node repulsion. Can be an array to represent range.
        repulsion: [0, 50],
        gravity: 0.1,
        // Initial friction
        friction: 0.6,
        // Edge length. Can be an array to represent range.
        edgeLength: 30,
        layoutAnimation: !0
      },
      left: "center",
      top: "center",
      // right: null,
      // bottom: null,
      // width: '80%',
      // height: '80%',
      symbol: "circle",
      symbolSize: 10,
      edgeSymbol: ["none", "none"],
      edgeSymbolSize: 10,
      edgeLabel: {
        position: "middle",
        distance: 5
      },
      draggable: !1,
      roam: !1,
      // Default on center of graph
      center: null,
      zoom: 1,
      // Symbol size scale ratio in roam
      nodeScaleRatio: 0.6,
      // cursor: null,
      // categories: [],
      // data: []
      // Or
      // nodes: []
      //
      // links: []
      // Or
      // edges: []
      label: {
        show: !1,
        formatter: "{b}"
      },
      itemStyle: {},
      lineStyle: {
        color: "#aaa",
        width: 1,
        opacity: 0.5
      },
      emphasis: {
        scale: !0,
        label: {
          show: !0
        }
      },
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      }
    }, t;
  }(it)
), oq = {
  type: "graphRoam",
  event: "graphRoam",
  update: "none"
};
function sq(r) {
  r.registerChartView(nq), r.registerSeriesModel(aq), r.registerProcessor(V7), r.registerVisual($7), r.registerVisual(G7), r.registerLayout(Y7), r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT, X7), r.registerLayout(K7), r.registerCoordinateSystem("graphView", {
    dimensions: ac.dimensions,
    create: Q7
  }), r.registerAction({
    type: "focusNodeAdjacency",
    event: "focusNodeAdjacency",
    update: "series:focusNodeAdjacency"
  }, dt), r.registerAction({
    type: "unfocusNodeAdjacency",
    event: "unfocusNodeAdjacency",
    update: "series:unfocusNodeAdjacency"
  }, dt), r.registerAction(oq, function(t, e, n) {
    e.eachComponent({
      mainType: "series",
      query: t
    }, function(i) {
      var a = i.coordinateSystem, o = s_(a, t, void 0, n);
      i.setCenter && i.setCenter(o.center), i.setZoom && i.setZoom(o.zoom);
    });
  });
}
var lq = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.angle = 0, this.width = 10, this.r = 10, this.x = 0, this.y = 0;
    }
    return r;
  }()
), uq = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "pointer", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new lq();
    }, t.prototype.buildPath = function(e, n) {
      var i = Math.cos, a = Math.sin, o = n.r, s = n.width, l = n.angle, u = n.x - i(l) * s * (s >= o / 3 ? 1 : 2), c = n.y - a(l) * s * (s >= o / 3 ? 1 : 2);
      l = n.angle - Math.PI / 2, e.moveTo(u, c), e.lineTo(n.x + i(l) * s, n.y + a(l) * s), e.lineTo(n.x + i(n.angle) * o, n.y + a(n.angle) * o), e.lineTo(n.x - i(l) * s, n.y - a(l) * s), e.lineTo(u, c);
    }, t;
  }(Te)
);
function cq(r, t) {
  var e = r.get("center"), n = t.getWidth(), i = t.getHeight(), a = Math.min(n, i), o = X(e[0], t.getWidth()), s = X(e[1], t.getHeight()), l = X(r.get("radius"), a / 2);
  return {
    cx: o,
    cy: s,
    r: l
  };
}
function nf(r, t) {
  var e = r == null ? "" : r + "";
  return t && (J(t) ? e = t.replace("{value}", e) : oe(t) && (e = t(r))), e;
}
var fq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      this.group.removeAll();
      var a = e.get(["axisLine", "lineStyle", "color"]), o = cq(e, i);
      this._renderMain(e, n, i, a, o), this._data = e.getData();
    }, t.prototype.dispose = function() {
    }, t.prototype._renderMain = function(e, n, i, a, o) {
      var s = this.group, l = e.get("clockwise"), u = -e.get("startAngle") / 180 * Math.PI, c = -e.get("endAngle") / 180 * Math.PI, f = e.getModel("axisLine"), h = f.get("roundCap"), v = h ? Ah : ir, d = f.get("show"), p = f.getModel("lineStyle"), g = p.get("width"), m = [u, c];
      l0(m, !l), u = m[0], c = m[1];
      for (var y = c - u, _ = u, b = [], S = 0; d && S < a.length; S++) {
        var x = Math.min(Math.max(a[S][0], 0), 1);
        c = u + y * x;
        var w = new v({
          shape: {
            startAngle: _,
            endAngle: c,
            cx: o.cx,
            cy: o.cy,
            clockwise: l,
            r0: o.r - g,
            r: o.r
          },
          silent: !0
        });
        w.setStyle({
          fill: a[S][1]
        }), w.setStyle(p.getLineStyle(
          // Because we use sector to simulate arc
          // so the properties for stroking are useless
          ["color", "width"]
        )), b.push(w), _ = c;
      }
      b.reverse(), M(b, function(D) {
        return s.add(D);
      });
      var C = function(D) {
        if (D <= 0)
          return a[0][1];
        var A;
        for (A = 0; A < a.length; A++)
          if (a[A][0] >= D && (A === 0 ? 0 : a[A - 1][0]) < D)
            return a[A][1];
        return a[A - 1][1];
      };
      this._renderTicks(e, n, i, C, o, u, c, l, g), this._renderTitleAndDetail(e, n, i, C, o), this._renderAnchor(e, o), this._renderPointer(e, n, i, C, o, u, c, l, g);
    }, t.prototype._renderTicks = function(e, n, i, a, o, s, l, u, c) {
      for (var f = this.group, h = o.cx, v = o.cy, d = o.r, p = +e.get("min"), g = +e.get("max"), m = e.getModel("splitLine"), y = e.getModel("axisTick"), _ = e.getModel("axisLabel"), b = e.get("splitNumber"), S = y.get("splitNumber"), x = X(m.get("length"), d), w = X(y.get("length"), d), C = s, D = (l - s) / b, A = D / S, T = m.getModel("lineStyle").getLineStyle(), L = y.getModel("lineStyle").getLineStyle(), E = m.get("distance"), I, P, R = 0; R <= b; R++) {
        if (I = Math.cos(C), P = Math.sin(C), m.get("show")) {
          var F = E ? E + c : c, O = new Ct({
            shape: {
              x1: I * (d - F) + h,
              y1: P * (d - F) + v,
              x2: I * (d - x - F) + h,
              y2: P * (d - x - F) + v
            },
            style: T,
            silent: !0
          });
          T.stroke === "auto" && O.setStyle({
            stroke: a(R / b)
          }), f.add(O);
        }
        if (_.get("show")) {
          var F = _.get("distance") + E, z = nf(ht(R / b * (g - p) + p), _.get("formatter")), G = a(R / b), W = I * (d - x - F) + h, Y = P * (d - x - F) + v, j = _.get("rotate"), ee = 0;
          j === "radial" ? (ee = -C + 2 * Math.PI, ee > Math.PI / 2 && (ee += Math.PI)) : j === "tangential" ? ee = -C - Math.PI / 2 : Be(j) && (ee = j * Math.PI / 180), ee === 0 ? f.add(new Fe({
            style: nt(_, {
              text: z,
              x: W,
              y: Y,
              verticalAlign: P < -0.8 ? "top" : P > 0.8 ? "bottom" : "middle",
              align: I < -0.4 ? "left" : I > 0.4 ? "right" : "center"
            }, {
              inheritColor: G
            }),
            silent: !0
          })) : f.add(new Fe({
            style: nt(_, {
              text: z,
              x: W,
              y: Y,
              verticalAlign: "middle",
              align: "center"
            }, {
              inheritColor: G
            }),
            silent: !0,
            originX: W,
            originY: Y,
            rotation: ee
          }));
        }
        if (y.get("show") && R !== b) {
          var F = y.get("distance");
          F = F ? F + c : c;
          for (var ie = 0; ie <= S; ie++) {
            I = Math.cos(C), P = Math.sin(C);
            var Me = new Ct({
              shape: {
                x1: I * (d - F) + h,
                y1: P * (d - F) + v,
                x2: I * (d - w - F) + h,
                y2: P * (d - w - F) + v
              },
              silent: !0,
              style: L
            });
            L.stroke === "auto" && Me.setStyle({
              stroke: a((R + ie / S) / b)
            }), f.add(Me), C += A;
          }
          C -= A;
        } else
          C += D;
      }
    }, t.prototype._renderPointer = function(e, n, i, a, o, s, l, u, c) {
      var f = this.group, h = this._data, v = this._progressEls, d = [], p = e.get(["pointer", "show"]), g = e.getModel("progress"), m = g.get("show"), y = e.getData(), _ = y.mapDimension("value"), b = +e.get("min"), S = +e.get("max"), x = [b, S], w = [s, l];
      function C(A, T) {
        var L = y.getItemModel(A), E = L.getModel("pointer"), I = X(E.get("width"), o.r), P = X(E.get("length"), o.r), R = e.get(["pointer", "icon"]), F = E.get("offsetCenter"), O = X(F[0], o.r), z = X(F[1], o.r), G = E.get("keepAspect"), W;
        return R ? W = yt(R, O - I / 2, z - P, I, P, null, G) : W = new uq({
          shape: {
            angle: -Math.PI / 2,
            width: I,
            r: P,
            x: O,
            y: z
          }
        }), W.rotation = -(T + Math.PI / 2), W.x = o.cx, W.y = o.cy, W;
      }
      function D(A, T) {
        var L = g.get("roundCap"), E = L ? Ah : ir, I = g.get("overlap"), P = I ? g.get("width") : c / y.count(), R = I ? o.r - P : o.r - (A + 1) * P, F = I ? o.r : o.r - A * P, O = new E({
          shape: {
            startAngle: s,
            endAngle: T,
            cx: o.cx,
            cy: o.cy,
            clockwise: u,
            r0: R,
            r: F
          }
        });
        return I && (O.z2 = Ye(y.get(_, A), [b, S], [100, 0], !0)), O;
      }
      (m || p) && (y.diff(h).add(function(A) {
        var T = y.get(_, A);
        if (p) {
          var L = C(A, s);
          st(L, {
            rotation: -((isNaN(+T) ? w[0] : Ye(T, x, w, !0)) + Math.PI / 2)
          }, e), f.add(L), y.setItemGraphicEl(A, L);
        }
        if (m) {
          var E = D(A, s), I = g.get("clip");
          st(E, {
            shape: {
              endAngle: Ye(T, x, w, I)
            }
          }, e), f.add(E), um(e.seriesIndex, y.dataType, A, E), d[A] = E;
        }
      }).update(function(A, T) {
        var L = y.get(_, A);
        if (p) {
          var E = h.getItemGraphicEl(T), I = E ? E.rotation : s, P = C(A, I);
          P.rotation = I, Ne(P, {
            rotation: -((isNaN(+L) ? w[0] : Ye(L, x, w, !0)) + Math.PI / 2)
          }, e), f.add(P), y.setItemGraphicEl(A, P);
        }
        if (m) {
          var R = v[T], F = R ? R.shape.endAngle : s, O = D(A, F), z = g.get("clip");
          Ne(O, {
            shape: {
              endAngle: Ye(L, x, w, z)
            }
          }, e), f.add(O), um(e.seriesIndex, y.dataType, A, O), d[A] = O;
        }
      }).execute(), y.each(function(A) {
        var T = y.getItemModel(A), L = T.getModel("emphasis"), E = L.get("focus"), I = L.get("blurScope"), P = L.get("disabled");
        if (p) {
          var R = y.getItemGraphicEl(A), F = y.getItemVisual(A, "style"), O = F.fill;
          if (R instanceof Pt) {
            var z = R.style;
            R.useStyle(H({
              image: z.image,
              x: z.x,
              y: z.y,
              width: z.width,
              height: z.height
            }, F));
          } else
            R.useStyle(F), R.type !== "pointer" && R.setColor(O);
          R.setStyle(T.getModel(["pointer", "itemStyle"]).getItemStyle()), R.style.fill === "auto" && R.setStyle("fill", a(Ye(y.get(_, A), x, [0, 1], !0))), R.z2EmphasisLift = 0, Ft(R, T), ut(R, E, I, P);
        }
        if (m) {
          var G = d[A];
          G.useStyle(y.getItemVisual(A, "style")), G.setStyle(T.getModel(["progress", "itemStyle"]).getItemStyle()), G.z2EmphasisLift = 0, Ft(G, T), ut(G, E, I, P);
        }
      }), this._progressEls = d);
    }, t.prototype._renderAnchor = function(e, n) {
      var i = e.getModel("anchor"), a = i.get("show");
      if (a) {
        var o = i.get("size"), s = i.get("icon"), l = i.get("offsetCenter"), u = i.get("keepAspect"), c = yt(s, n.cx - o / 2 + X(l[0], n.r), n.cy - o / 2 + X(l[1], n.r), o, o, null, u);
        c.z2 = i.get("showAbove") ? 1 : 0, c.setStyle(i.getModel("itemStyle").getItemStyle()), this.group.add(c);
      }
    }, t.prototype._renderTitleAndDetail = function(e, n, i, a, o) {
      var s = this, l = e.getData(), u = l.mapDimension("value"), c = +e.get("min"), f = +e.get("max"), h = new fe(), v = [], d = [], p = e.isAnimationEnabled(), g = e.get(["pointer", "showAbove"]);
      l.diff(this._data).add(function(m) {
        v[m] = new Fe({
          silent: !0
        }), d[m] = new Fe({
          silent: !0
        });
      }).update(function(m, y) {
        v[m] = s._titleEls[y], d[m] = s._detailEls[y];
      }).execute(), l.each(function(m) {
        var y = l.getItemModel(m), _ = l.get(u, m), b = new fe(), S = a(Ye(_, [c, f], [0, 1], !0)), x = y.getModel("title");
        if (x.get("show")) {
          var w = x.get("offsetCenter"), C = o.cx + X(w[0], o.r), D = o.cy + X(w[1], o.r), A = v[m];
          A.attr({
            z2: g ? 0 : 2,
            style: nt(x, {
              x: C,
              y: D,
              text: l.getName(m),
              align: "center",
              verticalAlign: "middle"
            }, {
              inheritColor: S
            })
          }), b.add(A);
        }
        var T = y.getModel("detail");
        if (T.get("show")) {
          var L = T.get("offsetCenter"), E = o.cx + X(L[0], o.r), I = o.cy + X(L[1], o.r), P = X(T.get("width"), o.r), R = X(T.get("height"), o.r), F = e.get(["progress", "show"]) ? l.getItemVisual(m, "style").fill : S, A = d[m], O = T.get("formatter");
          A.attr({
            z2: g ? 0 : 2,
            style: nt(T, {
              x: E,
              y: I,
              text: nf(_, O),
              width: isNaN(P) ? null : P,
              height: isNaN(R) ? null : R,
              align: "center",
              verticalAlign: "middle"
            }, {
              inheritColor: F
            })
          }), wM(A, {
            normal: T
          }, _, function(G) {
            return nf(G, O);
          }), p && CM(A, m, l, e, {
            getFormattedLabel: function(G, W, Y, j, ee, ie) {
              return nf(ie ? ie.interpolatedValue : _, O);
            }
          }), b.add(A);
        }
        h.add(b);
      }), this.group.add(h), this._titleEls = v, this._detailEls = d;
    }, t.type = "gauge", t;
  }(Qe)
), hq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.visualStyleAccessPath = "itemStyle", e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return Hs(this, ["value"]);
    }, t.type = "series.gauge", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      colorBy: "data",
      // 默认全局居中
      center: ["50%", "50%"],
      legendHoverLink: !0,
      radius: "75%",
      startAngle: 225,
      endAngle: -45,
      clockwise: !0,
      // 最小值
      min: 0,
      // 最大值
      max: 100,
      // 分割段数，默认为10
      splitNumber: 10,
      // 坐标轴线
      axisLine: {
        // 默认显示，属性show控制显示与否
        show: !0,
        roundCap: !1,
        lineStyle: {
          color: [[1, "#E6EBF8"]],
          width: 10
        }
      },
      // 坐标轴线
      progress: {
        // 默认显示，属性show控制显示与否
        show: !1,
        overlap: !0,
        width: 10,
        roundCap: !1,
        clip: !0
      },
      // 分隔线
      splitLine: {
        // 默认显示，属性show控制显示与否
        show: !0,
        // 属性length控制线长
        length: 10,
        distance: 10,
        // 属性lineStyle（详见lineStyle）控制线条样式
        lineStyle: {
          color: "#63677A",
          width: 3,
          type: "solid"
        }
      },
      // 坐标轴小标记
      axisTick: {
        // 属性show控制显示与否，默认不显示
        show: !0,
        // 每份split细分多少段
        splitNumber: 5,
        // 属性length控制线长
        length: 6,
        distance: 10,
        // 属性lineStyle控制线条样式
        lineStyle: {
          color: "#63677A",
          width: 1,
          type: "solid"
        }
      },
      axisLabel: {
        show: !0,
        distance: 15,
        // formatter: null,
        color: "#464646",
        fontSize: 12,
        rotate: 0
      },
      pointer: {
        icon: null,
        offsetCenter: [0, 0],
        show: !0,
        showAbove: !0,
        length: "60%",
        width: 6,
        keepAspect: !1
      },
      anchor: {
        show: !1,
        showAbove: !1,
        size: 6,
        icon: "circle",
        offsetCenter: [0, 0],
        keepAspect: !1,
        itemStyle: {
          color: "#fff",
          borderWidth: 0,
          borderColor: "#5470c6"
        }
      },
      title: {
        show: !0,
        // x, y，单位px
        offsetCenter: [0, "20%"],
        // 其余属性默认使用全局文本样式，详见TEXTSTYLE
        color: "#464646",
        fontSize: 16,
        valueAnimation: !1
      },
      detail: {
        show: !0,
        backgroundColor: "rgba(0,0,0,0)",
        borderWidth: 0,
        borderColor: "#ccc",
        width: 100,
        height: null,
        padding: [5, 10],
        // x, y，单位px
        offsetCenter: [0, "40%"],
        // formatter: null,
        // 其余属性默认使用全局文本样式，详见TEXTSTYLE
        color: "#464646",
        fontSize: 30,
        fontWeight: "bold",
        lineHeight: 30,
        valueAnimation: !1
      }
    }, t;
  }(it)
);
function vq(r) {
  r.registerChartView(fq), r.registerSeriesModel(hq);
}
var dq = ["itemStyle", "opacity"], pq = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n) {
      var i = r.call(this) || this, a = i, o = new sr(), s = new Fe();
      return a.setTextContent(s), i.setTextGuideLine(o), i.updateData(e, n, !0), i;
    }
    return t.prototype.updateData = function(e, n, i) {
      var a = this, o = e.hostModel, s = e.getItemModel(n), l = e.getItemLayout(n), u = s.getModel("emphasis"), c = s.get(dq);
      c = c ?? 1, i || un(a), a.useStyle(e.getItemVisual(n, "style")), a.style.lineJoin = "round", i ? (a.setShape({
        points: l.points
      }), a.style.opacity = 0, st(a, {
        style: {
          opacity: c
        }
      }, o, n)) : Ne(a, {
        style: {
          opacity: c
        },
        shape: {
          points: l.points
        }
      }, o, n), Ft(a, s), this._updateLabel(e, n), ut(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(e, n) {
      var i = this, a = this.getTextGuideLine(), o = i.getTextContent(), s = e.hostModel, l = e.getItemModel(n), u = e.getItemLayout(n), c = u.label, f = e.getItemVisual(n, "style"), h = f.fill;
      Bt(
        // position will not be used in setLabelStyle
        o,
        Mt(l),
        {
          labelFetcher: e.hostModel,
          labelDataIndex: n,
          defaultOpacity: f.opacity,
          defaultText: e.getName(n)
        },
        {
          normal: {
            align: c.textAlign,
            verticalAlign: c.verticalAlign
          }
        }
      ), i.setTextConfig({
        local: !0,
        inside: !!c.inside,
        insideStroke: h,
        // insideFill: 'auto',
        outsideFill: h
      });
      var v = c.linePoints;
      a.setShape({
        points: v
      }), i.textGuideLineConfig = {
        anchor: v ? new Se(v[0][0], v[0][1]) : null
      }, Ne(o, {
        style: {
          x: c.x,
          y: c.y
        }
      }, s, n), o.attr({
        rotation: c.rotation,
        originX: c.x,
        originY: c.y,
        z2: 10
      }), Y0(i, Z0(l), {
        // Default use item visual color
        stroke: h
      });
    }, t;
  }(ar)
), gq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.ignoreLabelLineUpdate = !0, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this._data, s = this.group;
      a.diff(o).add(function(l) {
        var u = new pq(a, l);
        a.setItemGraphicEl(l, u), s.add(u);
      }).update(function(l, u) {
        var c = o.getItemGraphicEl(u);
        c.updateData(a, l), s.add(c), a.setItemGraphicEl(l, c);
      }).remove(function(l) {
        var u = o.getItemGraphicEl(l);
        yu(u, e, l);
      }).execute(), this._data = a;
    }, t.prototype.remove = function() {
      this.group.removeAll(), this._data = null;
    }, t.prototype.dispose = function() {
    }, t.type = "funnel", t;
  }(Qe)
), mq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e) {
      r.prototype.init.apply(this, arguments), this.legendVisualProvider = new nc(Q(this.getData, this), Q(this.getRawData, this)), this._defaultLabelLine(e);
    }, t.prototype.getInitialData = function(e, n) {
      return Hs(this, {
        coordDimensions: ["value"],
        encodeDefaulter: ye(A0, this)
      });
    }, t.prototype._defaultLabelLine = function(e) {
      ho(e, "labelLine", ["show"]);
      var n = e.labelLine, i = e.emphasis.labelLine;
      n.show = n.show && e.label.show, i.show = i.show && e.emphasis.label.show;
    }, t.prototype.getDataParams = function(e) {
      var n = this.getData(), i = r.prototype.getDataParams.call(this, e), a = n.mapDimension("value"), o = n.getSum(a);
      return i.percent = o ? +(n.get(a, e) / o * 100).toFixed(2) : 0, i.$vars.push("percent"), i;
    }, t.type = "series.funnel", t.defaultOption = {
      // zlevel: 0,                  // 一级层叠
      z: 2,
      legendHoverLink: !0,
      colorBy: "data",
      left: 80,
      top: 60,
      right: 80,
      bottom: 60,
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      // 默认取数据最小最大值
      // min: 0,
      // max: 100,
      minSize: "0%",
      maxSize: "100%",
      sort: "descending",
      orient: "vertical",
      gap: 0,
      funnelAlign: "center",
      label: {
        show: !0,
        position: "outer"
        // formatter: 标签文本格式器，同Tooltip.formatter，不支持异步回调
      },
      labelLine: {
        show: !0,
        length: 20,
        lineStyle: {
          // color: 各异,
          width: 1
        }
      },
      itemStyle: {
        // color: 各异,
        borderColor: "#fff",
        borderWidth: 1
      },
      emphasis: {
        label: {
          show: !0
        }
      },
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      }
    }, t;
  }(it)
);
function yq(r, t) {
  return St(r.getBoxLayoutParams(), {
    width: t.getWidth(),
    height: t.getHeight()
  });
}
function _q(r, t) {
  for (var e = r.mapDimension("value"), n = r.mapArray(e, function(l) {
    return l;
  }), i = [], a = t === "ascending", o = 0, s = r.count(); o < s; o++)
    i[o] = o;
  return oe(t) ? i.sort(t) : t !== "none" && i.sort(function(l, u) {
    return a ? n[l] - n[u] : n[u] - n[l];
  }), i;
}
function bq(r) {
  var t = r.hostModel, e = t.get("orient");
  r.each(function(n) {
    var i = r.getItemModel(n), a = i.getModel("label"), o = a.get("position"), s = i.getModel("labelLine"), l = r.getItemLayout(n), u = l.points, c = o === "inner" || o === "inside" || o === "center" || o === "insideLeft" || o === "insideRight", f, h, v, d;
    if (c)
      o === "insideLeft" ? (h = (u[0][0] + u[3][0]) / 2 + 5, v = (u[0][1] + u[3][1]) / 2, f = "left") : o === "insideRight" ? (h = (u[1][0] + u[2][0]) / 2 - 5, v = (u[1][1] + u[2][1]) / 2, f = "right") : (h = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4, v = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4, f = "center"), d = [[h, v], [h, v]];
    else {
      var p = void 0, g = void 0, m = void 0, y = void 0, _ = s.get("length");
      o === "left" ? (p = (u[3][0] + u[0][0]) / 2, g = (u[3][1] + u[0][1]) / 2, m = p - _, h = m - 5, f = "right") : o === "right" ? (p = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, m = p + _, h = m + 5, f = "left") : o === "top" ? (p = (u[3][0] + u[0][0]) / 2, g = (u[3][1] + u[0][1]) / 2, y = g - _, v = y - 5, f = "center") : o === "bottom" ? (p = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, y = g + _, v = y + 5, f = "center") : o === "rightTop" ? (p = e === "horizontal" ? u[3][0] : u[1][0], g = e === "horizontal" ? u[3][1] : u[1][1], e === "horizontal" ? (y = g - _, v = y - 5, f = "center") : (m = p + _, h = m + 5, f = "top")) : o === "rightBottom" ? (p = u[2][0], g = u[2][1], e === "horizontal" ? (y = g + _, v = y + 5, f = "center") : (m = p + _, h = m + 5, f = "bottom")) : o === "leftTop" ? (p = u[0][0], g = e === "horizontal" ? u[0][1] : u[1][1], e === "horizontal" ? (y = g - _, v = y - 5, f = "center") : (m = p - _, h = m - 5, f = "right")) : o === "leftBottom" ? (p = e === "horizontal" ? u[1][0] : u[3][0], g = e === "horizontal" ? u[1][1] : u[2][1], e === "horizontal" ? (y = g + _, v = y + 5, f = "center") : (m = p - _, h = m - 5, f = "right")) : (p = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, e === "horizontal" ? (y = g + _, v = y + 5, f = "center") : (m = p + _, h = m + 5, f = "left")), e === "horizontal" ? (m = p, h = m) : (y = g, v = y), d = [[p, g], [m, y]];
    }
    l.label = {
      linePoints: d,
      x: h,
      y: v,
      verticalAlign: "middle",
      textAlign: f,
      inside: c
    };
  });
}
function Sq(r, t) {
  r.eachSeriesByType("funnel", function(e) {
    var n = e.getData(), i = n.mapDimension("value"), a = e.get("sort"), o = yq(e, t), s = e.get("orient"), l = o.width, u = o.height, c = _q(n, a), f = o.x, h = o.y, v = s === "horizontal" ? [X(e.get("minSize"), u), X(e.get("maxSize"), u)] : [X(e.get("minSize"), l), X(e.get("maxSize"), l)], d = n.getDataExtent(i), p = e.get("min"), g = e.get("max");
    p == null && (p = Math.min(d[0], 0)), g == null && (g = d[1]);
    var m = e.get("funnelAlign"), y = e.get("gap"), _ = s === "horizontal" ? l : u, b = (_ - y * (n.count() - 1)) / n.count(), S = function(I, P) {
      if (s === "horizontal") {
        var R = n.get(i, I) || 0, F = Ye(R, [p, g], v, !0), O = void 0;
        switch (m) {
          case "top":
            O = h;
            break;
          case "center":
            O = h + (u - F) / 2;
            break;
          case "bottom":
            O = h + (u - F);
            break;
        }
        return [[P, O], [P, O + F]];
      }
      var z = n.get(i, I) || 0, G = Ye(z, [p, g], v, !0), W;
      switch (m) {
        case "left":
          W = f;
          break;
        case "center":
          W = f + (l - G) / 2;
          break;
        case "right":
          W = f + l - G;
          break;
      }
      return [[W, P], [W + G, P]];
    };
    a === "ascending" && (b = -b, y = -y, s === "horizontal" ? f += l : h += u, c = c.reverse());
    for (var x = 0; x < c.length; x++) {
      var w = c[x], C = c[x + 1], D = n.getItemModel(w);
      if (s === "horizontal") {
        var A = D.get(["itemStyle", "width"]);
        A == null ? A = b : (A = X(A, l), a === "ascending" && (A = -A));
        var T = S(w, f), L = S(C, f + A);
        f += A + y, n.setItemLayout(w, {
          points: T.concat(L.slice().reverse())
        });
      } else {
        var E = D.get(["itemStyle", "height"]);
        E == null ? E = b : (E = X(E, u), a === "ascending" && (E = -E));
        var T = S(w, h), L = S(C, h + E);
        h += E + y, n.setItemLayout(w, {
          points: T.concat(L.slice().reverse())
        });
      }
    }
    bq(n);
  });
}
function xq(r) {
  r.registerChartView(gq), r.registerSeriesModel(mq), r.registerLayout(Sq), r.registerProcessor(rc("funnel"));
}
var wq = 0.3, Cq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._dataGroup = new fe(), e._initialized = !1, e;
    }
    return t.prototype.init = function() {
      this.group.add(this._dataGroup);
    }, t.prototype.render = function(e, n, i, a) {
      this._progressiveEls = null;
      var o = this._dataGroup, s = e.getData(), l = this._data, u = e.coordinateSystem, c = u.dimensions, f = Pw(e);
      s.diff(l).add(h).update(v).remove(d).execute();
      function h(g) {
        var m = Ew(s, o, g, c, u);
        Vp(m, s, g, f);
      }
      function v(g, m) {
        var y = l.getItemGraphicEl(m), _ = jE(s, g, c, u);
        s.setItemGraphicEl(g, y), Ne(y, {
          shape: {
            points: _
          }
        }, e, g), un(y), Vp(y, s, g, f);
      }
      function d(g) {
        var m = l.getItemGraphicEl(g);
        o.remove(m);
      }
      if (!this._initialized) {
        this._initialized = !0;
        var p = Aq(u, e, function() {
          setTimeout(function() {
            o.removeClipPath();
          });
        });
        o.setClipPath(p);
      }
      this._data = s;
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      this._initialized = !0, this._data = null, this._dataGroup.removeAll();
    }, t.prototype.incrementalRender = function(e, n, i) {
      for (var a = n.getData(), o = n.coordinateSystem, s = o.dimensions, l = Pw(n), u = this._progressiveEls = [], c = e.start; c < e.end; c++) {
        var f = Ew(a, this._dataGroup, c, s, o);
        f.incremental = !0, Vp(f, a, c, l), u.push(f);
      }
    }, t.prototype.remove = function() {
      this._dataGroup && this._dataGroup.removeAll(), this._data = null;
    }, t.type = "parallel", t;
  }(Qe)
);
function Aq(r, t, e) {
  var n = r.model, i = r.getRect(), a = new ke({
    shape: {
      x: i.x,
      y: i.y,
      width: i.width,
      height: i.height
    }
  }), o = n.get("layout") === "horizontal" ? "width" : "height";
  return a.setShape(o, 0), st(a, {
    shape: {
      width: i.width,
      height: i.height
    }
  }, t, e), a;
}
function jE(r, t, e, n) {
  for (var i = [], a = 0; a < e.length; a++) {
    var o = e[a], s = r.get(r.mapDimension(o), t);
    Dq(s, n.getAxis(o).type) || i.push(n.dataToPoint(s, o));
  }
  return i;
}
function Ew(r, t, e, n, i) {
  var a = jE(r, e, n, i), o = new sr({
    shape: {
      points: a
    },
    // silent: true,
    z2: 10
  });
  return t.add(o), r.setItemGraphicEl(e, o), o;
}
function Pw(r) {
  var t = r.get("smooth", !0);
  return t === !0 && (t = wq), t = ai(t), uu(t) && (t = 0), {
    smooth: t
  };
}
function Vp(r, t, e, n) {
  r.useStyle(t.getItemVisual(e, "style")), r.style.fill = null, r.setShape("smooth", n.smooth);
  var i = t.getItemModel(e), a = i.getModel("emphasis");
  Ft(r, i, "lineStyle"), ut(r, a.get("focus"), a.get("blurScope"), a.get("disabled"));
}
function Dq(r, t) {
  return t === "category" ? r == null : r == null || isNaN(r);
}
var Tq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.visualStyleAccessPath = "lineStyle", e.visualDrawType = "stroke", e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return gi(null, this, {
        useEncodeDefaulter: Q(Mq, null, this)
      });
    }, t.prototype.getRawIndicesByActiveState = function(e) {
      var n = this.coordinateSystem, i = this.getData(), a = [];
      return n.eachActiveState(i, function(o, s) {
        e === o && a.push(i.getRawIndex(s));
      }), a;
    }, t.type = "series.parallel", t.dependencies = ["parallel"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "parallel",
      parallelIndex: 0,
      label: {
        show: !1
      },
      inactiveOpacity: 0.05,
      activeOpacity: 1,
      lineStyle: {
        width: 1,
        opacity: 0.45,
        type: "solid"
      },
      emphasis: {
        label: {
          show: !1
        }
      },
      progressive: 500,
      smooth: !1,
      animationEasing: "linear"
    }, t;
  }(it)
);
function Mq(r) {
  var t = r.ecModel.getComponent("parallel", r.get("parallelIndex"));
  if (t) {
    var e = {};
    return M(t.dimensions, function(n) {
      var i = Iq(n);
      e[n] = i;
    }), e;
  }
}
function Iq(r) {
  return +r.replace("dim", "");
}
var Lq = ["lineStyle", "opacity"], Eq = {
  seriesType: "parallel",
  reset: function(r, t) {
    var e = r.coordinateSystem, n = {
      normal: r.get(["lineStyle", "opacity"]),
      active: r.get("activeOpacity"),
      inactive: r.get("inactiveOpacity")
    };
    return {
      progress: function(i, a) {
        e.eachActiveState(a, function(o, s) {
          var l = n[o];
          if (o === "normal" && a.hasItemOption) {
            var u = a.getItemModel(s).get(Lq, !0);
            u != null && (l = u);
          }
          var c = a.ensureUniqueItemVisual(s, "style");
          c.opacity = l;
        }, i.start, i.end);
      }
    };
  }
};
function Pq(r) {
  kq(r), Rq(r);
}
function kq(r) {
  if (!r.parallel) {
    var t = !1;
    M(r.series, function(e) {
      e && e.type === "parallel" && (t = !0);
    }), t && (r.parallel = [{}]);
  }
}
function Rq(r) {
  var t = je(r.parallelAxis);
  M(t, function(e) {
    if (ue(e)) {
      var n = e.parallelIndex || 0, i = je(r.parallel)[n];
      i && i.parallelAxisDefault && _e(e, i.parallelAxisDefault, !1);
    }
  });
}
var Oq = 5, Fq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      this._model = e, this._api = i, this._handlers || (this._handlers = {}, M(Bq, function(a, o) {
        i.getZr().on(o, this._handlers[o] = Q(a, this));
      }, this)), Vs(this, "_throttledDispatchExpand", e.get("axisExpandRate"), "fixRate");
    }, t.prototype.dispose = function(e, n) {
      xu(this, "_throttledDispatchExpand"), M(this._handlers, function(i, a) {
        n.getZr().off(a, i);
      }), this._handlers = null;
    }, t.prototype._throttledDispatchExpand = function(e) {
      this._dispatchExpand(e);
    }, t.prototype._dispatchExpand = function(e) {
      e && this._api.dispatchAction(H({
        type: "parallelAxisExpand"
      }, e));
    }, t.type = "parallel", t;
  }(lt)
), Bq = {
  mousedown: function(r) {
    $p(this, "click") && (this._mouseDownPoint = [r.offsetX, r.offsetY]);
  },
  mouseup: function(r) {
    var t = this._mouseDownPoint;
    if ($p(this, "click") && t) {
      var e = [r.offsetX, r.offsetY], n = Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2);
      if (n > Oq)
        return;
      var i = this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX, r.offsetY]);
      i.behavior !== "none" && this._dispatchExpand({
        axisExpandWindow: i.axisExpandWindow
      });
    }
    this._mouseDownPoint = null;
  },
  mousemove: function(r) {
    if (!(this._mouseDownPoint || !$p(this, "mousemove"))) {
      var t = this._model, e = t.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX, r.offsetY]), n = e.behavior;
      n === "jump" && this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")), this._throttledDispatchExpand(n === "none" ? null : {
        axisExpandWindow: e.axisExpandWindow,
        // Jumping uses animation, and sliding suppresses animation.
        animation: n === "jump" ? null : {
          duration: 0
          // Disable animation.
        }
      });
    }
  }
};
function $p(r, t) {
  var e = r._model;
  return e.get("axisExpandable") && e.get("axisExpandTriggerOn") === t;
}
var Nq = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function() {
      r.prototype.init.apply(this, arguments), this.mergeOption({});
    }, t.prototype.mergeOption = function(e) {
      var n = this.option;
      e && _e(n, e, !0), this._initDimensions();
    }, t.prototype.contains = function(e, n) {
      var i = e.get("parallelIndex");
      return i != null && n.getComponent("parallel", i) === this;
    }, t.prototype.setAxisExpand = function(e) {
      M(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(n) {
        e.hasOwnProperty(n) && (this.option[n] = e[n]);
      }, this);
    }, t.prototype._initDimensions = function() {
      var e = this.dimensions = [], n = this.parallelAxisIndex = [], i = qe(this.ecModel.queryComponents({
        mainType: "parallelAxis"
      }), function(a) {
        return (a.get("parallelIndex") || 0) === this.componentIndex;
      }, this);
      M(i, function(a) {
        e.push("dim" + a.get("dim")), n.push(a.componentIndex);
      });
    }, t.type = "parallel", t.dependencies = ["parallelAxis"], t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      z: 0,
      left: 80,
      top: 60,
      right: 80,
      bottom: 60,
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      layout: "horizontal",
      // FIXME
      // naming?
      axisExpandable: !1,
      axisExpandCenter: null,
      axisExpandCount: 0,
      axisExpandWidth: 50,
      axisExpandRate: 17,
      axisExpandDebounce: 50,
      // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.
      // Do not doc to user until necessary.
      axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],
      axisExpandTriggerOn: "click",
      parallelAxisDefault: null
    }, t;
  }(Le)
), zq = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a, o) {
      var s = r.call(this, e, n, i) || this;
      return s.type = a || "value", s.axisIndex = o, s;
    }
    return t.prototype.isHorizontal = function() {
      return this.coordinateSystem.getModel().get("layout") !== "horizontal";
    }, t;
  }(hn)
);
function Mo(r, t, e, n, i, a) {
  r = r || 0;
  var o = e[1] - e[0];
  if (i != null && (i = Zo(i, [0, o])), a != null && (a = Math.max(a, i ?? 0)), n === "all") {
    var s = Math.abs(t[1] - t[0]);
    s = Zo(s, [0, o]), i = a = Zo(s, [i, a]), n = 0;
  }
  t[0] = Zo(t[0], e), t[1] = Zo(t[1], e);
  var l = Gp(t, n);
  t[n] += r;
  var u = i || 0, c = e.slice();
  l.sign < 0 ? c[0] += u : c[1] -= u, t[n] = Zo(t[n], c);
  var f;
  return f = Gp(t, n), i != null && (f.sign !== l.sign || f.span < i) && (t[1 - n] = t[n] + l.sign * i), f = Gp(t, n), a != null && f.span > a && (t[1 - n] = t[n] + f.sign * a), t;
}
function Gp(r, t) {
  var e = r[t] - r[1 - t];
  return {
    span: Math.abs(e),
    sign: e > 0 ? -1 : e < 0 ? 1 : t ? -1 : 1
  };
}
function Zo(r, t) {
  return Math.min(t[1] != null ? t[1] : 1 / 0, Math.max(t[0] != null ? t[0] : -1 / 0, r));
}
var Hp = M, KE = Math.min, JE = Math.max, kw = Math.floor, Vq = Math.ceil, Rw = ht, $q = Math.PI, Gq = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.type = "parallel", this._axesMap = re(), this._axesLayout = {}, this.dimensions = t.dimensions, this._model = t, this._init(t, e, n);
    }
    return r.prototype._init = function(t, e, n) {
      var i = t.dimensions, a = t.parallelAxisIndex;
      Hp(i, function(o, s) {
        var l = a[s], u = e.getComponent("parallelAxis", l), c = this._axesMap.set(o, new zq(o, Ev(u), [0, 0], u.get("type"), l)), f = c.type === "category";
        c.onBand = f && u.get("boundaryGap"), c.inverse = u.get("inverse"), u.axis = c, c.model = u, c.coordinateSystem = u.coordinateSystem = this;
      }, this);
    }, r.prototype.update = function(t, e) {
      this._updateAxesFromSeries(this._model, t);
    }, r.prototype.containPoint = function(t) {
      var e = this._makeLayoutInfo(), n = e.axisBase, i = e.layoutBase, a = e.pixelDimIndex, o = t[1 - a], s = t[a];
      return o >= n && o <= n + e.axisLength && s >= i && s <= i + e.layoutLength;
    }, r.prototype.getModel = function() {
      return this._model;
    }, r.prototype._updateAxesFromSeries = function(t, e) {
      e.eachSeries(function(n) {
        if (t.contains(n, e)) {
          var i = n.getData();
          Hp(this.dimensions, function(a) {
            var o = this._axesMap.get(a);
            o.scale.unionExtentFromData(i, i.mapDimension(a)), Ss(o.scale, o.model);
          }, this);
        }
      }, this);
    }, r.prototype.resize = function(t, e) {
      this._rect = St(t.getBoxLayoutParams(), {
        width: e.getWidth(),
        height: e.getHeight()
      }), this._layoutAxes();
    }, r.prototype.getRect = function() {
      return this._rect;
    }, r.prototype._makeLayoutInfo = function() {
      var t = this._model, e = this._rect, n = ["x", "y"], i = ["width", "height"], a = t.get("layout"), o = a === "horizontal" ? 0 : 1, s = e[i[o]], l = [0, s], u = this.dimensions.length, c = af(t.get("axisExpandWidth"), l), f = af(t.get("axisExpandCount") || 0, [0, u]), h = t.get("axisExpandable") && u > 3 && u > f && f > 1 && c > 0 && s > 0, v = t.get("axisExpandWindow"), d;
      if (v)
        d = af(v[1] - v[0], l), v[1] = v[0] + d;
      else {
        d = af(c * (f - 1), l);
        var p = t.get("axisExpandCenter") || kw(u / 2);
        v = [c * p - d / 2], v[1] = v[0] + d;
      }
      var g = (s - d) / (u - f);
      g < 3 && (g = 0);
      var m = [kw(Rw(v[0] / c, 1)) + 1, Vq(Rw(v[1] / c, 1)) - 1], y = g / c * v[0];
      return {
        layout: a,
        pixelDimIndex: o,
        layoutBase: e[n[o]],
        layoutLength: s,
        axisBase: e[n[1 - o]],
        axisLength: e[i[1 - o]],
        axisExpandable: h,
        axisExpandWidth: c,
        axisCollapseWidth: g,
        axisExpandWindow: v,
        axisCount: u,
        winInnerIndices: m,
        axisExpandWindow0Pos: y
      };
    }, r.prototype._layoutAxes = function() {
      var t = this._rect, e = this._axesMap, n = this.dimensions, i = this._makeLayoutInfo(), a = i.layout;
      e.each(function(o) {
        var s = [0, i.axisLength], l = o.inverse ? 1 : 0;
        o.setExtent(s[l], s[1 - l]);
      }), Hp(n, function(o, s) {
        var l = (i.axisExpandable ? qq : Hq)(s, i), u = {
          horizontal: {
            x: l.position,
            y: i.axisLength
          },
          vertical: {
            x: 0,
            y: l.position
          }
        }, c = {
          horizontal: $q / 2,
          vertical: 0
        }, f = [u[a].x + t.x, u[a].y + t.y], h = c[a], v = Cr();
        So(v, v, h), Rn(v, v, f), this._axesLayout[o] = {
          position: f,
          rotation: h,
          transform: v,
          axisNameAvailableWidth: l.axisNameAvailableWidth,
          axisLabelShow: l.axisLabelShow,
          nameTruncateMaxWidth: l.nameTruncateMaxWidth,
          tickDirection: 1,
          labelDirection: 1
        };
      }, this);
    }, r.prototype.getAxis = function(t) {
      return this._axesMap.get(t);
    }, r.prototype.dataToPoint = function(t, e) {
      return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t), e);
    }, r.prototype.eachActiveState = function(t, e, n, i) {
      n == null && (n = 0), i == null && (i = t.count());
      var a = this._axesMap, o = this.dimensions, s = [], l = [];
      M(o, function(g) {
        s.push(t.mapDimension(g)), l.push(a.get(g).model);
      });
      for (var u = this.hasAxisBrushed(), c = n; c < i; c++) {
        var f = void 0;
        if (!u)
          f = "normal";
        else {
          f = "active";
          for (var h = t.getValues(s, c), v = 0, d = o.length; v < d; v++) {
            var p = l[v].getActiveState(h[v]);
            if (p === "inactive") {
              f = "inactive";
              break;
            }
          }
        }
        e(f, c);
      }
    }, r.prototype.hasAxisBrushed = function() {
      for (var t = this.dimensions, e = this._axesMap, n = !1, i = 0, a = t.length; i < a; i++)
        e.get(t[i]).model.getActiveState() !== "normal" && (n = !0);
      return n;
    }, r.prototype.axisCoordToPoint = function(t, e) {
      var n = this._axesLayout[e];
      return an([t, 0], n.transform);
    }, r.prototype.getAxisLayout = function(t) {
      return ce(this._axesLayout[t]);
    }, r.prototype.getSlidedAxisExpandWindow = function(t) {
      var e = this._makeLayoutInfo(), n = e.pixelDimIndex, i = e.axisExpandWindow.slice(), a = i[1] - i[0], o = [0, e.axisExpandWidth * (e.axisCount - 1)];
      if (!this.containPoint(t))
        return {
          behavior: "none",
          axisExpandWindow: i
        };
      var s = t[n] - e.layoutBase - e.axisExpandWindow0Pos, l, u = "slide", c = e.axisCollapseWidth, f = this._model.get("axisExpandSlideTriggerArea"), h = f[0] != null;
      if (c)
        h && c && s < a * f[0] ? (u = "jump", l = s - a * f[2]) : h && c && s > a * (1 - f[0]) ? (u = "jump", l = s - a * (1 - f[2])) : (l = s - a * f[1]) >= 0 && (l = s - a * (1 - f[1])) <= 0 && (l = 0), l *= e.axisExpandWidth / c, l ? Mo(l, i, o, "all") : u = "none";
      else {
        var v = i[1] - i[0], d = o[1] * s / v;
        i = [JE(0, d - v / 2)], i[1] = KE(o[1], i[0] + v), i[0] = i[1] - v;
      }
      return {
        axisExpandWindow: i,
        behavior: u
      };
    }, r;
  }()
);
function af(r, t) {
  return KE(JE(r, t[0]), t[1]);
}
function Hq(r, t) {
  var e = t.layoutLength / (t.axisCount - 1);
  return {
    position: e * r,
    axisNameAvailableWidth: e,
    axisLabelShow: !0
  };
}
function qq(r, t) {
  var e = t.layoutLength, n = t.axisExpandWidth, i = t.axisCount, a = t.axisCollapseWidth, o = t.winInnerIndices, s, l = a, u = !1, c;
  return r < o[0] ? (s = r * a, c = a) : r <= o[1] ? (s = t.axisExpandWindow0Pos + r * n - t.axisExpandWindow[0], l = n, u = !0) : (s = e - (i - 1 - r) * a, c = a), {
    position: s,
    axisNameAvailableWidth: l,
    axisLabelShow: u,
    nameTruncateMaxWidth: c
  };
}
function Wq(r, t) {
  var e = [];
  return r.eachComponent("parallel", function(n, i) {
    var a = new Gq(n, r, t);
    a.name = "parallel_" + i, a.resize(n, t), n.coordinateSystem = a, a.model = n, e.push(a);
  }), r.eachSeries(function(n) {
    if (n.get("coordinateSystem") === "parallel") {
      var i = n.getReferringComponents("parallel", mt).models[0];
      n.coordinateSystem = i.coordinateSystem;
    }
  }), e;
}
var Uq = {
  create: Wq
}, Qm = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.activeIntervals = [], e;
    }
    return t.prototype.getAreaSelectStyle = function() {
      return po([
        ["fill", "color"],
        ["lineWidth", "borderWidth"],
        ["stroke", "borderColor"],
        ["width", "width"],
        ["opacity", "opacity"]
        // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
        // So do not transfer decal directly.
      ])(this.getModel("areaSelectStyle"));
    }, t.prototype.setActiveIntervals = function(e) {
      var n = this.activeIntervals = ce(e);
      if (n)
        for (var i = n.length - 1; i >= 0; i--)
          Gr(n[i]);
    }, t.prototype.getActiveState = function(e) {
      var n = this.activeIntervals;
      if (!n.length)
        return "normal";
      if (e == null || isNaN(+e))
        return "inactive";
      if (n.length === 1) {
        var i = n[0];
        if (i[0] <= e && e <= i[1])
          return "active";
      } else
        for (var a = 0, o = n.length; a < o; a++)
          if (n[a][0] <= e && e <= n[a][1])
            return "active";
      return "inactive";
    }, t;
  }(Le)
);
_t(Qm, Ku);
var yo = !0, Ru = Math.min, Cs = Math.max, Yq = Math.pow, Zq = 1e4, Xq = 6, jq = 6, Ow = "globalPan", Kq = {
  w: [0, 0],
  e: [0, 1],
  n: [1, 0],
  s: [1, 1]
}, Jq = {
  w: "ew",
  e: "ew",
  n: "ns",
  s: "ns",
  ne: "nesw",
  sw: "nesw",
  nw: "nwse",
  se: "nwse"
}, Fw = {
  brushStyle: {
    lineWidth: 2,
    stroke: "rgba(210,219,238,0.3)",
    fill: "#D2DBEE"
  },
  transformable: !0,
  brushMode: "single",
  removeOnClick: !1
}, Qq = 0, m_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this) || this;
      return n._track = [], n._covers = [], n._handlers = {}, n._zr = e, n.group = new fe(), n._uid = "brushController_" + Qq++, M(oW, function(i, a) {
        this._handlers[a] = Q(i, this);
      }, n), n;
    }
    return t.prototype.enableBrush = function(e) {
      return this._brushType && this._doDisableBrush(), e.brushType && this._doEnableBrush(e), this;
    }, t.prototype._doEnableBrush = function(e) {
      var n = this._zr;
      this._enableGlobalPan || HH(n, Ow, this._uid), M(this._handlers, function(i, a) {
        n.on(a, i);
      }), this._brushType = e.brushType, this._brushOption = _e(ce(Fw), e, !0);
    }, t.prototype._doDisableBrush = function() {
      var e = this._zr;
      qH(e, Ow, this._uid), M(this._handlers, function(n, i) {
        e.off(i, n);
      }), this._brushType = this._brushOption = null;
    }, t.prototype.setPanels = function(e) {
      if (e && e.length) {
        var n = this._panels = {};
        M(e, function(i) {
          n[i.panelId] = ce(i);
        });
      } else
        this._panels = null;
      return this;
    }, t.prototype.mount = function(e) {
      e = e || {}, this._enableGlobalPan = e.enableGlobalPan;
      var n = this.group;
      return this._zr.add(n), n.attr({
        x: e.x || 0,
        y: e.y || 0,
        rotation: e.rotation || 0,
        scaleX: e.scaleX || 1,
        scaleY: e.scaleY || 1
      }), this._transform = n.getLocalTransform(), this;
    }, t.prototype.updateCovers = function(e) {
      e = U(e, function(h) {
        return _e(ce(Fw), h, !0);
      });
      var n = "\0-brush-index-", i = this._covers, a = this._covers = [], o = this, s = this._creatingCover;
      return new li(i, e, u, l).add(c).update(c).remove(f).execute(), this;
      function l(h, v) {
        return (h.id != null ? h.id : n + v) + "-" + h.brushType;
      }
      function u(h, v) {
        return l(h.__brushOption, v);
      }
      function c(h, v) {
        var d = e[h];
        if (v != null && i[v] === s)
          a[h] = i[v];
        else {
          var p = a[h] = v != null ? (i[v].__brushOption = d, i[v]) : eP(o, QE(o, d));
          y_(o, p);
        }
      }
      function f(h) {
        i[h] !== s && o.group.remove(i[h]);
      }
    }, t.prototype.unmount = function() {
      return this.enableBrush(!1), ey(this), this._zr.remove(this.group), this;
    }, t.prototype.dispose = function() {
      this.unmount(), this.off();
    }, t;
  }(Wr)
);
function QE(r, t) {
  var e = Bv[t.brushType].createCover(r, t);
  return e.__brushOption = t, rP(e, t), r.group.add(e), e;
}
function eP(r, t) {
  var e = __(t);
  return e.endCreating && (e.endCreating(r, t), rP(t, t.__brushOption)), t;
}
function tP(r, t) {
  var e = t.__brushOption;
  __(t).updateCoverShape(r, t, e.range, e);
}
function rP(r, t) {
  var e = t.z;
  e == null && (e = Zq), r.traverse(function(n) {
    n.z = e, n.z2 = e;
  });
}
function y_(r, t) {
  __(t).updateCommon(r, t), tP(r, t);
}
function __(r) {
  return Bv[r.__brushOption.brushType];
}
function b_(r, t, e) {
  var n = r._panels;
  if (!n)
    return yo;
  var i, a = r._transform;
  return M(n, function(o) {
    o.isTargetByCursor(t, e, a) && (i = o);
  }), i;
}
function nP(r, t) {
  var e = r._panels;
  if (!e)
    return yo;
  var n = t.__brushOption.panelId;
  return n != null ? e[n] : yo;
}
function ey(r) {
  var t = r._covers, e = t.length;
  return M(t, function(n) {
    r.group.remove(n);
  }, r), t.length = 0, !!e;
}
function _o(r, t) {
  var e = U(r._covers, function(n) {
    var i = n.__brushOption, a = ce(i.range);
    return {
      brushType: i.brushType,
      panelId: i.panelId,
      range: a
    };
  });
  r.trigger("brush", {
    areas: e,
    isEnd: !!t.isEnd,
    removeOnClick: !!t.removeOnClick
  });
}
function eW(r) {
  var t = r._track;
  if (!t.length)
    return !1;
  var e = t[t.length - 1], n = t[0], i = e[0] - n[0], a = e[1] - n[1], o = Yq(i * i + a * a, 0.5);
  return o > Xq;
}
function iP(r) {
  var t = r.length - 1;
  return t < 0 && (t = 0), [r[0], r[t]];
}
function aP(r, t, e, n) {
  var i = new fe();
  return i.add(new ke({
    name: "main",
    style: S_(e),
    silent: !0,
    draggable: !0,
    cursor: "move",
    drift: ye(Bw, r, t, i, ["n", "s", "w", "e"]),
    ondragend: ye(_o, t, {
      isEnd: !0
    })
  })), M(n, function(a) {
    i.add(new ke({
      name: a.join(""),
      style: {
        opacity: 0
      },
      draggable: !0,
      silent: !0,
      invisible: !0,
      drift: ye(Bw, r, t, i, a),
      ondragend: ye(_o, t, {
        isEnd: !0
      })
    }));
  }), i;
}
function oP(r, t, e, n) {
  var i = n.brushStyle.lineWidth || 0, a = Cs(i, jq), o = e[0][0], s = e[1][0], l = o - i / 2, u = s - i / 2, c = e[0][1], f = e[1][1], h = c - a + i / 2, v = f - a + i / 2, d = c - o, p = f - s, g = d + i, m = p + i;
  Un(r, t, "main", o, s, d, p), n.transformable && (Un(r, t, "w", l, u, a, m), Un(r, t, "e", h, u, a, m), Un(r, t, "n", l, u, g, a), Un(r, t, "s", l, v, g, a), Un(r, t, "nw", l, u, a, a), Un(r, t, "ne", h, u, a, a), Un(r, t, "sw", l, v, a, a), Un(r, t, "se", h, v, a, a));
}
function ty(r, t) {
  var e = t.__brushOption, n = e.transformable, i = t.childAt(0);
  i.useStyle(S_(e)), i.attr({
    silent: !n,
    cursor: n ? "move" : "default"
  }), M([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(a) {
    var o = t.childOfName(a.join("")), s = a.length === 1 ? ry(r, a[0]) : rW(r, a);
    o && o.attr({
      silent: !n,
      invisible: !n,
      cursor: n ? Jq[s] + "-resize" : null
    });
  });
}
function Un(r, t, e, n, i, a, o) {
  var s = t.childOfName(e);
  s && s.setShape(iW(x_(r, t, [[n, i], [n + a, i + o]])));
}
function S_(r) {
  return se({
    strokeNoScale: !0
  }, r.brushStyle);
}
function sP(r, t, e, n) {
  var i = [Ru(r, e), Ru(t, n)], a = [Cs(r, e), Cs(t, n)];
  return [
    [i[0], a[0]],
    [i[1], a[1]]
    // y range
  ];
}
function tW(r) {
  return oo(r.group);
}
function ry(r, t) {
  var e = {
    w: "left",
    e: "right",
    n: "top",
    s: "bottom"
  }, n = {
    left: "w",
    right: "e",
    top: "n",
    bottom: "s"
  }, i = pv(e[t], tW(r));
  return n[i];
}
function rW(r, t) {
  var e = [ry(r, t[0]), ry(r, t[1])];
  return (e[0] === "e" || e[0] === "w") && e.reverse(), e.join("");
}
function Bw(r, t, e, n, i, a) {
  var o = e.__brushOption, s = r.toRectRange(o.range), l = lP(t, i, a);
  M(n, function(u) {
    var c = Kq[u];
    s[c[0]][c[1]] += l[c[0]];
  }), o.range = r.fromRectRange(sP(s[0][0], s[1][0], s[0][1], s[1][1])), y_(t, e), _o(t, {
    isEnd: !1
  });
}
function nW(r, t, e, n) {
  var i = t.__brushOption.range, a = lP(r, e, n);
  M(i, function(o) {
    o[0] += a[0], o[1] += a[1];
  }), y_(r, t), _o(r, {
    isEnd: !1
  });
}
function lP(r, t, e) {
  var n = r.group, i = n.transformCoordToLocal(t, e), a = n.transformCoordToLocal(0, 0);
  return [i[0] - a[0], i[1] - a[1]];
}
function x_(r, t, e) {
  var n = nP(r, t);
  return n && n !== yo ? n.clipPath(e, r._transform) : ce(e);
}
function iW(r) {
  var t = Ru(r[0][0], r[1][0]), e = Ru(r[0][1], r[1][1]), n = Cs(r[0][0], r[1][0]), i = Cs(r[0][1], r[1][1]);
  return {
    x: t,
    y: e,
    width: n - t,
    height: i - e
  };
}
function aW(r, t, e) {
  if (
    // Check active
    !(!r._brushType || sW(r, t.offsetX, t.offsetY))
  ) {
    var n = r._zr, i = r._covers, a = b_(r, t, e);
    if (!r._dragging)
      for (var o = 0; o < i.length; o++) {
        var s = i[o].__brushOption;
        if (a && (a === yo || s.panelId === a.panelId) && Bv[s.brushType].contain(i[o], e[0], e[1]))
          return;
      }
    a && n.setCursorStyle("crosshair");
  }
}
function ny(r) {
  var t = r.event;
  t.preventDefault && t.preventDefault();
}
function iy(r, t, e) {
  return r.childOfName("main").contain(t, e);
}
function uP(r, t, e, n) {
  var i = r._creatingCover, a = r._creatingPanel, o = r._brushOption, s;
  if (r._track.push(e.slice()), eW(r) || i) {
    if (a && !i) {
      o.brushMode === "single" && ey(r);
      var l = ce(o);
      l.brushType = Nw(l.brushType, a), l.panelId = a === yo ? null : a.panelId, i = r._creatingCover = QE(r, l), r._covers.push(i);
    }
    if (i) {
      var u = Bv[Nw(r._brushType, a)], c = i.__brushOption;
      c.range = u.getCreatingRange(x_(r, i, r._track)), n && (eP(r, i), u.updateCommon(r, i)), tP(r, i), s = {
        isEnd: n
      };
    }
  } else n && o.brushMode === "single" && o.removeOnClick && b_(r, t, e) && ey(r) && (s = {
    isEnd: n,
    removeOnClick: !0
  });
  return s;
}
function Nw(r, t) {
  return r === "auto" ? t.defaultBrushType : r;
}
var oW = {
  mousedown: function(r) {
    if (this._dragging)
      zw(this, r);
    else if (!r.target || !r.target.draggable) {
      ny(r);
      var t = this.group.transformCoordToLocal(r.offsetX, r.offsetY);
      this._creatingCover = null;
      var e = this._creatingPanel = b_(this, r, t);
      e && (this._dragging = !0, this._track = [t.slice()]);
    }
  },
  mousemove: function(r) {
    var t = r.offsetX, e = r.offsetY, n = this.group.transformCoordToLocal(t, e);
    if (aW(this, r, n), this._dragging) {
      ny(r);
      var i = uP(this, r, n, !1);
      i && _o(this, i);
    }
  },
  mouseup: function(r) {
    zw(this, r);
  }
};
function zw(r, t) {
  if (r._dragging) {
    ny(t);
    var e = t.offsetX, n = t.offsetY, i = r.group.transformCoordToLocal(e, n), a = uP(r, t, i, !0);
    r._dragging = !1, r._track = [], r._creatingCover = null, a && _o(r, a);
  }
}
function sW(r, t, e) {
  var n = r._zr;
  return t < 0 || t > n.getWidth() || e < 0 || e > n.getHeight();
}
var Bv = {
  lineX: Vw(0),
  lineY: Vw(1),
  rect: {
    createCover: function(r, t) {
      function e(n) {
        return n;
      }
      return aP({
        toRectRange: e,
        fromRectRange: e
      }, r, t, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]);
    },
    getCreatingRange: function(r) {
      var t = iP(r);
      return sP(t[1][0], t[1][1], t[0][0], t[0][1]);
    },
    updateCoverShape: function(r, t, e, n) {
      oP(r, t, e, n);
    },
    updateCommon: ty,
    contain: iy
  },
  polygon: {
    createCover: function(r, t) {
      var e = new fe();
      return e.add(new sr({
        name: "main",
        style: S_(t),
        silent: !0
      })), e;
    },
    getCreatingRange: function(r) {
      return r;
    },
    endCreating: function(r, t) {
      t.remove(t.childAt(0)), t.add(new ar({
        name: "main",
        draggable: !0,
        drift: ye(nW, r, t),
        ondragend: ye(_o, r, {
          isEnd: !0
        })
      }));
    },
    updateCoverShape: function(r, t, e, n) {
      t.childAt(0).setShape({
        points: x_(r, t, e)
      });
    },
    updateCommon: ty,
    contain: iy
  }
};
function Vw(r) {
  return {
    createCover: function(t, e) {
      return aP({
        toRectRange: function(n) {
          var i = [n, [0, 100]];
          return r && i.reverse(), i;
        },
        fromRectRange: function(n) {
          return n[r];
        }
      }, t, e, [[["w"], ["e"]], [["n"], ["s"]]][r]);
    },
    getCreatingRange: function(t) {
      var e = iP(t), n = Ru(e[0][r], e[1][r]), i = Cs(e[0][r], e[1][r]);
      return [n, i];
    },
    updateCoverShape: function(t, e, n, i) {
      var a, o = nP(t, e);
      if (o !== yo && o.getLinearBrushOtherExtent)
        a = o.getLinearBrushOtherExtent(r);
      else {
        var s = t._zr;
        a = [0, [s.getWidth(), s.getHeight()][1 - r]];
      }
      var l = [n, a];
      r && l.reverse(), oP(t, e, l, i);
    },
    updateCommon: ty,
    contain: iy
  };
}
function cP(r) {
  return r = w_(r), function(t) {
    return _M(t, r);
  };
}
function fP(r, t) {
  return r = w_(r), function(e) {
    var n = t ?? e, i = n ? r.width : r.height, a = n ? r.x : r.y;
    return [a, a + (i || 0)];
  };
}
function hP(r, t, e) {
  var n = w_(r);
  return function(i, a) {
    return n.contain(a[0], a[1]) && !kv(i, t, e);
  };
}
function w_(r) {
  return xe.create(r);
}
var lW = ["axisLine", "axisTickLabel", "axisName"], uW = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n) {
      r.prototype.init.apply(this, arguments), (this._brushController = new m_(n.getZr())).on("brush", Q(this._onBrush, this));
    }, t.prototype.render = function(e, n, i, a) {
      if (!cW(e, n, a)) {
        this.axisModel = e, this.api = i, this.group.removeAll();
        var o = this._axisGroup;
        if (this._axisGroup = new fe(), this.group.add(this._axisGroup), !!e.get("show")) {
          var s = hW(e, n), l = s.coordinateSystem, u = e.getAreaSelectStyle(), c = u.width, f = e.axis.dim, h = l.getAxisLayout(f), v = H({
            strokeContainThreshold: c
          }, h), d = new tr(e, v);
          M(lW, d.add, d), this._axisGroup.add(d.getGroup()), this._refreshBrushController(v, u, e, s, c, i), Uu(o, this._axisGroup, e);
        }
      }
    }, t.prototype._refreshBrushController = function(e, n, i, a, o, s) {
      var l = i.axis.getExtent(), u = l[1] - l[0], c = Math.min(30, Math.abs(u) * 0.1), f = xe.create({
        x: l[0],
        y: -o / 2,
        width: u,
        height: o
      });
      f.x -= c, f.width += 2 * c, this._brushController.mount({
        enableGlobalPan: !0,
        rotation: e.rotation,
        x: e.position[0],
        y: e.position[1]
      }).setPanels([{
        panelId: "pl",
        clipPath: cP(f),
        isTargetByCursor: hP(f, s, a),
        getLinearBrushOtherExtent: fP(f, 0)
      }]).enableBrush({
        brushType: "lineX",
        brushStyle: n,
        removeOnClick: !0
      }).updateCovers(fW(i));
    }, t.prototype._onBrush = function(e) {
      var n = e.areas, i = this.axisModel, a = i.axis, o = U(n, function(s) {
        return [a.coordToData(s.range[0], !0), a.coordToData(s.range[1], !0)];
      });
      (!i.option.realtime === e.isEnd || e.removeOnClick) && this.api.dispatchAction({
        type: "axisAreaSelect",
        parallelAxisId: i.id,
        intervals: o
      });
    }, t.prototype.dispose = function() {
      this._brushController.dispose();
    }, t.type = "parallelAxis", t;
  }(lt)
);
function cW(r, t, e) {
  return e && e.type === "axisAreaSelect" && t.findComponents({
    mainType: "parallelAxis",
    query: e
  })[0] === r;
}
function fW(r) {
  var t = r.axis;
  return U(r.activeIntervals, function(e) {
    return {
      brushType: "lineX",
      panelId: "pl",
      range: [t.dataToCoord(e[0], !0), t.dataToCoord(e[1], !0)]
    };
  });
}
function hW(r, t) {
  return t.getComponent("parallel", r.get("parallelIndex"));
}
var vW = {
  type: "axisAreaSelect",
  event: "axisAreaSelected"
  // update: 'updateVisual'
};
function dW(r) {
  r.registerAction(vW, function(t, e) {
    e.eachComponent({
      mainType: "parallelAxis",
      query: t
    }, function(n) {
      n.axis.model.setActiveIntervals(t.intervals);
    });
  }), r.registerAction("parallelAxisExpand", function(t, e) {
    e.eachComponent({
      mainType: "parallel",
      query: t
    }, function(n) {
      n.setAxisExpand(t);
    });
  });
}
var pW = {
  type: "value",
  areaSelectStyle: {
    width: 20,
    borderWidth: 1,
    borderColor: "rgba(160,197,232)",
    color: "rgba(160,197,232)",
    opacity: 0.3
  },
  realtime: !0,
  z: 10
};
function vP(r) {
  r.registerComponentView(Fq), r.registerComponentModel(Nq), r.registerCoordinateSystem("parallel", Uq), r.registerPreprocessor(Pq), r.registerComponentModel(Qm), r.registerComponentView(uW), ws(r, "parallel", Qm, pW), dW(r);
}
function gW(r) {
  De(vP), r.registerChartView(Cq), r.registerSeriesModel(Tq), r.registerVisual(r.PRIORITY.VISUAL.BRUSH, Eq);
}
var mW = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.cpx1 = 0, this.cpy1 = 0, this.cpx2 = 0, this.cpy2 = 0, this.extent = 0;
    }
    return r;
  }()
), yW = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      return r.call(this, e) || this;
    }
    return t.prototype.getDefaultShape = function() {
      return new mW();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.extent;
      e.moveTo(n.x1, n.y1), e.bezierCurveTo(n.cpx1, n.cpy1, n.cpx2, n.cpy2, n.x2, n.y2), n.orient === "vertical" ? (e.lineTo(n.x2 + i, n.y2), e.bezierCurveTo(n.cpx2 + i, n.cpy2, n.cpx1 + i, n.cpy1, n.x1 + i, n.y1)) : (e.lineTo(n.x2, n.y2 + i), e.bezierCurveTo(n.cpx2, n.cpy2 + i, n.cpx1, n.cpy1 + i, n.x1, n.y1 + i)), e.closePath();
    }, t.prototype.highlight = function() {
      oi(this);
    }, t.prototype.downplay = function() {
      si(this);
    }, t;
  }(Te)
), _W = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._focusAdjacencyDisabled = !1, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = this, o = e.getGraph(), s = this.group, l = e.layoutInfo, u = l.width, c = l.height, f = e.getData(), h = e.getData("edge"), v = e.get("orient");
      this._model = e, s.removeAll(), s.x = l.x, s.y = l.y, o.eachEdge(function(d) {
        var p = new yW(), g = pe(p);
        g.dataIndex = d.dataIndex, g.seriesIndex = e.seriesIndex, g.dataType = "edge";
        var m = d.getModel(), y = m.getModel("lineStyle"), _ = y.get("curveness"), b = d.node1.getLayout(), S = d.node1.getModel(), x = S.get("localX"), w = S.get("localY"), C = d.node2.getLayout(), D = d.node2.getModel(), A = D.get("localX"), T = D.get("localY"), L = d.getLayout(), E, I, P, R, F, O, z, G;
        p.shape.extent = Math.max(1, L.dy), p.shape.orient = v, v === "vertical" ? (E = (x != null ? x * u : b.x) + L.sy, I = (w != null ? w * c : b.y) + b.dy, P = (A != null ? A * u : C.x) + L.ty, R = T != null ? T * c : C.y, F = E, O = I * (1 - _) + R * _, z = P, G = I * _ + R * (1 - _)) : (E = (x != null ? x * u : b.x) + b.dx, I = (w != null ? w * c : b.y) + L.sy, P = A != null ? A * u : C.x, R = (T != null ? T * c : C.y) + L.ty, F = E * (1 - _) + P * _, O = I, z = E * _ + P * (1 - _), G = R), p.setShape({
          x1: E,
          y1: I,
          x2: P,
          y2: R,
          cpx1: F,
          cpy1: O,
          cpx2: z,
          cpy2: G
        }), p.useStyle(y.getItemStyle()), $w(p.style, v, d);
        var W = "" + m.get("value"), Y = Mt(m, "edgeLabel");
        Bt(p, Y, {
          labelFetcher: {
            getFormattedLabel: function(ie, Me, We, ve, ae, be) {
              return e.getFormattedLabel(
                ie,
                Me,
                "edge",
                ve,
                // ensure edgeLabel formatter is provided
                // to prevent the inheritance from `label.formatter` of the series
                En(ae, Y.normal && Y.normal.get("formatter"), W),
                be
              );
            }
          },
          labelDataIndex: d.dataIndex,
          defaultText: W
        }), p.setTextConfig({
          position: "inside"
        });
        var j = m.getModel("emphasis");
        Ft(p, m, "lineStyle", function(ie) {
          var Me = ie.getItemStyle();
          return $w(Me, v, d), Me;
        }), s.add(p), h.setItemGraphicEl(d.dataIndex, p);
        var ee = j.get("focus");
        ut(p, ee === "adjacency" ? d.getAdjacentDataIndices() : ee === "trajectory" ? d.getTrajectoryDataIndices() : ee, j.get("blurScope"), j.get("disabled"));
      }), o.eachNode(function(d) {
        var p = d.getLayout(), g = d.getModel(), m = g.get("localX"), y = g.get("localY"), _ = g.getModel("emphasis"), b = g.get(["itemStyle", "borderRadius"]) || 0, S = new ke({
          shape: {
            x: m != null ? m * u : p.x,
            y: y != null ? y * c : p.y,
            width: p.dx,
            height: p.dy,
            r: b
          },
          style: g.getModel("itemStyle").getItemStyle(),
          z2: 10
        });
        Bt(S, Mt(g), {
          labelFetcher: {
            getFormattedLabel: function(w, C) {
              return e.getFormattedLabel(w, C, "node");
            }
          },
          labelDataIndex: d.dataIndex,
          defaultText: d.id
        }), S.disableLabelAnimation = !0, S.setStyle("fill", d.getVisual("color")), S.setStyle("decal", d.getVisual("style").decal), Ft(S, g), s.add(S), f.setItemGraphicEl(d.dataIndex, S), pe(S).dataType = "node";
        var x = _.get("focus");
        ut(S, x === "adjacency" ? d.getAdjacentDataIndices() : x === "trajectory" ? d.getTrajectoryDataIndices() : x, _.get("blurScope"), _.get("disabled"));
      }), f.eachItemGraphicEl(function(d, p) {
        var g = f.getItemModel(p);
        g.get("draggable") && (d.drift = function(m, y) {
          a._focusAdjacencyDisabled = !0, this.shape.x += m, this.shape.y += y, this.dirty(), i.dispatchAction({
            type: "dragNode",
            seriesId: e.id,
            dataIndex: f.getRawIndex(p),
            localX: this.shape.x / u,
            localY: this.shape.y / c
          });
        }, d.ondragend = function() {
          a._focusAdjacencyDisabled = !1;
        }, d.draggable = !0, d.cursor = "move");
      }), !this._data && e.isAnimationEnabled() && s.setClipPath(bW(s.getBoundingRect(), e, function() {
        s.removeClipPath();
      })), this._data = e.getData();
    }, t.prototype.dispose = function() {
    }, t.type = "sankey", t;
  }(Qe)
);
function $w(r, t, e) {
  switch (r.fill) {
    case "source":
      r.fill = e.node1.getVisual("color"), r.decal = e.node1.getVisual("style").decal;
      break;
    case "target":
      r.fill = e.node2.getVisual("color"), r.decal = e.node2.getVisual("style").decal;
      break;
    case "gradient":
      var n = e.node1.getVisual("color"), i = e.node2.getVisual("color");
      J(n) && J(i) && (r.fill = new Wu(0, 0, +(t === "horizontal"), +(t === "vertical"), [{
        color: n,
        offset: 0
      }, {
        color: i,
        offset: 1
      }]));
  }
}
function bW(r, t, e) {
  var n = new ke({
    shape: {
      x: r.x - 10,
      y: r.y - 10,
      width: 0,
      height: r.height + 20
    }
  });
  return st(n, {
    shape: {
      width: r.width + 20
    }
  }, t, e), n;
}
var SW = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      var i = e.edges || e.links || [], a = e.data || e.nodes || [], o = e.levels || [];
      this.levelModels = [];
      for (var s = this.levelModels, l = 0; l < o.length; l++)
        o[l].depth != null && o[l].depth >= 0 && (s[o[l].depth] = new Ze(o[l], this, n));
      var u = XE(a, i, this, !0, c);
      return u.data;
      function c(f, h) {
        f.wrapMethod("getItemModel", function(v, d) {
          var p = v.parentModel, g = p.getData().getItemLayout(d);
          if (g) {
            var m = g.depth, y = p.levelModels[m];
            y && (v.parentModel = y);
          }
          return v;
        }), h.wrapMethod("getItemModel", function(v, d) {
          var p = v.parentModel, g = p.getGraph().getEdgeByIndex(d), m = g.node1.getLayout();
          if (m) {
            var y = m.depth, _ = p.levelModels[y];
            _ && (v.parentModel = _);
          }
          return v;
        });
      }
    }, t.prototype.setNodePosition = function(e, n) {
      var i = this.option.data || this.option.nodes, a = i[e];
      a.localX = n[0], a.localY = n[1];
    }, t.prototype.getGraph = function() {
      return this.getData().graph;
    }, t.prototype.getEdgeData = function() {
      return this.getGraph().edgeData;
    }, t.prototype.formatTooltip = function(e, n, i) {
      function a(v) {
        return isNaN(v) || v == null;
      }
      if (i === "edge") {
        var o = this.getDataParams(e, i), s = o.data, l = o.value, u = s.source + " -- " + s.target;
        return It("nameValue", {
          name: u,
          value: l,
          noValue: a(l)
        });
      } else {
        var c = this.getGraph().getNodeByIndex(e), f = c.getLayout().value, h = this.getDataParams(e, i).data.name;
        return It("nameValue", {
          name: h != null ? h + "" : null,
          value: f,
          noValue: a(f)
        });
      }
    }, t.prototype.optionUpdated = function() {
    }, t.prototype.getDataParams = function(e, n) {
      var i = r.prototype.getDataParams.call(this, e, n);
      if (i.value == null && n === "node") {
        var a = this.getGraph().getNodeByIndex(e), o = a.getLayout().value;
        i.value = o;
      }
      return i;
    }, t.type = "series.sankey", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "view",
      left: "5%",
      top: "5%",
      right: "20%",
      bottom: "5%",
      orient: "horizontal",
      nodeWidth: 20,
      nodeGap: 8,
      draggable: !0,
      layoutIterations: 32,
      label: {
        show: !0,
        position: "right",
        fontSize: 12
      },
      edgeLabel: {
        show: !1,
        fontSize: 12
      },
      levels: [],
      nodeAlign: "justify",
      lineStyle: {
        color: "#314656",
        opacity: 0.2,
        curveness: 0.5
      },
      emphasis: {
        label: {
          show: !0
        },
        lineStyle: {
          opacity: 0.5
        }
      },
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      },
      animationEasing: "linear",
      animationDuration: 1e3
    }, t;
  }(it)
);
function xW(r, t) {
  r.eachSeriesByType("sankey", function(e) {
    var n = e.get("nodeWidth"), i = e.get("nodeGap"), a = wW(e, t);
    e.layoutInfo = a;
    var o = a.width, s = a.height, l = e.getGraph(), u = l.nodes, c = l.edges;
    AW(u);
    var f = qe(u, function(p) {
      return p.getLayout().value === 0;
    }), h = f.length !== 0 ? 0 : e.get("layoutIterations"), v = e.get("orient"), d = e.get("nodeAlign");
    CW(u, c, n, i, o, s, h, v, d);
  });
}
function wW(r, t) {
  return St(r.getBoxLayoutParams(), {
    width: t.getWidth(),
    height: t.getHeight()
  });
}
function CW(r, t, e, n, i, a, o, s, l) {
  DW(r, t, e, i, a, s, l), LW(r, t, a, i, n, o, s), zW(r, s);
}
function AW(r) {
  M(r, function(t) {
    var e = Zi(t.outEdges, Eh), n = Zi(t.inEdges, Eh), i = t.getValue() || 0, a = Math.max(e, n, i);
    t.setLayout({
      value: a
    }, !0);
  });
}
function DW(r, t, e, n, i, a, o) {
  for (var s = [], l = [], u = [], c = [], f = 0, h = 0; h < t.length; h++)
    s[h] = 1;
  for (var h = 0; h < r.length; h++)
    l[h] = r[h].inEdges.length, l[h] === 0 && u.push(r[h]);
  for (var v = -1; u.length; ) {
    for (var d = 0; d < u.length; d++) {
      var p = u[d], g = p.hostGraph.data.getRawDataItem(p.dataIndex), m = g.depth != null && g.depth >= 0;
      m && g.depth > v && (v = g.depth), p.setLayout({
        depth: m ? g.depth : f
      }, !0), a === "vertical" ? p.setLayout({
        dy: e
      }, !0) : p.setLayout({
        dx: e
      }, !0);
      for (var y = 0; y < p.outEdges.length; y++) {
        var _ = p.outEdges[y], b = t.indexOf(_);
        s[b] = 0;
        var S = _.node2, x = r.indexOf(S);
        --l[x] === 0 && c.indexOf(S) < 0 && c.push(S);
      }
    }
    ++f, u = c, c = [];
  }
  for (var h = 0; h < s.length; h++)
    if (s[h] === 1)
      throw new Error("Sankey is a DAG, the original data has cycle!");
  var w = v > f - 1 ? v : f - 1;
  o && o !== "left" && TW(r, o, a, w);
  var C = a === "vertical" ? (i - e) / w : (n - e) / w;
  IW(r, C, a);
}
function dP(r) {
  var t = r.hostGraph.data.getRawDataItem(r.dataIndex);
  return t.depth != null && t.depth >= 0;
}
function TW(r, t, e, n) {
  if (t === "right") {
    for (var i = [], a = r, o = 0; a.length; ) {
      for (var s = 0; s < a.length; s++) {
        var l = a[s];
        l.setLayout({
          skNodeHeight: o
        }, !0);
        for (var u = 0; u < l.inEdges.length; u++) {
          var c = l.inEdges[u];
          i.indexOf(c.node1) < 0 && i.push(c.node1);
        }
      }
      a = i, i = [], ++o;
    }
    M(r, function(f) {
      dP(f) || f.setLayout({
        depth: Math.max(0, n - f.getLayout().skNodeHeight)
      }, !0);
    });
  } else t === "justify" && MW(r, n);
}
function MW(r, t) {
  M(r, function(e) {
    !dP(e) && !e.outEdges.length && e.setLayout({
      depth: t
    }, !0);
  });
}
function IW(r, t, e) {
  M(r, function(n) {
    var i = n.getLayout().depth * t;
    e === "vertical" ? n.setLayout({
      y: i
    }, !0) : n.setLayout({
      x: i
    }, !0);
  });
}
function LW(r, t, e, n, i, a, o) {
  var s = EW(r, o);
  PW(s, t, e, n, i, o), qp(s, i, e, n, o);
  for (var l = 1; a > 0; a--)
    l *= 0.99, kW(s, l, o), qp(s, i, e, n, o), NW(s, l, o), qp(s, i, e, n, o);
}
function EW(r, t) {
  var e = [], n = t === "vertical" ? "y" : "x", i = am(r, function(a) {
    return a.getLayout()[n];
  });
  return i.keys.sort(function(a, o) {
    return a - o;
  }), M(i.keys, function(a) {
    e.push(i.buckets.get(a));
  }), e;
}
function PW(r, t, e, n, i, a) {
  var o = 1 / 0;
  M(r, function(s) {
    var l = s.length, u = 0;
    M(s, function(f) {
      u += f.getLayout().value;
    });
    var c = a === "vertical" ? (n - (l - 1) * i) / u : (e - (l - 1) * i) / u;
    c < o && (o = c);
  }), M(r, function(s) {
    M(s, function(l, u) {
      var c = l.getLayout().value * o;
      a === "vertical" ? (l.setLayout({
        x: u
      }, !0), l.setLayout({
        dx: c
      }, !0)) : (l.setLayout({
        y: u
      }, !0), l.setLayout({
        dy: c
      }, !0));
    });
  }), M(t, function(s) {
    var l = +s.getValue() * o;
    s.setLayout({
      dy: l
    }, !0);
  });
}
function qp(r, t, e, n, i) {
  var a = i === "vertical" ? "x" : "y";
  M(r, function(o) {
    o.sort(function(p, g) {
      return p.getLayout()[a] - g.getLayout()[a];
    });
    for (var s, l, u, c = 0, f = o.length, h = i === "vertical" ? "dx" : "dy", v = 0; v < f; v++)
      l = o[v], u = c - l.getLayout()[a], u > 0 && (s = l.getLayout()[a] + u, i === "vertical" ? l.setLayout({
        x: s
      }, !0) : l.setLayout({
        y: s
      }, !0)), c = l.getLayout()[a] + l.getLayout()[h] + t;
    var d = i === "vertical" ? n : e;
    if (u = c - t - d, u > 0) {
      s = l.getLayout()[a] - u, i === "vertical" ? l.setLayout({
        x: s
      }, !0) : l.setLayout({
        y: s
      }, !0), c = s;
      for (var v = f - 2; v >= 0; --v)
        l = o[v], u = l.getLayout()[a] + l.getLayout()[h] + t - c, u > 0 && (s = l.getLayout()[a] - u, i === "vertical" ? l.setLayout({
          x: s
        }, !0) : l.setLayout({
          y: s
        }, !0)), c = l.getLayout()[a];
    }
  });
}
function kW(r, t, e) {
  M(r.slice().reverse(), function(n) {
    M(n, function(i) {
      if (i.outEdges.length) {
        var a = Zi(i.outEdges, RW, e) / Zi(i.outEdges, Eh);
        if (isNaN(a)) {
          var o = i.outEdges.length;
          a = o ? Zi(i.outEdges, OW, e) / o : 0;
        }
        if (e === "vertical") {
          var s = i.getLayout().x + (a - ta(i, e)) * t;
          i.setLayout({
            x: s
          }, !0);
        } else {
          var l = i.getLayout().y + (a - ta(i, e)) * t;
          i.setLayout({
            y: l
          }, !0);
        }
      }
    });
  });
}
function RW(r, t) {
  return ta(r.node2, t) * r.getValue();
}
function OW(r, t) {
  return ta(r.node2, t);
}
function FW(r, t) {
  return ta(r.node1, t) * r.getValue();
}
function BW(r, t) {
  return ta(r.node1, t);
}
function ta(r, t) {
  return t === "vertical" ? r.getLayout().x + r.getLayout().dx / 2 : r.getLayout().y + r.getLayout().dy / 2;
}
function Eh(r) {
  return r.getValue();
}
function Zi(r, t, e) {
  for (var n = 0, i = r.length, a = -1; ++a < i; ) {
    var o = +t(r[a], e);
    isNaN(o) || (n += o);
  }
  return n;
}
function NW(r, t, e) {
  M(r, function(n) {
    M(n, function(i) {
      if (i.inEdges.length) {
        var a = Zi(i.inEdges, FW, e) / Zi(i.inEdges, Eh);
        if (isNaN(a)) {
          var o = i.inEdges.length;
          a = o ? Zi(i.inEdges, BW, e) / o : 0;
        }
        if (e === "vertical") {
          var s = i.getLayout().x + (a - ta(i, e)) * t;
          i.setLayout({
            x: s
          }, !0);
        } else {
          var l = i.getLayout().y + (a - ta(i, e)) * t;
          i.setLayout({
            y: l
          }, !0);
        }
      }
    });
  });
}
function zW(r, t) {
  var e = t === "vertical" ? "x" : "y";
  M(r, function(n) {
    n.outEdges.sort(function(i, a) {
      return i.node2.getLayout()[e] - a.node2.getLayout()[e];
    }), n.inEdges.sort(function(i, a) {
      return i.node1.getLayout()[e] - a.node1.getLayout()[e];
    });
  }), M(r, function(n) {
    var i = 0, a = 0;
    M(n.outEdges, function(o) {
      o.setLayout({
        sy: i
      }, !0), i += o.getLayout().dy;
    }), M(n.inEdges, function(o) {
      o.setLayout({
        ty: a
      }, !0), a += o.getLayout().dy;
    });
  });
}
function VW(r) {
  r.eachSeriesByType("sankey", function(t) {
    var e = t.getGraph(), n = e.nodes, i = e.edges;
    if (n.length) {
      var a = 1 / 0, o = -1 / 0;
      M(n, function(s) {
        var l = s.getLayout().value;
        l < a && (a = l), l > o && (o = l);
      }), M(n, function(s) {
        var l = new Dt({
          type: "color",
          mappingMethod: "linear",
          dataExtent: [a, o],
          visual: t.get("color")
        }), u = l.mapValueToVisual(s.getLayout().value), c = s.getModel().get(["itemStyle", "color"]);
        c != null ? (s.setVisual("color", c), s.setVisual("style", {
          fill: c
        })) : (s.setVisual("color", u), s.setVisual("style", {
          fill: u
        }));
      });
    }
    i.length && M(i, function(s) {
      var l = s.getModel().get("lineStyle");
      s.setVisual("style", l);
    });
  });
}
function $W(r) {
  r.registerChartView(_W), r.registerSeriesModel(SW), r.registerLayout(xW), r.registerVisual(VW), r.registerAction({
    type: "dragNode",
    event: "dragnode",
    // here can only use 'update' now, other value is not support in echarts.
    update: "update"
  }, function(t, e) {
    e.eachComponent({
      mainType: "series",
      subType: "sankey",
      query: t
    }, function(n) {
      n.setNodePosition(t.dataIndex, [t.localX, t.localY]);
    });
  });
}
var pP = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype._hasEncodeRule = function(t) {
      var e = this.getEncode();
      return e && e.get(t) != null;
    }, r.prototype.getInitialData = function(t, e) {
      var n, i = e.getComponent("xAxis", this.get("xAxisIndex")), a = e.getComponent("yAxis", this.get("yAxisIndex")), o = i.get("type"), s = a.get("type"), l;
      o === "category" ? (t.layout = "horizontal", n = i.getOrdinalMeta(), l = !this._hasEncodeRule("x")) : s === "category" ? (t.layout = "vertical", n = a.getOrdinalMeta(), l = !this._hasEncodeRule("y")) : t.layout = t.layout || "horizontal";
      var u = ["x", "y"], c = t.layout === "horizontal" ? 0 : 1, f = this._baseAxisDim = u[c], h = u[1 - c], v = [i, a], d = v[c].get("type"), p = v[1 - c].get("type"), g = t.data;
      if (g && l) {
        var m = [];
        M(g, function(b, S) {
          var x;
          q(b) ? (x = b.slice(), b.unshift(S)) : q(b.value) ? (x = H({}, b), x.value = x.value.slice(), b.value.unshift(S)) : x = b, m.push(x);
        }), t.data = m;
      }
      var y = this.defaultValueDimensions, _ = [{
        name: f,
        type: bh(d),
        ordinalMeta: n,
        otherDims: {
          tooltip: !1,
          itemName: 0
        },
        dimsDef: ["base"]
      }, {
        name: h,
        type: bh(p),
        dimsDef: y.slice()
      }];
      return Hs(this, {
        coordDimensions: _,
        dimensionsCount: y.length + 1,
        encodeDefaulter: ye(UM, _, this)
      });
    }, r.prototype.getBaseAxis = function() {
      var t = this._baseAxisDim;
      return this.ecModel.getComponent(t + "Axis", this.get(t + "AxisIndex")).axis;
    }, r;
  }()
), gP = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.defaultValueDimensions = [{
        name: "min",
        defaultTooltip: !0
      }, {
        name: "Q1",
        defaultTooltip: !0
      }, {
        name: "median",
        defaultTooltip: !0
      }, {
        name: "Q3",
        defaultTooltip: !0
      }, {
        name: "max",
        defaultTooltip: !0
      }], e.visualDrawType = "stroke", e;
    }
    return t.type = "series.boxplot", t.dependencies = ["xAxis", "yAxis", "grid"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "cartesian2d",
      legendHoverLink: !0,
      layout: null,
      boxWidth: [7, 50],
      itemStyle: {
        color: "#fff",
        borderWidth: 1
      },
      emphasis: {
        scale: !0,
        itemStyle: {
          borderWidth: 2,
          shadowBlur: 5,
          shadowOffsetX: 1,
          shadowOffsetY: 1,
          shadowColor: "rgba(0,0,0,0.2)"
        }
      },
      animationDuration: 800
    }, t;
  }(it)
);
_t(gP, pP, !0);
var GW = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this.group, s = this._data;
      this._data || o.removeAll();
      var l = e.get("layout") === "horizontal" ? 1 : 0;
      a.diff(s).add(function(u) {
        if (a.hasValue(u)) {
          var c = a.getItemLayout(u), f = Gw(c, a, u, l, !0);
          a.setItemGraphicEl(u, f), o.add(f);
        }
      }).update(function(u, c) {
        var f = s.getItemGraphicEl(c);
        if (!a.hasValue(u)) {
          o.remove(f);
          return;
        }
        var h = a.getItemLayout(u);
        f ? (un(f), mP(h, f, a, u)) : f = Gw(h, a, u, l), o.add(f), a.setItemGraphicEl(u, f);
      }).remove(function(u) {
        var c = s.getItemGraphicEl(u);
        c && o.remove(c);
      }).execute(), this._data = a;
    }, t.prototype.remove = function(e) {
      var n = this.group, i = this._data;
      this._data = null, i && i.eachItemGraphicEl(function(a) {
        a && n.remove(a);
      });
    }, t.type = "boxplot", t;
  }(Qe)
), HW = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), qW = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "boxplotBoxPath", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new HW();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.points, a = 0;
      for (e.moveTo(i[a][0], i[a][1]), a++; a < 4; a++)
        e.lineTo(i[a][0], i[a][1]);
      for (e.closePath(); a < i.length; a++)
        e.moveTo(i[a][0], i[a][1]), a++, e.lineTo(i[a][0], i[a][1]);
    }, t;
  }(Te)
);
function Gw(r, t, e, n, i) {
  var a = r.ends, o = new qW({
    shape: {
      points: i ? WW(a, n, r) : a
    }
  });
  return mP(r, o, t, e, i), o;
}
function mP(r, t, e, n, i) {
  var a = e.hostModel, o = wo[i ? "initProps" : "updateProps"];
  o(t, {
    shape: {
      points: r.ends
    }
  }, a, n), t.useStyle(e.getItemVisual(n, "style")), t.style.strokeNoScale = !0, t.z2 = 100;
  var s = e.getItemModel(n), l = s.getModel("emphasis");
  Ft(t, s), ut(t, l.get("focus"), l.get("blurScope"), l.get("disabled"));
}
function WW(r, t, e) {
  return U(r, function(n) {
    return n = n.slice(), n[t] = e.initBaseline, n;
  });
}
var ru = M;
function UW(r) {
  var t = YW(r);
  ru(t, function(e) {
    var n = e.seriesModels;
    n.length && (ZW(e), ru(n, function(i, a) {
      XW(i, e.boxOffsetList[a], e.boxWidthList[a]);
    }));
  });
}
function YW(r) {
  var t = [], e = [];
  return r.eachSeriesByType("boxplot", function(n) {
    var i = n.getBaseAxis(), a = we(e, i);
    a < 0 && (a = e.length, e[a] = i, t[a] = {
      axis: i,
      seriesModels: []
    }), t[a].seriesModels.push(n);
  }), t;
}
function ZW(r) {
  var t = r.axis, e = r.seriesModels, n = e.length, i = r.boxWidthList = [], a = r.boxOffsetList = [], o = [], s;
  if (t.type === "category")
    s = t.getBandWidth();
  else {
    var l = 0;
    ru(e, function(d) {
      l = Math.max(l, d.getData().count());
    });
    var u = t.getExtent();
    s = Math.abs(u[1] - u[0]) / l;
  }
  ru(e, function(d) {
    var p = d.get("boxWidth");
    q(p) || (p = [p, p]), o.push([X(p[0], s) || 0, X(p[1], s) || 0]);
  });
  var c = s * 0.8 - 2, f = c / n * 0.3, h = (c - f * (n - 1)) / n, v = h / 2 - c / 2;
  ru(e, function(d, p) {
    a.push(v), v += f + h, i.push(Math.min(Math.max(h, o[p][0]), o[p][1]));
  });
}
function XW(r, t, e) {
  var n = r.coordinateSystem, i = r.getData(), a = e / 2, o = r.get("layout") === "horizontal" ? 0 : 1, s = 1 - o, l = ["x", "y"], u = i.mapDimension(l[o]), c = i.mapDimensionsAll(l[s]);
  if (u == null || c.length < 5)
    return;
  for (var f = 0; f < i.count(); f++) {
    var h = i.get(u, f), v = _(h, c[2], f), d = _(h, c[0], f), p = _(h, c[1], f), g = _(h, c[3], f), m = _(h, c[4], f), y = [];
    b(y, p, !1), b(y, g, !0), y.push(d, p, m, g), S(y, d), S(y, m), S(y, v), i.setItemLayout(f, {
      initBaseline: v[s],
      ends: y
    });
  }
  function _(x, w, C) {
    var D = i.get(w, C), A = [];
    A[o] = x, A[s] = D;
    var T;
    return isNaN(x) || isNaN(D) ? T = [NaN, NaN] : (T = n.dataToPoint(A), T[o] += t), T;
  }
  function b(x, w, C) {
    var D = w.slice(), A = w.slice();
    D[o] += a, A[o] -= a, C ? x.push(D, A) : x.push(A, D);
  }
  function S(x, w) {
    var C = w.slice(), D = w.slice();
    C[o] -= a, D[o] += a, x.push(C, D);
  }
}
function jW(r, t) {
  t = t || {};
  for (var e = [], n = [], i = t.boundIQR, a = i === "none" || i === 0, o = 0; o < r.length; o++) {
    var s = Gr(r[o].slice()), l = _d(s, 0.25), u = _d(s, 0.5), c = _d(s, 0.75), f = s[0], h = s[s.length - 1], v = (i ?? 1.5) * (c - l), d = a ? f : Math.max(f, l - v), p = a ? h : Math.min(h, c + v), g = t.itemNameFormatter, m = oe(g) ? g({
      value: o
    }) : J(g) ? g.replace("{value}", o + "") : o + "";
    e.push([m, d, l, u, c, p]);
    for (var y = 0; y < s.length; y++) {
      var _ = s[y];
      if (_ < d || _ > p) {
        var b = [m, _];
        n.push(b);
      }
    }
  }
  return {
    boxData: e,
    outliers: n
  };
}
var KW = {
  type: "echarts:boxplot",
  transform: function(t) {
    var e = t.upstream;
    if (e.sourceFormat !== Wt) {
      var n = "";
      He(n);
    }
    var i = jW(e.getRawData(), t.config);
    return [{
      dimensions: ["ItemName", "Low", "Q1", "Q2", "Q3", "High"],
      data: i.boxData
    }, {
      data: i.outliers
    }];
  }
};
function JW(r) {
  r.registerSeriesModel(gP), r.registerChartView(GW), r.registerLayout(UW), r.registerTransform(KW);
}
var QW = ["itemStyle", "borderColor"], eU = ["itemStyle", "borderColor0"], tU = ["itemStyle", "borderColorDoji"], rU = ["itemStyle", "color"], nU = ["itemStyle", "color0"];
function C_(r, t) {
  return t.get(r > 0 ? rU : nU);
}
function A_(r, t) {
  return t.get(r === 0 ? tU : r > 0 ? QW : eU);
}
var iU = {
  seriesType: "candlestick",
  plan: zs(),
  // For legend.
  performRawSeries: !0,
  reset: function(r, t) {
    if (!t.isSeriesFiltered(r)) {
      var e = r.pipelineContext.large;
      return !e && {
        progress: function(n, i) {
          for (var a; (a = n.next()) != null; ) {
            var o = i.getItemModel(a), s = i.getItemLayout(a).sign, l = o.getItemStyle();
            l.fill = C_(s, o), l.stroke = A_(s, o) || l.fill;
            var u = i.ensureUniqueItemVisual(a, "style");
            H(u, l);
          }
        }
      };
    }
  }
}, aU = ["color", "borderColor"], oU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      this.group.removeClipPath(), this._progressiveEls = null, this._updateDrawMode(e), this._isLargeDraw ? this._renderLarge(e) : this._renderNormal(e);
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      this._clear(), this._updateDrawMode(e);
    }, t.prototype.incrementalRender = function(e, n, i, a) {
      this._progressiveEls = [], this._isLargeDraw ? this._incrementalRenderLarge(e, n) : this._incrementalRenderNormal(e, n);
    }, t.prototype.eachRendered = function(e) {
      sa(this._progressiveEls || this.group, e);
    }, t.prototype._updateDrawMode = function(e) {
      var n = e.pipelineContext.large;
      (this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
    }, t.prototype._renderNormal = function(e) {
      var n = e.getData(), i = this._data, a = this.group, o = n.getLayout("isSimpleBox"), s = e.get("clip", !0), l = e.coordinateSystem, u = l.getArea && l.getArea();
      this._data || a.removeAll(), n.diff(i).add(function(c) {
        if (n.hasValue(c)) {
          var f = n.getItemLayout(c);
          if (s && Hw(u, f))
            return;
          var h = Wp(f, c, !0);
          st(h, {
            shape: {
              points: f.ends
            }
          }, e, c), Up(h, n, c, o), a.add(h), n.setItemGraphicEl(c, h);
        }
      }).update(function(c, f) {
        var h = i.getItemGraphicEl(f);
        if (!n.hasValue(c)) {
          a.remove(h);
          return;
        }
        var v = n.getItemLayout(c);
        if (s && Hw(u, v)) {
          a.remove(h);
          return;
        }
        h ? (Ne(h, {
          shape: {
            points: v.ends
          }
        }, e, c), un(h)) : h = Wp(v), Up(h, n, c, o), a.add(h), n.setItemGraphicEl(c, h);
      }).remove(function(c) {
        var f = i.getItemGraphicEl(c);
        f && a.remove(f);
      }).execute(), this._data = n;
    }, t.prototype._renderLarge = function(e) {
      this._clear(), qw(e, this.group);
      var n = e.get("clip", !0) ? ec(e.coordinateSystem, !1, e) : null;
      n ? this.group.setClipPath(n) : this.group.removeClipPath();
    }, t.prototype._incrementalRenderNormal = function(e, n) {
      for (var i = n.getData(), a = i.getLayout("isSimpleBox"), o; (o = e.next()) != null; ) {
        var s = i.getItemLayout(o), l = Wp(s);
        Up(l, i, o, a), l.incremental = !0, this.group.add(l), this._progressiveEls.push(l);
      }
    }, t.prototype._incrementalRenderLarge = function(e, n) {
      qw(n, this.group, this._progressiveEls, !0);
    }, t.prototype.remove = function(e) {
      this._clear();
    }, t.prototype._clear = function() {
      this.group.removeAll(), this._data = null;
    }, t.type = "candlestick", t;
  }(Qe)
), sU = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), lU = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "normalCandlestickBox", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new sU();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.points;
      this.__simpleBox ? (e.moveTo(i[4][0], i[4][1]), e.lineTo(i[6][0], i[6][1])) : (e.moveTo(i[0][0], i[0][1]), e.lineTo(i[1][0], i[1][1]), e.lineTo(i[2][0], i[2][1]), e.lineTo(i[3][0], i[3][1]), e.closePath(), e.moveTo(i[4][0], i[4][1]), e.lineTo(i[5][0], i[5][1]), e.moveTo(i[6][0], i[6][1]), e.lineTo(i[7][0], i[7][1]));
    }, t;
  }(Te)
);
function Wp(r, t, e) {
  var n = r.ends;
  return new lU({
    shape: {
      points: e ? uU(n, r) : n
    },
    z2: 100
  });
}
function Hw(r, t) {
  for (var e = !0, n = 0; n < t.ends.length; n++)
    if (r.contain(t.ends[n][0], t.ends[n][1])) {
      e = !1;
      break;
    }
  return e;
}
function Up(r, t, e, n) {
  var i = t.getItemModel(e);
  r.useStyle(t.getItemVisual(e, "style")), r.style.strokeNoScale = !0, r.__simpleBox = n, Ft(r, i);
  var a = t.getItemLayout(e).sign;
  M(r.states, function(s, l) {
    var u = i.getModel(l), c = C_(a, u), f = A_(a, u) || c, h = s.style || (s.style = {});
    c && (h.fill = c), f && (h.stroke = f);
  });
  var o = i.getModel("emphasis");
  ut(r, o.get("focus"), o.get("blurScope"), o.get("disabled"));
}
function uU(r, t) {
  return U(r, function(e) {
    return e = e.slice(), e[1] = t.initBaseline, e;
  });
}
var cU = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), Yp = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n.type = "largeCandlestickBox", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new cU();
    }, t.prototype.buildPath = function(e, n) {
      for (var i = n.points, a = 0; a < i.length; )
        if (this.__sign === i[a++]) {
          var o = i[a++];
          e.moveTo(o, i[a++]), e.lineTo(o, i[a++]);
        } else
          a += 3;
    }, t;
  }(Te)
);
function qw(r, t, e, n) {
  var i = r.getData(), a = i.getLayout("largePoints"), o = new Yp({
    shape: {
      points: a
    },
    __sign: 1,
    ignoreCoarsePointer: !0
  });
  t.add(o);
  var s = new Yp({
    shape: {
      points: a
    },
    __sign: -1,
    ignoreCoarsePointer: !0
  });
  t.add(s);
  var l = new Yp({
    shape: {
      points: a
    },
    __sign: 0,
    ignoreCoarsePointer: !0
  });
  t.add(l), Zp(1, o, r), Zp(-1, s, r), Zp(0, l, r), n && (o.incremental = !0, s.incremental = !0), e && e.push(o, s);
}
function Zp(r, t, e, n) {
  var i = A_(r, e) || C_(r, e), a = e.getModel("itemStyle").getItemStyle(aU);
  t.useStyle(a), t.style.fill = null, t.style.stroke = i;
}
var yP = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.defaultValueDimensions = [{
        name: "open",
        defaultTooltip: !0
      }, {
        name: "close",
        defaultTooltip: !0
      }, {
        name: "lowest",
        defaultTooltip: !0
      }, {
        name: "highest",
        defaultTooltip: !0
      }], e;
    }
    return t.prototype.getShadowDim = function() {
      return "open";
    }, t.prototype.brushSelector = function(e, n, i) {
      var a = n.getItemLayout(e);
      return a && i.rect(a.brushRect);
    }, t.type = "series.candlestick", t.dependencies = ["xAxis", "yAxis", "grid"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "cartesian2d",
      legendHoverLink: !0,
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      layout: null,
      clip: !0,
      itemStyle: {
        color: "#eb5454",
        color0: "#47b262",
        borderColor: "#eb5454",
        borderColor0: "#47b262",
        borderColorDoji: null,
        // borderColor: '#d24040',
        // borderColor0: '#398f4f',
        borderWidth: 1
      },
      emphasis: {
        itemStyle: {
          borderWidth: 2
        }
      },
      barMaxWidth: null,
      barMinWidth: null,
      barWidth: null,
      large: !0,
      largeThreshold: 600,
      progressive: 3e3,
      progressiveThreshold: 1e4,
      progressiveChunkMode: "mod",
      animationEasing: "linear",
      animationDuration: 300
    }, t;
  }(it)
);
_t(yP, pP, !0);
function fU(r) {
  !r || !q(r.series) || M(r.series, function(t) {
    ue(t) && t.type === "k" && (t.type = "candlestick");
  });
}
var hU = {
  seriesType: "candlestick",
  plan: zs(),
  reset: function(r) {
    var t = r.coordinateSystem, e = r.getData(), n = vU(r, e), i = 0, a = 1, o = ["x", "y"], s = e.getDimensionIndex(e.mapDimension(o[i])), l = U(e.mapDimensionsAll(o[a]), e.getDimensionIndex, e), u = l[0], c = l[1], f = l[2], h = l[3];
    if (e.setLayout({
      candleWidth: n,
      // The value is experimented visually.
      isSimpleBox: n <= 1.3
    }), s < 0 || l.length < 4)
      return;
    return {
      progress: r.pipelineContext.large ? d : v
    };
    function v(p, g) {
      for (var m, y = g.getStore(); (m = p.next()) != null; ) {
        var _ = y.get(s, m), b = y.get(u, m), S = y.get(c, m), x = y.get(f, m), w = y.get(h, m), C = Math.min(b, S), D = Math.max(b, S), A = F(C, _), T = F(D, _), L = F(x, _), E = F(w, _), I = [];
        O(I, T, 0), O(I, A, 1), I.push(G(E), G(T), G(L), G(A));
        var P = g.getItemModel(m), R = !!P.get(["itemStyle", "borderColorDoji"]);
        g.setItemLayout(m, {
          sign: Ww(y, m, b, S, c, R),
          initBaseline: b > S ? T[a] : A[a],
          ends: I,
          brushRect: z(x, w, _)
        });
      }
      function F(W, Y) {
        var j = [];
        return j[i] = Y, j[a] = W, isNaN(Y) || isNaN(W) ? [NaN, NaN] : t.dataToPoint(j);
      }
      function O(W, Y, j) {
        var ee = Y.slice(), ie = Y.slice();
        ee[i] = Pf(ee[i] + n / 2, 1, !1), ie[i] = Pf(ie[i] - n / 2, 1, !0), j ? W.push(ee, ie) : W.push(ie, ee);
      }
      function z(W, Y, j) {
        var ee = F(W, j), ie = F(Y, j);
        return ee[i] -= n / 2, ie[i] -= n / 2, {
          x: ee[0],
          y: ee[1],
          width: n,
          height: ie[1] - ee[1]
        };
      }
      function G(W) {
        return W[i] = Pf(W[i], 1), W;
      }
    }
    function d(p, g) {
      for (var m = Mn(p.count * 4), y = 0, _, b = [], S = [], x, w = g.getStore(), C = !!r.get(["itemStyle", "borderColorDoji"]); (x = p.next()) != null; ) {
        var D = w.get(s, x), A = w.get(u, x), T = w.get(c, x), L = w.get(f, x), E = w.get(h, x);
        if (isNaN(D) || isNaN(L) || isNaN(E)) {
          m[y++] = NaN, y += 3;
          continue;
        }
        m[y++] = Ww(w, x, A, T, c, C), b[i] = D, b[a] = L, _ = t.dataToPoint(b, null, S), m[y++] = _ ? _[0] : NaN, m[y++] = _ ? _[1] : NaN, b[a] = E, _ = t.dataToPoint(b, null, S), m[y++] = _ ? _[1] : NaN;
      }
      g.setLayout("largePoints", m);
    }
  }
};
function Ww(r, t, e, n, i, a) {
  var o;
  return e > n ? o = -1 : e < n ? o = 1 : o = a ? 0 : t > 0 ? r.get(i, t - 1) <= n ? 1 : -1 : 1, o;
}
function vU(r, t) {
  var e = r.getBaseAxis(), n, i = e.type === "category" ? e.getBandWidth() : (n = e.getExtent(), Math.abs(n[1] - n[0]) / t.count()), a = X(me(r.get("barMaxWidth"), i), i), o = X(me(r.get("barMinWidth"), 1), i), s = r.get("barWidth");
  return s != null ? X(s, i) : Math.max(Math.min(i / 2, a), o);
}
function dU(r) {
  r.registerChartView(oU), r.registerSeriesModel(yP), r.registerPreprocessor(fU), r.registerVisual(iU), r.registerLayout(hU);
}
function Uw(r, t) {
  var e = t.rippleEffectColor || t.color;
  r.eachChild(function(n) {
    n.attr({
      z: t.z,
      zlevel: t.zlevel,
      style: {
        stroke: t.brushType === "stroke" ? e : null,
        fill: t.brushType === "fill" ? e : null
      }
    });
  });
}
var pU = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n) {
      var i = r.call(this) || this, a = new Ju(e, n), o = new fe();
      return i.add(a), i.add(o), i.updateData(e, n), i;
    }
    return t.prototype.stopEffectAnimation = function() {
      this.childAt(1).removeAll();
    }, t.prototype.startEffectAnimation = function(e) {
      for (var n = e.symbolType, i = e.color, a = e.rippleNumber, o = this.childAt(1), s = 0; s < a; s++) {
        var l = yt(n, -1, -1, 2, 2, i);
        l.attr({
          style: {
            strokeNoScale: !0
          },
          z2: 99,
          silent: !0,
          scaleX: 0.5,
          scaleY: 0.5
        });
        var u = -s / a * e.period + e.effectOffset;
        l.animate("", !0).when(e.period, {
          scaleX: e.rippleScale / 2,
          scaleY: e.rippleScale / 2
        }).delay(u).start(), l.animateStyle(!0).when(e.period, {
          opacity: 0
        }).delay(u).start(), o.add(l);
      }
      Uw(o, e);
    }, t.prototype.updateEffectAnimation = function(e) {
      for (var n = this._effectCfg, i = this.childAt(1), a = ["symbolType", "period", "rippleScale", "rippleNumber"], o = 0; o < a.length; o++) {
        var s = a[o];
        if (n[s] !== e[s]) {
          this.stopEffectAnimation(), this.startEffectAnimation(e);
          return;
        }
      }
      Uw(i, e);
    }, t.prototype.highlight = function() {
      oi(this);
    }, t.prototype.downplay = function() {
      si(this);
    }, t.prototype.getSymbolType = function() {
      var e = this.childAt(0);
      return e && e.getSymbolType();
    }, t.prototype.updateData = function(e, n) {
      var i = this, a = e.hostModel;
      this.childAt(0).updateData(e, n);
      var o = this.childAt(1), s = e.getItemModel(n), l = e.getItemVisual(n, "symbol"), u = $s(e.getItemVisual(n, "symbolSize")), c = e.getItemVisual(n, "style"), f = c && c.fill, h = s.getModel("emphasis");
      o.setScale(u), o.traverse(function(g) {
        g.setStyle("fill", f);
      });
      var v = Co(e.getItemVisual(n, "symbolOffset"), u);
      v && (o.x = v[0], o.y = v[1]);
      var d = e.getItemVisual(n, "symbolRotate");
      o.rotation = (d || 0) * Math.PI / 180 || 0;
      var p = {};
      p.showEffectOn = a.get("showEffectOn"), p.rippleScale = s.get(["rippleEffect", "scale"]), p.brushType = s.get(["rippleEffect", "brushType"]), p.period = s.get(["rippleEffect", "period"]) * 1e3, p.effectOffset = n / e.count(), p.z = a.getShallow("z") || 0, p.zlevel = a.getShallow("zlevel") || 0, p.symbolType = l, p.color = f, p.rippleEffectColor = s.get(["rippleEffect", "color"]), p.rippleNumber = s.get(["rippleEffect", "number"]), p.showEffectOn === "render" ? (this._effectCfg ? this.updateEffectAnimation(p) : this.startEffectAnimation(p), this._effectCfg = p) : (this._effectCfg = null, this.stopEffectAnimation(), this.onHoverStateChange = function(g) {
        g === "emphasis" ? p.showEffectOn !== "render" && i.startEffectAnimation(p) : g === "normal" && p.showEffectOn !== "render" && i.stopEffectAnimation();
      }), this._effectCfg = p, ut(this, h.get("focus"), h.get("blurScope"), h.get("disabled"));
    }, t.prototype.fadeOut = function(e) {
      e && e();
    }, t;
  }(fe)
), gU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function() {
      this._symbolDraw = new Qu(pU);
    }, t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this._symbolDraw;
      o.updateData(a, {
        clipShape: this._getClipShape(e)
      }), this.group.add(o.group);
    }, t.prototype._getClipShape = function(e) {
      var n = e.coordinateSystem, i = n && n.getArea && n.getArea();
      return e.get("clip", !0) ? i : null;
    }, t.prototype.updateTransform = function(e, n, i) {
      var a = e.getData();
      this.group.dirty();
      var o = tc("").reset(e, n, i);
      o.progress && o.progress({
        start: 0,
        end: a.count(),
        count: a.count()
      }, a), this._symbolDraw.updateLayout();
    }, t.prototype._updateGroupTransform = function(e) {
      var n = e.coordinateSystem;
      n && n.getRoamTransform && (this.group.transform = G3(n.getRoamTransform()), this.group.decomposeTransform());
    }, t.prototype.remove = function(e, n) {
      this._symbolDraw && this._symbolDraw.remove(!0);
    }, t.type = "effectScatter", t;
  }(Qe)
), mU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return gi(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.brushSelector = function(e, n, i) {
      return i.point(n.getItemLayout(e));
    }, t.type = "series.effectScatter", t.dependencies = ["grid", "polar"], t.defaultOption = {
      coordinateSystem: "cartesian2d",
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      effectType: "ripple",
      progressive: 0,
      // When to show the effect, option: 'render'|'emphasis'
      showEffectOn: "render",
      clip: !0,
      // Ripple effect config
      rippleEffect: {
        period: 4,
        // Scale of ripple
        scale: 2.5,
        // Brush type can be fill or stroke
        brushType: "fill",
        // Ripple number
        number: 3
      },
      universalTransition: {
        divideShape: "clone"
      },
      // Cartesian coordinate system
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      // Polar coordinate system
      // polarIndex: 0,
      // Geo coordinate system
      // geoIndex: 0,
      // symbol: null,        // 图形类型
      symbolSize: 10
      // 图形大小，半宽（半径）参数，当图形为方向或菱形则总宽度为symbolSize * 2
      // symbolRotate: null,  // 图形旋转控制
      // itemStyle: {
      //     opacity: 1
      // }
    }, t;
  }(it)
);
function yU(r) {
  r.registerChartView(gU), r.registerSeriesModel(mU), r.registerLayout(tc("effectScatter"));
}
var _P = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this) || this;
      return a.add(a.createLine(e, n, i)), a._updateEffectSymbol(e, n), a;
    }
    return t.prototype.createLine = function(e, n, i) {
      return new p_(e, n, i);
    }, t.prototype._updateEffectSymbol = function(e, n) {
      var i = e.getItemModel(n), a = i.getModel("effect"), o = a.get("symbolSize"), s = a.get("symbol");
      q(o) || (o = [o, o]);
      var l = e.getItemVisual(n, "style"), u = a.get("color") || l && l.stroke, c = this.childAt(1);
      this._symbolType !== s && (this.remove(c), c = yt(s, -0.5, -0.5, 1, 1, u), c.z2 = 100, c.culling = !0, this.add(c)), c && (c.setStyle("shadowColor", u), c.setStyle(a.getItemStyle(["color"])), c.scaleX = o[0], c.scaleY = o[1], c.setColor(u), this._symbolType = s, this._symbolScale = o, this._updateEffectAnimation(e, a, n));
    }, t.prototype._updateEffectAnimation = function(e, n, i) {
      var a = this.childAt(1);
      if (a) {
        var o = e.getItemLayout(i), s = n.get("period") * 1e3, l = n.get("loop"), u = n.get("roundTrip"), c = n.get("constantSpeed"), f = Et(n.get("delay"), function(v) {
          return v / e.count() * s / 3;
        });
        if (a.ignore = !0, this._updateAnimationPoints(a, o), c > 0 && (s = this._getLineLength(a) / c * 1e3), s !== this._period || l !== this._loop || u !== this._roundTrip) {
          a.stopAnimation();
          var h = void 0;
          oe(f) ? h = f(i) : h = f, a.__t > 0 && (h = -s * a.__t), this._animateSymbol(a, s, h, l, u);
        }
        this._period = s, this._loop = l, this._roundTrip = u;
      }
    }, t.prototype._animateSymbol = function(e, n, i, a, o) {
      if (n > 0) {
        e.__t = 0;
        var s = this, l = e.animate("", a).when(o ? n * 2 : n, {
          __t: o ? 2 : 1
        }).delay(i).during(function() {
          s._updateSymbolPosition(e);
        });
        a || l.done(function() {
          s.remove(e);
        }), l.start();
      }
    }, t.prototype._getLineLength = function(e) {
      return Ri(e.__p1, e.__cp1) + Ri(e.__cp1, e.__p2);
    }, t.prototype._updateAnimationPoints = function(e, n) {
      e.__p1 = n[0], e.__p2 = n[1], e.__cp1 = n[2] || [(n[0][0] + n[1][0]) / 2, (n[0][1] + n[1][1]) / 2];
    }, t.prototype.updateData = function(e, n, i) {
      this.childAt(0).updateData(e, n, i), this._updateEffectSymbol(e, n);
    }, t.prototype._updateSymbolPosition = function(e) {
      var n = e.__p1, i = e.__p2, a = e.__cp1, o = e.__t < 1 ? e.__t : 2 - e.__t, s = [e.x, e.y], l = s.slice(), u = Lt, c = qg;
      s[0] = u(n[0], a[0], i[0], o), s[1] = u(n[1], a[1], i[1], o);
      var f = e.__t < 1 ? c(n[0], a[0], i[0], o) : c(i[0], a[0], n[0], 1 - o), h = e.__t < 1 ? c(n[1], a[1], i[1], o) : c(i[1], a[1], n[1], 1 - o);
      e.rotation = -Math.atan2(h, f) - Math.PI / 2, (this._symbolType === "line" || this._symbolType === "rect" || this._symbolType === "roundRect") && (e.__lastT !== void 0 && e.__lastT < e.__t ? (e.scaleY = Ri(l, s) * 1.05, o === 1 && (s[0] = l[0] + (s[0] - l[0]) / 2, s[1] = l[1] + (s[1] - l[1]) / 2)) : e.__lastT === 1 ? e.scaleY = 2 * Ri(n, s) : e.scaleY = this._symbolScale[1]), e.__lastT = e.__t, e.ignore = !1, e.x = s[0], e.y = s[1];
    }, t.prototype.updateLayout = function(e, n) {
      this.childAt(0).updateLayout(e, n);
      var i = e.getItemModel(n).getModel("effect");
      this._updateEffectAnimation(e, i, n);
    }, t;
  }(fe)
), bP = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i) {
      var a = r.call(this) || this;
      return a._createPolyline(e, n, i), a;
    }
    return t.prototype._createPolyline = function(e, n, i) {
      var a = e.getItemLayout(n), o = new sr({
        shape: {
          points: a
        }
      });
      this.add(o), this._updateCommonStl(e, n, i);
    }, t.prototype.updateData = function(e, n, i) {
      var a = e.hostModel, o = this.childAt(0), s = {
        shape: {
          points: e.getItemLayout(n)
        }
      };
      Ne(o, s, a, n), this._updateCommonStl(e, n, i);
    }, t.prototype._updateCommonStl = function(e, n, i) {
      var a = this.childAt(0), o = e.getItemModel(n), s = i && i.emphasisLineStyle, l = i && i.focus, u = i && i.blurScope, c = i && i.emphasisDisabled;
      if (!i || e.hasItemOption) {
        var f = o.getModel("emphasis");
        s = f.getModel("lineStyle").getLineStyle(), c = f.get("disabled"), l = f.get("focus"), u = f.get("blurScope");
      }
      a.useStyle(e.getItemVisual(n, "style")), a.style.fill = null, a.style.strokeNoScale = !0;
      var h = a.ensureState("emphasis");
      h.style = s, ut(this, l, u, c);
    }, t.prototype.updateLayout = function(e, n) {
      var i = this.childAt(0);
      i.setShape("points", e.getItemLayout(n));
    }, t;
  }(fe)
), _U = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e._lastFrame = 0, e._lastFramePercent = 0, e;
    }
    return t.prototype.createLine = function(e, n, i) {
      return new bP(e, n, i);
    }, t.prototype._updateAnimationPoints = function(e, n) {
      this._points = n;
      for (var i = [0], a = 0, o = 1; o < n.length; o++) {
        var s = n[o - 1], l = n[o];
        a += Ri(s, l), i.push(a);
      }
      if (a === 0) {
        this._length = 0;
        return;
      }
      for (var o = 0; o < i.length; o++)
        i[o] /= a;
      this._offsets = i, this._length = a;
    }, t.prototype._getLineLength = function() {
      return this._length;
    }, t.prototype._updateSymbolPosition = function(e) {
      var n = e.__t < 1 ? e.__t : 2 - e.__t, i = this._points, a = this._offsets, o = i.length;
      if (a) {
        var s = this._lastFrame, l;
        if (n < this._lastFramePercent) {
          var u = Math.min(s + 1, o - 1);
          for (l = u; l >= 0 && !(a[l] <= n); l--)
            ;
          l = Math.min(l, o - 2);
        } else {
          for (l = s; l < o && !(a[l] > n); l++)
            ;
          l = Math.min(l - 1, o - 2);
        }
        var c = (n - a[l]) / (a[l + 1] - a[l]), f = i[l], h = i[l + 1];
        e.x = f[0] * (1 - c) + c * h[0], e.y = f[1] * (1 - c) + c * h[1];
        var v = e.__t < 1 ? h[0] - f[0] : f[0] - h[0], d = e.__t < 1 ? h[1] - f[1] : f[1] - h[1];
        e.rotation = -Math.atan2(d, v) - Math.PI / 2, this._lastFrame = l, this._lastFramePercent = n, e.ignore = !1;
      }
    }, t;
  }(_P)
), bU = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
      this.polyline = !1, this.curveness = 0, this.segs = [];
    }
    return r;
  }()
), SU = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e) {
      var n = r.call(this, e) || this;
      return n._off = 0, n.hoverDataIdx = -1, n;
    }
    return t.prototype.reset = function() {
      this.notClear = !1, this._off = 0;
    }, t.prototype.getDefaultStyle = function() {
      return {
        stroke: "#000",
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new bU();
    }, t.prototype.buildPath = function(e, n) {
      var i = n.segs, a = n.curveness, o;
      if (n.polyline)
        for (o = this._off; o < i.length; ) {
          var s = i[o++];
          if (s > 0) {
            e.moveTo(i[o++], i[o++]);
            for (var l = 1; l < s; l++)
              e.lineTo(i[o++], i[o++]);
          }
        }
      else
        for (o = this._off; o < i.length; ) {
          var u = i[o++], c = i[o++], f = i[o++], h = i[o++];
          if (e.moveTo(u, c), a > 0) {
            var v = (u + f) / 2 - (c - h) * a, d = (c + h) / 2 - (f - u) * a;
            e.quadraticCurveTo(v, d, f, h);
          } else
            e.lineTo(f, h);
        }
      this.incremental && (this._off = o, this.notClear = !0);
    }, t.prototype.findDataIndex = function(e, n) {
      var i = this.shape, a = i.segs, o = i.curveness, s = this.style.lineWidth;
      if (i.polyline)
        for (var l = 0, u = 0; u < a.length; ) {
          var c = a[u++];
          if (c > 0)
            for (var f = a[u++], h = a[u++], v = 1; v < c; v++) {
              var d = a[u++], p = a[u++];
              if (Ei(f, h, d, p, s, e, n))
                return l;
            }
          l++;
        }
      else
        for (var l = 0, u = 0; u < a.length; ) {
          var f = a[u++], h = a[u++], d = a[u++], p = a[u++];
          if (o > 0) {
            var g = (f + d) / 2 - (h - p) * o, m = (h + p) / 2 - (d - f) * o;
            if (WT(f, h, g, m, d, p, s, e, n))
              return l;
          } else if (Ei(f, h, d, p, s, e, n))
            return l;
          l++;
        }
      return -1;
    }, t.prototype.contain = function(e, n) {
      var i = this.transformCoordToLocal(e, n), a = this.getBoundingRect();
      if (e = i[0], n = i[1], a.contain(e, n)) {
        var o = this.hoverDataIdx = this.findDataIndex(e, n);
        return o >= 0;
      }
      return this.hoverDataIdx = -1, !1;
    }, t.prototype.getBoundingRect = function() {
      var e = this._rect;
      if (!e) {
        for (var n = this.shape, i = n.segs, a = 1 / 0, o = 1 / 0, s = -1 / 0, l = -1 / 0, u = 0; u < i.length; ) {
          var c = i[u++], f = i[u++];
          a = Math.min(c, a), s = Math.max(c, s), o = Math.min(f, o), l = Math.max(f, l);
        }
        e = this._rect = new xe(a, o, s, l);
      }
      return e;
    }, t;
  }(Te)
), xU = (
  /** @class */
  function() {
    function r() {
      this.group = new fe();
    }
    return r.prototype.updateData = function(t) {
      this._clear();
      var e = this._create();
      e.setShape({
        segs: t.getLayout("linesPoints")
      }), this._setCommon(e, t);
    }, r.prototype.incrementalPrepareUpdate = function(t) {
      this.group.removeAll(), this._clear();
    }, r.prototype.incrementalUpdate = function(t, e) {
      var n = this._newAdded[0], i = e.getLayout("linesPoints"), a = n && n.shape.segs;
      if (a && a.length < 2e4) {
        var o = a.length, s = new Float32Array(o + i.length);
        s.set(a), s.set(i, o), n.setShape({
          segs: s
        });
      } else {
        this._newAdded = [];
        var l = this._create();
        l.incremental = !0, l.setShape({
          segs: i
        }), this._setCommon(l, e), l.__startIndex = t.start;
      }
    }, r.prototype.remove = function() {
      this._clear();
    }, r.prototype.eachRendered = function(t) {
      this._newAdded[0] && t(this._newAdded[0]);
    }, r.prototype._create = function() {
      var t = new SU({
        cursor: "default",
        ignoreCoarsePointer: !0
      });
      return this._newAdded.push(t), this.group.add(t), t;
    }, r.prototype._setCommon = function(t, e, n) {
      var i = e.hostModel;
      t.setShape({
        polyline: i.get("polyline"),
        curveness: i.get(["lineStyle", "curveness"])
      }), t.useStyle(i.getModel("lineStyle").getLineStyle()), t.style.strokeNoScale = !0;
      var a = e.getVisual("style");
      a && a.stroke && t.setStyle("stroke", a.stroke), t.setStyle("fill", null);
      var o = pe(t);
      o.seriesIndex = i.seriesIndex, t.on("mousemove", function(s) {
        o.dataIndex = null;
        var l = t.hoverDataIdx;
        l > 0 && (o.dataIndex = l + t.__startIndex);
      });
    }, r.prototype._clear = function() {
      this._newAdded = [], this.group.removeAll();
    }, r;
  }()
), SP = {
  seriesType: "lines",
  plan: zs(),
  reset: function(r) {
    var t = r.coordinateSystem;
    if (t) {
      var e = r.get("polyline"), n = r.pipelineContext.large;
      return {
        progress: function(i, a) {
          var o = [];
          if (n) {
            var s = void 0, l = i.end - i.start;
            if (e) {
              for (var u = 0, c = i.start; c < i.end; c++)
                u += r.getLineCoordsCount(c);
              s = new Float32Array(l + u * 2);
            } else
              s = new Float32Array(l * 4);
            for (var f = 0, h = [], c = i.start; c < i.end; c++) {
              var v = r.getLineCoords(c, o);
              e && (s[f++] = v);
              for (var d = 0; d < v; d++)
                h = t.dataToPoint(o[d], !1, h), s[f++] = h[0], s[f++] = h[1];
            }
            a.setLayout("linesPoints", s);
          } else
            for (var c = i.start; c < i.end; c++) {
              var p = a.getItemModel(c), v = r.getLineCoords(c, o), g = [];
              if (e)
                for (var m = 0; m < v; m++)
                  g.push(t.dataToPoint(o[m]));
              else {
                g[0] = t.dataToPoint(o[0]), g[1] = t.dataToPoint(o[1]);
                var y = p.get(["lineStyle", "curveness"]);
                +y && (g[2] = [(g[0][0] + g[1][0]) / 2 - (g[0][1] - g[1][1]) * y, (g[0][1] + g[1][1]) / 2 - (g[1][0] - g[0][0]) * y]);
              }
              a.setItemLayout(c, g);
            }
        }
      };
    }
  }
}, wU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this._updateLineDraw(a, e), s = e.get("zlevel"), l = e.get(["effect", "trailLength"]), u = i.getZr(), c = u.painter.getType() === "svg";
      c || u.painter.getLayer(s).clear(!0), this._lastZlevel != null && !c && u.configLayer(this._lastZlevel, {
        motionBlur: !1
      }), this._showEffect(e) && l > 0 && (c || u.configLayer(s, {
        motionBlur: !0,
        lastFrameAlpha: Math.max(Math.min(l / 10 + 0.9, 1), 0)
      })), o.updateData(a);
      var f = e.get("clip", !0) && ec(e.coordinateSystem, !1, e);
      f ? this.group.setClipPath(f) : this.group.removeClipPath(), this._lastZlevel = s, this._finished = !0;
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      var a = e.getData(), o = this._updateLineDraw(a, e);
      o.incrementalPrepareUpdate(a), this._clearLayer(i), this._finished = !1;
    }, t.prototype.incrementalRender = function(e, n, i) {
      this._lineDraw.incrementalUpdate(e, n.getData()), this._finished = e.end === n.getData().count();
    }, t.prototype.eachRendered = function(e) {
      this._lineDraw && this._lineDraw.eachRendered(e);
    }, t.prototype.updateTransform = function(e, n, i) {
      var a = e.getData(), o = e.pipelineContext;
      if (!this._finished || o.large || o.progressiveRender)
        return {
          update: !0
        };
      var s = SP.reset(e, n, i);
      s.progress && s.progress({
        start: 0,
        end: a.count(),
        count: a.count()
      }, a), this._lineDraw.updateLayout(), this._clearLayer(i);
    }, t.prototype._updateLineDraw = function(e, n) {
      var i = this._lineDraw, a = this._showEffect(n), o = !!n.get("polyline"), s = n.pipelineContext, l = s.large;
      return (!i || a !== this._hasEffet || o !== this._isPolyline || l !== this._isLargeDraw) && (i && i.remove(), i = this._lineDraw = l ? new xU() : new g_(o ? a ? _U : bP : a ? _P : p_), this._hasEffet = a, this._isPolyline = o, this._isLargeDraw = l), this.group.add(i.group), i;
    }, t.prototype._showEffect = function(e) {
      return !!e.get(["effect", "show"]);
    }, t.prototype._clearLayer = function(e) {
      var n = e.getZr(), i = n.painter.getType() === "svg";
      !i && this._lastZlevel != null && n.painter.getLayer(this._lastZlevel).clear(!0);
    }, t.prototype.remove = function(e, n) {
      this._lineDraw && this._lineDraw.remove(), this._lineDraw = null, this._clearLayer(n);
    }, t.prototype.dispose = function(e, n) {
      this.remove(e, n);
    }, t.type = "lines", t;
  }(Qe)
), CU = typeof Uint32Array > "u" ? Array : Uint32Array, AU = typeof Float64Array > "u" ? Array : Float64Array;
function Yw(r) {
  var t = r.data;
  t && t[0] && t[0][0] && t[0][0].coord && (r.data = U(t, function(e) {
    var n = [e[0].coord, e[1].coord], i = {
      coords: n
    };
    return e[0].name && (i.fromName = e[0].name), e[1].name && (i.toName = e[1].name), Zy([i, e[0], e[1]]);
  }));
}
var DU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.visualStyleAccessPath = "lineStyle", e.visualDrawType = "stroke", e;
    }
    return t.prototype.init = function(e) {
      e.data = e.data || [], Yw(e);
      var n = this._processFlatCoordsArray(e.data);
      this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (e.data = new Float32Array(n.count)), r.prototype.init.apply(this, arguments);
    }, t.prototype.mergeOption = function(e) {
      if (Yw(e), e.data) {
        var n = this._processFlatCoordsArray(e.data);
        this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (e.data = new Float32Array(n.count));
      }
      r.prototype.mergeOption.apply(this, arguments);
    }, t.prototype.appendData = function(e) {
      var n = this._processFlatCoordsArray(e.data);
      n.flatCoords && (this._flatCoords ? (this._flatCoords = cu(this._flatCoords, n.flatCoords), this._flatCoordsOffset = cu(this._flatCoordsOffset, n.flatCoordsOffset)) : (this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset), e.data = new Float32Array(n.count)), this.getRawData().appendData(e.data);
    }, t.prototype._getCoordsFromItemModel = function(e) {
      var n = this.getData().getItemModel(e), i = n.option instanceof Array ? n.option : n.getShallow("coords");
      return i;
    }, t.prototype.getLineCoordsCount = function(e) {
      return this._flatCoordsOffset ? this._flatCoordsOffset[e * 2 + 1] : this._getCoordsFromItemModel(e).length;
    }, t.prototype.getLineCoords = function(e, n) {
      if (this._flatCoordsOffset) {
        for (var i = this._flatCoordsOffset[e * 2], a = this._flatCoordsOffset[e * 2 + 1], o = 0; o < a; o++)
          n[o] = n[o] || [], n[o][0] = this._flatCoords[i + o * 2], n[o][1] = this._flatCoords[i + o * 2 + 1];
        return a;
      } else {
        for (var s = this._getCoordsFromItemModel(e), o = 0; o < s.length; o++)
          n[o] = n[o] || [], n[o][0] = s[o][0], n[o][1] = s[o][1];
        return s.length;
      }
    }, t.prototype._processFlatCoordsArray = function(e) {
      var n = 0;
      if (this._flatCoords && (n = this._flatCoords.length), Be(e[0])) {
        for (var i = e.length, a = new CU(i), o = new AU(i), s = 0, l = 0, u = 0, c = 0; c < i; ) {
          u++;
          var f = e[c++];
          a[l++] = s + n, a[l++] = f;
          for (var h = 0; h < f; h++) {
            var v = e[c++], d = e[c++];
            o[s++] = v, o[s++] = d;
          }
        }
        return {
          flatCoordsOffset: new Uint32Array(a.buffer, 0, l),
          flatCoords: o,
          count: u
        };
      }
      return {
        flatCoordsOffset: null,
        flatCoords: null,
        count: e.length
      };
    }, t.prototype.getInitialData = function(e, n) {
      var i = new er(["value"], this);
      return i.hasItemOption = !1, i.initData(e.data, [], function(a, o, s, l) {
        if (a instanceof Array)
          return NaN;
        i.hasItemOption = !0;
        var u = a.value;
        if (u != null)
          return u instanceof Array ? u[l] : u;
      }), i;
    }, t.prototype.formatTooltip = function(e, n, i) {
      var a = this.getData(), o = a.getItemModel(e), s = o.get("name");
      if (s)
        return s;
      var l = o.get("fromName"), u = o.get("toName"), c = [];
      return l != null && c.push(l), u != null && c.push(u), It("nameValue", {
        name: c.join(" > ")
      });
    }, t.prototype.preventIncremental = function() {
      return !!this.get(["effect", "show"]);
    }, t.prototype.getProgressive = function() {
      var e = this.option.progressive;
      return e ?? (this.option.large ? 1e4 : this.get("progressive"));
    }, t.prototype.getProgressiveThreshold = function() {
      var e = this.option.progressiveThreshold;
      return e ?? (this.option.large ? 2e4 : this.get("progressiveThreshold"));
    }, t.prototype.getZLevelKey = function() {
      var e = this.getModel("effect"), n = e.get("trailLength");
      return this.getData().count() > this.getProgressiveThreshold() ? this.id : e.get("show") && n > 0 ? n + "" : "";
    }, t.type = "series.lines", t.dependencies = ["grid", "polar", "geo", "calendar"], t.defaultOption = {
      coordinateSystem: "geo",
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      // Cartesian coordinate system
      xAxisIndex: 0,
      yAxisIndex: 0,
      symbol: ["none", "none"],
      symbolSize: [10, 10],
      // Geo coordinate system
      geoIndex: 0,
      effect: {
        show: !1,
        period: 4,
        constantSpeed: 0,
        symbol: "circle",
        symbolSize: 3,
        loop: !0,
        trailLength: 0.2
      },
      large: !1,
      // Available when large is true
      largeThreshold: 2e3,
      polyline: !1,
      clip: !0,
      label: {
        show: !1,
        position: "end"
        // distance: 5,
        // formatter: 标签文本格式器，同Tooltip.formatter，不支持异步回调
      },
      lineStyle: {
        opacity: 0.5
      }
    }, t;
  }(it)
);
function of(r) {
  return r instanceof Array || (r = [r, r]), r;
}
var TU = {
  seriesType: "lines",
  reset: function(r) {
    var t = of(r.get("symbol")), e = of(r.get("symbolSize")), n = r.getData();
    n.setVisual("fromSymbol", t && t[0]), n.setVisual("toSymbol", t && t[1]), n.setVisual("fromSymbolSize", e && e[0]), n.setVisual("toSymbolSize", e && e[1]);
    function i(a, o) {
      var s = a.getItemModel(o), l = of(s.getShallow("symbol", !0)), u = of(s.getShallow("symbolSize", !0));
      l[0] && a.setItemVisual(o, "fromSymbol", l[0]), l[1] && a.setItemVisual(o, "toSymbol", l[1]), u[0] && a.setItemVisual(o, "fromSymbolSize", u[0]), u[1] && a.setItemVisual(o, "toSymbolSize", u[1]);
    }
    return {
      dataEach: n.hasItemOption ? i : null
    };
  }
};
function MU(r) {
  r.registerChartView(wU), r.registerSeriesModel(DU), r.registerLayout(SP), r.registerVisual(TU);
}
var IU = 256, LU = (
  /** @class */
  function() {
    function r() {
      this.blurSize = 30, this.pointSize = 20, this.maxOpacity = 1, this.minOpacity = 0, this._gradientPixels = {
        inRange: null,
        outOfRange: null
      };
      var t = ji.createCanvas();
      this.canvas = t;
    }
    return r.prototype.update = function(t, e, n, i, a, o) {
      var s = this._getBrush(), l = this._getGradient(a, "inRange"), u = this._getGradient(a, "outOfRange"), c = this.pointSize + this.blurSize, f = this.canvas, h = f.getContext("2d"), v = t.length;
      f.width = e, f.height = n;
      for (var d = 0; d < v; ++d) {
        var p = t[d], g = p[0], m = p[1], y = p[2], _ = i(y);
        h.globalAlpha = _, h.drawImage(s, g - c, m - c);
      }
      if (!f.width || !f.height)
        return f;
      for (var b = h.getImageData(0, 0, f.width, f.height), S = b.data, x = 0, w = S.length, C = this.minOpacity, D = this.maxOpacity, A = D - C; x < w; ) {
        var _ = S[x + 3] / 256, T = Math.floor(_ * (IU - 1)) * 4;
        if (_ > 0) {
          var L = o(_) ? l : u;
          _ > 0 && (_ = _ * A + C), S[x++] = L[T], S[x++] = L[T + 1], S[x++] = L[T + 2], S[x++] = L[T + 3] * _ * 256;
        } else
          x += 4;
      }
      return h.putImageData(b, 0, 0), f;
    }, r.prototype._getBrush = function() {
      var t = this._brushCanvas || (this._brushCanvas = ji.createCanvas()), e = this.pointSize + this.blurSize, n = e * 2;
      t.width = n, t.height = n;
      var i = t.getContext("2d");
      return i.clearRect(0, 0, n, n), i.shadowOffsetX = n, i.shadowBlur = this.blurSize, i.shadowColor = "#000", i.beginPath(), i.arc(-e, e, this.pointSize, 0, Math.PI * 2, !0), i.closePath(), i.fill(), t;
    }, r.prototype._getGradient = function(t, e) {
      for (var n = this._gradientPixels, i = n[e] || (n[e] = new Uint8ClampedArray(256 * 4)), a = [0, 0, 0, 0], o = 0, s = 0; s < 256; s++)
        t[e](s / 255, !0, a), i[o++] = a[0], i[o++] = a[1], i[o++] = a[2], i[o++] = a[3];
      return i;
    }, r;
  }()
);
function EU(r, t, e) {
  var n = r[1] - r[0];
  t = U(t, function(o) {
    return {
      interval: [(o.interval[0] - r[0]) / n, (o.interval[1] - r[0]) / n]
    };
  });
  var i = t.length, a = 0;
  return function(o) {
    var s;
    for (s = a; s < i; s++) {
      var l = t[s].interval;
      if (l[0] <= o && o <= l[1]) {
        a = s;
        break;
      }
    }
    if (s === i)
      for (s = a - 1; s >= 0; s--) {
        var l = t[s].interval;
        if (l[0] <= o && o <= l[1]) {
          a = s;
          break;
        }
      }
    return s >= 0 && s < i && e[s];
  };
}
function PU(r, t) {
  var e = r[1] - r[0];
  return t = [(t[0] - r[0]) / e, (t[1] - r[0]) / e], function(n) {
    return n >= t[0] && n <= t[1];
  };
}
function Zw(r) {
  var t = r.dimensions;
  return t[0] === "lng" && t[1] === "lat";
}
var kU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a;
      n.eachComponent("visualMap", function(s) {
        s.eachTargetSeries(function(l) {
          l === e && (a = s);
        });
      }), this._progressiveEls = null, this.group.removeAll();
      var o = e.coordinateSystem;
      o.type === "cartesian2d" || o.type === "calendar" ? this._renderOnCartesianAndCalendar(e, i, 0, e.getData().count()) : Zw(o) && this._renderOnGeo(o, e, a, i);
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      this.group.removeAll();
    }, t.prototype.incrementalRender = function(e, n, i, a) {
      var o = n.coordinateSystem;
      o && (Zw(o) ? this.render(n, i, a) : (this._progressiveEls = [], this._renderOnCartesianAndCalendar(n, a, e.start, e.end, !0)));
    }, t.prototype.eachRendered = function(e) {
      sa(this._progressiveEls || this.group, e);
    }, t.prototype._renderOnCartesianAndCalendar = function(e, n, i, a, o) {
      var s = e.coordinateSystem, l = Do(s, "cartesian2d"), u, c, f, h;
      if (l) {
        var v = s.getAxis("x"), d = s.getAxis("y");
        u = v.getBandWidth() + 0.5, c = d.getBandWidth() + 0.5, f = v.scale.getExtent(), h = d.scale.getExtent();
      }
      for (var p = this.group, g = e.getData(), m = e.getModel(["emphasis", "itemStyle"]).getItemStyle(), y = e.getModel(["blur", "itemStyle"]).getItemStyle(), _ = e.getModel(["select", "itemStyle"]).getItemStyle(), b = e.get(["itemStyle", "borderRadius"]), S = Mt(e), x = e.getModel("emphasis"), w = x.get("focus"), C = x.get("blurScope"), D = x.get("disabled"), A = l ? [g.mapDimension("x"), g.mapDimension("y"), g.mapDimension("value")] : [g.mapDimension("time"), g.mapDimension("value")], T = i; T < a; T++) {
        var L = void 0, E = g.getItemVisual(T, "style");
        if (l) {
          var I = g.get(A[0], T), P = g.get(A[1], T);
          if (isNaN(g.get(A[2], T)) || isNaN(I) || isNaN(P) || I < f[0] || I > f[1] || P < h[0] || P > h[1])
            continue;
          var R = s.dataToPoint([I, P]);
          L = new ke({
            shape: {
              x: R[0] - u / 2,
              y: R[1] - c / 2,
              width: u,
              height: c
            },
            style: E
          });
        } else {
          if (isNaN(g.get(A[1], T)))
            continue;
          L = new ke({
            z2: 1,
            shape: s.dataToRect([g.get(A[0], T)]).contentShape,
            style: E
          });
        }
        if (g.hasItemOption) {
          var F = g.getItemModel(T), O = F.getModel("emphasis");
          m = O.getModel("itemStyle").getItemStyle(), y = F.getModel(["blur", "itemStyle"]).getItemStyle(), _ = F.getModel(["select", "itemStyle"]).getItemStyle(), b = F.get(["itemStyle", "borderRadius"]), w = O.get("focus"), C = O.get("blurScope"), D = O.get("disabled"), S = Mt(F);
        }
        L.shape.r = b;
        var z = e.getRawValue(T), G = "-";
        z && z[2] != null && (G = z[2] + ""), Bt(L, S, {
          labelFetcher: e,
          labelDataIndex: T,
          defaultOpacity: E.opacity,
          defaultText: G
        }), L.ensureState("emphasis").style = m, L.ensureState("blur").style = y, L.ensureState("select").style = _, ut(L, w, C, D), L.incremental = o, o && (L.states.emphasis.hoverLayer = !0), p.add(L), g.setItemGraphicEl(T, L), this._progressiveEls && this._progressiveEls.push(L);
      }
    }, t.prototype._renderOnGeo = function(e, n, i, a) {
      var o = i.targetVisuals.inRange, s = i.targetVisuals.outOfRange, l = n.getData(), u = this._hmLayer || this._hmLayer || new LU();
      u.blurSize = n.get("blurSize"), u.pointSize = n.get("pointSize"), u.minOpacity = n.get("minOpacity"), u.maxOpacity = n.get("maxOpacity");
      var c = e.getViewRect().clone(), f = e.getRoamTransform();
      c.applyTransform(f);
      var h = Math.max(c.x, 0), v = Math.max(c.y, 0), d = Math.min(c.width + c.x, a.getWidth()), p = Math.min(c.height + c.y, a.getHeight()), g = d - h, m = p - v, y = [l.mapDimension("lng"), l.mapDimension("lat"), l.mapDimension("value")], _ = l.mapArray(y, function(w, C, D) {
        var A = e.dataToPoint([w, C]);
        return A[0] -= h, A[1] -= v, A.push(D), A;
      }), b = i.getExtent(), S = i.type === "visualMap.continuous" ? PU(b, i.option.range) : EU(b, i.getPieceList(), i.option.selected);
      u.update(_, g, m, o.color.getNormalizer(), {
        inRange: o.color.getColorMapper(),
        outOfRange: s.color.getColorMapper()
      }, S);
      var x = new Pt({
        style: {
          width: g,
          height: m,
          x: h,
          y: v,
          image: u.canvas
        },
        silent: !0
      });
      this.group.add(x);
    }, t.type = "heatmap", t;
  }(Qe)
), RU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      return gi(null, this, {
        generateCoord: "value"
      });
    }, t.prototype.preventIncremental = function() {
      var e = Zu.get(this.get("coordinateSystem"));
      if (e && e.dimensions)
        return e.dimensions[0] === "lng" && e.dimensions[1] === "lat";
    }, t.type = "series.heatmap", t.dependencies = ["grid", "geo", "calendar"], t.defaultOption = {
      coordinateSystem: "cartesian2d",
      // zlevel: 0,
      z: 2,
      // Cartesian coordinate system
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      // Geo coordinate system
      geoIndex: 0,
      blurSize: 30,
      pointSize: 20,
      maxOpacity: 1,
      minOpacity: 0,
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      }
    }, t;
  }(it)
);
function OU(r) {
  r.registerChartView(kU), r.registerSeriesModel(RU);
}
var FU = ["itemStyle", "borderWidth"], Xw = [{
  xy: "x",
  wh: "width",
  index: 0,
  posDesc: ["left", "right"]
}, {
  xy: "y",
  wh: "height",
  index: 1,
  posDesc: ["top", "bottom"]
}], Xp = new pi(), BU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = this.group, o = e.getData(), s = this._data, l = e.coordinateSystem, u = l.getBaseAxis(), c = u.isHorizontal(), f = l.master.getRect(), h = {
        ecSize: {
          width: i.getWidth(),
          height: i.getHeight()
        },
        seriesModel: e,
        coordSys: l,
        coordSysExtent: [[f.x, f.x + f.width], [f.y, f.y + f.height]],
        isHorizontal: c,
        valueDim: Xw[+c],
        categoryDim: Xw[1 - +c]
      };
      o.diff(s).add(function(d) {
        if (o.hasValue(d)) {
          var p = Kw(o, d), g = jw(o, d, p, h), m = Jw(o, h, g);
          o.setItemGraphicEl(d, m), a.add(m), eC(m, h, g);
        }
      }).update(function(d, p) {
        var g = s.getItemGraphicEl(p);
        if (!o.hasValue(d)) {
          a.remove(g);
          return;
        }
        var m = Kw(o, d), y = jw(o, d, m, h), _ = TP(o, y);
        g && _ !== g.__pictorialShapeStr && (a.remove(g), o.setItemGraphicEl(d, null), g = null), g ? qU(g, h, y) : g = Jw(o, h, y, !0), o.setItemGraphicEl(d, g), g.__pictorialSymbolMeta = y, a.add(g), eC(g, h, y);
      }).remove(function(d) {
        var p = s.getItemGraphicEl(d);
        p && Qw(s, d, p.__pictorialSymbolMeta.animationModel, p);
      }).execute();
      var v = e.get("clip", !0) ? ec(e.coordinateSystem, !1, e) : null;
      return v ? a.setClipPath(v) : a.removeClipPath(), this._data = o, this.group;
    }, t.prototype.remove = function(e, n) {
      var i = this.group, a = this._data;
      e.get("animation") ? a && a.eachItemGraphicEl(function(o) {
        Qw(a, pe(o).dataIndex, e, o);
      }) : i.removeAll();
    }, t.type = "pictorialBar", t;
  }(Qe)
);
function jw(r, t, e, n) {
  var i = r.getItemLayout(t), a = e.get("symbolRepeat"), o = e.get("symbolClip"), s = e.get("symbolPosition") || "start", l = e.get("symbolRotate"), u = (l || 0) * Math.PI / 180 || 0, c = e.get("symbolPatternSize") || 2, f = e.isAnimationEnabled(), h = {
    dataIndex: t,
    layout: i,
    itemModel: e,
    symbolType: r.getItemVisual(t, "symbol") || "circle",
    style: r.getItemVisual(t, "style"),
    symbolClip: o,
    symbolRepeat: a,
    symbolRepeatDirection: e.get("symbolRepeatDirection"),
    symbolPatternSize: c,
    rotation: u,
    animationModel: f ? e : null,
    hoverScale: f && e.get(["emphasis", "scale"]),
    z2: e.getShallow("z", !0) || 0
  };
  NU(e, a, i, n, h), zU(r, t, i, a, o, h.boundingLength, h.pxSign, c, n, h), VU(e, h.symbolScale, u, n, h);
  var v = h.symbolSize, d = Co(e.get("symbolOffset"), v);
  return $U(e, v, i, a, o, d, s, h.valueLineWidth, h.boundingLength, h.repeatCutLength, n, h), h;
}
function NU(r, t, e, n, i) {
  var a = n.valueDim, o = r.get("symbolBoundingData"), s = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), l = s.toGlobalCoord(s.dataToCoord(0)), u = 1 - +(e[a.wh] <= 0), c;
  if (q(o)) {
    var f = [jp(s, o[0]) - l, jp(s, o[1]) - l];
    f[1] < f[0] && f.reverse(), c = f[u];
  } else o != null ? c = jp(s, o) - l : t ? c = n.coordSysExtent[a.index][u] - l : c = e[a.wh];
  i.boundingLength = c, t && (i.repeatCutLength = e[a.wh]);
  var h = a.xy === "x", v = s.inverse;
  i.pxSign = h && !v || !h && v ? c >= 0 ? 1 : -1 : c > 0 ? 1 : -1;
}
function jp(r, t) {
  return r.toGlobalCoord(r.dataToCoord(r.scale.parse(t)));
}
function zU(r, t, e, n, i, a, o, s, l, u) {
  var c = l.valueDim, f = l.categoryDim, h = Math.abs(e[f.wh]), v = r.getItemVisual(t, "symbolSize"), d;
  q(v) ? d = v.slice() : v == null ? d = ["100%", "100%"] : d = [v, v], d[f.index] = X(d[f.index], h), d[c.index] = X(d[c.index], n ? h : Math.abs(a)), u.symbolSize = d;
  var p = u.symbolScale = [d[0] / s, d[1] / s];
  p[c.index] *= (l.isHorizontal ? -1 : 1) * o;
}
function VU(r, t, e, n, i) {
  var a = r.get(FU) || 0;
  a && (Xp.attr({
    scaleX: t[0],
    scaleY: t[1],
    rotation: e
  }), Xp.updateTransform(), a /= Xp.getLineScale(), a *= t[n.valueDim.index]), i.valueLineWidth = a || 0;
}
function $U(r, t, e, n, i, a, o, s, l, u, c, f) {
  var h = c.categoryDim, v = c.valueDim, d = f.pxSign, p = Math.max(t[v.index] + s, 0), g = p;
  if (n) {
    var m = Math.abs(l), y = Et(r.get("symbolMargin"), "15%") + "", _ = !1;
    y.lastIndexOf("!") === y.length - 1 && (_ = !0, y = y.slice(0, y.length - 1));
    var b = X(y, t[v.index]), S = Math.max(p + b * 2, 0), x = _ ? 0 : b * 2, w = ET(n), C = w ? n : tC((m + x) / S), D = m - C * p;
    b = D / 2 / (_ ? C : Math.max(C - 1, 1)), S = p + b * 2, x = _ ? 0 : b * 2, !w && n !== "fixed" && (C = u ? tC((Math.abs(u) + x) / S) : 0), g = C * S - x, f.repeatTimes = C, f.symbolMargin = b;
  }
  var A = d * (g / 2), T = f.pathPosition = [];
  T[h.index] = e[h.wh] / 2, T[v.index] = o === "start" ? A : o === "end" ? l - A : l / 2, a && (T[0] += a[0], T[1] += a[1]);
  var L = f.bundlePosition = [];
  L[h.index] = e[h.xy], L[v.index] = e[v.xy];
  var E = f.barRectShape = H({}, e);
  E[v.wh] = d * Math.max(Math.abs(e[v.wh]), Math.abs(T[v.index] + A)), E[h.wh] = e[h.wh];
  var I = f.clipShape = {};
  I[h.xy] = -e[h.xy], I[h.wh] = c.ecSize[h.wh], I[v.xy] = 0, I[v.wh] = e[v.wh];
}
function xP(r) {
  var t = r.symbolPatternSize, e = yt(
    // Consider texture img, make a big size.
    r.symbolType,
    -t / 2,
    -t / 2,
    t,
    t
  );
  return e.attr({
    culling: !0
  }), e.type !== "image" && e.setStyle({
    strokeNoScale: !0
  }), e;
}
function wP(r, t, e, n) {
  var i = r.__pictorialBundle, a = e.symbolSize, o = e.valueLineWidth, s = e.pathPosition, l = t.valueDim, u = e.repeatTimes || 0, c = 0, f = a[t.valueDim.index] + o + e.symbolMargin * 2;
  for (D_(r, function(p) {
    p.__pictorialAnimationIndex = c, p.__pictorialRepeatTimes = u, c < u ? ds(p, null, d(c), e, n) : ds(p, null, {
      scaleX: 0,
      scaleY: 0
    }, e, n, function() {
      i.remove(p);
    }), c++;
  }); c < u; c++) {
    var h = xP(e);
    h.__pictorialAnimationIndex = c, h.__pictorialRepeatTimes = u, i.add(h);
    var v = d(c);
    ds(h, {
      x: v.x,
      y: v.y,
      scaleX: 0,
      scaleY: 0
    }, {
      scaleX: v.scaleX,
      scaleY: v.scaleY,
      rotation: v.rotation
    }, e, n);
  }
  function d(p) {
    var g = s.slice(), m = e.pxSign, y = p;
    return (e.symbolRepeatDirection === "start" ? m > 0 : m < 0) && (y = u - 1 - p), g[l.index] = f * (y - u / 2 + 0.5) + s[l.index], {
      x: g[0],
      y: g[1],
      scaleX: e.symbolScale[0],
      scaleY: e.symbolScale[1],
      rotation: e.rotation
    };
  }
}
function CP(r, t, e, n) {
  var i = r.__pictorialBundle, a = r.__pictorialMainPath;
  a ? ds(a, null, {
    x: e.pathPosition[0],
    y: e.pathPosition[1],
    scaleX: e.symbolScale[0],
    scaleY: e.symbolScale[1],
    rotation: e.rotation
  }, e, n) : (a = r.__pictorialMainPath = xP(e), i.add(a), ds(a, {
    x: e.pathPosition[0],
    y: e.pathPosition[1],
    scaleX: 0,
    scaleY: 0,
    rotation: e.rotation
  }, {
    scaleX: e.symbolScale[0],
    scaleY: e.symbolScale[1]
  }, e, n));
}
function AP(r, t, e) {
  var n = H({}, t.barRectShape), i = r.__pictorialBarRect;
  i ? ds(i, null, {
    shape: n
  }, t, e) : (i = r.__pictorialBarRect = new ke({
    z2: 2,
    shape: n,
    silent: !0,
    style: {
      stroke: "transparent",
      fill: "transparent",
      lineWidth: 0
    }
  }), i.disableMorphing = !0, r.add(i));
}
function DP(r, t, e, n) {
  if (e.symbolClip) {
    var i = r.__pictorialClipPath, a = H({}, e.clipShape), o = t.valueDim, s = e.animationModel, l = e.dataIndex;
    if (i)
      Ne(i, {
        shape: a
      }, s, l);
    else {
      a[o.wh] = 0, i = new ke({
        shape: a
      }), r.__pictorialBundle.setClipPath(i), r.__pictorialClipPath = i;
      var u = {};
      u[o.wh] = e.clipShape[o.wh], wo[n ? "updateProps" : "initProps"](i, {
        shape: u
      }, s, l);
    }
  }
}
function Kw(r, t) {
  var e = r.getItemModel(t);
  return e.getAnimationDelayParams = GU, e.isAnimationEnabled = HU, e;
}
function GU(r) {
  return {
    index: r.__pictorialAnimationIndex,
    count: r.__pictorialRepeatTimes
  };
}
function HU() {
  return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation");
}
function Jw(r, t, e, n) {
  var i = new fe(), a = new fe();
  return i.add(a), i.__pictorialBundle = a, a.x = e.bundlePosition[0], a.y = e.bundlePosition[1], e.symbolRepeat ? wP(i, t, e) : CP(i, t, e), AP(i, e, n), DP(i, t, e, n), i.__pictorialShapeStr = TP(r, e), i.__pictorialSymbolMeta = e, i;
}
function qU(r, t, e) {
  var n = e.animationModel, i = e.dataIndex, a = r.__pictorialBundle;
  Ne(a, {
    x: e.bundlePosition[0],
    y: e.bundlePosition[1]
  }, n, i), e.symbolRepeat ? wP(r, t, e, !0) : CP(r, t, e, !0), AP(r, e, !0), DP(r, t, e, !0);
}
function Qw(r, t, e, n) {
  var i = n.__pictorialBarRect;
  i && i.removeTextContent();
  var a = [];
  D_(n, function(o) {
    a.push(o);
  }), n.__pictorialMainPath && a.push(n.__pictorialMainPath), n.__pictorialClipPath && (e = null), M(a, function(o) {
    Ji(o, {
      scaleX: 0,
      scaleY: 0
    }, e, t, function() {
      n.parent && n.parent.remove(n);
    });
  }), r.setItemGraphicEl(t, null);
}
function TP(r, t) {
  return [r.getItemVisual(t.dataIndex, "symbol") || "none", !!t.symbolRepeat, !!t.symbolClip].join(":");
}
function D_(r, t, e) {
  M(r.__pictorialBundle.children(), function(n) {
    n !== r.__pictorialBarRect && t.call(e, n);
  });
}
function ds(r, t, e, n, i, a) {
  t && r.attr(t), n.symbolClip && !i ? e && r.attr(e) : e && wo[i ? "updateProps" : "initProps"](r, e, n.animationModel, n.dataIndex, a);
}
function eC(r, t, e) {
  var n = e.dataIndex, i = e.itemModel, a = i.getModel("emphasis"), o = a.getModel("itemStyle").getItemStyle(), s = i.getModel(["blur", "itemStyle"]).getItemStyle(), l = i.getModel(["select", "itemStyle"]).getItemStyle(), u = i.getShallow("cursor"), c = a.get("focus"), f = a.get("blurScope"), h = a.get("scale");
  D_(r, function(p) {
    if (p instanceof Pt) {
      var g = p.style;
      p.useStyle(H({
        // TODO other properties like dx, dy ?
        image: g.image,
        x: g.x,
        y: g.y,
        width: g.width,
        height: g.height
      }, e.style));
    } else
      p.useStyle(e.style);
    var m = p.ensureState("emphasis");
    m.style = o, h && (m.scaleX = p.scaleX * 1.1, m.scaleY = p.scaleY * 1.1), p.ensureState("blur").style = s, p.ensureState("select").style = l, u && (p.cursor = u), p.z2 = e.z2;
  });
  var v = t.valueDim.posDesc[+(e.boundingLength > 0)], d = r.__pictorialBarRect;
  d.ignoreClip = !0, Bt(d, Mt(i), {
    labelFetcher: t.seriesModel,
    labelDataIndex: n,
    defaultText: xs(t.seriesModel.getData(), n),
    inheritColor: e.style.fill,
    defaultOpacity: e.style.opacity,
    defaultOutsidePosition: v
  }), ut(r, c, f, a.get("disabled"));
}
function tC(r) {
  var t = Math.round(r);
  return Math.abs(r - t) < 1e-4 ? t : Math.ceil(r);
}
var WU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.hasSymbolVisual = !0, e.defaultSymbol = "roundRect", e;
    }
    return t.prototype.getInitialData = function(e) {
      return e.stack = null, r.prototype.getInitialData.apply(this, arguments);
    }, t.type = "series.pictorialBar", t.dependencies = ["grid"], t.defaultOption = la(Mu.defaultOption, {
      symbol: "circle",
      symbolSize: null,
      symbolRotate: null,
      symbolPosition: null,
      symbolOffset: null,
      symbolMargin: null,
      symbolRepeat: !1,
      symbolRepeatDirection: "end",
      symbolClip: !1,
      symbolBoundingData: null,
      symbolPatternSize: 400,
      barGap: "-100%",
      // Pictorial bar do not clip by default because in many cases
      // xAxis and yAxis are not displayed and it's expected not to clip
      clip: !1,
      // z can be set in data item, which is z2 actually.
      // Disable progressive
      progressive: 0,
      emphasis: {
        // By default pictorialBar do not hover scale. Hover scale is not suitable
        // for the case that both has foreground and background.
        scale: !1
      },
      select: {
        itemStyle: {
          borderColor: "#212121"
        }
      }
    }), t;
  }(Mu)
);
function UU(r) {
  r.registerChartView(BU), r.registerSeriesModel(WU), r.registerLayout(r.PRIORITY.VISUAL.LAYOUT, ye(cL, "pictorialBar")), r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, fL("pictorialBar"));
}
var YU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._layers = [], e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = e.getData(), o = this, s = this.group, l = e.getLayerSeries(), u = a.getLayout("layoutInfo"), c = u.rect, f = u.boundaryGap;
      s.x = 0, s.y = c.y + f[0];
      function h(g) {
        return g.name;
      }
      var v = new li(this._layersSeries || [], l, h, h), d = [];
      v.add(Q(p, this, "add")).update(Q(p, this, "update")).remove(Q(p, this, "remove")).execute();
      function p(g, m, y) {
        var _ = o._layers;
        if (g === "remove") {
          s.remove(_[m]);
          return;
        }
        for (var b = [], S = [], x, w = l[m].indices, C = 0; C < w.length; C++) {
          var D = a.getItemLayout(w[C]), A = D.x, T = D.y0, L = D.y;
          b.push(A, T), S.push(A, T + L), x = a.getItemVisual(w[C], "style");
        }
        var E, I = a.getItemLayout(w[0]), P = e.getModel("label"), R = P.get("margin"), F = e.getModel("emphasis");
        if (g === "add") {
          var O = d[m] = new fe();
          E = new QL({
            shape: {
              points: b,
              stackedOnPoints: S,
              smooth: 0.4,
              stackedOnSmooth: 0.4,
              smoothConstraint: !1
            },
            z2: 0
          }), O.add(E), s.add(O), e.isAnimationEnabled() && E.setClipPath(ZU(E.getBoundingRect(), e, function() {
            E.removeClipPath();
          }));
        } else {
          var O = _[y];
          E = O.childAt(0), s.add(O), d[m] = O, Ne(E, {
            shape: {
              points: b,
              stackedOnPoints: S
            }
          }, e), un(E);
        }
        Bt(E, Mt(e), {
          labelDataIndex: w[C - 1],
          defaultText: a.getName(w[C - 1]),
          inheritColor: x.fill
        }, {
          normal: {
            verticalAlign: "middle"
            // align: 'right'
          }
        }), E.setTextConfig({
          position: null,
          local: !0
        });
        var z = E.getTextContent();
        z && (z.x = I.x - R, z.y = I.y0 + I.y / 2), E.useStyle(x), a.setItemGraphicEl(m, E), Ft(E, e), ut(E, F.get("focus"), F.get("blurScope"), F.get("disabled"));
      }
      this._layersSeries = l, this._layers = d;
    }, t.type = "themeRiver", t;
  }(Qe)
);
function ZU(r, t, e) {
  var n = new ke({
    shape: {
      x: r.x - 10,
      y: r.y - 10,
      width: 0,
      height: r.height + 20
    }
  });
  return st(n, {
    shape: {
      x: r.x - 50,
      width: r.width + 100,
      height: r.height + 20
    }
  }, t, e), n;
}
var Kp = 2, XU = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e) {
      r.prototype.init.apply(this, arguments), this.legendVisualProvider = new nc(Q(this.getData, this), Q(this.getRawData, this));
    }, t.prototype.fixData = function(e) {
      var n = e.length, i = {}, a = am(e, function(h) {
        return i.hasOwnProperty(h[0] + "") || (i[h[0] + ""] = -1), h[2];
      }), o = [];
      a.buckets.each(function(h, v) {
        o.push({
          name: v,
          dataList: h
        });
      });
      for (var s = o.length, l = 0; l < s; ++l) {
        for (var u = o[l].name, c = 0; c < o[l].dataList.length; ++c) {
          var f = o[l].dataList[c][0] + "";
          i[f] = l;
        }
        for (var f in i)
          i.hasOwnProperty(f) && i[f] !== l && (i[f] = l, e[n] = [f, 0, u], n++);
      }
      return e;
    }, t.prototype.getInitialData = function(e, n) {
      for (var i = this.getReferringComponents("singleAxis", mt).models[0], a = i.get("type"), o = qe(e.data, function(d) {
        return d[2] !== void 0;
      }), s = this.fixData(o || []), l = [], u = this.nameMap = re(), c = 0, f = 0; f < s.length; ++f)
        l.push(s[f][Kp]), u.get(s[f][Kp]) || (u.set(s[f][Kp], c), c++);
      var h = ju(s, {
        coordDimensions: ["single"],
        dimensionsDefine: [{
          name: "time",
          type: bh(a)
        }, {
          name: "value",
          type: "float"
        }, {
          name: "name",
          type: "ordinal"
        }],
        encodeDefine: {
          single: 0,
          value: 1,
          itemName: 2
        }
      }).dimensions, v = new er(h, this);
      return v.initData(s), v;
    }, t.prototype.getLayerSeries = function() {
      for (var e = this.getData(), n = e.count(), i = [], a = 0; a < n; ++a)
        i[a] = a;
      var o = e.mapDimension("single"), s = am(i, function(u) {
        return e.get("name", u);
      }), l = [];
      return s.buckets.each(function(u, c) {
        u.sort(function(f, h) {
          return e.get(o, f) - e.get(o, h);
        }), l.push({
          name: c,
          indices: u
        });
      }), l;
    }, t.prototype.getAxisTooltipData = function(e, n, i) {
      q(e) || (e = e ? [e] : []);
      for (var a = this.getData(), o = this.getLayerSeries(), s = [], l = o.length, u, c = 0; c < l; ++c) {
        for (var f = Number.MAX_VALUE, h = -1, v = o[c].indices.length, d = 0; d < v; ++d) {
          var p = a.get(e[0], o[c].indices[d]), g = Math.abs(p - n);
          g <= f && (u = p, f = g, h = o[c].indices[d]);
        }
        s.push(h);
      }
      return {
        dataIndices: s,
        nestestValue: u
      };
    }, t.prototype.formatTooltip = function(e, n, i) {
      var a = this.getData(), o = a.getName(e), s = a.get(a.mapDimension("value"), e);
      return It("nameValue", {
        name: o,
        value: s
      });
    }, t.type = "series.themeRiver", t.dependencies = ["singleAxis"], t.defaultOption = {
      // zlevel: 0,
      z: 2,
      colorBy: "data",
      coordinateSystem: "singleAxis",
      // gap in axis's orthogonal orientation
      boundaryGap: ["10%", "10%"],
      // legendHoverLink: true,
      singleAxisIndex: 0,
      animationEasing: "linear",
      label: {
        margin: 4,
        show: !0,
        position: "left",
        fontSize: 11
      },
      emphasis: {
        label: {
          show: !0
        }
      }
    }, t;
  }(it)
);
function jU(r, t) {
  r.eachSeriesByType("themeRiver", function(e) {
    var n = e.getData(), i = e.coordinateSystem, a = {}, o = i.getRect();
    a.rect = o;
    var s = e.get("boundaryGap"), l = i.getAxis();
    if (a.boundaryGap = s, l.orient === "horizontal") {
      s[0] = X(s[0], o.height), s[1] = X(s[1], o.height);
      var u = o.height - s[0] - s[1];
      rC(n, e, u);
    } else {
      s[0] = X(s[0], o.width), s[1] = X(s[1], o.width);
      var c = o.width - s[0] - s[1];
      rC(n, e, c);
    }
    n.setLayout("layoutInfo", a);
  });
}
function rC(r, t, e) {
  if (r.count())
    for (var n = t.coordinateSystem, i = t.getLayerSeries(), a = r.mapDimension("single"), o = r.mapDimension("value"), s = U(i, function(g) {
      return U(g.indices, function(m) {
        var y = n.dataToPoint(r.get(a, m));
        return y[1] = r.get(o, m), y;
      });
    }), l = KU(s), u = l.y0, c = e / l.max, f = i.length, h = i[0].indices.length, v, d = 0; d < h; ++d) {
      v = u[d] * c, r.setItemLayout(i[0].indices[d], {
        layerIndex: 0,
        x: s[0][d][0],
        y0: v,
        y: s[0][d][1] * c
      });
      for (var p = 1; p < f; ++p)
        v += s[p - 1][d][1] * c, r.setItemLayout(i[p].indices[d], {
          layerIndex: p,
          x: s[p][d][0],
          y0: v,
          y: s[p][d][1] * c
        });
    }
}
function KU(r) {
  for (var t = r.length, e = r[0].length, n = [], i = [], a = 0, o = 0; o < e; ++o) {
    for (var s = 0, l = 0; l < t; ++l)
      s += r[l][o][1];
    s > a && (a = s), n.push(s);
  }
  for (var u = 0; u < e; ++u)
    i[u] = (a - n[u]) / 2;
  a = 0;
  for (var c = 0; c < e; ++c) {
    var f = n[c] + i[c];
    f > a && (a = f);
  }
  return {
    y0: i,
    max: a
  };
}
function JU(r) {
  r.registerChartView(YU), r.registerSeriesModel(XU), r.registerLayout(jU), r.registerProcessor(rc("themeRiver"));
}
var QU = 2, eY = 4, nC = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a) {
      var o = r.call(this) || this;
      o.z2 = QU, o.textConfig = {
        inside: !0
      }, pe(o).seriesIndex = n.seriesIndex;
      var s = new Fe({
        z2: eY,
        silent: e.getModel().get(["label", "silent"])
      });
      return o.setTextContent(s), o.updateData(!0, e, n, i, a), o;
    }
    return t.prototype.updateData = function(e, n, i, a, o) {
      this.node = n, n.piece = this, i = i || this._seriesModel, a = a || this._ecModel;
      var s = this;
      pe(s).dataIndex = n.dataIndex;
      var l = n.getModel(), u = l.getModel("emphasis"), c = n.getLayout(), f = H({}, c);
      f.label = null;
      var h = n.getVisual("style");
      h.lineJoin = "bevel";
      var v = n.getVisual("decal");
      v && (h.decal = bs(v, o));
      var d = Ja(l.getModel("itemStyle"), f, !0);
      H(f, d), M(nr, function(y) {
        var _ = s.ensureState(y), b = l.getModel([y, "itemStyle"]);
        _.style = b.getItemStyle();
        var S = Ja(b, f);
        S && (_.shape = S);
      }), e ? (s.setShape(f), s.shape.r = c.r0, st(s, {
        shape: {
          r: c.r
        }
      }, i, n.dataIndex)) : (Ne(s, {
        shape: f
      }, i), un(s)), s.useStyle(h), this._updateLabel(i);
      var p = l.getShallow("cursor");
      p && s.attr("cursor", p), this._seriesModel = i || this._seriesModel, this._ecModel = a || this._ecModel;
      var g = u.get("focus"), m = g === "relative" ? cu(n.getAncestorsIndices(), n.getDescendantIndices()) : g === "ancestor" ? n.getAncestorsIndices() : g === "descendant" ? n.getDescendantIndices() : g;
      ut(this, m, u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(e) {
      var n = this, i = this.node.getModel(), a = i.getModel("label"), o = this.node.getLayout(), s = o.endAngle - o.startAngle, l = (o.startAngle + o.endAngle) / 2, u = Math.cos(l), c = Math.sin(l), f = this, h = f.getTextContent(), v = this.node.dataIndex, d = a.get("minAngle") / 180 * Math.PI, p = a.get("show") && !(d != null && Math.abs(s) < d);
      h.ignore = !p, M(gu, function(m) {
        var y = m === "normal" ? i.getModel("label") : i.getModel([m, "label"]), _ = m === "normal", b = _ ? h : h.ensureState(m), S = e.getFormattedLabel(v, m);
        _ && (S = S || n.node.name), b.style = nt(y, {}, null, m !== "normal", !0), S && (b.style.text = S);
        var x = y.get("show");
        x != null && !_ && (b.ignore = !x);
        var w = g(y, "position"), C = _ ? f : f.states[m], D = C.style.fill;
        C.textConfig = {
          outsideFill: y.get("color") === "inherit" ? D : null,
          inside: w !== "outside"
        };
        var A, T = g(y, "distance") || 0, L = g(y, "align"), E = g(y, "rotate"), I = Math.PI * 0.5, P = Math.PI * 1.5, R = xr(E === "tangential" ? Math.PI / 2 - l : l), F = R > I && !du(R - I) && R < P;
        w === "outside" ? (A = o.r + T, L = F ? "right" : "left") : !L || L === "center" ? (s === 2 * Math.PI && o.r0 === 0 ? A = 0 : A = (o.r + o.r0) / 2, L = "center") : L === "left" ? (A = o.r0 + T, L = F ? "right" : "left") : L === "right" && (A = o.r - T, L = F ? "left" : "right"), b.style.align = L, b.style.verticalAlign = g(y, "verticalAlign") || "middle", b.x = A * u + o.cx, b.y = A * c + o.cy;
        var O = 0;
        E === "radial" ? O = xr(-l) + (F ? Math.PI : 0) : E === "tangential" ? O = xr(Math.PI / 2 - l) + (F ? Math.PI : 0) : Be(E) && (O = E * Math.PI / 180), b.rotation = xr(O);
      });
      function g(m, y) {
        var _ = m.get(y);
        return _ ?? a.get(y);
      }
      h.dirtyStyle();
    }, t;
  }(ir)
), ay = "sunburstRootToNode", iC = "sunburstHighlight", tY = "sunburstUnhighlight";
function rY(r) {
  r.registerAction({
    type: ay,
    update: "updateView"
  }, function(t, e) {
    e.eachComponent({
      mainType: "series",
      subType: "sunburst",
      query: t
    }, n);
    function n(i, a) {
      var o = Lu(t, [ay], i);
      if (o) {
        var s = i.getViewRoot();
        s && (t.direction = c_(s, o.node) ? "rollUp" : "drillDown"), i.resetViewRoot(o.node);
      }
    }
  }), r.registerAction({
    type: iC,
    update: "none"
  }, function(t, e, n) {
    t = H({}, t), e.eachComponent({
      mainType: "series",
      subType: "sunburst",
      query: t
    }, i);
    function i(a) {
      var o = Lu(t, [iC], a);
      o && (t.dataIndex = o.node.dataIndex);
    }
    n.dispatchAction(H(t, {
      type: "highlight"
    }));
  }), r.registerAction({
    type: tY,
    update: "updateView"
  }, function(t, e, n) {
    t = H({}, t), n.dispatchAction(H(t, {
      type: "downplay"
    }));
  });
}
var nY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      var o = this;
      this.seriesModel = e, this.api = i, this.ecModel = n;
      var s = e.getData(), l = s.tree.root, u = e.getViewRoot(), c = this.group, f = e.get("renderLabelForZeroData"), h = [];
      u.eachNode(function(y) {
        h.push(y);
      });
      var v = this._oldChildren || [];
      d(h, v), m(l, u), this._initEvents(), this._oldChildren = h;
      function d(y, _) {
        if (y.length === 0 && _.length === 0)
          return;
        new li(_, y, b, b).add(S).update(S).remove(ye(S, null)).execute();
        function b(x) {
          return x.getId();
        }
        function S(x, w) {
          var C = x == null ? null : y[x], D = w == null ? null : _[w];
          p(C, D);
        }
      }
      function p(y, _) {
        if (!f && y && !y.getValue() && (y = null), y !== l && _ !== l) {
          if (_ && _.piece)
            y ? (_.piece.updateData(!1, y, e, n, i), s.setItemGraphicEl(y.dataIndex, _.piece)) : g(_);
          else if (y) {
            var b = new nC(y, e, n, i);
            c.add(b), s.setItemGraphicEl(y.dataIndex, b);
          }
        }
      }
      function g(y) {
        y && y.piece && (c.remove(y.piece), y.piece = null);
      }
      function m(y, _) {
        _.depth > 0 ? (o.virtualPiece ? o.virtualPiece.updateData(!1, y, e, n, i) : (o.virtualPiece = new nC(y, e, n, i), c.add(o.virtualPiece)), _.piece.off("click"), o.virtualPiece.on("click", function(b) {
          o._rootToNode(_.parentNode);
        })) : o.virtualPiece && (c.remove(o.virtualPiece), o.virtualPiece = null);
      }
    }, t.prototype._initEvents = function() {
      var e = this;
      this.group.off("click"), this.group.on("click", function(n) {
        var i = !1, a = e.seriesModel.getViewRoot();
        a.eachNode(function(o) {
          if (!i && o.piece && o.piece === n.target) {
            var s = o.getModel().get("nodeClick");
            if (s === "rootToNode")
              e._rootToNode(o);
            else if (s === "link") {
              var l = o.getModel(), u = l.get("link");
              if (u) {
                var c = l.get("target", !0) || "_blank";
                hh(u, c);
              }
            }
            i = !0;
          }
        });
      });
    }, t.prototype._rootToNode = function(e) {
      e !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
        type: ay,
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: e
      });
    }, t.prototype.containPoint = function(e, n) {
      var i = n.getData(), a = i.getItemLayout(0);
      if (a) {
        var o = e[0] - a.cx, s = e[1] - a.cy, l = Math.sqrt(o * o + s * s);
        return l <= a.r && l >= a.r0;
      }
    }, t.type = "sunburst", t;
  }(Qe)
), iY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.ignoreStyleOnData = !0, e;
    }
    return t.prototype.getInitialData = function(e, n) {
      var i = {
        name: e.name,
        children: e.data
      };
      MP(i);
      var a = this._levelModels = U(e.levels || [], function(l) {
        return new Ze(l, this, n);
      }, this), o = u_.createTree(i, this, s);
      function s(l) {
        l.wrapMethod("getItemModel", function(u, c) {
          var f = o.getNodeByDataIndex(c), h = a[f.depth];
          return h && (u.parentModel = h), u;
        });
      }
      return o.data;
    }, t.prototype.optionUpdated = function() {
      this.resetViewRoot();
    }, t.prototype.getDataParams = function(e) {
      var n = r.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(e);
      return n.treePathInfo = Ov(i, this), n;
    }, t.prototype.getLevelModel = function(e) {
      return this._levelModels && this._levelModels[e.depth];
    }, t.prototype.getViewRoot = function() {
      return this._viewRoot;
    }, t.prototype.resetViewRoot = function(e) {
      e ? this._viewRoot = e : e = this._viewRoot;
      var n = this.getRawData().tree.root;
      (!e || e !== n && !n.contains(e)) && (this._viewRoot = n);
    }, t.prototype.enableAriaDecal = function() {
      kE(this);
    }, t.type = "series.sunburst", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      // 默认全局居中
      center: ["50%", "50%"],
      radius: [0, "75%"],
      // 默认顺时针
      clockwise: !0,
      startAngle: 90,
      // 最小角度改为0
      minAngle: 0,
      // If still show when all data zero.
      stillShowZeroSum: !0,
      // 'rootToNode', 'link', or false
      nodeClick: "rootToNode",
      renderLabelForZeroData: !1,
      label: {
        // could be: 'radial', 'tangential', or 'none'
        rotate: "radial",
        show: !0,
        opacity: 1,
        // 'left' is for inner side of inside, and 'right' is for outer
        // side for inside
        align: "center",
        position: "inside",
        distance: 5,
        silent: !0
      },
      itemStyle: {
        borderWidth: 1,
        borderColor: "white",
        borderType: "solid",
        shadowBlur: 0,
        shadowColor: "rgba(0, 0, 0, 0.2)",
        shadowOffsetX: 0,
        shadowOffsetY: 0,
        opacity: 1
      },
      emphasis: {
        focus: "descendant"
      },
      blur: {
        itemStyle: {
          opacity: 0.2
        },
        label: {
          opacity: 0.1
        }
      },
      // Animation type can be expansion, scale.
      animationType: "expansion",
      animationDuration: 1e3,
      animationDurationUpdate: 500,
      data: [],
      /**
       * Sort order.
       *
       * Valid values: 'desc', 'asc', null, or callback function.
       * 'desc' and 'asc' for descend and ascendant order;
       * null for not sorting;
       * example of callback function:
       * function(nodeA, nodeB) {
       *     return nodeA.getValue() - nodeB.getValue();
       * }
       */
      sort: "desc"
    }, t;
  }(it)
);
function MP(r) {
  var t = 0;
  M(r.children, function(n) {
    MP(n);
    var i = n.value;
    q(i) && (i = i[0]), t += i;
  });
  var e = r.value;
  q(e) && (e = e[0]), (e == null || isNaN(e)) && (e = t), e < 0 && (e = 0), q(r.value) ? r.value[0] = e : r.value = e;
}
var aC = Math.PI / 180;
function aY(r, t, e) {
  t.eachSeriesByType(r, function(n) {
    var i = n.get("center"), a = n.get("radius");
    q(a) || (a = [0, a]), q(i) || (i = [i, i]);
    var o = e.getWidth(), s = e.getHeight(), l = Math.min(o, s), u = X(i[0], o), c = X(i[1], s), f = X(a[0], l / 2), h = X(a[1], l / 2), v = -n.get("startAngle") * aC, d = n.get("minAngle") * aC, p = n.getData().tree.root, g = n.getViewRoot(), m = g.depth, y = n.get("sort");
    y != null && IP(g, y);
    var _ = 0;
    M(g.children, function(R) {
      !isNaN(R.getValue()) && _++;
    });
    var b = g.getValue(), S = Math.PI / (b || _) * 2, x = g.depth > 0, w = g.height - (x ? -1 : 1), C = (h - f) / (w || 1), D = n.get("clockwise"), A = n.get("stillShowZeroSum"), T = D ? 1 : -1, L = function(R, F) {
      if (R) {
        var O = F;
        if (R !== p) {
          var z = R.getValue(), G = b === 0 && A ? S : z * S;
          G < d && (G = d), O = F + T * G;
          var W = R.depth - m - (x ? -1 : 1), Y = f + C * W, j = f + C * (W + 1), ee = n.getLevelModel(R);
          if (ee) {
            var ie = ee.get("r0", !0), Me = ee.get("r", !0), We = ee.get("radius", !0);
            We != null && (ie = We[0], Me = We[1]), ie != null && (Y = X(ie, l / 2)), Me != null && (j = X(Me, l / 2));
          }
          R.setLayout({
            angle: G,
            startAngle: F,
            endAngle: O,
            clockwise: D,
            cx: u,
            cy: c,
            r0: Y,
            r: j
          });
        }
        if (R.children && R.children.length) {
          var ve = 0;
          M(R.children, function(ae) {
            ve += L(ae, F + ve);
          });
        }
        return O - F;
      }
    };
    if (x) {
      var E = f, I = f + C, P = Math.PI * 2;
      p.setLayout({
        angle: P,
        startAngle: v,
        endAngle: v + P,
        clockwise: D,
        cx: u,
        cy: c,
        r0: E,
        r: I
      });
    }
    L(g, v);
  });
}
function IP(r, t) {
  var e = r.children || [];
  r.children = oY(e, t), e.length && M(r.children, function(n) {
    IP(n, t);
  });
}
function oY(r, t) {
  if (oe(t)) {
    var e = U(r, function(i, a) {
      var o = i.getValue();
      return {
        params: {
          depth: i.depth,
          height: i.height,
          dataIndex: i.dataIndex,
          getValue: function() {
            return o;
          }
        },
        index: a
      };
    });
    return e.sort(function(i, a) {
      return t(i.params, a.params);
    }), U(e, function(i) {
      return r[i.index];
    });
  } else {
    var n = t === "asc";
    return r.sort(function(i, a) {
      var o = (i.getValue() - a.getValue()) * (n ? 1 : -1);
      return o === 0 ? (i.dataIndex - a.dataIndex) * (n ? -1 : 1) : o;
    });
  }
}
function sY(r) {
  var t = {};
  function e(n, i, a) {
    for (var o = n; o && o.depth > 1; )
      o = o.parentNode;
    var s = i.getColorFromPalette(o.name || o.dataIndex + "", t);
    return n.depth > 1 && J(s) && (s = Yg(s, (n.depth - 1) / (a - 1) * 0.5)), s;
  }
  r.eachSeriesByType("sunburst", function(n) {
    var i = n.getData(), a = i.tree;
    a.eachNode(function(o) {
      var s = o.getModel(), l = s.getModel("itemStyle").getItemStyle();
      l.fill || (l.fill = e(o, n, a.root.height));
      var u = i.ensureUniqueItemVisual(o.dataIndex, "style");
      H(u, l);
    });
  });
}
function lY(r) {
  r.registerChartView(nY), r.registerSeriesModel(iY), r.registerLayout(ye(aY, "sunburst")), r.registerProcessor(ye(rc, "sunburst")), r.registerVisual(sY), rY(r);
}
var oC = {
  color: "fill",
  borderColor: "stroke"
}, uY = {
  symbol: 1,
  symbolSize: 1,
  symbolKeepAspect: 1,
  legendIcon: 1,
  visualMeta: 1,
  liftZ: 1,
  decal: 1
}, ri = Oe(), cY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.optionUpdated = function() {
      this.currentZLevel = this.get("zlevel", !0), this.currentZ = this.get("z", !0);
    }, t.prototype.getInitialData = function(e, n) {
      return gi(null, this);
    }, t.prototype.getDataParams = function(e, n, i) {
      var a = r.prototype.getDataParams.call(this, e, n);
      return i && (a.info = ri(i).info), a;
    }, t.type = "series.custom", t.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], t.defaultOption = {
      coordinateSystem: "cartesian2d",
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      // Custom series will not clip by default.
      // Some case will use custom series to draw label
      // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
      clip: !1
      // Cartesian coordinate system
      // xAxisIndex: 0,
      // yAxisIndex: 0,
      // Polar coordinate system
      // polarIndex: 0,
      // Geo coordinate system
      // geoIndex: 0,
    }, t;
  }(it)
);
function fY(r, t) {
  return t = t || [0, 0], U(["x", "y"], function(e, n) {
    var i = this.getAxis(e), a = t[n], o = r[n] / 2;
    return i.type === "category" ? i.getBandWidth() : Math.abs(i.dataToCoord(a - o) - i.dataToCoord(a + o));
  }, this);
}
function hY(r) {
  var t = r.master.getRect();
  return {
    coordSys: {
      // The name exposed to user is always 'cartesian2d' but not 'grid'.
      type: "cartesian2d",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    api: {
      coord: function(e) {
        return r.dataToPoint(e);
      },
      size: Q(fY, r)
    }
  };
}
function vY(r, t) {
  return t = t || [0, 0], U([0, 1], function(e) {
    var n = t[e], i = r[e] / 2, a = [], o = [];
    return a[e] = n - i, o[e] = n + i, a[1 - e] = o[1 - e] = t[1 - e], Math.abs(this.dataToPoint(a)[e] - this.dataToPoint(o)[e]);
  }, this);
}
function dY(r) {
  var t = r.getBoundingRect();
  return {
    coordSys: {
      type: "geo",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height,
      zoom: r.getZoom()
    },
    api: {
      coord: function(e) {
        return r.dataToPoint(e);
      },
      size: Q(vY, r)
    }
  };
}
function pY(r, t) {
  var e = this.getAxis(), n = t instanceof Array ? t[0] : t, i = (r instanceof Array ? r[0] : r) / 2;
  return e.type === "category" ? e.getBandWidth() : Math.abs(e.dataToCoord(n - i) - e.dataToCoord(n + i));
}
function gY(r) {
  var t = r.getRect();
  return {
    coordSys: {
      type: "singleAxis",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    api: {
      coord: function(e) {
        return r.dataToPoint(e);
      },
      size: Q(pY, r)
    }
  };
}
function mY(r, t) {
  return t = t || [0, 0], U(["Radius", "Angle"], function(e, n) {
    var i = "get" + e + "Axis", a = this[i](), o = t[n], s = r[n] / 2, l = a.type === "category" ? a.getBandWidth() : Math.abs(a.dataToCoord(o - s) - a.dataToCoord(o + s));
    return e === "Angle" && (l = l * Math.PI / 180), l;
  }, this);
}
function yY(r) {
  var t = r.getRadiusAxis(), e = r.getAngleAxis(), n = t.getExtent();
  return n[0] > n[1] && n.reverse(), {
    coordSys: {
      type: "polar",
      cx: r.cx,
      cy: r.cy,
      r: n[1],
      r0: n[0]
    },
    api: {
      coord: function(i) {
        var a = t.dataToRadius(i[0]), o = e.dataToAngle(i[1]), s = r.coordToPoint([a, o]);
        return s.push(a, o * Math.PI / 180), s;
      },
      size: Q(mY, r)
    }
  };
}
function _Y(r) {
  var t = r.getRect(), e = r.getRangeInfo();
  return {
    coordSys: {
      type: "calendar",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height,
      cellWidth: r.getCellWidth(),
      cellHeight: r.getCellHeight(),
      rangeInfo: {
        start: e.start,
        end: e.end,
        weeks: e.weeks,
        dayCount: e.allDay
      }
    },
    api: {
      coord: function(n, i) {
        return r.dataToPoint(n, i);
      }
    }
  };
}
function LP(r, t, e, n) {
  return r && (r.legacy || r.legacy !== !1 && !e && !n && t !== "tspan" && (t === "text" || te(r, "text")));
}
function EP(r, t, e) {
  var n = r, i, a, o;
  if (t === "text")
    o = n;
  else {
    o = {}, te(n, "text") && (o.text = n.text), te(n, "rich") && (o.rich = n.rich), te(n, "textFill") && (o.fill = n.textFill), te(n, "textStroke") && (o.stroke = n.textStroke), te(n, "fontFamily") && (o.fontFamily = n.fontFamily), te(n, "fontSize") && (o.fontSize = n.fontSize), te(n, "fontStyle") && (o.fontStyle = n.fontStyle), te(n, "fontWeight") && (o.fontWeight = n.fontWeight), a = {
      type: "text",
      style: o,
      // ec4 does not support rectText trigger.
      // And when text position is different in normal and emphasis
      // => hover text trigger emphasis;
      // => text position changed, leave mouse pointer immediately;
      // That might cause incorrect state.
      silent: !0
    }, i = {};
    var s = te(n, "textPosition");
    e ? i.position = s ? n.textPosition : "inside" : s && (i.position = n.textPosition), te(n, "textPosition") && (i.position = n.textPosition), te(n, "textOffset") && (i.offset = n.textOffset), te(n, "textRotation") && (i.rotation = n.textRotation), te(n, "textDistance") && (i.distance = n.textDistance);
  }
  return sC(o, r), M(o.rich, function(l) {
    sC(l, l);
  }), {
    textConfig: i,
    textContent: a
  };
}
function sC(r, t) {
  t && (t.font = t.textFont || t.font, te(t, "textStrokeWidth") && (r.lineWidth = t.textStrokeWidth), te(t, "textAlign") && (r.align = t.textAlign), te(t, "textVerticalAlign") && (r.verticalAlign = t.textVerticalAlign), te(t, "textLineHeight") && (r.lineHeight = t.textLineHeight), te(t, "textWidth") && (r.width = t.textWidth), te(t, "textHeight") && (r.height = t.textHeight), te(t, "textBackgroundColor") && (r.backgroundColor = t.textBackgroundColor), te(t, "textPadding") && (r.padding = t.textPadding), te(t, "textBorderColor") && (r.borderColor = t.textBorderColor), te(t, "textBorderWidth") && (r.borderWidth = t.textBorderWidth), te(t, "textBorderRadius") && (r.borderRadius = t.textBorderRadius), te(t, "textBoxShadowColor") && (r.shadowColor = t.textBoxShadowColor), te(t, "textBoxShadowBlur") && (r.shadowBlur = t.textBoxShadowBlur), te(t, "textBoxShadowOffsetX") && (r.shadowOffsetX = t.textBoxShadowOffsetX), te(t, "textBoxShadowOffsetY") && (r.shadowOffsetY = t.textBoxShadowOffsetY));
}
function lC(r, t, e) {
  var n = r;
  n.textPosition = n.textPosition || e.position || "inside", e.offset != null && (n.textOffset = e.offset), e.rotation != null && (n.textRotation = e.rotation), e.distance != null && (n.textDistance = e.distance);
  var i = n.textPosition.indexOf("inside") >= 0, a = r.fill || "#000";
  uC(n, t);
  var o = n.textFill == null;
  return i ? o && (n.textFill = e.insideFill || "#fff", !n.textStroke && e.insideStroke && (n.textStroke = e.insideStroke), !n.textStroke && (n.textStroke = a), n.textStrokeWidth == null && (n.textStrokeWidth = 2)) : (o && (n.textFill = r.fill || e.outsideFill || "#000"), !n.textStroke && e.outsideStroke && (n.textStroke = e.outsideStroke)), n.text = t.text, n.rich = t.rich, M(t.rich, function(s) {
    uC(s, s);
  }), n;
}
function uC(r, t) {
  t && (te(t, "fill") && (r.textFill = t.fill), te(t, "stroke") && (r.textStroke = t.fill), te(t, "lineWidth") && (r.textStrokeWidth = t.lineWidth), te(t, "font") && (r.font = t.font), te(t, "fontStyle") && (r.fontStyle = t.fontStyle), te(t, "fontWeight") && (r.fontWeight = t.fontWeight), te(t, "fontSize") && (r.fontSize = t.fontSize), te(t, "fontFamily") && (r.fontFamily = t.fontFamily), te(t, "align") && (r.textAlign = t.align), te(t, "verticalAlign") && (r.textVerticalAlign = t.verticalAlign), te(t, "lineHeight") && (r.textLineHeight = t.lineHeight), te(t, "width") && (r.textWidth = t.width), te(t, "height") && (r.textHeight = t.height), te(t, "backgroundColor") && (r.textBackgroundColor = t.backgroundColor), te(t, "padding") && (r.textPadding = t.padding), te(t, "borderColor") && (r.textBorderColor = t.borderColor), te(t, "borderWidth") && (r.textBorderWidth = t.borderWidth), te(t, "borderRadius") && (r.textBorderRadius = t.borderRadius), te(t, "shadowColor") && (r.textBoxShadowColor = t.shadowColor), te(t, "shadowBlur") && (r.textBoxShadowBlur = t.shadowBlur), te(t, "shadowOffsetX") && (r.textBoxShadowOffsetX = t.shadowOffsetX), te(t, "shadowOffsetY") && (r.textBoxShadowOffsetY = t.shadowOffsetY), te(t, "textShadowColor") && (r.textShadowColor = t.textShadowColor), te(t, "textShadowBlur") && (r.textShadowBlur = t.textShadowBlur), te(t, "textShadowOffsetX") && (r.textShadowOffsetX = t.textShadowOffsetX), te(t, "textShadowOffsetY") && (r.textShadowOffsetY = t.textShadowOffsetY));
}
var PP = {
  position: ["x", "y"],
  scale: ["scaleX", "scaleY"],
  origin: ["originX", "originY"]
}, cC = Ee(PP);
kn(On, function(r, t) {
  return r[t] = 1, r;
}, {});
On.join(", ");
var Ph = ["", "style", "shape", "extra"], As = Oe();
function T_(r, t, e, n, i) {
  var a = r + "Animation", o = ks(r, n, i) || {}, s = As(t).userDuring;
  return o.duration > 0 && (o.during = s ? Q(CY, {
    el: t,
    userDuring: s
  }) : null, o.setToFinal = !0, o.scope = r), H(o, e[a]), o;
}
function Nf(r, t, e, n) {
  n = n || {};
  var i = n.dataIndex, a = n.isInit, o = n.clearStyle, s = e.isAnimationEnabled(), l = As(r), u = t.style;
  l.userDuring = t.during;
  var c = {}, f = {};
  if (DY(r, t, f), hC("shape", t, f), hC("extra", t, f), !a && s && (AY(r, t, c), fC("shape", r, t, c), fC("extra", r, t, c), TY(r, t, u, c)), f.style = u, bY(r, f, o), xY(r, t), s)
    if (a) {
      var h = {};
      M(Ph, function(d) {
        var p = d ? t[d] : t;
        p && p.enterFrom && (d && (h[d] = h[d] || {}), H(d ? h[d] : h, p.enterFrom));
      });
      var v = T_("enter", r, t, e, i);
      v.duration > 0 && r.animateFrom(h, v);
    } else
      SY(r, t, i || 0, e, c);
  kP(r, t), u ? r.dirty() : r.markRedraw();
}
function kP(r, t) {
  for (var e = As(r).leaveToProps, n = 0; n < Ph.length; n++) {
    var i = Ph[n], a = i ? t[i] : t;
    a && a.leaveTo && (e || (e = As(r).leaveToProps = {}), i && (e[i] = e[i] || {}), H(i ? e[i] : e, a.leaveTo));
  }
}
function Nv(r, t, e, n) {
  if (r) {
    var i = r.parent, a = As(r).leaveToProps;
    if (a) {
      var o = T_("update", r, t, e, 0);
      o.done = function() {
        i.remove(r);
      }, r.animateTo(a, o);
    } else
      i.remove(r);
  }
}
function uo(r) {
  return r === "all";
}
function bY(r, t, e) {
  var n = t.style;
  if (!r.isGroup && n) {
    if (e) {
      r.useStyle({});
      for (var i = r.animators, a = 0; a < i.length; a++) {
        var o = i[a];
        o.targetName === "style" && o.changeTarget(r.style);
      }
    }
    r.setStyle(n);
  }
  t && (t.style = null, t && r.attr(t), t.style = n);
}
function SY(r, t, e, n, i) {
  if (i) {
    var a = T_("update", r, t, n, e);
    a.duration > 0 && r.animateFrom(i, a);
  }
}
function xY(r, t) {
  te(t, "silent") && (r.silent = t.silent), te(t, "ignore") && (r.ignore = t.ignore), r instanceof qr && te(t, "invisible") && (r.invisible = t.invisible), r instanceof Te && te(t, "autoBatch") && (r.autoBatch = t.autoBatch);
}
var Sn = {}, wY = {
  // Usually other props do not need to be changed in animation during.
  setTransform: function(r, t) {
    return Sn.el[r] = t, this;
  },
  getTransform: function(r) {
    return Sn.el[r];
  },
  setShape: function(r, t) {
    var e = Sn.el, n = e.shape || (e.shape = {});
    return n[r] = t, e.dirtyShape && e.dirtyShape(), this;
  },
  getShape: function(r) {
    var t = Sn.el.shape;
    if (t)
      return t[r];
  },
  setStyle: function(r, t) {
    var e = Sn.el, n = e.style;
    return n && (n[r] = t, e.dirtyStyle && e.dirtyStyle()), this;
  },
  getStyle: function(r) {
    var t = Sn.el.style;
    if (t)
      return t[r];
  },
  setExtra: function(r, t) {
    var e = Sn.el.extra || (Sn.el.extra = {});
    return e[r] = t, this;
  },
  getExtra: function(r) {
    var t = Sn.el.extra;
    if (t)
      return t[r];
  }
};
function CY() {
  var r = this, t = r.el;
  if (t) {
    var e = As(t).userDuring, n = r.userDuring;
    if (e !== n) {
      r.el = r.userDuring = null;
      return;
    }
    Sn.el = t, n(wY);
  }
}
function fC(r, t, e, n) {
  var i = e[r];
  if (i) {
    var a = t[r], o;
    if (a) {
      var s = e.transition, l = i.transition;
      if (l)
        if (!o && (o = n[r] = {}), uo(l))
          H(o, a);
        else
          for (var u = je(l), c = 0; c < u.length; c++) {
            var f = u[c], h = a[f];
            o[f] = h;
          }
      else if (uo(s) || we(s, r) >= 0) {
        !o && (o = n[r] = {});
        for (var v = Ee(a), c = 0; c < v.length; c++) {
          var f = v[c], h = a[f];
          MY(i[f], h) && (o[f] = h);
        }
      }
    }
  }
}
function hC(r, t, e) {
  var n = t[r];
  if (n)
    for (var i = e[r] = {}, a = Ee(n), o = 0; o < a.length; o++) {
      var s = a[o];
      i[s] = Wl(n[s]);
    }
}
function AY(r, t, e) {
  for (var n = t.transition, i = uo(n) ? On : je(n || []), a = 0; a < i.length; a++) {
    var o = i[a];
    if (!(o === "style" || o === "shape" || o === "extra")) {
      var s = r[o];
      e[o] = s;
    }
  }
}
function DY(r, t, e) {
  for (var n = 0; n < cC.length; n++) {
    var i = cC[n], a = PP[i], o = t[i];
    o && (e[a[0]] = o[0], e[a[1]] = o[1]);
  }
  for (var n = 0; n < On.length; n++) {
    var s = On[n];
    t[s] != null && (e[s] = t[s]);
  }
}
function TY(r, t, e, n) {
  if (e) {
    var i = r.style, a;
    if (i) {
      var o = e.transition, s = t.transition;
      if (o && !uo(o)) {
        var l = je(o);
        !a && (a = n.style = {});
        for (var u = 0; u < l.length; u++) {
          var c = l[u], f = i[c];
          a[c] = f;
        }
      } else if (r.getAnimationStyleProps && (uo(s) || uo(o) || we(s, "style") >= 0)) {
        var h = r.getAnimationStyleProps(), v = h ? h.style : null;
        if (v) {
          !a && (a = n.style = {});
          for (var d = Ee(e), u = 0; u < d.length; u++) {
            var c = d[u];
            if (v[c]) {
              var f = i[c];
              a[c] = f;
            }
          }
        }
      }
    }
  }
}
function MY(r, t) {
  return qt(r) ? r !== t : r != null && isFinite(r);
}
var RP = Oe(), IY = ["percent", "easing", "shape", "style", "extra"];
function OP(r) {
  r.stopAnimation("keyframe"), r.attr(RP(r));
}
function kh(r, t, e) {
  if (!(!e.isAnimationEnabled() || !t)) {
    if (q(t)) {
      M(t, function(s) {
        kh(r, s, e);
      });
      return;
    }
    var n = t.keyframes, i = t.duration;
    if (e && i == null) {
      var a = ks("enter", e, 0);
      i = a && a.duration;
    }
    if (!(!n || !i)) {
      var o = RP(r);
      M(Ph, function(s) {
        if (!(s && !r[s])) {
          var l;
          n.sort(function(u, c) {
            return u.percent - c.percent;
          }), M(n, function(u) {
            var c = r.animators, f = s ? u[s] : u;
            if (f) {
              var h = Ee(f);
              if (s || (h = qe(h, function(p) {
                return we(IY, p) < 0;
              })), !!h.length) {
                l || (l = r.animate(s, t.loop, !0), l.scope = "keyframe");
                for (var v = 0; v < c.length; v++)
                  c[v] !== l && c[v].targetName === l.targetName && c[v].stopTracks(h);
                s && (o[s] = o[s] || {});
                var d = s ? o[s] : o;
                M(h, function(p) {
                  d[p] = ((s ? r[s] : r) || {})[p];
                }), l.whenWithKeys(i * u.percent, f, h, u.easing);
              }
            }
          }), l && l.delay(t.delay || 0).duration(i).start(t.easing);
        }
      });
    }
  }
}
var ni = "emphasis", $i = "normal", M_ = "blur", I_ = "select", ra = [$i, ni, M_, I_], Jp = {
  normal: ["itemStyle"],
  emphasis: [ni, "itemStyle"],
  blur: [M_, "itemStyle"],
  select: [I_, "itemStyle"]
}, Qp = {
  normal: ["label"],
  emphasis: [ni, "label"],
  blur: [M_, "label"],
  select: [I_, "label"]
}, LY = ["x", "y"], EY = "e\0\0", Pr = {
  normal: {},
  emphasis: {},
  blur: {},
  select: {}
}, PY = {
  cartesian2d: hY,
  geo: dY,
  single: gY,
  polar: yY,
  calendar: _Y
};
function oy(r) {
  return r instanceof Te;
}
function sy(r) {
  return r instanceof qr;
}
function kY(r, t) {
  t.copyTransform(r), sy(t) && sy(r) && (t.setStyle(r.style), t.z = r.z, t.z2 = r.z2, t.zlevel = r.zlevel, t.invisible = r.invisible, t.ignore = r.ignore, oy(t) && oy(r) && t.setShape(r.shape));
}
var RY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      this._progressiveEls = null;
      var o = this._data, s = e.getData(), l = this.group, u = vC(e, s, n, i);
      o || l.removeAll(), s.diff(o).add(function(f) {
        eg(i, null, f, u(f, a), e, l, s);
      }).remove(function(f) {
        var h = o.getItemGraphicEl(f);
        h && Nv(h, ri(h).option, e);
      }).update(function(f, h) {
        var v = o.getItemGraphicEl(h);
        eg(i, v, f, u(f, a), e, l, s);
      }).execute();
      var c = e.get("clip", !0) ? ec(e.coordinateSystem, !1, e) : null;
      c ? l.setClipPath(c) : l.removeClipPath(), this._data = s;
    }, t.prototype.incrementalPrepareRender = function(e, n, i) {
      this.group.removeAll(), this._data = null;
    }, t.prototype.incrementalRender = function(e, n, i, a, o) {
      var s = n.getData(), l = vC(n, s, i, a), u = this._progressiveEls = [];
      function c(v) {
        v.isGroup || (v.incremental = !0, v.ensureState("emphasis").hoverLayer = !0);
      }
      for (var f = e.start; f < e.end; f++) {
        var h = eg(null, null, f, l(f, o), n, this.group, s);
        h && (h.traverse(c), u.push(h));
      }
    }, t.prototype.eachRendered = function(e) {
      sa(this._progressiveEls || this.group, e);
    }, t.prototype.filterForExposedEvent = function(e, n, i, a) {
      var o = n.element;
      if (o == null || i.name === o)
        return !0;
      for (; (i = i.__hostTarget || i.parent) && i !== this.group; )
        if (i.name === o)
          return !0;
      return !1;
    }, t.type = "custom", t;
  }(Qe)
);
function L_(r) {
  var t = r.type, e;
  if (t === "path") {
    var n = r.shape, i = n.width != null && n.height != null ? {
      x: n.x || 0,
      y: n.y || 0,
      width: n.width,
      height: n.height
    } : null, a = NP(n);
    e = dv(a, null, i, n.layout || "center"), ri(e).customPathData = a;
  } else if (t === "image")
    e = new Pt({}), ri(e).customImagePath = r.style.image;
  else if (t === "text")
    e = new Fe({});
  else if (t === "group")
    e = new fe();
  else {
    if (t === "compoundPath")
      throw new Error('"compoundPath" is not supported yet.');
    var o = m0(t);
    if (!o) {
      var s = "";
      He(s);
    }
    e = new o();
  }
  return ri(e).customGraphicType = t, e.name = r.name, e.z2EmphasisLift = 1, e.z2SelectLift = 1, e;
}
function E_(r, t, e, n, i, a, o) {
  OP(t);
  var s = i && i.normal.cfg;
  s && t.setTextConfig(s), n && n.transition == null && (n.transition = LY);
  var l = n && n.style;
  if (l) {
    if (t.type === "text") {
      var u = l;
      te(u, "textFill") && (u.fill = u.textFill), te(u, "textStroke") && (u.stroke = u.textStroke);
    }
    var c = void 0, f = oy(t) ? l.decal : null;
    r && f && (f.dirty = !0, c = bs(f, r)), l.__decalPattern = c;
  }
  if (sy(t) && l) {
    var c = l.__decalPattern;
    c && (l.decal = c);
  }
  Nf(t, n, a, {
    dataIndex: e,
    isInit: o,
    clearStyle: !0
  }), kh(t, n.keyframeAnimation, a);
}
function FP(r, t, e, n, i) {
  var a = t.isGroup ? null : t, o = i && i[r].cfg;
  if (a) {
    var s = a.ensureState(r);
    if (n === !1) {
      var l = a.getState(r);
      l && (l.style = null);
    } else
      s.style = n || null;
    o && (s.textConfig = o), go(a);
  }
}
function OY(r, t, e) {
  if (!r.isGroup) {
    var n = r, i = e.currentZ, a = e.currentZLevel;
    n.z = i, n.zlevel = a;
    var o = t.z2;
    o != null && (n.z2 = o || 0);
    for (var s = 0; s < ra.length; s++)
      FY(n, t, ra[s]);
  }
}
function FY(r, t, e) {
  var n = e === $i, i = n ? t : Rh(t, e), a = i ? i.z2 : null, o;
  a != null && (o = n ? r : r.ensureState(e), o.z2 = a || 0);
}
function vC(r, t, e, n) {
  var i = r.get("renderItem"), a = r.coordinateSystem, o = {};
  a && (o = a.prepareCustoms ? a.prepareCustoms(a) : PY[a.type](a));
  for (var s = se({
    getWidth: n.getWidth,
    getHeight: n.getHeight,
    getZr: n.getZr,
    getDevicePixelRatio: n.getDevicePixelRatio,
    value: b,
    style: x,
    ordinalRawValue: S,
    styleEmphasis: w,
    visual: A,
    barLayout: T,
    currentSeriesIndices: L,
    font: E
  }, o.api || {}), l = {
    // The life cycle of context: current round of rendering.
    // The global life cycle is probably not necessary, because
    // user can store global status by themselves.
    context: {},
    seriesId: r.id,
    seriesName: r.name,
    seriesIndex: r.seriesIndex,
    coordSys: o.coordSys,
    dataInsideLength: t.count(),
    encode: BY(r.getData())
  }, u, c, f = {}, h = {}, v = {}, d = {}, p = 0; p < ra.length; p++) {
    var g = ra[p];
    v[g] = r.getModel(Jp[g]), d[g] = r.getModel(Qp[g]);
  }
  function m(I) {
    return I === u ? c || (c = t.getItemModel(I)) : t.getItemModel(I);
  }
  function y(I, P) {
    return t.hasItemOption ? I === u ? f[P] || (f[P] = m(I).getModel(Jp[P])) : m(I).getModel(Jp[P]) : v[P];
  }
  function _(I, P) {
    return t.hasItemOption ? I === u ? h[P] || (h[P] = m(I).getModel(Qp[P])) : m(I).getModel(Qp[P]) : d[P];
  }
  return function(I, P) {
    return u = I, c = null, f = {}, h = {}, i && i(se({
      dataIndexInside: I,
      dataIndex: t.getRawIndex(I),
      // Can be used for optimization when zoom or roam.
      actionType: P ? P.type : null
    }, l), s);
  };
  function b(I, P) {
    return P == null && (P = u), t.getStore().get(t.getDimensionIndex(I || 0), P);
  }
  function S(I, P) {
    P == null && (P = u), I = I || 0;
    var R = t.getDimensionInfo(I);
    if (!R) {
      var F = t.getDimensionIndex(I);
      return F >= 0 ? t.getStore().get(F, P) : void 0;
    }
    var O = t.get(R.name, P), z = R && R.ordinalMeta;
    return z ? z.categories[O] : O;
  }
  function x(I, P) {
    P == null && (P = u);
    var R = t.getItemVisual(P, "style"), F = R && R.fill, O = R && R.opacity, z = y(P, $i).getItemStyle();
    F != null && (z.fill = F), O != null && (z.opacity = O);
    var G = {
      inheritColor: J(F) ? F : "#000"
    }, W = _(P, $i), Y = nt(W, null, G, !1, !0);
    Y.text = W.getShallow("show") ? me(r.getFormattedLabel(P, $i), xs(t, P)) : null;
    var j = ch(W, G, !1);
    return D(I, z), z = lC(z, Y, j), I && C(z, I), z.legacy = !0, z;
  }
  function w(I, P) {
    P == null && (P = u);
    var R = y(P, ni).getItemStyle(), F = _(P, ni), O = nt(F, null, null, !0, !0);
    O.text = F.getShallow("show") ? En(r.getFormattedLabel(P, ni), r.getFormattedLabel(P, $i), xs(t, P)) : null;
    var z = ch(F, null, !0);
    return D(I, R), R = lC(R, O, z), I && C(R, I), R.legacy = !0, R;
  }
  function C(I, P) {
    for (var R in P)
      te(P, R) && (I[R] = P[R]);
  }
  function D(I, P) {
    I && (I.textFill && (P.textFill = I.textFill), I.textPosition && (P.textPosition = I.textPosition));
  }
  function A(I, P) {
    if (P == null && (P = u), te(oC, I)) {
      var R = t.getItemVisual(P, "style");
      return R ? R[oC[I]] : null;
    }
    if (te(uY, I))
      return t.getItemVisual(P, I);
  }
  function T(I) {
    if (a.type === "cartesian2d") {
      var P = a.getBaseAxis();
      return DG(se({
        axis: P
      }, I));
    }
  }
  function L() {
    return e.getCurrentSeriesIndices();
  }
  function E(I) {
    return y0(I, e);
  }
}
function BY(r) {
  var t = {};
  return M(r.dimensions, function(e) {
    var n = r.getDimensionInfo(e);
    if (!n.isExtraCoord) {
      var i = n.coordDim, a = t[i] = t[i] || [];
      a[n.coordDimIndex] = r.getDimensionIndex(e);
    }
  }), t;
}
function eg(r, t, e, n, i, a, o) {
  if (!n) {
    a.remove(t);
    return;
  }
  var s = P_(r, t, e, n, i, a);
  return s && o.setItemGraphicEl(e, s), s && ut(s, n.focus, n.blurScope, n.emphasisDisabled), s;
}
function P_(r, t, e, n, i, a) {
  var o = -1, s = t;
  t && BP(t, n, i) && (o = we(a.childrenRef(), t), t = null);
  var l = !t, u = t;
  u ? u.clearStates() : (u = L_(n), s && kY(s, u)), n.morph === !1 ? u.disableMorphing = !0 : u.disableMorphing && (u.disableMorphing = !1), Pr.normal.cfg = Pr.normal.conOpt = Pr.emphasis.cfg = Pr.emphasis.conOpt = Pr.blur.cfg = Pr.blur.conOpt = Pr.select.cfg = Pr.select.conOpt = null, Pr.isLegacy = !1, zY(u, e, n, i, l, Pr), NY(u, e, n, i, l), E_(r, u, e, n, Pr, i, l), te(n, "info") && (ri(u).info = n.info);
  for (var c = 0; c < ra.length; c++) {
    var f = ra[c];
    if (f !== $i) {
      var h = Rh(n, f), v = k_(n, h, f);
      FP(f, u, h, v, Pr);
    }
  }
  return OY(u, n, i), n.type === "group" && VY(r, u, e, n, i), o >= 0 ? a.replaceAt(u, o) : a.add(u), u;
}
function BP(r, t, e) {
  var n = ri(r), i = t.type, a = t.shape, o = t.style;
  return (
    // Always create new if universal transition is enabled.
    // Because we do transition after render. It needs to know what old element is. Replacement will loose it.
    e.isUniversalTransitionEnabled() || i != null && i !== n.customGraphicType || i === "path" && qY(a) && NP(a) !== n.customPathData || i === "image" && te(o, "image") && o.image !== n.customImagePath
  );
}
function NY(r, t, e, n, i) {
  var a = e.clipPath;
  if (a === !1)
    r && r.getClipPath() && r.removeClipPath();
  else if (a) {
    var o = r.getClipPath();
    o && BP(o, a, n) && (o = null), o || (o = L_(a), r.setClipPath(o)), E_(null, o, t, a, null, n, i);
  }
}
function zY(r, t, e, n, i, a) {
  if (!r.isGroup) {
    dC(e, null, a), dC(e, ni, a);
    var o = a.normal.conOpt, s = a.emphasis.conOpt, l = a.blur.conOpt, u = a.select.conOpt;
    if (o != null || s != null || u != null || l != null) {
      var c = r.getTextContent();
      if (o === !1)
        c && r.removeTextContent();
      else {
        o = a.normal.conOpt = o || {
          type: "text"
        }, c ? c.clearStates() : (c = L_(o), r.setTextContent(c)), E_(null, c, t, o, null, n, i);
        for (var f = o && o.style, h = 0; h < ra.length; h++) {
          var v = ra[h];
          if (v !== $i) {
            var d = a[v].conOpt;
            FP(v, c, d, k_(o, d, v), null);
          }
        }
        f ? c.dirty() : c.markRedraw();
      }
    }
  }
}
function dC(r, t, e) {
  var n = t ? Rh(r, t) : r, i = t ? k_(r, n, ni) : r.style, a = r.type, o = n ? n.textConfig : null, s = r.textContent, l = s ? t ? Rh(s, t) : s : null;
  if (i && // Because emphasis style has little info to detect legacy,
  // if normal is legacy, emphasis is trade as legacy.
  (e.isLegacy || LP(i, a, !!o, !!l))) {
    e.isLegacy = !0;
    var u = EP(i, a, !t);
    !o && u.textConfig && (o = u.textConfig), !l && u.textContent && (l = u.textContent);
  }
  if (!t && l) {
    var c = l;
    !c.type && (c.type = "text");
  }
  var f = t ? e[t] : e.normal;
  f.cfg = o, f.conOpt = l;
}
function Rh(r, t) {
  return t ? r ? r[t] : null : r;
}
function k_(r, t, e) {
  var n = t && t.style;
  return n == null && e === ni && r && (n = r.styleEmphasis), n;
}
function VY(r, t, e, n, i) {
  var a = n.children, o = a ? a.length : 0, s = n.$mergeChildren, l = s === "byName" || n.diffChildrenByName, u = s === !1;
  if (!(!o && !l && !u)) {
    if (l) {
      GY({
        api: r,
        oldChildren: t.children() || [],
        newChildren: a || [],
        dataIndex: e,
        seriesModel: i,
        group: t
      });
      return;
    }
    u && t.removeAll();
    for (var c = 0; c < o; c++) {
      var f = a[c], h = t.childAt(c);
      f ? (f.ignore == null && (f.ignore = !1), P_(r, h, e, f, i, t)) : h.ignore = !0;
    }
    for (var v = t.childCount() - 1; v >= c; v--) {
      var d = t.childAt(v);
      $Y(t, d, i);
    }
  }
}
function $Y(r, t, e) {
  t && Nv(t, ri(r).option, e);
}
function GY(r) {
  new li(r.oldChildren, r.newChildren, pC, pC, r).add(gC).update(gC).remove(HY).execute();
}
function pC(r, t) {
  var e = r && r.name;
  return e ?? EY + t;
}
function gC(r, t) {
  var e = this.context, n = r != null ? e.newChildren[r] : null, i = t != null ? e.oldChildren[t] : null;
  P_(e.api, i, e.dataIndex, n, e.seriesModel, e.group);
}
function HY(r) {
  var t = this.context, e = t.oldChildren[r];
  e && Nv(e, ri(e).option, t.seriesModel);
}
function NP(r) {
  return r && (r.pathData || r.d);
}
function qY(r) {
  return r && (te(r, "pathData") || te(r, "d"));
}
function WY(r) {
  r.registerChartView(RY), r.registerSeriesModel(cY);
}
var Ga = Oe(), mC = ce, tg = Q, R_ = (
  /** @class */
  function() {
    function r() {
      this._dragging = !1, this.animationThreshold = 15;
    }
    return r.prototype.render = function(t, e, n, i) {
      var a = e.get("value"), o = e.get("status");
      if (this._axisModel = t, this._axisPointerModel = e, this._api = n, !(!i && this._lastValue === a && this._lastStatus === o)) {
        this._lastValue = a, this._lastStatus = o;
        var s = this._group, l = this._handle;
        if (!o || o === "hide") {
          s && s.hide(), l && l.hide();
          return;
        }
        s && s.show(), l && l.show();
        var u = {};
        this.makeElOption(u, a, t, e, n);
        var c = u.graphicKey;
        c !== this._lastGraphicKey && this.clear(n), this._lastGraphicKey = c;
        var f = this._moveAnimation = this.determineAnimation(t, e);
        if (!s)
          s = this._group = new fe(), this.createPointerEl(s, u, t, e), this.createLabelEl(s, u, t, e), n.getZr().add(s);
        else {
          var h = ye(yC, e, f);
          this.updatePointerEl(s, u, h), this.updateLabelEl(s, u, h, e);
        }
        bC(s, e, !0), this._renderHandle(a);
      }
    }, r.prototype.remove = function(t) {
      this.clear(t);
    }, r.prototype.dispose = function(t) {
      this.clear(t);
    }, r.prototype.determineAnimation = function(t, e) {
      var n = e.get("animation"), i = t.axis, a = i.type === "category", o = e.get("snap");
      if (!o && !a)
        return !1;
      if (n === "auto" || n == null) {
        var s = this.animationThreshold;
        if (a && i.getBandWidth() > s)
          return !0;
        if (o) {
          var l = r_(t).seriesDataCount, u = i.getExtent();
          return Math.abs(u[0] - u[1]) / l > s;
        }
        return !1;
      }
      return n === !0;
    }, r.prototype.makeElOption = function(t, e, n, i, a) {
    }, r.prototype.createPointerEl = function(t, e, n, i) {
      var a = e.pointer;
      if (a) {
        var o = Ga(t).pointerEl = new wo[a.type](mC(e.pointer));
        t.add(o);
      }
    }, r.prototype.createLabelEl = function(t, e, n, i) {
      if (e.label) {
        var a = Ga(t).labelEl = new Fe(mC(e.label));
        t.add(a), _C(a, i);
      }
    }, r.prototype.updatePointerEl = function(t, e, n) {
      var i = Ga(t).pointerEl;
      i && e.pointer && (i.setStyle(e.pointer.style), n(i, {
        shape: e.pointer.shape
      }));
    }, r.prototype.updateLabelEl = function(t, e, n, i) {
      var a = Ga(t).labelEl;
      a && (a.setStyle(e.label.style), n(a, {
        // Consider text length change in vertical axis, animation should
        // be used on shape, otherwise the effect will be weird.
        // TODOTODO
        // shape: elOption.label.shape,
        x: e.label.x,
        y: e.label.y
      }), _C(a, i));
    }, r.prototype._renderHandle = function(t) {
      if (!(this._dragging || !this.updateHandleTransform)) {
        var e = this._axisPointerModel, n = this._api.getZr(), i = this._handle, a = e.getModel("handle"), o = e.get("status");
        if (!a.get("show") || !o || o === "hide") {
          i && n.remove(i), this._handle = null;
          return;
        }
        var s;
        this._handle || (s = !0, i = this._handle = Yu(a.get("icon"), {
          cursor: "move",
          draggable: !0,
          onmousemove: function(u) {
            ii(u.event);
          },
          onmousedown: tg(this._onHandleDragMove, this, 0, 0),
          drift: tg(this._onHandleDragMove, this),
          ondragend: tg(this._onHandleDragEnd, this)
        }), n.add(i)), bC(i, e, !1), i.setStyle(a.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
        var l = a.get("size");
        q(l) || (l = [l, l]), i.scaleX = l[0] / 2, i.scaleY = l[1] / 2, Vs(this, "_doDispatchAxisPointer", a.get("throttle") || 0, "fixRate"), this._moveHandleToValue(t, s);
      }
    }, r.prototype._moveHandleToValue = function(t, e) {
      yC(this._axisPointerModel, !e && this._moveAnimation, this._handle, rg(this.getHandleTransform(t, this._axisModel, this._axisPointerModel)));
    }, r.prototype._onHandleDragMove = function(t, e) {
      var n = this._handle;
      if (n) {
        this._dragging = !0;
        var i = this.updateHandleTransform(rg(n), [t, e], this._axisModel, this._axisPointerModel);
        this._payloadInfo = i, n.stopAnimation(), n.attr(rg(i)), Ga(n).lastProp = null, this._doDispatchAxisPointer();
      }
    }, r.prototype._doDispatchAxisPointer = function() {
      var t = this._handle;
      if (t) {
        var e = this._payloadInfo, n = this._axisModel;
        this._api.dispatchAction({
          type: "updateAxisPointer",
          x: e.cursorPoint[0],
          y: e.cursorPoint[1],
          tooltipOption: e.tooltipOption,
          axesInfo: [{
            axisDim: n.axis.dim,
            axisIndex: n.componentIndex
          }]
        });
      }
    }, r.prototype._onHandleDragEnd = function() {
      this._dragging = !1;
      var t = this._handle;
      if (t) {
        var e = this._axisPointerModel.get("value");
        this._moveHandleToValue(e), this._api.dispatchAction({
          type: "hideTip"
        });
      }
    }, r.prototype.clear = function(t) {
      this._lastValue = null, this._lastStatus = null;
      var e = t.getZr(), n = this._group, i = this._handle;
      e && n && (this._lastGraphicKey = null, n && e.remove(n), i && e.remove(i), this._group = null, this._handle = null, this._payloadInfo = null), xu(this, "_doDispatchAxisPointer");
    }, r.prototype.doClear = function() {
    }, r.prototype.buildLabel = function(t, e, n) {
      return n = n || 0, {
        x: t[n],
        y: t[1 - n],
        width: e[n],
        height: e[1 - n]
      };
    }, r;
  }()
);
function yC(r, t, e, n) {
  zP(Ga(e).lastProp, n) || (Ga(e).lastProp = n, t ? Ne(e, n, r) : (e.stopAnimation(), e.attr(n)));
}
function zP(r, t) {
  if (ue(r) && ue(t)) {
    var e = !0;
    return M(t, function(n, i) {
      e = e && zP(r[i], n);
    }), !!e;
  } else
    return r === t;
}
function _C(r, t) {
  r[t.get(["label", "show"]) ? "show" : "hide"]();
}
function rg(r) {
  return {
    x: r.x || 0,
    y: r.y || 0,
    rotation: r.rotation || 0
  };
}
function bC(r, t, e) {
  var n = t.get("z"), i = t.get("zlevel");
  r && r.traverse(function(a) {
    a.type !== "group" && (n != null && (a.z = n), i != null && (a.zlevel = i), a.silent = e);
  });
}
function O_(r) {
  var t = r.get("type"), e = r.getModel(t + "Style"), n;
  return t === "line" ? (n = e.getLineStyle(), n.fill = null) : t === "shadow" && (n = e.getAreaStyle(), n.stroke = null), n;
}
function VP(r, t, e, n, i) {
  var a = e.get("value"), o = $P(a, t.axis, t.ecModel, e.get("seriesDataIndices"), {
    precision: e.get(["label", "precision"]),
    formatter: e.get(["label", "formatter"])
  }), s = e.getModel("label"), l = Fs(s.get("padding") || 0), u = s.getFont(), c = Vu(o, u), f = i.position, h = c.width + l[1] + l[3], v = c.height + l[0] + l[2], d = i.align;
  d === "right" && (f[0] -= h), d === "center" && (f[0] -= h / 2);
  var p = i.verticalAlign;
  p === "bottom" && (f[1] -= v), p === "middle" && (f[1] -= v / 2), UY(f, h, v, n);
  var g = s.get("backgroundColor");
  (!g || g === "auto") && (g = t.get(["axisLine", "lineStyle", "color"])), r.label = {
    // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
    x: f[0],
    y: f[1],
    style: nt(s, {
      text: o,
      font: u,
      fill: s.getTextColor(),
      padding: l,
      backgroundColor: g
    }),
    // Label should be over axisPointer.
    z2: 10
  };
}
function UY(r, t, e, n) {
  var i = n.getWidth(), a = n.getHeight();
  r[0] = Math.min(r[0] + t, i) - t, r[1] = Math.min(r[1] + e, a) - e, r[0] = Math.max(r[0], 0), r[1] = Math.max(r[1], 0);
}
function $P(r, t, e, n, i) {
  r = t.scale.parse(r);
  var a = t.scale.getLabel({
    value: r
  }, {
    // If `precision` is set, width can be fixed (like '12.00500'), which
    // helps to debounce when when moving label.
    precision: i.precision
  }), o = i.formatter;
  if (o) {
    var s = {
      value: W0(t, {
        value: r
      }),
      axisDimension: t.dim,
      axisIndex: t.index,
      seriesData: []
    };
    M(n, function(l) {
      var u = e.getSeriesByIndex(l.seriesIndex), c = l.dataIndexInside, f = u && u.getDataParams(c);
      f && s.seriesData.push(f);
    }), J(o) ? a = o.replace("{value}", a) : oe(o) && (a = o(s));
  }
  return a;
}
function F_(r, t, e) {
  var n = Cr();
  return So(n, n, e.rotation), Rn(n, n, e.position), an([r.dataToCoord(t), (e.labelOffset || 0) + (e.labelDirection || 1) * (e.labelMargin || 0)], n);
}
function GP(r, t, e, n, i, a) {
  var o = tr.innerTextLayout(e.rotation, 0, e.labelDirection);
  e.labelMargin = i.get(["label", "margin"]), VP(t, n, i, a, {
    position: F_(n.axis, r, e),
    align: o.textAlign,
    verticalAlign: o.textVerticalAlign
  });
}
function B_(r, t, e) {
  return e = e || 0, {
    x1: r[e],
    y1: r[1 - e],
    x2: t[e],
    y2: t[1 - e]
  };
}
function HP(r, t, e) {
  return e = e || 0, {
    x: r[e],
    y: r[1 - e],
    width: t[e],
    height: t[1 - e]
  };
}
function SC(r, t, e, n, i, a) {
  return {
    cx: r,
    cy: t,
    r0: e,
    r: n,
    startAngle: i,
    endAngle: a,
    clockwise: !0
  };
}
var YY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(e, n, i, a, o) {
      var s = i.axis, l = s.grid, u = a.get("type"), c = xC(l, s).getOtherAxis(s).getGlobalExtent(), f = s.toGlobalCoord(s.dataToCoord(n, !0));
      if (u && u !== "none") {
        var h = O_(a), v = ZY[u](s, f, c);
        v.style = h, e.graphicKey = v.type, e.pointer = v;
      }
      var d = $m(l.model, i);
      GP(
        // @ts-ignore
        n,
        e,
        d,
        i,
        a,
        o
      );
    }, t.prototype.getHandleTransform = function(e, n, i) {
      var a = $m(n.axis.grid.model, n, {
        labelInside: !1
      });
      a.labelMargin = i.get(["handle", "margin"]);
      var o = F_(n.axis, e, a);
      return {
        x: o[0],
        y: o[1],
        rotation: a.rotation + (a.labelDirection < 0 ? Math.PI : 0)
      };
    }, t.prototype.updateHandleTransform = function(e, n, i, a) {
      var o = i.axis, s = o.grid, l = o.getGlobalExtent(!0), u = xC(s, o).getOtherAxis(o).getGlobalExtent(), c = o.dim === "x" ? 0 : 1, f = [e.x, e.y];
      f[c] += n[c], f[c] = Math.min(l[1], f[c]), f[c] = Math.max(l[0], f[c]);
      var h = (u[1] + u[0]) / 2, v = [h, h];
      v[c] = f[c];
      var d = [{
        verticalAlign: "middle"
      }, {
        align: "center"
      }];
      return {
        x: f[0],
        y: f[1],
        rotation: e.rotation,
        cursorPoint: v,
        tooltipOption: d[c]
      };
    }, t;
  }(R_)
);
function xC(r, t) {
  var e = {};
  return e[t.dim + "AxisIndex"] = t.index, r.getCartesian(e);
}
var ZY = {
  line: function(r, t, e) {
    var n = B_([t, e[0]], [t, e[1]], wC(r));
    return {
      type: "Line",
      subPixelOptimize: !0,
      shape: n
    };
  },
  shadow: function(r, t, e) {
    var n = Math.max(1, r.getBandWidth()), i = e[1] - e[0];
    return {
      type: "Rect",
      shape: HP([t - n / 2, e[0]], [n, i], wC(r))
    };
  }
};
function wC(r) {
  return r.dim === "x" ? 0 : 1;
}
var XY = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "axisPointer", t.defaultOption = {
      // 'auto' means that show when triggered by tooltip or handle.
      show: "auto",
      // zlevel: 0,
      z: 50,
      type: "line",
      // axispointer triggered by tootip determine snap automatically,
      // see `modelHelper`.
      snap: !1,
      triggerTooltip: !0,
      triggerEmphasis: !0,
      value: null,
      status: null,
      link: [],
      // Do not set 'auto' here, otherwise global animation: false
      // will not effect at this axispointer.
      animation: null,
      animationDurationUpdate: 200,
      lineStyle: {
        color: "#B9BEC9",
        width: 1,
        type: "dashed"
      },
      shadowStyle: {
        color: "rgba(210,219,238,0.2)"
      },
      label: {
        show: !0,
        formatter: null,
        precision: "auto",
        margin: 3,
        color: "#fff",
        padding: [5, 7, 5, 7],
        backgroundColor: "auto",
        borderColor: null,
        borderWidth: 0,
        borderRadius: 3
      },
      handle: {
        show: !1,
        // eslint-disable-next-line
        icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
        size: 45,
        // handle margin is from symbol center to axis, which is stable when circular move.
        margin: 50,
        // color: '#1b8bbd'
        // color: '#2f4554'
        color: "#333",
        shadowBlur: 3,
        shadowColor: "#aaa",
        shadowOffsetX: 0,
        shadowOffsetY: 2,
        // For mobile performance
        throttle: 40
      }
    }, t;
  }(Le)
), Jn = Oe(), jY = M;
function qP(r, t, e) {
  if (!Ie.node) {
    var n = t.getZr();
    Jn(n).records || (Jn(n).records = {}), KY(n, t);
    var i = Jn(n).records[r] || (Jn(n).records[r] = {});
    i.handler = e;
  }
}
function KY(r, t) {
  if (Jn(r).initialized)
    return;
  Jn(r).initialized = !0, e("click", ye(CC, "click")), e("mousemove", ye(CC, "mousemove")), e("globalout", QY);
  function e(n, i) {
    r.on(n, function(a) {
      var o = eZ(t);
      jY(Jn(r).records, function(s) {
        s && i(s, a, o.dispatchAction);
      }), JY(o.pendings, t);
    });
  }
}
function JY(r, t) {
  var e = r.showTip.length, n = r.hideTip.length, i;
  e ? i = r.showTip[e - 1] : n && (i = r.hideTip[n - 1]), i && (i.dispatchAction = null, t.dispatchAction(i));
}
function QY(r, t, e) {
  r.handler("leave", null, e);
}
function CC(r, t, e, n) {
  t.handler(r, e, n);
}
function eZ(r) {
  var t = {
    showTip: [],
    hideTip: []
  }, e = function(n) {
    var i = t[n.type];
    i ? i.push(n) : (n.dispatchAction = e, r.dispatchAction(n));
  };
  return {
    dispatchAction: e,
    pendings: t
  };
}
function ly(r, t) {
  if (!Ie.node) {
    var e = t.getZr(), n = (Jn(e).records || {})[r];
    n && (Jn(e).records[r] = null);
  }
}
var tZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = n.getComponent("tooltip"), o = e.get("triggerOn") || a && a.get("triggerOn") || "mousemove|click";
      qP("axisPointer", i, function(s, l, u) {
        o !== "none" && (s === "leave" || o.indexOf(s) >= 0) && u({
          type: "updateAxisPointer",
          currTrigger: s,
          x: l && l.offsetX,
          y: l && l.offsetY
        });
      });
    }, t.prototype.remove = function(e, n) {
      ly("axisPointer", n);
    }, t.prototype.dispose = function(e, n) {
      ly("axisPointer", n);
    }, t.type = "axisPointer", t;
  }(lt)
);
function WP(r, t) {
  var e = [], n = r.seriesIndex, i;
  if (n == null || !(i = t.getSeriesByIndex(n)))
    return {
      point: []
    };
  var a = i.getData(), o = vo(a, r);
  if (o == null || o < 0 || q(o))
    return {
      point: []
    };
  var s = a.getItemGraphicEl(o), l = i.coordinateSystem;
  if (i.getTooltipPosition)
    e = i.getTooltipPosition(o) || [];
  else if (l && l.dataToPoint)
    if (r.isStacked) {
      var u = l.getBaseAxis(), c = l.getOtherAxis(u), f = c.dim, h = u.dim, v = f === "x" || f === "radius" ? 1 : 0, d = a.mapDimension(h), p = [];
      p[v] = a.get(d, o), p[1 - v] = a.get(a.getCalculationInfo("stackResultDimension"), o), e = l.dataToPoint(p) || [];
    } else
      e = l.dataToPoint(a.getValues(U(l.dimensions, function(m) {
        return a.mapDimension(m);
      }), o)) || [];
  else if (s) {
    var g = s.getBoundingRect().clone();
    g.applyTransform(s.transform), e = [g.x + g.width / 2, g.y + g.height / 2];
  }
  return {
    point: e,
    el: s
  };
}
var AC = Oe();
function rZ(r, t, e) {
  var n = r.currTrigger, i = [r.x, r.y], a = r, o = r.dispatchAction || Q(e.dispatchAction, e), s = t.getComponent("axisPointer").coordSysAxesInfo;
  if (s) {
    zf(i) && (i = WP({
      seriesIndex: a.seriesIndex,
      // Do not use dataIndexInside from other ec instance.
      // FIXME: auto detect it?
      dataIndex: a.dataIndex
    }, t).point);
    var l = zf(i), u = a.axesInfo, c = s.axesInfo, f = n === "leave" || zf(i), h = {}, v = {}, d = {
      list: [],
      map: {}
    }, p = {
      showPointer: ye(iZ, v),
      showTooltip: ye(aZ, d)
    };
    M(s.coordSysMap, function(m, y) {
      var _ = l || m.containPoint(i);
      M(s.coordSysAxesInfo[y], function(b, S) {
        var x = b.axis, w = uZ(u, b);
        if (!f && _ && (!u || w)) {
          var C = w && w.value;
          C == null && !l && (C = x.pointToData(i)), C != null && DC(b, C, p, !1, h);
        }
      });
    });
    var g = {};
    return M(c, function(m, y) {
      var _ = m.linkGroup;
      _ && !v[y] && M(_.axesInfo, function(b, S) {
        var x = v[S];
        if (b !== m && x) {
          var w = x.value;
          _.mapper && (w = m.axis.scale.parse(_.mapper(w, TC(b), TC(m)))), g[m.key] = w;
        }
      });
    }), M(g, function(m, y) {
      DC(c[y], m, p, !0, h);
    }), oZ(v, c, h), sZ(d, i, r, o), lZ(c, o, e), h;
  }
}
function DC(r, t, e, n, i) {
  var a = r.axis;
  if (!(a.scale.isBlank() || !a.containData(t))) {
    if (!r.involveSeries) {
      e.showPointer(r, t);
      return;
    }
    var o = nZ(t, r), s = o.payloadBatch, l = o.snapToValue;
    s[0] && i.seriesIndex == null && H(i, s[0]), !n && r.snap && a.containData(l) && l != null && (t = l), e.showPointer(r, t, s), e.showTooltip(r, o, l);
  }
}
function nZ(r, t) {
  var e = t.axis, n = e.dim, i = r, a = [], o = Number.MAX_VALUE, s = -1;
  return M(t.seriesModels, function(l, u) {
    var c = l.getData().mapDimensionsAll(n), f, h;
    if (l.getAxisTooltipData) {
      var v = l.getAxisTooltipData(c, r, e);
      h = v.dataIndices, f = v.nestestValue;
    } else {
      if (h = l.getData().indicesOfNearest(
        c[0],
        r,
        // Add a threshold to avoid find the wrong dataIndex
        // when data length is not same.
        // false,
        e.type === "category" ? 0.5 : null
      ), !h.length)
        return;
      f = l.getData().get(c[0], h[0]);
    }
    if (!(f == null || !isFinite(f))) {
      var d = r - f, p = Math.abs(d);
      p <= o && ((p < o || d >= 0 && s < 0) && (o = p, s = d, i = f, a.length = 0), M(h, function(g) {
        a.push({
          seriesIndex: l.seriesIndex,
          dataIndexInside: g,
          dataIndex: l.getData().getRawIndex(g)
        });
      }));
    }
  }), {
    payloadBatch: a,
    snapToValue: i
  };
}
function iZ(r, t, e, n) {
  r[t.key] = {
    value: e,
    payloadBatch: n
  };
}
function aZ(r, t, e, n) {
  var i = e.payloadBatch, a = t.axis, o = a.model, s = t.axisPointerModel;
  if (!(!t.triggerTooltip || !i.length)) {
    var l = t.coordSys.model, u = Iu(l), c = r.map[u];
    c || (c = r.map[u] = {
      coordSysId: l.id,
      coordSysIndex: l.componentIndex,
      coordSysType: l.type,
      coordSysMainType: l.mainType,
      dataByAxis: []
    }, r.list.push(c)), c.dataByAxis.push({
      axisDim: a.dim,
      axisIndex: o.componentIndex,
      axisType: o.type,
      axisId: o.id,
      value: n,
      // Caustion: viewHelper.getValueLabel is actually on "view stage", which
      // depends that all models have been updated. So it should not be performed
      // here. Considering axisPointerModel used here is volatile, which is hard
      // to be retrieve in TooltipView, we prepare parameters here.
      valueLabelOpt: {
        precision: s.get(["label", "precision"]),
        formatter: s.get(["label", "formatter"])
      },
      seriesDataIndices: i.slice()
    });
  }
}
function oZ(r, t, e) {
  var n = e.axesInfo = [];
  M(t, function(i, a) {
    var o = i.axisPointerModel.option, s = r[a];
    s ? (!i.useHandle && (o.status = "show"), o.value = s.value, o.seriesDataIndices = (s.payloadBatch || []).slice()) : !i.useHandle && (o.status = "hide"), o.status === "show" && n.push({
      axisDim: i.axis.dim,
      axisIndex: i.axis.model.componentIndex,
      value: o.value
    });
  });
}
function sZ(r, t, e, n) {
  if (zf(t) || !r.list.length) {
    n({
      type: "hideTip"
    });
    return;
  }
  var i = ((r.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
  n({
    type: "showTip",
    escapeConnect: !0,
    x: t[0],
    y: t[1],
    tooltipOption: e.tooltipOption,
    position: e.position,
    dataIndexInside: i.dataIndexInside,
    dataIndex: i.dataIndex,
    seriesIndex: i.seriesIndex,
    dataByCoordSys: r.list
  });
}
function lZ(r, t, e) {
  var n = e.getZr(), i = "axisPointerLastHighlights", a = AC(n)[i] || {}, o = AC(n)[i] = {};
  M(r, function(u, c) {
    var f = u.axisPointerModel.option;
    f.status === "show" && u.triggerEmphasis && M(f.seriesDataIndices, function(h) {
      var v = h.seriesIndex + " | " + h.dataIndex;
      o[v] = h;
    });
  });
  var s = [], l = [];
  M(a, function(u, c) {
    !o[c] && l.push(u);
  }), M(o, function(u, c) {
    !a[c] && s.push(u);
  }), l.length && e.dispatchAction({
    type: "downplay",
    escapeConnect: !0,
    // Not blur others when highlight in axisPointer.
    notBlur: !0,
    batch: l
  }), s.length && e.dispatchAction({
    type: "highlight",
    escapeConnect: !0,
    // Not blur others when highlight in axisPointer.
    notBlur: !0,
    batch: s
  });
}
function uZ(r, t) {
  for (var e = 0; e < (r || []).length; e++) {
    var n = r[e];
    if (t.axis.dim === n.axisDim && t.axis.model.componentIndex === n.axisIndex)
      return n;
  }
}
function TC(r) {
  var t = r.axis.model, e = {}, n = e.axisDim = r.axis.dim;
  return e.axisIndex = e[n + "AxisIndex"] = t.componentIndex, e.axisName = e[n + "AxisName"] = t.name, e.axisId = e[n + "AxisId"] = t.id, e;
}
function zf(r) {
  return !r || r[0] == null || isNaN(r[0]) || r[1] == null || isNaN(r[1]);
}
function oc(r) {
  To.registerAxisPointerClass("CartesianAxisPointer", YY), r.registerComponentModel(XY), r.registerComponentView(tZ), r.registerPreprocessor(function(t) {
    if (t) {
      (!t.axisPointer || t.axisPointer.length === 0) && (t.axisPointer = {});
      var e = t.axisPointer.link;
      e && !q(e) && (t.axisPointer.link = [e]);
    }
  }), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, function(t, e) {
    t.getComponent("axisPointer").coordSysAxesInfo = _H(t, e);
  }), r.registerAction({
    type: "updateAxisPointer",
    event: "updateAxisPointer",
    update: ":updateAxisPointer"
  }, rZ);
}
function cZ(r) {
  De(_E), De(oc);
}
var fZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(e, n, i, a, o) {
      var s = i.axis;
      s.dim === "angle" && (this.animationThreshold = Math.PI / 18);
      var l = s.polar, u = l.getOtherAxis(s), c = u.getExtent(), f = s.dataToCoord(n), h = a.get("type");
      if (h && h !== "none") {
        var v = O_(a), d = vZ[h](s, l, f, c);
        d.style = v, e.graphicKey = d.type, e.pointer = d;
      }
      var p = a.get(["label", "margin"]), g = hZ(n, i, a, l, p);
      VP(e, i, a, o, g);
    }, t;
  }(R_)
);
function hZ(r, t, e, n, i) {
  var a = t.axis, o = a.dataToCoord(r), s = n.getAngleAxis().getExtent()[0];
  s = s / 180 * Math.PI;
  var l = n.getRadiusAxis().getExtent(), u, c, f;
  if (a.dim === "radius") {
    var h = Cr();
    So(h, h, s), Rn(h, h, [n.cx, n.cy]), u = an([o, -i], h);
    var v = t.getModel("axisLabel").get("rotate") || 0, d = tr.innerTextLayout(s, v * Math.PI / 180, -1);
    c = d.textAlign, f = d.textVerticalAlign;
  } else {
    var p = l[1];
    u = n.coordToPoint([p + i, o]);
    var g = n.cx, m = n.cy;
    c = Math.abs(u[0] - g) / p < 0.3 ? "center" : u[0] > g ? "left" : "right", f = Math.abs(u[1] - m) / p < 0.3 ? "middle" : u[1] > m ? "top" : "bottom";
  }
  return {
    position: u,
    align: c,
    verticalAlign: f
  };
}
var vZ = {
  line: function(r, t, e, n) {
    return r.dim === "angle" ? {
      type: "Line",
      shape: B_(t.coordToPoint([n[0], e]), t.coordToPoint([n[1], e]))
    } : {
      type: "Circle",
      shape: {
        cx: t.cx,
        cy: t.cy,
        r: e
      }
    };
  },
  shadow: function(r, t, e, n) {
    var i = Math.max(1, r.getBandWidth()), a = Math.PI / 180;
    return r.dim === "angle" ? {
      type: "Sector",
      shape: SC(
        t.cx,
        t.cy,
        n[0],
        n[1],
        // In ECharts y is negative if angle is positive
        (-e - i / 2) * a,
        (-e + i / 2) * a
      )
    } : {
      type: "Sector",
      shape: SC(t.cx, t.cy, e - i / 2, e + i / 2, 0, Math.PI * 2)
    };
  }
}, dZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.findAxisModel = function(e) {
      var n, i = this.ecModel;
      return i.eachComponent(e, function(a) {
        a.getCoordSysModel() === this && (n = a);
      }, this), n;
    }, t.type = "polar", t.dependencies = ["radiusAxis", "angleAxis"], t.defaultOption = {
      // zlevel: 0,
      z: 0,
      center: ["50%", "50%"],
      radius: "80%"
    }, t;
  }(Le)
), N_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("polar", mt).models[0];
    }, t.type = "polarAxis", t;
  }(Le)
);
_t(N_, Ku);
var pZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "angleAxis", t;
  }(N_)
), gZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "radiusAxis", t;
  }(N_)
), z_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n) {
      return r.call(this, "radius", e, n) || this;
    }
    return t.prototype.pointToData = function(e, n) {
      return this.polar.pointToData(e, n)[this.dim === "radius" ? 0 : 1];
    }, t;
  }(hn)
);
z_.prototype.dataToRadius = hn.prototype.dataToCoord;
z_.prototype.radiusToData = hn.prototype.coordToData;
var mZ = Oe(), V_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n) {
      return r.call(this, "angle", e, n || [0, 360]) || this;
    }
    return t.prototype.pointToData = function(e, n) {
      return this.polar.pointToData(e, n)[this.dim === "radius" ? 0 : 1];
    }, t.prototype.calculateCategoryInterval = function() {
      var e = this, n = e.getLabelModel(), i = e.scale, a = i.getExtent(), o = i.count();
      if (a[1] - a[0] < 1)
        return 0;
      var s = a[0], l = e.dataToCoord(s + 1) - e.dataToCoord(s), u = Math.abs(l), c = Vu(s == null ? "" : s + "", n.getFont(), "center", "top"), f = Math.max(c.height, 7), h = f / u;
      isNaN(h) && (h = 1 / 0);
      var v = Math.max(0, Math.floor(h)), d = mZ(e.model), p = d.lastAutoInterval, g = d.lastTickCount;
      return p != null && g != null && Math.abs(p - v) <= 1 && Math.abs(g - o) <= 1 && p > v ? v = p : (d.lastTickCount = o, d.lastAutoInterval = v), v;
    }, t;
  }(hn)
);
V_.prototype.dataToAngle = hn.prototype.dataToCoord;
V_.prototype.angleToData = hn.prototype.coordToData;
var UP = ["radius", "angle"], yZ = (
  /** @class */
  function() {
    function r(t) {
      this.dimensions = UP, this.type = "polar", this.cx = 0, this.cy = 0, this._radiusAxis = new z_(), this._angleAxis = new V_(), this.axisPointerEnabled = !0, this.name = t || "", this._radiusAxis.polar = this._angleAxis.polar = this;
    }
    return r.prototype.containPoint = function(t) {
      var e = this.pointToCoord(t);
      return this._radiusAxis.contain(e[0]) && this._angleAxis.contain(e[1]);
    }, r.prototype.containData = function(t) {
      return this._radiusAxis.containData(t[0]) && this._angleAxis.containData(t[1]);
    }, r.prototype.getAxis = function(t) {
      var e = "_" + t + "Axis";
      return this[e];
    }, r.prototype.getAxes = function() {
      return [this._radiusAxis, this._angleAxis];
    }, r.prototype.getAxesByScale = function(t) {
      var e = [], n = this._angleAxis, i = this._radiusAxis;
      return n.scale.type === t && e.push(n), i.scale.type === t && e.push(i), e;
    }, r.prototype.getAngleAxis = function() {
      return this._angleAxis;
    }, r.prototype.getRadiusAxis = function() {
      return this._radiusAxis;
    }, r.prototype.getOtherAxis = function(t) {
      var e = this._angleAxis;
      return t === e ? this._radiusAxis : e;
    }, r.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
    }, r.prototype.getTooltipAxes = function(t) {
      var e = t != null && t !== "auto" ? this.getAxis(t) : this.getBaseAxis();
      return {
        baseAxes: [e],
        otherAxes: [this.getOtherAxis(e)]
      };
    }, r.prototype.dataToPoint = function(t, e) {
      return this.coordToPoint([this._radiusAxis.dataToRadius(t[0], e), this._angleAxis.dataToAngle(t[1], e)]);
    }, r.prototype.pointToData = function(t, e) {
      var n = this.pointToCoord(t);
      return [this._radiusAxis.radiusToData(n[0], e), this._angleAxis.angleToData(n[1], e)];
    }, r.prototype.pointToCoord = function(t) {
      var e = t[0] - this.cx, n = t[1] - this.cy, i = this.getAngleAxis(), a = i.getExtent(), o = Math.min(a[0], a[1]), s = Math.max(a[0], a[1]);
      i.inverse ? o = s - 360 : s = o + 360;
      var l = Math.sqrt(e * e + n * n);
      e /= l, n /= l;
      for (var u = Math.atan2(-n, e) / Math.PI * 180, c = u < o ? 1 : -1; u < o || u > s; )
        u += c * 360;
      return [l, u];
    }, r.prototype.coordToPoint = function(t) {
      var e = t[0], n = t[1] / 180 * Math.PI, i = Math.cos(n) * e + this.cx, a = -Math.sin(n) * e + this.cy;
      return [i, a];
    }, r.prototype.getArea = function() {
      var t = this.getAngleAxis(), e = this.getRadiusAxis(), n = e.getExtent().slice();
      n[0] > n[1] && n.reverse();
      var i = t.getExtent(), a = Math.PI / 180, o = 1e-4;
      return {
        cx: this.cx,
        cy: this.cy,
        r0: n[0],
        r: n[1],
        startAngle: -i[0] * a,
        endAngle: -i[1] * a,
        clockwise: t.inverse,
        contain: function(s, l) {
          var u = s - this.cx, c = l - this.cy, f = u * u + c * c, h = this.r, v = this.r0;
          return h !== v && f - o <= h * h && f + o >= v * v;
        }
      };
    }, r.prototype.convertToPixel = function(t, e, n) {
      var i = MC(e);
      return i === this ? this.dataToPoint(n) : null;
    }, r.prototype.convertFromPixel = function(t, e, n) {
      var i = MC(e);
      return i === this ? this.pointToData(n) : null;
    }, r;
  }()
);
function MC(r) {
  var t = r.seriesModel, e = r.polarModel;
  return e && e.coordinateSystem || t && t.coordinateSystem;
}
function _Z(r, t, e) {
  var n = t.get("center"), i = e.getWidth(), a = e.getHeight();
  r.cx = X(n[0], i), r.cy = X(n[1], a);
  var o = r.getRadiusAxis(), s = Math.min(i, a) / 2, l = t.get("radius");
  l == null ? l = [0, "100%"] : q(l) || (l = [0, l]);
  var u = [X(l[0], s), X(l[1], s)];
  o.inverse ? o.setExtent(u[1], u[0]) : o.setExtent(u[0], u[1]);
}
function bZ(r, t) {
  var e = this, n = e.getAngleAxis(), i = e.getRadiusAxis();
  if (n.scale.setExtent(1 / 0, -1 / 0), i.scale.setExtent(1 / 0, -1 / 0), r.eachSeries(function(s) {
    if (s.coordinateSystem === e) {
      var l = s.getData();
      M(Sh(l, "radius"), function(u) {
        i.scale.unionExtentFromData(l, u);
      }), M(Sh(l, "angle"), function(u) {
        n.scale.unionExtentFromData(l, u);
      });
    }
  }), Ss(n.scale, n.model), Ss(i.scale, i.model), n.type === "category" && !n.onBand) {
    var a = n.getExtent(), o = 360 / n.scale.count();
    n.inverse ? a[1] += o : a[1] -= o, n.setExtent(a[0], a[1]);
  }
}
function SZ(r) {
  return r.mainType === "angleAxis";
}
function IC(r, t) {
  var e;
  if (r.type = t.get("type"), r.scale = Ev(t), r.onBand = t.get("boundaryGap") && r.type === "category", r.inverse = t.get("inverse"), SZ(t)) {
    r.inverse = r.inverse !== t.get("clockwise");
    var n = t.get("startAngle"), i = (e = t.get("endAngle")) !== null && e !== void 0 ? e : n + (r.inverse ? -360 : 360);
    r.setExtent(n, i);
  }
  t.axis = r, r.model = t;
}
var xZ = {
  dimensions: UP,
  create: function(r, t) {
    var e = [];
    return r.eachComponent("polar", function(n, i) {
      var a = new yZ(i + "");
      a.update = bZ;
      var o = a.getRadiusAxis(), s = a.getAngleAxis(), l = n.findAxisModel("radiusAxis"), u = n.findAxisModel("angleAxis");
      IC(o, l), IC(s, u), _Z(a, n, t), e.push(a), n.coordinateSystem = a, a.model = n;
    }), r.eachSeries(function(n) {
      if (n.get("coordinateSystem") === "polar") {
        var i = n.getReferringComponents("polar", mt).models[0];
        n.coordinateSystem = i.coordinateSystem;
      }
    }), e;
  }
}, wZ = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
function sf(r, t, e) {
  t[1] > t[0] && (t = t.slice().reverse());
  var n = r.coordToPoint([t[0], e]), i = r.coordToPoint([t[1], e]);
  return {
    x1: n[0],
    y1: n[1],
    x2: i[0],
    y2: i[1]
  };
}
function lf(r) {
  var t = r.getRadiusAxis();
  return t.inverse ? 0 : 1;
}
function LC(r) {
  var t = r[0], e = r[r.length - 1];
  t && e && Math.abs(Math.abs(t.coord - e.coord) - 360) < 1e-4 && r.pop();
}
var CZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.axisPointerClass = "PolarAxisPointer", e;
    }
    return t.prototype.render = function(e, n) {
      if (this.group.removeAll(), !!e.get("show")) {
        var i = e.axis, a = i.polar, o = a.getRadiusAxis().getExtent(), s = i.getTicksCoords(), l = i.getMinorTicksCoords(), u = U(i.getViewLabels(), function(c) {
          c = ce(c);
          var f = i.scale, h = f.type === "ordinal" ? f.getRawOrdinalNumber(c.tickValue) : c.tickValue;
          return c.coord = i.dataToCoord(h), c;
        });
        LC(u), LC(s), M(wZ, function(c) {
          e.get([c, "show"]) && (!i.scale.isBlank() || c === "axisLine") && AZ[c](this.group, e, a, s, l, o, u);
        }, this);
      }
    }, t.type = "angleAxis", t;
  }(To)
), AZ = {
  axisLine: function(r, t, e, n, i, a) {
    var o = t.getModel(["axisLine", "lineStyle"]), s = e.getAngleAxis(), l = Math.PI / 180, u = s.getExtent(), c = lf(e), f = c ? 0 : 1, h, v = Math.abs(u[1] - u[0]) === 360 ? "Circle" : "Arc";
    a[f] === 0 ? h = new wo[v]({
      shape: {
        cx: e.cx,
        cy: e.cy,
        r: a[c],
        startAngle: -u[0] * l,
        endAngle: -u[1] * l,
        clockwise: s.inverse
      },
      style: o.getLineStyle(),
      z2: 1,
      silent: !0
    }) : h = new Hu({
      shape: {
        cx: e.cx,
        cy: e.cy,
        r: a[c],
        r0: a[f]
      },
      style: o.getLineStyle(),
      z2: 1,
      silent: !0
    }), h.style.fill = null, r.add(h);
  },
  axisTick: function(r, t, e, n, i, a) {
    var o = t.getModel("axisTick"), s = (o.get("inside") ? -1 : 1) * o.get("length"), l = a[lf(e)], u = U(n, function(c) {
      return new Ct({
        shape: sf(e, [l, l + s], c.coord)
      });
    });
    r.add(Vr(u, {
      style: se(o.getModel("lineStyle").getLineStyle(), {
        stroke: t.get(["axisLine", "lineStyle", "color"])
      })
    }));
  },
  minorTick: function(r, t, e, n, i, a) {
    if (i.length) {
      for (var o = t.getModel("axisTick"), s = t.getModel("minorTick"), l = (o.get("inside") ? -1 : 1) * s.get("length"), u = a[lf(e)], c = [], f = 0; f < i.length; f++)
        for (var h = 0; h < i[f].length; h++)
          c.push(new Ct({
            shape: sf(e, [u, u + l], i[f][h].coord)
          }));
      r.add(Vr(c, {
        style: se(s.getModel("lineStyle").getLineStyle(), se(o.getLineStyle(), {
          stroke: t.get(["axisLine", "lineStyle", "color"])
        }))
      }));
    }
  },
  axisLabel: function(r, t, e, n, i, a, o) {
    var s = t.getCategories(!0), l = t.getModel("axisLabel"), u = l.get("margin"), c = t.get("triggerEvent");
    M(o, function(f, h) {
      var v = l, d = f.tickValue, p = a[lf(e)], g = e.coordToPoint([p + u, f.coord]), m = e.cx, y = e.cy, _ = Math.abs(g[0] - m) / p < 0.3 ? "center" : g[0] > m ? "left" : "right", b = Math.abs(g[1] - y) / p < 0.3 ? "middle" : g[1] > y ? "top" : "bottom";
      if (s && s[d]) {
        var S = s[d];
        ue(S) && S.textStyle && (v = new Ze(S.textStyle, l, l.ecModel));
      }
      var x = new Fe({
        silent: tr.isLabelSilent(t),
        style: nt(v, {
          x: g[0],
          y: g[1],
          fill: v.getTextColor() || t.get(["axisLine", "lineStyle", "color"]),
          text: f.formattedLabel,
          align: _,
          verticalAlign: b
        })
      });
      if (r.add(x), c) {
        var w = tr.makeAxisEventDataBase(t);
        w.targetType = "axisLabel", w.value = f.rawLabel, pe(x).eventData = w;
      }
    }, this);
  },
  splitLine: function(r, t, e, n, i, a) {
    var o = t.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = 0;
    l = l instanceof Array ? l : [l];
    for (var c = [], f = 0; f < n.length; f++) {
      var h = u++ % l.length;
      c[h] = c[h] || [], c[h].push(new Ct({
        shape: sf(e, a, n[f].coord)
      }));
    }
    for (var f = 0; f < c.length; f++)
      r.add(Vr(c[f], {
        style: se({
          stroke: l[f % l.length]
        }, s.getLineStyle()),
        silent: !0,
        z: t.get("z")
      }));
  },
  minorSplitLine: function(r, t, e, n, i, a) {
    if (i.length) {
      for (var o = t.getModel("minorSplitLine"), s = o.getModel("lineStyle"), l = [], u = 0; u < i.length; u++)
        for (var c = 0; c < i[u].length; c++)
          l.push(new Ct({
            shape: sf(e, a, i[u][c].coord)
          }));
      r.add(Vr(l, {
        style: s.getLineStyle(),
        silent: !0,
        z: t.get("z")
      }));
    }
  },
  splitArea: function(r, t, e, n, i, a) {
    if (n.length) {
      var o = t.getModel("splitArea"), s = o.getModel("areaStyle"), l = s.get("color"), u = 0;
      l = l instanceof Array ? l : [l];
      for (var c = [], f = Math.PI / 180, h = -n[0].coord * f, v = Math.min(a[0], a[1]), d = Math.max(a[0], a[1]), p = t.get("clockwise"), g = 1, m = n.length; g <= m; g++) {
        var y = g === m ? n[0].coord : n[g].coord, _ = u++ % l.length;
        c[_] = c[_] || [], c[_].push(new ir({
          shape: {
            cx: e.cx,
            cy: e.cy,
            r0: v,
            r: d,
            startAngle: h,
            endAngle: -y * f,
            clockwise: p
          },
          silent: !0
        })), h = -y * f;
      }
      for (var g = 0; g < c.length; g++)
        r.add(Vr(c[g], {
          style: se({
            fill: l[g % l.length]
          }, s.getAreaStyle()),
          silent: !0
        }));
    }
  }
}, DZ = ["axisLine", "axisTickLabel", "axisName"], TZ = ["splitLine", "splitArea", "minorSplitLine"], MZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.axisPointerClass = "PolarAxisPointer", e;
    }
    return t.prototype.render = function(e, n) {
      if (this.group.removeAll(), !!e.get("show")) {
        var i = this._axisGroup, a = this._axisGroup = new fe();
        this.group.add(a);
        var o = e.axis, s = o.polar, l = s.getAngleAxis(), u = o.getTicksCoords(), c = o.getMinorTicksCoords(), f = l.getExtent()[0], h = o.getExtent(), v = LZ(s, e, f), d = new tr(e, v);
        M(DZ, d.add, d), a.add(d.getGroup()), Uu(i, a, e), M(TZ, function(p) {
          e.get([p, "show"]) && !o.scale.isBlank() && IZ[p](this.group, e, s, f, h, u, c);
        }, this);
      }
    }, t.type = "radiusAxis", t;
  }(To)
), IZ = {
  splitLine: function(r, t, e, n, i, a) {
    var o = t.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = 0, c = e.getAngleAxis(), f = Math.PI / 180, h = c.getExtent(), v = Math.abs(h[1] - h[0]) === 360 ? "Circle" : "Arc";
    l = l instanceof Array ? l : [l];
    for (var d = [], p = 0; p < a.length; p++) {
      var g = u++ % l.length;
      d[g] = d[g] || [], d[g].push(new wo[v]({
        shape: {
          cx: e.cx,
          cy: e.cy,
          // ensure circle radius >= 0
          r: Math.max(a[p].coord, 0),
          startAngle: -h[0] * f,
          endAngle: -h[1] * f,
          clockwise: c.inverse
        }
      }));
    }
    for (var p = 0; p < d.length; p++)
      r.add(Vr(d[p], {
        style: se({
          stroke: l[p % l.length],
          fill: null
        }, s.getLineStyle()),
        silent: !0
      }));
  },
  minorSplitLine: function(r, t, e, n, i, a, o) {
    if (o.length) {
      for (var s = t.getModel("minorSplitLine"), l = s.getModel("lineStyle"), u = [], c = 0; c < o.length; c++)
        for (var f = 0; f < o[c].length; f++)
          u.push(new pi({
            shape: {
              cx: e.cx,
              cy: e.cy,
              r: o[c][f].coord
            }
          }));
      r.add(Vr(u, {
        style: se({
          fill: null
        }, l.getLineStyle()),
        silent: !0
      }));
    }
  },
  splitArea: function(r, t, e, n, i, a) {
    if (a.length) {
      var o = t.getModel("splitArea"), s = o.getModel("areaStyle"), l = s.get("color"), u = 0;
      l = l instanceof Array ? l : [l];
      for (var c = [], f = a[0].coord, h = 1; h < a.length; h++) {
        var v = u++ % l.length;
        c[v] = c[v] || [], c[v].push(new ir({
          shape: {
            cx: e.cx,
            cy: e.cy,
            r0: f,
            r: a[h].coord,
            startAngle: 0,
            endAngle: Math.PI * 2
          },
          silent: !0
        })), f = a[h].coord;
      }
      for (var h = 0; h < c.length; h++)
        r.add(Vr(c[h], {
          style: se({
            fill: l[h % l.length]
          }, s.getAreaStyle()),
          silent: !0
        }));
    }
  }
};
function LZ(r, t, e) {
  return {
    position: [r.cx, r.cy],
    rotation: e / 180 * Math.PI,
    labelDirection: -1,
    tickDirection: -1,
    nameDirection: 1,
    labelRotate: t.getModel("axisLabel").get("rotate"),
    // Over splitLine and splitArea
    z2: 1
  };
}
function YP(r) {
  return r.get("stack") || "__ec_stack_" + r.seriesIndex;
}
function ZP(r, t) {
  return t.dim + r.model.componentIndex;
}
function EZ(r, t, e) {
  var n = {}, i = PZ(qe(t.getSeriesByType(r), function(a) {
    return !t.isSeriesFiltered(a) && a.coordinateSystem && a.coordinateSystem.type === "polar";
  }));
  t.eachSeriesByType(r, function(a) {
    if (a.coordinateSystem.type === "polar") {
      var o = a.getData(), s = a.coordinateSystem, l = s.getBaseAxis(), u = ZP(s, l), c = YP(a), f = i[u][c], h = f.offset, v = f.width, d = s.getOtherAxis(l), p = a.coordinateSystem.cx, g = a.coordinateSystem.cy, m = a.get("barMinHeight") || 0, y = a.get("barMinAngle") || 0;
      n[c] = n[c] || [];
      for (var _ = o.mapDimension(d.dim), b = o.mapDimension(l.dim), S = ea(
        o,
        _
        /* , baseDim */
      ), x = l.dim !== "radius" || !a.get("roundCap", !0), w = d.model, C = w.get("startValue"), D = d.dataToCoord(C || 0), A = 0, T = o.count(); A < T; A++) {
        var L = o.get(_, A), E = o.get(b, A), I = L >= 0 ? "p" : "n", P = D;
        S && (n[c][E] || (n[c][E] = {
          p: D,
          n: D
          // Negative stack
        }), P = n[c][E][I]);
        var R = void 0, F = void 0, O = void 0, z = void 0;
        if (d.dim === "radius") {
          var G = d.dataToCoord(L) - D, W = l.dataToCoord(E);
          Math.abs(G) < m && (G = (G < 0 ? -1 : 1) * m), R = P, F = P + G, O = W - h, z = O - v, S && (n[c][E][I] = F);
        } else {
          var Y = d.dataToCoord(L, x) - D, j = l.dataToCoord(E);
          Math.abs(Y) < y && (Y = (Y < 0 ? -1 : 1) * y), R = j + h, F = R + v, O = P, z = P + Y, S && (n[c][E][I] = z);
        }
        o.setItemLayout(A, {
          cx: p,
          cy: g,
          r0: R,
          r: F,
          // Consider that positive angle is anti-clockwise,
          // while positive radian of sector is clockwise
          startAngle: -O * Math.PI / 180,
          endAngle: -z * Math.PI / 180,
          /**
           * Keep the same logic with bar in catesion: use end value to
           * control direction. Notice that if clockwise is true (by
           * default), the sector will always draw clockwisely, no matter
           * whether endAngle is greater or less than startAngle.
           */
          clockwise: O >= z
        });
      }
    }
  });
}
function PZ(r) {
  var t = {};
  M(r, function(n, i) {
    var a = n.getData(), o = n.coordinateSystem, s = o.getBaseAxis(), l = ZP(o, s), u = s.getExtent(), c = s.type === "category" ? s.getBandWidth() : Math.abs(u[1] - u[0]) / a.count(), f = t[l] || {
      bandWidth: c,
      remainedWidth: c,
      autoWidthCount: 0,
      categoryGap: "20%",
      gap: "30%",
      stacks: {}
    }, h = f.stacks;
    t[l] = f;
    var v = YP(n);
    h[v] || f.autoWidthCount++, h[v] = h[v] || {
      width: 0,
      maxWidth: 0
    };
    var d = X(n.get("barWidth"), c), p = X(n.get("barMaxWidth"), c), g = n.get("barGap"), m = n.get("barCategoryGap");
    d && !h[v].width && (d = Math.min(f.remainedWidth, d), h[v].width = d, f.remainedWidth -= d), p && (h[v].maxWidth = p), g != null && (f.gap = g), m != null && (f.categoryGap = m);
  });
  var e = {};
  return M(t, function(n, i) {
    e[i] = {};
    var a = n.stacks, o = n.bandWidth, s = X(n.categoryGap, o), l = X(n.gap, 1), u = n.remainedWidth, c = n.autoWidthCount, f = (u - s) / (c + (c - 1) * l);
    f = Math.max(f, 0), M(a, function(p, g) {
      var m = p.maxWidth;
      m && m < f && (m = Math.min(m, u), p.width && (m = Math.min(m, p.width)), u -= m, p.width = m, c--);
    }), f = (u - s) / (c + (c - 1) * l), f = Math.max(f, 0);
    var h = 0, v;
    M(a, function(p, g) {
      p.width || (p.width = f), v = p, h += p.width * (1 + l);
    }), v && (h -= v.width * l);
    var d = -h / 2;
    M(a, function(p, g) {
      e[i][g] = e[i][g] || {
        offset: d,
        width: p.width
      }, d += p.width * (1 + l);
    });
  }), e;
}
var kZ = {
  startAngle: 90,
  clockwise: !0,
  splitNumber: 12,
  axisLabel: {
    rotate: 0
  }
}, RZ = {
  splitNumber: 5
}, OZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "polar", t;
  }(lt)
);
function FZ(r) {
  De(oc), To.registerAxisPointerClass("PolarAxisPointer", fZ), r.registerCoordinateSystem("polar", xZ), r.registerComponentModel(dZ), r.registerComponentView(OZ), ws(r, "angle", pZ, kZ), ws(r, "radius", gZ, RZ), r.registerComponentView(CZ), r.registerComponentView(MZ), r.registerLayout(ye(EZ, "bar"));
}
function uy(r, t) {
  t = t || {};
  var e = r.coordinateSystem, n = r.axis, i = {}, a = n.position, o = n.orient, s = e.getRect(), l = [s.x, s.x + s.width, s.y, s.y + s.height], u = {
    horizontal: {
      top: l[2],
      bottom: l[3]
    },
    vertical: {
      left: l[0],
      right: l[1]
    }
  };
  i.position = [o === "vertical" ? u.vertical[a] : l[0], o === "horizontal" ? u.horizontal[a] : l[3]];
  var c = {
    horizontal: 0,
    vertical: 1
  };
  i.rotation = Math.PI / 2 * c[o];
  var f = {
    top: -1,
    bottom: 1,
    right: 1,
    left: -1
  };
  i.labelDirection = i.tickDirection = i.nameDirection = f[a], r.get(["axisTick", "inside"]) && (i.tickDirection = -i.tickDirection), Et(t.labelInside, r.get(["axisLabel", "inside"])) && (i.labelDirection = -i.labelDirection);
  var h = t.rotate;
  return h == null && (h = r.get(["axisLabel", "rotate"])), i.labelRotation = a === "top" ? -h : h, i.z2 = 1, i;
}
var BZ = ["axisLine", "axisTickLabel", "axisName"], NZ = ["splitArea", "splitLine"], zZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.axisPointerClass = "SingleAxisPointer", e;
    }
    return t.prototype.render = function(e, n, i, a) {
      var o = this.group;
      o.removeAll();
      var s = this._axisGroup;
      this._axisGroup = new fe();
      var l = uy(e), u = new tr(e, l);
      M(BZ, u.add, u), o.add(this._axisGroup), o.add(u.getGroup()), M(NZ, function(c) {
        e.get([c, "show"]) && VZ[c](this, this.group, this._axisGroup, e);
      }, this), Uu(s, this._axisGroup, e), r.prototype.render.call(this, e, n, i, a);
    }, t.prototype.remove = function() {
      gE(this);
    }, t.type = "singleAxis", t;
  }(To)
), VZ = {
  splitLine: function(r, t, e, n) {
    var i = n.axis;
    if (!i.scale.isBlank()) {
      var a = n.getModel("splitLine"), o = a.getModel("lineStyle"), s = o.get("color");
      s = s instanceof Array ? s : [s];
      for (var l = o.get("width"), u = n.coordinateSystem.getRect(), c = i.isHorizontal(), f = [], h = 0, v = i.getTicksCoords({
        tickModel: a
      }), d = [], p = [], g = 0; g < v.length; ++g) {
        var m = i.toGlobalCoord(v[g].coord);
        c ? (d[0] = m, d[1] = u.y, p[0] = m, p[1] = u.y + u.height) : (d[0] = u.x, d[1] = m, p[0] = u.x + u.width, p[1] = m);
        var y = new Ct({
          shape: {
            x1: d[0],
            y1: d[1],
            x2: p[0],
            y2: p[1]
          },
          silent: !0
        });
        ys(y.shape, l);
        var _ = h++ % s.length;
        f[_] = f[_] || [], f[_].push(y);
      }
      for (var b = o.getLineStyle(["color"]), g = 0; g < f.length; ++g)
        t.add(Vr(f[g], {
          style: se({
            stroke: s[g % s.length]
          }, b),
          silent: !0
        }));
    }
  },
  splitArea: function(r, t, e, n) {
    pE(r, e, n, n);
  }
}, Vf = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.getCoordSysModel = function() {
      return this;
    }, t.type = "singleAxis", t.layoutMode = "box", t.defaultOption = {
      left: "5%",
      top: "5%",
      right: "5%",
      bottom: "5%",
      type: "value",
      position: "bottom",
      orient: "horizontal",
      axisLine: {
        show: !0,
        lineStyle: {
          width: 1,
          type: "solid"
        }
      },
      // Single coordinate system and single axis is the,
      // which is used as the parent tooltip model.
      // same model, so we set default tooltip show as true.
      tooltip: {
        show: !0
      },
      axisTick: {
        show: !0,
        length: 6,
        lineStyle: {
          width: 1
        }
      },
      axisLabel: {
        show: !0,
        interval: "auto"
      },
      splitLine: {
        show: !0,
        lineStyle: {
          type: "dashed",
          opacity: 0.2
        }
      }
    }, t;
  }(Le)
);
_t(Vf, Ku.prototype);
var $Z = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a, o) {
      var s = r.call(this, e, n, i) || this;
      return s.type = a || "value", s.position = o || "bottom", s;
    }
    return t.prototype.isHorizontal = function() {
      var e = this.position;
      return e === "top" || e === "bottom";
    }, t.prototype.pointToData = function(e, n) {
      return this.coordinateSystem.pointToData(e)[0];
    }, t;
  }(hn)
), XP = ["single"], GZ = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.type = "single", this.dimension = "single", this.dimensions = XP, this.axisPointerEnabled = !0, this.model = t, this._init(t, e, n);
    }
    return r.prototype._init = function(t, e, n) {
      var i = this.dimension, a = new $Z(i, Ev(t), [0, 0], t.get("type"), t.get("position")), o = a.type === "category";
      a.onBand = o && t.get("boundaryGap"), a.inverse = t.get("inverse"), a.orient = t.get("orient"), t.axis = a, a.model = t, a.coordinateSystem = this, this._axis = a;
    }, r.prototype.update = function(t, e) {
      t.eachSeries(function(n) {
        if (n.coordinateSystem === this) {
          var i = n.getData();
          M(i.mapDimensionsAll(this.dimension), function(a) {
            this._axis.scale.unionExtentFromData(i, a);
          }, this), Ss(this._axis.scale, this._axis.model);
        }
      }, this);
    }, r.prototype.resize = function(t, e) {
      this._rect = St({
        left: t.get("left"),
        top: t.get("top"),
        right: t.get("right"),
        bottom: t.get("bottom"),
        width: t.get("width"),
        height: t.get("height")
      }, {
        width: e.getWidth(),
        height: e.getHeight()
      }), this._adjustAxis();
    }, r.prototype.getRect = function() {
      return this._rect;
    }, r.prototype._adjustAxis = function() {
      var t = this._rect, e = this._axis, n = e.isHorizontal(), i = n ? [0, t.width] : [0, t.height], a = e.inverse ? 1 : 0;
      e.setExtent(i[a], i[1 - a]), this._updateAxisTransform(e, n ? t.x : t.y);
    }, r.prototype._updateAxisTransform = function(t, e) {
      var n = t.getExtent(), i = n[0] + n[1], a = t.isHorizontal();
      t.toGlobalCoord = a ? function(o) {
        return o + e;
      } : function(o) {
        return i - o + e;
      }, t.toLocalCoord = a ? function(o) {
        return o - e;
      } : function(o) {
        return i - o + e;
      };
    }, r.prototype.getAxis = function() {
      return this._axis;
    }, r.prototype.getBaseAxis = function() {
      return this._axis;
    }, r.prototype.getAxes = function() {
      return [this._axis];
    }, r.prototype.getTooltipAxes = function() {
      return {
        baseAxes: [this.getAxis()],
        // Empty otherAxes
        otherAxes: []
      };
    }, r.prototype.containPoint = function(t) {
      var e = this.getRect(), n = this.getAxis(), i = n.orient;
      return i === "horizontal" ? n.contain(n.toLocalCoord(t[0])) && t[1] >= e.y && t[1] <= e.y + e.height : n.contain(n.toLocalCoord(t[1])) && t[0] >= e.y && t[0] <= e.y + e.height;
    }, r.prototype.pointToData = function(t) {
      var e = this.getAxis();
      return [e.coordToData(e.toLocalCoord(t[e.orient === "horizontal" ? 0 : 1]))];
    }, r.prototype.dataToPoint = function(t) {
      var e = this.getAxis(), n = this.getRect(), i = [], a = e.orient === "horizontal" ? 0 : 1;
      return t instanceof Array && (t = t[0]), i[a] = e.toGlobalCoord(e.dataToCoord(+t)), i[1 - a] = a === 0 ? n.y + n.height / 2 : n.x + n.width / 2, i;
    }, r.prototype.convertToPixel = function(t, e, n) {
      var i = EC(e);
      return i === this ? this.dataToPoint(n) : null;
    }, r.prototype.convertFromPixel = function(t, e, n) {
      var i = EC(e);
      return i === this ? this.pointToData(n) : null;
    }, r;
  }()
);
function EC(r) {
  var t = r.seriesModel, e = r.singleAxisModel;
  return e && e.coordinateSystem || t && t.coordinateSystem;
}
function HZ(r, t) {
  var e = [];
  return r.eachComponent("singleAxis", function(n, i) {
    var a = new GZ(n, r, t);
    a.name = "single_" + i, a.resize(n, t), n.coordinateSystem = a, e.push(a);
  }), r.eachSeries(function(n) {
    if (n.get("coordinateSystem") === "singleAxis") {
      var i = n.getReferringComponents("singleAxis", mt).models[0];
      n.coordinateSystem = i && i.coordinateSystem;
    }
  }), e;
}
var qZ = {
  create: HZ,
  dimensions: XP
}, PC = ["x", "y"], WZ = ["width", "height"], UZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(e, n, i, a, o) {
      var s = i.axis, l = s.coordinateSystem, u = ng(l, 1 - Oh(s)), c = l.dataToPoint(n)[0], f = a.get("type");
      if (f && f !== "none") {
        var h = O_(a), v = YZ[f](s, c, u);
        v.style = h, e.graphicKey = v.type, e.pointer = v;
      }
      var d = uy(i);
      GP(
        // @ts-ignore
        n,
        e,
        d,
        i,
        a,
        o
      );
    }, t.prototype.getHandleTransform = function(e, n, i) {
      var a = uy(n, {
        labelInside: !1
      });
      a.labelMargin = i.get(["handle", "margin"]);
      var o = F_(n.axis, e, a);
      return {
        x: o[0],
        y: o[1],
        rotation: a.rotation + (a.labelDirection < 0 ? Math.PI : 0)
      };
    }, t.prototype.updateHandleTransform = function(e, n, i, a) {
      var o = i.axis, s = o.coordinateSystem, l = Oh(o), u = ng(s, l), c = [e.x, e.y];
      c[l] += n[l], c[l] = Math.min(u[1], c[l]), c[l] = Math.max(u[0], c[l]);
      var f = ng(s, 1 - l), h = (f[1] + f[0]) / 2, v = [h, h];
      return v[l] = c[l], {
        x: c[0],
        y: c[1],
        rotation: e.rotation,
        cursorPoint: v,
        tooltipOption: {
          verticalAlign: "middle"
        }
      };
    }, t;
  }(R_)
), YZ = {
  line: function(r, t, e) {
    var n = B_([t, e[0]], [t, e[1]], Oh(r));
    return {
      type: "Line",
      subPixelOptimize: !0,
      shape: n
    };
  },
  shadow: function(r, t, e) {
    var n = r.getBandWidth(), i = e[1] - e[0];
    return {
      type: "Rect",
      shape: HP([t - n / 2, e[0]], [n, i], Oh(r))
    };
  }
};
function Oh(r) {
  return r.isHorizontal() ? 0 : 1;
}
function ng(r, t) {
  var e = r.getRect();
  return [e[PC[t]], e[PC[t]] + e[WZ[t]]];
}
var ZZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "single", t;
  }(lt)
);
function XZ(r) {
  De(oc), To.registerAxisPointerClass("SingleAxisPointer", UZ), r.registerComponentView(ZZ), r.registerComponentView(zZ), r.registerComponentModel(Vf), ws(r, "single", Vf, Vf.defaultOption), r.registerCoordinateSystem("single", qZ);
}
var jZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n, i) {
      var a = Bs(e);
      r.prototype.init.apply(this, arguments), kC(e, a);
    }, t.prototype.mergeOption = function(e) {
      r.prototype.mergeOption.apply(this, arguments), kC(this.option, e);
    }, t.prototype.getCellSize = function() {
      return this.option.cellSize;
    }, t.type = "calendar", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      left: 80,
      top: 60,
      cellSize: 20,
      // horizontal vertical
      orient: "horizontal",
      // month separate line style
      splitLine: {
        show: !0,
        lineStyle: {
          color: "#000",
          width: 1,
          type: "solid"
        }
      },
      // rect style  temporarily unused emphasis
      itemStyle: {
        color: "#fff",
        borderWidth: 1,
        borderColor: "#ccc"
      },
      // week text style
      dayLabel: {
        show: !0,
        firstDay: 0,
        // start end
        position: "start",
        margin: "50%",
        color: "#000"
      },
      // month text style
      monthLabel: {
        show: !0,
        // start end
        position: "start",
        margin: 5,
        // center or left
        align: "center",
        formatter: null,
        color: "#000"
      },
      // year text style
      yearLabel: {
        show: !0,
        // top bottom left right
        position: null,
        margin: 30,
        formatter: null,
        color: "#ccc",
        fontFamily: "sans-serif",
        fontWeight: "bolder",
        fontSize: 20
      }
    }, t;
  }(Le)
);
function kC(r, t) {
  var e = r.cellSize, n;
  q(e) ? n = e : n = r.cellSize = [e, e], n.length === 1 && (n[1] = n[0]);
  var i = U([0, 1], function(a) {
    return mV(t, a) && (n[a] = "auto"), n[a] != null && n[a] !== "auto";
  });
  Qi(r, t, {
    type: "box",
    ignoreSize: i
  });
}
var KZ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      var a = this.group;
      a.removeAll();
      var o = e.coordinateSystem, s = o.getRangeInfo(), l = o.getOrient(), u = n.getLocaleModel();
      this._renderDayRect(e, s, a), this._renderLines(e, s, l, a), this._renderYearText(e, s, l, a), this._renderMonthText(e, u, l, a), this._renderWeekText(e, u, s, l, a);
    }, t.prototype._renderDayRect = function(e, n, i) {
      for (var a = e.coordinateSystem, o = e.getModel("itemStyle").getItemStyle(), s = a.getCellWidth(), l = a.getCellHeight(), u = n.start.time; u <= n.end.time; u = a.getNextNDay(u, 1).time) {
        var c = a.dataToRect([u], !1).tl, f = new ke({
          shape: {
            x: c[0],
            y: c[1],
            width: s,
            height: l
          },
          cursor: "default",
          style: o
        });
        i.add(f);
      }
    }, t.prototype._renderLines = function(e, n, i, a) {
      var o = this, s = e.coordinateSystem, l = e.getModel(["splitLine", "lineStyle"]).getLineStyle(), u = e.get(["splitLine", "show"]), c = l.lineWidth;
      this._tlpoints = [], this._blpoints = [], this._firstDayOfMonth = [], this._firstDayPoints = [];
      for (var f = n.start, h = 0; f.time <= n.end.time; h++) {
        d(f.formatedDate), h === 0 && (f = s.getDateInfo(n.start.y + "-" + n.start.m));
        var v = f.date;
        v.setMonth(v.getMonth() + 1), f = s.getDateInfo(v);
      }
      d(s.getNextNDay(n.end.time, 1).formatedDate);
      function d(p) {
        o._firstDayOfMonth.push(s.getDateInfo(p)), o._firstDayPoints.push(s.dataToRect([p], !1).tl);
        var g = o._getLinePointsOfOneWeek(e, p, i);
        o._tlpoints.push(g[0]), o._blpoints.push(g[g.length - 1]), u && o._drawSplitline(g, l, a);
      }
      u && this._drawSplitline(o._getEdgesPoints(o._tlpoints, c, i), l, a), u && this._drawSplitline(o._getEdgesPoints(o._blpoints, c, i), l, a);
    }, t.prototype._getEdgesPoints = function(e, n, i) {
      var a = [e[0].slice(), e[e.length - 1].slice()], o = i === "horizontal" ? 0 : 1;
      return a[0][o] = a[0][o] - n / 2, a[1][o] = a[1][o] + n / 2, a;
    }, t.prototype._drawSplitline = function(e, n, i) {
      var a = new sr({
        z2: 20,
        shape: {
          points: e
        },
        style: n
      });
      i.add(a);
    }, t.prototype._getLinePointsOfOneWeek = function(e, n, i) {
      for (var a = e.coordinateSystem, o = a.getDateInfo(n), s = [], l = 0; l < 7; l++) {
        var u = a.getNextNDay(o.time, l), c = a.dataToRect([u.time], !1);
        s[2 * u.day] = c.tl, s[2 * u.day + 1] = c[i === "horizontal" ? "bl" : "tr"];
      }
      return s;
    }, t.prototype._formatterLabel = function(e, n) {
      return J(e) && e ? dV(e, n) : oe(e) ? e(n) : n.nameMap;
    }, t.prototype._yearTextPositionControl = function(e, n, i, a, o) {
      var s = n[0], l = n[1], u = ["center", "bottom"];
      a === "bottom" ? (l += o, u = ["center", "top"]) : a === "left" ? s -= o : a === "right" ? (s += o, u = ["center", "top"]) : l -= o;
      var c = 0;
      return (a === "left" || a === "right") && (c = Math.PI / 2), {
        rotation: c,
        x: s,
        y: l,
        style: {
          align: u[0],
          verticalAlign: u[1]
        }
      };
    }, t.prototype._renderYearText = function(e, n, i, a) {
      var o = e.getModel("yearLabel");
      if (o.get("show")) {
        var s = o.get("margin"), l = o.get("position");
        l || (l = i !== "horizontal" ? "top" : "left");
        var u = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]], c = (u[0][0] + u[1][0]) / 2, f = (u[0][1] + u[1][1]) / 2, h = i === "horizontal" ? 0 : 1, v = {
          top: [c, u[h][1]],
          bottom: [c, u[1 - h][1]],
          left: [u[1 - h][0], f],
          right: [u[h][0], f]
        }, d = n.start.y;
        +n.end.y > +n.start.y && (d = d + "-" + n.end.y);
        var p = o.get("formatter"), g = {
          start: n.start.y,
          end: n.end.y,
          nameMap: d
        }, m = this._formatterLabel(p, g), y = new Fe({
          z2: 30,
          style: nt(o, {
            text: m
          }),
          silent: o.get("silent")
        });
        y.attr(this._yearTextPositionControl(y, v[l], i, l, s)), a.add(y);
      }
    }, t.prototype._monthTextPositionControl = function(e, n, i, a, o) {
      var s = "left", l = "top", u = e[0], c = e[1];
      return i === "horizontal" ? (c = c + o, n && (s = "center"), a === "start" && (l = "bottom")) : (u = u + o, n && (l = "middle"), a === "start" && (s = "right")), {
        x: u,
        y: c,
        align: s,
        verticalAlign: l
      };
    }, t.prototype._renderMonthText = function(e, n, i, a) {
      var o = e.getModel("monthLabel");
      if (o.get("show")) {
        var s = o.get("nameMap"), l = o.get("margin"), u = o.get("position"), c = o.get("align"), f = [this._tlpoints, this._blpoints];
        (!s || J(s)) && (s && (n = mm(s) || n), s = n.get(["time", "monthAbbr"]) || []);
        var h = u === "start" ? 0 : 1, v = i === "horizontal" ? 0 : 1;
        l = u === "start" ? -l : l;
        for (var d = c === "center", p = o.get("silent"), g = 0; g < f[h].length - 1; g++) {
          var m = f[h][g].slice(), y = this._firstDayOfMonth[g];
          if (d) {
            var _ = this._firstDayPoints[g];
            m[v] = (_[v] + f[0][g + 1][v]) / 2;
          }
          var b = o.get("formatter"), S = s[+y.m - 1], x = {
            yyyy: y.y,
            yy: (y.y + "").slice(2),
            MM: y.m,
            M: +y.m,
            nameMap: S
          }, w = this._formatterLabel(b, x), C = new Fe({
            z2: 30,
            style: H(nt(o, {
              text: w
            }), this._monthTextPositionControl(m, d, i, u, l)),
            silent: p
          });
          a.add(C);
        }
      }
    }, t.prototype._weekTextPositionControl = function(e, n, i, a, o) {
      var s = "center", l = "middle", u = e[0], c = e[1], f = i === "start";
      return n === "horizontal" ? (u = u + a + (f ? 1 : -1) * o[0] / 2, s = f ? "right" : "left") : (c = c + a + (f ? 1 : -1) * o[1] / 2, l = f ? "bottom" : "top"), {
        x: u,
        y: c,
        align: s,
        verticalAlign: l
      };
    }, t.prototype._renderWeekText = function(e, n, i, a, o) {
      var s = e.getModel("dayLabel");
      if (s.get("show")) {
        var l = e.coordinateSystem, u = s.get("position"), c = s.get("nameMap"), f = s.get("margin"), h = l.getFirstDayOfWeek();
        if (!c || J(c)) {
          c && (n = mm(c) || n);
          var v = n.get(["time", "dayOfWeekShort"]);
          c = v || U(n.get(["time", "dayOfWeekAbbr"]), function(x) {
            return x[0];
          });
        }
        var d = l.getNextNDay(i.end.time, 7 - i.lweek).time, p = [l.getCellWidth(), l.getCellHeight()];
        f = X(f, Math.min(p[1], p[0])), u === "start" && (d = l.getNextNDay(i.start.time, -(7 + i.fweek)).time, f = -f);
        for (var g = s.get("silent"), m = 0; m < 7; m++) {
          var y = l.getNextNDay(d, m), _ = l.dataToRect([y.time], !1).center, b = m;
          b = Math.abs((m + h) % 7);
          var S = new Fe({
            z2: 30,
            style: H(nt(s, {
              text: c[b]
            }), this._weekTextPositionControl(_, a, u, f, p)),
            silent: g
          });
          o.add(S);
        }
      }
    }, t.type = "calendar", t;
  }(lt)
), ig = 864e5, JZ = (
  /** @class */
  function() {
    function r(t, e, n) {
      this.type = "calendar", this.dimensions = r.dimensions, this.getDimensionsInfo = r.getDimensionsInfo, this._model = t;
    }
    return r.getDimensionsInfo = function() {
      return [{
        name: "time",
        type: "time"
      }, "value"];
    }, r.prototype.getRangeInfo = function() {
      return this._rangeInfo;
    }, r.prototype.getModel = function() {
      return this._model;
    }, r.prototype.getRect = function() {
      return this._rect;
    }, r.prototype.getCellWidth = function() {
      return this._sw;
    }, r.prototype.getCellHeight = function() {
      return this._sh;
    }, r.prototype.getOrient = function() {
      return this._orient;
    }, r.prototype.getFirstDayOfWeek = function() {
      return this._firstDayOfWeek;
    }, r.prototype.getDateInfo = function(t) {
      t = Fn(t);
      var e = t.getFullYear(), n = t.getMonth() + 1, i = n < 10 ? "0" + n : "" + n, a = t.getDate(), o = a < 10 ? "0" + a : "" + a, s = t.getDay();
      return s = Math.abs((s + 7 - this.getFirstDayOfWeek()) % 7), {
        y: e + "",
        m: i,
        d: o,
        day: s,
        time: t.getTime(),
        formatedDate: e + "-" + i + "-" + o,
        date: t
      };
    }, r.prototype.getNextNDay = function(t, e) {
      return e = e || 0, e === 0 ? this.getDateInfo(t) : (t = new Date(this.getDateInfo(t).time), t.setDate(t.getDate() + e), this.getDateInfo(t));
    }, r.prototype.update = function(t, e) {
      this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"), this._orient = this._model.get("orient"), this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0, this._rangeInfo = this._getRangeInfo(this._initRangeOption());
      var n = this._rangeInfo.weeks || 1, i = ["width", "height"], a = this._model.getCellSize().slice(), o = this._model.getBoxLayoutParams(), s = this._orient === "horizontal" ? [n, 7] : [7, n];
      M([0, 1], function(f) {
        c(a, f) && (o[i[f]] = a[f] * s[f]);
      });
      var l = {
        width: e.getWidth(),
        height: e.getHeight()
      }, u = this._rect = St(o, l);
      M([0, 1], function(f) {
        c(a, f) || (a[f] = u[i[f]] / s[f]);
      });
      function c(f, h) {
        return f[h] != null && f[h] !== "auto";
      }
      this._sw = a[0], this._sh = a[1];
    }, r.prototype.dataToPoint = function(t, e) {
      q(t) && (t = t[0]), e == null && (e = !0);
      var n = this.getDateInfo(t), i = this._rangeInfo, a = n.formatedDate;
      if (e && !(n.time >= i.start.time && n.time < i.end.time + ig))
        return [NaN, NaN];
      var o = n.day, s = this._getRangeInfo([i.start.time, a]).nthWeek;
      return this._orient === "vertical" ? [this._rect.x + o * this._sw + this._sw / 2, this._rect.y + s * this._sh + this._sh / 2] : [this._rect.x + s * this._sw + this._sw / 2, this._rect.y + o * this._sh + this._sh / 2];
    }, r.prototype.pointToData = function(t) {
      var e = this.pointToDate(t);
      return e && e.time;
    }, r.prototype.dataToRect = function(t, e) {
      var n = this.dataToPoint(t, e);
      return {
        contentShape: {
          x: n[0] - (this._sw - this._lineWidth) / 2,
          y: n[1] - (this._sh - this._lineWidth) / 2,
          width: this._sw - this._lineWidth,
          height: this._sh - this._lineWidth
        },
        center: n,
        tl: [n[0] - this._sw / 2, n[1] - this._sh / 2],
        tr: [n[0] + this._sw / 2, n[1] - this._sh / 2],
        br: [n[0] + this._sw / 2, n[1] + this._sh / 2],
        bl: [n[0] - this._sw / 2, n[1] + this._sh / 2]
      };
    }, r.prototype.pointToDate = function(t) {
      var e = Math.floor((t[0] - this._rect.x) / this._sw) + 1, n = Math.floor((t[1] - this._rect.y) / this._sh) + 1, i = this._rangeInfo.range;
      return this._orient === "vertical" ? this._getDateByWeeksAndDay(n, e - 1, i) : this._getDateByWeeksAndDay(e, n - 1, i);
    }, r.prototype.convertToPixel = function(t, e, n) {
      var i = RC(e);
      return i === this ? i.dataToPoint(n) : null;
    }, r.prototype.convertFromPixel = function(t, e, n) {
      var i = RC(e);
      return i === this ? i.pointToData(n) : null;
    }, r.prototype.containPoint = function(t) {
      return console.warn("Not implemented."), !1;
    }, r.prototype._initRangeOption = function() {
      var t = this._model.get("range"), e;
      if (q(t) && t.length === 1 && (t = t[0]), q(t))
        e = t;
      else {
        var n = t.toString();
        if (/^\d{4}$/.test(n) && (e = [n + "-01-01", n + "-12-31"]), /^\d{4}[\/|-]\d{1,2}$/.test(n)) {
          var i = this.getDateInfo(n), a = i.date;
          a.setMonth(a.getMonth() + 1);
          var o = this.getNextNDay(a, -1);
          e = [i.formatedDate, o.formatedDate];
        }
        /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n) && (e = [n, n]);
      }
      if (!e)
        return t;
      var s = this._getRangeInfo(e);
      return s.start.time > s.end.time && e.reverse(), e;
    }, r.prototype._getRangeInfo = function(t) {
      var e = [this.getDateInfo(t[0]), this.getDateInfo(t[1])], n;
      e[0].time > e[1].time && (n = !0, e.reverse());
      var i = Math.floor(e[1].time / ig) - Math.floor(e[0].time / ig) + 1, a = new Date(e[0].time), o = a.getDate(), s = e[1].date.getDate();
      a.setDate(o + i - 1);
      var l = a.getDate();
      if (l !== s)
        for (var u = a.getTime() - e[1].time > 0 ? 1 : -1; (l = a.getDate()) !== s && (a.getTime() - e[1].time) * u > 0; )
          i -= u, a.setDate(l - u);
      var c = Math.floor((i + e[0].day + 6) / 7), f = n ? -c + 1 : c - 1;
      return n && e.reverse(), {
        range: [e[0].formatedDate, e[1].formatedDate],
        start: e[0],
        end: e[1],
        allDay: i,
        weeks: c,
        // From 0.
        nthWeek: f,
        fweek: e[0].day,
        lweek: e[1].day
      };
    }, r.prototype._getDateByWeeksAndDay = function(t, e, n) {
      var i = this._getRangeInfo(n);
      if (t > i.weeks || t === 0 && e < i.fweek || t === i.weeks && e > i.lweek)
        return null;
      var a = (t - 1) * 7 - i.fweek + e, o = new Date(i.start.time);
      return o.setDate(+i.start.d + a), this.getDateInfo(o);
    }, r.create = function(t, e) {
      var n = [];
      return t.eachComponent("calendar", function(i) {
        var a = new r(i);
        n.push(a), i.coordinateSystem = a;
      }), t.eachSeries(function(i) {
        i.get("coordinateSystem") === "calendar" && (i.coordinateSystem = n[i.get("calendarIndex") || 0]);
      }), n;
    }, r.dimensions = ["time", "value"], r;
  }()
);
function RC(r) {
  var t = r.calendarModel, e = r.seriesModel, n = t ? t.coordinateSystem : e ? e.coordinateSystem : null;
  return n;
}
function QZ(r) {
  r.registerComponentModel(jZ), r.registerComponentView(KZ), r.registerCoordinateSystem("calendar", JZ);
}
function eX(r, t) {
  var e = r.existing;
  if (t.id = r.keyInfo.id, !t.type && e && (t.type = e.type), t.parentId == null) {
    var n = t.parentOption;
    n ? t.parentId = n.id : e && (t.parentId = e.parentId);
  }
  t.parentOption = null;
}
function OC(r, t) {
  var e;
  return M(t, function(n) {
    r[n] != null && r[n] !== "auto" && (e = !0);
  }), e;
}
function tX(r, t, e) {
  var n = H({}, e), i = r[t], a = e.$action || "merge";
  a === "merge" ? i ? (_e(i, n, !0), Qi(i, n, {
    ignoreSize: !0
  }), $M(e, i), uf(e, i), uf(e, i, "shape"), uf(e, i, "style"), uf(e, i, "extra"), e.clipPath = i.clipPath) : r[t] = n : a === "replace" ? r[t] = n : a === "remove" && i && (r[t] = null);
}
var jP = ["transition", "enterFrom", "leaveTo"], rX = jP.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
function uf(r, t, e) {
  if (e && (!r[e] && t[e] && (r[e] = {}), r = r[e], t = t[e]), !(!r || !t))
    for (var n = e ? jP : rX, i = 0; i < n.length; i++) {
      var a = n[i];
      r[a] == null && t[a] != null && (r[a] = t[a]);
    }
}
function nX(r, t) {
  if (r && (r.hv = t.hv = [
    // Rigid body, don't care about `width`.
    OC(t, ["left", "right"]),
    // Rigid body, don't care about `height`.
    OC(t, ["top", "bottom"])
  ], r.type === "group")) {
    var e = r, n = t;
    e.width == null && (e.width = n.width = 0), e.height == null && (e.height = n.height = 0);
  }
}
var iX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.preventAutoZ = !0, e;
    }
    return t.prototype.mergeOption = function(e, n) {
      var i = this.option.elements;
      this.option.elements = null, r.prototype.mergeOption.call(this, e, n), this.option.elements = i;
    }, t.prototype.optionUpdated = function(e, n) {
      var i = this.option, a = (n ? i : e).elements, o = i.elements = n ? [] : i.elements, s = [];
      this._flatten(a, s, null);
      var l = FT(o, s, "normalMerge"), u = this._elOptionsToUpdate = [];
      M(l, function(c, f) {
        var h = c.newOption;
        h && (u.push(h), eX(c, h), tX(o, f, h), nX(o[f], h));
      }, this), i.elements = qe(o, function(c) {
        return c && delete c.$action, c != null;
      });
    }, t.prototype._flatten = function(e, n, i) {
      M(e, function(a) {
        if (a) {
          i && (a.parentOption = i), n.push(a);
          var o = a.children;
          o && o.length && this._flatten(o, n, a), delete a.children;
        }
      }, this);
    }, t.prototype.useElOptionsToUpdate = function() {
      var e = this._elOptionsToUpdate;
      return this._elOptionsToUpdate = null, e;
    }, t.type = "graphic", t.defaultOption = {
      elements: []
      // parentId: null
    }, t;
  }(Le)
), FC = {
  // Reserved but not supported in graphic component.
  path: null,
  compoundPath: null,
  // Supported in graphic component.
  group: fe,
  image: Pt,
  text: Fe
}, Br = Oe(), aX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function() {
      this._elMap = re();
    }, t.prototype.render = function(e, n, i) {
      e !== this._lastGraphicModel && this._clear(), this._lastGraphicModel = e, this._updateElements(e), this._relocate(e, i);
    }, t.prototype._updateElements = function(e) {
      var n = e.useElOptionsToUpdate();
      if (n) {
        var i = this._elMap, a = this.group, o = e.get("z"), s = e.get("zlevel");
        M(n, function(l) {
          var u = bt(l.id, null), c = u != null ? i.get(u) : null, f = bt(l.parentId, null), h = f != null ? i.get(f) : a, v = l.type, d = l.style;
          v === "text" && d && l.hv && l.hv[1] && (d.textVerticalAlign = d.textBaseline = d.verticalAlign = d.align = null);
          var p = l.textContent, g = l.textConfig;
          if (d && LP(d, v, !!g, !!p)) {
            var m = EP(d, v, !0);
            !g && m.textConfig && (g = l.textConfig = m.textConfig), !p && m.textContent && (p = m.textContent);
          }
          var y = oX(l), _ = l.$action || "merge", b = _ === "merge", S = _ === "replace";
          if (b) {
            var x = !c, w = c;
            x ? w = BC(u, h, l.type, i) : (w && (Br(w).isNew = !1), OP(w)), w && (Nf(w, y, e, {
              isInit: x
            }), NC(w, l, o, s));
          } else if (S) {
            $f(c, l, i, e);
            var C = BC(u, h, l.type, i);
            C && (Nf(C, y, e, {
              isInit: !0
            }), NC(C, l, o, s));
          } else _ === "remove" && (kP(c, l), $f(c, l, i, e));
          var D = i.get(u);
          if (D && p)
            if (b) {
              var A = D.getTextContent();
              A ? A.attr(p) : D.setTextContent(new Fe(p));
            } else S && D.setTextContent(new Fe(p));
          if (D) {
            var T = l.clipPath;
            if (T) {
              var L = T.type, E = void 0, x = !1;
              if (b) {
                var I = D.getClipPath();
                x = !I || Br(I).type !== L, E = x ? cy(L) : I;
              } else S && (x = !0, E = cy(L));
              D.setClipPath(E), Nf(E, T, e, {
                isInit: x
              }), kh(E, T.keyframeAnimation, e);
            }
            var P = Br(D);
            D.setTextConfig(g), P.option = l, sX(D, e, l), xo({
              el: D,
              componentModel: e,
              itemName: D.name,
              itemTooltipOption: l.tooltip
            }), kh(D, l.keyframeAnimation, e);
          }
        });
      }
    }, t.prototype._relocate = function(e, n) {
      for (var i = e.option.elements, a = this.group, o = this._elMap, s = n.getWidth(), l = n.getHeight(), u = ["x", "y"], c = 0; c < i.length; c++) {
        var f = i[c], h = bt(f.id, null), v = h != null ? o.get(h) : null;
        if (!(!v || !v.isGroup)) {
          var d = v.parent, p = d === a, g = Br(v), m = Br(d);
          g.width = X(g.option.width, p ? s : m.width) || 0, g.height = X(g.option.height, p ? l : m.height) || 0;
        }
      }
      for (var c = i.length - 1; c >= 0; c--) {
        var f = i[c], h = bt(f.id, null), v = h != null ? o.get(h) : null;
        if (v) {
          var d = v.parent, m = Br(d), y = d === a ? {
            width: s,
            height: l
          } : {
            width: m.width,
            height: m.height
          }, _ = {}, b = xv(v, f, y, null, {
            hv: f.hv,
            boundingMode: f.bounding
          }, _);
          if (!Br(v).isNew && b) {
            for (var S = f.transition, x = {}, w = 0; w < u.length; w++) {
              var C = u[w], D = _[C];
              S && (uo(S) || we(S, C) >= 0) ? x[C] = D : v[C] = D;
            }
            Ne(v, x, e, 0);
          } else
            v.attr(_);
        }
      }
    }, t.prototype._clear = function() {
      var e = this, n = this._elMap;
      n.each(function(i) {
        $f(i, Br(i).option, n, e._lastGraphicModel);
      }), this._elMap = re();
    }, t.prototype.dispose = function() {
      this._clear();
    }, t.type = "graphic", t;
  }(lt)
);
function cy(r) {
  var t = te(FC, r) ? FC[r] : m0(r), e = new t({});
  return Br(e).type = r, e;
}
function BC(r, t, e, n) {
  var i = cy(e);
  return t.add(i), n.set(r, i), Br(i).id = r, Br(i).isNew = !0, i;
}
function $f(r, t, e, n) {
  var i = r && r.parent;
  i && (r.type === "group" && r.traverse(function(a) {
    $f(a, t, e, n);
  }), Nv(r, t, n), e.removeKey(Br(r).id));
}
function NC(r, t, e, n) {
  r.isGroup || M([
    ["cursor", qr.prototype.cursor],
    // We should not support configure z and zlevel in the element level.
    // But seems we didn't limit it previously. So here still use it to avoid breaking.
    ["zlevel", n || 0],
    ["z", e || 0],
    // z2 must not be null/undefined, otherwise sort error may occur.
    ["z2", 0]
  ], function(i) {
    var a = i[0];
    te(t, a) ? r[a] = me(t[a], i[1]) : r[a] == null && (r[a] = i[1]);
  }), M(Ee(t), function(i) {
    if (i.indexOf("on") === 0) {
      var a = t[i];
      r[i] = oe(a) ? a : null;
    }
  }), te(t, "draggable") && (r.draggable = t.draggable), t.name != null && (r.name = t.name), t.id != null && (r.id = t.id);
}
function oX(r) {
  return r = H({}, r), M(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(VM), function(t) {
    delete r[t];
  }), r;
}
function sX(r, t, e) {
  var n = pe(r).eventData;
  !r.silent && !r.ignore && !n && (n = pe(r).eventData = {
    componentType: "graphic",
    componentIndex: t.componentIndex,
    name: r.name
  }), n && (n.info = e.info);
}
function lX(r) {
  r.registerComponentModel(iX), r.registerComponentView(aX), r.registerPreprocessor(function(t) {
    var e = t.graphic;
    q(e) ? !e[0] || !e[0].elements ? t.graphic = [{
      elements: e
    }] : t.graphic = [t.graphic[0]] : e && !e.elements && (t.graphic = [{
      elements: [e]
    }]);
  });
}
var zC = ["x", "y", "radius", "angle", "single"], uX = ["cartesian2d", "polar", "singleAxis"];
function cX(r) {
  var t = r.get("coordinateSystem");
  return we(uX, t) >= 0;
}
function Gi(r) {
  return r + "Axis";
}
function fX(r, t) {
  var e = re(), n = [], i = re();
  r.eachComponent({
    mainType: "dataZoom",
    query: t
  }, function(c) {
    i.get(c.uid) || s(c);
  });
  var a;
  do
    a = !1, r.eachComponent("dataZoom", o);
  while (a);
  function o(c) {
    !i.get(c.uid) && l(c) && (s(c), a = !0);
  }
  function s(c) {
    i.set(c.uid, !0), n.push(c), u(c);
  }
  function l(c) {
    var f = !1;
    return c.eachTargetAxis(function(h, v) {
      var d = e.get(h);
      d && d[v] && (f = !0);
    }), f;
  }
  function u(c) {
    c.eachTargetAxis(function(f, h) {
      (e.get(f) || e.set(f, []))[h] = !0;
    });
  }
  return n;
}
function KP(r) {
  var t = r.ecModel, e = {
    infoList: [],
    infoMap: re()
  };
  return r.eachTargetAxis(function(n, i) {
    var a = t.getComponent(Gi(n), i);
    if (a) {
      var o = a.getCoordSysModel();
      if (o) {
        var s = o.uid, l = e.infoMap.get(s);
        l || (l = {
          model: o,
          axisModels: []
        }, e.infoList.push(l), e.infoMap.set(s, l)), l.axisModels.push(a);
      }
    }
  }), e;
}
var ag = (
  /** @class */
  function() {
    function r() {
      this.indexList = [], this.indexMap = [];
    }
    return r.prototype.add = function(t) {
      this.indexMap[t] || (this.indexList.push(t), this.indexMap[t] = !0);
    }, r;
  }()
), Ou = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._autoThrottle = !0, e._noTarget = !0, e._rangePropMode = ["percent", "percent"], e;
    }
    return t.prototype.init = function(e, n, i) {
      var a = VC(e);
      this.settledOption = a, this.mergeDefaultAndTheme(e, i), this._doInit(a);
    }, t.prototype.mergeOption = function(e) {
      var n = VC(e);
      _e(this.option, e, !0), _e(this.settledOption, n, !0), this._doInit(n);
    }, t.prototype._doInit = function(e) {
      var n = this.option;
      this._setDefaultThrottle(e), this._updateRangeUse(e);
      var i = this.settledOption;
      M([["start", "startValue"], ["end", "endValue"]], function(a, o) {
        this._rangePropMode[o] === "value" && (n[a[0]] = i[a[0]] = null);
      }, this), this._resetTarget();
    }, t.prototype._resetTarget = function() {
      var e = this.get("orient", !0), n = this._targetAxisInfoMap = re(), i = this._fillSpecifiedTargetAxis(n);
      i ? this._orient = e || this._makeAutoOrientByTargetAxis() : (this._orient = e || "horizontal", this._fillAutoTargetAxisByOrient(n, this._orient)), this._noTarget = !0, n.each(function(a) {
        a.indexList.length && (this._noTarget = !1);
      }, this);
    }, t.prototype._fillSpecifiedTargetAxis = function(e) {
      var n = !1;
      return M(zC, function(i) {
        var a = this.getReferringComponents(Gi(i), iN);
        if (a.specified) {
          n = !0;
          var o = new ag();
          M(a.models, function(s) {
            o.add(s.componentIndex);
          }), e.set(i, o);
        }
      }, this), n;
    }, t.prototype._fillAutoTargetAxisByOrient = function(e, n) {
      var i = this.ecModel, a = !0;
      if (a) {
        var o = n === "vertical" ? "y" : "x", s = i.findComponents({
          mainType: o + "Axis"
        });
        l(s, o);
      }
      if (a) {
        var s = i.findComponents({
          mainType: "singleAxis",
          filter: function(c) {
            return c.get("orient", !0) === n;
          }
        });
        l(s, "single");
      }
      function l(u, c) {
        var f = u[0];
        if (f) {
          var h = new ag();
          if (h.add(f.componentIndex), e.set(c, h), a = !1, c === "x" || c === "y") {
            var v = f.getReferringComponents("grid", mt).models[0];
            v && M(u, function(d) {
              f.componentIndex !== d.componentIndex && v === d.getReferringComponents("grid", mt).models[0] && h.add(d.componentIndex);
            });
          }
        }
      }
      a && M(zC, function(u) {
        if (a) {
          var c = i.findComponents({
            mainType: Gi(u),
            filter: function(h) {
              return h.get("type", !0) === "category";
            }
          });
          if (c[0]) {
            var f = new ag();
            f.add(c[0].componentIndex), e.set(u, f), a = !1;
          }
        }
      }, this);
    }, t.prototype._makeAutoOrientByTargetAxis = function() {
      var e;
      return this.eachTargetAxis(function(n) {
        !e && (e = n);
      }, this), e === "y" ? "vertical" : "horizontal";
    }, t.prototype._setDefaultThrottle = function(e) {
      if (e.hasOwnProperty("throttle") && (this._autoThrottle = !1), this._autoThrottle) {
        var n = this.ecModel.option;
        this.option.throttle = n.animation && n.animationDurationUpdate > 0 ? 100 : 20;
      }
    }, t.prototype._updateRangeUse = function(e) {
      var n = this._rangePropMode, i = this.get("rangeMode");
      M([["start", "startValue"], ["end", "endValue"]], function(a, o) {
        var s = e[a[0]] != null, l = e[a[1]] != null;
        s && !l ? n[o] = "percent" : !s && l ? n[o] = "value" : i ? n[o] = i[o] : s && (n[o] = "percent");
      });
    }, t.prototype.noTarget = function() {
      return this._noTarget;
    }, t.prototype.getFirstTargetAxisModel = function() {
      var e;
      return this.eachTargetAxis(function(n, i) {
        e == null && (e = this.ecModel.getComponent(Gi(n), i));
      }, this), e;
    }, t.prototype.eachTargetAxis = function(e, n) {
      this._targetAxisInfoMap.each(function(i, a) {
        M(i.indexList, function(o) {
          e.call(n, a, o);
        });
      });
    }, t.prototype.getAxisProxy = function(e, n) {
      var i = this.getAxisModel(e, n);
      if (i)
        return i.__dzAxisProxy;
    }, t.prototype.getAxisModel = function(e, n) {
      var i = this._targetAxisInfoMap.get(e);
      if (i && i.indexMap[n])
        return this.ecModel.getComponent(Gi(e), n);
    }, t.prototype.setRawRange = function(e) {
      var n = this.option, i = this.settledOption;
      M([["start", "startValue"], ["end", "endValue"]], function(a) {
        (e[a[0]] != null || e[a[1]] != null) && (n[a[0]] = i[a[0]] = e[a[0]], n[a[1]] = i[a[1]] = e[a[1]]);
      }, this), this._updateRangeUse(e);
    }, t.prototype.setCalculatedRange = function(e) {
      var n = this.option;
      M(["start", "startValue", "end", "endValue"], function(i) {
        n[i] = e[i];
      });
    }, t.prototype.getPercentRange = function() {
      var e = this.findRepresentativeAxisProxy();
      if (e)
        return e.getDataPercentWindow();
    }, t.prototype.getValueRange = function(e, n) {
      if (e == null && n == null) {
        var i = this.findRepresentativeAxisProxy();
        if (i)
          return i.getDataValueWindow();
      } else
        return this.getAxisProxy(e, n).getDataValueWindow();
    }, t.prototype.findRepresentativeAxisProxy = function(e) {
      if (e)
        return e.__dzAxisProxy;
      for (var n, i = this._targetAxisInfoMap.keys(), a = 0; a < i.length; a++)
        for (var o = i[a], s = this._targetAxisInfoMap.get(o), l = 0; l < s.indexList.length; l++) {
          var u = this.getAxisProxy(o, s.indexList[l]);
          if (u.hostedBy(this))
            return u;
          n || (n = u);
        }
      return n;
    }, t.prototype.getRangePropMode = function() {
      return this._rangePropMode.slice();
    }, t.prototype.getOrient = function() {
      return this._orient;
    }, t.type = "dataZoom", t.dependencies = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "series", "toolbox"], t.defaultOption = {
      // zlevel: 0,
      z: 4,
      filterMode: "filter",
      start: 0,
      end: 100
    }, t;
  }(Le)
);
function VC(r) {
  var t = {};
  return M(["start", "end", "startValue", "endValue", "throttle"], function(e) {
    r.hasOwnProperty(e) && (t[e] = r[e]);
  }), t;
}
var hX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "dataZoom.select", t;
  }(Ou)
), $_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i, a) {
      this.dataZoomModel = e, this.ecModel = n, this.api = i;
    }, t.type = "dataZoom", t;
  }(lt)
), vX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "dataZoom.select", t;
  }($_)
), ns = M, $C = Gr, dX = (
  /** @class */
  function() {
    function r(t, e, n, i) {
      this._dimName = t, this._axisIndex = e, this.ecModel = i, this._dataZoomModel = n;
    }
    return r.prototype.hostedBy = function(t) {
      return this._dataZoomModel === t;
    }, r.prototype.getDataValueWindow = function() {
      return this._valueWindow.slice();
    }, r.prototype.getDataPercentWindow = function() {
      return this._percentWindow.slice();
    }, r.prototype.getTargetSeriesModels = function() {
      var t = [];
      return this.ecModel.eachSeries(function(e) {
        if (cX(e)) {
          var n = Gi(this._dimName), i = e.getReferringComponents(n, mt).models[0];
          i && this._axisIndex === i.componentIndex && t.push(e);
        }
      }, this), t;
    }, r.prototype.getAxisModel = function() {
      return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
    }, r.prototype.getMinMaxSpan = function() {
      return ce(this._minMaxSpan);
    }, r.prototype.calculateDataWindow = function(t) {
      var e = this._dataExtent, n = this.getAxisModel(), i = n.axis.scale, a = this._dataZoomModel.getRangePropMode(), o = [0, 100], s = [], l = [], u;
      ns(["start", "end"], function(h, v) {
        var d = t[h], p = t[h + "Value"];
        a[v] === "percent" ? (d == null && (d = o[v]), p = i.parse(Ye(d, o, e))) : (u = !0, p = p == null ? e[v] : i.parse(p), d = Ye(p, e, o)), l[v] = p == null || isNaN(p) ? e[v] : p, s[v] = d == null || isNaN(d) ? o[v] : d;
      }), $C(l), $C(s);
      var c = this._minMaxSpan;
      u ? f(l, s, e, o, !1) : f(s, l, o, e, !0);
      function f(h, v, d, p, g) {
        var m = g ? "Span" : "ValueSpan";
        Mo(0, h, d, "all", c["min" + m], c["max" + m]);
        for (var y = 0; y < 2; y++)
          v[y] = Ye(h[y], d, p, !0), g && (v[y] = i.parse(v[y]));
      }
      return {
        valueWindow: l,
        percentWindow: s
      };
    }, r.prototype.reset = function(t) {
      if (t === this._dataZoomModel) {
        var e = this.getTargetSeriesModels();
        this._dataExtent = pX(this, this._dimName, e), this._updateMinMaxSpan();
        var n = this.calculateDataWindow(t.settledOption);
        this._valueWindow = n.valueWindow, this._percentWindow = n.percentWindow, this._setAxisModel();
      }
    }, r.prototype.filterData = function(t, e) {
      if (t !== this._dataZoomModel)
        return;
      var n = this._dimName, i = this.getTargetSeriesModels(), a = t.get("filterMode"), o = this._valueWindow;
      if (a === "none")
        return;
      ns(i, function(l) {
        var u = l.getData(), c = u.mapDimensionsAll(n);
        if (c.length) {
          if (a === "weakFilter") {
            var f = u.getStore(), h = U(c, function(v) {
              return u.getDimensionIndex(v);
            }, u);
            u.filterSelf(function(v) {
              for (var d, p, g, m = 0; m < c.length; m++) {
                var y = f.get(h[m], v), _ = !isNaN(y), b = y < o[0], S = y > o[1];
                if (_ && !b && !S)
                  return !0;
                _ && (g = !0), b && (d = !0), S && (p = !0);
              }
              return g && d && p;
            });
          } else
            ns(c, function(v) {
              if (a === "empty")
                l.setData(u = u.map(v, function(p) {
                  return s(p) ? p : NaN;
                }));
              else {
                var d = {};
                d[v] = o, u.selectRange(d);
              }
            });
          ns(c, function(v) {
            u.setApproximateExtent(o, v);
          });
        }
      });
      function s(l) {
        return l >= o[0] && l <= o[1];
      }
    }, r.prototype._updateMinMaxSpan = function() {
      var t = this._minMaxSpan = {}, e = this._dataZoomModel, n = this._dataExtent;
      ns(["min", "max"], function(i) {
        var a = e.get(i + "Span"), o = e.get(i + "ValueSpan");
        o != null && (o = this.getAxisModel().axis.scale.parse(o)), o != null ? a = Ye(n[0] + o, n, [0, 100], !0) : a != null && (o = Ye(a, [0, 100], n, !0) - n[0]), t[i + "Span"] = a, t[i + "ValueSpan"] = o;
      }, this);
    }, r.prototype._setAxisModel = function() {
      var t = this.getAxisModel(), e = this._percentWindow, n = this._valueWindow;
      if (e) {
        var i = MT(n, [0, 500]);
        i = Math.min(i, 20);
        var a = t.axis.scale.rawExtentInfo;
        e[0] !== 0 && a.setDeterminedMinMax("min", +n[0].toFixed(i)), e[1] !== 100 && a.setDeterminedMinMax("max", +n[1].toFixed(i)), a.freeze();
      }
    }, r;
  }()
);
function pX(r, t, e) {
  var n = [1 / 0, -1 / 0];
  ns(e, function(o) {
    ZG(n, o.getData(), t);
  });
  var i = r.getAxisModel(), a = pL(i.axis.scale, i, n).calculate();
  return [a.min, a.max];
}
var gX = {
  // `dataZoomProcessor` will only be performed in needed series. Consider if
  // there is a line series and a pie series, it is better not to update the
  // line series if only pie series is needed to be updated.
  getTargetSeries: function(r) {
    function t(i) {
      r.eachComponent("dataZoom", function(a) {
        a.eachTargetAxis(function(o, s) {
          var l = r.getComponent(Gi(o), s);
          i(o, s, l, a);
        });
      });
    }
    t(function(i, a, o, s) {
      o.__dzAxisProxy = null;
    });
    var e = [];
    t(function(i, a, o, s) {
      o.__dzAxisProxy || (o.__dzAxisProxy = new dX(i, a, s, r), e.push(o.__dzAxisProxy));
    });
    var n = re();
    return M(e, function(i) {
      M(i.getTargetSeriesModels(), function(a) {
        n.set(a.uid, a);
      });
    }), n;
  },
  // Consider appendData, where filter should be performed. Because data process is
  // in block mode currently, it is not need to worry about that the overallProgress
  // execute every frame.
  overallReset: function(r, t) {
    r.eachComponent("dataZoom", function(e) {
      e.eachTargetAxis(function(n, i) {
        e.getAxisProxy(n, i).reset(e);
      }), e.eachTargetAxis(function(n, i) {
        e.getAxisProxy(n, i).filterData(e, t);
      });
    }), r.eachComponent("dataZoom", function(e) {
      var n = e.findRepresentativeAxisProxy();
      if (n) {
        var i = n.getDataPercentWindow(), a = n.getDataValueWindow();
        e.setCalculatedRange({
          start: i[0],
          end: i[1],
          startValue: a[0],
          endValue: a[1]
        });
      }
    });
  }
};
function mX(r) {
  r.registerAction("dataZoom", function(t, e) {
    var n = fX(e, t);
    M(n, function(i) {
      i.setRawRange({
        start: t.start,
        end: t.end,
        startValue: t.startValue,
        endValue: t.endValue
      });
    });
  });
}
var GC = !1;
function G_(r) {
  GC || (GC = !0, r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER, gX), mX(r), r.registerSubTypeDefaulter("dataZoom", function() {
    return "slider";
  }));
}
function yX(r) {
  r.registerComponentModel(hX), r.registerComponentView(vX), G_(r);
}
var zr = (
  /** @class */
  /* @__PURE__ */ function() {
    function r() {
    }
    return r;
  }()
), JP = {};
function is(r, t) {
  JP[r] = t;
}
function QP(r) {
  return JP[r];
}
var _X = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.optionUpdated = function() {
      r.prototype.optionUpdated.apply(this, arguments);
      var e = this.ecModel;
      M(this.option.feature, function(n, i) {
        var a = QP(i);
        a && (a.getDefaultOption && (a.defaultOption = a.getDefaultOption(e)), _e(n, a.defaultOption));
      });
    }, t.type = "toolbox", t.layoutMode = {
      type: "box",
      ignoreSize: !0
    }, t.defaultOption = {
      show: !0,
      z: 6,
      // zlevel: 0,
      orient: "horizontal",
      left: "right",
      top: "top",
      // right
      // bottom
      backgroundColor: "transparent",
      borderColor: "#ccc",
      borderRadius: 0,
      borderWidth: 0,
      padding: 5,
      itemSize: 15,
      itemGap: 8,
      showTitle: !0,
      iconStyle: {
        borderColor: "#666",
        color: "none"
      },
      emphasis: {
        iconStyle: {
          borderColor: "#3E98C5"
        }
      },
      // textStyle: {},
      // feature
      tooltip: {
        show: !1,
        position: "bottom"
      }
    }, t;
  }(Le)
);
function bX(r, t, e) {
  var n = t.getBoxLayoutParams(), i = t.get("padding"), a = {
    width: e.getWidth(),
    height: e.getHeight()
  }, o = St(n, a, i);
  so(t.get("orient"), r, t.get("itemGap"), o.width, o.height), xv(r, n, a, i);
}
function ek(r, t) {
  var e = Fs(t.get("padding")), n = t.getItemStyle(["color", "opacity"]);
  return n.fill = t.get("backgroundColor"), r = new ke({
    shape: {
      x: r.x - e[3],
      y: r.y - e[0],
      width: r.width + e[1] + e[3],
      height: r.height + e[0] + e[2],
      r: t.get("borderRadius")
    },
    style: n,
    silent: !0,
    z2: -1
  }), r;
}
var SX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.render = function(e, n, i, a) {
      var o = this.group;
      if (o.removeAll(), !e.get("show"))
        return;
      var s = +e.get("itemSize"), l = e.get("orient") === "vertical", u = e.get("feature") || {}, c = this._features || (this._features = {}), f = [];
      M(u, function(d, p) {
        f.push(p);
      }), new li(this._featureNames || [], f).add(h).update(h).remove(ye(h, null)).execute(), this._featureNames = f;
      function h(d, p) {
        var g = f[d], m = f[p], y = u[g], _ = new Ze(y, e, e.ecModel), b;
        if (a && a.newTitle != null && a.featureName === g && (y.title = a.newTitle), g && !m) {
          if (xX(g))
            b = {
              onclick: _.option.onclick,
              featureName: g
            };
          else {
            var S = QP(g);
            if (!S)
              return;
            b = new S();
          }
          c[g] = b;
        } else if (b = c[m], !b)
          return;
        b.uid = Os("toolbox-feature"), b.model = _, b.ecModel = n, b.api = i;
        var x = b instanceof zr;
        if (!g && m) {
          x && b.dispose && b.dispose(n, i);
          return;
        }
        if (!_.get("show") || x && b.unusable) {
          x && b.remove && b.remove(n, i);
          return;
        }
        v(_, b, g), _.setIconStatus = function(w, C) {
          var D = this.option, A = this.iconPaths;
          D.iconStatus = D.iconStatus || {}, D.iconStatus[w] = C, A[w] && (C === "emphasis" ? oi : si)(A[w]);
        }, b instanceof zr && b.render && b.render(_, n, i, a);
      }
      function v(d, p, g) {
        var m = d.getModel("iconStyle"), y = d.getModel(["emphasis", "iconStyle"]), _ = p instanceof zr && p.getIcons ? p.getIcons() : d.get("icon"), b = d.get("title") || {}, S, x;
        J(_) ? (S = {}, S[g] = _) : S = _, J(b) ? (x = {}, x[g] = b) : x = b;
        var w = d.iconPaths = {};
        M(S, function(C, D) {
          var A = Yu(C, {}, {
            x: -s / 2,
            y: -s / 2,
            width: s,
            height: s
          });
          A.setStyle(m.getItemStyle());
          var T = A.ensureState("emphasis");
          T.style = y.getItemStyle();
          var L = new Fe({
            style: {
              text: x[D],
              align: y.get("textAlign"),
              borderRadius: y.get("textBorderRadius"),
              padding: y.get("textPadding"),
              fill: null,
              font: y0({
                fontStyle: y.get("textFontStyle"),
                fontFamily: y.get("textFontFamily"),
                fontSize: y.get("textFontSize"),
                fontWeight: y.get("textFontWeight")
              }, n)
            },
            ignore: !0
          });
          A.setTextContent(L), xo({
            el: A,
            componentModel: e,
            itemName: D,
            formatterParamsExtra: {
              title: x[D]
            }
          }), A.__title = x[D], A.on("mouseover", function() {
            var E = y.getItemStyle(), I = l ? e.get("right") == null && e.get("left") !== "right" ? "right" : "left" : e.get("bottom") == null && e.get("top") !== "bottom" ? "bottom" : "top";
            L.setStyle({
              fill: y.get("textFill") || E.fill || E.stroke || "#000",
              backgroundColor: y.get("textBackgroundColor")
            }), A.setTextConfig({
              position: y.get("textPosition") || I
            }), L.ignore = !e.get("showTitle"), i.enterEmphasis(this);
          }).on("mouseout", function() {
            d.get(["iconStatus", D]) !== "emphasis" && i.leaveEmphasis(this), L.hide();
          }), (d.get(["iconStatus", D]) === "emphasis" ? oi : si)(A), o.add(A), A.on("click", Q(p.onclick, p, n, i, D)), w[D] = A;
        });
      }
      bX(o, e, i), o.add(ek(o.getBoundingRect(), e)), l || o.eachChild(function(d) {
        var p = d.__title, g = d.ensureState("emphasis"), m = g.textConfig || (g.textConfig = {}), y = d.getTextContent(), _ = y && y.ensureState("emphasis");
        if (_ && !oe(_) && p) {
          var b = _.style || (_.style = {}), S = Vu(p, Fe.makeFont(b)), x = d.x + o.x, w = d.y + o.y + s, C = !1;
          w + S.height > i.getHeight() && (m.position = "top", C = !0);
          var D = C ? -5 - S.height : s + 10;
          x + S.width / 2 > i.getWidth() ? (m.position = ["100%", D], b.align = "right") : x - S.width / 2 < 0 && (m.position = [0, D], b.align = "left");
        }
      });
    }, t.prototype.updateView = function(e, n, i, a) {
      M(this._features, function(o) {
        o instanceof zr && o.updateView && o.updateView(o.model, n, i, a);
      });
    }, t.prototype.remove = function(e, n) {
      M(this._features, function(i) {
        i instanceof zr && i.remove && i.remove(e, n);
      }), this.group.removeAll();
    }, t.prototype.dispose = function(e, n) {
      M(this._features, function(i) {
        i instanceof zr && i.dispose && i.dispose(e, n);
      });
    }, t.type = "toolbox", t;
  }(lt)
);
function xX(r) {
  return r.indexOf("my") === 0;
}
var wX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(e, n) {
      var i = this.model, a = i.get("name") || e.get("title.0.text") || "echarts", o = n.getZr().painter.getType() === "svg", s = o ? "svg" : i.get("type", !0) || "png", l = n.getConnectedDataURL({
        type: s,
        backgroundColor: i.get("backgroundColor", !0) || e.get("backgroundColor") || "#fff",
        connectedBackgroundColor: i.get("connectedBackgroundColor"),
        excludeComponents: i.get("excludeComponents"),
        pixelRatio: i.get("pixelRatio")
      }), u = Ie.browser;
      if (typeof MouseEvent == "function" && (u.newEdge || !u.ie && !u.edge)) {
        var c = document.createElement("a");
        c.download = a + "." + s, c.target = "_blank", c.href = l;
        var f = new MouseEvent("click", {
          // some micro front-end framework， window maybe is a Proxy
          view: document.defaultView,
          bubbles: !0,
          cancelable: !1
        });
        c.dispatchEvent(f);
      } else if (window.navigator.msSaveOrOpenBlob || o) {
        var h = l.split(","), v = h[0].indexOf("base64") > -1, d = o ? decodeURIComponent(h[1]) : h[1];
        v && (d = window.atob(d));
        var p = a + "." + s;
        if (window.navigator.msSaveOrOpenBlob) {
          for (var g = d.length, m = new Uint8Array(g); g--; )
            m[g] = d.charCodeAt(g);
          var y = new Blob([m]);
          window.navigator.msSaveOrOpenBlob(y, p);
        } else {
          var _ = document.createElement("iframe");
          document.body.appendChild(_);
          var b = _.contentWindow, S = b.document;
          S.open("image/svg+xml", "replace"), S.write(d), S.close(), b.focus(), S.execCommand("SaveAs", !0, p), document.body.removeChild(_);
        }
      } else {
        var x = i.get("lang"), w = '<body style="margin:0;"><img src="' + l + '" style="max-width:100%;" title="' + (x && x[0] || "") + '" /></body>', C = window.open();
        C.document.write(w), C.document.title = a;
      }
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
        title: e.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
        type: "png",
        // Default use option.backgroundColor
        // backgroundColor: '#fff',
        connectedBackgroundColor: "#fff",
        name: "",
        excludeComponents: ["toolbox"],
        // use current pixel ratio of device by default
        // pixelRatio: 1,
        lang: e.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
      };
      return n;
    }, t;
  }(zr)
), HC = "__ec_magicType_stack__", CX = [["line", "bar"], ["stack"]], AX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.getIcons = function() {
      var e = this.model, n = e.get("icon"), i = {};
      return M(e.get("type"), function(a) {
        n[a] && (i[a] = n[a]);
      }), i;
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        type: [],
        // Icon group
        icon: {
          line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
          bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
          // eslint-disable-next-line
          stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
          // jshint ignore:line
        },
        // `line`, `bar`, `stack`, `tiled`
        title: e.getLocaleModel().get(["toolbox", "magicType", "title"]),
        option: {},
        seriesIndex: {}
      };
      return n;
    }, t.prototype.onclick = function(e, n, i) {
      var a = this.model, o = a.get(["seriesIndex", i]);
      if (qC[i]) {
        var s = {
          series: []
        }, l = function(f) {
          var h = f.subType, v = f.id, d = qC[i](h, v, f, a);
          d && (se(d, f.option), s.series.push(d));
          var p = f.coordinateSystem;
          if (p && p.type === "cartesian2d" && (i === "line" || i === "bar")) {
            var g = p.getAxesByScale("ordinal")[0];
            if (g) {
              var m = g.dim, y = m + "Axis", _ = f.getReferringComponents(y, mt).models[0], b = _.componentIndex;
              s[y] = s[y] || [];
              for (var S = 0; S <= b; S++)
                s[y][b] = s[y][b] || {};
              s[y][b].boundaryGap = i === "bar";
            }
          }
        };
        M(CX, function(f) {
          we(f, i) >= 0 && M(f, function(h) {
            a.setIconStatus(h, "normal");
          });
        }), a.setIconStatus(i, "emphasis"), e.eachComponent({
          mainType: "series",
          query: o == null ? null : {
            seriesIndex: o
          }
        }, l);
        var u, c = i;
        i === "stack" && (u = _e({
          stack: a.option.title.tiled,
          tiled: a.option.title.stack
        }, a.option.title), a.get(["iconStatus", i]) !== "emphasis" && (c = "tiled")), n.dispatchAction({
          type: "changeMagicType",
          currentType: c,
          newOption: s,
          newTitle: u,
          featureName: "magicType"
        });
      }
    }, t;
  }(zr)
), qC = {
  line: function(r, t, e, n) {
    if (r === "bar")
      return _e({
        id: t,
        type: "line",
        // Preserve data related option
        data: e.get("data"),
        stack: e.get("stack"),
        markPoint: e.get("markPoint"),
        markLine: e.get("markLine")
      }, n.get(["option", "line"]) || {}, !0);
  },
  bar: function(r, t, e, n) {
    if (r === "line")
      return _e({
        id: t,
        type: "bar",
        // Preserve data related option
        data: e.get("data"),
        stack: e.get("stack"),
        markPoint: e.get("markPoint"),
        markLine: e.get("markLine")
      }, n.get(["option", "bar"]) || {}, !0);
  },
  stack: function(r, t, e, n) {
    var i = e.get("stack") === HC;
    if (r === "line" || r === "bar")
      return n.setIconStatus("stack", i ? "normal" : "emphasis"), _e({
        id: t,
        stack: i ? "" : HC
      }, n.get(["option", "stack"]) || {}, !0);
  }
};
Vn({
  type: "changeMagicType",
  event: "magicTypeChanged",
  update: "prepareAndUpdate"
}, function(r, t) {
  t.mergeOption(r.newOption);
});
var zv = new Array(60).join("-"), Ds = "	";
function DX(r) {
  var t = {}, e = [], n = [];
  return r.eachRawSeries(function(i) {
    var a = i.coordinateSystem;
    if (a && (a.type === "cartesian2d" || a.type === "polar")) {
      var o = a.getBaseAxis();
      if (o.type === "category") {
        var s = o.dim + "_" + o.index;
        t[s] || (t[s] = {
          categoryAxis: o,
          valueAxis: a.getOtherAxis(o),
          series: []
        }, n.push({
          axisDim: o.dim,
          axisIndex: o.index
        })), t[s].series.push(i);
      } else
        e.push(i);
    } else
      e.push(i);
  }), {
    seriesGroupByCategoryAxis: t,
    other: e,
    meta: n
  };
}
function TX(r) {
  var t = [];
  return M(r, function(e, n) {
    var i = e.categoryAxis, a = e.valueAxis, o = a.dim, s = [" "].concat(U(e.series, function(v) {
      return v.name;
    })), l = [i.model.getCategories()];
    M(e.series, function(v) {
      var d = v.getRawData();
      l.push(v.getRawData().mapArray(d.mapDimension(o), function(p) {
        return p;
      }));
    });
    for (var u = [s.join(Ds)], c = 0; c < l[0].length; c++) {
      for (var f = [], h = 0; h < l.length; h++)
        f.push(l[h][c]);
      u.push(f.join(Ds));
    }
    t.push(u.join(`
`));
  }), t.join(`

` + zv + `

`);
}
function MX(r) {
  return U(r, function(t) {
    var e = t.getRawData(), n = [t.name], i = [];
    return e.each(e.dimensions, function() {
      for (var a = arguments.length, o = arguments[a - 1], s = e.getName(o), l = 0; l < a - 1; l++)
        i[l] = arguments[l];
      n.push((s ? s + Ds : "") + i.join(Ds));
    }), n.join(`
`);
  }).join(`

` + zv + `

`);
}
function IX(r) {
  var t = DX(r);
  return {
    value: qe([TX(t.seriesGroupByCategoryAxis), MX(t.other)], function(e) {
      return !!e.replace(/[\n\t\s]/g, "");
    }).join(`

` + zv + `

`),
    meta: t.meta
  };
}
function Fh(r) {
  return r.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}
function LX(r) {
  var t = r.slice(0, r.indexOf(`
`));
  if (t.indexOf(Ds) >= 0)
    return !0;
}
var fy = new RegExp("[" + Ds + "]+", "g");
function EX(r) {
  for (var t = r.split(/\n+/g), e = Fh(t.shift()).split(fy), n = [], i = U(e, function(l) {
    return {
      name: l,
      data: []
    };
  }), a = 0; a < t.length; a++) {
    var o = Fh(t[a]).split(fy);
    n.push(o.shift());
    for (var s = 0; s < o.length; s++)
      i[s] && (i[s].data[a] = o[s]);
  }
  return {
    series: i,
    categories: n
  };
}
function PX(r) {
  for (var t = r.split(/\n+/g), e = Fh(t.shift()), n = [], i = 0; i < t.length; i++) {
    var a = Fh(t[i]);
    if (a) {
      var o = a.split(fy), s = "", l = void 0, u = !1;
      isNaN(o[0]) ? (u = !0, s = o[0], o = o.slice(1), n[i] = {
        name: s,
        value: []
      }, l = n[i].value) : l = n[i] = [];
      for (var c = 0; c < o.length; c++)
        l.push(+o[c]);
      l.length === 1 && (u ? n[i].value = l[0] : n[i] = l[0]);
    }
  }
  return {
    name: e,
    data: n
  };
}
function kX(r, t) {
  var e = r.split(new RegExp(`
*` + zv + `
*`, "g")), n = {
    series: []
  };
  return M(e, function(i, a) {
    if (LX(i)) {
      var o = EX(i), s = t[a], l = s.axisDim + "Axis";
      s && (n[l] = n[l] || [], n[l][s.axisIndex] = {
        data: o.categories
      }, n.series = n.series.concat(o.series));
    } else {
      var o = PX(i);
      n.series.push(o);
    }
  }), n;
}
var RX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(e, n) {
      setTimeout(function() {
        n.dispatchAction({
          type: "hideTip"
        });
      });
      var i = n.getDom(), a = this.model;
      this._dom && i.removeChild(this._dom);
      var o = document.createElement("div");
      o.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px", o.style.backgroundColor = a.get("backgroundColor") || "#fff";
      var s = document.createElement("h4"), l = a.get("lang") || [];
      s.innerHTML = l[0] || a.get("title"), s.style.cssText = "margin:10px 20px", s.style.color = a.get("textColor");
      var u = document.createElement("div"), c = document.createElement("textarea");
      u.style.cssText = "overflow:auto";
      var f = a.get("optionToContent"), h = a.get("contentToOption"), v = IX(e);
      if (oe(f)) {
        var d = f(n.getOption());
        J(d) ? u.innerHTML = d : gs(d) && u.appendChild(d);
      } else {
        c.readOnly = a.get("readOnly");
        var p = c.style;
        p.cssText = "display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none", p.color = a.get("textColor"), p.borderColor = a.get("textareaBorderColor"), p.backgroundColor = a.get("textareaColor"), c.value = v.value, u.appendChild(c);
      }
      var g = v.meta, m = document.createElement("div");
      m.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
      var y = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px", _ = document.createElement("div"), b = document.createElement("div");
      y += ";background-color:" + a.get("buttonColor"), y += ";color:" + a.get("buttonTextColor");
      var S = this;
      function x() {
        i.removeChild(o), S._dom = null;
      }
      Hg(_, "click", x), Hg(b, "click", function() {
        if (h == null && f != null || h != null && f == null) {
          x();
          return;
        }
        var w;
        try {
          oe(h) ? w = h(u, n.getOption()) : w = kX(c.value, g);
        } catch (C) {
          throw x(), new Error("Data view format error " + C);
        }
        w && n.dispatchAction({
          type: "changeDataView",
          newOption: w
        }), x();
      }), _.innerHTML = l[1], b.innerHTML = l[2], b.style.cssText = _.style.cssText = y, !a.get("readOnly") && m.appendChild(b), m.appendChild(_), o.appendChild(s), o.appendChild(u), o.appendChild(m), u.style.height = i.clientHeight - 80 + "px", i.appendChild(o), this._dom = o;
    }, t.prototype.remove = function(e, n) {
      this._dom && n.getDom().removeChild(this._dom);
    }, t.prototype.dispose = function(e, n) {
      this.remove(e, n);
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        readOnly: !1,
        optionToContent: null,
        contentToOption: null,
        // eslint-disable-next-line
        icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
        title: e.getLocaleModel().get(["toolbox", "dataView", "title"]),
        lang: e.getLocaleModel().get(["toolbox", "dataView", "lang"]),
        backgroundColor: "#fff",
        textColor: "#000",
        textareaColor: "#fff",
        textareaBorderColor: "#333",
        buttonColor: "#c23531",
        buttonTextColor: "#fff"
      };
      return n;
    }, t;
  }(zr)
);
function OX(r, t) {
  return U(r, function(e, n) {
    var i = t && t[n];
    if (ue(i) && !q(i)) {
      var a = ue(e) && !q(e);
      a || (e = {
        value: e
      });
      var o = i.name != null && e.name == null;
      return e = se(e, i), o && delete e.name, e;
    } else
      return e;
  });
}
Vn({
  type: "changeDataView",
  event: "dataViewChanged",
  update: "prepareAndUpdate"
}, function(r, t) {
  var e = [];
  M(r.newOption.series, function(n) {
    var i = t.getSeriesByName(n.name)[0];
    if (!i)
      e.push(H({
        // Default is scatter
        type: "scatter"
      }, n));
    else {
      var a = i.get("data");
      e.push({
        name: n.name,
        data: OX(n.data, a)
      });
    }
  }), t.mergeOption(se({
    series: e
  }, r.newOption));
});
var tk = M, rk = Oe();
function FX(r, t) {
  var e = H_(r);
  tk(t, function(n, i) {
    for (var a = e.length - 1; a >= 0; a--) {
      var o = e[a];
      if (o[i])
        break;
    }
    if (a < 0) {
      var s = r.queryComponents({
        mainType: "dataZoom",
        subType: "select",
        id: i
      })[0];
      if (s) {
        var l = s.getPercentRange();
        e[0][i] = {
          dataZoomId: i,
          start: l[0],
          end: l[1]
        };
      }
    }
  }), e.push(t);
}
function BX(r) {
  var t = H_(r), e = t[t.length - 1];
  t.length > 1 && t.pop();
  var n = {};
  return tk(e, function(i, a) {
    for (var o = t.length - 1; o >= 0; o--)
      if (i = t[o][a], i) {
        n[a] = i;
        break;
      }
  }), n;
}
function NX(r) {
  rk(r).snapshots = null;
}
function zX(r) {
  return H_(r).length;
}
function H_(r) {
  var t = rk(r);
  return t.snapshots || (t.snapshots = [{}]), t.snapshots;
}
var VX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(e, n) {
      NX(e), n.dispatchAction({
        type: "restore",
        from: this.uid
      });
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        // eslint-disable-next-line
        icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
        title: e.getLocaleModel().get(["toolbox", "restore", "title"])
      };
      return n;
    }, t;
  }(zr)
);
Vn({
  type: "restore",
  event: "restore",
  update: "prepareAndUpdate"
}, function(r, t) {
  t.resetOption("recreate");
});
var $X = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"], q_ = (
  /** @class */
  function() {
    function r(t, e, n) {
      var i = this;
      this._targetInfoList = [];
      var a = WC(e, t);
      M(GX, function(o, s) {
        (!n || !n.include || we(n.include, s) >= 0) && o(a, i._targetInfoList);
      });
    }
    return r.prototype.setOutputRanges = function(t, e) {
      return this.matchOutputRanges(t, e, function(n, i, a) {
        if ((n.coordRanges || (n.coordRanges = [])).push(i), !n.coordRange) {
          n.coordRange = i;
          var o = og[n.brushType](0, a, i);
          n.__rangeOffset = {
            offset: XC[n.brushType](o.values, n.range, [1, 1]),
            xyMinMax: o.xyMinMax
          };
        }
      }), t;
    }, r.prototype.matchOutputRanges = function(t, e, n) {
      M(t, function(i) {
        var a = this.findTargetInfo(i, e);
        a && a !== !0 && M(a.coordSyses, function(o) {
          var s = og[i.brushType](1, o, i.range, !0);
          n(i, s.values, o, e);
        });
      }, this);
    }, r.prototype.setInputRanges = function(t, e) {
      M(t, function(n) {
        var i = this.findTargetInfo(n, e);
        if (n.range = n.range || [], i && i !== !0) {
          n.panelId = i.panelId;
          var a = og[n.brushType](0, i.coordSys, n.coordRange), o = n.__rangeOffset;
          n.range = o ? XC[n.brushType](a.values, o.offset, HX(a.xyMinMax, o.xyMinMax)) : a.values;
        }
      }, this);
    }, r.prototype.makePanelOpts = function(t, e) {
      return U(this._targetInfoList, function(n) {
        var i = n.getPanelRect();
        return {
          panelId: n.panelId,
          defaultBrushType: e ? e(n) : null,
          clipPath: cP(i),
          isTargetByCursor: hP(i, t, n.coordSysModel),
          getLinearBrushOtherExtent: fP(i)
        };
      });
    }, r.prototype.controlSeries = function(t, e, n) {
      var i = this.findTargetInfo(t, n);
      return i === !0 || i && we(i.coordSyses, e.coordinateSystem) >= 0;
    }, r.prototype.findTargetInfo = function(t, e) {
      for (var n = this._targetInfoList, i = WC(e, t), a = 0; a < n.length; a++) {
        var o = n[a], s = t.panelId;
        if (s) {
          if (o.panelId === s)
            return o;
        } else
          for (var l = 0; l < UC.length; l++)
            if (UC[l](i, o))
              return o;
      }
      return !0;
    }, r;
  }()
);
function hy(r) {
  return r[0] > r[1] && r.reverse(), r;
}
function WC(r, t) {
  return Yl(r, t, {
    includeMainTypes: $X
  });
}
var GX = {
  grid: function(r, t) {
    var e = r.xAxisModels, n = r.yAxisModels, i = r.gridModels, a = re(), o = {}, s = {};
    !e && !n && !i || (M(e, function(l) {
      var u = l.axis.grid.model;
      a.set(u.id, u), o[u.id] = !0;
    }), M(n, function(l) {
      var u = l.axis.grid.model;
      a.set(u.id, u), s[u.id] = !0;
    }), M(i, function(l) {
      a.set(l.id, l), o[l.id] = !0, s[l.id] = !0;
    }), a.each(function(l) {
      var u = l.coordinateSystem, c = [];
      M(u.getCartesians(), function(f, h) {
        (we(e, f.getAxis("x").model) >= 0 || we(n, f.getAxis("y").model) >= 0) && c.push(f);
      }), t.push({
        panelId: "grid--" + l.id,
        gridModel: l,
        coordSysModel: l,
        // Use the first one as the representitive coordSys.
        coordSys: c[0],
        coordSyses: c,
        getPanelRect: YC.grid,
        xAxisDeclared: o[l.id],
        yAxisDeclared: s[l.id]
      });
    }));
  },
  geo: function(r, t) {
    M(r.geoModels, function(e) {
      var n = e.coordinateSystem;
      t.push({
        panelId: "geo--" + e.id,
        geoModel: e,
        coordSysModel: e,
        coordSys: n,
        coordSyses: [n],
        getPanelRect: YC.geo
      });
    });
  }
}, UC = [
  // grid
  function(r, t) {
    var e = r.xAxisModel, n = r.yAxisModel, i = r.gridModel;
    return !i && e && (i = e.axis.grid.model), !i && n && (i = n.axis.grid.model), i && i === t.gridModel;
  },
  // geo
  function(r, t) {
    var e = r.geoModel;
    return e && e === t.geoModel;
  }
], YC = {
  grid: function() {
    return this.coordSys.master.getRect().clone();
  },
  geo: function() {
    var r = this.coordSys, t = r.getBoundingRect().clone();
    return t.applyTransform(oo(r)), t;
  }
}, og = {
  lineX: ye(ZC, 0),
  lineY: ye(ZC, 1),
  rect: function(r, t, e, n) {
    var i = r ? t.pointToData([e[0][0], e[1][0]], n) : t.dataToPoint([e[0][0], e[1][0]], n), a = r ? t.pointToData([e[0][1], e[1][1]], n) : t.dataToPoint([e[0][1], e[1][1]], n), o = [hy([i[0], a[0]]), hy([i[1], a[1]])];
    return {
      values: o,
      xyMinMax: o
    };
  },
  polygon: function(r, t, e, n) {
    var i = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]], a = U(e, function(o) {
      var s = r ? t.pointToData(o, n) : t.dataToPoint(o, n);
      return i[0][0] = Math.min(i[0][0], s[0]), i[1][0] = Math.min(i[1][0], s[1]), i[0][1] = Math.max(i[0][1], s[0]), i[1][1] = Math.max(i[1][1], s[1]), s;
    });
    return {
      values: a,
      xyMinMax: i
    };
  }
};
function ZC(r, t, e, n) {
  var i = e.getAxis(["x", "y"][r]), a = hy(U([0, 1], function(s) {
    return t ? i.coordToData(i.toLocalCoord(n[s]), !0) : i.toGlobalCoord(i.dataToCoord(n[s]));
  })), o = [];
  return o[r] = a, o[1 - r] = [NaN, NaN], {
    values: a,
    xyMinMax: o
  };
}
var XC = {
  lineX: ye(jC, 0),
  lineY: ye(jC, 1),
  rect: function(r, t, e) {
    return [[r[0][0] - e[0] * t[0][0], r[0][1] - e[0] * t[0][1]], [r[1][0] - e[1] * t[1][0], r[1][1] - e[1] * t[1][1]]];
  },
  polygon: function(r, t, e) {
    return U(r, function(n, i) {
      return [n[0] - e[0] * t[i][0], n[1] - e[1] * t[i][1]];
    });
  }
};
function jC(r, t, e, n) {
  return [t[0] - n[r] * e[0], t[1] - n[r] * e[1]];
}
function HX(r, t) {
  var e = KC(r), n = KC(t), i = [e[0] / n[0], e[1] / n[1]];
  return isNaN(i[0]) && (i[0] = 1), isNaN(i[1]) && (i[1] = 1), i;
}
function KC(r) {
  return r ? [r[0][1] - r[0][0], r[1][1] - r[1][0]] : [NaN, NaN];
}
var vy = M, qX = QB("toolbox-dataZoom_"), WX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.render = function(e, n, i, a) {
      this._brushController || (this._brushController = new m_(i.getZr()), this._brushController.on("brush", Q(this._onBrush, this)).mount()), ZX(e, n, this, a, i), YX(e, n);
    }, t.prototype.onclick = function(e, n, i) {
      UX[i].call(this);
    }, t.prototype.remove = function(e, n) {
      this._brushController && this._brushController.unmount();
    }, t.prototype.dispose = function(e, n) {
      this._brushController && this._brushController.dispose();
    }, t.prototype._onBrush = function(e) {
      var n = e.areas;
      if (!e.isEnd || !n.length)
        return;
      var i = {}, a = this.ecModel;
      this._brushController.updateCovers([]);
      var o = new q_(W_(this.model), a, {
        include: ["grid"]
      });
      o.matchOutputRanges(n, a, function(u, c, f) {
        if (f.type === "cartesian2d") {
          var h = u.brushType;
          h === "rect" ? (s("x", f, c[0]), s("y", f, c[1])) : s({
            lineX: "x",
            lineY: "y"
          }[h], f, c);
        }
      }), FX(a, i), this._dispatchZoomAction(i);
      function s(u, c, f) {
        var h = c.getAxis(u), v = h.model, d = l(u, v, a), p = d.findRepresentativeAxisProxy(v).getMinMaxSpan();
        (p.minValueSpan != null || p.maxValueSpan != null) && (f = Mo(0, f.slice(), h.scale.getExtent(), 0, p.minValueSpan, p.maxValueSpan)), d && (i[d.id] = {
          dataZoomId: d.id,
          startValue: f[0],
          endValue: f[1]
        });
      }
      function l(u, c, f) {
        var h;
        return f.eachComponent({
          mainType: "dataZoom",
          subType: "select"
        }, function(v) {
          var d = v.getAxisModel(u, c.componentIndex);
          d && (h = v);
        }), h;
      }
    }, t.prototype._dispatchZoomAction = function(e) {
      var n = [];
      vy(e, function(i, a) {
        n.push(ce(i));
      }), n.length && this.api.dispatchAction({
        type: "dataZoom",
        from: this.uid,
        batch: n
      });
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        filterMode: "filter",
        // Icon group
        icon: {
          zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
          back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
        },
        // `zoom`, `back`
        title: e.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
        brushStyle: {
          borderWidth: 0,
          color: "rgba(210,219,238,0.2)"
        }
      };
      return n;
    }, t;
  }(zr)
), UX = {
  zoom: function() {
    var r = !this._isZoomActive;
    this.api.dispatchAction({
      type: "takeGlobalCursor",
      key: "dataZoomSelect",
      dataZoomSelectActive: r
    });
  },
  back: function() {
    this._dispatchZoomAction(BX(this.ecModel));
  }
};
function W_(r) {
  var t = {
    xAxisIndex: r.get("xAxisIndex", !0),
    yAxisIndex: r.get("yAxisIndex", !0),
    xAxisId: r.get("xAxisId", !0),
    yAxisId: r.get("yAxisId", !0)
  };
  return t.xAxisIndex == null && t.xAxisId == null && (t.xAxisIndex = "all"), t.yAxisIndex == null && t.yAxisId == null && (t.yAxisIndex = "all"), t;
}
function YX(r, t) {
  r.setIconStatus("back", zX(t) > 1 ? "emphasis" : "normal");
}
function ZX(r, t, e, n, i) {
  var a = e._isZoomActive;
  n && n.type === "takeGlobalCursor" && (a = n.key === "dataZoomSelect" ? n.dataZoomSelectActive : !1), e._isZoomActive = a, r.setIconStatus("zoom", a ? "emphasis" : "normal");
  var o = new q_(W_(r), t, {
    include: ["grid"]
  }), s = o.makePanelOpts(i, function(l) {
    return l.xAxisDeclared && !l.yAxisDeclared ? "lineX" : !l.xAxisDeclared && l.yAxisDeclared ? "lineY" : "rect";
  });
  e._brushController.setPanels(s).enableBrush(a && s.length ? {
    brushType: "auto",
    brushStyle: r.getModel("brushStyle").getItemStyle()
  } : !1);
}
wV("dataZoom", function(r) {
  var t = r.getComponent("toolbox", 0), e = ["feature", "dataZoom"];
  if (!t || t.get(e) == null)
    return;
  var n = t.getModel(e), i = [], a = W_(n), o = Yl(r, a);
  vy(o.xAxisModels, function(l) {
    return s(l, "xAxis", "xAxisIndex");
  }), vy(o.yAxisModels, function(l) {
    return s(l, "yAxis", "yAxisIndex");
  });
  function s(l, u, c) {
    var f = l.componentIndex, h = {
      type: "select",
      $fromToolbox: !0,
      // Default to be filter
      filterMode: n.get("filterMode", !0) || "filter",
      // Id for merge mapping.
      id: qX + u + f
    };
    h[c] = f, i.push(h);
  }
  return i;
});
function XX(r) {
  r.registerComponentModel(_X), r.registerComponentView(SX), is("saveAsImage", wX), is("magicType", AX), is("dataView", RX), is("dataZoom", WX), is("restore", VX), De(yX);
}
var jX = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "tooltip", t.dependencies = ["axisPointer"], t.defaultOption = {
      // zlevel: 0,
      z: 60,
      show: !0,
      // tooltip main content
      showContent: !0,
      // 'trigger' only works on coordinate system.
      // 'item' | 'axis' | 'none'
      trigger: "item",
      // 'click' | 'mousemove' | 'none'
      triggerOn: "mousemove|click",
      alwaysShowContent: !1,
      displayMode: "single",
      renderMode: "auto",
      // whether restraint content inside viewRect.
      // If renderMode: 'richText', default true.
      // If renderMode: 'html', defaut false (for backward compat).
      confine: null,
      showDelay: 0,
      hideDelay: 100,
      // Animation transition time, unit is second
      transitionDuration: 0.4,
      enterable: !1,
      backgroundColor: "#fff",
      // box shadow
      shadowBlur: 10,
      shadowColor: "rgba(0, 0, 0, .2)",
      shadowOffsetX: 1,
      shadowOffsetY: 2,
      // tooltip border radius, unit is px, default is 4
      borderRadius: 4,
      // tooltip border width, unit is px, default is 0 (no border)
      borderWidth: 1,
      // Tooltip inside padding, default is 5 for all direction
      // Array is allowed to set up, right, bottom, left, same with css
      // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
      padding: null,
      // Extra css text
      extraCssText: "",
      // axis indicator, trigger by axis
      axisPointer: {
        // default is line
        // legal values: 'line' | 'shadow' | 'cross'
        type: "line",
        // Valid when type is line, appoint tooltip line locate on which line. Optional
        // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
        // default is 'auto', chose the axis which type is category.
        // for multiply y axis, cartesian coord chose x axis, polar chose angle axis
        axis: "auto",
        animation: "auto",
        animationDurationUpdate: 200,
        animationEasingUpdate: "exponentialOut",
        crossStyle: {
          color: "#999",
          width: 1,
          type: "dashed",
          // TODO formatter
          textStyle: {}
        }
        // lineStyle and shadowStyle should not be specified here,
        // otherwise it will always override those styles on option.axisPointer.
      },
      textStyle: {
        color: "#666",
        fontSize: 14
      }
    }, t;
  }(Le)
);
function nk(r) {
  var t = r.get("confine");
  return t != null ? !!t : r.get("renderMode") === "richText";
}
function ik(r) {
  if (Ie.domSupported) {
    for (var t = document.documentElement.style, e = 0, n = r.length; e < n; e++)
      if (r[e] in t)
        return r[e];
  }
}
var ak = ik(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]), KX = ik(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
function ok(r, t) {
  if (!r)
    return t;
  t = NM(t, !0);
  var e = r.indexOf(t);
  return r = e === -1 ? t : "-" + r.slice(0, e) + "-" + t, r.toLowerCase();
}
function JX(r, t) {
  var e = r.currentStyle || document.defaultView && document.defaultView.getComputedStyle(r);
  return e ? e[t] : null;
}
var QX = ok(KX, "transition"), U_ = ok(ak, "transform"), ej = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (Ie.transform3dSupported ? "will-change:transform;" : "");
function tj(r) {
  return r = r === "left" ? "right" : r === "right" ? "left" : r === "top" ? "bottom" : "top", r;
}
function rj(r, t, e) {
  if (!J(e) || e === "inside")
    return "";
  var n = r.get("backgroundColor"), i = r.get("borderWidth");
  t = mo(t);
  var a = tj(e), o = Math.max(Math.round(i) * 1.5, 6), s = "", l = U_ + ":", u;
  we(["left", "right"], a) > -1 ? (s += "top:50%", l += "translateY(-50%) rotate(" + (u = a === "left" ? -225 : -45) + "deg)") : (s += "left:50%", l += "translateX(-50%) rotate(" + (u = a === "top" ? 225 : 45) + "deg)");
  var c = u * Math.PI / 180, f = o + i, h = f * Math.abs(Math.cos(c)) + f * Math.abs(Math.sin(c)), v = Math.round(((h - Math.SQRT2 * i) / 2 + Math.SQRT2 * i - (h - f) / 2) * 100) / 100;
  s += ";" + a + ":-" + v + "px";
  var d = t + " solid " + i + "px;", p = ["position:absolute;width:" + o + "px;height:" + o + "px;z-index:-1;", s + ";" + l + ";", "border-bottom:" + d, "border-right:" + d, "background-color:" + n + ";"];
  return '<div style="' + p.join("") + '"></div>';
}
function nj(r, t) {
  var e = "cubic-bezier(0.23,1,0.32,1)", n = " " + r / 2 + "s " + e, i = "opacity" + n + ",visibility" + n;
  return t || (n = " " + r + "s " + e, i += Ie.transformSupported ? "," + U_ + n : ",left" + n + ",top" + n), QX + ":" + i;
}
function JC(r, t, e) {
  var n = r.toFixed(0) + "px", i = t.toFixed(0) + "px";
  if (!Ie.transformSupported)
    return e ? "top:" + i + ";left:" + n + ";" : [["top", i], ["left", n]];
  var a = Ie.transform3dSupported, o = "translate" + (a ? "3d" : "") + "(" + n + "," + i + (a ? ",0" : "") + ")";
  return e ? "top:0;left:0;" + U_ + ":" + o + ";" : [["top", 0], ["left", 0], [ak, o]];
}
function ij(r) {
  var t = [], e = r.get("fontSize"), n = r.getTextColor();
  n && t.push("color:" + n), t.push("font:" + r.getFont());
  var i = me(r.get("lineHeight"), Math.round(e * 3 / 2));
  e && t.push("line-height:" + i + "px");
  var a = r.get("textShadowColor"), o = r.get("textShadowBlur") || 0, s = r.get("textShadowOffsetX") || 0, l = r.get("textShadowOffsetY") || 0;
  return a && o && t.push("text-shadow:" + s + "px " + l + "px " + o + "px " + a), M(["decoration", "align"], function(u) {
    var c = r.get(u);
    c && t.push("text-" + u + ":" + c);
  }), t.join(";");
}
function aj(r, t, e) {
  var n = [], i = r.get("transitionDuration"), a = r.get("backgroundColor"), o = r.get("shadowBlur"), s = r.get("shadowColor"), l = r.get("shadowOffsetX"), u = r.get("shadowOffsetY"), c = r.getModel("textStyle"), f = yI(r, "html"), h = l + "px " + u + "px " + o + "px " + s;
  return n.push("box-shadow:" + h), t && i && n.push(nj(i, e)), a && n.push("background-color:" + a), M(["width", "color", "radius"], function(v) {
    var d = "border-" + v, p = NM(d), g = r.get(p);
    g != null && n.push(d + ":" + g + (v === "color" ? "" : "px"));
  }), n.push(ij(c)), f != null && n.push("padding:" + Fs(f).join("px ") + "px"), n.join(";") + ";";
}
function QC(r, t, e, n, i) {
  var a = t && t.painter;
  if (e) {
    var o = a && a.getViewportRoot();
    o && E3(r, o, e, n, i);
  } else {
    r[0] = n, r[1] = i;
    var s = a && a.getViewportRootOffset();
    s && (r[0] += s.offsetLeft, r[1] += s.offsetTop);
  }
  r[2] = r[0] / t.getWidth(), r[3] = r[1] / t.getHeight();
}
var oj = (
  /** @class */
  function() {
    function r(t, e) {
      if (this._show = !1, this._styleCoord = [0, 0, 0, 0], this._enterable = !0, this._alwaysShowContent = !1, this._firstShow = !0, this._longHide = !0, Ie.wxa)
        return null;
      var n = document.createElement("div");
      n.domBelongToZr = !0, this.el = n;
      var i = this._zr = t.getZr(), a = e.appendTo, o = a && (J(a) ? document.querySelector(a) : gs(a) ? a : oe(a) && a(t.getDom()));
      QC(this._styleCoord, i, o, t.getWidth() / 2, t.getHeight() / 2), (o || t.getDom()).appendChild(n), this._api = t, this._container = o;
      var s = this;
      n.onmouseenter = function() {
        s._enterable && (clearTimeout(s._hideTimeout), s._show = !0), s._inContent = !0;
      }, n.onmousemove = function(l) {
        if (l = l || window.event, !s._enterable) {
          var u = i.handler, c = i.painter.getViewportRoot();
          Rr(c, l, !0), u.dispatch("mousemove", l);
        }
      }, n.onmouseleave = function() {
        s._inContent = !1, s._enterable && s._show && s.hideLater(s._hideDelay);
      };
    }
    return r.prototype.update = function(t) {
      if (!this._container) {
        var e = this._api.getDom(), n = JX(e, "position"), i = e.style;
        i.position !== "absolute" && n !== "absolute" && (i.position = "relative");
      }
      var a = t.get("alwaysShowContent");
      a && this._moveIfResized(), this._alwaysShowContent = a, this.el.className = t.get("className") || "";
    }, r.prototype.show = function(t, e) {
      clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
      var n = this.el, i = n.style, a = this._styleCoord;
      n.innerHTML ? i.cssText = ej + aj(t, !this._firstShow, this._longHide) + JC(a[0], a[1], !0) + ("border-color:" + mo(e) + ";") + (t.get("extraCssText") || "") + (";pointer-events:" + (this._enterable ? "auto" : "none")) : i.display = "none", this._show = !0, this._firstShow = !1, this._longHide = !1;
    }, r.prototype.setContent = function(t, e, n, i, a) {
      var o = this.el;
      if (t == null) {
        o.innerHTML = "";
        return;
      }
      var s = "";
      if (J(a) && n.get("trigger") === "item" && !nk(n) && (s = rj(n, i, a)), J(t))
        o.innerHTML = t + s;
      else if (t) {
        o.innerHTML = "", q(t) || (t = [t]);
        for (var l = 0; l < t.length; l++)
          gs(t[l]) && t[l].parentNode !== o && o.appendChild(t[l]);
        if (s && o.childNodes.length) {
          var u = document.createElement("div");
          u.innerHTML = s, o.appendChild(u);
        }
      }
    }, r.prototype.setEnterable = function(t) {
      this._enterable = t;
    }, r.prototype.getSize = function() {
      var t = this.el;
      return t ? [t.offsetWidth, t.offsetHeight] : [0, 0];
    }, r.prototype.moveTo = function(t, e) {
      if (this.el) {
        var n = this._styleCoord;
        if (QC(n, this._zr, this._container, t, e), n[0] != null && n[1] != null) {
          var i = this.el.style, a = JC(n[0], n[1]);
          M(a, function(o) {
            i[o[0]] = o[1];
          });
        }
      }
    }, r.prototype._moveIfResized = function() {
      var t = this._styleCoord[2], e = this._styleCoord[3];
      this.moveTo(t * this._zr.getWidth(), e * this._zr.getHeight());
    }, r.prototype.hide = function() {
      var t = this, e = this.el.style;
      e.visibility = "hidden", e.opacity = "0", Ie.transform3dSupported && (e.willChange = ""), this._show = !1, this._longHideTimeout = setTimeout(function() {
        return t._longHide = !0;
      }, 500);
    }, r.prototype.hideLater = function(t) {
      this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (t ? (this._hideDelay = t, this._show = !1, this._hideTimeout = setTimeout(Q(this.hide, this), t)) : this.hide());
    }, r.prototype.isShow = function() {
      return this._show;
    }, r.prototype.dispose = function() {
      clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
      var t = this.el.parentNode;
      t && t.removeChild(this.el), this.el = this._container = null;
    }, r;
  }()
), sj = (
  /** @class */
  function() {
    function r(t) {
      this._show = !1, this._styleCoord = [0, 0, 0, 0], this._alwaysShowContent = !1, this._enterable = !0, this._zr = t.getZr(), tA(this._styleCoord, this._zr, t.getWidth() / 2, t.getHeight() / 2);
    }
    return r.prototype.update = function(t) {
      var e = t.get("alwaysShowContent");
      e && this._moveIfResized(), this._alwaysShowContent = e;
    }, r.prototype.show = function() {
      this._hideTimeout && clearTimeout(this._hideTimeout), this.el.show(), this._show = !0;
    }, r.prototype.setContent = function(t, e, n, i, a) {
      var o = this;
      ue(t) && He(""), this.el && this._zr.remove(this.el);
      var s = n.getModel("textStyle");
      this.el = new Fe({
        style: {
          rich: e.richTextStyles,
          text: t,
          lineHeight: 22,
          borderWidth: 1,
          borderColor: i,
          textShadowColor: s.get("textShadowColor"),
          fill: n.get(["textStyle", "color"]),
          padding: yI(n, "richText"),
          verticalAlign: "top",
          align: "left"
        },
        z: n.get("z")
      }), M(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(u) {
        o.el.style[u] = n.get(u);
      }), M(["textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], function(u) {
        o.el.style[u] = s.get(u) || 0;
      }), this._zr.add(this.el);
      var l = this;
      this.el.on("mouseover", function() {
        l._enterable && (clearTimeout(l._hideTimeout), l._show = !0), l._inContent = !0;
      }), this.el.on("mouseout", function() {
        l._enterable && l._show && l.hideLater(l._hideDelay), l._inContent = !1;
      });
    }, r.prototype.setEnterable = function(t) {
      this._enterable = t;
    }, r.prototype.getSize = function() {
      var t = this.el, e = this.el.getBoundingRect(), n = eA(t.style);
      return [e.width + n.left + n.right, e.height + n.top + n.bottom];
    }, r.prototype.moveTo = function(t, e) {
      var n = this.el;
      if (n) {
        var i = this._styleCoord;
        tA(i, this._zr, t, e), t = i[0], e = i[1];
        var a = n.style, o = Ii(a.borderWidth || 0), s = eA(a);
        n.x = t + o + s.left, n.y = e + o + s.top, n.markRedraw();
      }
    }, r.prototype._moveIfResized = function() {
      var t = this._styleCoord[2], e = this._styleCoord[3];
      this.moveTo(t * this._zr.getWidth(), e * this._zr.getHeight());
    }, r.prototype.hide = function() {
      this.el && this.el.hide(), this._show = !1;
    }, r.prototype.hideLater = function(t) {
      this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (t ? (this._hideDelay = t, this._show = !1, this._hideTimeout = setTimeout(Q(this.hide, this), t)) : this.hide());
    }, r.prototype.isShow = function() {
      return this._show;
    }, r.prototype.dispose = function() {
      this._zr.remove(this.el);
    }, r;
  }()
);
function Ii(r) {
  return Math.max(0, r);
}
function eA(r) {
  var t = Ii(r.shadowBlur || 0), e = Ii(r.shadowOffsetX || 0), n = Ii(r.shadowOffsetY || 0);
  return {
    left: Ii(t - e),
    right: Ii(t + e),
    top: Ii(t - n),
    bottom: Ii(t + n)
  };
}
function tA(r, t, e, n) {
  r[0] = e, r[1] = n, r[2] = r[0] / t.getWidth(), r[3] = r[1] / t.getHeight();
}
var lj = new ke({
  shape: {
    x: -1,
    y: -1,
    width: 2,
    height: 2
  }
}), uj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n) {
      if (!(Ie.node || !n.getDom())) {
        var i = e.getComponent("tooltip"), a = this._renderMode = oN(i.get("renderMode"));
        this._tooltipContent = a === "richText" ? new sj(n) : new oj(n, {
          appendTo: i.get("appendToBody", !0) ? "body" : i.get("appendTo", !0)
        });
      }
    }, t.prototype.render = function(e, n, i) {
      if (!(Ie.node || !i.getDom())) {
        this.group.removeAll(), this._tooltipModel = e, this._ecModel = n, this._api = i;
        var a = this._tooltipContent;
        a.update(e), a.setEnterable(e.get("enterable")), this._initGlobalListener(), this._keepShow(), this._renderMode !== "richText" && e.get("transitionDuration") ? Vs(this, "_updatePosition", 50, "fixRate") : xu(this, "_updatePosition");
      }
    }, t.prototype._initGlobalListener = function() {
      var e = this._tooltipModel, n = e.get("triggerOn");
      qP("itemTooltip", this._api, Q(function(i, a, o) {
        n !== "none" && (n.indexOf(i) >= 0 ? this._tryShow(a, o) : i === "leave" && this._hide(o));
      }, this));
    }, t.prototype._keepShow = function() {
      var e = this._tooltipModel, n = this._ecModel, i = this._api, a = e.get("triggerOn");
      if (this._lastX != null && this._lastY != null && a !== "none" && a !== "click") {
        var o = this;
        clearTimeout(this._refreshUpdateTimeout), this._refreshUpdateTimeout = setTimeout(function() {
          !i.isDisposed() && o.manuallyShowTip(e, n, i, {
            x: o._lastX,
            y: o._lastY,
            dataByCoordSys: o._lastDataByCoordSys
          });
        });
      }
    }, t.prototype.manuallyShowTip = function(e, n, i, a) {
      if (!(a.from === this.uid || Ie.node || !i.getDom())) {
        var o = rA(a, i);
        this._ticket = "";
        var s = a.dataByCoordSys, l = vj(a, n, i);
        if (l) {
          var u = l.el.getBoundingRect().clone();
          u.applyTransform(l.el.transform), this._tryShow({
            offsetX: u.x + u.width / 2,
            offsetY: u.y + u.height / 2,
            target: l.el,
            position: a.position,
            // When manully trigger, the mouse is not on the el, so we'd better to
            // position tooltip on the bottom of the el and display arrow is possible.
            positionDefault: "bottom"
          }, o);
        } else if (a.tooltip && a.x != null && a.y != null) {
          var c = lj;
          c.x = a.x, c.y = a.y, c.update(), pe(c).tooltipConfig = {
            name: null,
            option: a.tooltip
          }, this._tryShow({
            offsetX: a.x,
            offsetY: a.y,
            target: c
          }, o);
        } else if (s)
          this._tryShow({
            offsetX: a.x,
            offsetY: a.y,
            position: a.position,
            dataByCoordSys: s,
            tooltipOption: a.tooltipOption
          }, o);
        else if (a.seriesIndex != null) {
          if (this._manuallyAxisShowTip(e, n, i, a))
            return;
          var f = WP(a, n), h = f.point[0], v = f.point[1];
          h != null && v != null && this._tryShow({
            offsetX: h,
            offsetY: v,
            target: f.el,
            position: a.position,
            // When manully trigger, the mouse is not on the el, so we'd better to
            // position tooltip on the bottom of the el and display arrow is possible.
            positionDefault: "bottom"
          }, o);
        } else a.x != null && a.y != null && (i.dispatchAction({
          type: "updateAxisPointer",
          x: a.x,
          y: a.y
        }), this._tryShow({
          offsetX: a.x,
          offsetY: a.y,
          position: a.position,
          target: i.getZr().findHover(a.x, a.y).target
        }, o));
      }
    }, t.prototype.manuallyHideTip = function(e, n, i, a) {
      var o = this._tooltipContent;
      this._tooltipModel && o.hideLater(this._tooltipModel.get("hideDelay")), this._lastX = this._lastY = this._lastDataByCoordSys = null, a.from !== this.uid && this._hide(rA(a, i));
    }, t.prototype._manuallyAxisShowTip = function(e, n, i, a) {
      var o = a.seriesIndex, s = a.dataIndex, l = n.getComponent("axisPointer").coordSysAxesInfo;
      if (!(o == null || s == null || l == null)) {
        var u = n.getSeriesByIndex(o);
        if (u) {
          var c = u.getData(), f = bl([c.getItemModel(s), u, (u.coordinateSystem || {}).model], this._tooltipModel);
          if (f.get("trigger") === "axis")
            return i.dispatchAction({
              type: "updateAxisPointer",
              seriesIndex: o,
              dataIndex: s,
              position: a.position
            }), !0;
        }
      }
    }, t.prototype._tryShow = function(e, n) {
      var i = e.target, a = this._tooltipModel;
      if (a) {
        this._lastX = e.offsetX, this._lastY = e.offsetY;
        var o = e.dataByCoordSys;
        if (o && o.length)
          this._showAxisTooltip(o, e);
        else if (i) {
          var s = pe(i);
          if (s.ssrType === "legend")
            return;
          this._lastDataByCoordSys = null;
          var l, u;
          Xa(i, function(c) {
            if (pe(c).dataIndex != null)
              return l = c, !0;
            if (pe(c).tooltipConfig != null)
              return u = c, !0;
          }, !0), l ? this._showSeriesItemTooltip(e, l, n) : u ? this._showComponentItemTooltip(e, u, n) : this._hide(n);
        } else
          this._lastDataByCoordSys = null, this._hide(n);
      }
    }, t.prototype._showOrMove = function(e, n) {
      var i = e.get("showDelay");
      n = Q(n, this), clearTimeout(this._showTimout), i > 0 ? this._showTimout = setTimeout(n, i) : n();
    }, t.prototype._showAxisTooltip = function(e, n) {
      var i = this._ecModel, a = this._tooltipModel, o = [n.offsetX, n.offsetY], s = bl([n.tooltipOption], a), l = this._renderMode, u = [], c = It("section", {
        blocks: [],
        noHeader: !0
      }), f = [], h = new Wd();
      M(e, function(y) {
        M(y.dataByAxis, function(_) {
          var b = i.getComponent(_.axisDim + "Axis", _.axisIndex), S = _.value;
          if (!(!b || S == null)) {
            var x = $P(S, b.axis, i, _.seriesDataIndices, _.valueLabelOpt), w = It("section", {
              header: x,
              noHeader: !tn(x),
              sortBlocks: !0,
              blocks: []
            });
            c.blocks.push(w), M(_.seriesDataIndices, function(C) {
              var D = i.getSeriesByIndex(C.seriesIndex), A = C.dataIndexInside, T = D.getDataParams(A);
              if (!(T.dataIndex < 0)) {
                T.axisDim = _.axisDim, T.axisIndex = _.axisIndex, T.axisType = _.axisType, T.axisId = _.axisId, T.axisValue = W0(b.axis, {
                  value: S
                }), T.axisValueLabel = x, T.marker = h.makeTooltipMarker("item", mo(T.color), l);
                var L = $S(D.formatTooltip(A, !0, null)), E = L.frag;
                if (E) {
                  var I = bl([D], a).get("valueFormatter");
                  w.blocks.push(I ? H({
                    valueFormatter: I
                  }, E) : E);
                }
                L.text && f.push(L.text), u.push(T);
              }
            });
          }
        });
      }), c.blocks.reverse(), f.reverse();
      var v = n.position, d = s.get("order"), p = YS(c, h, l, d, i.get("useUTC"), s.get("textStyle"));
      p && f.unshift(p);
      var g = l === "richText" ? `

` : "<br/>", m = f.join(g);
      this._showOrMove(s, function() {
        this._updateContentNotChangedOnAxis(e, u) ? this._updatePosition(s, v, o[0], o[1], this._tooltipContent, u) : this._showTooltipContent(s, m, u, Math.random() + "", o[0], o[1], v, null, h);
      });
    }, t.prototype._showSeriesItemTooltip = function(e, n, i) {
      var a = this._ecModel, o = pe(n), s = o.seriesIndex, l = a.getSeriesByIndex(s), u = o.dataModel || l, c = o.dataIndex, f = o.dataType, h = u.getData(f), v = this._renderMode, d = e.positionDefault, p = bl([h.getItemModel(c), u, l && (l.coordinateSystem || {}).model], this._tooltipModel, d ? {
        position: d
      } : null), g = p.get("trigger");
      if (!(g != null && g !== "item")) {
        var m = u.getDataParams(c, f), y = new Wd();
        m.marker = y.makeTooltipMarker("item", mo(m.color), v);
        var _ = $S(u.formatTooltip(c, !1, f)), b = p.get("order"), S = p.get("valueFormatter"), x = _.frag, w = x ? YS(S ? H({
          valueFormatter: S
        }, x) : x, y, v, b, a.get("useUTC"), p.get("textStyle")) : _.text, C = "item_" + u.name + "_" + c;
        this._showOrMove(p, function() {
          this._showTooltipContent(p, w, m, C, e.offsetX, e.offsetY, e.position, e.target, y);
        }), i({
          type: "showTip",
          dataIndexInside: c,
          dataIndex: h.getRawIndex(c),
          seriesIndex: s,
          from: this.uid
        });
      }
    }, t.prototype._showComponentItemTooltip = function(e, n, i) {
      var a = this._renderMode === "html", o = pe(n), s = o.tooltipConfig, l = s.option || {}, u = l.encodeHTMLContent;
      if (J(l)) {
        var c = l;
        l = {
          content: c,
          // Fixed formatter
          formatter: c
        }, u = !0;
      }
      u && a && l.content && (l = ce(l), l.content = Jt(l.content));
      var f = [l], h = this._ecModel.getComponent(o.componentMainType, o.componentIndex);
      h && f.push(h), f.push({
        formatter: l.content
      });
      var v = e.positionDefault, d = bl(f, this._tooltipModel, v ? {
        position: v
      } : null), p = d.get("content"), g = Math.random() + "", m = new Wd();
      this._showOrMove(d, function() {
        var y = ce(d.get("formatterParams") || {});
        this._showTooltipContent(d, p, y, g, e.offsetX, e.offsetY, e.position, n, m);
      }), i({
        type: "showTip",
        from: this.uid
      });
    }, t.prototype._showTooltipContent = function(e, n, i, a, o, s, l, u, c) {
      if (this._ticket = "", !(!e.get("showContent") || !e.get("show"))) {
        var f = this._tooltipContent;
        f.setEnterable(e.get("enterable"));
        var h = e.get("formatter");
        l = l || e.get("position");
        var v = n, d = this._getNearestPoint([o, s], i, e.get("trigger"), e.get("borderColor")), p = d.color;
        if (h)
          if (J(h)) {
            var g = e.ecModel.get("useUTC"), m = q(i) ? i[0] : i, y = m && m.axisType && m.axisType.indexOf("time") >= 0;
            v = h, y && (v = mv(m.axisValue, v, g)), v = zM(v, i, !0);
          } else if (oe(h)) {
            var _ = Q(function(b, S) {
              b === this._ticket && (f.setContent(S, c, e, p, l), this._updatePosition(e, l, o, s, f, i, u));
            }, this);
            this._ticket = a, v = h(i, a, _);
          } else
            v = h;
        f.setContent(v, c, e, p, l), f.show(e, p), this._updatePosition(e, l, o, s, f, i, u);
      }
    }, t.prototype._getNearestPoint = function(e, n, i, a) {
      if (i === "axis" || q(n))
        return {
          color: a || (this._renderMode === "html" ? "#fff" : "none")
        };
      if (!q(n))
        return {
          color: a || n.color || n.borderColor
        };
    }, t.prototype._updatePosition = function(e, n, i, a, o, s, l) {
      var u = this._api.getWidth(), c = this._api.getHeight();
      n = n || e.get("position");
      var f = o.getSize(), h = e.get("align"), v = e.get("verticalAlign"), d = l && l.getBoundingRect().clone();
      if (l && d.applyTransform(l.transform), oe(n) && (n = n([i, a], s, o.el, d, {
        viewSize: [u, c],
        contentSize: f.slice()
      })), q(n))
        i = X(n[0], u), a = X(n[1], c);
      else if (ue(n)) {
        var p = n;
        p.width = f[0], p.height = f[1];
        var g = St(p, {
          width: u,
          height: c
        });
        i = g.x, a = g.y, h = null, v = null;
      } else if (J(n) && l) {
        var m = hj(n, d, f, e.get("borderWidth"));
        i = m[0], a = m[1];
      } else {
        var m = cj(i, a, o, u, c, h ? null : 20, v ? null : 20);
        i = m[0], a = m[1];
      }
      if (h && (i -= nA(h) ? f[0] / 2 : h === "right" ? f[0] : 0), v && (a -= nA(v) ? f[1] / 2 : v === "bottom" ? f[1] : 0), nk(e)) {
        var m = fj(i, a, o, u, c);
        i = m[0], a = m[1];
      }
      o.moveTo(i, a);
    }, t.prototype._updateContentNotChangedOnAxis = function(e, n) {
      var i = this._lastDataByCoordSys, a = this._cbParamsList, o = !!i && i.length === e.length;
      return o && M(i, function(s, l) {
        var u = s.dataByAxis || [], c = e[l] || {}, f = c.dataByAxis || [];
        o = o && u.length === f.length, o && M(u, function(h, v) {
          var d = f[v] || {}, p = h.seriesDataIndices || [], g = d.seriesDataIndices || [];
          o = o && h.value === d.value && h.axisType === d.axisType && h.axisId === d.axisId && p.length === g.length, o && M(p, function(m, y) {
            var _ = g[y];
            o = o && m.seriesIndex === _.seriesIndex && m.dataIndex === _.dataIndex;
          }), a && M(h.seriesDataIndices, function(m) {
            var y = m.seriesIndex, _ = n[y], b = a[y];
            _ && b && b.data !== _.data && (o = !1);
          });
        });
      }), this._lastDataByCoordSys = e, this._cbParamsList = n, !!o;
    }, t.prototype._hide = function(e) {
      this._lastDataByCoordSys = null, e({
        type: "hideTip",
        from: this.uid
      });
    }, t.prototype.dispose = function(e, n) {
      Ie.node || !n.getDom() || (xu(this, "_updatePosition"), this._tooltipContent.dispose(), ly("itemTooltip", n));
    }, t.type = "tooltip", t;
  }(lt)
);
function bl(r, t, e) {
  var n = t.ecModel, i;
  e ? (i = new Ze(e, n, n), i = new Ze(t.option, i, n)) : i = t;
  for (var a = r.length - 1; a >= 0; a--) {
    var o = r[a];
    o && (o instanceof Ze && (o = o.get("tooltip", !0)), J(o) && (o = {
      formatter: o
    }), o && (i = new Ze(o, i, n)));
  }
  return i;
}
function rA(r, t) {
  return r.dispatchAction || Q(t.dispatchAction, t);
}
function cj(r, t, e, n, i, a, o) {
  var s = e.getSize(), l = s[0], u = s[1];
  return a != null && (r + l + a + 2 > n ? r -= l + a : r += a), o != null && (t + u + o > i ? t -= u + o : t += o), [r, t];
}
function fj(r, t, e, n, i) {
  var a = e.getSize(), o = a[0], s = a[1];
  return r = Math.min(r + o, n) - o, t = Math.min(t + s, i) - s, r = Math.max(r, 0), t = Math.max(t, 0), [r, t];
}
function hj(r, t, e, n) {
  var i = e[0], a = e[1], o = Math.ceil(Math.SQRT2 * n) + 8, s = 0, l = 0, u = t.width, c = t.height;
  switch (r) {
    case "inside":
      s = t.x + u / 2 - i / 2, l = t.y + c / 2 - a / 2;
      break;
    case "top":
      s = t.x + u / 2 - i / 2, l = t.y - a - o;
      break;
    case "bottom":
      s = t.x + u / 2 - i / 2, l = t.y + c + o;
      break;
    case "left":
      s = t.x - i - o, l = t.y + c / 2 - a / 2;
      break;
    case "right":
      s = t.x + u + o, l = t.y + c / 2 - a / 2;
  }
  return [s, l];
}
function nA(r) {
  return r === "center" || r === "middle";
}
function vj(r, t, e) {
  var n = a0(r).queryOptionMap, i = n.keys()[0];
  if (!(!i || i === "series")) {
    var a = $u(t, i, n.get(i), {
      useDefault: !1,
      enableAll: !1,
      enableNone: !1
    }), o = a.models[0];
    if (o) {
      var s = e.getViewOfComponentModel(o), l;
      if (s.group.traverse(function(u) {
        var c = pe(u).tooltipConfig;
        if (c && c.name === r.name)
          return l = u, !0;
      }), l)
        return {
          componentMainType: i,
          componentIndex: o.componentIndex,
          el: l
        };
    }
  }
}
function dj(r) {
  De(oc), r.registerComponentModel(jX), r.registerComponentView(uj), r.registerAction({
    type: "showTip",
    event: "showTip",
    update: "tooltip:manuallyShowTip"
  }, dt), r.registerAction({
    type: "hideTip",
    event: "hideTip",
    update: "tooltip:manuallyHideTip"
  }, dt);
}
var pj = ["rect", "polygon", "keep", "clear"];
function gj(r, t) {
  var e = je(r ? r.brush : []);
  if (e.length) {
    var n = [];
    M(e, function(l) {
      var u = l.hasOwnProperty("toolbox") ? l.toolbox : [];
      u instanceof Array && (n = n.concat(u));
    });
    var i = r && r.toolbox;
    q(i) && (i = i[0]), i || (i = {
      feature: {}
    }, r.toolbox = [i]);
    var a = i.feature || (i.feature = {}), o = a.brush || (a.brush = {}), s = o.type || (o.type = []);
    s.push.apply(s, n), mj(s), t && !s.length && s.push.apply(s, pj);
  }
}
function mj(r) {
  var t = {};
  M(r, function(e) {
    t[e] = 1;
  }), r.length = 0, M(t, function(e, n) {
    r.push(n);
  });
}
var iA = M;
function aA(r) {
  if (r) {
    for (var t in r)
      if (r.hasOwnProperty(t))
        return !0;
  }
}
function dy(r, t, e) {
  var n = {};
  return iA(t, function(a) {
    var o = n[a] = i();
    iA(r[a], function(s, l) {
      if (Dt.isValidType(l)) {
        var u = {
          type: l,
          visual: s
        };
        e && e(u, a), o[l] = new Dt(u), l === "opacity" && (u = ce(u), u.type = "colorAlpha", o.__hidden.__alphaForOpacity = new Dt(u));
      }
    });
  }), n;
  function i() {
    var a = function() {
    };
    a.prototype.__hidden = a.prototype;
    var o = new a();
    return o;
  }
}
function sk(r, t, e) {
  var n;
  M(e, function(i) {
    t.hasOwnProperty(i) && aA(t[i]) && (n = !0);
  }), n && M(e, function(i) {
    t.hasOwnProperty(i) && aA(t[i]) ? r[i] = ce(t[i]) : delete r[i];
  });
}
function yj(r, t, e, n, i, a) {
  var o = {};
  M(r, function(f) {
    var h = Dt.prepareVisualTypes(t[f]);
    o[f] = h;
  });
  var s;
  function l(f) {
    return R0(e, s, f);
  }
  function u(f, h) {
    MI(e, s, f, h);
  }
  e.each(c);
  function c(f, h) {
    s = f;
    var v = e.getRawDataItem(s);
    if (!(v && v.visualMap === !1))
      for (var d = n.call(i, f), p = t[d], g = o[d], m = 0, y = g.length; m < y; m++) {
        var _ = g[m];
        p[_] && p[_].applyVisual(f, l, u);
      }
  }
}
function _j(r, t, e, n) {
  var i = {};
  return M(r, function(a) {
    var o = Dt.prepareVisualTypes(t[a]);
    i[a] = o;
  }), {
    progress: function(o, s) {
      var l;
      n != null && (l = s.getDimensionIndex(n));
      function u(S) {
        return R0(s, f, S);
      }
      function c(S, x) {
        MI(s, f, S, x);
      }
      for (var f, h = s.getStore(); (f = o.next()) != null; ) {
        var v = s.getRawDataItem(f);
        if (!(v && v.visualMap === !1))
          for (var d = n != null ? h.get(l, f) : f, p = e(d), g = t[p], m = i[p], y = 0, _ = m.length; y < _; y++) {
            var b = m[y];
            g[b] && g[b].applyVisual(d, u, c);
          }
      }
    }
  };
}
function bj(r) {
  var t = r.brushType, e = {
    point: function(n) {
      return oA[t].point(n, e, r);
    },
    rect: function(n) {
      return oA[t].rect(n, e, r);
    }
  };
  return e;
}
var oA = {
  lineX: sA(0),
  lineY: sA(1),
  rect: {
    point: function(r, t, e) {
      return r && e.boundingRect.contain(r[0], r[1]);
    },
    rect: function(r, t, e) {
      return r && e.boundingRect.intersect(r);
    }
  },
  polygon: {
    point: function(r, t, e) {
      return r && e.boundingRect.contain(r[0], r[1]) && Va(e.range, r[0], r[1]);
    },
    rect: function(r, t, e) {
      var n = e.range;
      if (!r || n.length <= 1)
        return !1;
      var i = r.x, a = r.y, o = r.width, s = r.height, l = n[0];
      if (Va(n, i, a) || Va(n, i + o, a) || Va(n, i, a + s) || Va(n, i + o, a + s) || xe.create(r).contain(l[0], l[1]) || Pl(i, a, i + o, a, n) || Pl(i, a, i, a + s, n) || Pl(i + o, a, i + o, a + s, n) || Pl(i, a + s, i + o, a + s, n))
        return !0;
    }
  }
};
function sA(r) {
  var t = ["x", "y"], e = ["width", "height"];
  return {
    point: function(n, i, a) {
      if (n) {
        var o = a.range, s = n[r];
        return Sl(s, o);
      }
    },
    rect: function(n, i, a) {
      if (n) {
        var o = a.range, s = [n[t[r]], n[t[r]] + n[e[r]]];
        return s[1] < s[0] && s.reverse(), Sl(s[0], o) || Sl(s[1], o) || Sl(o[0], s) || Sl(o[1], s);
      }
    }
  };
}
function Sl(r, t) {
  return t[0] <= r && r <= t[1];
}
var lA = ["inBrush", "outOfBrush"], sg = "__ecBrushSelect", py = "__ecInBrushSelectEvent";
function lk(r) {
  r.eachComponent({
    mainType: "brush"
  }, function(t) {
    var e = t.brushTargetManager = new q_(t.option, r);
    e.setInputRanges(t.areas, r);
  });
}
function Sj(r, t, e) {
  var n = [], i, a;
  r.eachComponent({
    mainType: "brush"
  }, function(o) {
    e && e.type === "takeGlobalCursor" && o.setBrushOption(e.key === "brush" ? e.brushOption : {
      brushType: !1
    });
  }), lk(r), r.eachComponent({
    mainType: "brush"
  }, function(o, s) {
    var l = {
      brushId: o.id,
      brushIndex: s,
      brushName: o.name,
      areas: ce(o.areas),
      selected: []
    };
    n.push(l);
    var u = o.option, c = u.brushLink, f = [], h = [], v = [], d = !1;
    s || (i = u.throttleType, a = u.throttleDelay);
    var p = U(o.areas, function(S) {
      var x = Aj[S.brushType], w = se({
        boundingRect: x ? x(S) : void 0
      }, S);
      return w.selectors = bj(w), w;
    }), g = dy(o.option, lA, function(S) {
      S.mappingMethod = "fixed";
    });
    q(c) && M(c, function(S) {
      f[S] = 1;
    });
    function m(S) {
      return c === "all" || !!f[S];
    }
    function y(S) {
      return !!S.length;
    }
    r.eachSeries(function(S, x) {
      var w = v[x] = [];
      S.subType === "parallel" ? _(S, x) : b(S, x, w);
    });
    function _(S, x) {
      var w = S.coordinateSystem;
      d = d || w.hasAxisBrushed(), m(x) && w.eachActiveState(S.getData(), function(C, D) {
        C === "active" && (h[D] = 1);
      });
    }
    function b(S, x, w) {
      if (!(!S.brushSelector || Cj(o, x)) && (M(p, function(D) {
        o.brushTargetManager.controlSeries(D, S, r) && w.push(D), d = d || y(w);
      }), m(x) && y(w))) {
        var C = S.getData();
        C.each(function(D) {
          uA(S, w, C, D) && (h[D] = 1);
        });
      }
    }
    r.eachSeries(function(S, x) {
      var w = {
        seriesId: S.id,
        seriesIndex: x,
        seriesName: S.name,
        dataIndex: []
      };
      l.selected.push(w);
      var C = v[x], D = S.getData(), A = m(x) ? function(T) {
        return h[T] ? (w.dataIndex.push(D.getRawIndex(T)), "inBrush") : "outOfBrush";
      } : function(T) {
        return uA(S, C, D, T) ? (w.dataIndex.push(D.getRawIndex(T)), "inBrush") : "outOfBrush";
      };
      (m(x) ? d : y(C)) && yj(lA, g, D, A);
    });
  }), xj(t, i, a, n, e);
}
function xj(r, t, e, n, i) {
  if (i) {
    var a = r.getZr();
    if (!a[py]) {
      a[sg] || (a[sg] = wj);
      var o = Vs(a, sg, e, t);
      o(r, n);
    }
  }
}
function wj(r, t) {
  if (!r.isDisposed()) {
    var e = r.getZr();
    e[py] = !0, r.dispatchAction({
      type: "brushSelect",
      batch: t
    }), e[py] = !1;
  }
}
function uA(r, t, e, n) {
  for (var i = 0, a = t.length; i < a; i++) {
    var o = t[i];
    if (r.brushSelector(n, e, o.selectors, o))
      return !0;
  }
}
function Cj(r, t) {
  var e = r.option.seriesIndex;
  return e != null && e !== "all" && (q(e) ? we(e, t) < 0 : t !== e);
}
var Aj = {
  rect: function(r) {
    return cA(r.range);
  },
  polygon: function(r) {
    for (var t, e = r.range, n = 0, i = e.length; n < i; n++) {
      t = t || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
      var a = e[n];
      a[0] < t[0][0] && (t[0][0] = a[0]), a[0] > t[0][1] && (t[0][1] = a[0]), a[1] < t[1][0] && (t[1][0] = a[1]), a[1] > t[1][1] && (t[1][1] = a[1]);
    }
    return t && cA(t);
  }
};
function cA(r) {
  return new xe(r[0][0], r[1][0], r[0][1] - r[0][0], r[1][1] - r[1][0]);
}
var Dj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n) {
      this.ecModel = e, this.api = n, this.model, (this._brushController = new m_(n.getZr())).on("brush", Q(this._onBrush, this)).mount();
    }, t.prototype.render = function(e, n, i, a) {
      this.model = e, this._updateController(e, n, i, a);
    }, t.prototype.updateTransform = function(e, n, i, a) {
      lk(n), this._updateController(e, n, i, a);
    }, t.prototype.updateVisual = function(e, n, i, a) {
      this.updateTransform(e, n, i, a);
    }, t.prototype.updateView = function(e, n, i, a) {
      this._updateController(e, n, i, a);
    }, t.prototype._updateController = function(e, n, i, a) {
      (!a || a.$from !== e.id) && this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice());
    }, t.prototype.dispose = function() {
      this._brushController.dispose();
    }, t.prototype._onBrush = function(e) {
      var n = this.model.id, i = this.model.brushTargetManager.setOutputRanges(e.areas, this.ecModel);
      (!e.isEnd || e.removeOnClick) && this.api.dispatchAction({
        type: "brush",
        brushId: n,
        areas: ce(i),
        $from: n
      }), e.isEnd && this.api.dispatchAction({
        type: "brushEnd",
        brushId: n,
        areas: ce(i),
        $from: n
      });
    }, t.type = "brush", t;
  }(lt)
), Tj = "#ddd", Mj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.areas = [], e.brushOption = {}, e;
    }
    return t.prototype.optionUpdated = function(e, n) {
      var i = this.option;
      !n && sk(i, e, ["inBrush", "outOfBrush"]);
      var a = i.inBrush = i.inBrush || {};
      i.outOfBrush = i.outOfBrush || {
        color: Tj
      }, a.hasOwnProperty("liftZ") || (a.liftZ = 5);
    }, t.prototype.setAreas = function(e) {
      e && (this.areas = U(e, function(n) {
        return fA(this.option, n);
      }, this));
    }, t.prototype.setBrushOption = function(e) {
      this.brushOption = fA(this.option, e), this.brushType = this.brushOption.brushType;
    }, t.type = "brush", t.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"], t.defaultOption = {
      seriesIndex: "all",
      brushType: "rect",
      brushMode: "single",
      transformable: !0,
      brushStyle: {
        borderWidth: 1,
        color: "rgba(210,219,238,0.3)",
        borderColor: "#D2DBEE"
      },
      throttleType: "fixRate",
      throttleDelay: 0,
      removeOnClick: !0,
      z: 1e4
    }, t;
  }(Le)
);
function fA(r, t) {
  return _e({
    brushType: r.brushType,
    brushMode: r.brushMode,
    transformable: r.transformable,
    brushStyle: new Ze(r.brushStyle).getItemStyle(),
    removeOnClick: r.removeOnClick,
    z: r.z
  }, t, !0);
}
var Ij = ["rect", "polygon", "lineX", "lineY", "keep", "clear"], Lj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      return r !== null && r.apply(this, arguments) || this;
    }
    return t.prototype.render = function(e, n, i) {
      var a, o, s;
      n.eachComponent({
        mainType: "brush"
      }, function(l) {
        a = l.brushType, o = l.brushOption.brushMode || "single", s = s || !!l.areas.length;
      }), this._brushType = a, this._brushMode = o, M(e.get("type", !0), function(l) {
        e.setIconStatus(l, (l === "keep" ? o === "multiple" : l === "clear" ? s : l === a) ? "emphasis" : "normal");
      });
    }, t.prototype.updateView = function(e, n, i) {
      this.render(e, n, i);
    }, t.prototype.getIcons = function() {
      var e = this.model, n = e.get("icon", !0), i = {};
      return M(e.get("type", !0), function(a) {
        n[a] && (i[a] = n[a]);
      }), i;
    }, t.prototype.onclick = function(e, n, i) {
      var a = this._brushType, o = this._brushMode;
      i === "clear" ? (n.dispatchAction({
        type: "axisAreaSelect",
        intervals: []
      }), n.dispatchAction({
        type: "brush",
        command: "clear",
        // Clear all areas of all brush components.
        areas: []
      })) : n.dispatchAction({
        type: "takeGlobalCursor",
        key: "brush",
        brushOption: {
          brushType: i === "keep" ? a : a === i ? !1 : i,
          brushMode: i === "keep" ? o === "multiple" ? "single" : "multiple" : o
        }
      });
    }, t.getDefaultOption = function(e) {
      var n = {
        show: !0,
        type: Ij.slice(),
        icon: {
          /* eslint-disable */
          rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
          polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
          lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
          lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
          keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
          clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
          // jshint ignore:line
          /* eslint-enable */
        },
        // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
        title: e.getLocaleModel().get(["toolbox", "brush", "title"])
      };
      return n;
    }, t;
  }(zr)
);
function Ej(r) {
  r.registerComponentView(Dj), r.registerComponentModel(Mj), r.registerPreprocessor(gj), r.registerVisual(r.PRIORITY.VISUAL.BRUSH, Sj), r.registerAction({
    type: "brush",
    event: "brush",
    update: "updateVisual"
  }, function(t, e) {
    e.eachComponent({
      mainType: "brush",
      query: t
    }, function(n) {
      n.setAreas(t.areas);
    });
  }), r.registerAction({
    type: "brushSelect",
    event: "brushSelected",
    update: "none"
  }, dt), r.registerAction({
    type: "brushEnd",
    event: "brushEnd",
    update: "none"
  }, dt), is("brush", Lj);
}
var Pj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.layoutMode = {
        type: "box",
        ignoreSize: !0
      }, e;
    }
    return t.type = "title", t.defaultOption = {
      // zlevel: 0,
      z: 6,
      show: !0,
      text: "",
      target: "blank",
      subtext: "",
      subtarget: "blank",
      left: 0,
      top: 0,
      backgroundColor: "rgba(0,0,0,0)",
      borderColor: "#ccc",
      borderWidth: 0,
      padding: 5,
      itemGap: 10,
      textStyle: {
        fontSize: 18,
        fontWeight: "bold",
        color: "#464646"
      },
      subtextStyle: {
        fontSize: 12,
        color: "#6E7079"
      }
    }, t;
  }(Le)
), kj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.render = function(e, n, i) {
      if (this.group.removeAll(), !!e.get("show")) {
        var a = this.group, o = e.getModel("textStyle"), s = e.getModel("subtextStyle"), l = e.get("textAlign"), u = me(e.get("textBaseline"), e.get("textVerticalAlign")), c = new Fe({
          style: nt(o, {
            text: e.get("text"),
            fill: o.getTextColor()
          }, {
            disableBox: !0
          }),
          z2: 10
        }), f = c.getBoundingRect(), h = e.get("subtext"), v = new Fe({
          style: nt(s, {
            text: h,
            fill: s.getTextColor(),
            y: f.height + e.get("itemGap"),
            verticalAlign: "top"
          }, {
            disableBox: !0
          }),
          z2: 10
        }), d = e.get("link"), p = e.get("sublink"), g = e.get("triggerEvent", !0);
        c.silent = !d && !g, v.silent = !p && !g, d && c.on("click", function() {
          hh(d, "_" + e.get("target"));
        }), p && v.on("click", function() {
          hh(p, "_" + e.get("subtarget"));
        }), pe(c).eventData = pe(v).eventData = g ? {
          componentType: "title",
          componentIndex: e.componentIndex
        } : null, a.add(c), h && a.add(v);
        var m = a.getBoundingRect(), y = e.getBoxLayoutParams();
        y.width = m.width, y.height = m.height;
        var _ = St(y, {
          width: i.getWidth(),
          height: i.getHeight()
        }, e.get("padding"));
        l || (l = e.get("left") || e.get("right"), l === "middle" && (l = "center"), l === "right" ? _.x += _.width : l === "center" && (_.x += _.width / 2)), u || (u = e.get("top") || e.get("bottom"), u === "center" && (u = "middle"), u === "bottom" ? _.y += _.height : u === "middle" && (_.y += _.height / 2), u = u || "top"), a.x = _.x, a.y = _.y, a.markRedraw();
        var b = {
          align: l,
          verticalAlign: u
        };
        c.setStyle(b), v.setStyle(b), m = a.getBoundingRect();
        var S = _.margin, x = e.getItemStyle(["color", "opacity"]);
        x.fill = e.get("backgroundColor");
        var w = new ke({
          shape: {
            x: m.x - S[3],
            y: m.y - S[0],
            width: m.width + S[1] + S[3],
            height: m.height + S[0] + S[2],
            r: e.get("borderRadius")
          },
          style: x,
          subPixelOptimize: !0,
          silent: !0
        });
        a.add(w);
      }
    }, t.type = "title", t;
  }(lt)
);
function Rj(r) {
  r.registerComponentModel(Pj), r.registerComponentView(kj);
}
var hA = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.layoutMode = "box", e;
    }
    return t.prototype.init = function(e, n, i) {
      this.mergeDefaultAndTheme(e, i), this._initData();
    }, t.prototype.mergeOption = function(e) {
      r.prototype.mergeOption.apply(this, arguments), this._initData();
    }, t.prototype.setCurrentIndex = function(e) {
      e == null && (e = this.option.currentIndex);
      var n = this._data.count();
      this.option.loop ? e = (e % n + n) % n : (e >= n && (e = n - 1), e < 0 && (e = 0)), this.option.currentIndex = e;
    }, t.prototype.getCurrentIndex = function() {
      return this.option.currentIndex;
    }, t.prototype.isIndexMax = function() {
      return this.getCurrentIndex() >= this._data.count() - 1;
    }, t.prototype.setPlayState = function(e) {
      this.option.autoPlay = !!e;
    }, t.prototype.getPlayState = function() {
      return !!this.option.autoPlay;
    }, t.prototype._initData = function() {
      var e = this.option, n = e.data || [], i = e.axisType, a = this._names = [], o;
      i === "category" ? (o = [], M(n, function(u, c) {
        var f = bt(Es(u), ""), h;
        ue(u) ? (h = ce(u), h.value = c) : h = c, o.push(h), a.push(f);
      })) : o = n;
      var s = {
        category: "ordinal",
        time: "time",
        value: "number"
      }[i] || "number", l = this._data = new er([{
        name: "value",
        type: s
      }], this);
      l.initData(o, a);
    }, t.prototype.getData = function() {
      return this._data;
    }, t.prototype.getCategories = function() {
      if (this.get("axisType") === "category")
        return this._names.slice();
    }, t.type = "timeline", t.defaultOption = {
      // zlevel: 0,                  // 一级层叠
      z: 4,
      show: !0,
      axisType: "time",
      realtime: !0,
      left: "20%",
      top: null,
      right: "20%",
      bottom: 0,
      width: null,
      height: 40,
      padding: 5,
      controlPosition: "left",
      autoPlay: !1,
      rewind: !1,
      loop: !0,
      playInterval: 2e3,
      currentIndex: 0,
      itemStyle: {},
      label: {
        color: "#000"
      },
      data: []
    }, t;
  }(Le)
), uk = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "timeline.slider", t.defaultOption = la(hA.defaultOption, {
      backgroundColor: "rgba(0,0,0,0)",
      borderColor: "#ccc",
      borderWidth: 0,
      orient: "horizontal",
      inverse: !1,
      tooltip: {
        trigger: "item"
        // data item may also have tootip attr.
      },
      symbol: "circle",
      symbolSize: 12,
      lineStyle: {
        show: !0,
        width: 2,
        color: "#DAE1F5"
      },
      label: {
        position: "auto",
        // When using number, label position is not
        // restricted by viewRect.
        // positive: right/bottom, negative: left/top
        show: !0,
        interval: "auto",
        rotate: 0,
        // formatter: null,
        // 其余属性默认使用全局文本样式，详见TEXTSTYLE
        color: "#A4B1D7"
      },
      itemStyle: {
        color: "#A4B1D7",
        borderWidth: 1
      },
      checkpointStyle: {
        symbol: "circle",
        symbolSize: 15,
        color: "#316bf3",
        borderColor: "#fff",
        borderWidth: 2,
        shadowBlur: 2,
        shadowOffsetX: 1,
        shadowOffsetY: 1,
        shadowColor: "rgba(0, 0, 0, 0.3)",
        // borderColor: 'rgba(194,53,49, 0.5)',
        animation: !0,
        animationDuration: 300,
        animationEasing: "quinticInOut"
      },
      controlStyle: {
        show: !0,
        showPlayBtn: !0,
        showPrevBtn: !0,
        showNextBtn: !0,
        itemSize: 24,
        itemGap: 12,
        position: "left",
        playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
        stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
        // eslint-disable-next-line max-len
        nextIcon: "M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",
        // eslint-disable-next-line max-len
        prevIcon: "M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",
        prevBtnSize: 18,
        nextBtnSize: 18,
        color: "#A4B1D7",
        borderColor: "#A4B1D7",
        borderWidth: 1
      },
      emphasis: {
        label: {
          show: !0,
          // 其余属性默认使用全局文本样式，详见TEXTSTYLE
          color: "#6f778d"
        },
        itemStyle: {
          color: "#316BF3"
        },
        controlStyle: {
          color: "#316BF3",
          borderColor: "#316BF3",
          borderWidth: 2
        }
      },
      progress: {
        lineStyle: {
          color: "#316BF3"
        },
        itemStyle: {
          color: "#316BF3"
        },
        label: {
          color: "#6f778d"
        }
      },
      data: []
    }), t;
  }(hA)
);
_t(uk, Cv.prototype);
var Oj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "timeline", t;
  }(lt)
), Fj = (
  /** @class */
  function(r) {
    N(t, r);
    function t(e, n, i, a) {
      var o = r.call(this, e, n, i) || this;
      return o.type = a || "value", o;
    }
    return t.prototype.getLabelModel = function() {
      return this.model.getModel("label");
    }, t.prototype.isHorizontal = function() {
      return this.model.get("orient") === "horizontal";
    }, t;
  }(hn)
), lg = Math.PI, vA = Oe(), Bj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, n) {
      this.api = n;
    }, t.prototype.render = function(e, n, i) {
      if (this.model = e, this.api = i, this.ecModel = n, this.group.removeAll(), e.get("show", !0)) {
        var a = this._layout(e, i), o = this._createGroup("_mainGroup"), s = this._createGroup("_labelGroup"), l = this._axis = this._createAxis(a, e);
        e.formatTooltip = function(u) {
          var c = l.scale.getLabel({
            value: u
          });
          return It("nameValue", {
            noName: !0,
            value: c
          });
        }, M(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(u) {
          this["_render" + u](a, o, l, e);
        }, this), this._renderAxisLabel(a, s, l, e), this._position(a, e);
      }
      this._doPlayStop(), this._updateTicksStatus();
    }, t.prototype.remove = function() {
      this._clearTimer(), this.group.removeAll();
    }, t.prototype.dispose = function() {
      this._clearTimer();
    }, t.prototype._layout = function(e, n) {
      var i = e.get(["label", "position"]), a = e.get("orient"), o = zj(e, n), s;
      i == null || i === "auto" ? s = a === "horizontal" ? o.y + o.height / 2 < n.getHeight() / 2 ? "-" : "+" : o.x + o.width / 2 < n.getWidth() / 2 ? "+" : "-" : J(i) ? s = {
        horizontal: {
          top: "-",
          bottom: "+"
        },
        vertical: {
          left: "-",
          right: "+"
        }
      }[a][i] : s = i;
      var l = {
        horizontal: "center",
        vertical: s >= 0 || s === "+" ? "left" : "right"
      }, u = {
        horizontal: s >= 0 || s === "+" ? "top" : "bottom",
        vertical: "middle"
      }, c = {
        horizontal: 0,
        vertical: lg / 2
      }, f = a === "vertical" ? o.height : o.width, h = e.getModel("controlStyle"), v = h.get("show", !0), d = v ? h.get("itemSize") : 0, p = v ? h.get("itemGap") : 0, g = d + p, m = e.get(["label", "rotate"]) || 0;
      m = m * lg / 180;
      var y, _, b, S = h.get("position", !0), x = v && h.get("showPlayBtn", !0), w = v && h.get("showPrevBtn", !0), C = v && h.get("showNextBtn", !0), D = 0, A = f;
      S === "left" || S === "bottom" ? (x && (y = [0, 0], D += g), w && (_ = [D, 0], D += g), C && (b = [A - d, 0], A -= g)) : (x && (y = [A - d, 0], A -= g), w && (_ = [0, 0], D += g), C && (b = [A - d, 0], A -= g));
      var T = [D, A];
      return e.get("inverse") && T.reverse(), {
        viewRect: o,
        mainLength: f,
        orient: a,
        rotation: c[a],
        labelRotation: m,
        labelPosOpt: s,
        labelAlign: e.get(["label", "align"]) || l[a],
        labelBaseline: e.get(["label", "verticalAlign"]) || e.get(["label", "baseline"]) || u[a],
        // Based on mainGroup.
        playPosition: y,
        prevBtnPosition: _,
        nextBtnPosition: b,
        axisExtent: T,
        controlSize: d,
        controlGap: p
      };
    }, t.prototype._position = function(e, n) {
      var i = this._mainGroup, a = this._labelGroup, o = e.viewRect;
      if (e.orient === "vertical") {
        var s = Cr(), l = o.x, u = o.y + o.height;
        Rn(s, s, [-l, -u]), So(s, s, -lg / 2), Rn(s, s, [l, u]), o = o.clone(), o.applyTransform(s);
      }
      var c = y(o), f = y(i.getBoundingRect()), h = y(a.getBoundingRect()), v = [i.x, i.y], d = [a.x, a.y];
      d[0] = v[0] = c[0][0];
      var p = e.labelPosOpt;
      if (p == null || J(p)) {
        var g = p === "+" ? 0 : 1;
        _(v, f, c, 1, g), _(d, h, c, 1, 1 - g);
      } else {
        var g = p >= 0 ? 0 : 1;
        _(v, f, c, 1, g), d[1] = v[1] + p;
      }
      i.setPosition(v), a.setPosition(d), i.rotation = a.rotation = e.rotation, m(i), m(a);
      function m(b) {
        b.originX = c[0][0] - b.x, b.originY = c[1][0] - b.y;
      }
      function y(b) {
        return [[b.x, b.x + b.width], [b.y, b.y + b.height]];
      }
      function _(b, S, x, w, C) {
        b[w] += x[w][C] - S[w][C];
      }
    }, t.prototype._createAxis = function(e, n) {
      var i = n.getData(), a = n.get("axisType"), o = Nj(n, a);
      o.getTicks = function() {
        return i.mapArray(["value"], function(u) {
          return {
            value: u
          };
        });
      };
      var s = i.getDataExtent("value");
      o.setExtent(s[0], s[1]), o.calcNiceTicks();
      var l = new Fj("value", o, e.axisExtent, a);
      return l.model = n, l;
    }, t.prototype._createGroup = function(e) {
      var n = this[e] = new fe();
      return this.group.add(n), n;
    }, t.prototype._renderAxisLine = function(e, n, i, a) {
      var o = i.getExtent();
      if (a.get(["lineStyle", "show"])) {
        var s = new Ct({
          shape: {
            x1: o[0],
            y1: 0,
            x2: o[1],
            y2: 0
          },
          style: H({
            lineCap: "round"
          }, a.getModel("lineStyle").getLineStyle()),
          silent: !0,
          z2: 1
        });
        n.add(s);
        var l = this._progressLine = new Ct({
          shape: {
            x1: o[0],
            x2: this._currentPointer ? this._currentPointer.x : o[0],
            y1: 0,
            y2: 0
          },
          style: se({
            lineCap: "round",
            lineWidth: s.style.lineWidth
          }, a.getModel(["progress", "lineStyle"]).getLineStyle()),
          silent: !0,
          z2: 1
        });
        n.add(l);
      }
    }, t.prototype._renderAxisTick = function(e, n, i, a) {
      var o = this, s = a.getData(), l = i.scale.getTicks();
      this._tickSymbols = [], M(l, function(u) {
        var c = i.dataToCoord(u.value), f = s.getItemModel(u.value), h = f.getModel("itemStyle"), v = f.getModel(["emphasis", "itemStyle"]), d = f.getModel(["progress", "itemStyle"]), p = {
          x: c,
          y: 0,
          onclick: Q(o._changeTimeline, o, u.value)
        }, g = dA(f, h, n, p);
        g.ensureState("emphasis").style = v.getItemStyle(), g.ensureState("progress").style = d.getItemStyle(), ao(g);
        var m = pe(g);
        f.get("tooltip") ? (m.dataIndex = u.value, m.dataModel = a) : m.dataIndex = m.dataModel = null, o._tickSymbols.push(g);
      });
    }, t.prototype._renderAxisLabel = function(e, n, i, a) {
      var o = this, s = i.getLabelModel();
      if (s.get("show")) {
        var l = a.getData(), u = i.getViewLabels();
        this._tickLabels = [], M(u, function(c) {
          var f = c.tickValue, h = l.getItemModel(f), v = h.getModel("label"), d = h.getModel(["emphasis", "label"]), p = h.getModel(["progress", "label"]), g = i.dataToCoord(c.tickValue), m = new Fe({
            x: g,
            y: 0,
            rotation: e.labelRotation - e.rotation,
            onclick: Q(o._changeTimeline, o, f),
            silent: !1,
            style: nt(v, {
              text: c.formattedLabel,
              align: e.labelAlign,
              verticalAlign: e.labelBaseline
            })
          });
          m.ensureState("emphasis").style = nt(d), m.ensureState("progress").style = nt(p), n.add(m), ao(m), vA(m).dataIndex = f, o._tickLabels.push(m);
        });
      }
    }, t.prototype._renderControl = function(e, n, i, a) {
      var o = e.controlSize, s = e.rotation, l = a.getModel("controlStyle").getItemStyle(), u = a.getModel(["emphasis", "controlStyle"]).getItemStyle(), c = a.getPlayState(), f = a.get("inverse", !0);
      h(e.nextBtnPosition, "next", Q(this._changeTimeline, this, f ? "-" : "+")), h(e.prevBtnPosition, "prev", Q(this._changeTimeline, this, f ? "+" : "-")), h(e.playPosition, c ? "stop" : "play", Q(this._handlePlayClick, this, !c), !0);
      function h(v, d, p, g) {
        if (v) {
          var m = ln(me(a.get(["controlStyle", d + "BtnSize"]), o), o), y = [0, -m / 2, m, m], _ = Vj(a, d + "Icon", y, {
            x: v[0],
            y: v[1],
            originX: o / 2,
            originY: 0,
            rotation: g ? -s : 0,
            rectHover: !0,
            style: l,
            onclick: p
          });
          _.ensureState("emphasis").style = u, n.add(_), ao(_);
        }
      }
    }, t.prototype._renderCurrentPointer = function(e, n, i, a) {
      var o = a.getData(), s = a.getCurrentIndex(), l = o.getItemModel(s).getModel("checkpointStyle"), u = this, c = {
        onCreate: function(f) {
          f.draggable = !0, f.drift = Q(u._handlePointerDrag, u), f.ondragend = Q(u._handlePointerDragend, u), pA(f, u._progressLine, s, i, a, !0);
        },
        onUpdate: function(f) {
          pA(f, u._progressLine, s, i, a);
        }
      };
      this._currentPointer = dA(l, l, this._mainGroup, {}, this._currentPointer, c);
    }, t.prototype._handlePlayClick = function(e) {
      this._clearTimer(), this.api.dispatchAction({
        type: "timelinePlayChange",
        playState: e,
        from: this.uid
      });
    }, t.prototype._handlePointerDrag = function(e, n, i) {
      this._clearTimer(), this._pointerChangeTimeline([i.offsetX, i.offsetY]);
    }, t.prototype._handlePointerDragend = function(e) {
      this._pointerChangeTimeline([e.offsetX, e.offsetY], !0);
    }, t.prototype._pointerChangeTimeline = function(e, n) {
      var i = this._toAxisCoord(e)[0], a = this._axis, o = Gr(a.getExtent().slice());
      i > o[1] && (i = o[1]), i < o[0] && (i = o[0]), this._currentPointer.x = i, this._currentPointer.markRedraw();
      var s = this._progressLine;
      s && (s.shape.x2 = i, s.dirty());
      var l = this._findNearestTick(i), u = this.model;
      (n || l !== u.getCurrentIndex() && u.get("realtime")) && this._changeTimeline(l);
    }, t.prototype._doPlayStop = function() {
      var e = this;
      this._clearTimer(), this.model.getPlayState() && (this._timer = setTimeout(function() {
        var n = e.model;
        e._changeTimeline(n.getCurrentIndex() + (n.get("rewind", !0) ? -1 : 1));
      }, this.model.get("playInterval")));
    }, t.prototype._toAxisCoord = function(e) {
      var n = this._mainGroup.getLocalTransform();
      return an(e, n, !0);
    }, t.prototype._findNearestTick = function(e) {
      var n = this.model.getData(), i = 1 / 0, a, o = this._axis;
      return n.each(["value"], function(s, l) {
        var u = o.dataToCoord(s), c = Math.abs(u - e);
        c < i && (i = c, a = l);
      }), a;
    }, t.prototype._clearTimer = function() {
      this._timer && (clearTimeout(this._timer), this._timer = null);
    }, t.prototype._changeTimeline = function(e) {
      var n = this.model.getCurrentIndex();
      e === "+" ? e = n + 1 : e === "-" && (e = n - 1), this.api.dispatchAction({
        type: "timelineChange",
        currentIndex: e,
        from: this.uid
      });
    }, t.prototype._updateTicksStatus = function() {
      var e = this.model.getCurrentIndex(), n = this._tickSymbols, i = this._tickLabels;
      if (n)
        for (var a = 0; a < n.length; a++)
          n && n[a] && n[a].toggleState("progress", a < e);
      if (i)
        for (var a = 0; a < i.length; a++)
          i && i[a] && i[a].toggleState("progress", vA(i[a]).dataIndex <= e);
    }, t.type = "timeline.slider", t;
  }(Oj)
);
function Nj(r, t) {
  if (t = t || r.get("type"), t)
    switch (t) {
      case "category":
        return new Lv({
          ordinalMeta: r.getCategories(),
          extent: [1 / 0, -1 / 0]
        });
      case "time":
        return new H0({
          locale: r.ecModel.getLocaleModel(),
          useUTC: r.ecModel.get("useUTC")
        });
      default:
        return new ui();
    }
}
function zj(r, t) {
  return St(r.getBoxLayoutParams(), {
    width: t.getWidth(),
    height: t.getHeight()
  }, r.get("padding"));
}
function Vj(r, t, e, n) {
  var i = n.style, a = Yu(r.get(["controlStyle", t]), n || {}, new xe(e[0], e[1], e[2], e[3]));
  return i && a.setStyle(i), a;
}
function dA(r, t, e, n, i, a) {
  var o = t.get("color");
  if (i)
    i.setColor(o), e.add(i), a && a.onUpdate(i);
  else {
    var s = r.get("symbol");
    i = yt(s, -1, -1, 2, 2, o), i.setStyle("strokeNoScale", !0), e.add(i), a && a.onCreate(i);
  }
  var l = t.getItemStyle(["color"]);
  i.setStyle(l), n = _e({
    rectHover: !0,
    z2: 100
  }, n, !0);
  var u = $s(r.get("symbolSize"));
  n.scaleX = u[0] / 2, n.scaleY = u[1] / 2;
  var c = Co(r.get("symbolOffset"), u);
  c && (n.x = (n.x || 0) + c[0], n.y = (n.y || 0) + c[1]);
  var f = r.get("symbolRotate");
  return n.rotation = (f || 0) * Math.PI / 180 || 0, i.attr(n), i.updateTransform(), i;
}
function pA(r, t, e, n, i, a) {
  if (!r.dragging) {
    var o = i.getModel("checkpointStyle"), s = n.dataToCoord(i.getData().get("value", e));
    if (a || !o.get("animation", !0))
      r.attr({
        x: s,
        y: 0
      }), t && t.attr({
        shape: {
          x2: s
        }
      });
    else {
      var l = {
        duration: o.get("animationDuration", !0),
        easing: o.get("animationEasing", !0)
      };
      r.stopAnimation(null, !0), r.animateTo({
        x: s,
        y: 0
      }, l), t && t.animateTo({
        shape: {
          x2: s
        }
      }, l);
    }
  }
}
function $j(r) {
  r.registerAction({
    type: "timelineChange",
    event: "timelineChanged",
    update: "prepareAndUpdate"
  }, function(t, e, n) {
    var i = e.getComponent("timeline");
    return i && t.currentIndex != null && (i.setCurrentIndex(t.currentIndex), !i.get("loop", !0) && i.isIndexMax() && i.getPlayState() && (i.setPlayState(!1), n.dispatchAction({
      type: "timelinePlayChange",
      playState: !1,
      from: t.from
    }))), e.resetOption("timeline", {
      replaceMerge: i.get("replaceMerge", !0)
    }), se({
      currentIndex: i.option.currentIndex
    }, t);
  }), r.registerAction({
    type: "timelinePlayChange",
    event: "timelinePlayChanged",
    update: "update"
  }, function(t, e) {
    var n = e.getComponent("timeline");
    n && t.playState != null && n.setPlayState(t.playState);
  });
}
function Gj(r) {
  var t = r && r.timeline;
  q(t) || (t = t ? [t] : []), M(t, function(e) {
    e && Hj(e);
  });
}
function Hj(r) {
  var t = r.type, e = {
    number: "value",
    time: "time"
  };
  if (e[t] && (r.axisType = e[t], delete r.type), gA(r), Ha(r, "controlPosition")) {
    var n = r.controlStyle || (r.controlStyle = {});
    Ha(n, "position") || (n.position = r.controlPosition), n.position === "none" && !Ha(n, "show") && (n.show = !1, delete n.position), delete r.controlPosition;
  }
  M(r.data || [], function(i) {
    ue(i) && !q(i) && (!Ha(i, "value") && Ha(i, "name") && (i.value = i.name), gA(i));
  });
}
function gA(r) {
  var t = r.itemStyle || (r.itemStyle = {}), e = t.emphasis || (t.emphasis = {}), n = r.label || r.label || {}, i = n.normal || (n.normal = {}), a = {
    normal: 1,
    emphasis: 1
  };
  M(n, function(o, s) {
    !a[s] && !Ha(i, s) && (i[s] = o);
  }), e.label && !Ha(n, "emphasis") && (n.emphasis = e.label, delete e.label);
}
function Ha(r, t) {
  return r.hasOwnProperty(t);
}
function qj(r) {
  r.registerComponentModel(uk), r.registerComponentView(Bj), r.registerSubTypeDefaulter("timeline", function() {
    return "slider";
  }), $j(r), r.registerPreprocessor(Gj);
}
function Y_(r, t) {
  if (!r)
    return !1;
  for (var e = q(r) ? r : [r], n = 0; n < e.length; n++)
    if (e[n] && e[n][t])
      return !0;
  return !1;
}
function cf(r) {
  ho(r, "label", ["show"]);
}
var ff = Oe(), fi = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.createdBySelf = !1, e;
    }
    return t.prototype.init = function(e, n, i) {
      this.mergeDefaultAndTheme(e, i), this._mergeOption(e, i, !1, !0);
    }, t.prototype.isAnimationEnabled = function() {
      if (Ie.node)
        return !1;
      var e = this.__hostSeries;
      return this.getShallow("animation") && e && e.isAnimationEnabled();
    }, t.prototype.mergeOption = function(e, n) {
      this._mergeOption(e, n, !1, !1);
    }, t.prototype._mergeOption = function(e, n, i, a) {
      var o = this.mainType;
      i || n.eachSeries(function(s) {
        var l = s.get(this.mainType, !0), u = ff(s)[o];
        if (!l || !l.data) {
          ff(s)[o] = null;
          return;
        }
        u ? u._mergeOption(l, n, !0) : (a && cf(l), M(l.data, function(c) {
          c instanceof Array ? (cf(c[0]), cf(c[1])) : cf(c);
        }), u = this.createMarkerModelFromSeries(l, this, n), H(u, {
          mainType: this.mainType,
          // Use the same series index and name
          seriesIndex: s.seriesIndex,
          name: s.name,
          createdBySelf: !0
        }), u.__hostSeries = s), ff(s)[o] = u;
      }, this);
    }, t.prototype.formatTooltip = function(e, n, i) {
      var a = this.getData(), o = this.getRawValue(e), s = a.getName(e);
      return It("section", {
        header: this.name,
        blocks: [It("nameValue", {
          name: s,
          value: o,
          noName: !s,
          noValue: o == null
        })]
      });
    }, t.prototype.getData = function() {
      return this._data;
    }, t.prototype.setData = function(e) {
      this._data = e;
    }, t.prototype.getDataParams = function(e, n) {
      var i = Cv.prototype.getDataParams.call(this, e, n), a = this.__hostSeries;
      return a && (i.seriesId = a.id, i.seriesName = a.name, i.seriesType = a.subType), i;
    }, t.getMarkerModelFromSeries = function(e, n) {
      return ff(e)[n];
    }, t.type = "marker", t.dependencies = ["series", "grid", "polar", "geo"], t;
  }(Le)
);
_t(fi, Cv.prototype);
var Wj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.createMarkerModelFromSeries = function(e, n, i) {
      return new t(e, n, i);
    }, t.type = "markPoint", t.defaultOption = {
      // zlevel: 0,
      z: 5,
      symbol: "pin",
      symbolSize: 50,
      // symbolRotate: 0,
      // symbolOffset: [0, 0]
      tooltip: {
        trigger: "item"
      },
      label: {
        show: !0,
        position: "inside"
      },
      itemStyle: {
        borderWidth: 2
      },
      emphasis: {
        label: {
          show: !0
        }
      }
    }, t;
  }(fi)
);
function gy(r) {
  return !(isNaN(parseFloat(r.x)) && isNaN(parseFloat(r.y)));
}
function Uj(r) {
  return !isNaN(parseFloat(r.x)) && !isNaN(parseFloat(r.y));
}
function hf(r, t, e, n, i, a) {
  var o = [], s = ea(
    t,
    n
    /* , otherDataDim */
  ), l = s ? t.getCalculationInfo("stackResultDimension") : n, u = Z_(t, l, r), c = t.indicesOfNearest(l, u)[0];
  o[i] = t.get(e, c), o[a] = t.get(l, c);
  var f = t.get(n, c), h = Dn(t.get(n, c));
  return h = Math.min(h, 20), h >= 0 && (o[a] = +o[a].toFixed(h)), [o, f];
}
var ug = {
  min: ye(hf, "min"),
  max: ye(hf, "max"),
  average: ye(hf, "average"),
  median: ye(hf, "median")
};
function Fu(r, t) {
  if (t) {
    var e = r.getData(), n = r.coordinateSystem, i = n && n.dimensions;
    if (!Uj(t) && !q(t.coord) && q(i)) {
      var a = ck(t, e, n, r);
      if (t = ce(t), t.type && ug[t.type] && a.baseAxis && a.valueAxis) {
        var o = we(i, a.baseAxis.dim), s = we(i, a.valueAxis.dim), l = ug[t.type](e, a.baseDataDim, a.valueDataDim, o, s);
        t.coord = l[0], t.value = l[1];
      } else
        t.coord = [t.xAxis != null ? t.xAxis : t.radiusAxis, t.yAxis != null ? t.yAxis : t.angleAxis];
    }
    if (t.coord == null || !q(i))
      t.coord = [];
    else
      for (var u = t.coord, c = 0; c < 2; c++)
        ug[u[c]] && (u[c] = Z_(e, e.mapDimension(i[c]), u[c]));
    return t;
  }
}
function ck(r, t, e, n) {
  var i = {};
  return r.valueIndex != null || r.valueDim != null ? (i.valueDataDim = r.valueIndex != null ? t.getDimension(r.valueIndex) : r.valueDim, i.valueAxis = e.getAxis(Yj(n, i.valueDataDim)), i.baseAxis = e.getOtherAxis(i.valueAxis), i.baseDataDim = t.mapDimension(i.baseAxis.dim)) : (i.baseAxis = n.getBaseAxis(), i.valueAxis = e.getOtherAxis(i.baseAxis), i.baseDataDim = t.mapDimension(i.baseAxis.dim), i.valueDataDim = t.mapDimension(i.valueAxis.dim)), i;
}
function Yj(r, t) {
  var e = r.getData().getDimensionInfo(t);
  return e && e.coordDim;
}
function Bu(r, t) {
  return r && r.containData && t.coord && !gy(t) ? r.containData(t.coord) : !0;
}
function Zj(r, t, e) {
  return r && r.containZone && t.coord && e.coord && !gy(t) && !gy(e) ? r.containZone(t.coord, e.coord) : !0;
}
function fk(r, t) {
  return r ? function(e, n, i, a) {
    var o = a < 2 ? e.coord && e.coord[a] : e.value;
    return Yi(o, t[a]);
  } : function(e, n, i, a) {
    return Yi(e.value, t[a]);
  };
}
function Z_(r, t, e) {
  if (e === "average") {
    var n = 0, i = 0;
    return r.each(t, function(a, o) {
      isNaN(a) || (n += a, i++);
    }), n / i;
  } else return e === "median" ? r.getMedian(t) : r.getDataExtent(t)[e === "max" ? 1 : 0];
}
var cg = Oe(), X_ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function() {
      this.markerGroupMap = re();
    }, t.prototype.render = function(e, n, i) {
      var a = this, o = this.markerGroupMap;
      o.each(function(s) {
        cg(s).keep = !1;
      }), n.eachSeries(function(s) {
        var l = fi.getMarkerModelFromSeries(s, a.type);
        l && a.renderSeries(s, l, n, i);
      }), o.each(function(s) {
        !cg(s).keep && a.group.remove(s.group);
      });
    }, t.prototype.markKeep = function(e) {
      cg(e).keep = !0;
    }, t.prototype.toggleBlurSeries = function(e, n) {
      var i = this;
      M(e, function(a) {
        var o = fi.getMarkerModelFromSeries(a, i.type);
        if (o) {
          var s = o.getData();
          s.eachItemGraphicEl(function(l) {
            l && (n ? tM(l) : h0(l));
          });
        }
      });
    }, t.type = "marker", t;
  }(lt)
);
function mA(r, t, e) {
  var n = t.coordinateSystem;
  r.each(function(i) {
    var a = r.getItemModel(i), o, s = X(a.get("x"), e.getWidth()), l = X(a.get("y"), e.getHeight());
    if (!isNaN(s) && !isNaN(l))
      o = [s, l];
    else if (t.getMarkerPosition)
      o = t.getMarkerPosition(r.getValues(r.dimensions, i));
    else if (n) {
      var u = r.get(n.dimensions[0], i), c = r.get(n.dimensions[1], i);
      o = n.dataToPoint([u, c]);
    }
    isNaN(s) || (o[0] = s), isNaN(l) || (o[1] = l), r.setItemLayout(i, o);
  });
}
var Xj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.updateTransform = function(e, n, i) {
      n.eachSeries(function(a) {
        var o = fi.getMarkerModelFromSeries(a, "markPoint");
        o && (mA(o.getData(), a, i), this.markerGroupMap.get(a.id).updateLayout());
      }, this);
    }, t.prototype.renderSeries = function(e, n, i, a) {
      var o = e.coordinateSystem, s = e.id, l = e.getData(), u = this.markerGroupMap, c = u.get(s) || u.set(s, new Qu()), f = jj(o, e, n);
      n.setData(f), mA(n.getData(), e, a), f.each(function(h) {
        var v = f.getItemModel(h), d = v.getShallow("symbol"), p = v.getShallow("symbolSize"), g = v.getShallow("symbolRotate"), m = v.getShallow("symbolOffset"), y = v.getShallow("symbolKeepAspect");
        if (oe(d) || oe(p) || oe(g) || oe(m)) {
          var _ = n.getRawValue(h), b = n.getDataParams(h);
          oe(d) && (d = d(_, b)), oe(p) && (p = p(_, b)), oe(g) && (g = g(_, b)), oe(m) && (m = m(_, b));
        }
        var S = v.getModel("itemStyle").getItemStyle(), x = Xu(l, "color");
        S.fill || (S.fill = x), f.setItemVisual(h, {
          symbol: d,
          symbolSize: p,
          symbolRotate: g,
          symbolOffset: m,
          symbolKeepAspect: y,
          style: S
        });
      }), c.updateData(f), this.group.add(c.group), f.eachItemGraphicEl(function(h) {
        h.traverse(function(v) {
          pe(v).dataModel = n;
        });
      }), this.markKeep(c), c.group.silent = n.get("silent") || e.get("silent");
    }, t.type = "markPoint", t;
  }(X_)
);
function jj(r, t, e) {
  var n;
  r ? n = U(r && r.dimensions, function(s) {
    var l = t.getData().getDimensionInfo(t.getData().mapDimension(s)) || {};
    return H(H({}, l), {
      name: s,
      // DON'T use ordinalMeta to parse and collect ordinal.
      ordinalMeta: null
    });
  }) : n = [{
    name: "value",
    type: "float"
  }];
  var i = new er(n, e), a = U(e.get("data"), ye(Fu, t));
  r && (a = qe(a, ye(Bu, r)));
  var o = fk(!!r, n);
  return i.initData(a, null, o), i;
}
function Kj(r) {
  r.registerComponentModel(Wj), r.registerComponentView(Xj), r.registerPreprocessor(function(t) {
    Y_(t.series, "markPoint") && (t.markPoint = t.markPoint || {});
  });
}
var Jj = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.createMarkerModelFromSeries = function(e, n, i) {
      return new t(e, n, i);
    }, t.type = "markLine", t.defaultOption = {
      // zlevel: 0,
      z: 5,
      symbol: ["circle", "arrow"],
      symbolSize: [8, 16],
      // symbolRotate: 0,
      symbolOffset: 0,
      precision: 2,
      tooltip: {
        trigger: "item"
      },
      label: {
        show: !0,
        position: "end",
        distance: 5
      },
      lineStyle: {
        type: "dashed"
      },
      emphasis: {
        label: {
          show: !0
        },
        lineStyle: {
          width: 3
        }
      },
      animationEasing: "linear"
    }, t;
  }(fi)
), vf = Oe(), Qj = function(r, t, e, n) {
  var i = r.getData(), a;
  if (q(n))
    a = n;
  else {
    var o = n.type;
    if (o === "min" || o === "max" || o === "average" || o === "median" || n.xAxis != null || n.yAxis != null) {
      var s = void 0, l = void 0;
      if (n.yAxis != null || n.xAxis != null)
        s = t.getAxis(n.yAxis != null ? "y" : "x"), l = Et(n.yAxis, n.xAxis);
      else {
        var u = ck(n, i, t, r);
        s = u.valueAxis;
        var c = nL(i, u.valueDataDim);
        l = Z_(i, c, o);
      }
      var f = s.dim === "x" ? 0 : 1, h = 1 - f, v = ce(n), d = {
        coord: []
      };
      v.type = null, v.coord = [], v.coord[h] = -1 / 0, d.coord[h] = 1 / 0;
      var p = e.get("precision");
      p >= 0 && Be(l) && (l = +l.toFixed(Math.min(p, 20))), v.coord[f] = d.coord[f] = l, a = [v, d, {
        type: o,
        valueIndex: n.valueIndex,
        // Force to use the value of calculated value.
        value: l
      }];
    } else
      a = [];
  }
  var g = [Fu(r, a[0]), Fu(r, a[1]), H({}, a[2])];
  return g[2].type = g[2].type || null, _e(g[2], g[0]), _e(g[2], g[1]), g;
};
function Bh(r) {
  return !isNaN(r) && !isFinite(r);
}
function yA(r, t, e, n) {
  var i = 1 - r, a = n.dimensions[r];
  return Bh(t[i]) && Bh(e[i]) && t[r] === e[r] && n.getAxis(a).containData(t[r]);
}
function eK(r, t) {
  if (r.type === "cartesian2d") {
    var e = t[0].coord, n = t[1].coord;
    if (e && n && (yA(1, e, n, r) || yA(0, e, n, r)))
      return !0;
  }
  return Bu(r, t[0]) && Bu(r, t[1]);
}
function fg(r, t, e, n, i) {
  var a = n.coordinateSystem, o = r.getItemModel(t), s, l = X(o.get("x"), i.getWidth()), u = X(o.get("y"), i.getHeight());
  if (!isNaN(l) && !isNaN(u))
    s = [l, u];
  else {
    if (n.getMarkerPosition)
      s = n.getMarkerPosition(r.getValues(r.dimensions, t));
    else {
      var c = a.dimensions, f = r.get(c[0], t), h = r.get(c[1], t);
      s = a.dataToPoint([f, h]);
    }
    if (Do(a, "cartesian2d")) {
      var v = a.getAxis("x"), d = a.getAxis("y"), c = a.dimensions;
      Bh(r.get(c[0], t)) ? s[0] = v.toGlobalCoord(v.getExtent()[e ? 0 : 1]) : Bh(r.get(c[1], t)) && (s[1] = d.toGlobalCoord(d.getExtent()[e ? 0 : 1]));
    }
    isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
  }
  r.setItemLayout(t, s);
}
var tK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.updateTransform = function(e, n, i) {
      n.eachSeries(function(a) {
        var o = fi.getMarkerModelFromSeries(a, "markLine");
        if (o) {
          var s = o.getData(), l = vf(o).from, u = vf(o).to;
          l.each(function(c) {
            fg(l, c, !0, a, i), fg(u, c, !1, a, i);
          }), s.each(function(c) {
            s.setItemLayout(c, [l.getItemLayout(c), u.getItemLayout(c)]);
          }), this.markerGroupMap.get(a.id).updateLayout();
        }
      }, this);
    }, t.prototype.renderSeries = function(e, n, i, a) {
      var o = e.coordinateSystem, s = e.id, l = e.getData(), u = this.markerGroupMap, c = u.get(s) || u.set(s, new g_());
      this.group.add(c.group);
      var f = rK(o, e, n), h = f.from, v = f.to, d = f.line;
      vf(n).from = h, vf(n).to = v, n.setData(d);
      var p = n.get("symbol"), g = n.get("symbolSize"), m = n.get("symbolRotate"), y = n.get("symbolOffset");
      q(p) || (p = [p, p]), q(g) || (g = [g, g]), q(m) || (m = [m, m]), q(y) || (y = [y, y]), f.from.each(function(b) {
        _(h, b, !0), _(v, b, !1);
      }), d.each(function(b) {
        var S = d.getItemModel(b).getModel("lineStyle").getLineStyle();
        d.setItemLayout(b, [h.getItemLayout(b), v.getItemLayout(b)]), S.stroke == null && (S.stroke = h.getItemVisual(b, "style").fill), d.setItemVisual(b, {
          fromSymbolKeepAspect: h.getItemVisual(b, "symbolKeepAspect"),
          fromSymbolOffset: h.getItemVisual(b, "symbolOffset"),
          fromSymbolRotate: h.getItemVisual(b, "symbolRotate"),
          fromSymbolSize: h.getItemVisual(b, "symbolSize"),
          fromSymbol: h.getItemVisual(b, "symbol"),
          toSymbolKeepAspect: v.getItemVisual(b, "symbolKeepAspect"),
          toSymbolOffset: v.getItemVisual(b, "symbolOffset"),
          toSymbolRotate: v.getItemVisual(b, "symbolRotate"),
          toSymbolSize: v.getItemVisual(b, "symbolSize"),
          toSymbol: v.getItemVisual(b, "symbol"),
          style: S
        });
      }), c.updateData(d), f.line.eachItemGraphicEl(function(b) {
        pe(b).dataModel = n, b.traverse(function(S) {
          pe(S).dataModel = n;
        });
      });
      function _(b, S, x) {
        var w = b.getItemModel(S);
        fg(b, S, x, e, a);
        var C = w.getModel("itemStyle").getItemStyle();
        C.fill == null && (C.fill = Xu(l, "color")), b.setItemVisual(S, {
          symbolKeepAspect: w.get("symbolKeepAspect"),
          // `0` should be considered as a valid value, so use `retrieve2` instead of `||`
          symbolOffset: me(w.get("symbolOffset", !0), y[x ? 0 : 1]),
          symbolRotate: me(w.get("symbolRotate", !0), m[x ? 0 : 1]),
          // TODO: when 2d array is supported, it should ignore parent
          symbolSize: me(w.get("symbolSize"), g[x ? 0 : 1]),
          symbol: me(w.get("symbol", !0), p[x ? 0 : 1]),
          style: C
        });
      }
      this.markKeep(c), c.group.silent = n.get("silent") || e.get("silent");
    }, t.type = "markLine", t;
  }(X_)
);
function rK(r, t, e) {
  var n;
  r ? n = U(r && r.dimensions, function(u) {
    var c = t.getData().getDimensionInfo(t.getData().mapDimension(u)) || {};
    return H(H({}, c), {
      name: u,
      // DON'T use ordinalMeta to parse and collect ordinal.
      ordinalMeta: null
    });
  }) : n = [{
    name: "value",
    type: "float"
  }];
  var i = new er(n, e), a = new er(n, e), o = new er([], e), s = U(e.get("data"), ye(Qj, t, r, e));
  r && (s = qe(s, ye(eK, r)));
  var l = fk(!!r, n);
  return i.initData(U(s, function(u) {
    return u[0];
  }), null, l), a.initData(U(s, function(u) {
    return u[1];
  }), null, l), o.initData(U(s, function(u) {
    return u[2];
  })), o.hasItemOption = !0, {
    from: i,
    to: a,
    line: o
  };
}
function nK(r) {
  r.registerComponentModel(Jj), r.registerComponentView(tK), r.registerPreprocessor(function(t) {
    Y_(t.series, "markLine") && (t.markLine = t.markLine || {});
  });
}
var iK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.createMarkerModelFromSeries = function(e, n, i) {
      return new t(e, n, i);
    }, t.type = "markArea", t.defaultOption = {
      // zlevel: 0,
      // PENDING
      z: 1,
      tooltip: {
        trigger: "item"
      },
      // markArea should fixed on the coordinate system
      animation: !1,
      label: {
        show: !0,
        position: "top"
      },
      itemStyle: {
        // color and borderColor default to use color from series
        // color: 'auto'
        // borderColor: 'auto'
        borderWidth: 0
      },
      emphasis: {
        label: {
          show: !0,
          position: "top"
        }
      }
    }, t;
  }(fi)
), df = Oe(), aK = function(r, t, e, n) {
  var i = n[0], a = n[1];
  if (!(!i || !a)) {
    var o = Fu(r, i), s = Fu(r, a), l = o.coord, u = s.coord;
    l[0] = Et(l[0], -1 / 0), l[1] = Et(l[1], -1 / 0), u[0] = Et(u[0], 1 / 0), u[1] = Et(u[1], 1 / 0);
    var c = Zy([{}, o, s]);
    return c.coord = [o.coord, s.coord], c.x0 = o.x, c.y0 = o.y, c.x1 = s.x, c.y1 = s.y, c;
  }
};
function Nh(r) {
  return !isNaN(r) && !isFinite(r);
}
function _A(r, t, e, n) {
  var i = 1 - r;
  return Nh(t[i]) && Nh(e[i]);
}
function oK(r, t) {
  var e = t.coord[0], n = t.coord[1], i = {
    coord: e,
    x: t.x0,
    y: t.y0
  }, a = {
    coord: n,
    x: t.x1,
    y: t.y1
  };
  return Do(r, "cartesian2d") ? e && n && (_A(1, e, n) || _A(0, e, n)) ? !0 : Zj(r, i, a) : Bu(r, i) || Bu(r, a);
}
function bA(r, t, e, n, i) {
  var a = n.coordinateSystem, o = r.getItemModel(t), s, l = X(o.get(e[0]), i.getWidth()), u = X(o.get(e[1]), i.getHeight());
  if (!isNaN(l) && !isNaN(u))
    s = [l, u];
  else {
    if (n.getMarkerPosition) {
      var c = r.getValues(["x0", "y0"], t), f = r.getValues(["x1", "y1"], t), h = a.clampData(c), v = a.clampData(f), d = [];
      e[0] === "x0" ? d[0] = h[0] > v[0] ? f[0] : c[0] : d[0] = h[0] > v[0] ? c[0] : f[0], e[1] === "y0" ? d[1] = h[1] > v[1] ? f[1] : c[1] : d[1] = h[1] > v[1] ? c[1] : f[1], s = n.getMarkerPosition(d, e, !0);
    } else {
      var p = r.get(e[0], t), g = r.get(e[1], t), m = [p, g];
      a.clampData && a.clampData(m, m), s = a.dataToPoint(m, !0);
    }
    if (Do(a, "cartesian2d")) {
      var y = a.getAxis("x"), _ = a.getAxis("y"), p = r.get(e[0], t), g = r.get(e[1], t);
      Nh(p) ? s[0] = y.toGlobalCoord(y.getExtent()[e[0] === "x0" ? 0 : 1]) : Nh(g) && (s[1] = _.toGlobalCoord(_.getExtent()[e[1] === "y0" ? 0 : 1]));
    }
    isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
  }
  return s;
}
var SA = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]], sK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.updateTransform = function(e, n, i) {
      n.eachSeries(function(a) {
        var o = fi.getMarkerModelFromSeries(a, "markArea");
        if (o) {
          var s = o.getData();
          s.each(function(l) {
            var u = U(SA, function(f) {
              return bA(s, l, f, a, i);
            });
            s.setItemLayout(l, u);
            var c = s.getItemGraphicEl(l);
            c.setShape("points", u);
          });
        }
      }, this);
    }, t.prototype.renderSeries = function(e, n, i, a) {
      var o = e.coordinateSystem, s = e.id, l = e.getData(), u = this.markerGroupMap, c = u.get(s) || u.set(s, {
        group: new fe()
      });
      this.group.add(c.group), this.markKeep(c);
      var f = lK(o, e, n);
      n.setData(f), f.each(function(h) {
        var v = U(SA, function(C) {
          return bA(f, h, C, e, a);
        }), d = o.getAxis("x").scale, p = o.getAxis("y").scale, g = d.getExtent(), m = p.getExtent(), y = [d.parse(f.get("x0", h)), d.parse(f.get("x1", h))], _ = [p.parse(f.get("y0", h)), p.parse(f.get("y1", h))];
        Gr(y), Gr(_);
        var b = !(g[0] > y[1] || g[1] < y[0] || m[0] > _[1] || m[1] < _[0]), S = !b;
        f.setItemLayout(h, {
          points: v,
          allClipped: S
        });
        var x = f.getItemModel(h).getModel("itemStyle").getItemStyle(), w = Xu(l, "color");
        x.fill || (x.fill = w, J(x.fill) && (x.fill = eh(x.fill, 0.4))), x.stroke || (x.stroke = w), f.setItemVisual(h, "style", x);
      }), f.diff(df(c).data).add(function(h) {
        var v = f.getItemLayout(h);
        if (!v.allClipped) {
          var d = new ar({
            shape: {
              points: v.points
            }
          });
          f.setItemGraphicEl(h, d), c.group.add(d);
        }
      }).update(function(h, v) {
        var d = df(c).data.getItemGraphicEl(v), p = f.getItemLayout(h);
        p.allClipped ? d && c.group.remove(d) : (d ? Ne(d, {
          shape: {
            points: p.points
          }
        }, n, h) : d = new ar({
          shape: {
            points: p.points
          }
        }), f.setItemGraphicEl(h, d), c.group.add(d));
      }).remove(function(h) {
        var v = df(c).data.getItemGraphicEl(h);
        c.group.remove(v);
      }).execute(), f.eachItemGraphicEl(function(h, v) {
        var d = f.getItemModel(v), p = f.getItemVisual(v, "style");
        h.useStyle(f.getItemVisual(v, "style")), Bt(h, Mt(d), {
          labelFetcher: n,
          labelDataIndex: v,
          defaultText: f.getName(v) || "",
          inheritColor: J(p.fill) ? eh(p.fill, 1) : "#000"
        }), Ft(h, d), ut(h, null, null, d.get(["emphasis", "disabled"])), pe(h).dataModel = n;
      }), df(c).data = f, c.group.silent = n.get("silent") || e.get("silent");
    }, t.type = "markArea", t;
  }(X_)
);
function lK(r, t, e) {
  var n, i, a = ["x0", "y0", "x1", "y1"];
  if (r) {
    var o = U(r && r.dimensions, function(u) {
      var c = t.getData(), f = c.getDimensionInfo(c.mapDimension(u)) || {};
      return H(H({}, f), {
        name: u,
        // DON'T use ordinalMeta to parse and collect ordinal.
        ordinalMeta: null
      });
    });
    i = U(a, function(u, c) {
      return {
        name: u,
        type: o[c % 2].type
      };
    }), n = new er(i, e);
  } else
    i = [{
      name: "value",
      type: "float"
    }], n = new er(i, e);
  var s = U(e.get("data"), ye(aK, t, r, e));
  r && (s = qe(s, ye(oK, r)));
  var l = r ? function(u, c, f, h) {
    var v = u.coord[Math.floor(h / 2)][h % 2];
    return Yi(v, i[h]);
  } : function(u, c, f, h) {
    return Yi(u.value, i[h]);
  };
  return n.initData(s, null, l), n.hasItemOption = !0, n;
}
function uK(r) {
  r.registerComponentModel(iK), r.registerComponentView(sK), r.registerPreprocessor(function(t) {
    Y_(t.series, "markArea") && (t.markArea = t.markArea || {});
  });
}
var cK = function(r, t) {
  if (t === "all")
    return {
      type: "all",
      title: r.getLocaleModel().get(["legend", "selector", "all"])
    };
  if (t === "inverse")
    return {
      type: "inverse",
      title: r.getLocaleModel().get(["legend", "selector", "inverse"])
    };
}, my = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.layoutMode = {
        type: "box",
        // legend.width/height are maxWidth/maxHeight actually,
        // whereas real width/height is calculated by its content.
        // (Setting {left: 10, right: 10} does not make sense).
        // So consider the case:
        // `setOption({legend: {left: 10});`
        // then `setOption({legend: {right: 10});`
        // The previous `left` should be cleared by setting `ignoreSize`.
        ignoreSize: !0
      }, e;
    }
    return t.prototype.init = function(e, n, i) {
      this.mergeDefaultAndTheme(e, i), e.selected = e.selected || {}, this._updateSelector(e);
    }, t.prototype.mergeOption = function(e, n) {
      r.prototype.mergeOption.call(this, e, n), this._updateSelector(e);
    }, t.prototype._updateSelector = function(e) {
      var n = e.selector, i = this.ecModel;
      n === !0 && (n = e.selector = ["all", "inverse"]), q(n) && M(n, function(a, o) {
        J(a) && (a = {
          type: a
        }), n[o] = _e(a, cK(i, a.type));
      });
    }, t.prototype.optionUpdated = function() {
      this._updateData(this.ecModel);
      var e = this._data;
      if (e[0] && this.get("selectedMode") === "single") {
        for (var n = !1, i = 0; i < e.length; i++) {
          var a = e[i].get("name");
          if (this.isSelected(a)) {
            this.select(a), n = !0;
            break;
          }
        }
        !n && this.select(e[0].get("name"));
      }
    }, t.prototype._updateData = function(e) {
      var n = [], i = [];
      e.eachRawSeries(function(l) {
        var u = l.name;
        i.push(u);
        var c;
        if (l.legendVisualProvider) {
          var f = l.legendVisualProvider, h = f.getAllNames();
          e.isSeriesFiltered(l) || (i = i.concat(h)), h.length ? n = n.concat(h) : c = !0;
        } else
          c = !0;
        c && i0(l) && n.push(l.name);
      }), this._availableNames = i;
      var a = this.get("data") || n, o = re(), s = U(a, function(l) {
        return (J(l) || Be(l)) && (l = {
          name: l
        }), o.get(l.name) ? null : (o.set(l.name, !0), new Ze(l, this, this.ecModel));
      }, this);
      this._data = qe(s, function(l) {
        return !!l;
      });
    }, t.prototype.getData = function() {
      return this._data;
    }, t.prototype.select = function(e) {
      var n = this.option.selected, i = this.get("selectedMode");
      if (i === "single") {
        var a = this._data;
        M(a, function(o) {
          n[o.get("name")] = !1;
        });
      }
      n[e] = !0;
    }, t.prototype.unSelect = function(e) {
      this.get("selectedMode") !== "single" && (this.option.selected[e] = !1);
    }, t.prototype.toggleSelected = function(e) {
      var n = this.option.selected;
      n.hasOwnProperty(e) || (n[e] = !0), this[n[e] ? "unSelect" : "select"](e);
    }, t.prototype.allSelect = function() {
      var e = this._data, n = this.option.selected;
      M(e, function(i) {
        n[i.get("name", !0)] = !0;
      });
    }, t.prototype.inverseSelect = function() {
      var e = this._data, n = this.option.selected;
      M(e, function(i) {
        var a = i.get("name", !0);
        n.hasOwnProperty(a) || (n[a] = !0), n[a] = !n[a];
      });
    }, t.prototype.isSelected = function(e) {
      var n = this.option.selected;
      return !(n.hasOwnProperty(e) && !n[e]) && we(this._availableNames, e) >= 0;
    }, t.prototype.getOrient = function() {
      return this.get("orient") === "vertical" ? {
        index: 1,
        name: "vertical"
      } : {
        index: 0,
        name: "horizontal"
      };
    }, t.type = "legend.plain", t.dependencies = ["series"], t.defaultOption = {
      // zlevel: 0,
      z: 4,
      show: !0,
      orient: "horizontal",
      left: "center",
      // right: 'center',
      top: 0,
      // bottom: null,
      align: "auto",
      backgroundColor: "rgba(0,0,0,0)",
      borderColor: "#ccc",
      borderRadius: 0,
      borderWidth: 0,
      padding: 5,
      itemGap: 10,
      itemWidth: 25,
      itemHeight: 14,
      symbolRotate: "inherit",
      symbolKeepAspect: !0,
      inactiveColor: "#ccc",
      inactiveBorderColor: "#ccc",
      inactiveBorderWidth: "auto",
      itemStyle: {
        color: "inherit",
        opacity: "inherit",
        borderColor: "inherit",
        borderWidth: "auto",
        borderCap: "inherit",
        borderJoin: "inherit",
        borderDashOffset: "inherit",
        borderMiterLimit: "inherit"
      },
      lineStyle: {
        width: "auto",
        color: "inherit",
        inactiveColor: "#ccc",
        inactiveWidth: 2,
        opacity: "inherit",
        type: "inherit",
        cap: "inherit",
        join: "inherit",
        dashOffset: "inherit",
        miterLimit: "inherit"
      },
      textStyle: {
        color: "#333"
      },
      selectedMode: !0,
      selector: !1,
      selectorLabel: {
        show: !0,
        borderRadius: 10,
        padding: [3, 5, 3, 5],
        fontSize: 12,
        fontFamily: "sans-serif",
        color: "#666",
        borderWidth: 1,
        borderColor: "#666"
      },
      emphasis: {
        selectorLabel: {
          show: !0,
          color: "#eee",
          backgroundColor: "#666"
        }
      },
      selectorPosition: "auto",
      selectorItemGap: 7,
      selectorButtonGap: 10,
      tooltip: {
        show: !1
      }
    }, t;
  }(Le)
), Xo = ye, yy = M, pf = fe, hk = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.newlineDisabled = !1, e;
    }
    return t.prototype.init = function() {
      this.group.add(this._contentGroup = new pf()), this.group.add(this._selectorGroup = new pf()), this._isFirstRender = !0;
    }, t.prototype.getContentGroup = function() {
      return this._contentGroup;
    }, t.prototype.getSelectorGroup = function() {
      return this._selectorGroup;
    }, t.prototype.render = function(e, n, i) {
      var a = this._isFirstRender;
      if (this._isFirstRender = !1, this.resetInner(), !!e.get("show", !0)) {
        var o = e.get("align"), s = e.get("orient");
        (!o || o === "auto") && (o = e.get("left") === "right" && s === "vertical" ? "right" : "left");
        var l = e.get("selector", !0), u = e.get("selectorPosition", !0);
        l && (!u || u === "auto") && (u = s === "horizontal" ? "end" : "start"), this.renderInner(o, e, n, i, l, s, u);
        var c = e.getBoxLayoutParams(), f = {
          width: i.getWidth(),
          height: i.getHeight()
        }, h = e.get("padding"), v = St(c, f, h), d = this.layoutInner(e, o, v, a, l, u), p = St(se({
          width: d.width,
          height: d.height
        }, c), f, h);
        this.group.x = p.x - d.x, this.group.y = p.y - d.y, this.group.markRedraw(), this.group.add(this._backgroundEl = ek(d, e));
      }
    }, t.prototype.resetInner = function() {
      this.getContentGroup().removeAll(), this._backgroundEl && this.group.remove(this._backgroundEl), this.getSelectorGroup().removeAll();
    }, t.prototype.renderInner = function(e, n, i, a, o, s, l) {
      var u = this.getContentGroup(), c = re(), f = n.get("selectedMode"), h = [];
      i.eachRawSeries(function(v) {
        !v.get("legendHoverLink") && h.push(v.id);
      }), yy(n.getData(), function(v, d) {
        var p = v.get("name");
        if (!this.newlineDisabled && (p === "" || p === `
`)) {
          var g = new pf();
          g.newline = !0, u.add(g);
          return;
        }
        var m = i.getSeriesByName(p)[0];
        if (!c.get(p))
          if (m) {
            var y = m.getData(), _ = y.getVisual("legendLineStyle") || {}, b = y.getVisual("legendIcon"), S = y.getVisual("style"), x = this._createItem(m, p, d, v, n, e, _, S, b, f, a);
            x.on("click", Xo(xA, p, null, a, h)).on("mouseover", Xo(_y, m.name, null, a, h)).on("mouseout", Xo(by, m.name, null, a, h)), i.ssr && x.eachChild(function(w) {
              var C = pe(w);
              C.seriesIndex = m.seriesIndex, C.dataIndex = d, C.ssrType = "legend";
            }), c.set(p, !0);
          } else
            i.eachRawSeries(function(w) {
              if (!c.get(p) && w.legendVisualProvider) {
                var C = w.legendVisualProvider;
                if (!C.containName(p))
                  return;
                var D = C.indexOfName(p), A = C.getItemVisual(D, "style"), T = C.getItemVisual(D, "legendIcon"), L = Ar(A.fill);
                L && L[3] === 0 && (L[3] = 0.2, A = H(H({}, A), {
                  fill: ti(L, "rgba")
                }));
                var E = this._createItem(w, p, d, v, n, e, {}, A, T, f, a);
                E.on("click", Xo(xA, null, p, a, h)).on("mouseover", Xo(_y, null, p, a, h)).on("mouseout", Xo(by, null, p, a, h)), i.ssr && E.eachChild(function(I) {
                  var P = pe(I);
                  P.seriesIndex = w.seriesIndex, P.dataIndex = d, P.ssrType = "legend";
                }), c.set(p, !0);
              }
            }, this);
      }, this), o && this._createSelector(o, n, a, s, l);
    }, t.prototype._createSelector = function(e, n, i, a, o) {
      var s = this.getSelectorGroup();
      yy(e, function(u) {
        var c = u.type, f = new Fe({
          style: {
            x: 0,
            y: 0,
            align: "center",
            verticalAlign: "middle"
          },
          onclick: function() {
            i.dispatchAction({
              type: c === "all" ? "legendAllSelect" : "legendInverseSelect",
              legendId: n.id
            });
          }
        });
        s.add(f);
        var h = n.getModel("selectorLabel"), v = n.getModel(["emphasis", "selectorLabel"]);
        Bt(f, {
          normal: h,
          emphasis: v
        }, {
          defaultText: u.title
        }), ao(f);
      });
    }, t.prototype._createItem = function(e, n, i, a, o, s, l, u, c, f, h) {
      var v = e.visualDrawType, d = o.get("itemWidth"), p = o.get("itemHeight"), g = o.isSelected(n), m = a.get("symbolRotate"), y = a.get("symbolKeepAspect"), _ = a.get("icon");
      c = _ || c || "roundRect";
      var b = fK(c, a, l, u, v, g, h), S = new pf(), x = a.getModel("textStyle");
      if (oe(e.getLegendIcon) && (!_ || _ === "inherit"))
        S.add(e.getLegendIcon({
          itemWidth: d,
          itemHeight: p,
          icon: c,
          iconRotate: m,
          itemStyle: b.itemStyle,
          lineStyle: b.lineStyle,
          symbolKeepAspect: y
        }));
      else {
        var w = _ === "inherit" && e.getData().getVisual("symbol") ? m === "inherit" ? e.getData().getVisual("symbolRotate") : m : 0;
        S.add(hK({
          itemWidth: d,
          itemHeight: p,
          icon: c,
          iconRotate: w,
          itemStyle: b.itemStyle,
          symbolKeepAspect: y
        }));
      }
      var C = s === "left" ? d + 5 : -5, D = s, A = o.get("formatter"), T = n;
      J(A) && A ? T = A.replace("{name}", n ?? "") : oe(A) && (T = A(n));
      var L = g ? x.getTextColor() : a.get("inactiveColor");
      S.add(new Fe({
        style: nt(x, {
          text: T,
          x: C,
          y: p / 2,
          fill: L,
          align: D,
          verticalAlign: "middle"
        }, {
          inheritColor: L
        })
      }));
      var E = new ke({
        shape: S.getBoundingRect(),
        style: {
          // Cannot use 'invisible' because SVG SSR will miss the node
          fill: "transparent"
        }
      }), I = a.getModel("tooltip");
      return I.get("show") && xo({
        el: E,
        componentModel: o,
        itemName: n,
        itemTooltipOption: I.option
      }), S.add(E), S.eachChild(function(P) {
        P.silent = !0;
      }), E.silent = !f, this.getContentGroup().add(S), ao(S), S.__legendDataIndex = i, S;
    }, t.prototype.layoutInner = function(e, n, i, a, o, s) {
      var l = this.getContentGroup(), u = this.getSelectorGroup();
      so(e.get("orient"), l, e.get("itemGap"), i.width, i.height);
      var c = l.getBoundingRect(), f = [-c.x, -c.y];
      if (u.markRedraw(), l.markRedraw(), o) {
        so(
          // Buttons in selectorGroup always layout horizontally
          "horizontal",
          u,
          e.get("selectorItemGap", !0)
        );
        var h = u.getBoundingRect(), v = [-h.x, -h.y], d = e.get("selectorButtonGap", !0), p = e.getOrient().index, g = p === 0 ? "width" : "height", m = p === 0 ? "height" : "width", y = p === 0 ? "y" : "x";
        s === "end" ? v[p] += c[g] + d : f[p] += h[g] + d, v[1 - p] += c[m] / 2 - h[m] / 2, u.x = v[0], u.y = v[1], l.x = f[0], l.y = f[1];
        var _ = {
          x: 0,
          y: 0
        };
        return _[g] = c[g] + d + h[g], _[m] = Math.max(c[m], h[m]), _[y] = Math.min(0, h[y] + v[1 - p]), _;
      } else
        return l.x = f[0], l.y = f[1], this.group.getBoundingRect();
    }, t.prototype.remove = function() {
      this.getContentGroup().removeAll(), this._isFirstRender = !0;
    }, t.type = "legend.plain", t;
  }(lt)
);
function fK(r, t, e, n, i, a, o) {
  function s(g, m) {
    g.lineWidth === "auto" && (g.lineWidth = m.lineWidth > 0 ? 2 : 0), yy(g, function(y, _) {
      g[_] === "inherit" && (g[_] = m[_]);
    });
  }
  var l = t.getModel("itemStyle"), u = l.getItemStyle(), c = r.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke", f = l.getShallow("decal");
  u.decal = !f || f === "inherit" ? n.decal : bs(f, o), u.fill === "inherit" && (u.fill = n[i]), u.stroke === "inherit" && (u.stroke = n[c]), u.opacity === "inherit" && (u.opacity = (i === "fill" ? n : e).opacity), s(u, n);
  var h = t.getModel("lineStyle"), v = h.getLineStyle();
  if (s(v, e), u.fill === "auto" && (u.fill = n.fill), u.stroke === "auto" && (u.stroke = n.fill), v.stroke === "auto" && (v.stroke = n.fill), !a) {
    var d = t.get("inactiveBorderWidth"), p = u[c];
    u.lineWidth = d === "auto" ? n.lineWidth > 0 && p ? 2 : 0 : u.lineWidth, u.fill = t.get("inactiveColor"), u.stroke = t.get("inactiveBorderColor"), v.stroke = h.get("inactiveColor"), v.lineWidth = h.get("inactiveWidth");
  }
  return {
    itemStyle: u,
    lineStyle: v
  };
}
function hK(r) {
  var t = r.icon || "roundRect", e = yt(t, 0, 0, r.itemWidth, r.itemHeight, r.itemStyle.fill, r.symbolKeepAspect);
  return e.setStyle(r.itemStyle), e.rotation = (r.iconRotate || 0) * Math.PI / 180, e.setOrigin([r.itemWidth / 2, r.itemHeight / 2]), t.indexOf("empty") > -1 && (e.style.stroke = e.style.fill, e.style.fill = "#fff", e.style.lineWidth = 2), e;
}
function xA(r, t, e, n) {
  by(r, t, e, n), e.dispatchAction({
    type: "legendToggleSelect",
    name: r ?? t
  }), _y(r, t, e, n);
}
function vk(r) {
  for (var t = r.getZr().storage.getDisplayList(), e, n = 0, i = t.length; n < i && !(e = t[n].states.emphasis); )
    n++;
  return e && e.hoverLayer;
}
function _y(r, t, e, n) {
  vk(e) || e.dispatchAction({
    type: "highlight",
    seriesName: r,
    name: t,
    excludeSeriesId: n
  });
}
function by(r, t, e, n) {
  vk(e) || e.dispatchAction({
    type: "downplay",
    seriesName: r,
    name: t,
    excludeSeriesId: n
  });
}
function vK(r) {
  var t = r.findComponents({
    mainType: "legend"
  });
  t && t.length && r.filterSeries(function(e) {
    for (var n = 0; n < t.length; n++)
      if (!t[n].isSelected(e.name))
        return !1;
    return !0;
  });
}
function xl(r, t, e) {
  var n = r === "allSelect" || r === "inverseSelect", i = {}, a = [];
  e.eachComponent({
    mainType: "legend",
    query: t
  }, function(s) {
    n ? s[r]() : s[r](t.name), wA(s, i), a.push(s.componentIndex);
  });
  var o = {};
  return e.eachComponent("legend", function(s) {
    M(i, function(l, u) {
      s[l ? "select" : "unSelect"](u);
    }), wA(s, o);
  }), n ? {
    selected: o,
    // return legendIndex array to tell the developers which legends are allSelect / inverseSelect
    legendIndex: a
  } : {
    name: t.name,
    selected: o
  };
}
function wA(r, t) {
  var e = t || {};
  return M(r.getData(), function(n) {
    var i = n.get("name");
    if (!(i === `
` || i === "")) {
      var a = r.isSelected(i);
      te(e, i) ? e[i] = e[i] && a : e[i] = a;
    }
  }), e;
}
function dK(r) {
  r.registerAction("legendToggleSelect", "legendselectchanged", ye(xl, "toggleSelected")), r.registerAction("legendAllSelect", "legendselectall", ye(xl, "allSelect")), r.registerAction("legendInverseSelect", "legendinverseselect", ye(xl, "inverseSelect")), r.registerAction("legendSelect", "legendselected", ye(xl, "select")), r.registerAction("legendUnSelect", "legendunselected", ye(xl, "unSelect"));
}
function dk(r) {
  r.registerComponentModel(my), r.registerComponentView(hk), r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER, vK), r.registerSubTypeDefaulter("legend", function() {
    return "plain";
  }), dK(r);
}
var pK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.setScrollDataIndex = function(e) {
      this.option.scrollDataIndex = e;
    }, t.prototype.init = function(e, n, i) {
      var a = Bs(e);
      r.prototype.init.call(this, e, n, i), CA(this, e, a);
    }, t.prototype.mergeOption = function(e, n) {
      r.prototype.mergeOption.call(this, e, n), CA(this, this.option, e);
    }, t.type = "legend.scroll", t.defaultOption = la(my.defaultOption, {
      scrollDataIndex: 0,
      pageButtonItemGap: 5,
      pageButtonGap: null,
      pageButtonPosition: "end",
      pageFormatter: "{current}/{total}",
      pageIcons: {
        horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
        vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
      },
      pageIconColor: "#2f4554",
      pageIconInactiveColor: "#aaa",
      pageIconSize: 15,
      pageTextStyle: {
        color: "#333"
      },
      animationDurationUpdate: 800
    }), t;
  }(my)
);
function CA(r, t, e) {
  var n = r.getOrient(), i = [1, 1];
  i[n.index] = 0, Qi(t, e, {
    type: "box",
    ignoreSize: !!i
  });
}
var AA = fe, hg = ["width", "height"], vg = ["x", "y"], gK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.newlineDisabled = !0, e._currentIndex = 0, e;
    }
    return t.prototype.init = function() {
      r.prototype.init.call(this), this.group.add(this._containerGroup = new AA()), this._containerGroup.add(this.getContentGroup()), this.group.add(this._controllerGroup = new AA());
    }, t.prototype.resetInner = function() {
      r.prototype.resetInner.call(this), this._controllerGroup.removeAll(), this._containerGroup.removeClipPath(), this._containerGroup.__rectSize = null;
    }, t.prototype.renderInner = function(e, n, i, a, o, s, l) {
      var u = this;
      r.prototype.renderInner.call(this, e, n, i, a, o, s, l);
      var c = this._controllerGroup, f = n.get("pageIconSize", !0), h = q(f) ? f : [f, f];
      d("pagePrev", 0);
      var v = n.getModel("pageTextStyle");
      c.add(new Fe({
        name: "pageText",
        style: {
          // Placeholder to calculate a proper layout.
          text: "xx/xx",
          fill: v.getTextColor(),
          font: v.getFont(),
          verticalAlign: "middle",
          align: "center"
        },
        silent: !0
      })), d("pageNext", 1);
      function d(p, g) {
        var m = p + "DataIndex", y = Yu(n.get("pageIcons", !0)[n.getOrient().name][g], {
          // Buttons will be created in each render, so we do not need
          // to worry about avoiding using legendModel kept in scope.
          onclick: Q(u._pageGo, u, m, n, a)
        }, {
          x: -h[0] / 2,
          y: -h[1] / 2,
          width: h[0],
          height: h[1]
        });
        y.name = p, c.add(y);
      }
    }, t.prototype.layoutInner = function(e, n, i, a, o, s) {
      var l = this.getSelectorGroup(), u = e.getOrient().index, c = hg[u], f = vg[u], h = hg[1 - u], v = vg[1 - u];
      o && so(
        // Buttons in selectorGroup always layout horizontally
        "horizontal",
        l,
        e.get("selectorItemGap", !0)
      );
      var d = e.get("selectorButtonGap", !0), p = l.getBoundingRect(), g = [-p.x, -p.y], m = ce(i);
      o && (m[c] = i[c] - p[c] - d);
      var y = this._layoutContentAndController(e, a, m, u, c, h, v, f);
      if (o) {
        if (s === "end")
          g[u] += y[c] + d;
        else {
          var _ = p[c] + d;
          g[u] -= _, y[f] -= _;
        }
        y[c] += p[c] + d, g[1 - u] += y[v] + y[h] / 2 - p[h] / 2, y[h] = Math.max(y[h], p[h]), y[v] = Math.min(y[v], p[v] + g[1 - u]), l.x = g[0], l.y = g[1], l.markRedraw();
      }
      return y;
    }, t.prototype._layoutContentAndController = function(e, n, i, a, o, s, l, u) {
      var c = this.getContentGroup(), f = this._containerGroup, h = this._controllerGroup;
      so(e.get("orient"), c, e.get("itemGap"), a ? i.width : null, a ? null : i.height), so(
        // Buttons in controller are layout always horizontally.
        "horizontal",
        h,
        e.get("pageButtonItemGap", !0)
      );
      var v = c.getBoundingRect(), d = h.getBoundingRect(), p = this._showController = v[o] > i[o], g = [-v.x, -v.y];
      n || (g[a] = c[u]);
      var m = [0, 0], y = [-d.x, -d.y], _ = me(e.get("pageButtonGap", !0), e.get("itemGap", !0));
      if (p) {
        var b = e.get("pageButtonPosition", !0);
        b === "end" ? y[a] += i[o] - d[o] : m[a] += d[o] + _;
      }
      y[1 - a] += v[s] / 2 - d[s] / 2, c.setPosition(g), f.setPosition(m), h.setPosition(y);
      var S = {
        x: 0,
        y: 0
      };
      if (S[o] = p ? i[o] : v[o], S[s] = Math.max(v[s], d[s]), S[l] = Math.min(0, d[l] + y[1 - a]), f.__rectSize = i[o], p) {
        var x = {
          x: 0,
          y: 0
        };
        x[o] = Math.max(i[o] - d[o] - _, 0), x[s] = S[s], f.setClipPath(new ke({
          shape: x
        })), f.__rectSize = x[o];
      } else
        h.eachChild(function(C) {
          C.attr({
            invisible: !0,
            silent: !0
          });
        });
      var w = this._getPageInfo(e);
      return w.pageIndex != null && Ne(
        c,
        {
          x: w.contentPosition[0],
          y: w.contentPosition[1]
        },
        // When switch from "show controller" to "not show controller", view should be
        // updated immediately without animation, otherwise causes weird effect.
        p ? e : null
      ), this._updatePageInfoView(e, w), S;
    }, t.prototype._pageGo = function(e, n, i) {
      var a = this._getPageInfo(n)[e];
      a != null && i.dispatchAction({
        type: "legendScroll",
        scrollDataIndex: a,
        legendId: n.id
      });
    }, t.prototype._updatePageInfoView = function(e, n) {
      var i = this._controllerGroup;
      M(["pagePrev", "pageNext"], function(c) {
        var f = c + "DataIndex", h = n[f] != null, v = i.childOfName(c);
        v && (v.setStyle("fill", h ? e.get("pageIconColor", !0) : e.get("pageIconInactiveColor", !0)), v.cursor = h ? "pointer" : "default");
      });
      var a = i.childOfName("pageText"), o = e.get("pageFormatter"), s = n.pageIndex, l = s != null ? s + 1 : 0, u = n.pageCount;
      a && o && a.setStyle("text", J(o) ? o.replace("{current}", l == null ? "" : l + "").replace("{total}", u == null ? "" : u + "") : o({
        current: l,
        total: u
      }));
    }, t.prototype._getPageInfo = function(e) {
      var n = e.get("scrollDataIndex", !0), i = this.getContentGroup(), a = this._containerGroup.__rectSize, o = e.getOrient().index, s = hg[o], l = vg[o], u = this._findTargetItemIndex(n), c = i.children(), f = c[u], h = c.length, v = h ? 1 : 0, d = {
        contentPosition: [i.x, i.y],
        pageCount: v,
        pageIndex: v - 1,
        pagePrevDataIndex: null,
        pageNextDataIndex: null
      };
      if (!f)
        return d;
      var p = b(f);
      d.contentPosition[o] = -p.s;
      for (var g = u + 1, m = p, y = p, _ = null; g <= h; ++g)
        _ = b(c[g]), // Half of the last item is out of the window.
        (!_ && y.e > m.s + a || _ && !S(_, m.s)) && (y.i > m.i ? m = y : m = _, m && (d.pageNextDataIndex == null && (d.pageNextDataIndex = m.i), ++d.pageCount)), y = _;
      for (var g = u - 1, m = p, y = p, _ = null; g >= -1; --g)
        _ = b(c[g]), // If the the end item does not intersect with the window started
        // from the current item, a page can be settled.
        (!_ || !S(y, _.s)) && m.i < y.i && (y = m, d.pagePrevDataIndex == null && (d.pagePrevDataIndex = m.i), ++d.pageCount, ++d.pageIndex), m = _;
      return d;
      function b(x) {
        if (x) {
          var w = x.getBoundingRect(), C = w[l] + x[l];
          return {
            s: C,
            e: C + w[s],
            i: x.__legendDataIndex
          };
        }
      }
      function S(x, w) {
        return x.e >= w && x.s <= w + a;
      }
    }, t.prototype._findTargetItemIndex = function(e) {
      if (!this._showController)
        return 0;
      var n, i = this.getContentGroup(), a;
      return i.eachChild(function(o, s) {
        var l = o.__legendDataIndex;
        a == null && l != null && (a = s), l === e && (n = s);
      }), n ?? a;
    }, t.type = "legend.scroll", t;
  }(hk)
);
function mK(r) {
  r.registerAction("legendScroll", "legendscroll", function(t, e) {
    var n = t.scrollDataIndex;
    n != null && e.eachComponent({
      mainType: "legend",
      subType: "scroll",
      query: t
    }, function(i) {
      i.setScrollDataIndex(n);
    });
  });
}
function yK(r) {
  De(dk), r.registerComponentModel(pK), r.registerComponentView(gK), mK(r);
}
function _K(r) {
  De(dk), De(yK);
}
var bK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "dataZoom.inside", t.defaultOption = la(Ou.defaultOption, {
      disabled: !1,
      zoomLock: !1,
      zoomOnMouseWheel: !0,
      moveOnMouseMove: !0,
      moveOnMouseWheel: !1,
      preventDefaultMouseMove: !0
    }), t;
  }(Ou)
), j_ = Oe();
function SK(r, t, e) {
  j_(r).coordSysRecordMap.each(function(n) {
    var i = n.dataZoomInfoMap.get(t.uid);
    i && (i.getRange = e);
  });
}
function xK(r, t) {
  for (var e = j_(r).coordSysRecordMap, n = e.keys(), i = 0; i < n.length; i++) {
    var a = n[i], o = e.get(a), s = o.dataZoomInfoMap;
    if (s) {
      var l = t.uid, u = s.get(l);
      u && (s.removeKey(l), s.keys().length || pk(e, o));
    }
  }
}
function pk(r, t) {
  if (t) {
    r.removeKey(t.model.uid);
    var e = t.controller;
    e && e.dispose();
  }
}
function wK(r, t) {
  var e = {
    model: t,
    containsPoint: ye(AK, t),
    dispatchAction: ye(CK, r),
    dataZoomInfoMap: null,
    controller: null
  }, n = e.controller = new ic(r.getZr());
  return M(["pan", "zoom", "scrollMove"], function(i) {
    n.on(i, function(a) {
      var o = [];
      e.dataZoomInfoMap.each(function(s) {
        if (a.isAvailableBehavior(s.model.option)) {
          var l = (s.getRange || {})[i], u = l && l(s.dzReferCoordSysInfo, e.model.mainType, e.controller, a);
          !s.model.get("disabled", !0) && u && o.push({
            dataZoomId: s.model.id,
            start: u[0],
            end: u[1]
          });
        }
      }), o.length && e.dispatchAction(o);
    });
  }), e;
}
function CK(r, t) {
  r.isDisposed() || r.dispatchAction({
    type: "dataZoom",
    animation: {
      easing: "cubicOut",
      duration: 100
    },
    batch: t
  });
}
function AK(r, t, e, n) {
  return r.coordinateSystem.containPoint([e, n]);
}
function DK(r) {
  var t, e = "type_", n = {
    type_true: 2,
    type_move: 1,
    type_false: 0,
    type_undefined: -1
  }, i = !0;
  return r.each(function(a) {
    var o = a.model, s = o.get("disabled", !0) ? !1 : o.get("zoomLock", !0) ? "move" : !0;
    n[e + s] > n[e + t] && (t = s), i = i && o.get("preventDefaultMouseMove", !0);
  }), {
    controlType: t,
    opt: {
      // RoamController will enable all of these functionalities,
      // and the final behavior is determined by its event listener
      // provided by each inside zoom.
      zoomOnMouseWheel: !0,
      moveOnMouseMove: !0,
      moveOnMouseWheel: !0,
      preventDefaultMouseMove: !!i
    }
  };
}
function TK(r) {
  r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER, function(t, e) {
    var n = j_(e), i = n.coordSysRecordMap || (n.coordSysRecordMap = re());
    i.each(function(a) {
      a.dataZoomInfoMap = null;
    }), t.eachComponent({
      mainType: "dataZoom",
      subType: "inside"
    }, function(a) {
      var o = KP(a);
      M(o.infoList, function(s) {
        var l = s.model.uid, u = i.get(l) || i.set(l, wK(e, s.model)), c = u.dataZoomInfoMap || (u.dataZoomInfoMap = re());
        c.set(a.uid, {
          dzReferCoordSysInfo: s,
          model: a,
          getRange: null
        });
      });
    }), i.each(function(a) {
      var o = a.controller, s, l = a.dataZoomInfoMap;
      if (l) {
        var u = l.keys()[0];
        u != null && (s = l.get(u));
      }
      if (!s) {
        pk(i, a);
        return;
      }
      var c = DK(l);
      o.enable(c.controlType, c.opt), o.setPointerChecker(a.containsPoint), Vs(a, "dispatchAction", s.model.get("throttle", !0), "fixRate");
    });
  });
}
var MK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "dataZoom.inside", e;
    }
    return t.prototype.render = function(e, n, i) {
      if (r.prototype.render.apply(this, arguments), e.noTarget()) {
        this._clear();
        return;
      }
      this.range = e.getPercentRange(), SK(i, e, {
        pan: Q(dg.pan, this),
        zoom: Q(dg.zoom, this),
        scrollMove: Q(dg.scrollMove, this)
      });
    }, t.prototype.dispose = function() {
      this._clear(), r.prototype.dispose.apply(this, arguments);
    }, t.prototype._clear = function() {
      xK(this.api, this.dataZoomModel), this.range = null;
    }, t.type = "dataZoom.inside", t;
  }($_)
), dg = {
  zoom: function(r, t, e, n) {
    var i = this.range, a = i.slice(), o = r.axisModels[0];
    if (o) {
      var s = pg[t](null, [n.originX, n.originY], o, e, r), l = (s.signal > 0 ? s.pixelStart + s.pixelLength - s.pixel : s.pixel - s.pixelStart) / s.pixelLength * (a[1] - a[0]) + a[0], u = Math.max(1 / n.scale, 0);
      a[0] = (a[0] - l) * u + l, a[1] = (a[1] - l) * u + l;
      var c = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
      if (Mo(0, a, [0, 100], 0, c.minSpan, c.maxSpan), this.range = a, i[0] !== a[0] || i[1] !== a[1])
        return a;
    }
  },
  pan: DA(function(r, t, e, n, i, a) {
    var o = pg[n]([a.oldX, a.oldY], [a.newX, a.newY], t, i, e);
    return o.signal * (r[1] - r[0]) * o.pixel / o.pixelLength;
  }),
  scrollMove: DA(function(r, t, e, n, i, a) {
    var o = pg[n]([0, 0], [a.scrollDelta, a.scrollDelta], t, i, e);
    return o.signal * (r[1] - r[0]) * a.scrollDelta;
  })
};
function DA(r) {
  return function(t, e, n, i) {
    var a = this.range, o = a.slice(), s = t.axisModels[0];
    if (s) {
      var l = r(o, s, t, e, n, i);
      if (Mo(l, o, [0, 100], "all"), this.range = o, a[0] !== o[0] || a[1] !== o[1])
        return o;
    }
  };
}
var pg = {
  grid: function(r, t, e, n, i) {
    var a = e.axis, o = {}, s = i.model.coordinateSystem.getRect();
    return r = r || [0, 0], a.dim === "x" ? (o.pixel = t[0] - r[0], o.pixelLength = s.width, o.pixelStart = s.x, o.signal = a.inverse ? 1 : -1) : (o.pixel = t[1] - r[1], o.pixelLength = s.height, o.pixelStart = s.y, o.signal = a.inverse ? -1 : 1), o;
  },
  polar: function(r, t, e, n, i) {
    var a = e.axis, o = {}, s = i.model.coordinateSystem, l = s.getRadiusAxis().getExtent(), u = s.getAngleAxis().getExtent();
    return r = r ? s.pointToCoord(r) : [0, 0], t = s.pointToCoord(t), e.mainType === "radiusAxis" ? (o.pixel = t[0] - r[0], o.pixelLength = l[1] - l[0], o.pixelStart = l[0], o.signal = a.inverse ? 1 : -1) : (o.pixel = t[1] - r[1], o.pixelLength = u[1] - u[0], o.pixelStart = u[0], o.signal = a.inverse ? -1 : 1), o;
  },
  singleAxis: function(r, t, e, n, i) {
    var a = e.axis, o = i.model.coordinateSystem.getRect(), s = {};
    return r = r || [0, 0], a.orient === "horizontal" ? (s.pixel = t[0] - r[0], s.pixelLength = o.width, s.pixelStart = o.x, s.signal = a.inverse ? 1 : -1) : (s.pixel = t[1] - r[1], s.pixelLength = o.height, s.pixelStart = o.y, s.signal = a.inverse ? -1 : 1), s;
  }
};
function gk(r) {
  G_(r), r.registerComponentModel(bK), r.registerComponentView(MK), TK(r);
}
var IK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "dataZoom.slider", t.layoutMode = "box", t.defaultOption = la(Ou.defaultOption, {
      show: !0,
      // deault value can only be drived in view stage.
      right: "ph",
      top: "ph",
      width: "ph",
      height: "ph",
      left: null,
      bottom: null,
      borderColor: "#d2dbee",
      borderRadius: 3,
      backgroundColor: "rgba(47,69,84,0)",
      // dataBackgroundColor: '#ddd',
      dataBackground: {
        lineStyle: {
          color: "#d2dbee",
          width: 0.5
        },
        areaStyle: {
          color: "#d2dbee",
          opacity: 0.2
        }
      },
      selectedDataBackground: {
        lineStyle: {
          color: "#8fb0f7",
          width: 0.5
        },
        areaStyle: {
          color: "#8fb0f7",
          opacity: 0.2
        }
      },
      // Color of selected window.
      fillerColor: "rgba(135,175,274,0.2)",
      handleIcon: "path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
      // Percent of the slider height
      handleSize: "100%",
      handleStyle: {
        color: "#fff",
        borderColor: "#ACB8D1"
      },
      moveHandleSize: 7,
      moveHandleIcon: "path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",
      moveHandleStyle: {
        color: "#D2DBEE",
        opacity: 0.7
      },
      showDetail: !0,
      showDataShadow: "auto",
      realtime: !0,
      zoomLock: !1,
      textStyle: {
        color: "#6E7079"
      },
      brushSelect: !0,
      brushStyle: {
        color: "rgba(135,175,274,0.15)"
      },
      emphasis: {
        handleLabel: {
          show: !0
        },
        handleStyle: {
          borderColor: "#8FB0F7"
        },
        moveHandleStyle: {
          color: "#8FB0F7"
        }
      }
    }), t;
  }(Ou)
), wl = ke, TA = 7, LK = 1, gg = 30, EK = 7, Cl = "horizontal", MA = "vertical", PK = 5, kK = ["line", "bar", "candlestick", "scatter"], RK = {
  easing: "cubicOut",
  duration: 100,
  delay: 0
}, OK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._displayables = {}, e;
    }
    return t.prototype.init = function(e, n) {
      this.api = n, this._onBrush = Q(this._onBrush, this), this._onBrushEnd = Q(this._onBrushEnd, this);
    }, t.prototype.render = function(e, n, i, a) {
      if (r.prototype.render.apply(this, arguments), Vs(this, "_dispatchZoomAction", e.get("throttle"), "fixRate"), this._orient = e.getOrient(), e.get("show") === !1) {
        this.group.removeAll();
        return;
      }
      if (e.noTarget()) {
        this._clear(), this.group.removeAll();
        return;
      }
      (!a || a.type !== "dataZoom" || a.from !== this.uid) && this._buildView(), this._updateView();
    }, t.prototype.dispose = function() {
      this._clear(), r.prototype.dispose.apply(this, arguments);
    }, t.prototype._clear = function() {
      xu(this, "_dispatchZoomAction");
      var e = this.api.getZr();
      e.off("mousemove", this._onBrush), e.off("mouseup", this._onBrushEnd);
    }, t.prototype._buildView = function() {
      var e = this.group;
      e.removeAll(), this._brushing = !1, this._displayables.brushRect = null, this._resetLocation(), this._resetInterval();
      var n = this._displayables.sliderGroup = new fe();
      this._renderBackground(), this._renderHandle(), this._renderDataShadow(), e.add(n), this._positionGroup();
    }, t.prototype._resetLocation = function() {
      var e = this.dataZoomModel, n = this.api, i = e.get("brushSelect"), a = i ? EK : 0, o = this._findCoordRect(), s = {
        width: n.getWidth(),
        height: n.getHeight()
      }, l = this._orient === Cl ? {
        // Why using 'right', because right should be used in vertical,
        // and it is better to be consistent for dealing with position param merge.
        right: s.width - o.x - o.width,
        top: s.height - gg - TA - a,
        width: o.width,
        height: gg
      } : {
        right: TA,
        top: o.y,
        width: gg,
        height: o.height
      }, u = Bs(e.option);
      M(["right", "top", "width", "height"], function(f) {
        u[f] === "ph" && (u[f] = l[f]);
      });
      var c = St(u, s);
      this._location = {
        x: c.x,
        y: c.y
      }, this._size = [c.width, c.height], this._orient === MA && this._size.reverse();
    }, t.prototype._positionGroup = function() {
      var e = this.group, n = this._location, i = this._orient, a = this.dataZoomModel.getFirstTargetAxisModel(), o = a && a.get("inverse"), s = this._displayables.sliderGroup, l = (this._dataShadowInfo || {}).otherAxisInverse;
      s.attr(i === Cl && !o ? {
        scaleY: l ? 1 : -1,
        scaleX: 1
      } : i === Cl && o ? {
        scaleY: l ? 1 : -1,
        scaleX: -1
      } : i === MA && !o ? {
        scaleY: l ? -1 : 1,
        scaleX: 1,
        rotation: Math.PI / 2
      } : {
        scaleY: l ? -1 : 1,
        scaleX: -1,
        rotation: Math.PI / 2
      });
      var u = e.getBoundingRect([s]);
      e.x = n.x - u.x, e.y = n.y - u.y, e.markRedraw();
    }, t.prototype._getViewExtent = function() {
      return [0, this._size[0]];
    }, t.prototype._renderBackground = function() {
      var e = this.dataZoomModel, n = this._size, i = this._displayables.sliderGroup, a = e.get("brushSelect");
      i.add(new wl({
        silent: !0,
        shape: {
          x: 0,
          y: 0,
          width: n[0],
          height: n[1]
        },
        style: {
          fill: e.get("backgroundColor")
        },
        z2: -40
      }));
      var o = new wl({
        shape: {
          x: 0,
          y: 0,
          width: n[0],
          height: n[1]
        },
        style: {
          fill: "transparent"
        },
        z2: 0,
        onclick: Q(this._onClickPanel, this)
      }), s = this.api.getZr();
      a ? (o.on("mousedown", this._onBrushStart, this), o.cursor = "crosshair", s.on("mousemove", this._onBrush), s.on("mouseup", this._onBrushEnd)) : (s.off("mousemove", this._onBrush), s.off("mouseup", this._onBrushEnd)), i.add(o);
    }, t.prototype._renderDataShadow = function() {
      var e = this._dataShadowInfo = this._prepareDataShadowInfo();
      if (this._displayables.dataShadowSegs = [], !e)
        return;
      var n = this._size, i = this._shadowSize || [], a = e.series, o = a.getRawData(), s = a.getShadowDim && a.getShadowDim(), l = s && o.getDimensionInfo(s) ? a.getShadowDim() : e.otherDim;
      if (l == null)
        return;
      var u = this._shadowPolygonPts, c = this._shadowPolylinePts;
      if (o !== this._shadowData || l !== this._shadowDim || n[0] !== i[0] || n[1] !== i[1]) {
        var f = o.getDataExtent(l), h = (f[1] - f[0]) * 0.3;
        f = [f[0] - h, f[1] + h];
        var v = [0, n[1]], d = [0, n[0]], p = [[n[0], 0], [0, 0]], g = [], m = d[1] / (o.count() - 1), y = 0, _ = Math.round(o.count() / n[0]), b;
        o.each([l], function(D, A) {
          if (_ > 0 && A % _) {
            y += m;
            return;
          }
          var T = D == null || isNaN(D) || D === "", L = T ? 0 : Ye(D, f, v, !0);
          T && !b && A ? (p.push([p[p.length - 1][0], 0]), g.push([g[g.length - 1][0], 0])) : !T && b && (p.push([y, 0]), g.push([y, 0])), p.push([y, L]), g.push([y, L]), y += m, b = T;
        }), u = this._shadowPolygonPts = p, c = this._shadowPolylinePts = g;
      }
      this._shadowData = o, this._shadowDim = l, this._shadowSize = [n[0], n[1]];
      var S = this.dataZoomModel;
      function x(D) {
        var A = S.getModel(D ? "selectedDataBackground" : "dataBackground"), T = new fe(), L = new ar({
          shape: {
            points: u
          },
          segmentIgnoreThreshold: 1,
          style: A.getModel("areaStyle").getAreaStyle(),
          silent: !0,
          z2: -20
        }), E = new sr({
          shape: {
            points: c
          },
          segmentIgnoreThreshold: 1,
          style: A.getModel("lineStyle").getLineStyle(),
          silent: !0,
          z2: -19
        });
        return T.add(L), T.add(E), T;
      }
      for (var w = 0; w < 3; w++) {
        var C = x(w === 1);
        this._displayables.sliderGroup.add(C), this._displayables.dataShadowSegs.push(C);
      }
    }, t.prototype._prepareDataShadowInfo = function() {
      var e = this.dataZoomModel, n = e.get("showDataShadow");
      if (n !== !1) {
        var i, a = this.ecModel;
        return e.eachTargetAxis(function(o, s) {
          var l = e.getAxisProxy(o, s).getTargetSeriesModels();
          M(l, function(u) {
            if (!i && !(n !== !0 && we(kK, u.get("type")) < 0)) {
              var c = a.getComponent(Gi(o), s).axis, f = FK(o), h, v = u.coordinateSystem;
              f != null && v.getOtherAxis && (h = v.getOtherAxis(c).inverse), f = u.getData().mapDimension(f), i = {
                thisAxis: c,
                series: u,
                thisDim: o,
                otherDim: f,
                otherAxisInverse: h
              };
            }
          }, this);
        }, this), i;
      }
    }, t.prototype._renderHandle = function() {
      var e = this.group, n = this._displayables, i = n.handles = [null, null], a = n.handleLabels = [null, null], o = this._displayables.sliderGroup, s = this._size, l = this.dataZoomModel, u = this.api, c = l.get("borderRadius") || 0, f = l.get("brushSelect"), h = n.filler = new wl({
        silent: f,
        style: {
          fill: l.get("fillerColor")
        },
        textConfig: {
          position: "inside"
        }
      });
      o.add(h), o.add(new wl({
        silent: !0,
        subPixelOptimize: !0,
        shape: {
          x: 0,
          y: 0,
          width: s[0],
          height: s[1],
          r: c
        },
        style: {
          // deprecated option
          stroke: l.get("dataBackgroundColor") || l.get("borderColor"),
          lineWidth: LK,
          fill: "rgba(0,0,0,0)"
        }
      })), M([0, 1], function(_) {
        var b = l.get("handleIcon");
        !ph[b] && b.indexOf("path://") < 0 && b.indexOf("image://") < 0 && (b = "path://" + b);
        var S = yt(b, -1, 0, 2, 2, null, !0);
        S.attr({
          cursor: IA(this._orient),
          draggable: !0,
          drift: Q(this._onDragMove, this, _),
          ondragend: Q(this._onDragEnd, this),
          onmouseover: Q(this._showDataInfo, this, !0),
          onmouseout: Q(this._showDataInfo, this, !1),
          z2: 5
        });
        var x = S.getBoundingRect(), w = l.get("handleSize");
        this._handleHeight = X(w, this._size[1]), this._handleWidth = x.width / x.height * this._handleHeight, S.setStyle(l.getModel("handleStyle").getItemStyle()), S.style.strokeNoScale = !0, S.rectHover = !0, S.ensureState("emphasis").style = l.getModel(["emphasis", "handleStyle"]).getItemStyle(), ao(S);
        var C = l.get("handleColor");
        C != null && (S.style.fill = C), o.add(i[_] = S);
        var D = l.getModel("textStyle"), A = l.get("handleLabel") || {}, T = A.show || !1;
        e.add(a[_] = new Fe({
          silent: !0,
          invisible: !T,
          style: nt(D, {
            x: 0,
            y: 0,
            text: "",
            verticalAlign: "middle",
            align: "center",
            fill: D.getTextColor(),
            font: D.getFont()
          }),
          z2: 10
        }));
      }, this);
      var v = h;
      if (f) {
        var d = X(l.get("moveHandleSize"), s[1]), p = n.moveHandle = new ke({
          style: l.getModel("moveHandleStyle").getItemStyle(),
          silent: !0,
          shape: {
            r: [0, 0, 2, 2],
            y: s[1] - 0.5,
            height: d
          }
        }), g = d * 0.8, m = n.moveHandleIcon = yt(l.get("moveHandleIcon"), -g / 2, -g / 2, g, g, "#fff", !0);
        m.silent = !0, m.y = s[1] + d / 2 - 0.5, p.ensureState("emphasis").style = l.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
        var y = Math.min(s[1] / 2, Math.max(d, 10));
        v = n.moveZone = new ke({
          invisible: !0,
          shape: {
            y: s[1] - y,
            height: d + y
          }
        }), v.on("mouseover", function() {
          u.enterEmphasis(p);
        }).on("mouseout", function() {
          u.leaveEmphasis(p);
        }), o.add(p), o.add(m), o.add(v);
      }
      v.attr({
        draggable: !0,
        cursor: IA(this._orient),
        drift: Q(this._onDragMove, this, "all"),
        ondragstart: Q(this._showDataInfo, this, !0),
        ondragend: Q(this._onDragEnd, this),
        onmouseover: Q(this._showDataInfo, this, !0),
        onmouseout: Q(this._showDataInfo, this, !1)
      });
    }, t.prototype._resetInterval = function() {
      var e = this._range = this.dataZoomModel.getPercentRange(), n = this._getViewExtent();
      this._handleEnds = [Ye(e[0], [0, 100], n, !0), Ye(e[1], [0, 100], n, !0)];
    }, t.prototype._updateInterval = function(e, n) {
      var i = this.dataZoomModel, a = this._handleEnds, o = this._getViewExtent(), s = i.findRepresentativeAxisProxy().getMinMaxSpan(), l = [0, 100];
      Mo(n, a, o, i.get("zoomLock") ? "all" : e, s.minSpan != null ? Ye(s.minSpan, l, o, !0) : null, s.maxSpan != null ? Ye(s.maxSpan, l, o, !0) : null);
      var u = this._range, c = this._range = Gr([Ye(a[0], o, l, !0), Ye(a[1], o, l, !0)]);
      return !u || u[0] !== c[0] || u[1] !== c[1];
    }, t.prototype._updateView = function(e) {
      var n = this._displayables, i = this._handleEnds, a = Gr(i.slice()), o = this._size;
      M([0, 1], function(v) {
        var d = n.handles[v], p = this._handleHeight;
        d.attr({
          scaleX: p / 2,
          scaleY: p / 2,
          // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.
          // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.
          x: i[v] + (v ? -1 : 1),
          y: o[1] / 2 - p / 2
        });
      }, this), n.filler.setShape({
        x: a[0],
        y: 0,
        width: a[1] - a[0],
        height: o[1]
      });
      var s = {
        x: a[0],
        width: a[1] - a[0]
      };
      n.moveHandle && (n.moveHandle.setShape(s), n.moveZone.setShape(s), n.moveZone.getBoundingRect(), n.moveHandleIcon && n.moveHandleIcon.attr("x", s.x + s.width / 2));
      for (var l = n.dataShadowSegs, u = [0, a[0], a[1], o[0]], c = 0; c < l.length; c++) {
        var f = l[c], h = f.getClipPath();
        h || (h = new ke(), f.setClipPath(h)), h.setShape({
          x: u[c],
          y: 0,
          width: u[c + 1] - u[c],
          height: o[1]
        });
      }
      this._updateDataInfo(e);
    }, t.prototype._updateDataInfo = function(e) {
      var n = this.dataZoomModel, i = this._displayables, a = i.handleLabels, o = this._orient, s = ["", ""];
      if (n.get("showDetail")) {
        var l = n.findRepresentativeAxisProxy();
        if (l) {
          var u = l.getAxisModel().axis, c = this._range, f = e ? l.calculateDataWindow({
            start: c[0],
            end: c[1]
          }).valueWindow : l.getDataValueWindow();
          s = [this._formatLabel(f[0], u), this._formatLabel(f[1], u)];
        }
      }
      var h = Gr(this._handleEnds.slice());
      v.call(this, 0), v.call(this, 1);
      function v(d) {
        var p = oo(i.handles[d].parent, this.group), g = pv(d === 0 ? "right" : "left", p), m = this._handleWidth / 2 + PK, y = an([h[d] + (d === 0 ? -m : m), this._size[1] / 2], p);
        a[d].setStyle({
          x: y[0],
          y: y[1],
          verticalAlign: o === Cl ? "middle" : g,
          align: o === Cl ? g : "center",
          text: s[d]
        });
      }
    }, t.prototype._formatLabel = function(e, n) {
      var i = this.dataZoomModel, a = i.get("labelFormatter"), o = i.get("labelPrecision");
      (o == null || o === "auto") && (o = n.getPixelPrecision());
      var s = e == null || isNaN(e) ? "" : n.type === "category" || n.type === "time" ? n.scale.getLabel({
        value: Math.round(e)
      }) : e.toFixed(Math.min(o, 20));
      return oe(a) ? a(e, s) : J(a) ? a.replace("{value}", s) : s;
    }, t.prototype._showDataInfo = function(e) {
      var n = this.dataZoomModel.get("handleLabel") || {}, i = n.show || !1, a = this.dataZoomModel.getModel(["emphasis", "handleLabel"]), o = a.get("show") || !1, s = e || this._dragging ? o : i, l = this._displayables, u = l.handleLabels;
      u[0].attr("invisible", !s), u[1].attr("invisible", !s), l.moveHandle && this.api[s ? "enterEmphasis" : "leaveEmphasis"](l.moveHandle, 1);
    }, t.prototype._onDragMove = function(e, n, i, a) {
      this._dragging = !0, ii(a.event);
      var o = this._displayables.sliderGroup.getLocalTransform(), s = an([n, i], o, !0), l = this._updateInterval(e, s[0]), u = this.dataZoomModel.get("realtime");
      this._updateView(!u), l && u && this._dispatchZoomAction(!0);
    }, t.prototype._onDragEnd = function() {
      this._dragging = !1, this._showDataInfo(!1);
      var e = this.dataZoomModel.get("realtime");
      !e && this._dispatchZoomAction(!1);
    }, t.prototype._onClickPanel = function(e) {
      var n = this._size, i = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);
      if (!(i[0] < 0 || i[0] > n[0] || i[1] < 0 || i[1] > n[1])) {
        var a = this._handleEnds, o = (a[0] + a[1]) / 2, s = this._updateInterval("all", i[0] - o);
        this._updateView(), s && this._dispatchZoomAction(!1);
      }
    }, t.prototype._onBrushStart = function(e) {
      var n = e.offsetX, i = e.offsetY;
      this._brushStart = new Se(n, i), this._brushing = !0, this._brushStartTime = +/* @__PURE__ */ new Date();
    }, t.prototype._onBrushEnd = function(e) {
      if (this._brushing) {
        var n = this._displayables.brushRect;
        if (this._brushing = !1, !!n) {
          n.attr("ignore", !0);
          var i = n.shape, a = +/* @__PURE__ */ new Date();
          if (!(a - this._brushStartTime < 200 && Math.abs(i.width) < 5)) {
            var o = this._getViewExtent(), s = [0, 100];
            this._range = Gr([Ye(i.x, o, s, !0), Ye(i.x + i.width, o, s, !0)]), this._handleEnds = [i.x, i.x + i.width], this._updateView(), this._dispatchZoomAction(!1);
          }
        }
      }
    }, t.prototype._onBrush = function(e) {
      this._brushing && (ii(e.event), this._updateBrushRect(e.offsetX, e.offsetY));
    }, t.prototype._updateBrushRect = function(e, n) {
      var i = this._displayables, a = this.dataZoomModel, o = i.brushRect;
      o || (o = i.brushRect = new wl({
        silent: !0,
        style: a.getModel("brushStyle").getItemStyle()
      }), i.sliderGroup.add(o)), o.attr("ignore", !1);
      var s = this._brushStart, l = this._displayables.sliderGroup, u = l.transformCoordToLocal(e, n), c = l.transformCoordToLocal(s.x, s.y), f = this._size;
      u[0] = Math.max(Math.min(f[0], u[0]), 0), o.setShape({
        x: c[0],
        y: 0,
        width: u[0] - c[0],
        height: f[1]
      });
    }, t.prototype._dispatchZoomAction = function(e) {
      var n = this._range;
      this.api.dispatchAction({
        type: "dataZoom",
        from: this.uid,
        dataZoomId: this.dataZoomModel.id,
        animation: e ? RK : null,
        start: n[0],
        end: n[1]
      });
    }, t.prototype._findCoordRect = function() {
      var e, n = KP(this.dataZoomModel).infoList;
      if (!e && n.length) {
        var i = n[0].model.coordinateSystem;
        e = i.getRect && i.getRect();
      }
      if (!e) {
        var a = this.api.getWidth(), o = this.api.getHeight();
        e = {
          x: a * 0.2,
          y: o * 0.2,
          width: a * 0.6,
          height: o * 0.6
        };
      }
      return e;
    }, t.type = "dataZoom.slider", t;
  }($_)
);
function FK(r) {
  var t = {
    x: "y",
    y: "x",
    radius: "angle",
    angle: "radius"
  };
  return t[r];
}
function IA(r) {
  return r === "vertical" ? "ns-resize" : "ew-resize";
}
function mk(r) {
  r.registerComponentModel(IK), r.registerComponentView(OK), G_(r);
}
function BK(r) {
  De(gk), De(mk);
}
var yk = {
  /**
   * @public
   */
  get: function(r, t, e) {
    var n = ce((NK[r] || {})[t]);
    return e && q(n) ? n[n.length - 1] : n;
  }
}, NK = {
  color: {
    active: ["#006edd", "#e0ffff"],
    inactive: ["rgba(0,0,0,0)"]
  },
  colorHue: {
    active: [0, 360],
    inactive: [0, 0]
  },
  colorSaturation: {
    active: [0.3, 1],
    inactive: [0, 0]
  },
  colorLightness: {
    active: [0.9, 0.5],
    inactive: [0, 0]
  },
  colorAlpha: {
    active: [0.3, 1],
    inactive: [0, 0]
  },
  opacity: {
    active: [0.3, 1],
    inactive: [0, 0]
  },
  symbol: {
    active: ["circle", "roundRect", "diamond"],
    inactive: ["none"]
  },
  symbolSize: {
    active: [10, 50],
    inactive: [0, 0]
  }
}, LA = Dt.mapVisual, zK = Dt.eachVisual, VK = q, EA = M, $K = Gr, GK = Ye, zh = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.stateList = ["inRange", "outOfRange"], e.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"], e.layoutMode = {
        type: "box",
        ignoreSize: !0
      }, e.dataBound = [-1 / 0, 1 / 0], e.targetVisuals = {}, e.controllerVisuals = {}, e;
    }
    return t.prototype.init = function(e, n, i) {
      this.mergeDefaultAndTheme(e, i);
    }, t.prototype.optionUpdated = function(e, n) {
      var i = this.option;
      !n && sk(i, e, this.replacableOptionKeys), this.textStyleModel = this.getModel("textStyle"), this.resetItemSize(), this.completeVisualOption();
    }, t.prototype.resetVisual = function(e) {
      var n = this.stateList;
      e = Q(e, this), this.controllerVisuals = dy(this.option.controller, n, e), this.targetVisuals = dy(this.option.target, n, e);
    }, t.prototype.getItemSymbol = function() {
      return null;
    }, t.prototype.getTargetSeriesIndices = function() {
      var e = this.option.seriesIndex, n = [];
      return e == null || e === "all" ? this.ecModel.eachSeries(function(i, a) {
        n.push(a);
      }) : n = je(e), n;
    }, t.prototype.eachTargetSeries = function(e, n) {
      M(this.getTargetSeriesIndices(), function(i) {
        var a = this.ecModel.getSeriesByIndex(i);
        a && e.call(n, a);
      }, this);
    }, t.prototype.isTargetSeries = function(e) {
      var n = !1;
      return this.eachTargetSeries(function(i) {
        i === e && (n = !0);
      }), n;
    }, t.prototype.formatValueText = function(e, n, i) {
      var a = this.option, o = a.precision, s = this.dataBound, l = a.formatter, u;
      i = i || ["<", ">"], q(e) && (e = e.slice(), u = !0);
      var c = n ? e : u ? [f(e[0]), f(e[1])] : f(e);
      if (J(l))
        return l.replace("{value}", u ? c[0] : c).replace("{value2}", u ? c[1] : c);
      if (oe(l))
        return u ? l(e[0], e[1]) : l(e);
      if (u)
        return e[0] === s[0] ? i[0] + " " + c[1] : e[1] === s[1] ? i[1] + " " + c[0] : c[0] + " - " + c[1];
      return c;
      function f(h) {
        return h === s[0] ? "min" : h === s[1] ? "max" : (+h).toFixed(Math.min(o, 20));
      }
    }, t.prototype.resetExtent = function() {
      var e = this.option, n = $K([e.min, e.max]);
      this._dataExtent = n;
    }, t.prototype.getDataDimensionIndex = function(e) {
      var n = this.option.dimension;
      if (n != null)
        return e.getDimensionIndex(n);
      for (var i = e.dimensions, a = i.length - 1; a >= 0; a--) {
        var o = i[a], s = e.getDimensionInfo(o);
        if (!s.isCalculationCoord)
          return s.storeDimIndex;
      }
    }, t.prototype.getExtent = function() {
      return this._dataExtent.slice();
    }, t.prototype.completeVisualOption = function() {
      var e = this.ecModel, n = this.option, i = {
        inRange: n.inRange,
        outOfRange: n.outOfRange
      }, a = n.target || (n.target = {}), o = n.controller || (n.controller = {});
      _e(a, i), _e(o, i);
      var s = this.isCategory();
      l.call(this, a), l.call(this, o), u.call(this, a, "inRange", "outOfRange"), c.call(this, o);
      function l(f) {
        VK(n.color) && !f.inRange && (f.inRange = {
          color: n.color.slice().reverse()
        }), f.inRange = f.inRange || {
          color: e.get("gradientColor")
        };
      }
      function u(f, h, v) {
        var d = f[h], p = f[v];
        d && !p && (p = f[v] = {}, EA(d, function(g, m) {
          if (Dt.isValidType(m)) {
            var y = yk.get(m, "inactive", s);
            y != null && (p[m] = y, m === "color" && !p.hasOwnProperty("opacity") && !p.hasOwnProperty("colorAlpha") && (p.opacity = [0, 0]));
          }
        }));
      }
      function c(f) {
        var h = (f.inRange || {}).symbol || (f.outOfRange || {}).symbol, v = (f.inRange || {}).symbolSize || (f.outOfRange || {}).symbolSize, d = this.get("inactiveColor"), p = this.getItemSymbol(), g = p || "roundRect";
        EA(this.stateList, function(m) {
          var y = this.itemSize, _ = f[m];
          _ || (_ = f[m] = {
            color: s ? d : [d]
          }), _.symbol == null && (_.symbol = h && ce(h) || (s ? g : [g])), _.symbolSize == null && (_.symbolSize = v && ce(v) || (s ? y[0] : [y[0], y[0]])), _.symbol = LA(_.symbol, function(x) {
            return x === "none" ? g : x;
          });
          var b = _.symbolSize;
          if (b != null) {
            var S = -1 / 0;
            zK(b, function(x) {
              x > S && (S = x);
            }), _.symbolSize = LA(b, function(x) {
              return GK(x, [0, S], [0, y[0]], !0);
            });
          }
        }, this);
      }
    }, t.prototype.resetItemSize = function() {
      this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))];
    }, t.prototype.isCategory = function() {
      return !!this.option.categories;
    }, t.prototype.setSelected = function(e) {
    }, t.prototype.getSelected = function() {
      return null;
    }, t.prototype.getValueState = function(e) {
      return null;
    }, t.prototype.getVisualMeta = function(e) {
      return null;
    }, t.type = "visualMap", t.dependencies = ["series"], t.defaultOption = {
      show: !0,
      // zlevel: 0,
      z: 4,
      seriesIndex: "all",
      min: 0,
      max: 200,
      left: 0,
      right: null,
      top: null,
      bottom: 0,
      itemWidth: null,
      itemHeight: null,
      inverse: !1,
      orient: "vertical",
      backgroundColor: "rgba(0,0,0,0)",
      borderColor: "#ccc",
      contentColor: "#5793f3",
      inactiveColor: "#aaa",
      borderWidth: 0,
      padding: 5,
      // 接受数组分别设定上右下左边距，同css
      textGap: 10,
      precision: 0,
      textStyle: {
        color: "#333"
        // 值域文字颜色
      }
    }, t;
  }(Le)
), PA = [20, 140], HK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.optionUpdated = function(e, n) {
      r.prototype.optionUpdated.apply(this, arguments), this.resetExtent(), this.resetVisual(function(i) {
        i.mappingMethod = "linear", i.dataExtent = this.getExtent();
      }), this._resetRange();
    }, t.prototype.resetItemSize = function() {
      r.prototype.resetItemSize.apply(this, arguments);
      var e = this.itemSize;
      (e[0] == null || isNaN(e[0])) && (e[0] = PA[0]), (e[1] == null || isNaN(e[1])) && (e[1] = PA[1]);
    }, t.prototype._resetRange = function() {
      var e = this.getExtent(), n = this.option.range;
      !n || n.auto ? (e.auto = 1, this.option.range = e) : q(n) && (n[0] > n[1] && n.reverse(), n[0] = Math.max(n[0], e[0]), n[1] = Math.min(n[1], e[1]));
    }, t.prototype.completeVisualOption = function() {
      r.prototype.completeVisualOption.apply(this, arguments), M(this.stateList, function(e) {
        var n = this.option.controller[e].symbolSize;
        n && n[0] !== n[1] && (n[0] = n[1] / 3);
      }, this);
    }, t.prototype.setSelected = function(e) {
      this.option.range = e.slice(), this._resetRange();
    }, t.prototype.getSelected = function() {
      var e = this.getExtent(), n = Gr((this.get("range") || []).slice());
      return n[0] > e[1] && (n[0] = e[1]), n[1] > e[1] && (n[1] = e[1]), n[0] < e[0] && (n[0] = e[0]), n[1] < e[0] && (n[1] = e[0]), n;
    }, t.prototype.getValueState = function(e) {
      var n = this.option.range, i = this.getExtent();
      return (n[0] <= i[0] || n[0] <= e) && (n[1] >= i[1] || e <= n[1]) ? "inRange" : "outOfRange";
    }, t.prototype.findTargetDataIndices = function(e) {
      var n = [];
      return this.eachTargetSeries(function(i) {
        var a = [], o = i.getData();
        o.each(this.getDataDimensionIndex(o), function(s, l) {
          e[0] <= s && s <= e[1] && a.push(l);
        }, this), n.push({
          seriesId: i.id,
          dataIndex: a
        });
      }, this), n;
    }, t.prototype.getVisualMeta = function(e) {
      var n = kA(this, "outOfRange", this.getExtent()), i = kA(this, "inRange", this.option.range.slice()), a = [];
      function o(v, d) {
        a.push({
          value: v,
          color: e(v, d)
        });
      }
      for (var s = 0, l = 0, u = i.length, c = n.length; l < c && (!i.length || n[l] <= i[0]); l++)
        n[l] < i[s] && o(n[l], "outOfRange");
      for (var f = 1; s < u; s++, f = 0)
        f && a.length && o(i[s], "outOfRange"), o(i[s], "inRange");
      for (var f = 1; l < c; l++)
        (!i.length || i[i.length - 1] < n[l]) && (f && (a.length && o(a[a.length - 1].value, "outOfRange"), f = 0), o(n[l], "outOfRange"));
      var h = a.length;
      return {
        stops: a,
        outerColors: [h ? a[0].color : "transparent", h ? a[h - 1].color : "transparent"]
      };
    }, t.type = "visualMap.continuous", t.defaultOption = la(zh.defaultOption, {
      align: "auto",
      calculable: !1,
      hoverLink: !0,
      realtime: !0,
      handleIcon: "path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",
      handleSize: "120%",
      handleStyle: {
        borderColor: "#fff",
        borderWidth: 1
      },
      indicatorIcon: "circle",
      indicatorSize: "50%",
      indicatorStyle: {
        borderColor: "#fff",
        borderWidth: 2,
        shadowBlur: 2,
        shadowOffsetX: 1,
        shadowOffsetY: 1,
        shadowColor: "rgba(0,0,0,0.2)"
      }
      // emphasis: {
      //     handleStyle: {
      //         shadowBlur: 3,
      //         shadowOffsetX: 1,
      //         shadowOffsetY: 1,
      //         shadowColor: 'rgba(0,0,0,0.2)'
      //     }
      // }
    }), t;
  }(zh)
);
function kA(r, t, e) {
  if (e[0] === e[1])
    return e.slice();
  for (var n = 200, i = (e[1] - e[0]) / n, a = e[0], o = [], s = 0; s <= n && a < e[1]; s++)
    o.push(a), a += i;
  return o.push(e[1]), o;
}
var _k = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e.autoPositionValues = {
        left: 1,
        right: 1,
        top: 1,
        bottom: 1
      }, e;
    }
    return t.prototype.init = function(e, n) {
      this.ecModel = e, this.api = n;
    }, t.prototype.render = function(e, n, i, a) {
      if (this.visualMapModel = e, e.get("show") === !1) {
        this.group.removeAll();
        return;
      }
      this.doRender(e, n, i, a);
    }, t.prototype.renderBackground = function(e) {
      var n = this.visualMapModel, i = Fs(n.get("padding") || 0), a = e.getBoundingRect();
      e.add(new ke({
        z2: -1,
        silent: !0,
        shape: {
          x: a.x - i[3],
          y: a.y - i[0],
          width: a.width + i[3] + i[1],
          height: a.height + i[0] + i[2]
        },
        style: {
          fill: n.get("backgroundColor"),
          stroke: n.get("borderColor"),
          lineWidth: n.get("borderWidth")
        }
      }));
    }, t.prototype.getControllerVisual = function(e, n, i) {
      i = i || {};
      var a = i.forceState, o = this.visualMapModel, s = {};
      if (n === "color") {
        var l = o.get("contentColor");
        s.color = l;
      }
      function u(v) {
        return s[v];
      }
      function c(v, d) {
        s[v] = d;
      }
      var f = o.controllerVisuals[a || o.getValueState(e)], h = Dt.prepareVisualTypes(f);
      return M(h, function(v) {
        var d = f[v];
        i.convertOpacityToAlpha && v === "opacity" && (v = "colorAlpha", d = f.__alphaForOpacity), Dt.dependsOn(v, n) && d && d.applyVisual(e, u, c);
      }), s[n];
    }, t.prototype.positionGroup = function(e) {
      var n = this.visualMapModel, i = this.api;
      xv(e, n.getBoxLayoutParams(), {
        width: i.getWidth(),
        height: i.getHeight()
      });
    }, t.prototype.doRender = function(e, n, i, a) {
    }, t.type = "visualMap", t;
  }(lt)
), RA = [["left", "right", "width"], ["top", "bottom", "height"]];
function bk(r, t, e) {
  var n = r.option, i = n.align;
  if (i != null && i !== "auto")
    return i;
  for (var a = {
    width: t.getWidth(),
    height: t.getHeight()
  }, o = n.orient === "horizontal" ? 1 : 0, s = RA[o], l = [0, null, 10], u = {}, c = 0; c < 3; c++)
    u[RA[1 - o][c]] = l[c], u[s[c]] = c === 2 ? e[0] : n[s[c]];
  var f = [["x", "width", 3], ["y", "height", 0]][o], h = St(u, a, n.padding);
  return s[(h.margin[f[2]] || 0) + h[f[0]] + h[f[1]] * 0.5 < a[f[1]] * 0.5 ? 0 : 1];
}
function Gf(r, t) {
  return M(r || [], function(e) {
    e.dataIndex != null && (e.dataIndexInside = e.dataIndex, e.dataIndex = null), e.highlightKey = "visualMap" + (t ? t.componentIndex : "");
  }), r;
}
var xn = Ye, qK = M, OA = Math.min, mg = Math.max, WK = 12, UK = 6, YK = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._shapes = {}, e._dataInterval = [], e._handleEnds = [], e._hoverLinkDataIndices = [], e;
    }
    return t.prototype.init = function(e, n) {
      r.prototype.init.call(this, e, n), this._hoverLinkFromSeriesMouseOver = Q(this._hoverLinkFromSeriesMouseOver, this), this._hideIndicator = Q(this._hideIndicator, this);
    }, t.prototype.doRender = function(e, n, i, a) {
      (!a || a.type !== "selectDataRange" || a.from !== this.uid) && this._buildView();
    }, t.prototype._buildView = function() {
      this.group.removeAll();
      var e = this.visualMapModel, n = this.group;
      this._orient = e.get("orient"), this._useHandle = e.get("calculable"), this._resetInterval(), this._renderBar(n);
      var i = e.get("text");
      this._renderEndsText(n, i, 0), this._renderEndsText(n, i, 1), this._updateView(!0), this.renderBackground(n), this._updateView(), this._enableHoverLinkToSeries(), this._enableHoverLinkFromSeries(), this.positionGroup(n);
    }, t.prototype._renderEndsText = function(e, n, i) {
      if (n) {
        var a = n[1 - i];
        a = a != null ? a + "" : "";
        var o = this.visualMapModel, s = o.get("textGap"), l = o.itemSize, u = this._shapes.mainGroup, c = this._applyTransform([l[0] / 2, i === 0 ? -s : l[1] + s], u), f = this._applyTransform(i === 0 ? "bottom" : "top", u), h = this._orient, v = this.visualMapModel.textStyleModel;
        this.group.add(new Fe({
          style: nt(v, {
            x: c[0],
            y: c[1],
            verticalAlign: h === "horizontal" ? "middle" : f,
            align: h === "horizontal" ? f : "center",
            text: a
          })
        }));
      }
    }, t.prototype._renderBar = function(e) {
      var n = this.visualMapModel, i = this._shapes, a = n.itemSize, o = this._orient, s = this._useHandle, l = bk(n, this.api, a), u = i.mainGroup = this._createBarGroup(l), c = new fe();
      u.add(c), c.add(i.outOfRange = FA()), c.add(i.inRange = FA(null, s ? NA(this._orient) : null, Q(this._dragHandle, this, "all", !1), Q(this._dragHandle, this, "all", !0))), c.setClipPath(new ke({
        shape: {
          x: 0,
          y: 0,
          width: a[0],
          height: a[1],
          r: 3
        }
      }));
      var f = n.textStyleModel.getTextRect("国"), h = mg(f.width, f.height);
      s && (i.handleThumbs = [], i.handleLabels = [], i.handleLabelPoints = [], this._createHandle(n, u, 0, a, h, o), this._createHandle(n, u, 1, a, h, o)), this._createIndicator(n, u, a, h, o), e.add(u);
    }, t.prototype._createHandle = function(e, n, i, a, o, s) {
      var l = Q(this._dragHandle, this, i, !1), u = Q(this._dragHandle, this, i, !0), c = ln(e.get("handleSize"), a[0]), f = yt(e.get("handleIcon"), -c / 2, -c / 2, c, c, null, !0), h = NA(this._orient);
      f.attr({
        cursor: h,
        draggable: !0,
        drift: l,
        ondragend: u,
        onmousemove: function(m) {
          ii(m.event);
        }
      }), f.x = a[0] / 2, f.useStyle(e.getModel("handleStyle").getItemStyle()), f.setStyle({
        strokeNoScale: !0,
        strokeFirst: !0
      }), f.style.lineWidth *= 2, f.ensureState("emphasis").style = e.getModel(["emphasis", "handleStyle"]).getItemStyle(), Ya(f, !0), n.add(f);
      var v = this.visualMapModel.textStyleModel, d = new Fe({
        cursor: h,
        draggable: !0,
        drift: l,
        onmousemove: function(m) {
          ii(m.event);
        },
        ondragend: u,
        style: nt(v, {
          x: 0,
          y: 0,
          text: ""
        })
      });
      d.ensureState("blur").style = {
        opacity: 0.1
      }, d.stateTransition = {
        duration: 200
      }, this.group.add(d);
      var p = [c, 0], g = this._shapes;
      g.handleThumbs[i] = f, g.handleLabelPoints[i] = p, g.handleLabels[i] = d;
    }, t.prototype._createIndicator = function(e, n, i, a, o) {
      var s = ln(e.get("indicatorSize"), i[0]), l = yt(e.get("indicatorIcon"), -s / 2, -s / 2, s, s, null, !0);
      l.attr({
        cursor: "move",
        invisible: !0,
        silent: !0,
        x: i[0] / 2
      });
      var u = e.getModel("indicatorStyle").getItemStyle();
      if (l instanceof Pt) {
        var c = l.style;
        l.useStyle(H({
          // TODO other properties like x, y ?
          image: c.image,
          x: c.x,
          y: c.y,
          width: c.width,
          height: c.height
        }, u));
      } else
        l.useStyle(u);
      n.add(l);
      var f = this.visualMapModel.textStyleModel, h = new Fe({
        silent: !0,
        invisible: !0,
        style: nt(f, {
          x: 0,
          y: 0,
          text: ""
        })
      });
      this.group.add(h);
      var v = [(o === "horizontal" ? a / 2 : UK) + i[0] / 2, 0], d = this._shapes;
      d.indicator = l, d.indicatorLabel = h, d.indicatorLabelPoint = v, this._firstShowIndicator = !0;
    }, t.prototype._dragHandle = function(e, n, i, a) {
      if (this._useHandle) {
        if (this._dragging = !n, !n) {
          var o = this._applyTransform([i, a], this._shapes.mainGroup, !0);
          this._updateInterval(e, o[1]), this._hideIndicator(), this._updateView();
        }
        n === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
          type: "selectDataRange",
          from: this.uid,
          visualMapId: this.visualMapModel.id,
          selected: this._dataInterval.slice()
        }), n ? !this._hovering && this._clearHoverLinkToSeries() : BA(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[e], !1);
      }
    }, t.prototype._resetInterval = function() {
      var e = this.visualMapModel, n = this._dataInterval = e.getSelected(), i = e.getExtent(), a = [0, e.itemSize[1]];
      this._handleEnds = [xn(n[0], i, a, !0), xn(n[1], i, a, !0)];
    }, t.prototype._updateInterval = function(e, n) {
      n = n || 0;
      var i = this.visualMapModel, a = this._handleEnds, o = [0, i.itemSize[1]];
      Mo(
        n,
        a,
        o,
        e,
        // cross is forbidden
        0
      );
      var s = i.getExtent();
      this._dataInterval = [xn(a[0], o, s, !0), xn(a[1], o, s, !0)];
    }, t.prototype._updateView = function(e) {
      var n = this.visualMapModel, i = n.getExtent(), a = this._shapes, o = [0, n.itemSize[1]], s = e ? o : this._handleEnds, l = this._createBarVisual(this._dataInterval, i, s, "inRange"), u = this._createBarVisual(i, i, o, "outOfRange");
      a.inRange.setStyle({
        fill: l.barColor
        // opacity: visualInRange.opacity
      }).setShape("points", l.barPoints), a.outOfRange.setStyle({
        fill: u.barColor
        // opacity: visualOutOfRange.opacity
      }).setShape("points", u.barPoints), this._updateHandle(s, l);
    }, t.prototype._createBarVisual = function(e, n, i, a) {
      var o = {
        forceState: a,
        convertOpacityToAlpha: !0
      }, s = this._makeColorGradient(e, o), l = [this.getControllerVisual(e[0], "symbolSize", o), this.getControllerVisual(e[1], "symbolSize", o)], u = this._createBarPoints(i, l);
      return {
        barColor: new Wu(0, 0, 0, 1, s),
        barPoints: u,
        handlesColor: [s[0].color, s[s.length - 1].color]
      };
    }, t.prototype._makeColorGradient = function(e, n) {
      var i = 100, a = [], o = (e[1] - e[0]) / i;
      a.push({
        color: this.getControllerVisual(e[0], "color", n),
        offset: 0
      });
      for (var s = 1; s < i; s++) {
        var l = e[0] + o * s;
        if (l > e[1])
          break;
        a.push({
          color: this.getControllerVisual(l, "color", n),
          offset: s / i
        });
      }
      return a.push({
        color: this.getControllerVisual(e[1], "color", n),
        offset: 1
      }), a;
    }, t.prototype._createBarPoints = function(e, n) {
      var i = this.visualMapModel.itemSize;
      return [[i[0] - n[0], e[0]], [i[0], e[0]], [i[0], e[1]], [i[0] - n[1], e[1]]];
    }, t.prototype._createBarGroup = function(e) {
      var n = this._orient, i = this.visualMapModel.get("inverse");
      return new fe(n === "horizontal" && !i ? {
        scaleX: e === "bottom" ? 1 : -1,
        rotation: Math.PI / 2
      } : n === "horizontal" && i ? {
        scaleX: e === "bottom" ? -1 : 1,
        rotation: -Math.PI / 2
      } : n === "vertical" && !i ? {
        scaleX: e === "left" ? 1 : -1,
        scaleY: -1
      } : {
        scaleX: e === "left" ? 1 : -1
      });
    }, t.prototype._updateHandle = function(e, n) {
      if (this._useHandle) {
        var i = this._shapes, a = this.visualMapModel, o = i.handleThumbs, s = i.handleLabels, l = a.itemSize, u = a.getExtent(), c = this._applyTransform("left", i.mainGroup);
        qK([0, 1], function(f) {
          var h = o[f];
          h.setStyle("fill", n.handlesColor[f]), h.y = e[f];
          var v = xn(e[f], [0, l[1]], u, !0), d = this.getControllerVisual(v, "symbolSize");
          h.scaleX = h.scaleY = d / l[0], h.x = l[0] - d / 2;
          var p = an(i.handleLabelPoints[f], oo(h, this.group));
          if (this._orient === "horizontal") {
            var g = c === "left" || c === "top" ? (l[0] - d) / 2 : (l[0] - d) / -2;
            p[1] += g;
          }
          s[f].setStyle({
            x: p[0],
            y: p[1],
            text: a.formatValueText(this._dataInterval[f]),
            verticalAlign: "middle",
            align: this._orient === "vertical" ? this._applyTransform("left", i.mainGroup) : "center"
          });
        }, this);
      }
    }, t.prototype._showIndicator = function(e, n, i, a) {
      var o = this.visualMapModel, s = o.getExtent(), l = o.itemSize, u = [0, l[1]], c = this._shapes, f = c.indicator;
      if (f) {
        f.attr("invisible", !1);
        var h = {
          convertOpacityToAlpha: !0
        }, v = this.getControllerVisual(e, "color", h), d = this.getControllerVisual(e, "symbolSize"), p = xn(e, s, u, !0), g = l[0] - d / 2, m = {
          x: f.x,
          y: f.y
        };
        f.y = p, f.x = g;
        var y = an(c.indicatorLabelPoint, oo(f, this.group)), _ = c.indicatorLabel;
        _.attr("invisible", !1);
        var b = this._applyTransform("left", c.mainGroup), S = this._orient, x = S === "horizontal";
        _.setStyle({
          text: (i || "") + o.formatValueText(n),
          verticalAlign: x ? b : "middle",
          align: x ? "center" : b
        });
        var w = {
          x: g,
          y: p,
          style: {
            fill: v
          }
        }, C = {
          style: {
            x: y[0],
            y: y[1]
          }
        };
        if (o.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
          var D = {
            duration: 100,
            easing: "cubicInOut",
            additive: !0
          };
          f.x = m.x, f.y = m.y, f.animateTo(w, D), _.animateTo(C, D);
        } else
          f.attr(w), _.attr(C);
        this._firstShowIndicator = !1;
        var A = this._shapes.handleLabels;
        if (A)
          for (var T = 0; T < A.length; T++)
            this.api.enterBlur(A[T]);
      }
    }, t.prototype._enableHoverLinkToSeries = function() {
      var e = this;
      this._shapes.mainGroup.on("mousemove", function(n) {
        if (e._hovering = !0, !e._dragging) {
          var i = e.visualMapModel.itemSize, a = e._applyTransform([n.offsetX, n.offsetY], e._shapes.mainGroup, !0, !0);
          a[1] = OA(mg(0, a[1]), i[1]), e._doHoverLinkToSeries(a[1], 0 <= a[0] && a[0] <= i[0]);
        }
      }).on("mouseout", function() {
        e._hovering = !1, !e._dragging && e._clearHoverLinkToSeries();
      });
    }, t.prototype._enableHoverLinkFromSeries = function() {
      var e = this.api.getZr();
      this.visualMapModel.option.hoverLink ? (e.on("mouseover", this._hoverLinkFromSeriesMouseOver, this), e.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries();
    }, t.prototype._doHoverLinkToSeries = function(e, n) {
      var i = this.visualMapModel, a = i.itemSize;
      if (i.option.hoverLink) {
        var o = [0, a[1]], s = i.getExtent();
        e = OA(mg(o[0], e), o[1]);
        var l = ZK(i, s, o), u = [e - l, e + l], c = xn(e, o, s, !0), f = [xn(u[0], o, s, !0), xn(u[1], o, s, !0)];
        u[0] < o[0] && (f[0] = -1 / 0), u[1] > o[1] && (f[1] = 1 / 0), n && (f[0] === -1 / 0 ? this._showIndicator(c, f[1], "< ", l) : f[1] === 1 / 0 ? this._showIndicator(c, f[0], "> ", l) : this._showIndicator(c, c, "≈ ", l));
        var h = this._hoverLinkDataIndices, v = [];
        (n || BA(i)) && (v = this._hoverLinkDataIndices = i.findTargetDataIndices(f));
        var d = rN(h, v);
        this._dispatchHighDown("downplay", Gf(d[0], i)), this._dispatchHighDown("highlight", Gf(d[1], i));
      }
    }, t.prototype._hoverLinkFromSeriesMouseOver = function(e) {
      var n;
      if (Xa(e.target, function(l) {
        var u = pe(l);
        if (u.dataIndex != null)
          return n = u, !0;
      }, !0), !!n) {
        var i = this.ecModel.getSeriesByIndex(n.seriesIndex), a = this.visualMapModel;
        if (a.isTargetSeries(i)) {
          var o = i.getData(n.dataType), s = o.getStore().get(a.getDataDimensionIndex(o), n.dataIndex);
          isNaN(s) || this._showIndicator(s, s);
        }
      }
    }, t.prototype._hideIndicator = function() {
      var e = this._shapes;
      e.indicator && e.indicator.attr("invisible", !0), e.indicatorLabel && e.indicatorLabel.attr("invisible", !0);
      var n = this._shapes.handleLabels;
      if (n)
        for (var i = 0; i < n.length; i++)
          this.api.leaveBlur(n[i]);
    }, t.prototype._clearHoverLinkToSeries = function() {
      this._hideIndicator();
      var e = this._hoverLinkDataIndices;
      this._dispatchHighDown("downplay", Gf(e, this.visualMapModel)), e.length = 0;
    }, t.prototype._clearHoverLinkFromSeries = function() {
      this._hideIndicator();
      var e = this.api.getZr();
      e.off("mouseover", this._hoverLinkFromSeriesMouseOver), e.off("mouseout", this._hideIndicator);
    }, t.prototype._applyTransform = function(e, n, i, a) {
      var o = oo(n, a ? null : this.group);
      return q(e) ? an(e, o, i) : pv(e, o, i);
    }, t.prototype._dispatchHighDown = function(e, n) {
      n && n.length && this.api.dispatchAction({
        type: e,
        batch: n
      });
    }, t.prototype.dispose = function() {
      this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries();
    }, t.type = "visualMap.continuous", t;
  }(_k)
);
function FA(r, t, e, n) {
  return new ar({
    shape: {
      points: r
    },
    draggable: !!e,
    cursor: t,
    drift: e,
    onmousemove: function(i) {
      ii(i.event);
    },
    ondragend: n
  });
}
function ZK(r, t, e) {
  var n = WK / 2, i = r.get("hoverLinkDataSize");
  return i && (n = xn(i, t, e, !0) / 2), n;
}
function BA(r) {
  var t = r.get("hoverLinkOnHandle");
  return !!(t ?? r.get("realtime"));
}
function NA(r) {
  return r === "vertical" ? "ns-resize" : "ew-resize";
}
var XK = {
  type: "selectDataRange",
  event: "dataRangeSelected",
  // FIXME use updateView appears wrong
  update: "update"
}, jK = function(r, t) {
  t.eachComponent({
    mainType: "visualMap",
    query: r
  }, function(e) {
    e.setSelected(r.selected);
  });
}, KK = [
  {
    createOnAllSeries: !0,
    reset: function(r, t) {
      var e = [];
      return t.eachComponent("visualMap", function(n) {
        var i = r.pipelineContext;
        !n.isTargetSeries(r) || i && i.large || e.push(_j(n.stateList, n.targetVisuals, Q(n.getValueState, n), n.getDataDimensionIndex(r.getData())));
      }), e;
    }
  },
  // Only support color.
  {
    createOnAllSeries: !0,
    reset: function(r, t) {
      var e = r.getData(), n = [];
      t.eachComponent("visualMap", function(i) {
        if (i.isTargetSeries(r)) {
          var a = i.getVisualMeta(Q(JK, null, r, i)) || {
            stops: [],
            outerColors: []
          }, o = i.getDataDimensionIndex(e);
          o >= 0 && (a.dimension = o, n.push(a));
        }
      }), r.getData().setVisual("visualMeta", n);
    }
  }
];
function JK(r, t, e, n) {
  for (var i = t.targetVisuals[n], a = Dt.prepareVisualTypes(i), o = {
    color: Xu(r.getData(), "color")
    // default color.
  }, s = 0, l = a.length; s < l; s++) {
    var u = a[s], c = i[u === "opacity" ? "__alphaForOpacity" : u];
    c && c.applyVisual(e, f, h);
  }
  return o.color;
  function f(v) {
    return o[v];
  }
  function h(v, d) {
    o[v] = d;
  }
}
var zA = M;
function QK(r) {
  var t = r && r.visualMap;
  q(t) || (t = t ? [t] : []), zA(t, function(e) {
    if (e) {
      jo(e, "splitList") && !jo(e, "pieces") && (e.pieces = e.splitList, delete e.splitList);
      var n = e.pieces;
      n && q(n) && zA(n, function(i) {
        ue(i) && (jo(i, "start") && !jo(i, "min") && (i.min = i.start), jo(i, "end") && !jo(i, "max") && (i.max = i.end));
      });
    }
  });
}
function jo(r, t) {
  return r && r.hasOwnProperty && r.hasOwnProperty(t);
}
var VA = !1;
function Sk(r) {
  VA || (VA = !0, r.registerSubTypeDefaulter("visualMap", function(t) {
    return !t.categories && (!(t.pieces ? t.pieces.length > 0 : t.splitNumber > 0) || t.calculable) ? "continuous" : "piecewise";
  }), r.registerAction(XK, jK), M(KK, function(t) {
    r.registerVisual(r.PRIORITY.VISUAL.COMPONENT, t);
  }), r.registerPreprocessor(QK));
}
function xk(r) {
  r.registerComponentModel(HK), r.registerComponentView(YK), Sk(r);
}
var eJ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e._pieceList = [], e;
    }
    return t.prototype.optionUpdated = function(e, n) {
      r.prototype.optionUpdated.apply(this, arguments), this.resetExtent();
      var i = this._mode = this._determineMode();
      this._pieceList = [], tJ[this._mode].call(this, this._pieceList), this._resetSelected(e, n);
      var a = this.option.categories;
      this.resetVisual(function(o, s) {
        i === "categories" ? (o.mappingMethod = "category", o.categories = ce(a)) : (o.dataExtent = this.getExtent(), o.mappingMethod = "piecewise", o.pieceList = U(this._pieceList, function(l) {
          return l = ce(l), s !== "inRange" && (l.visual = null), l;
        }));
      });
    }, t.prototype.completeVisualOption = function() {
      var e = this.option, n = {}, i = Dt.listVisualTypes(), a = this.isCategory();
      M(e.pieces, function(s) {
        M(i, function(l) {
          s.hasOwnProperty(l) && (n[l] = 1);
        });
      }), M(n, function(s, l) {
        var u = !1;
        M(this.stateList, function(c) {
          u = u || o(e, c, l) || o(e.target, c, l);
        }, this), !u && M(this.stateList, function(c) {
          (e[c] || (e[c] = {}))[l] = yk.get(l, c === "inRange" ? "active" : "inactive", a);
        });
      }, this);
      function o(s, l, u) {
        return s && s[l] && s[l].hasOwnProperty(u);
      }
      r.prototype.completeVisualOption.apply(this, arguments);
    }, t.prototype._resetSelected = function(e, n) {
      var i = this.option, a = this._pieceList, o = (n ? i : e).selected || {};
      if (i.selected = o, M(a, function(l, u) {
        var c = this.getSelectedMapKey(l);
        o.hasOwnProperty(c) || (o[c] = !0);
      }, this), i.selectedMode === "single") {
        var s = !1;
        M(a, function(l, u) {
          var c = this.getSelectedMapKey(l);
          o[c] && (s ? o[c] = !1 : s = !0);
        }, this);
      }
    }, t.prototype.getItemSymbol = function() {
      return this.get("itemSymbol");
    }, t.prototype.getSelectedMapKey = function(e) {
      return this._mode === "categories" ? e.value + "" : e.index + "";
    }, t.prototype.getPieceList = function() {
      return this._pieceList;
    }, t.prototype._determineMode = function() {
      var e = this.option;
      return e.pieces && e.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
    }, t.prototype.setSelected = function(e) {
      this.option.selected = ce(e);
    }, t.prototype.getValueState = function(e) {
      var n = Dt.findPieceIndex(e, this._pieceList);
      return n != null && this.option.selected[this.getSelectedMapKey(this._pieceList[n])] ? "inRange" : "outOfRange";
    }, t.prototype.findTargetDataIndices = function(e) {
      var n = [], i = this._pieceList;
      return this.eachTargetSeries(function(a) {
        var o = [], s = a.getData();
        s.each(this.getDataDimensionIndex(s), function(l, u) {
          var c = Dt.findPieceIndex(l, i);
          c === e && o.push(u);
        }, this), n.push({
          seriesId: a.id,
          dataIndex: o
        });
      }, this), n;
    }, t.prototype.getRepresentValue = function(e) {
      var n;
      if (this.isCategory())
        n = e.value;
      else if (e.value != null)
        n = e.value;
      else {
        var i = e.interval || [];
        n = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2;
      }
      return n;
    }, t.prototype.getVisualMeta = function(e) {
      if (this.isCategory())
        return;
      var n = [], i = ["", ""], a = this;
      function o(c, f) {
        var h = a.getRepresentValue({
          interval: c
        });
        f || (f = a.getValueState(h));
        var v = e(h, f);
        c[0] === -1 / 0 ? i[0] = v : c[1] === 1 / 0 ? i[1] = v : n.push({
          value: c[0],
          color: v
        }, {
          value: c[1],
          color: v
        });
      }
      var s = this._pieceList.slice();
      if (!s.length)
        s.push({
          interval: [-1 / 0, 1 / 0]
        });
      else {
        var l = s[0].interval[0];
        l !== -1 / 0 && s.unshift({
          interval: [-1 / 0, l]
        }), l = s[s.length - 1].interval[1], l !== 1 / 0 && s.push({
          interval: [l, 1 / 0]
        });
      }
      var u = -1 / 0;
      return M(s, function(c) {
        var f = c.interval;
        f && (f[0] > u && o([u, f[0]], "outOfRange"), o(f.slice()), u = f[1]);
      }, this), {
        stops: n,
        outerColors: i
      };
    }, t.type = "visualMap.piecewise", t.defaultOption = la(zh.defaultOption, {
      selected: null,
      minOpen: !1,
      maxOpen: !1,
      align: "auto",
      itemWidth: 20,
      itemHeight: 14,
      itemSymbol: "roundRect",
      pieces: null,
      categories: null,
      splitNumber: 5,
      selectedMode: "multiple",
      itemGap: 10,
      hoverLink: !0
      // Enable hover highlight.
    }), t;
  }(zh)
), tJ = {
  splitNumber: function(r) {
    var t = this.option, e = Math.min(t.precision, 20), n = this.getExtent(), i = t.splitNumber;
    i = Math.max(parseInt(i, 10), 1), t.splitNumber = i;
    for (var a = (n[1] - n[0]) / i; +a.toFixed(e) !== a && e < 5; )
      e++;
    t.precision = e, a = +a.toFixed(e), t.minOpen && r.push({
      interval: [-1 / 0, n[0]],
      close: [0, 0]
    });
    for (var o = 0, s = n[0]; o < i; s += a, o++) {
      var l = o === i - 1 ? n[1] : s + a;
      r.push({
        interval: [s, l],
        close: [1, 1]
      });
    }
    t.maxOpen && r.push({
      interval: [n[1], 1 / 0],
      close: [0, 0]
    }), kb(r), M(r, function(u, c) {
      u.index = c, u.text = this.formatValueText(u.interval);
    }, this);
  },
  categories: function(r) {
    var t = this.option;
    M(t.categories, function(e) {
      r.push({
        text: this.formatValueText(e, !0),
        value: e
      });
    }, this), $A(t, r);
  },
  pieces: function(r) {
    var t = this.option;
    M(t.pieces, function(e, n) {
      ue(e) || (e = {
        value: e
      });
      var i = {
        text: "",
        index: n
      };
      if (e.label != null && (i.text = e.label), e.hasOwnProperty("value")) {
        var a = i.value = e.value;
        i.interval = [a, a], i.close = [1, 1];
      } else {
        for (var o = i.interval = [], s = i.close = [0, 0], l = [1, 0, 1], u = [-1 / 0, 1 / 0], c = [], f = 0; f < 2; f++) {
          for (var h = [["gte", "gt", "min"], ["lte", "lt", "max"]][f], v = 0; v < 3 && o[f] == null; v++)
            o[f] = e[h[v]], s[f] = l[v], c[f] = v === 2;
          o[f] == null && (o[f] = u[f]);
        }
        c[0] && o[1] === 1 / 0 && (s[0] = 0), c[1] && o[0] === -1 / 0 && (s[1] = 0), o[0] === o[1] && s[0] && s[1] && (i.value = o[0]);
      }
      i.visual = Dt.retrieveVisuals(e), r.push(i);
    }, this), $A(t, r), kb(r), M(r, function(e) {
      var n = e.close, i = [["<", "≤"][n[1]], [">", "≥"][n[0]]];
      e.text = e.text || this.formatValueText(e.value != null ? e.value : e.interval, !1, i);
    }, this);
  }
};
function $A(r, t) {
  var e = r.inverse;
  (r.orient === "vertical" ? !e : e) && t.reverse();
}
var rJ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.doRender = function() {
      var e = this.group;
      e.removeAll();
      var n = this.visualMapModel, i = n.get("textGap"), a = n.textStyleModel, o = a.getFont(), s = a.getTextColor(), l = this._getItemAlign(), u = n.itemSize, c = this._getViewData(), f = c.endsText, h = Et(n.get("showLabel", !0), !f), v = !n.get("selectedMode");
      f && this._renderEndsText(e, f[0], u, h, l), M(c.viewPieceList, function(d) {
        var p = d.piece, g = new fe();
        g.onclick = Q(this._onItemClick, this, p), this._enableHoverLink(g, d.indexInModelPieceList);
        var m = n.getRepresentValue(p);
        if (this._createItemSymbol(g, m, [0, 0, u[0], u[1]], v), h) {
          var y = this.visualMapModel.getValueState(m);
          g.add(new Fe({
            style: {
              x: l === "right" ? -i : u[0] + i,
              y: u[1] / 2,
              text: p.text,
              verticalAlign: "middle",
              align: l,
              font: o,
              fill: s,
              opacity: y === "outOfRange" ? 0.5 : 1
            },
            silent: v
          }));
        }
        e.add(g);
      }, this), f && this._renderEndsText(e, f[1], u, h, l), so(n.get("orient"), e, n.get("itemGap")), this.renderBackground(e), this.positionGroup(e);
    }, t.prototype._enableHoverLink = function(e, n) {
      var i = this;
      e.on("mouseover", function() {
        return a("highlight");
      }).on("mouseout", function() {
        return a("downplay");
      });
      var a = function(o) {
        var s = i.visualMapModel;
        s.option.hoverLink && i.api.dispatchAction({
          type: o,
          batch: Gf(s.findTargetDataIndices(n), s)
        });
      };
    }, t.prototype._getItemAlign = function() {
      var e = this.visualMapModel, n = e.option;
      if (n.orient === "vertical")
        return bk(e, this.api, e.itemSize);
      var i = n.align;
      return (!i || i === "auto") && (i = "left"), i;
    }, t.prototype._renderEndsText = function(e, n, i, a, o) {
      if (n) {
        var s = new fe(), l = this.visualMapModel.textStyleModel;
        s.add(new Fe({
          style: nt(l, {
            x: a ? o === "right" ? i[0] : 0 : i[0] / 2,
            y: i[1] / 2,
            verticalAlign: "middle",
            align: a ? o : "center",
            text: n
          })
        })), e.add(s);
      }
    }, t.prototype._getViewData = function() {
      var e = this.visualMapModel, n = U(e.getPieceList(), function(s, l) {
        return {
          piece: s,
          indexInModelPieceList: l
        };
      }), i = e.get("text"), a = e.get("orient"), o = e.get("inverse");
      return (a === "horizontal" ? o : !o) ? n.reverse() : i && (i = i.slice().reverse()), {
        viewPieceList: n,
        endsText: i
      };
    }, t.prototype._createItemSymbol = function(e, n, i, a) {
      var o = yt(
        // symbol will be string
        this.getControllerVisual(n, "symbol"),
        i[0],
        i[1],
        i[2],
        i[3],
        // color will be string
        this.getControllerVisual(n, "color")
      );
      o.silent = a, e.add(o);
    }, t.prototype._onItemClick = function(e) {
      var n = this.visualMapModel, i = n.option, a = i.selectedMode;
      if (a) {
        var o = ce(i.selected), s = n.getSelectedMapKey(e);
        a === "single" || a === !0 ? (o[s] = !0, M(o, function(l, u) {
          o[u] = u === s;
        })) : o[s] = !o[s], this.api.dispatchAction({
          type: "selectDataRange",
          from: this.uid,
          visualMapId: this.visualMapModel.id,
          selected: o
        });
      }
    }, t.type = "visualMap.piecewise", t;
  }(_k)
);
function wk(r) {
  r.registerComponentModel(eJ), r.registerComponentView(rJ), Sk(r);
}
function nJ(r) {
  De(xk), De(wk);
}
var iJ = {
  label: {
    enabled: !0
  },
  decal: {
    show: !1
  }
}, GA = Oe(), aJ = {};
function oJ(r, t) {
  var e = r.getModel("aria");
  if (!e.get("enabled"))
    return;
  var n = ce(iJ);
  _e(n.label, r.getLocaleModel().get("aria"), !1), _e(e.option, n, !1), i(), a();
  function i() {
    var u = e.getModel("decal"), c = u.get("show");
    if (c) {
      var f = re();
      r.eachSeries(function(h) {
        if (!h.isColorBySeries()) {
          var v = f.get(h.type);
          v || (v = {}, f.set(h.type, v)), GA(h).scope = v;
        }
      }), r.eachRawSeries(function(h) {
        if (r.isSeriesFiltered(h))
          return;
        if (oe(h.enableAriaDecal)) {
          h.enableAriaDecal();
          return;
        }
        var v = h.getData();
        if (h.isColorBySeries()) {
          var y = bm(h.ecModel, h.name, aJ, r.getSeriesCount()), _ = v.getVisual("decal");
          v.setVisual("decal", b(_, y));
        } else {
          var d = h.getRawData(), p = {}, g = GA(h).scope;
          v.each(function(S) {
            var x = v.getRawIndex(S);
            p[x] = S;
          });
          var m = d.count();
          d.each(function(S) {
            var x = p[S], w = d.getName(S) || S + "", C = bm(h.ecModel, w, g, m), D = v.getItemVisual(x, "decal");
            v.setItemVisual(x, "decal", b(D, C));
          });
        }
        function b(S, x) {
          var w = S ? H(H({}, x), S) : x;
          return w.dirty = !0, w;
        }
      });
    }
  }
  function a() {
    var u = t.getZr().dom;
    if (u) {
      var c = r.getLocaleModel().get("aria"), f = e.getModel("label");
      if (f.option = se(f.option, c), !!f.get("enabled")) {
        if (u.setAttribute("role", "img"), f.get("description")) {
          u.setAttribute("aria-label", f.get("description"));
          return;
        }
        var h = r.getSeriesCount(), v = f.get(["data", "maxCount"]) || 10, d = f.get(["series", "maxCount"]) || 10, p = Math.min(h, d), g;
        if (!(h < 1)) {
          var m = s();
          if (m) {
            var y = f.get(["general", "withTitle"]);
            g = o(y, {
              title: m
            });
          } else
            g = f.get(["general", "withoutTitle"]);
          var _ = [], b = h > 1 ? f.get(["series", "multiple", "prefix"]) : f.get(["series", "single", "prefix"]);
          g += o(b, {
            seriesCount: h
          }), r.eachSeries(function(C, D) {
            if (D < p) {
              var A = void 0, T = C.get("name"), L = T ? "withName" : "withoutName";
              A = h > 1 ? f.get(["series", "multiple", L]) : f.get(["series", "single", L]), A = o(A, {
                seriesId: C.seriesIndex,
                seriesName: C.get("name"),
                seriesType: l(C.subType)
              });
              var E = C.getData();
              if (E.count() > v) {
                var I = f.get(["data", "partialData"]);
                A += o(I, {
                  displayCnt: v
                });
              } else
                A += f.get(["data", "allData"]);
              for (var P = f.get(["data", "separator", "middle"]), R = f.get(["data", "separator", "end"]), F = f.get(["data", "excludeDimensionId"]), O = [], z = 0; z < E.count(); z++)
                if (z < v) {
                  var G = E.getName(z), W = F ? qe(E.getValues(z), function(j, ee) {
                    return we(F, ee) === -1;
                  }) : E.getValues(z), Y = f.get(["data", G ? "withName" : "withoutName"]);
                  O.push(o(Y, {
                    name: G,
                    value: W.join(P)
                  }));
                }
              A += O.join(P) + R, _.push(A);
            }
          });
          var S = f.getModel(["series", "multiple", "separator"]), x = S.get("middle"), w = S.get("end");
          g += _.join(x) + w, u.setAttribute("aria-label", g);
        }
      }
    }
  }
  function o(u, c) {
    if (!J(u))
      return u;
    var f = u;
    return M(c, function(h, v) {
      f = f.replace(new RegExp("\\{\\s*" + v + "\\s*\\}", "g"), h);
    }), f;
  }
  function s() {
    var u = r.get("title");
    return u && u.length && (u = u[0]), u && u.text;
  }
  function l(u) {
    var c = r.getLocaleModel().get(["series", "typeNames"]);
    return c[u] || c.chart;
  }
}
function sJ(r) {
  if (!(!r || !r.aria)) {
    var t = r.aria;
    t.show != null && (t.enabled = t.show), t.label = t.label || {}, M(["description", "general", "series", "data"], function(e) {
      t[e] != null && (t.label[e] = t[e]);
    });
  }
}
function lJ(r) {
  r.registerPreprocessor(sJ), r.registerVisual(r.PRIORITY.VISUAL.ARIA, oJ);
}
var HA = {
  value: "eq",
  // PENDING: not good for literal semantic?
  "<": "lt",
  "<=": "lte",
  ">": "gt",
  ">=": "gte",
  "=": "eq",
  "!=": "ne",
  "<>": "ne"
  // Might be misleading for sake of the difference between '==' and '===',
  // so don't support them.
  // '==': 'eq',
  // '===': 'seq',
  // '!==': 'sne'
  // PENDING: Whether support some common alias "ge", "le", "neq"?
  // ge: 'gte',
  // le: 'lte',
  // neq: 'ne',
}, uJ = (
  /** @class */
  function() {
    function r(t) {
      var e = this._condVal = J(t) ? new RegExp(t) : x3(t) ? t : null;
      if (e == null) {
        var n = "";
        He(n);
      }
    }
    return r.prototype.evaluate = function(t) {
      var e = typeof t;
      return J(e) ? this._condVal.test(t) : Be(e) ? this._condVal.test(t + "") : !1;
    }, r;
  }()
), cJ = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.evaluate = function() {
      return this.value;
    }, r;
  }()
), fJ = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.evaluate = function() {
      for (var t = this.children, e = 0; e < t.length; e++)
        if (!t[e].evaluate())
          return !1;
      return !0;
    }, r;
  }()
), hJ = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.evaluate = function() {
      for (var t = this.children, e = 0; e < t.length; e++)
        if (t[e].evaluate())
          return !0;
      return !1;
    }, r;
  }()
), vJ = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.evaluate = function() {
      return !this.child.evaluate();
    }, r;
  }()
), dJ = (
  /** @class */
  function() {
    function r() {
    }
    return r.prototype.evaluate = function() {
      for (var t = !!this.valueParser, e = this.getValue, n = e(this.valueGetterParam), i = t ? this.valueParser(n) : null, a = 0; a < this.subCondList.length; a++)
        if (!this.subCondList[a].evaluate(t ? i : n))
          return !1;
      return !0;
    }, r;
  }()
);
function K_(r, t) {
  if (r === !0 || r === !1) {
    var e = new cJ();
    return e.value = r, e;
  }
  var n = "";
  return Ck(r) || He(n), r.and ? qA("and", r, t) : r.or ? qA("or", r, t) : r.not ? pJ(r, t) : gJ(r, t);
}
function qA(r, t, e) {
  var n = t[r], i = "";
  q(n) || He(i), n.length || He(i);
  var a = r === "and" ? new fJ() : new hJ();
  return a.children = U(n, function(o) {
    return K_(o, e);
  }), a.children.length || He(i), a;
}
function pJ(r, t) {
  var e = r.not, n = "";
  Ck(e) || He(n);
  var i = new vJ();
  return i.child = K_(e, t), i.child || He(n), i;
}
function gJ(r, t) {
  for (var e = "", n = t.prepareGetValue(r), i = [], a = Ee(r), o = r.parser, s = o ? aI(o) : null, l = 0; l < a.length; l++) {
    var u = a[l];
    if (!(u === "parser" || t.valueGetterAttrMap.get(u))) {
      var c = te(HA, u) ? HA[u] : u, f = r[u], h = s ? s(f) : f, v = i4(c, h) || c === "reg" && new uJ(h);
      v || He(e), i.push(v);
    }
  }
  i.length || He(e);
  var d = new dJ();
  return d.valueGetterParam = n, d.valueParser = s, d.getValue = t.getValue, d.subCondList = i, d;
}
function Ck(r) {
  return ue(r) && !qt(r);
}
var mJ = (
  /** @class */
  function() {
    function r(t, e) {
      this._cond = K_(t, e);
    }
    return r.prototype.evaluate = function() {
      return this._cond.evaluate();
    }, r;
  }()
);
function yJ(r, t) {
  return new mJ(r, t);
}
var _J = {
  type: "echarts:filter",
  // PENDING: enhance to filter by index rather than create new data
  transform: function(r) {
    for (var t = r.upstream, e, n = yJ(r.config, {
      valueGetterAttrMap: re({
        dimension: !0
      }),
      prepareGetValue: function(s) {
        var l = "", u = s.dimension;
        te(s, "dimension") || He(l);
        var c = t.getDimensionInfo(u);
        return c || He(l), {
          dimIdx: c.index
        };
      },
      getValue: function(s) {
        return t.retrieveValueFromItem(e, s.dimIdx);
      }
    }), i = [], a = 0, o = t.count(); a < o; a++)
      e = t.getRawDataItem(a), n.evaluate() && i.push(e);
    return {
      data: i
    };
  }
}, bJ = {
  type: "echarts:sort",
  transform: function(r) {
    var t = r.upstream, e = r.config, n = "", i = je(e);
    i.length || He(n);
    var a = [];
    M(i, function(c) {
      var f = c.dimension, h = c.order, v = c.parser, d = c.incomparable;
      if (f == null && He(n), h !== "asc" && h !== "desc" && He(n), d && d !== "min" && d !== "max") {
        var p = "";
        He(p);
      }
      if (h !== "asc" && h !== "desc") {
        var g = "";
        He(g);
      }
      var m = t.getDimensionInfo(f);
      m || He(n);
      var y = v ? aI(v) : null;
      v && !y && He(n), a.push({
        dimIdx: m.index,
        parser: y,
        comparator: new sI(h, d)
      });
    });
    var o = t.sourceFormat;
    o !== Wt && o !== Yr && He(n);
    for (var s = [], l = 0, u = t.count(); l < u; l++)
      s.push(t.getRawDataItem(l));
    return s.sort(function(c, f) {
      for (var h = 0; h < a.length; h++) {
        var v = a[h], d = t.retrieveValueFromItem(c, v.dimIdx), p = t.retrieveValueFromItem(f, v.dimIdx);
        v.parser && (d = v.parser(d), p = v.parser(p));
        var g = v.comparator.evaluate(d, p);
        if (g !== 0)
          return g;
      }
      return 0;
    }), {
      data: s
    };
  }
};
function SJ(r) {
  r.registerTransform(_J), r.registerTransform(bJ);
}
var xJ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "dataset", e;
    }
    return t.prototype.init = function(e, n, i) {
      r.prototype.init.call(this, e, n, i), this._sourceManager = new fI(this), WS(this);
    }, t.prototype.mergeOption = function(e, n) {
      r.prototype.mergeOption.call(this, e, n), WS(this);
    }, t.prototype.optionUpdated = function() {
      this._sourceManager.dirty();
    }, t.prototype.getSourceManager = function() {
      return this._sourceManager;
    }, t.type = "dataset", t.defaultOption = {
      seriesLayoutBy: Pn
    }, t;
  }(Le)
), wJ = (
  /** @class */
  function(r) {
    N(t, r);
    function t() {
      var e = r !== null && r.apply(this, arguments) || this;
      return e.type = "dataset", e;
    }
    return t.type = "dataset", t;
  }(lt)
);
function CJ(r) {
  r.registerComponentModel(xJ), r.registerComponentView(wJ);
}
var bn = Bn.CMD;
function ls(r, t) {
  return Math.abs(r - t) < 1e-5;
}
function Sy(r) {
  var t = r.data, e = r.len(), n = [], i, a = 0, o = 0, s = 0, l = 0;
  function u(E, I) {
    i && i.length > 2 && n.push(i), i = [E, I];
  }
  function c(E, I, P, R) {
    ls(E, P) && ls(I, R) || i.push(E, I, P, R, P, R);
  }
  function f(E, I, P, R, F, O) {
    var z = Math.abs(I - E), G = Math.tan(z / 4) * 4 / 3, W = I < E ? -1 : 1, Y = Math.cos(E), j = Math.sin(E), ee = Math.cos(I), ie = Math.sin(I), Me = Y * F + P, We = j * O + R, ve = ee * F + P, ae = ie * O + R, be = F * G * W, ne = O * G * W;
    i.push(Me - be * j, We + ne * Y, ve + be * ie, ae - ne * ee, ve, ae);
  }
  for (var h, v, d, p, g = 0; g < e; ) {
    var m = t[g++], y = g === 1;
    switch (y && (a = t[g], o = t[g + 1], s = a, l = o, (m === bn.L || m === bn.C || m === bn.Q) && (i = [s, l])), m) {
      case bn.M:
        a = s = t[g++], o = l = t[g++], u(s, l);
        break;
      case bn.L:
        h = t[g++], v = t[g++], c(a, o, h, v), a = h, o = v;
        break;
      case bn.C:
        i.push(t[g++], t[g++], t[g++], t[g++], a = t[g++], o = t[g++]);
        break;
      case bn.Q:
        h = t[g++], v = t[g++], d = t[g++], p = t[g++], i.push(a + 2 / 3 * (h - a), o + 2 / 3 * (v - o), d + 2 / 3 * (h - d), p + 2 / 3 * (v - p), d, p), a = d, o = p;
        break;
      case bn.A:
        var _ = t[g++], b = t[g++], S = t[g++], x = t[g++], w = t[g++], C = t[g++] + w;
        g += 1;
        var D = !t[g++];
        h = Math.cos(w) * S + _, v = Math.sin(w) * x + b, y ? (s = h, l = v, u(s, l)) : c(a, o, h, v), a = Math.cos(C) * S + _, o = Math.sin(C) * x + b;
        for (var A = (D ? -1 : 1) * Math.PI / 2, T = w; D ? T > C : T < C; T += A) {
          var L = D ? Math.max(T + A, C) : Math.min(T + A, C);
          f(T, L, _, b, S, x);
        }
        break;
      case bn.R:
        s = a = t[g++], l = o = t[g++], h = s + t[g++], v = l + t[g++], u(h, l), c(h, l, h, v), c(h, v, s, v), c(s, v, s, l), c(s, l, h, l);
        break;
      case bn.Z:
        i && c(a, o, s, l), a = s, o = l;
        break;
    }
  }
  return i && i.length > 2 && n.push(i), n;
}
function xy(r, t, e, n, i, a, o, s, l, u) {
  if (ls(r, e) && ls(t, n) && ls(i, o) && ls(a, s)) {
    l.push(o, s);
    return;
  }
  var c = 2 / u, f = c * c, h = o - r, v = s - t, d = Math.sqrt(h * h + v * v);
  h /= d, v /= d;
  var p = e - r, g = n - t, m = i - o, y = a - s, _ = p * p + g * g, b = m * m + y * y;
  if (_ < f && b < f) {
    l.push(o, s);
    return;
  }
  var S = h * p + v * g, x = -h * m - v * y, w = _ - S * S, C = b - x * x;
  if (w < f && S >= 0 && C < f && x >= 0) {
    l.push(o, s);
    return;
  }
  var D = [], A = [];
  Ki(r, e, i, o, 0.5, D), Ki(t, n, a, s, 0.5, A), xy(D[0], A[0], D[1], A[1], D[2], A[2], D[3], A[3], l, u), xy(D[4], A[4], D[5], A[5], D[6], A[6], D[7], A[7], l, u);
}
function AJ(r, t) {
  var e = Sy(r), n = [];
  t = t || 1;
  for (var i = 0; i < e.length; i++) {
    var a = e[i], o = [], s = a[0], l = a[1];
    o.push(s, l);
    for (var u = 2; u < a.length; ) {
      var c = a[u++], f = a[u++], h = a[u++], v = a[u++], d = a[u++], p = a[u++];
      xy(s, l, c, f, h, v, d, p, o, t), s = d, l = p;
    }
    n.push(o);
  }
  return n;
}
function Ak(r, t, e) {
  var n = r[t], i = r[1 - t], a = Math.abs(n / i), o = Math.ceil(Math.sqrt(a * e)), s = Math.floor(e / o);
  s === 0 && (s = 1, o = e);
  for (var l = [], u = 0; u < o; u++)
    l.push(s);
  var c = o * s, f = e - c;
  if (f > 0)
    for (var u = 0; u < f; u++)
      l[u % o] += 1;
  return l;
}
function WA(r, t, e) {
  for (var n = r.r0, i = r.r, a = r.startAngle, o = r.endAngle, s = Math.abs(o - a), l = s * i, u = i - n, c = l > Math.abs(u), f = Ak([l, u], c ? 0 : 1, t), h = (c ? s : u) / f.length, v = 0; v < f.length; v++)
    for (var d = (c ? u : s) / f[v], p = 0; p < f[v]; p++) {
      var g = {};
      c ? (g.startAngle = a + h * v, g.endAngle = a + h * (v + 1), g.r0 = n + d * p, g.r = n + d * (p + 1)) : (g.startAngle = a + d * p, g.endAngle = a + d * (p + 1), g.r0 = n + h * v, g.r = n + h * (v + 1)), g.clockwise = r.clockwise, g.cx = r.cx, g.cy = r.cy, e.push(g);
    }
}
function DJ(r, t, e) {
  for (var n = r.width, i = r.height, a = n > i, o = Ak([n, i], a ? 0 : 1, t), s = a ? "width" : "height", l = a ? "height" : "width", u = a ? "x" : "y", c = a ? "y" : "x", f = r[s] / o.length, h = 0; h < o.length; h++)
    for (var v = r[l] / o[h], d = 0; d < o[h]; d++) {
      var p = {};
      p[u] = h * f, p[c] = d * v, p[s] = f, p[l] = v, p.x += r.x, p.y += r.y, e.push(p);
    }
}
function UA(r, t, e, n) {
  return r * n - e * t;
}
function TJ(r, t, e, n, i, a, o, s) {
  var l = e - r, u = n - t, c = o - i, f = s - a, h = UA(c, f, l, u);
  if (Math.abs(h) < 1e-6)
    return null;
  var v = r - i, d = t - a, p = UA(v, d, c, f) / h;
  return p < 0 || p > 1 ? null : new Se(p * l + r, p * u + t);
}
function MJ(r, t, e) {
  var n = new Se();
  Se.sub(n, e, t), n.normalize();
  var i = new Se();
  Se.sub(i, r, t);
  var a = i.dot(n);
  return a;
}
function Ko(r, t) {
  var e = r[r.length - 1];
  e && e[0] === t[0] && e[1] === t[1] || r.push(t);
}
function IJ(r, t, e) {
  for (var n = r.length, i = [], a = 0; a < n; a++) {
    var o = r[a], s = r[(a + 1) % n], l = TJ(o[0], o[1], s[0], s[1], t.x, t.y, e.x, e.y);
    l && i.push({
      projPt: MJ(l, t, e),
      pt: l,
      idx: a
    });
  }
  if (i.length < 2)
    return [{ points: r }, { points: r }];
  i.sort(function(g, m) {
    return g.projPt - m.projPt;
  });
  var u = i[0], c = i[i.length - 1];
  if (c.idx < u.idx) {
    var f = u;
    u = c, c = f;
  }
  for (var h = [u.pt.x, u.pt.y], v = [c.pt.x, c.pt.y], d = [h], p = [v], a = u.idx + 1; a <= c.idx; a++)
    Ko(d, r[a].slice());
  Ko(d, v), Ko(d, h);
  for (var a = c.idx + 1; a <= u.idx + n; a++)
    Ko(p, r[a % n].slice());
  return Ko(p, h), Ko(p, v), [{
    points: d
  }, {
    points: p
  }];
}
function YA(r) {
  var t = r.points, e = [], n = [];
  uv(t, e, n);
  var i = new xe(e[0], e[1], n[0] - e[0], n[1] - e[1]), a = i.width, o = i.height, s = i.x, l = i.y, u = new Se(), c = new Se();
  return a > o ? (u.x = c.x = s + a / 2, u.y = l, c.y = l + o) : (u.y = c.y = l + o / 2, u.x = s, c.x = s + a), IJ(t, u, c);
}
function Vh(r, t, e, n) {
  if (e === 1)
    n.push(t);
  else {
    var i = Math.floor(e / 2), a = r(t);
    Vh(r, a[0], i, n), Vh(r, a[1], e - i, n);
  }
  return n;
}
function LJ(r, t) {
  for (var e = [], n = 0; n < t; n++)
    e.push(d0(r));
  return e;
}
function EJ(r, t) {
  t.setStyle(r.style), t.z = r.z, t.z2 = r.z2, t.zlevel = r.zlevel;
}
function PJ(r) {
  for (var t = [], e = 0; e < r.length; )
    t.push([r[e++], r[e++]]);
  return t;
}
function kJ(r, t) {
  var e = [], n = r.shape, i;
  switch (r.type) {
    case "rect":
      DJ(n, t, e), i = ke;
      break;
    case "sector":
      WA(n, t, e), i = ir;
      break;
    case "circle":
      WA({
        r0: 0,
        r: n.r,
        startAngle: 0,
        endAngle: Math.PI * 2,
        cx: n.cx,
        cy: n.cy
      }, t, e), i = ir;
      break;
    default:
      var a = r.getComputedTransform(), o = a ? Math.sqrt(Math.max(a[0] * a[0] + a[1] * a[1], a[2] * a[2] + a[3] * a[3])) : 1, s = U(AJ(r.getUpdatedPathProxy(), o), function(m) {
        return PJ(m);
      }), l = s.length;
      if (l === 0)
        Vh(YA, {
          points: s[0]
        }, t, e);
      else if (l === t)
        for (var u = 0; u < l; u++)
          e.push({
            points: s[u]
          });
      else {
        var c = 0, f = U(s, function(m) {
          var y = [], _ = [];
          uv(m, y, _);
          var b = (_[1] - y[1]) * (_[0] - y[0]);
          return c += b, { poly: m, area: b };
        });
        f.sort(function(m, y) {
          return y.area - m.area;
        });
        for (var h = t, u = 0; u < l; u++) {
          var v = f[u];
          if (h <= 0)
            break;
          var d = u === l - 1 ? h : Math.ceil(v.area / c * t);
          d < 0 || (Vh(YA, {
            points: v.poly
          }, d, e), h -= d);
        }
      }
      i = ar;
      break;
  }
  if (!i)
    return LJ(r, t);
  for (var p = [], u = 0; u < e.length; u++) {
    var g = new i();
    g.setShape(e[u]), EJ(r, g), p.push(g);
  }
  return p;
}
function RJ(r, t) {
  var e = r.length, n = t.length;
  if (e === n)
    return [r, t];
  for (var i = [], a = [], o = e < n ? r : t, s = Math.min(e, n), l = Math.abs(n - e) / 6, u = (s - 2) / 6, c = Math.ceil(l / u) + 1, f = [o[0], o[1]], h = l, v = 2; v < s; ) {
    var d = o[v - 2], p = o[v - 1], g = o[v++], m = o[v++], y = o[v++], _ = o[v++], b = o[v++], S = o[v++];
    if (h <= 0) {
      f.push(g, m, y, _, b, S);
      continue;
    }
    for (var x = Math.min(h, c - 1) + 1, w = 1; w <= x; w++) {
      var C = w / x;
      Ki(d, g, y, b, C, i), Ki(p, m, _, S, C, a), d = i[3], p = a[3], f.push(i[1], a[1], i[2], a[2], d, p), g = i[5], m = a[5], y = i[6], _ = a[6];
    }
    h -= x - 1;
  }
  return o === r ? [f, t] : [r, f];
}
function ZA(r, t) {
  for (var e = r.length, n = r[e - 2], i = r[e - 1], a = [], o = 0; o < t.length; )
    a[o++] = n, a[o++] = i;
  return a;
}
function OJ(r, t) {
  for (var e, n, i, a = [], o = [], s = 0; s < Math.max(r.length, t.length); s++) {
    var l = r[s], u = t[s], c = void 0, f = void 0;
    l ? u ? (e = RJ(l, u), c = e[0], f = e[1], n = c, i = f) : (f = ZA(i || l, l), c = l) : (c = ZA(n || u, u), f = u), a.push(c), o.push(f);
  }
  return [a, o];
}
function XA(r) {
  for (var t = 0, e = 0, n = 0, i = r.length, a = 0, o = i - 2; a < i; o = a, a += 2) {
    var s = r[o], l = r[o + 1], u = r[a], c = r[a + 1], f = s * c - u * l;
    t += f, e += (s + u) * f, n += (l + c) * f;
  }
  return t === 0 ? [r[0] || 0, r[1] || 0] : [e / t / 3, n / t / 3, t];
}
function FJ(r, t, e, n) {
  for (var i = (r.length - 2) / 6, a = 1 / 0, o = 0, s = r.length, l = s - 2, u = 0; u < i; u++) {
    for (var c = u * 6, f = 0, h = 0; h < s; h += 2) {
      var v = h === 0 ? c : (c + h - 2) % l + 2, d = r[v] - e[0], p = r[v + 1] - e[1], g = t[h] - n[0], m = t[h + 1] - n[1], y = g - d, _ = m - p;
      f += y * y + _ * _;
    }
    f < a && (a = f, o = u);
  }
  return o;
}
function BJ(r) {
  for (var t = [], e = r.length, n = 0; n < e; n += 2)
    t[n] = r[e - n - 2], t[n + 1] = r[e - n - 1];
  return t;
}
function NJ(r, t, e, n) {
  for (var i = [], a, o = 0; o < r.length; o++) {
    var s = r[o], l = t[o], u = XA(s), c = XA(l);
    a == null && (a = u[2] < 0 != c[2] < 0);
    var f = [], h = [], v = 0, d = 1 / 0, p = [], g = s.length;
    a && (s = BJ(s));
    for (var m = FJ(s, l, u, c) * 6, y = g - 2, _ = 0; _ < y; _ += 2) {
      var b = (m + _) % y + 2;
      f[_ + 2] = s[b] - u[0], f[_ + 3] = s[b + 1] - u[1];
    }
    f[0] = s[m] - u[0], f[1] = s[m + 1] - u[1];
    for (var S = n / e, x = -n / 2; x <= n / 2; x += S) {
      for (var w = Math.sin(x), C = Math.cos(x), D = 0, _ = 0; _ < s.length; _ += 2) {
        var A = f[_], T = f[_ + 1], L = l[_] - c[0], E = l[_ + 1] - c[1], I = L * C - E * w, P = L * w + E * C;
        p[_] = I, p[_ + 1] = P;
        var R = I - A, F = P - T;
        D += R * R + F * F;
      }
      if (D < d) {
        d = D, v = x;
        for (var O = 0; O < p.length; O++)
          h[O] = p[O];
      }
    }
    i.push({
      from: f,
      to: h,
      fromCp: u,
      toCp: c,
      rotation: -v
    });
  }
  return i;
}
function $h(r) {
  return r.__isCombineMorphing;
}
var Dk = "__mOriginal_";
function Gh(r, t, e) {
  var n = Dk + t, i = r[n] || r[t];
  r[n] || (r[n] = r[t]);
  var a = e.replace, o = e.after, s = e.before;
  r[t] = function() {
    var l = arguments, u;
    return s && s.apply(this, l), a ? u = a.apply(this, l) : u = i.apply(this, l), o && o.apply(this, l), u;
  };
}
function nu(r, t) {
  var e = Dk + t;
  r[e] && (r[t] = r[e], r[e] = null);
}
function jA(r, t) {
  for (var e = 0; e < r.length; e++)
    for (var n = r[e], i = 0; i < n.length; ) {
      var a = n[i], o = n[i + 1];
      n[i++] = t[0] * a + t[2] * o + t[4], n[i++] = t[1] * a + t[3] * o + t[5];
    }
}
function Tk(r, t) {
  var e = r.getUpdatedPathProxy(), n = t.getUpdatedPathProxy(), i = OJ(Sy(e), Sy(n)), a = i[0], o = i[1], s = r.getComputedTransform(), l = t.getComputedTransform();
  function u() {
    this.transform = null;
  }
  s && jA(a, s), l && jA(o, l), Gh(t, "updateTransform", { replace: u }), t.transform = null;
  var c = NJ(a, o, 10, Math.PI), f = [];
  Gh(t, "buildPath", { replace: function(h) {
    for (var v = t.__morphT, d = 1 - v, p = [], g = 0; g < c.length; g++) {
      var m = c[g], y = m.from, _ = m.to, b = m.rotation * v, S = m.fromCp, x = m.toCp, w = Math.sin(b), C = Math.cos(b);
      Cf(p, S, x, v);
      for (var D = 0; D < y.length; D += 2) {
        var A = y[D], T = y[D + 1], L = _[D], E = _[D + 1], I = A * d + L * v, P = T * d + E * v;
        f[D] = I * C - P * w + p[0], f[D + 1] = I * w + P * C + p[1];
      }
      var R = f[0], F = f[1];
      h.moveTo(R, F);
      for (var D = 2; D < y.length; ) {
        var L = f[D++], E = f[D++], O = f[D++], z = f[D++], G = f[D++], W = f[D++];
        R === L && F === E && O === G && z === W ? h.lineTo(G, W) : h.bezierCurveTo(L, E, O, z, G, W), R = G, F = W;
      }
    }
  } });
}
function J_(r, t, e) {
  if (!r || !t)
    return t;
  var n = e.done, i = e.during;
  Tk(r, t), t.__morphT = 0;
  function a() {
    nu(t, "buildPath"), nu(t, "updateTransform"), t.__morphT = -1, t.createPathProxy(), t.dirtyShape();
  }
  return t.animateTo({
    __morphT: 1
  }, se({
    during: function(o) {
      t.dirtyShape(), i && i(o);
    },
    done: function() {
      a(), n && n();
    }
  }, e)), t;
}
function zJ(r, t, e, n, i, a) {
  var o = 16;
  r = i === e ? 0 : Math.round(32767 * (r - e) / (i - e)), t = a === n ? 0 : Math.round(32767 * (t - n) / (a - n));
  for (var s = 0, l, u = (1 << o) / 2; u > 0; u /= 2) {
    var c = 0, f = 0;
    (r & u) > 0 && (c = 1), (t & u) > 0 && (f = 1), s += u * u * (3 * c ^ f), f === 0 && (c === 1 && (r = u - 1 - r, t = u - 1 - t), l = r, r = t, t = l);
  }
  return s;
}
function Hh(r) {
  var t = 1 / 0, e = 1 / 0, n = -1 / 0, i = -1 / 0, a = U(r, function(s) {
    var l = s.getBoundingRect(), u = s.getComputedTransform(), c = l.x + l.width / 2 + (u ? u[4] : 0), f = l.y + l.height / 2 + (u ? u[5] : 0);
    return t = Math.min(c, t), e = Math.min(f, e), n = Math.max(c, n), i = Math.max(f, i), [c, f];
  }), o = U(a, function(s, l) {
    return {
      cp: s,
      z: zJ(s[0], s[1], t, e, n, i),
      path: r[l]
    };
  });
  return o.sort(function(s, l) {
    return s.z - l.z;
  }).map(function(s) {
    return s.path;
  });
}
function Mk(r) {
  return kJ(r.path, r.count);
}
function wy() {
  return {
    fromIndividuals: [],
    toIndividuals: [],
    count: 0
  };
}
function VJ(r, t, e) {
  var n = [];
  function i(S) {
    for (var x = 0; x < S.length; x++) {
      var w = S[x];
      $h(w) ? i(w.childrenRef()) : w instanceof Te && n.push(w);
    }
  }
  i(r);
  var a = n.length;
  if (!a)
    return wy();
  var o = e.dividePath || Mk, s = o({
    path: t,
    count: a
  });
  if (s.length !== a)
    return console.error("Invalid morphing: unmatched splitted path"), wy();
  n = Hh(n), s = Hh(s);
  for (var l = e.done, u = e.during, c = e.individualDelay, f = new Kn(), h = 0; h < a; h++) {
    var v = n[h], d = s[h];
    d.parent = t, d.copyTransform(f), c || Tk(v, d);
  }
  t.__isCombineMorphing = !0, t.childrenRef = function() {
    return s;
  };
  function p(S) {
    for (var x = 0; x < s.length; x++)
      s[x].addSelfToZr(S);
  }
  Gh(t, "addSelfToZr", {
    after: function(S) {
      p(S);
    }
  }), Gh(t, "removeSelfFromZr", {
    after: function(S) {
      for (var x = 0; x < s.length; x++)
        s[x].removeSelfFromZr(S);
    }
  });
  function g() {
    t.__isCombineMorphing = !1, t.__morphT = -1, t.childrenRef = null, nu(t, "addSelfToZr"), nu(t, "removeSelfFromZr");
  }
  var m = s.length;
  if (c)
    for (var y = m, _ = function() {
      y--, y === 0 && (g(), l && l());
    }, h = 0; h < m; h++) {
      var b = c ? se({
        delay: (e.delay || 0) + c(h, m, n[h], s[h]),
        done: _
      }, e) : e;
      J_(n[h], s[h], b);
    }
  else
    t.__morphT = 0, t.animateTo({
      __morphT: 1
    }, se({
      during: function(S) {
        for (var x = 0; x < m; x++) {
          var w = s[x];
          w.__morphT = t.__morphT, w.dirtyShape();
        }
        u && u(S);
      },
      done: function() {
        g();
        for (var S = 0; S < r.length; S++)
          nu(r[S], "updateTransform");
        l && l();
      }
    }, e));
  return t.__zr && p(t.__zr), {
    fromIndividuals: n,
    toIndividuals: s,
    count: m
  };
}
function $J(r, t, e) {
  var n = t.length, i = [], a = e.dividePath || Mk;
  function o(v) {
    for (var d = 0; d < v.length; d++) {
      var p = v[d];
      $h(p) ? o(p.childrenRef()) : p instanceof Te && i.push(p);
    }
  }
  if ($h(r)) {
    o(r.childrenRef());
    var s = i.length;
    if (s < n)
      for (var l = 0, u = s; u < n; u++)
        i.push(d0(i[l++ % s]));
    i.length = n;
  } else {
    i = a({ path: r, count: n });
    for (var c = r.getComputedTransform(), u = 0; u < i.length; u++)
      i[u].setLocalTransform(c);
    if (i.length !== n)
      return console.error("Invalid morphing: unmatched splitted path"), wy();
  }
  i = Hh(i), t = Hh(t);
  for (var f = e.individualDelay, u = 0; u < n; u++) {
    var h = f ? se({
      delay: (e.delay || 0) + f(u, n, i[u], t[u])
    }, e) : e;
    J_(i[u], t[u], h);
  }
  return {
    fromIndividuals: i,
    toIndividuals: t,
    count: t.length
  };
}
function KA(r) {
  return q(r[0]);
}
function JA(r, t) {
  for (var e = [], n = r.length, i = 0; i < n; i++)
    e.push({
      one: r[i],
      many: []
    });
  for (var i = 0; i < t.length; i++) {
    var a = t[i].length, o = void 0;
    for (o = 0; o < a; o++)
      e[o % n].many.push(t[i][o]);
  }
  for (var s = 0, i = n - 1; i >= 0; i--)
    if (!e[i].many.length) {
      var l = e[s].many;
      if (l.length <= 1)
        if (s)
          s = 0;
        else
          return e;
      var a = l.length, u = Math.ceil(a / 2);
      e[i].many = l.slice(u, a), e[s].many = l.slice(0, u), s++;
    }
  return e;
}
var GJ = {
  clone: function(r) {
    for (var t = [], e = 1 - Math.pow(1 - r.path.style.opacity, 1 / r.count), n = 0; n < r.count; n++) {
      var i = d0(r.path);
      i.setStyle("opacity", e), t.push(i);
    }
    return t;
  },
  // Use the default divider
  split: null
};
function yg(r, t, e, n, i, a) {
  if (!r.length || !t.length)
    return;
  var o = ks("update", n, i);
  if (!(o && o.duration > 0))
    return;
  var s = n.getModel("universalTransition").get("delay"), l = Object.assign({
    // Need to setToFinal so the further calculation based on the style can be correct.
    // Like emphasis color.
    setToFinal: !0
  }, o), u, c;
  KA(r) && (u = r, c = t), KA(t) && (u = t, c = r);
  function f(m, y, _, b, S) {
    var x = m.many, w = m.one;
    if (x.length === 1 && !S) {
      var C = y ? x[0] : w, D = y ? w : x[0];
      if ($h(C))
        f({
          many: [C],
          one: D
        }, !0, _, b, !0);
      else {
        var A = s ? se({
          delay: s(_, b)
        }, l) : l;
        J_(C, D, A), a(C, D, C, D, A);
      }
    } else
      for (var T = se({
        dividePath: GJ[e],
        individualDelay: s && function(F, O, z, G) {
          return s(F + _, b);
        }
      }, l), L = y ? VJ(x, w, T) : $J(w, x, T), E = L.fromIndividuals, I = L.toIndividuals, P = E.length, R = 0; R < P; R++) {
        var A = s ? se({
          delay: s(R, P)
        }, l) : l;
        a(E[R], I[R], y ? x[R] : m.one, y ? m.one : x[R], A);
      }
  }
  for (var h = u ? u === r : r.length > t.length, v = u ? JA(c, u) : JA(h ? t : r, [h ? r : t]), d = 0, p = 0; p < v.length; p++)
    d += v[p].many.length;
  for (var g = 0, p = 0; p < v.length; p++)
    f(v[p], h, g, d), g += v[p].many.length;
}
function za(r) {
  if (!r)
    return [];
  if (q(r)) {
    for (var t = [], e = 0; e < r.length; e++)
      t.push(za(r[e]));
    return t;
  }
  var n = [];
  return r.traverse(function(i) {
    i instanceof Te && !i.disableMorphing && !i.invisible && !i.ignore && n.push(i);
  }), n;
}
var Ik = 1e4, HJ = 0, QA = 1, eD = 2, qJ = Oe();
function WJ(r, t) {
  for (var e = r.dimensions, n = 0; n < e.length; n++) {
    var i = r.getDimensionInfo(e[n]);
    if (i && i.otherDims[t] === 0)
      return e[n];
  }
}
function UJ(r, t, e) {
  var n = r.getDimensionInfo(e), i = n && n.ordinalMeta;
  if (n) {
    var a = r.get(n.name, t);
    return i && i.categories[a] || a + "";
  }
}
function tD(r, t, e, n) {
  var i = n ? "itemChildGroupId" : "itemGroupId", a = WJ(r, i);
  if (a) {
    var o = UJ(r, t, a);
    return o;
  }
  var s = r.getRawDataItem(t), l = n ? "childGroupId" : "groupId";
  if (s && s[l])
    return s[l] + "";
  if (!n)
    return e || r.getId(t);
}
function rD(r) {
  var t = [];
  return M(r, function(e) {
    var n = e.data, i = e.dataGroupId;
    if (!(n.count() > Ik))
      for (var a = n.getIndices(), o = 0; o < a.length; o++)
        t.push({
          data: n,
          groupId: tD(n, o, i, !1),
          childGroupId: tD(n, o, i, !0),
          divide: e.divide,
          dataIndex: o
        });
  }), t;
}
function _g(r, t, e) {
  r.traverse(function(n) {
    n instanceof Te && st(n, {
      style: {
        opacity: 0
      }
    }, t, {
      dataIndex: e,
      isFrom: !0
    });
  });
}
function bg(r) {
  if (r.parent) {
    var t = r.getComputedTransform();
    r.setLocalTransform(t), r.parent.remove(r);
  }
}
function Jo(r) {
  r.stopAnimation(), r.isGroup && r.traverse(function(t) {
    t.stopAnimation();
  });
}
function YJ(r, t, e) {
  var n = ks("update", e, t);
  n && r.traverse(function(i) {
    if (i instanceof qr) {
      var a = Gz(i);
      a && i.animateFrom({
        style: a
      }, n);
    }
  });
}
function ZJ(r, t) {
  var e = r.length;
  if (e !== t.length)
    return !1;
  for (var n = 0; n < e; n++) {
    var i = r[n], a = t[n];
    if (i.data.getId(i.dataIndex) !== a.data.getId(a.dataIndex))
      return !1;
  }
  return !0;
}
function Lk(r, t, e) {
  var n = rD(r), i = rD(t);
  function a(_, b, S, x, w) {
    (S || _) && b.animateFrom({
      style: S && S !== _ ? H(H({}, S.style), _.style) : _.style
    }, w);
  }
  var o = !1, s = HJ, l = re(), u = re();
  n.forEach(function(_) {
    _.groupId && l.set(_.groupId, !0), _.childGroupId && u.set(_.childGroupId, !0);
  });
  for (var c = 0; c < i.length; c++) {
    var f = i[c].groupId;
    if (u.get(f)) {
      s = QA;
      break;
    }
    var h = i[c].childGroupId;
    if (h && l.get(h)) {
      s = eD;
      break;
    }
  }
  function v(_, b) {
    return function(S) {
      var x = S.data, w = S.dataIndex;
      return b ? x.getId(w) : _ ? s === QA ? S.childGroupId : S.groupId : s === eD ? S.childGroupId : S.groupId;
    };
  }
  var d = ZJ(n, i), p = {};
  if (!d)
    for (var c = 0; c < i.length; c++) {
      var g = i[c], m = g.data.getItemGraphicEl(g.dataIndex);
      m && (p[m.id] = !0);
    }
  function y(_, b) {
    var S = n[b], x = i[_], w = x.data.hostModel, C = S.data.getItemGraphicEl(S.dataIndex), D = x.data.getItemGraphicEl(x.dataIndex);
    if (C === D) {
      D && YJ(D, x.dataIndex, w);
      return;
    }
    // We can't use the elements that already being morphed
    C && p[C.id] || D && (Jo(D), C ? (Jo(C), bg(C), o = !0, yg(za(C), za(D), x.divide, w, _, a)) : _g(D, w, _));
  }
  new li(n, i, v(!0, d), v(!1, d), null, "multiple").update(y).updateManyToOne(function(_, b) {
    var S = i[_], x = S.data, w = x.hostModel, C = x.getItemGraphicEl(S.dataIndex), D = qe(U(b, function(A) {
      return n[A].data.getItemGraphicEl(n[A].dataIndex);
    }), function(A) {
      return A && A !== C && !p[A.id];
    });
    C && (Jo(C), D.length ? (M(D, function(A) {
      Jo(A), bg(A);
    }), o = !0, yg(za(D), za(C), S.divide, w, _, a)) : _g(C, w, S.dataIndex));
  }).updateOneToMany(function(_, b) {
    var S = n[b], x = S.data.getItemGraphicEl(S.dataIndex);
    if (!(x && p[x.id])) {
      var w = qe(U(_, function(D) {
        return i[D].data.getItemGraphicEl(i[D].dataIndex);
      }), function(D) {
        return D && D !== x;
      }), C = i[_[0]].data.hostModel;
      w.length && (M(w, function(D) {
        return Jo(D);
      }), x ? (Jo(x), bg(x), o = !0, yg(
        za(x),
        za(w),
        S.divide,
        // Use divide on old.
        C,
        _[0],
        a
      )) : M(w, function(D) {
        return _g(D, C, _[0]);
      }));
    }
  }).updateManyToMany(function(_, b) {
    new li(b, _, function(S) {
      return n[S].data.getId(n[S].dataIndex);
    }, function(S) {
      return i[S].data.getId(i[S].dataIndex);
    }).update(function(S, x) {
      y(_[S], b[x]);
    }).execute();
  }).execute(), o && M(t, function(_) {
    var b = _.data, S = b.hostModel, x = S && e.getViewOfSeriesModel(S), w = ks("update", S, 0);
    x && S.isAnimationEnabled() && w && w.duration > 0 && x.group.traverse(function(C) {
      C instanceof Te && !C.animators.length && C.animateFrom({
        style: {
          opacity: 0
        }
      }, w);
    });
  });
}
function nD(r) {
  var t = r.getModel("universalTransition").get("seriesKey");
  return t || r.id;
}
function iD(r) {
  return q(r) ? r.sort().join(",") : r;
}
function Pi(r) {
  if (r.hostModel)
    return r.hostModel.getModel("universalTransition").get("divideShape");
}
function XJ(r, t) {
  var e = re(), n = re(), i = re();
  return M(r.oldSeries, function(a, o) {
    var s = r.oldDataGroupIds[o], l = r.oldData[o], u = nD(a), c = iD(u);
    n.set(c, {
      dataGroupId: s,
      data: l
    }), q(u) && M(u, function(f) {
      i.set(f, {
        key: c,
        dataGroupId: s,
        data: l
      });
    });
  }), M(t.updatedSeries, function(a) {
    if (a.isUniversalTransitionEnabled() && a.isAnimationEnabled()) {
      var o = a.get("dataGroupId"), s = a.getData(), l = nD(a), u = iD(l), c = n.get(u);
      if (c)
        e.set(u, {
          oldSeries: [{
            dataGroupId: c.dataGroupId,
            divide: Pi(c.data),
            data: c.data
          }],
          newSeries: [{
            dataGroupId: o,
            divide: Pi(s),
            data: s
          }]
        });
      else if (q(l)) {
        var f = [];
        M(l, function(d) {
          var p = n.get(d);
          p.data && f.push({
            dataGroupId: p.dataGroupId,
            divide: Pi(p.data),
            data: p.data
          });
        }), f.length && e.set(u, {
          oldSeries: f,
          newSeries: [{
            dataGroupId: o,
            data: s,
            divide: Pi(s)
          }]
        });
      } else {
        var h = i.get(l);
        if (h) {
          var v = e.get(h.key);
          v || (v = {
            oldSeries: [{
              dataGroupId: h.dataGroupId,
              data: h.data,
              divide: Pi(h.data)
            }],
            newSeries: []
          }, e.set(h.key, v)), v.newSeries.push({
            dataGroupId: o,
            data: s,
            divide: Pi(s)
          });
        }
      }
    }
  }), e;
}
function aD(r, t) {
  for (var e = 0; e < r.length; e++) {
    var n = t.seriesIndex != null && t.seriesIndex === r[e].seriesIndex || t.seriesId != null && t.seriesId === r[e].id;
    if (n)
      return e;
  }
}
function jJ(r, t, e, n) {
  var i = [], a = [];
  M(je(r.from), function(o) {
    var s = aD(t.oldSeries, o);
    s >= 0 && i.push({
      dataGroupId: t.oldDataGroupIds[s],
      data: t.oldData[s],
      // TODO can specify divideShape in transition.
      divide: Pi(t.oldData[s]),
      groupIdDim: o.dimension
    });
  }), M(je(r.to), function(o) {
    var s = aD(e.updatedSeries, o);
    if (s >= 0) {
      var l = e.updatedSeries[s].getData();
      a.push({
        dataGroupId: t.oldDataGroupIds[s],
        data: l,
        divide: Pi(l),
        groupIdDim: o.dimension
      });
    }
  }), i.length > 0 && a.length > 0 && Lk(i, a, n);
}
function KJ(r) {
  r.registerUpdateLifecycle("series:beforeupdate", function(t, e, n) {
    M(je(n.seriesTransition), function(i) {
      M(je(i.to), function(a) {
        for (var o = n.updatedSeries, s = 0; s < o.length; s++)
          (a.seriesIndex != null && a.seriesIndex === o[s].seriesIndex || a.seriesId != null && a.seriesId === o[s].id) && (o[s][Of] = !0);
      });
    });
  }), r.registerUpdateLifecycle("series:transition", function(t, e, n) {
    var i = qJ(e);
    if (i.oldSeries && n.updatedSeries && n.optionChanged) {
      var a = n.seriesTransition;
      if (a)
        M(je(a), function(v) {
          jJ(v, i, n, e);
        });
      else {
        var o = XJ(i, n);
        M(o.keys(), function(v) {
          var d = o.get(v);
          Lk(d.oldSeries, d.newSeries, e);
        });
      }
      M(n.updatedSeries, function(v) {
        v[Of] && (v[Of] = !1);
      });
    }
    for (var s = t.getSeries(), l = i.oldSeries = [], u = i.oldDataGroupIds = [], c = i.oldData = [], f = 0; f < s.length; f++) {
      var h = s[f].getData();
      h.count() < Ik && (l.push(s[f]), u.push(s[f].get("dataGroupId")), c.push(h));
    }
  });
}
De([s9]);
De([r9]);
De([T9, G9, J9, EH, GH, M8, r7, z7, sq, vq, xq, gW, $W, JW, dU, yU, MU, OU, UU, JU, lY, WY]);
De(cZ);
De(FZ);
De(ME);
De(XZ);
De(vP);
De(QZ);
De(lX);
De(XX);
De(dj);
De(oc);
De(Ej);
De(Rj);
De(qj);
De(Kj);
De(nK);
De(uK);
De(_K);
De(BK);
De(gk);
De(mk);
De(nJ);
De(xk);
De(wk);
De(lJ);
De(SJ);
De(CJ);
De(KJ);
De(x6);
var JJ = Object.defineProperty, qs = (r, t, e, n) => {
  for (var i = void 0, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = o(t, e, i) || i);
  return i && JJ(t, e, i), i;
};
const a1 = class a1 extends wr {
  constructor() {
    super(...arguments), this.query = "", this.type = "line", this.x = "", this.y = "", this.title = "", this.error = null;
  }
  /**
   * Extract a column's values from query result.
   */
  getColumnValues(t) {
    if (!this.data) return [];
    const e = this.data.columns.findIndex(
      (n) => n.name === t
    );
    if (e === -1)
      throw new Error(`Column not found: ${t}`);
    return this.data.data.map((n) => n[e]);
  }
  /**
   * Get column metadata by name.
   */
  getColumn(t) {
    var e;
    return (e = this.data) == null ? void 0 : e.columns.find((n) => n.name === t);
  }
  /**
   * Check if data is numeric type.
   */
  isNumericType(t) {
    return [
      "INTEGER",
      "BIGINT",
      "DOUBLE",
      "FLOAT",
      "DECIMAL",
      "NUMERIC",
      "REAL",
      "SMALLINT",
      "TINYINT",
      "HUGEINT"
    ].some((n) => t.toUpperCase().includes(n));
  }
  /**
   * Format values based on column type.
   */
  formatValue(t, e) {
    if (t == null)
      return "";
    if (this.isNumericType(e)) {
      const n = Number(t);
      return Math.abs(n) >= 1e3 ? n.toLocaleString() : Number.isInteger(n) ? n : n.toFixed(2);
    }
    return String(t);
  }
  /**
   * Called when properties change.
   */
  updated(t) {
    if (t.has("data") && this.data)
      try {
        this.error = null, this.renderChart();
      } catch (e) {
        this.error = e instanceof Error ? e.message : "Chart render failed", this.requestUpdate();
      }
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.destroyChart();
  }
};
a1.styles = [
  oa,
  Nn`
      :host {
        display: block;
        height: var(--lence-chart-height);
        width: 100%;
        font-family: var(--lence-font-family);
      }

      .chart-container {
        width: 100%;
        height: 100%;
      }

      .loading {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }

      .error {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-negative);
        background: var(--lence-negative-bg);
        border: 1px solid var(--lence-negative);
        border-radius: var(--lence-radius);
        padding: 1rem;
      }

      .no-data {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }
    `
];
let hi = a1;
qs([
  Re({ type: String })
], hi.prototype, "query");
qs([
  Re({ type: String })
], hi.prototype, "type");
qs([
  Re({ type: String })
], hi.prototype, "x");
qs([
  Re({ type: String })
], hi.prototype, "y");
qs([
  Re({ type: String })
], hi.prototype, "title");
qs([
  Re({ attribute: !1 })
], hi.prototype, "data");
var QJ = Object.getOwnPropertyDescriptor, eQ = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? QJ(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = o(i) || i);
  return i;
};
let qh = class extends hi {
  constructor() {
    super(...arguments), this.chart = null, this.resizeObserver = null;
  }
  firstUpdated() {
    var t;
    this.resizeObserver = new ResizeObserver(() => {
      var e;
      (e = this.chart) == null || e.resize();
    });
    const r = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".chart-container");
    r && this.resizeObserver.observe(r);
  }
  renderChart() {
    var i;
    if (!this.data || !this.x || !this.y)
      return;
    const r = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".chart-container");
    if (!r) return;
    this.chart || (this.chart = z0(r));
    const t = this.getColumnValues(this.x), e = this.getColumnValues(this.y), n = this.buildOption(t, e);
    this.chart.setOption(n, !0);
  }
  buildOption(r, t) {
    const e = {
      animation: !1,
      color: qh.CHART_COLORS,
      title: this.title ? {
        text: this.title,
        left: "center",
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif",
          fontWeight: 600,
          fontSize: 16,
          color: "#060606"
        }
      } : void 0,
      tooltip: {
        trigger: this.type === "pie" ? "item" : "axis",
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif"
        }
      },
      grid: {
        left: "3%",
        right: "4%",
        bottom: "3%",
        containLabel: !0
      },
      textStyle: {
        fontFamily: "Inter, system-ui, sans-serif",
        color: "#6b7280"
      }
    };
    switch (this.type) {
      case "pie":
        return this.buildPieOption(r, t, e);
      case "bar":
        return this.buildBarOption(r, t, e);
      case "scatter":
        return this.buildScatterOption(r, t, e);
      case "area":
        return this.buildAreaOption(r, t, e);
      case "line":
      default:
        return this.buildLineOption(r, t, e);
    }
  }
  buildLineOption(r, t, e) {
    return {
      ...e,
      xAxis: {
        type: "category",
        data: r
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          data: t,
          type: "line",
          smooth: !0
        }
      ]
    };
  }
  buildBarOption(r, t, e) {
    return {
      ...e,
      xAxis: {
        type: "category",
        data: r
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          data: t,
          type: "bar"
        }
      ]
    };
  }
  buildPieOption(r, t, e) {
    const n = r.map((i, a) => ({
      name: String(i),
      value: t[a]
    }));
    return {
      ...e,
      series: [
        {
          type: "pie",
          radius: "50%",
          data: n,
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "rgba(0, 0, 0, 0.5)"
            }
          }
        }
      ]
    };
  }
  buildScatterOption(r, t, e) {
    const n = r.map((i, a) => [i, t[a]]);
    return {
      ...e,
      xAxis: {
        type: "value"
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          type: "scatter",
          data: n
        }
      ]
    };
  }
  buildAreaOption(r, t, e) {
    return {
      ...e,
      xAxis: {
        type: "category",
        boundaryGap: !1,
        data: r
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          data: t,
          type: "line",
          areaStyle: {}
        }
      ]
    };
  }
  destroyChart() {
    this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.chart && (this.chart.dispose(), this.chart = null);
  }
  render() {
    return this.error ? ge`<div class="error">${this.error}</div>` : this.data ? this.data.row_count === 0 ? ge`<div class="no-data">No data available</div>` : ge`<div class="chart-container"></div>` : ge`<div class="loading">Loading chart...</div>`;
  }
};
qh.CHART_COLORS = [
  "#236aa4",
  // Deep blue
  "#45a1bf",
  // Teal
  "#a5cdee",
  // Light blue
  "#8dacbf",
  // Grayish blue
  "#85c7c6",
  // Cyan
  "#d2c6ac",
  // Tan
  "#f4b548",
  // Golden amber
  "#8f3d56",
  // Burgundy
  "#71b9f4",
  // Sky blue
  "#46a485"
  // Green
];
qh = eQ([
  Ts("lence-chart")
], qh);
const Ws = {
  fromAttribute: (r) => r === "true" || r === "",
  toAttribute: (r) => r ? "true" : "false"
};
var tQ = Object.defineProperty, rQ = Object.getOwnPropertyDescriptor, Us = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? rQ(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = (n ? o(t, e, i) : o(i)) || i);
  return n && i && tQ(t, e, i), i;
};
const Sg = [
  "#236aa4",
  // Deep blue
  "#45a1bf",
  // Teal
  "#a5cdee",
  // Light blue
  "#8dacbf",
  // Grayish blue
  "#85c7c6",
  // Cyan
  "#d2c6ac",
  // Tan
  "#f4b548",
  // Golden amber
  "#8f3d56",
  // Burgundy
  "#71b9f4",
  // Sky blue
  "#46a485"
  // Green
];
let na = class extends wr {
  constructor() {
    super(...arguments), this.x = "", this.y = "", this.title = "", this.stacked = !1, this.error = null, this.chart = null, this.resizeObserver = null;
  }
  firstUpdated() {
    var t;
    this.resizeObserver = new ResizeObserver(() => {
      var e;
      (e = this.chart) == null || e.resize();
    });
    const r = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".chart-container");
    r && this.resizeObserver.observe(r);
  }
  updated(r) {
    if (r.has("data") && this.data)
      try {
        this.error = null, this.renderChart();
      } catch (t) {
        this.error = t instanceof Error ? t.message : "Chart render failed", this.requestUpdate();
      }
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.destroyChart();
  }
  getColumnValues(r) {
    if (!this.data) return [];
    const t = this.data.columns.findIndex(
      (e) => e.name === r
    );
    if (t === -1)
      throw new Error(`Column not found: ${r}`);
    return this.data.data.map((e) => e[t]);
  }
  parseYColumns() {
    return this.y.split(",").map((r) => r.trim()).filter(Boolean);
  }
  renderChart() {
    var e;
    if (!this.data || !this.x || !this.y)
      return;
    const r = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".chart-container");
    if (!r) return;
    this.chart || (this.chart = z0(r));
    const t = this.buildAreaOption();
    this.chart.setOption(t, !0);
  }
  buildAreaOption() {
    const r = this.getColumnValues(this.x), t = this.parseYColumns(), e = t.map((i, a) => {
      const o = this.getColumnValues(i);
      return {
        name: i,
        type: "line",
        data: o,
        areaStyle: {
          opacity: 0.7
        },
        stack: this.stacked ? "total" : void 0,
        emphasis: {
          focus: "series"
        },
        smooth: !0,
        color: Sg[a % Sg.length]
      };
    }), n = t.length > 1;
    return {
      animation: !1,
      color: Sg,
      title: this.title ? {
        text: this.title,
        left: "center",
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif",
          fontWeight: 600,
          fontSize: 16,
          color: "#060606"
        }
      } : void 0,
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "cross",
          label: {
            backgroundColor: "#6a7985"
          }
        },
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif"
        }
      },
      legend: n ? {
        data: t,
        top: this.title ? 30 : 0,
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif",
          color: "#6b7280"
        }
      } : void 0,
      grid: {
        left: "3%",
        right: "4%",
        bottom: "3%",
        top: this.title ? n ? 80 : 50 : n ? 40 : 10,
        containLabel: !0
      },
      xAxis: {
        type: "category",
        boundaryGap: !1,
        data: r,
        axisLabel: {
          fontFamily: "Inter, system-ui, sans-serif",
          color: "#6b7280"
        }
      },
      yAxis: {
        type: "value",
        axisLabel: {
          fontFamily: "Inter, system-ui, sans-serif",
          color: "#6b7280"
        },
        splitLine: {
          lineStyle: {
            color: "#e5e7eb"
          }
        }
      },
      series: e,
      textStyle: {
        fontFamily: "Inter, system-ui, sans-serif",
        color: "#6b7280"
      }
    };
  }
  destroyChart() {
    this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.chart && (this.chart.dispose(), this.chart = null);
  }
  render() {
    return this.error ? ge`<div class="error">${this.error}</div>` : this.data ? this.data.row_count === 0 ? ge`<div class="no-data">No data available</div>` : ge`<div class="chart-container"></div>` : ge`<div class="loading">Loading chart...</div>`;
  }
};
na.styles = [
  oa,
  Nn`
      :host {
        display: block;
        height: var(--lence-chart-height);
        width: 100%;
        font-family: var(--lence-font-family);
      }

      .chart-container {
        width: 100%;
        height: 100%;
      }

      .loading {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }

      .error {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-negative);
        background: var(--lence-negative-bg);
        border: 1px solid var(--lence-negative);
        border-radius: var(--lence-radius);
        padding: 1rem;
      }

      .no-data {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }
    `
];
Us([
  Re({ type: String })
], na.prototype, "x", 2);
Us([
  Re({ type: String })
], na.prototype, "y", 2);
Us([
  Re({ type: String })
], na.prototype, "title", 2);
Us([
  Re({ converter: Ws })
], na.prototype, "stacked", 2);
Us([
  Re({ attribute: !1 })
], na.prototype, "data", 2);
na = Us([
  Ts("lence-area-chart")
], na);
/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */
function Hi(r, t) {
  return typeof r == "function" ? r(t) : r;
}
function Tr(r, t) {
  return (e) => {
    t.setState((n) => ({
      ...n,
      [r]: Hi(e, n[r])
    }));
  };
}
function Vv(r) {
  return r instanceof Function;
}
function nQ(r) {
  return Array.isArray(r) && r.every((t) => typeof t == "number");
}
function iQ(r, t) {
  const e = [], n = (i) => {
    i.forEach((a) => {
      e.push(a);
      const o = t(a);
      o != null && o.length && n(o);
    });
  };
  return n(r), e;
}
function Ce(r, t, e) {
  let n = [], i;
  return (a) => {
    let o;
    e.key && e.debug && (o = Date.now());
    const s = r(a);
    if (!(s.length !== n.length || s.some((c, f) => n[f] !== c)))
      return i;
    n = s;
    let u;
    if (e.key && e.debug && (u = Date.now()), i = t(...s), e == null || e.onChange == null || e.onChange(i), e.key && e.debug && e != null && e.debug()) {
      const c = Math.round((Date.now() - o) * 100) / 100, f = Math.round((Date.now() - u) * 100) / 100, h = f / 16, v = (d, p) => {
        for (d = String(d); d.length < p; )
          d = " " + d;
        return d;
      };
      console.info(`%c⏱ ${v(f, 5)} /${v(c, 5)} ms`, `
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0, Math.min(120 - 120 * h, 120))}deg 100% 31%);`, e == null ? void 0 : e.key);
    }
    return i;
  };
}
function Ae(r, t, e, n) {
  return {
    debug: () => {
      var i;
      return (i = r == null ? void 0 : r.debugAll) != null ? i : r[t];
    },
    key: !1,
    onChange: n
  };
}
function aQ(r, t, e, n) {
  const i = () => {
    var o;
    return (o = a.getValue()) != null ? o : r.options.renderFallbackValue;
  }, a = {
    id: `${t.id}_${e.id}`,
    row: t,
    column: e,
    getValue: () => t.getValue(n),
    renderValue: i,
    getContext: Ce(() => [r, e, t, a], (o, s, l, u) => ({
      table: o,
      column: s,
      row: l,
      cell: u,
      getValue: u.getValue,
      renderValue: u.renderValue
    }), Ae(r.options, "debugCells"))
  };
  return r._features.forEach((o) => {
    o.createCell == null || o.createCell(a, e, t, r);
  }, {}), a;
}
function oQ(r, t, e, n) {
  var i, a;
  const s = {
    ...r._getDefaultColumnDef(),
    ...t
  }, l = s.accessorKey;
  let u = (i = (a = s.id) != null ? a : l ? typeof String.prototype.replaceAll == "function" ? l.replaceAll(".", "_") : l.replace(/\./g, "_") : void 0) != null ? i : typeof s.header == "string" ? s.header : void 0, c;
  if (s.accessorFn ? c = s.accessorFn : l && (l.includes(".") ? c = (h) => {
    let v = h;
    for (const p of l.split(".")) {
      var d;
      v = (d = v) == null ? void 0 : d[p];
    }
    return v;
  } : c = (h) => h[s.accessorKey]), !u)
    throw new Error();
  let f = {
    id: `${String(u)}`,
    accessorFn: c,
    parent: n,
    depth: e,
    columnDef: s,
    columns: [],
    getFlatColumns: Ce(() => [!0], () => {
      var h;
      return [f, ...(h = f.columns) == null ? void 0 : h.flatMap((v) => v.getFlatColumns())];
    }, Ae(r.options, "debugColumns")),
    getLeafColumns: Ce(() => [r._getOrderColumnsFn()], (h) => {
      var v;
      if ((v = f.columns) != null && v.length) {
        let d = f.columns.flatMap((p) => p.getLeafColumns());
        return h(d);
      }
      return [f];
    }, Ae(r.options, "debugColumns"))
  };
  for (const h of r._features)
    h.createColumn == null || h.createColumn(f, r);
  return f;
}
const $t = "debugHeaders";
function oD(r, t, e) {
  var n;
  let a = {
    id: (n = e.id) != null ? n : t.id,
    column: t,
    index: e.index,
    isPlaceholder: !!e.isPlaceholder,
    placeholderId: e.placeholderId,
    depth: e.depth,
    subHeaders: [],
    colSpan: 0,
    rowSpan: 0,
    headerGroup: null,
    getLeafHeaders: () => {
      const o = [], s = (l) => {
        l.subHeaders && l.subHeaders.length && l.subHeaders.map(s), o.push(l);
      };
      return s(a), o;
    },
    getContext: () => ({
      table: r,
      header: a,
      column: t
    })
  };
  return r._features.forEach((o) => {
    o.createHeader == null || o.createHeader(a, r);
  }), a;
}
const sQ = {
  createTable: (r) => {
    r.getHeaderGroups = Ce(() => [r.getAllColumns(), r.getVisibleLeafColumns(), r.getState().columnPinning.left, r.getState().columnPinning.right], (t, e, n, i) => {
      var a, o;
      const s = (a = n == null ? void 0 : n.map((f) => e.find((h) => h.id === f)).filter(Boolean)) != null ? a : [], l = (o = i == null ? void 0 : i.map((f) => e.find((h) => h.id === f)).filter(Boolean)) != null ? o : [], u = e.filter((f) => !(n != null && n.includes(f.id)) && !(i != null && i.includes(f.id)));
      return gf(t, [...s, ...u, ...l], r);
    }, Ae(r.options, $t)), r.getCenterHeaderGroups = Ce(() => [r.getAllColumns(), r.getVisibleLeafColumns(), r.getState().columnPinning.left, r.getState().columnPinning.right], (t, e, n, i) => (e = e.filter((a) => !(n != null && n.includes(a.id)) && !(i != null && i.includes(a.id))), gf(t, e, r, "center")), Ae(r.options, $t)), r.getLeftHeaderGroups = Ce(() => [r.getAllColumns(), r.getVisibleLeafColumns(), r.getState().columnPinning.left], (t, e, n) => {
      var i;
      const a = (i = n == null ? void 0 : n.map((o) => e.find((s) => s.id === o)).filter(Boolean)) != null ? i : [];
      return gf(t, a, r, "left");
    }, Ae(r.options, $t)), r.getRightHeaderGroups = Ce(() => [r.getAllColumns(), r.getVisibleLeafColumns(), r.getState().columnPinning.right], (t, e, n) => {
      var i;
      const a = (i = n == null ? void 0 : n.map((o) => e.find((s) => s.id === o)).filter(Boolean)) != null ? i : [];
      return gf(t, a, r, "right");
    }, Ae(r.options, $t)), r.getFooterGroups = Ce(() => [r.getHeaderGroups()], (t) => [...t].reverse(), Ae(r.options, $t)), r.getLeftFooterGroups = Ce(() => [r.getLeftHeaderGroups()], (t) => [...t].reverse(), Ae(r.options, $t)), r.getCenterFooterGroups = Ce(() => [r.getCenterHeaderGroups()], (t) => [...t].reverse(), Ae(r.options, $t)), r.getRightFooterGroups = Ce(() => [r.getRightHeaderGroups()], (t) => [...t].reverse(), Ae(r.options, $t)), r.getFlatHeaders = Ce(() => [r.getHeaderGroups()], (t) => t.map((e) => e.headers).flat(), Ae(r.options, $t)), r.getLeftFlatHeaders = Ce(() => [r.getLeftHeaderGroups()], (t) => t.map((e) => e.headers).flat(), Ae(r.options, $t)), r.getCenterFlatHeaders = Ce(() => [r.getCenterHeaderGroups()], (t) => t.map((e) => e.headers).flat(), Ae(r.options, $t)), r.getRightFlatHeaders = Ce(() => [r.getRightHeaderGroups()], (t) => t.map((e) => e.headers).flat(), Ae(r.options, $t)), r.getCenterLeafHeaders = Ce(() => [r.getCenterFlatHeaders()], (t) => t.filter((e) => {
      var n;
      return !((n = e.subHeaders) != null && n.length);
    }), Ae(r.options, $t)), r.getLeftLeafHeaders = Ce(() => [r.getLeftFlatHeaders()], (t) => t.filter((e) => {
      var n;
      return !((n = e.subHeaders) != null && n.length);
    }), Ae(r.options, $t)), r.getRightLeafHeaders = Ce(() => [r.getRightFlatHeaders()], (t) => t.filter((e) => {
      var n;
      return !((n = e.subHeaders) != null && n.length);
    }), Ae(r.options, $t)), r.getLeafHeaders = Ce(() => [r.getLeftHeaderGroups(), r.getCenterHeaderGroups(), r.getRightHeaderGroups()], (t, e, n) => {
      var i, a, o, s, l, u;
      return [...(i = (a = t[0]) == null ? void 0 : a.headers) != null ? i : [], ...(o = (s = e[0]) == null ? void 0 : s.headers) != null ? o : [], ...(l = (u = n[0]) == null ? void 0 : u.headers) != null ? l : []].map((c) => c.getLeafHeaders()).flat();
    }, Ae(r.options, $t));
  }
};
function gf(r, t, e, n) {
  var i, a;
  let o = 0;
  const s = function(h, v) {
    v === void 0 && (v = 1), o = Math.max(o, v), h.filter((d) => d.getIsVisible()).forEach((d) => {
      var p;
      (p = d.columns) != null && p.length && s(d.columns, v + 1);
    }, 0);
  };
  s(r);
  let l = [];
  const u = (h, v) => {
    const d = {
      depth: v,
      id: [n, `${v}`].filter(Boolean).join("_"),
      headers: []
    }, p = [];
    h.forEach((g) => {
      const m = [...p].reverse()[0], y = g.column.depth === d.depth;
      let _, b = !1;
      if (y && g.column.parent ? _ = g.column.parent : (_ = g.column, b = !0), m && (m == null ? void 0 : m.column) === _)
        m.subHeaders.push(g);
      else {
        const S = oD(e, _, {
          id: [n, v, _.id, g == null ? void 0 : g.id].filter(Boolean).join("_"),
          isPlaceholder: b,
          placeholderId: b ? `${p.filter((x) => x.column === _).length}` : void 0,
          depth: v,
          index: p.length
        });
        S.subHeaders.push(g), p.push(S);
      }
      d.headers.push(g), g.headerGroup = d;
    }), l.push(d), v > 0 && u(p, v - 1);
  }, c = t.map((h, v) => oD(e, h, {
    depth: o,
    index: v
  }));
  u(c, o - 1), l.reverse();
  const f = (h) => h.filter((d) => d.column.getIsVisible()).map((d) => {
    let p = 0, g = 0, m = [0];
    d.subHeaders && d.subHeaders.length ? (m = [], f(d.subHeaders).forEach((_) => {
      let {
        colSpan: b,
        rowSpan: S
      } = _;
      p += b, m.push(S);
    })) : p = 1;
    const y = Math.min(...m);
    return g = g + y, d.colSpan = p, d.rowSpan = g, {
      colSpan: p,
      rowSpan: g
    };
  });
  return f((i = (a = l[0]) == null ? void 0 : a.headers) != null ? i : []), l;
}
const Q_ = (r, t, e, n, i, a, o) => {
  let s = {
    id: t,
    index: n,
    original: e,
    depth: i,
    parentId: o,
    _valuesCache: {},
    _uniqueValuesCache: {},
    getValue: (l) => {
      if (s._valuesCache.hasOwnProperty(l))
        return s._valuesCache[l];
      const u = r.getColumn(l);
      if (u != null && u.accessorFn)
        return s._valuesCache[l] = u.accessorFn(s.original, n), s._valuesCache[l];
    },
    getUniqueValues: (l) => {
      if (s._uniqueValuesCache.hasOwnProperty(l))
        return s._uniqueValuesCache[l];
      const u = r.getColumn(l);
      if (u != null && u.accessorFn)
        return u.columnDef.getUniqueValues ? (s._uniqueValuesCache[l] = u.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[l]) : (s._uniqueValuesCache[l] = [s.getValue(l)], s._uniqueValuesCache[l]);
    },
    renderValue: (l) => {
      var u;
      return (u = s.getValue(l)) != null ? u : r.options.renderFallbackValue;
    },
    subRows: [],
    getLeafRows: () => iQ(s.subRows, (l) => l.subRows),
    getParentRow: () => s.parentId ? r.getRow(s.parentId, !0) : void 0,
    getParentRows: () => {
      let l = [], u = s;
      for (; ; ) {
        const c = u.getParentRow();
        if (!c) break;
        l.push(c), u = c;
      }
      return l.reverse();
    },
    getAllCells: Ce(() => [r.getAllLeafColumns()], (l) => l.map((u) => aQ(r, s, u, u.id)), Ae(r.options, "debugRows")),
    _getAllCellsByColumnId: Ce(() => [s.getAllCells()], (l) => l.reduce((u, c) => (u[c.column.id] = c, u), {}), Ae(r.options, "debugRows"))
  };
  for (let l = 0; l < r._features.length; l++) {
    const u = r._features[l];
    u == null || u.createRow == null || u.createRow(s, r);
  }
  return s;
}, lQ = {
  createColumn: (r, t) => {
    r._getFacetedRowModel = t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, r.id), r.getFacetedRowModel = () => r._getFacetedRowModel ? r._getFacetedRowModel() : t.getPreFilteredRowModel(), r._getFacetedUniqueValues = t.options.getFacetedUniqueValues && t.options.getFacetedUniqueValues(t, r.id), r.getFacetedUniqueValues = () => r._getFacetedUniqueValues ? r._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), r._getFacetedMinMaxValues = t.options.getFacetedMinMaxValues && t.options.getFacetedMinMaxValues(t, r.id), r.getFacetedMinMaxValues = () => {
      if (r._getFacetedMinMaxValues)
        return r._getFacetedMinMaxValues();
    };
  }
}, Ek = (r, t, e) => {
  var n, i;
  const a = e == null || (n = e.toString()) == null ? void 0 : n.toLowerCase();
  return !!(!((i = r.getValue(t)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(a));
};
Ek.autoRemove = (r) => on(r);
const Pk = (r, t, e) => {
  var n;
  return !!(!((n = r.getValue(t)) == null || (n = n.toString()) == null) && n.includes(e));
};
Pk.autoRemove = (r) => on(r);
const kk = (r, t, e) => {
  var n;
  return ((n = r.getValue(t)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (e == null ? void 0 : e.toLowerCase());
};
kk.autoRemove = (r) => on(r);
const Rk = (r, t, e) => {
  var n;
  return (n = r.getValue(t)) == null ? void 0 : n.includes(e);
};
Rk.autoRemove = (r) => on(r);
const Ok = (r, t, e) => !e.some((n) => {
  var i;
  return !((i = r.getValue(t)) != null && i.includes(n));
});
Ok.autoRemove = (r) => on(r) || !(r != null && r.length);
const Fk = (r, t, e) => e.some((n) => {
  var i;
  return (i = r.getValue(t)) == null ? void 0 : i.includes(n);
});
Fk.autoRemove = (r) => on(r) || !(r != null && r.length);
const Bk = (r, t, e) => r.getValue(t) === e;
Bk.autoRemove = (r) => on(r);
const Nk = (r, t, e) => r.getValue(t) == e;
Nk.autoRemove = (r) => on(r);
const e1 = (r, t, e) => {
  let [n, i] = e;
  const a = r.getValue(t);
  return a >= n && a <= i;
};
e1.resolveFilterValue = (r) => {
  let [t, e] = r, n = typeof t != "number" ? parseFloat(t) : t, i = typeof e != "number" ? parseFloat(e) : e, a = t === null || Number.isNaN(n) ? -1 / 0 : n, o = e === null || Number.isNaN(i) ? 1 / 0 : i;
  if (a > o) {
    const s = a;
    a = o, o = s;
  }
  return [a, o];
};
e1.autoRemove = (r) => on(r) || on(r[0]) && on(r[1]);
const Xn = {
  includesString: Ek,
  includesStringSensitive: Pk,
  equalsString: kk,
  arrIncludes: Rk,
  arrIncludesAll: Ok,
  arrIncludesSome: Fk,
  equals: Bk,
  weakEquals: Nk,
  inNumberRange: e1
};
function on(r) {
  return r == null || r === "";
}
const uQ = {
  getDefaultColumnDef: () => ({
    filterFn: "auto"
  }),
  getInitialState: (r) => ({
    columnFilters: [],
    ...r
  }),
  getDefaultOptions: (r) => ({
    onColumnFiltersChange: Tr("columnFilters", r),
    filterFromLeafRows: !1,
    maxLeafRowFilterDepth: 100
  }),
  createColumn: (r, t) => {
    r.getAutoFilterFn = () => {
      const e = t.getCoreRowModel().flatRows[0], n = e == null ? void 0 : e.getValue(r.id);
      return typeof n == "string" ? Xn.includesString : typeof n == "number" ? Xn.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? Xn.equals : Array.isArray(n) ? Xn.arrIncludes : Xn.weakEquals;
    }, r.getFilterFn = () => {
      var e, n;
      return Vv(r.columnDef.filterFn) ? r.columnDef.filterFn : r.columnDef.filterFn === "auto" ? r.getAutoFilterFn() : (
        // @ts-ignore
        (e = (n = t.options.filterFns) == null ? void 0 : n[r.columnDef.filterFn]) != null ? e : Xn[r.columnDef.filterFn]
      );
    }, r.getCanFilter = () => {
      var e, n, i;
      return ((e = r.columnDef.enableColumnFilter) != null ? e : !0) && ((n = t.options.enableColumnFilters) != null ? n : !0) && ((i = t.options.enableFilters) != null ? i : !0) && !!r.accessorFn;
    }, r.getIsFiltered = () => r.getFilterIndex() > -1, r.getFilterValue = () => {
      var e;
      return (e = t.getState().columnFilters) == null || (e = e.find((n) => n.id === r.id)) == null ? void 0 : e.value;
    }, r.getFilterIndex = () => {
      var e, n;
      return (e = (n = t.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === r.id)) != null ? e : -1;
    }, r.setFilterValue = (e) => {
      t.setColumnFilters((n) => {
        const i = r.getFilterFn(), a = n == null ? void 0 : n.find((c) => c.id === r.id), o = Hi(e, a ? a.value : void 0);
        if (sD(i, o, r)) {
          var s;
          return (s = n == null ? void 0 : n.filter((c) => c.id !== r.id)) != null ? s : [];
        }
        const l = {
          id: r.id,
          value: o
        };
        if (a) {
          var u;
          return (u = n == null ? void 0 : n.map((c) => c.id === r.id ? l : c)) != null ? u : [];
        }
        return n != null && n.length ? [...n, l] : [l];
      });
    };
  },
  createRow: (r, t) => {
    r.columnFilters = {}, r.columnFiltersMeta = {};
  },
  createTable: (r) => {
    r.setColumnFilters = (t) => {
      const e = r.getAllLeafColumns(), n = (i) => {
        var a;
        return (a = Hi(t, i)) == null ? void 0 : a.filter((o) => {
          const s = e.find((l) => l.id === o.id);
          if (s) {
            const l = s.getFilterFn();
            if (sD(l, o.value, s))
              return !1;
          }
          return !0;
        });
      };
      r.options.onColumnFiltersChange == null || r.options.onColumnFiltersChange(n);
    }, r.resetColumnFilters = (t) => {
      var e, n;
      r.setColumnFilters(t ? [] : (e = (n = r.initialState) == null ? void 0 : n.columnFilters) != null ? e : []);
    }, r.getPreFilteredRowModel = () => r.getCoreRowModel(), r.getFilteredRowModel = () => (!r._getFilteredRowModel && r.options.getFilteredRowModel && (r._getFilteredRowModel = r.options.getFilteredRowModel(r)), r.options.manualFiltering || !r._getFilteredRowModel ? r.getPreFilteredRowModel() : r._getFilteredRowModel());
  }
};
function sD(r, t, e) {
  return (r && r.autoRemove ? r.autoRemove(t, e) : !1) || typeof t > "u" || typeof t == "string" && !t;
}
const cQ = (r, t, e) => e.reduce((n, i) => {
  const a = i.getValue(r);
  return n + (typeof a == "number" ? a : 0);
}, 0), fQ = (r, t, e) => {
  let n;
  return e.forEach((i) => {
    const a = i.getValue(r);
    a != null && (n > a || n === void 0 && a >= a) && (n = a);
  }), n;
}, hQ = (r, t, e) => {
  let n;
  return e.forEach((i) => {
    const a = i.getValue(r);
    a != null && (n < a || n === void 0 && a >= a) && (n = a);
  }), n;
}, vQ = (r, t, e) => {
  let n, i;
  return e.forEach((a) => {
    const o = a.getValue(r);
    o != null && (n === void 0 ? o >= o && (n = i = o) : (n > o && (n = o), i < o && (i = o)));
  }), [n, i];
}, dQ = (r, t) => {
  let e = 0, n = 0;
  if (t.forEach((i) => {
    let a = i.getValue(r);
    a != null && (a = +a) >= a && (++e, n += a);
  }), e) return n / e;
}, pQ = (r, t) => {
  if (!t.length)
    return;
  const e = t.map((a) => a.getValue(r));
  if (!nQ(e))
    return;
  if (e.length === 1)
    return e[0];
  const n = Math.floor(e.length / 2), i = e.sort((a, o) => a - o);
  return e.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
}, gQ = (r, t) => Array.from(new Set(t.map((e) => e.getValue(r))).values()), mQ = (r, t) => new Set(t.map((e) => e.getValue(r))).size, yQ = (r, t) => t.length, xg = {
  sum: cQ,
  min: fQ,
  max: hQ,
  extent: vQ,
  mean: dQ,
  median: pQ,
  unique: gQ,
  uniqueCount: mQ,
  count: yQ
}, _Q = {
  getDefaultColumnDef: () => ({
    aggregatedCell: (r) => {
      var t, e;
      return (t = (e = r.getValue()) == null || e.toString == null ? void 0 : e.toString()) != null ? t : null;
    },
    aggregationFn: "auto"
  }),
  getInitialState: (r) => ({
    grouping: [],
    ...r
  }),
  getDefaultOptions: (r) => ({
    onGroupingChange: Tr("grouping", r),
    groupedColumnMode: "reorder"
  }),
  createColumn: (r, t) => {
    r.toggleGrouping = () => {
      t.setGrouping((e) => e != null && e.includes(r.id) ? e.filter((n) => n !== r.id) : [...e ?? [], r.id]);
    }, r.getCanGroup = () => {
      var e, n;
      return ((e = r.columnDef.enableGrouping) != null ? e : !0) && ((n = t.options.enableGrouping) != null ? n : !0) && (!!r.accessorFn || !!r.columnDef.getGroupingValue);
    }, r.getIsGrouped = () => {
      var e;
      return (e = t.getState().grouping) == null ? void 0 : e.includes(r.id);
    }, r.getGroupedIndex = () => {
      var e;
      return (e = t.getState().grouping) == null ? void 0 : e.indexOf(r.id);
    }, r.getToggleGroupingHandler = () => {
      const e = r.getCanGroup();
      return () => {
        e && r.toggleGrouping();
      };
    }, r.getAutoAggregationFn = () => {
      const e = t.getCoreRowModel().flatRows[0], n = e == null ? void 0 : e.getValue(r.id);
      if (typeof n == "number")
        return xg.sum;
      if (Object.prototype.toString.call(n) === "[object Date]")
        return xg.extent;
    }, r.getAggregationFn = () => {
      var e, n;
      if (!r)
        throw new Error();
      return Vv(r.columnDef.aggregationFn) ? r.columnDef.aggregationFn : r.columnDef.aggregationFn === "auto" ? r.getAutoAggregationFn() : (e = (n = t.options.aggregationFns) == null ? void 0 : n[r.columnDef.aggregationFn]) != null ? e : xg[r.columnDef.aggregationFn];
    };
  },
  createTable: (r) => {
    r.setGrouping = (t) => r.options.onGroupingChange == null ? void 0 : r.options.onGroupingChange(t), r.resetGrouping = (t) => {
      var e, n;
      r.setGrouping(t ? [] : (e = (n = r.initialState) == null ? void 0 : n.grouping) != null ? e : []);
    }, r.getPreGroupedRowModel = () => r.getFilteredRowModel(), r.getGroupedRowModel = () => (!r._getGroupedRowModel && r.options.getGroupedRowModel && (r._getGroupedRowModel = r.options.getGroupedRowModel(r)), r.options.manualGrouping || !r._getGroupedRowModel ? r.getPreGroupedRowModel() : r._getGroupedRowModel());
  },
  createRow: (r, t) => {
    r.getIsGrouped = () => !!r.groupingColumnId, r.getGroupingValue = (e) => {
      if (r._groupingValuesCache.hasOwnProperty(e))
        return r._groupingValuesCache[e];
      const n = t.getColumn(e);
      return n != null && n.columnDef.getGroupingValue ? (r._groupingValuesCache[e] = n.columnDef.getGroupingValue(r.original), r._groupingValuesCache[e]) : r.getValue(e);
    }, r._groupingValuesCache = {};
  },
  createCell: (r, t, e, n) => {
    r.getIsGrouped = () => t.getIsGrouped() && t.id === e.groupingColumnId, r.getIsPlaceholder = () => !r.getIsGrouped() && t.getIsGrouped(), r.getIsAggregated = () => {
      var i;
      return !r.getIsGrouped() && !r.getIsPlaceholder() && !!((i = e.subRows) != null && i.length);
    };
  }
};
function bQ(r, t, e) {
  if (!(t != null && t.length) || !e)
    return r;
  const n = r.filter((a) => !t.includes(a.id));
  return e === "remove" ? n : [...t.map((a) => r.find((o) => o.id === a)).filter(Boolean), ...n];
}
const SQ = {
  getInitialState: (r) => ({
    columnOrder: [],
    ...r
  }),
  getDefaultOptions: (r) => ({
    onColumnOrderChange: Tr("columnOrder", r)
  }),
  createColumn: (r, t) => {
    r.getIndex = Ce((e) => [iu(t, e)], (e) => e.findIndex((n) => n.id === r.id), Ae(t.options, "debugColumns")), r.getIsFirstColumn = (e) => {
      var n;
      return ((n = iu(t, e)[0]) == null ? void 0 : n.id) === r.id;
    }, r.getIsLastColumn = (e) => {
      var n;
      const i = iu(t, e);
      return ((n = i[i.length - 1]) == null ? void 0 : n.id) === r.id;
    };
  },
  createTable: (r) => {
    r.setColumnOrder = (t) => r.options.onColumnOrderChange == null ? void 0 : r.options.onColumnOrderChange(t), r.resetColumnOrder = (t) => {
      var e;
      r.setColumnOrder(t ? [] : (e = r.initialState.columnOrder) != null ? e : []);
    }, r._getOrderColumnsFn = Ce(() => [r.getState().columnOrder, r.getState().grouping, r.options.groupedColumnMode], (t, e, n) => (i) => {
      let a = [];
      if (!(t != null && t.length))
        a = i;
      else {
        const o = [...t], s = [...i];
        for (; s.length && o.length; ) {
          const l = o.shift(), u = s.findIndex((c) => c.id === l);
          u > -1 && a.push(s.splice(u, 1)[0]);
        }
        a = [...a, ...s];
      }
      return bQ(a, e, n);
    }, Ae(r.options, "debugTable"));
  }
}, wg = () => ({
  left: [],
  right: []
}), xQ = {
  getInitialState: (r) => ({
    columnPinning: wg(),
    ...r
  }),
  getDefaultOptions: (r) => ({
    onColumnPinningChange: Tr("columnPinning", r)
  }),
  createColumn: (r, t) => {
    r.pin = (e) => {
      const n = r.getLeafColumns().map((i) => i.id).filter(Boolean);
      t.setColumnPinning((i) => {
        var a, o;
        if (e === "right") {
          var s, l;
          return {
            left: ((s = i == null ? void 0 : i.left) != null ? s : []).filter((f) => !(n != null && n.includes(f))),
            right: [...((l = i == null ? void 0 : i.right) != null ? l : []).filter((f) => !(n != null && n.includes(f))), ...n]
          };
        }
        if (e === "left") {
          var u, c;
          return {
            left: [...((u = i == null ? void 0 : i.left) != null ? u : []).filter((f) => !(n != null && n.includes(f))), ...n],
            right: ((c = i == null ? void 0 : i.right) != null ? c : []).filter((f) => !(n != null && n.includes(f)))
          };
        }
        return {
          left: ((a = i == null ? void 0 : i.left) != null ? a : []).filter((f) => !(n != null && n.includes(f))),
          right: ((o = i == null ? void 0 : i.right) != null ? o : []).filter((f) => !(n != null && n.includes(f)))
        };
      });
    }, r.getCanPin = () => r.getLeafColumns().some((n) => {
      var i, a, o;
      return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((a = (o = t.options.enableColumnPinning) != null ? o : t.options.enablePinning) != null ? a : !0);
    }), r.getIsPinned = () => {
      const e = r.getLeafColumns().map((s) => s.id), {
        left: n,
        right: i
      } = t.getState().columnPinning, a = e.some((s) => n == null ? void 0 : n.includes(s)), o = e.some((s) => i == null ? void 0 : i.includes(s));
      return a ? "left" : o ? "right" : !1;
    }, r.getPinnedIndex = () => {
      var e, n;
      const i = r.getIsPinned();
      return i ? (e = (n = t.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(r.id)) != null ? e : -1 : 0;
    };
  },
  createRow: (r, t) => {
    r.getCenterVisibleCells = Ce(() => [r._getAllVisibleCells(), t.getState().columnPinning.left, t.getState().columnPinning.right], (e, n, i) => {
      const a = [...n ?? [], ...i ?? []];
      return e.filter((o) => !a.includes(o.column.id));
    }, Ae(t.options, "debugRows")), r.getLeftVisibleCells = Ce(() => [r._getAllVisibleCells(), t.getState().columnPinning.left], (e, n) => (n ?? []).map((a) => e.find((o) => o.column.id === a)).filter(Boolean).map((a) => ({
      ...a,
      position: "left"
    })), Ae(t.options, "debugRows")), r.getRightVisibleCells = Ce(() => [r._getAllVisibleCells(), t.getState().columnPinning.right], (e, n) => (n ?? []).map((a) => e.find((o) => o.column.id === a)).filter(Boolean).map((a) => ({
      ...a,
      position: "right"
    })), Ae(t.options, "debugRows"));
  },
  createTable: (r) => {
    r.setColumnPinning = (t) => r.options.onColumnPinningChange == null ? void 0 : r.options.onColumnPinningChange(t), r.resetColumnPinning = (t) => {
      var e, n;
      return r.setColumnPinning(t ? wg() : (e = (n = r.initialState) == null ? void 0 : n.columnPinning) != null ? e : wg());
    }, r.getIsSomeColumnsPinned = (t) => {
      var e;
      const n = r.getState().columnPinning;
      if (!t) {
        var i, a;
        return !!((i = n.left) != null && i.length || (a = n.right) != null && a.length);
      }
      return !!((e = n[t]) != null && e.length);
    }, r.getLeftLeafColumns = Ce(() => [r.getAllLeafColumns(), r.getState().columnPinning.left], (t, e) => (e ?? []).map((n) => t.find((i) => i.id === n)).filter(Boolean), Ae(r.options, "debugColumns")), r.getRightLeafColumns = Ce(() => [r.getAllLeafColumns(), r.getState().columnPinning.right], (t, e) => (e ?? []).map((n) => t.find((i) => i.id === n)).filter(Boolean), Ae(r.options, "debugColumns")), r.getCenterLeafColumns = Ce(() => [r.getAllLeafColumns(), r.getState().columnPinning.left, r.getState().columnPinning.right], (t, e, n) => {
      const i = [...e ?? [], ...n ?? []];
      return t.filter((a) => !i.includes(a.id));
    }, Ae(r.options, "debugColumns"));
  }
};
function wQ(r) {
  return r || (typeof document < "u" ? document : null);
}
const mf = {
  size: 150,
  minSize: 20,
  maxSize: Number.MAX_SAFE_INTEGER
}, Cg = () => ({
  startOffset: null,
  startSize: null,
  deltaOffset: null,
  deltaPercentage: null,
  isResizingColumn: !1,
  columnSizingStart: []
}), CQ = {
  getDefaultColumnDef: () => mf,
  getInitialState: (r) => ({
    columnSizing: {},
    columnSizingInfo: Cg(),
    ...r
  }),
  getDefaultOptions: (r) => ({
    columnResizeMode: "onEnd",
    columnResizeDirection: "ltr",
    onColumnSizingChange: Tr("columnSizing", r),
    onColumnSizingInfoChange: Tr("columnSizingInfo", r)
  }),
  createColumn: (r, t) => {
    r.getSize = () => {
      var e, n, i;
      const a = t.getState().columnSizing[r.id];
      return Math.min(Math.max((e = r.columnDef.minSize) != null ? e : mf.minSize, (n = a ?? r.columnDef.size) != null ? n : mf.size), (i = r.columnDef.maxSize) != null ? i : mf.maxSize);
    }, r.getStart = Ce((e) => [e, iu(t, e), t.getState().columnSizing], (e, n) => n.slice(0, r.getIndex(e)).reduce((i, a) => i + a.getSize(), 0), Ae(t.options, "debugColumns")), r.getAfter = Ce((e) => [e, iu(t, e), t.getState().columnSizing], (e, n) => n.slice(r.getIndex(e) + 1).reduce((i, a) => i + a.getSize(), 0), Ae(t.options, "debugColumns")), r.resetSize = () => {
      t.setColumnSizing((e) => {
        let {
          [r.id]: n,
          ...i
        } = e;
        return i;
      });
    }, r.getCanResize = () => {
      var e, n;
      return ((e = r.columnDef.enableResizing) != null ? e : !0) && ((n = t.options.enableColumnResizing) != null ? n : !0);
    }, r.getIsResizing = () => t.getState().columnSizingInfo.isResizingColumn === r.id;
  },
  createHeader: (r, t) => {
    r.getSize = () => {
      let e = 0;
      const n = (i) => {
        if (i.subHeaders.length)
          i.subHeaders.forEach(n);
        else {
          var a;
          e += (a = i.column.getSize()) != null ? a : 0;
        }
      };
      return n(r), e;
    }, r.getStart = () => {
      if (r.index > 0) {
        const e = r.headerGroup.headers[r.index - 1];
        return e.getStart() + e.getSize();
      }
      return 0;
    }, r.getResizeHandler = (e) => {
      const n = t.getColumn(r.column.id), i = n == null ? void 0 : n.getCanResize();
      return (a) => {
        if (!n || !i || (a.persist == null || a.persist(), Ag(a) && a.touches && a.touches.length > 1))
          return;
        const o = r.getSize(), s = r ? r.getLeafHeaders().map((m) => [m.column.id, m.column.getSize()]) : [[n.id, n.getSize()]], l = Ag(a) ? Math.round(a.touches[0].clientX) : a.clientX, u = {}, c = (m, y) => {
          typeof y == "number" && (t.setColumnSizingInfo((_) => {
            var b, S;
            const x = t.options.columnResizeDirection === "rtl" ? -1 : 1, w = (y - ((b = _ == null ? void 0 : _.startOffset) != null ? b : 0)) * x, C = Math.max(w / ((S = _ == null ? void 0 : _.startSize) != null ? S : 0), -0.999999);
            return _.columnSizingStart.forEach((D) => {
              let [A, T] = D;
              u[A] = Math.round(Math.max(T + T * C, 0) * 100) / 100;
            }), {
              ..._,
              deltaOffset: w,
              deltaPercentage: C
            };
          }), (t.options.columnResizeMode === "onChange" || m === "end") && t.setColumnSizing((_) => ({
            ..._,
            ...u
          })));
        }, f = (m) => c("move", m), h = (m) => {
          c("end", m), t.setColumnSizingInfo((y) => ({
            ...y,
            isResizingColumn: !1,
            startOffset: null,
            startSize: null,
            deltaOffset: null,
            deltaPercentage: null,
            columnSizingStart: []
          }));
        }, v = wQ(e), d = {
          moveHandler: (m) => f(m.clientX),
          upHandler: (m) => {
            v == null || v.removeEventListener("mousemove", d.moveHandler), v == null || v.removeEventListener("mouseup", d.upHandler), h(m.clientX);
          }
        }, p = {
          moveHandler: (m) => (m.cancelable && (m.preventDefault(), m.stopPropagation()), f(m.touches[0].clientX), !1),
          upHandler: (m) => {
            var y;
            v == null || v.removeEventListener("touchmove", p.moveHandler), v == null || v.removeEventListener("touchend", p.upHandler), m.cancelable && (m.preventDefault(), m.stopPropagation()), h((y = m.touches[0]) == null ? void 0 : y.clientX);
          }
        }, g = AQ() ? {
          passive: !1
        } : !1;
        Ag(a) ? (v == null || v.addEventListener("touchmove", p.moveHandler, g), v == null || v.addEventListener("touchend", p.upHandler, g)) : (v == null || v.addEventListener("mousemove", d.moveHandler, g), v == null || v.addEventListener("mouseup", d.upHandler, g)), t.setColumnSizingInfo((m) => ({
          ...m,
          startOffset: l,
          startSize: o,
          deltaOffset: 0,
          deltaPercentage: 0,
          columnSizingStart: s,
          isResizingColumn: n.id
        }));
      };
    };
  },
  createTable: (r) => {
    r.setColumnSizing = (t) => r.options.onColumnSizingChange == null ? void 0 : r.options.onColumnSizingChange(t), r.setColumnSizingInfo = (t) => r.options.onColumnSizingInfoChange == null ? void 0 : r.options.onColumnSizingInfoChange(t), r.resetColumnSizing = (t) => {
      var e;
      r.setColumnSizing(t ? {} : (e = r.initialState.columnSizing) != null ? e : {});
    }, r.resetHeaderSizeInfo = (t) => {
      var e;
      r.setColumnSizingInfo(t ? Cg() : (e = r.initialState.columnSizingInfo) != null ? e : Cg());
    }, r.getTotalSize = () => {
      var t, e;
      return (t = (e = r.getHeaderGroups()[0]) == null ? void 0 : e.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? t : 0;
    }, r.getLeftTotalSize = () => {
      var t, e;
      return (t = (e = r.getLeftHeaderGroups()[0]) == null ? void 0 : e.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? t : 0;
    }, r.getCenterTotalSize = () => {
      var t, e;
      return (t = (e = r.getCenterHeaderGroups()[0]) == null ? void 0 : e.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? t : 0;
    }, r.getRightTotalSize = () => {
      var t, e;
      return (t = (e = r.getRightHeaderGroups()[0]) == null ? void 0 : e.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? t : 0;
    };
  }
};
let yf = null;
function AQ() {
  if (typeof yf == "boolean") return yf;
  let r = !1;
  try {
    const t = {
      get passive() {
        return r = !0, !1;
      }
    }, e = () => {
    };
    window.addEventListener("test", e, t), window.removeEventListener("test", e);
  } catch {
    r = !1;
  }
  return yf = r, yf;
}
function Ag(r) {
  return r.type === "touchstart";
}
const DQ = {
  getInitialState: (r) => ({
    columnVisibility: {},
    ...r
  }),
  getDefaultOptions: (r) => ({
    onColumnVisibilityChange: Tr("columnVisibility", r)
  }),
  createColumn: (r, t) => {
    r.toggleVisibility = (e) => {
      r.getCanHide() && t.setColumnVisibility((n) => ({
        ...n,
        [r.id]: e ?? !r.getIsVisible()
      }));
    }, r.getIsVisible = () => {
      var e, n;
      const i = r.columns;
      return (e = i.length ? i.some((a) => a.getIsVisible()) : (n = t.getState().columnVisibility) == null ? void 0 : n[r.id]) != null ? e : !0;
    }, r.getCanHide = () => {
      var e, n;
      return ((e = r.columnDef.enableHiding) != null ? e : !0) && ((n = t.options.enableHiding) != null ? n : !0);
    }, r.getToggleVisibilityHandler = () => (e) => {
      r.toggleVisibility == null || r.toggleVisibility(e.target.checked);
    };
  },
  createRow: (r, t) => {
    r._getAllVisibleCells = Ce(() => [r.getAllCells(), t.getState().columnVisibility], (e) => e.filter((n) => n.column.getIsVisible()), Ae(t.options, "debugRows")), r.getVisibleCells = Ce(() => [r.getLeftVisibleCells(), r.getCenterVisibleCells(), r.getRightVisibleCells()], (e, n, i) => [...e, ...n, ...i], Ae(t.options, "debugRows"));
  },
  createTable: (r) => {
    const t = (e, n) => Ce(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((a) => a.getIsVisible == null ? void 0 : a.getIsVisible()), Ae(r.options, "debugColumns"));
    r.getVisibleFlatColumns = t("getVisibleFlatColumns", () => r.getAllFlatColumns()), r.getVisibleLeafColumns = t("getVisibleLeafColumns", () => r.getAllLeafColumns()), r.getLeftVisibleLeafColumns = t("getLeftVisibleLeafColumns", () => r.getLeftLeafColumns()), r.getRightVisibleLeafColumns = t("getRightVisibleLeafColumns", () => r.getRightLeafColumns()), r.getCenterVisibleLeafColumns = t("getCenterVisibleLeafColumns", () => r.getCenterLeafColumns()), r.setColumnVisibility = (e) => r.options.onColumnVisibilityChange == null ? void 0 : r.options.onColumnVisibilityChange(e), r.resetColumnVisibility = (e) => {
      var n;
      r.setColumnVisibility(e ? {} : (n = r.initialState.columnVisibility) != null ? n : {});
    }, r.toggleAllColumnsVisible = (e) => {
      var n;
      e = (n = e) != null ? n : !r.getIsAllColumnsVisible(), r.setColumnVisibility(r.getAllLeafColumns().reduce((i, a) => ({
        ...i,
        [a.id]: e || !(a.getCanHide != null && a.getCanHide())
      }), {}));
    }, r.getIsAllColumnsVisible = () => !r.getAllLeafColumns().some((e) => !(e.getIsVisible != null && e.getIsVisible())), r.getIsSomeColumnsVisible = () => r.getAllLeafColumns().some((e) => e.getIsVisible == null ? void 0 : e.getIsVisible()), r.getToggleAllColumnsVisibilityHandler = () => (e) => {
      var n;
      r.toggleAllColumnsVisible((n = e.target) == null ? void 0 : n.checked);
    };
  }
};
function iu(r, t) {
  return t ? t === "center" ? r.getCenterVisibleLeafColumns() : t === "left" ? r.getLeftVisibleLeafColumns() : r.getRightVisibleLeafColumns() : r.getVisibleLeafColumns();
}
const TQ = {
  createTable: (r) => {
    r._getGlobalFacetedRowModel = r.options.getFacetedRowModel && r.options.getFacetedRowModel(r, "__global__"), r.getGlobalFacetedRowModel = () => r.options.manualFiltering || !r._getGlobalFacetedRowModel ? r.getPreFilteredRowModel() : r._getGlobalFacetedRowModel(), r._getGlobalFacetedUniqueValues = r.options.getFacetedUniqueValues && r.options.getFacetedUniqueValues(r, "__global__"), r.getGlobalFacetedUniqueValues = () => r._getGlobalFacetedUniqueValues ? r._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), r._getGlobalFacetedMinMaxValues = r.options.getFacetedMinMaxValues && r.options.getFacetedMinMaxValues(r, "__global__"), r.getGlobalFacetedMinMaxValues = () => {
      if (r._getGlobalFacetedMinMaxValues)
        return r._getGlobalFacetedMinMaxValues();
    };
  }
}, MQ = {
  getInitialState: (r) => ({
    globalFilter: void 0,
    ...r
  }),
  getDefaultOptions: (r) => ({
    onGlobalFilterChange: Tr("globalFilter", r),
    globalFilterFn: "auto",
    getColumnCanGlobalFilter: (t) => {
      var e;
      const n = (e = r.getCoreRowModel().flatRows[0]) == null || (e = e._getAllCellsByColumnId()[t.id]) == null ? void 0 : e.getValue();
      return typeof n == "string" || typeof n == "number";
    }
  }),
  createColumn: (r, t) => {
    r.getCanGlobalFilter = () => {
      var e, n, i, a;
      return ((e = r.columnDef.enableGlobalFilter) != null ? e : !0) && ((n = t.options.enableGlobalFilter) != null ? n : !0) && ((i = t.options.enableFilters) != null ? i : !0) && ((a = t.options.getColumnCanGlobalFilter == null ? void 0 : t.options.getColumnCanGlobalFilter(r)) != null ? a : !0) && !!r.accessorFn;
    };
  },
  createTable: (r) => {
    r.getGlobalAutoFilterFn = () => Xn.includesString, r.getGlobalFilterFn = () => {
      var t, e;
      const {
        globalFilterFn: n
      } = r.options;
      return Vv(n) ? n : n === "auto" ? r.getGlobalAutoFilterFn() : (t = (e = r.options.filterFns) == null ? void 0 : e[n]) != null ? t : Xn[n];
    }, r.setGlobalFilter = (t) => {
      r.options.onGlobalFilterChange == null || r.options.onGlobalFilterChange(t);
    }, r.resetGlobalFilter = (t) => {
      r.setGlobalFilter(t ? void 0 : r.initialState.globalFilter);
    };
  }
}, IQ = {
  getInitialState: (r) => ({
    expanded: {},
    ...r
  }),
  getDefaultOptions: (r) => ({
    onExpandedChange: Tr("expanded", r),
    paginateExpandedRows: !0
  }),
  createTable: (r) => {
    let t = !1, e = !1;
    r._autoResetExpanded = () => {
      var n, i;
      if (!t) {
        r._queue(() => {
          t = !0;
        });
        return;
      }
      if ((n = (i = r.options.autoResetAll) != null ? i : r.options.autoResetExpanded) != null ? n : !r.options.manualExpanding) {
        if (e) return;
        e = !0, r._queue(() => {
          r.resetExpanded(), e = !1;
        });
      }
    }, r.setExpanded = (n) => r.options.onExpandedChange == null ? void 0 : r.options.onExpandedChange(n), r.toggleAllRowsExpanded = (n) => {
      n ?? !r.getIsAllRowsExpanded() ? r.setExpanded(!0) : r.setExpanded({});
    }, r.resetExpanded = (n) => {
      var i, a;
      r.setExpanded(n ? {} : (i = (a = r.initialState) == null ? void 0 : a.expanded) != null ? i : {});
    }, r.getCanSomeRowsExpand = () => r.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), r.getToggleAllRowsExpandedHandler = () => (n) => {
      n.persist == null || n.persist(), r.toggleAllRowsExpanded();
    }, r.getIsSomeRowsExpanded = () => {
      const n = r.getState().expanded;
      return n === !0 || Object.values(n).some(Boolean);
    }, r.getIsAllRowsExpanded = () => {
      const n = r.getState().expanded;
      return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || r.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
    }, r.getExpandedDepth = () => {
      let n = 0;
      return (r.getState().expanded === !0 ? Object.keys(r.getRowModel().rowsById) : Object.keys(r.getState().expanded)).forEach((a) => {
        const o = a.split(".");
        n = Math.max(n, o.length);
      }), n;
    }, r.getPreExpandedRowModel = () => r.getSortedRowModel(), r.getExpandedRowModel = () => (!r._getExpandedRowModel && r.options.getExpandedRowModel && (r._getExpandedRowModel = r.options.getExpandedRowModel(r)), r.options.manualExpanding || !r._getExpandedRowModel ? r.getPreExpandedRowModel() : r._getExpandedRowModel());
  },
  createRow: (r, t) => {
    r.toggleExpanded = (e) => {
      t.setExpanded((n) => {
        var i;
        const a = n === !0 ? !0 : !!(n != null && n[r.id]);
        let o = {};
        if (n === !0 ? Object.keys(t.getRowModel().rowsById).forEach((s) => {
          o[s] = !0;
        }) : o = n, e = (i = e) != null ? i : !a, !a && e)
          return {
            ...o,
            [r.id]: !0
          };
        if (a && !e) {
          const {
            [r.id]: s,
            ...l
          } = o;
          return l;
        }
        return n;
      });
    }, r.getIsExpanded = () => {
      var e;
      const n = t.getState().expanded;
      return !!((e = t.options.getIsRowExpanded == null ? void 0 : t.options.getIsRowExpanded(r)) != null ? e : n === !0 || n != null && n[r.id]);
    }, r.getCanExpand = () => {
      var e, n, i;
      return (e = t.options.getRowCanExpand == null ? void 0 : t.options.getRowCanExpand(r)) != null ? e : ((n = t.options.enableExpanding) != null ? n : !0) && !!((i = r.subRows) != null && i.length);
    }, r.getIsAllParentsExpanded = () => {
      let e = !0, n = r;
      for (; e && n.parentId; )
        n = t.getRow(n.parentId, !0), e = n.getIsExpanded();
      return e;
    }, r.getToggleExpandedHandler = () => {
      const e = r.getCanExpand();
      return () => {
        e && r.toggleExpanded();
      };
    };
  }
}, Cy = 0, Ay = 10, Dg = () => ({
  pageIndex: Cy,
  pageSize: Ay
}), LQ = {
  getInitialState: (r) => ({
    ...r,
    pagination: {
      ...Dg(),
      ...r == null ? void 0 : r.pagination
    }
  }),
  getDefaultOptions: (r) => ({
    onPaginationChange: Tr("pagination", r)
  }),
  createTable: (r) => {
    let t = !1, e = !1;
    r._autoResetPageIndex = () => {
      var n, i;
      if (!t) {
        r._queue(() => {
          t = !0;
        });
        return;
      }
      if ((n = (i = r.options.autoResetAll) != null ? i : r.options.autoResetPageIndex) != null ? n : !r.options.manualPagination) {
        if (e) return;
        e = !0, r._queue(() => {
          r.resetPageIndex(), e = !1;
        });
      }
    }, r.setPagination = (n) => {
      const i = (a) => Hi(n, a);
      return r.options.onPaginationChange == null ? void 0 : r.options.onPaginationChange(i);
    }, r.resetPagination = (n) => {
      var i;
      r.setPagination(n ? Dg() : (i = r.initialState.pagination) != null ? i : Dg());
    }, r.setPageIndex = (n) => {
      r.setPagination((i) => {
        let a = Hi(n, i.pageIndex);
        const o = typeof r.options.pageCount > "u" || r.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : r.options.pageCount - 1;
        return a = Math.max(0, Math.min(a, o)), {
          ...i,
          pageIndex: a
        };
      });
    }, r.resetPageIndex = (n) => {
      var i, a;
      r.setPageIndex(n ? Cy : (i = (a = r.initialState) == null || (a = a.pagination) == null ? void 0 : a.pageIndex) != null ? i : Cy);
    }, r.resetPageSize = (n) => {
      var i, a;
      r.setPageSize(n ? Ay : (i = (a = r.initialState) == null || (a = a.pagination) == null ? void 0 : a.pageSize) != null ? i : Ay);
    }, r.setPageSize = (n) => {
      r.setPagination((i) => {
        const a = Math.max(1, Hi(n, i.pageSize)), o = i.pageSize * i.pageIndex, s = Math.floor(o / a);
        return {
          ...i,
          pageIndex: s,
          pageSize: a
        };
      });
    }, r.setPageCount = (n) => r.setPagination((i) => {
      var a;
      let o = Hi(n, (a = r.options.pageCount) != null ? a : -1);
      return typeof o == "number" && (o = Math.max(-1, o)), {
        ...i,
        pageCount: o
      };
    }), r.getPageOptions = Ce(() => [r.getPageCount()], (n) => {
      let i = [];
      return n && n > 0 && (i = [...new Array(n)].fill(null).map((a, o) => o)), i;
    }, Ae(r.options, "debugTable")), r.getCanPreviousPage = () => r.getState().pagination.pageIndex > 0, r.getCanNextPage = () => {
      const {
        pageIndex: n
      } = r.getState().pagination, i = r.getPageCount();
      return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
    }, r.previousPage = () => r.setPageIndex((n) => n - 1), r.nextPage = () => r.setPageIndex((n) => n + 1), r.firstPage = () => r.setPageIndex(0), r.lastPage = () => r.setPageIndex(r.getPageCount() - 1), r.getPrePaginationRowModel = () => r.getExpandedRowModel(), r.getPaginationRowModel = () => (!r._getPaginationRowModel && r.options.getPaginationRowModel && (r._getPaginationRowModel = r.options.getPaginationRowModel(r)), r.options.manualPagination || !r._getPaginationRowModel ? r.getPrePaginationRowModel() : r._getPaginationRowModel()), r.getPageCount = () => {
      var n;
      return (n = r.options.pageCount) != null ? n : Math.ceil(r.getRowCount() / r.getState().pagination.pageSize);
    }, r.getRowCount = () => {
      var n;
      return (n = r.options.rowCount) != null ? n : r.getPrePaginationRowModel().rows.length;
    };
  }
}, Tg = () => ({
  top: [],
  bottom: []
}), EQ = {
  getInitialState: (r) => ({
    rowPinning: Tg(),
    ...r
  }),
  getDefaultOptions: (r) => ({
    onRowPinningChange: Tr("rowPinning", r)
  }),
  createRow: (r, t) => {
    r.pin = (e, n, i) => {
      const a = n ? r.getLeafRows().map((l) => {
        let {
          id: u
        } = l;
        return u;
      }) : [], o = i ? r.getParentRows().map((l) => {
        let {
          id: u
        } = l;
        return u;
      }) : [], s = /* @__PURE__ */ new Set([...o, r.id, ...a]);
      t.setRowPinning((l) => {
        var u, c;
        if (e === "bottom") {
          var f, h;
          return {
            top: ((f = l == null ? void 0 : l.top) != null ? f : []).filter((p) => !(s != null && s.has(p))),
            bottom: [...((h = l == null ? void 0 : l.bottom) != null ? h : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)]
          };
        }
        if (e === "top") {
          var v, d;
          return {
            top: [...((v = l == null ? void 0 : l.top) != null ? v : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)],
            bottom: ((d = l == null ? void 0 : l.bottom) != null ? d : []).filter((p) => !(s != null && s.has(p)))
          };
        }
        return {
          top: ((u = l == null ? void 0 : l.top) != null ? u : []).filter((p) => !(s != null && s.has(p))),
          bottom: ((c = l == null ? void 0 : l.bottom) != null ? c : []).filter((p) => !(s != null && s.has(p)))
        };
      });
    }, r.getCanPin = () => {
      var e;
      const {
        enableRowPinning: n,
        enablePinning: i
      } = t.options;
      return typeof n == "function" ? n(r) : (e = n ?? i) != null ? e : !0;
    }, r.getIsPinned = () => {
      const e = [r.id], {
        top: n,
        bottom: i
      } = t.getState().rowPinning, a = e.some((s) => n == null ? void 0 : n.includes(s)), o = e.some((s) => i == null ? void 0 : i.includes(s));
      return a ? "top" : o ? "bottom" : !1;
    }, r.getPinnedIndex = () => {
      var e, n;
      const i = r.getIsPinned();
      if (!i) return -1;
      const a = (e = i === "top" ? t.getTopRows() : t.getBottomRows()) == null ? void 0 : e.map((o) => {
        let {
          id: s
        } = o;
        return s;
      });
      return (n = a == null ? void 0 : a.indexOf(r.id)) != null ? n : -1;
    };
  },
  createTable: (r) => {
    r.setRowPinning = (t) => r.options.onRowPinningChange == null ? void 0 : r.options.onRowPinningChange(t), r.resetRowPinning = (t) => {
      var e, n;
      return r.setRowPinning(t ? Tg() : (e = (n = r.initialState) == null ? void 0 : n.rowPinning) != null ? e : Tg());
    }, r.getIsSomeRowsPinned = (t) => {
      var e;
      const n = r.getState().rowPinning;
      if (!t) {
        var i, a;
        return !!((i = n.top) != null && i.length || (a = n.bottom) != null && a.length);
      }
      return !!((e = n[t]) != null && e.length);
    }, r._getPinnedRows = (t, e, n) => {
      var i;
      return ((i = r.options.keepPinnedRows) == null || i ? (
        //get all rows that are pinned even if they would not be otherwise visible
        //account for expanded parent rows, but not pagination or filtering
        (e ?? []).map((o) => {
          const s = r.getRow(o, !0);
          return s.getIsAllParentsExpanded() ? s : null;
        })
      ) : (
        //else get only visible rows that are pinned
        (e ?? []).map((o) => t.find((s) => s.id === o))
      )).filter(Boolean).map((o) => ({
        ...o,
        position: n
      }));
    }, r.getTopRows = Ce(() => [r.getRowModel().rows, r.getState().rowPinning.top], (t, e) => r._getPinnedRows(t, e, "top"), Ae(r.options, "debugRows")), r.getBottomRows = Ce(() => [r.getRowModel().rows, r.getState().rowPinning.bottom], (t, e) => r._getPinnedRows(t, e, "bottom"), Ae(r.options, "debugRows")), r.getCenterRows = Ce(() => [r.getRowModel().rows, r.getState().rowPinning.top, r.getState().rowPinning.bottom], (t, e, n) => {
      const i = /* @__PURE__ */ new Set([...e ?? [], ...n ?? []]);
      return t.filter((a) => !i.has(a.id));
    }, Ae(r.options, "debugRows"));
  }
}, PQ = {
  getInitialState: (r) => ({
    rowSelection: {},
    ...r
  }),
  getDefaultOptions: (r) => ({
    onRowSelectionChange: Tr("rowSelection", r),
    enableRowSelection: !0,
    enableMultiRowSelection: !0,
    enableSubRowSelection: !0
    // enableGroupingRowSelection: false,
    // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
    // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
  }),
  createTable: (r) => {
    r.setRowSelection = (t) => r.options.onRowSelectionChange == null ? void 0 : r.options.onRowSelectionChange(t), r.resetRowSelection = (t) => {
      var e;
      return r.setRowSelection(t ? {} : (e = r.initialState.rowSelection) != null ? e : {});
    }, r.toggleAllRowsSelected = (t) => {
      r.setRowSelection((e) => {
        t = typeof t < "u" ? t : !r.getIsAllRowsSelected();
        const n = {
          ...e
        }, i = r.getPreGroupedRowModel().flatRows;
        return t ? i.forEach((a) => {
          a.getCanSelect() && (n[a.id] = !0);
        }) : i.forEach((a) => {
          delete n[a.id];
        }), n;
      });
    }, r.toggleAllPageRowsSelected = (t) => r.setRowSelection((e) => {
      const n = typeof t < "u" ? t : !r.getIsAllPageRowsSelected(), i = {
        ...e
      };
      return r.getRowModel().rows.forEach((a) => {
        Dy(i, a.id, n, !0, r);
      }), i;
    }), r.getPreSelectedRowModel = () => r.getCoreRowModel(), r.getSelectedRowModel = Ce(() => [r.getState().rowSelection, r.getCoreRowModel()], (t, e) => Object.keys(t).length ? Mg(r, e) : {
      rows: [],
      flatRows: [],
      rowsById: {}
    }, Ae(r.options, "debugTable")), r.getFilteredSelectedRowModel = Ce(() => [r.getState().rowSelection, r.getFilteredRowModel()], (t, e) => Object.keys(t).length ? Mg(r, e) : {
      rows: [],
      flatRows: [],
      rowsById: {}
    }, Ae(r.options, "debugTable")), r.getGroupedSelectedRowModel = Ce(() => [r.getState().rowSelection, r.getSortedRowModel()], (t, e) => Object.keys(t).length ? Mg(r, e) : {
      rows: [],
      flatRows: [],
      rowsById: {}
    }, Ae(r.options, "debugTable")), r.getIsAllRowsSelected = () => {
      const t = r.getFilteredRowModel().flatRows, {
        rowSelection: e
      } = r.getState();
      let n = !!(t.length && Object.keys(e).length);
      return n && t.some((i) => i.getCanSelect() && !e[i.id]) && (n = !1), n;
    }, r.getIsAllPageRowsSelected = () => {
      const t = r.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
        rowSelection: e
      } = r.getState();
      let n = !!t.length;
      return n && t.some((i) => !e[i.id]) && (n = !1), n;
    }, r.getIsSomeRowsSelected = () => {
      var t;
      const e = Object.keys((t = r.getState().rowSelection) != null ? t : {}).length;
      return e > 0 && e < r.getFilteredRowModel().flatRows.length;
    }, r.getIsSomePageRowsSelected = () => {
      const t = r.getPaginationRowModel().flatRows;
      return r.getIsAllPageRowsSelected() ? !1 : t.filter((e) => e.getCanSelect()).some((e) => e.getIsSelected() || e.getIsSomeSelected());
    }, r.getToggleAllRowsSelectedHandler = () => (t) => {
      r.toggleAllRowsSelected(t.target.checked);
    }, r.getToggleAllPageRowsSelectedHandler = () => (t) => {
      r.toggleAllPageRowsSelected(t.target.checked);
    };
  },
  createRow: (r, t) => {
    r.toggleSelected = (e, n) => {
      const i = r.getIsSelected();
      t.setRowSelection((a) => {
        var o;
        if (e = typeof e < "u" ? e : !i, r.getCanSelect() && i === e)
          return a;
        const s = {
          ...a
        };
        return Dy(s, r.id, e, (o = n == null ? void 0 : n.selectChildren) != null ? o : !0, t), s;
      });
    }, r.getIsSelected = () => {
      const {
        rowSelection: e
      } = t.getState();
      return t1(r, e);
    }, r.getIsSomeSelected = () => {
      const {
        rowSelection: e
      } = t.getState();
      return Ty(r, e) === "some";
    }, r.getIsAllSubRowsSelected = () => {
      const {
        rowSelection: e
      } = t.getState();
      return Ty(r, e) === "all";
    }, r.getCanSelect = () => {
      var e;
      return typeof t.options.enableRowSelection == "function" ? t.options.enableRowSelection(r) : (e = t.options.enableRowSelection) != null ? e : !0;
    }, r.getCanSelectSubRows = () => {
      var e;
      return typeof t.options.enableSubRowSelection == "function" ? t.options.enableSubRowSelection(r) : (e = t.options.enableSubRowSelection) != null ? e : !0;
    }, r.getCanMultiSelect = () => {
      var e;
      return typeof t.options.enableMultiRowSelection == "function" ? t.options.enableMultiRowSelection(r) : (e = t.options.enableMultiRowSelection) != null ? e : !0;
    }, r.getToggleSelectedHandler = () => {
      const e = r.getCanSelect();
      return (n) => {
        var i;
        e && r.toggleSelected((i = n.target) == null ? void 0 : i.checked);
      };
    };
  }
}, Dy = (r, t, e, n, i) => {
  var a;
  const o = i.getRow(t, !0);
  e ? (o.getCanMultiSelect() || Object.keys(r).forEach((s) => delete r[s]), o.getCanSelect() && (r[t] = !0)) : delete r[t], n && (a = o.subRows) != null && a.length && o.getCanSelectSubRows() && o.subRows.forEach((s) => Dy(r, s.id, e, n, i));
};
function Mg(r, t) {
  const e = r.getState().rowSelection, n = [], i = {}, a = function(o, s) {
    return o.map((l) => {
      var u;
      const c = t1(l, e);
      if (c && (n.push(l), i[l.id] = l), (u = l.subRows) != null && u.length && (l = {
        ...l,
        subRows: a(l.subRows)
      }), c)
        return l;
    }).filter(Boolean);
  };
  return {
    rows: a(t.rows),
    flatRows: n,
    rowsById: i
  };
}
function t1(r, t) {
  var e;
  return (e = t[r.id]) != null ? e : !1;
}
function Ty(r, t, e) {
  var n;
  if (!((n = r.subRows) != null && n.length)) return !1;
  let i = !0, a = !1;
  return r.subRows.forEach((o) => {
    if (!(a && !i) && (o.getCanSelect() && (t1(o, t) ? a = !0 : i = !1), o.subRows && o.subRows.length)) {
      const s = Ty(o, t);
      s === "all" ? a = !0 : (s === "some" && (a = !0), i = !1);
    }
  }), i ? "all" : a ? "some" : !1;
}
const My = /([0-9]+)/gm, kQ = (r, t, e) => zk(ia(r.getValue(e)).toLowerCase(), ia(t.getValue(e)).toLowerCase()), RQ = (r, t, e) => zk(ia(r.getValue(e)), ia(t.getValue(e))), OQ = (r, t, e) => r1(ia(r.getValue(e)).toLowerCase(), ia(t.getValue(e)).toLowerCase()), FQ = (r, t, e) => r1(ia(r.getValue(e)), ia(t.getValue(e))), BQ = (r, t, e) => {
  const n = r.getValue(e), i = t.getValue(e);
  return n > i ? 1 : n < i ? -1 : 0;
}, NQ = (r, t, e) => r1(r.getValue(e), t.getValue(e));
function r1(r, t) {
  return r === t ? 0 : r > t ? 1 : -1;
}
function ia(r) {
  return typeof r == "number" ? isNaN(r) || r === 1 / 0 || r === -1 / 0 ? "" : String(r) : typeof r == "string" ? r : "";
}
function zk(r, t) {
  const e = r.split(My).filter(Boolean), n = t.split(My).filter(Boolean);
  for (; e.length && n.length; ) {
    const i = e.shift(), a = n.shift(), o = parseInt(i, 10), s = parseInt(a, 10), l = [o, s].sort();
    if (isNaN(l[0])) {
      if (i > a)
        return 1;
      if (a > i)
        return -1;
      continue;
    }
    if (isNaN(l[1]))
      return isNaN(o) ? -1 : 1;
    if (o > s)
      return 1;
    if (s > o)
      return -1;
  }
  return e.length - n.length;
}
const Al = {
  alphanumeric: kQ,
  alphanumericCaseSensitive: RQ,
  text: OQ,
  textCaseSensitive: FQ,
  datetime: BQ,
  basic: NQ
}, zQ = {
  getInitialState: (r) => ({
    sorting: [],
    ...r
  }),
  getDefaultColumnDef: () => ({
    sortingFn: "auto",
    sortUndefined: 1
  }),
  getDefaultOptions: (r) => ({
    onSortingChange: Tr("sorting", r),
    isMultiSortEvent: (t) => t.shiftKey
  }),
  createColumn: (r, t) => {
    r.getAutoSortingFn = () => {
      const e = t.getFilteredRowModel().flatRows.slice(10);
      let n = !1;
      for (const i of e) {
        const a = i == null ? void 0 : i.getValue(r.id);
        if (Object.prototype.toString.call(a) === "[object Date]")
          return Al.datetime;
        if (typeof a == "string" && (n = !0, a.split(My).length > 1))
          return Al.alphanumeric;
      }
      return n ? Al.text : Al.basic;
    }, r.getAutoSortDir = () => {
      const e = t.getFilteredRowModel().flatRows[0];
      return typeof (e == null ? void 0 : e.getValue(r.id)) == "string" ? "asc" : "desc";
    }, r.getSortingFn = () => {
      var e, n;
      if (!r)
        throw new Error();
      return Vv(r.columnDef.sortingFn) ? r.columnDef.sortingFn : r.columnDef.sortingFn === "auto" ? r.getAutoSortingFn() : (e = (n = t.options.sortingFns) == null ? void 0 : n[r.columnDef.sortingFn]) != null ? e : Al[r.columnDef.sortingFn];
    }, r.toggleSorting = (e, n) => {
      const i = r.getNextSortingOrder(), a = typeof e < "u" && e !== null;
      t.setSorting((o) => {
        const s = o == null ? void 0 : o.find((v) => v.id === r.id), l = o == null ? void 0 : o.findIndex((v) => v.id === r.id);
        let u = [], c, f = a ? e : i === "desc";
        if (o != null && o.length && r.getCanMultiSort() && n ? s ? c = "toggle" : c = "add" : o != null && o.length && l !== o.length - 1 ? c = "replace" : s ? c = "toggle" : c = "replace", c === "toggle" && (a || i || (c = "remove")), c === "add") {
          var h;
          u = [...o, {
            id: r.id,
            desc: f
          }], u.splice(0, u.length - ((h = t.options.maxMultiSortColCount) != null ? h : Number.MAX_SAFE_INTEGER));
        } else c === "toggle" ? u = o.map((v) => v.id === r.id ? {
          ...v,
          desc: f
        } : v) : c === "remove" ? u = o.filter((v) => v.id !== r.id) : u = [{
          id: r.id,
          desc: f
        }];
        return u;
      });
    }, r.getFirstSortDir = () => {
      var e, n;
      return ((e = (n = r.columnDef.sortDescFirst) != null ? n : t.options.sortDescFirst) != null ? e : r.getAutoSortDir() === "desc") ? "desc" : "asc";
    }, r.getNextSortingOrder = (e) => {
      var n, i;
      const a = r.getFirstSortDir(), o = r.getIsSorted();
      return o ? o !== a && ((n = t.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
      (!(e && (i = t.options.enableMultiRemove) != null) || i) ? !1 : o === "desc" ? "asc" : "desc" : a;
    }, r.getCanSort = () => {
      var e, n;
      return ((e = r.columnDef.enableSorting) != null ? e : !0) && ((n = t.options.enableSorting) != null ? n : !0) && !!r.accessorFn;
    }, r.getCanMultiSort = () => {
      var e, n;
      return (e = (n = r.columnDef.enableMultiSort) != null ? n : t.options.enableMultiSort) != null ? e : !!r.accessorFn;
    }, r.getIsSorted = () => {
      var e;
      const n = (e = t.getState().sorting) == null ? void 0 : e.find((i) => i.id === r.id);
      return n ? n.desc ? "desc" : "asc" : !1;
    }, r.getSortIndex = () => {
      var e, n;
      return (e = (n = t.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === r.id)) != null ? e : -1;
    }, r.clearSorting = () => {
      t.setSorting((e) => e != null && e.length ? e.filter((n) => n.id !== r.id) : []);
    }, r.getToggleSortingHandler = () => {
      const e = r.getCanSort();
      return (n) => {
        e && (n.persist == null || n.persist(), r.toggleSorting == null || r.toggleSorting(void 0, r.getCanMultiSort() ? t.options.isMultiSortEvent == null ? void 0 : t.options.isMultiSortEvent(n) : !1));
      };
    };
  },
  createTable: (r) => {
    r.setSorting = (t) => r.options.onSortingChange == null ? void 0 : r.options.onSortingChange(t), r.resetSorting = (t) => {
      var e, n;
      r.setSorting(t ? [] : (e = (n = r.initialState) == null ? void 0 : n.sorting) != null ? e : []);
    }, r.getPreSortedRowModel = () => r.getGroupedRowModel(), r.getSortedRowModel = () => (!r._getSortedRowModel && r.options.getSortedRowModel && (r._getSortedRowModel = r.options.getSortedRowModel(r)), r.options.manualSorting || !r._getSortedRowModel ? r.getPreSortedRowModel() : r._getSortedRowModel());
  }
}, VQ = [
  sQ,
  DQ,
  SQ,
  xQ,
  lQ,
  uQ,
  TQ,
  //depends on ColumnFaceting
  MQ,
  //depends on ColumnFiltering
  zQ,
  _Q,
  //depends on RowSorting
  IQ,
  LQ,
  EQ,
  PQ,
  CQ
];
function $Q(r) {
  var t, e;
  const n = [...VQ, ...(t = r._features) != null ? t : []];
  let i = {
    _features: n
  };
  const a = i._features.reduce((h, v) => Object.assign(h, v.getDefaultOptions == null ? void 0 : v.getDefaultOptions(i)), {}), o = (h) => i.options.mergeOptions ? i.options.mergeOptions(a, h) : {
    ...a,
    ...h
  };
  let l = {
    ...{},
    ...(e = r.initialState) != null ? e : {}
  };
  i._features.forEach((h) => {
    var v;
    l = (v = h.getInitialState == null ? void 0 : h.getInitialState(l)) != null ? v : l;
  });
  const u = [];
  let c = !1;
  const f = {
    _features: n,
    options: {
      ...a,
      ...r
    },
    initialState: l,
    _queue: (h) => {
      u.push(h), c || (c = !0, Promise.resolve().then(() => {
        for (; u.length; )
          u.shift()();
        c = !1;
      }).catch((v) => setTimeout(() => {
        throw v;
      })));
    },
    reset: () => {
      i.setState(i.initialState);
    },
    setOptions: (h) => {
      const v = Hi(h, i.options);
      i.options = o(v);
    },
    getState: () => i.options.state,
    setState: (h) => {
      i.options.onStateChange == null || i.options.onStateChange(h);
    },
    _getRowId: (h, v, d) => {
      var p;
      return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(h, v, d)) != null ? p : `${d ? [d.id, v].join(".") : v}`;
    },
    getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
    // The final calls start at the bottom of the model,
    // expanded rows, which then work their way up
    getRowModel: () => i.getPaginationRowModel(),
    //in next version, we should just pass in the row model as the optional 2nd arg
    getRow: (h, v) => {
      let d = (v ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[h];
      if (!d && (d = i.getCoreRowModel().rowsById[h], !d))
        throw new Error();
      return d;
    },
    _getDefaultColumnDef: Ce(() => [i.options.defaultColumn], (h) => {
      var v;
      return h = (v = h) != null ? v : {}, {
        header: (d) => {
          const p = d.header.column.columnDef;
          return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
        },
        // footer: props => props.header.column.id,
        cell: (d) => {
          var p, g;
          return (p = (g = d.renderValue()) == null || g.toString == null ? void 0 : g.toString()) != null ? p : null;
        },
        ...i._features.reduce((d, p) => Object.assign(d, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
        ...h
      };
    }, Ae(r, "debugColumns")),
    _getColumnDefs: () => i.options.columns,
    getAllColumns: Ce(() => [i._getColumnDefs()], (h) => {
      const v = function(d, p, g) {
        return g === void 0 && (g = 0), d.map((m) => {
          const y = oQ(i, m, g, p), _ = m;
          return y.columns = _.columns ? v(_.columns, y, g + 1) : [], y;
        });
      };
      return v(h);
    }, Ae(r, "debugColumns")),
    getAllFlatColumns: Ce(() => [i.getAllColumns()], (h) => h.flatMap((v) => v.getFlatColumns()), Ae(r, "debugColumns")),
    _getAllFlatColumnsById: Ce(() => [i.getAllFlatColumns()], (h) => h.reduce((v, d) => (v[d.id] = d, v), {}), Ae(r, "debugColumns")),
    getAllLeafColumns: Ce(() => [i.getAllColumns(), i._getOrderColumnsFn()], (h, v) => {
      let d = h.flatMap((p) => p.getLeafColumns());
      return v(d);
    }, Ae(r, "debugColumns")),
    getColumn: (h) => i._getAllFlatColumnsById()[h]
  };
  Object.assign(i, f);
  for (let h = 0; h < i._features.length; h++) {
    const v = i._features[h];
    v == null || v.createTable == null || v.createTable(i);
  }
  return i;
}
function GQ() {
  return (r) => Ce(() => [r.options.data], (t) => {
    const e = {
      rows: [],
      flatRows: [],
      rowsById: {}
    }, n = function(i, a, o) {
      a === void 0 && (a = 0);
      const s = [];
      for (let u = 0; u < i.length; u++) {
        const c = Q_(r, r._getRowId(i[u], u, o), i[u], u, a, void 0, o == null ? void 0 : o.id);
        if (e.flatRows.push(c), e.rowsById[c.id] = c, s.push(c), r.options.getSubRows) {
          var l;
          c.originalSubRows = r.options.getSubRows(i[u], u), (l = c.originalSubRows) != null && l.length && (c.subRows = n(c.originalSubRows, a + 1, c));
        }
      }
      return s;
    };
    return e.rows = n(t), e;
  }, Ae(r.options, "debugTable", "getRowModel", () => r._autoResetPageIndex()));
}
function HQ(r) {
  const t = [], e = (n) => {
    var i;
    t.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(e);
  };
  return r.rows.forEach(e), {
    rows: t,
    flatRows: r.flatRows,
    rowsById: r.rowsById
  };
}
function qQ(r, t, e) {
  return e.options.filterFromLeafRows ? WQ(r, t, e) : UQ(r, t, e);
}
function WQ(r, t, e) {
  var n;
  const i = [], a = {}, o = (n = e.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(l, u) {
    u === void 0 && (u = 0);
    const c = [];
    for (let h = 0; h < l.length; h++) {
      var f;
      let v = l[h];
      const d = Q_(e, v.id, v.original, v.index, v.depth, void 0, v.parentId);
      if (d.columnFilters = v.columnFilters, (f = v.subRows) != null && f.length && u < o) {
        if (d.subRows = s(v.subRows, u + 1), v = d, t(v) && !d.subRows.length) {
          c.push(v), a[v.id] = v, i.push(v);
          continue;
        }
        if (t(v) || d.subRows.length) {
          c.push(v), a[v.id] = v, i.push(v);
          continue;
        }
      } else
        v = d, t(v) && (c.push(v), a[v.id] = v, i.push(v));
    }
    return c;
  };
  return {
    rows: s(r),
    flatRows: i,
    rowsById: a
  };
}
function UQ(r, t, e) {
  var n;
  const i = [], a = {}, o = (n = e.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(l, u) {
    u === void 0 && (u = 0);
    const c = [];
    for (let h = 0; h < l.length; h++) {
      let v = l[h];
      if (t(v)) {
        var f;
        if ((f = v.subRows) != null && f.length && u < o) {
          const p = Q_(e, v.id, v.original, v.index, v.depth, void 0, v.parentId);
          p.subRows = s(v.subRows, u + 1), v = p;
        }
        c.push(v), i.push(v), a[v.id] = v;
      }
    }
    return c;
  };
  return {
    rows: s(r),
    flatRows: i,
    rowsById: a
  };
}
function YQ() {
  return (r) => Ce(() => [r.getPreFilteredRowModel(), r.getState().columnFilters, r.getState().globalFilter], (t, e, n) => {
    if (!t.rows.length || !(e != null && e.length) && !n) {
      for (let h = 0; h < t.flatRows.length; h++)
        t.flatRows[h].columnFilters = {}, t.flatRows[h].columnFiltersMeta = {};
      return t;
    }
    const i = [], a = [];
    (e ?? []).forEach((h) => {
      var v;
      const d = r.getColumn(h.id);
      if (!d)
        return;
      const p = d.getFilterFn();
      p && i.push({
        id: h.id,
        filterFn: p,
        resolvedValue: (v = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(h.value)) != null ? v : h.value
      });
    });
    const o = (e ?? []).map((h) => h.id), s = r.getGlobalFilterFn(), l = r.getAllLeafColumns().filter((h) => h.getCanGlobalFilter());
    n && s && l.length && (o.push("__global__"), l.forEach((h) => {
      var v;
      a.push({
        id: h.id,
        filterFn: s,
        resolvedValue: (v = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? v : n
      });
    }));
    let u, c;
    for (let h = 0; h < t.flatRows.length; h++) {
      const v = t.flatRows[h];
      if (v.columnFilters = {}, i.length)
        for (let d = 0; d < i.length; d++) {
          u = i[d];
          const p = u.id;
          v.columnFilters[p] = u.filterFn(v, p, u.resolvedValue, (g) => {
            v.columnFiltersMeta[p] = g;
          });
        }
      if (a.length) {
        for (let d = 0; d < a.length; d++) {
          c = a[d];
          const p = c.id;
          if (c.filterFn(v, p, c.resolvedValue, (g) => {
            v.columnFiltersMeta[p] = g;
          })) {
            v.columnFilters.__global__ = !0;
            break;
          }
        }
        v.columnFilters.__global__ !== !0 && (v.columnFilters.__global__ = !1);
      }
    }
    const f = (h) => {
      for (let v = 0; v < o.length; v++)
        if (h.columnFilters[o[v]] === !1)
          return !1;
      return !0;
    };
    return qQ(t.rows, f, r);
  }, Ae(r.options, "debugTable", "getFilteredRowModel", () => r._autoResetPageIndex()));
}
function ZQ(r) {
  return (t) => Ce(() => [t.getState().pagination, t.getPrePaginationRowModel(), t.options.paginateExpandedRows ? void 0 : t.getState().expanded], (e, n) => {
    if (!n.rows.length)
      return n;
    const {
      pageSize: i,
      pageIndex: a
    } = e;
    let {
      rows: o,
      flatRows: s,
      rowsById: l
    } = n;
    const u = i * a, c = u + i;
    o = o.slice(u, c);
    let f;
    t.options.paginateExpandedRows ? f = {
      rows: o,
      flatRows: s,
      rowsById: l
    } : f = HQ({
      rows: o,
      flatRows: s,
      rowsById: l
    }), f.flatRows = [];
    const h = (v) => {
      f.flatRows.push(v), v.subRows.length && v.subRows.forEach(h);
    };
    return f.rows.forEach(h), f;
  }, Ae(t.options, "debugTable"));
}
function XQ() {
  return (r) => Ce(() => [r.getState().sorting, r.getPreSortedRowModel()], (t, e) => {
    if (!e.rows.length || !(t != null && t.length))
      return e;
    const n = r.getState().sorting, i = [], a = n.filter((l) => {
      var u;
      return (u = r.getColumn(l.id)) == null ? void 0 : u.getCanSort();
    }), o = {};
    a.forEach((l) => {
      const u = r.getColumn(l.id);
      u && (o[l.id] = {
        sortUndefined: u.columnDef.sortUndefined,
        invertSorting: u.columnDef.invertSorting,
        sortingFn: u.getSortingFn()
      });
    });
    const s = (l) => {
      const u = l.map((c) => ({
        ...c
      }));
      return u.sort((c, f) => {
        for (let v = 0; v < a.length; v += 1) {
          var h;
          const d = a[v], p = o[d.id], g = p.sortUndefined, m = (h = d == null ? void 0 : d.desc) != null ? h : !1;
          let y = 0;
          if (g) {
            const _ = c.getValue(d.id), b = f.getValue(d.id), S = _ === void 0, x = b === void 0;
            if (S || x) {
              if (g === "first") return S ? -1 : 1;
              if (g === "last") return S ? 1 : -1;
              y = S && x ? 0 : S ? g : -g;
            }
          }
          if (y === 0 && (y = p.sortingFn(c, f, d.id)), y !== 0)
            return m && (y *= -1), p.invertSorting && (y *= -1), y;
        }
        return c.index - f.index;
      }), u.forEach((c) => {
        var f;
        i.push(c), (f = c.subRows) != null && f.length && (c.subRows = s(c.subRows));
      }), u;
    };
    return {
      rows: s(e.rows),
      flatRows: i,
      rowsById: e.rowsById
    };
  }, Ae(r.options, "debugTable", "getSortedRowModel", () => r._autoResetPageIndex()));
}
/**
   * lit-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */
function lD(r, t) {
  return r ? typeof r == "function" ? r(t) : r : null;
}
class jQ {
  constructor(t) {
    Hv(this, "tableInstance", null);
    Hv(this, "_tableState", null);
    (this.host = t).addController(this);
  }
  table(t) {
    if (!this.tableInstance) {
      const e = {
        state: {},
        onStateChange: () => {
        },
        // noop
        renderFallbackValue: null,
        ...t
      };
      this.tableInstance = $Q(e), this._tableState = {
        ...this.tableInstance.initialState,
        ...t.state
      };
    }
    return this.tableInstance.setOptions((e) => ({
      ...e,
      ...t,
      state: {
        ...this._tableState,
        ...t.state
      },
      onStateChange: (n) => {
        this._tableState = n(this._tableState), this.host.requestUpdate(), t.onStateChange == null || t.onStateChange(n);
      }
    })), this.tableInstance;
  }
  hostDisconnected() {
  }
}
var KQ = Object.defineProperty, JQ = Object.getOwnPropertyDescriptor, mi = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? JQ(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = (n ? o(t, e, i) : o(i)) || i);
  return n && i && KQ(t, e, i), i;
};
let cn = class extends wr {
  constructor() {
    super(...arguments), this.query = "", this.search = !1, this.sort = !0, this.sorting = [], this.globalFilter = "", this.paginationState = {
      pageIndex: 0,
      pageSize: 10
    }, this.tableController = new jQ(this), this.coreRowModel = GQ(), this.sortedRowModel = XQ(), this.filteredRowModel = YQ(), this.paginationRowModel = ZQ(), this.cachedRowData = [], this.cachedColumns = [];
  }
  /**
   * Update cached data when data prop changes.
   */
  updateCachedData() {
    if (!this.data) {
      this.cachedRowData = [], this.cachedColumns = [];
      return;
    }
    this.cachedRowData = this.data.data.map((r) => {
      const t = {};
      return this.data.columns.forEach((e, n) => {
        t[e.name] = r[n];
      }), t;
    }), this.cachedColumns = this.data.columns.map((r) => ({
      accessorKey: r.name,
      header: r.name,
      cell: (t) => this.formatCell(t.getValue(), r.type),
      meta: {
        type: r.type,
        isNumeric: this.isNumericType(r.type)
      }
    }));
  }
  isNumericType(r) {
    return [
      "INTEGER",
      "BIGINT",
      "DOUBLE",
      "FLOAT",
      "DECIMAL",
      "NUMERIC",
      "REAL"
    ].some((e) => r.toUpperCase().includes(e));
  }
  formatCell(r, t) {
    if (r == null)
      return "";
    if (this.isNumericType(t)) {
      const e = Number(r);
      return Math.abs(e) >= 1e3 ? e.toLocaleString() : Number.isInteger(e) ? String(e) : e.toFixed(2);
    }
    return String(r);
  }
  handleSearchInput(r) {
    const t = r.target;
    this.globalFilter = t.value, this.paginationState = { ...this.paginationState, pageIndex: 0 };
  }
  willUpdate(r) {
    r.has("pagination") && this.pagination !== void 0 && (this.paginationState = {
      ...this.paginationState,
      pageSize: this.pagination,
      pageIndex: 0
    }), r.has("data") && (this.sorting = [], this.globalFilter = "", this.paginationState = {
      pageIndex: 0,
      pageSize: this.pagination || 10
    }, this.updateCachedData());
  }
  render() {
    if (!this.data)
      return ge`<div class="loading">Loading table...</div>`;
    if (this.data.row_count === 0)
      return ge`<div class="empty">No data available</div>`;
    const r = this.tableController.table({
      data: this.cachedRowData,
      columns: this.cachedColumns,
      state: {
        sorting: this.sorting,
        globalFilter: this.globalFilter,
        pagination: this.paginationState
      },
      onSortingChange: (e) => {
        this.sorting = typeof e == "function" ? e(this.sorting) : e;
      },
      onGlobalFilterChange: (e) => {
        this.globalFilter = typeof e == "function" ? e(this.globalFilter) : e;
      },
      onPaginationChange: (e) => {
        this.paginationState = typeof e == "function" ? e(this.paginationState) : e;
      },
      getCoreRowModel: this.coreRowModel,
      getSortedRowModel: this.sort ? this.sortedRowModel : void 0,
      getFilteredRowModel: this.search ? this.filteredRowModel : void 0,
      getPaginationRowModel: this.pagination ? this.paginationRowModel : void 0,
      enableSorting: this.sort,
      enableGlobalFilter: this.search
    }), t = this.pagination !== void 0 && this.pagination > 0;
    return ge`
      ${this.search ? ge`
            <div class="controls">
              <input
                type="text"
                class="search-input"
                placeholder="Search..."
                .value=${this.globalFilter}
                @input=${this.handleSearchInput}
              />
            </div>
          ` : ct}

      <div class="table-container">
        <table>
          <thead>
            ${r.getHeaderGroups().map(
      (e) => ge`
                <tr>
                  ${e.headers.map((n) => {
        const i = n.column.getCanSort(), a = n.column.getIsSorted();
        return n.column.columnDef.meta, ge`
                      <th
                        class=${i ? "sortable" : ""}
                        @click=${i ? () => n.column.toggleSorting() : ct}
                      >
                        ${lD(n.column.columnDef.header, n.getContext())}
                        ${this.sort ? ge`
                              <span class="sort-indicator">
                                <svg viewBox="0 0 8 6" class=${a === "asc" ? "active" : ""}>
                                  <path d="M4 0L8 6H0L4 0Z"/>
                                </svg>
                                <svg viewBox="0 0 8 6" class=${a === "desc" ? "active" : ""}>
                                  <path d="M4 6L0 0H8L4 6Z"/>
                                </svg>
                              </span>
                            ` : ct}
                      </th>
                    `;
      })}
                </tr>
              `
    )}
          </thead>
          <tbody>
            ${r.getRowModel().rows.map(
      (e) => ge`
                <tr>
                  ${e.getVisibleCells().map((n) => {
        const i = n.column.columnDef.meta;
        return ge`
                      <td class=${i != null && i.isNumeric ? "numeric" : ""}>
                        ${lD(n.column.columnDef.cell, n.getContext())}
                      </td>
                    `;
      })}
                </tr>
              `
    )}
          </tbody>
        </table>
      </div>

      ${t ? this.renderPagination(r) : ct}
    `;
  }
  renderPagination(r) {
    const t = r.getPageCount(), e = r.getState().pagination.pageIndex, n = r.getFilteredRowModel().rows.length, i = r.getState().pagination.pageSize, a = e * i + 1, o = Math.min((e + 1) * i, n), s = [], l = 5;
    let u = Math.max(0, e - Math.floor(l / 2)), c = Math.min(t, u + l);
    c - u < l && (u = Math.max(0, c - l));
    for (let f = u; f < c; f++)
      s.push(f);
    return ge`
      <div class="pagination">
        <span class="pagination-info">
          Showing ${a}-${o} of ${n} rows
        </span>

        <div class="pagination-buttons">
          <button
            class="pagination-btn"
            @click=${() => r.setPageIndex(0)}
            ?disabled=${!r.getCanPreviousPage()}
          >
            «
          </button>
          <button
            class="pagination-btn"
            @click=${() => r.previousPage()}
            ?disabled=${!r.getCanPreviousPage()}
          >
            ‹
          </button>

          ${s.map(
      (f) => ge`
              <button
                class="pagination-btn ${f === e ? "active" : ""}"
                @click=${() => r.setPageIndex(f)}
              >
                ${f + 1}
              </button>
            `
    )}

          <button
            class="pagination-btn"
            @click=${() => r.nextPage()}
            ?disabled=${!r.getCanNextPage()}
          >
            ›
          </button>
          <button
            class="pagination-btn"
            @click=${() => r.setPageIndex(t - 1)}
            ?disabled=${!r.getCanNextPage()}
          >
            »
          </button>
        </div>
      </div>
    `;
  }
};
cn.styles = [
  oa,
  Nn`
      :host {
        display: block;
        font-family: var(--lence-font-family);
        font-size: var(--lence-font-size-sm);
      }

      .table-container {
        overflow-x: auto;
      }

      .controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        gap: 1rem;
        flex-wrap: wrap;
      }

      .search-input {
        padding: 0.375rem 0.625rem;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        font-size: var(--lence-font-size-sm);
        min-width: 200px;
        background: var(--lence-bg);
        color: var(--lence-text);
      }

      .search-input:focus {
        outline: none;
        border-color: var(--lence-primary);
        box-shadow: 0 0 0 2px var(--lence-primary-bg);
      }

      .search-input::placeholder {
        color: var(--lence-text-muted);
      }

      table {
        width: 100%;
        border-collapse: collapse;
      }

      th,
      td {
        padding: 0.375rem 0.5rem;
        text-align: left;
        border-bottom: 1px solid var(--lence-border);
      }

      th {
        background: var(--lence-bg-subtle);
        font-weight: 500;
        font-size: var(--lence-font-size-xs);
        color: var(--lence-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        white-space: nowrap;
      }

      th.sortable {
        cursor: pointer;
        user-select: none;
      }

      th.sortable:hover {
        background: var(--lence-bg-muted);
      }

      th .sort-indicator {
        display: inline-flex;
        flex-direction: column;
        margin-left: 0.25rem;
        vertical-align: middle;
        gap: 1px;
      }

      th .sort-indicator svg {
        width: 8px;
        height: 6px;
        fill: var(--lence-text-muted);
        opacity: 0.5;
      }

      th .sort-indicator svg.active {
        fill: var(--lence-primary);
        opacity: 1;
      }

      tbody tr:hover {
        background: var(--lence-bg-subtle);
      }

      td {
        color: var(--lence-text);
      }

      td.numeric {
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-family: var(--lence-font-mono);
      }

      .pagination {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
      }

      .pagination-info {
        color: var(--lence-text-muted);
        font-size: var(--lence-font-size-xs);
      }

      .pagination-buttons {
        display: flex;
        gap: 0.25rem;
      }

      .pagination-btn {
        padding: 0.25rem 0.5rem;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        background: var(--lence-bg);
        color: var(--lence-text);
        font-size: var(--lence-font-size-xs);
        cursor: pointer;
        min-width: 2rem;
      }

      .pagination-btn:hover:not(:disabled) {
        background: var(--lence-bg-subtle);
        border-color: var(--lence-border-strong);
      }

      .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      .pagination-btn.active {
        background: var(--lence-primary);
        color: white;
        border-color: var(--lence-primary);
      }

      .page-size-select {
        padding: 0.25rem 0.375rem;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        font-size: var(--lence-font-size-xs);
        background: var(--lence-bg);
        color: var(--lence-text);
      }

      .loading,
      .empty {
        padding: 1.5rem;
        text-align: center;
        color: var(--lence-text-muted);
        font-size: var(--lence-font-size-sm);
      }
    `
];
mi([
  Re({ type: String })
], cn.prototype, "query", 2);
mi([
  Re({ attribute: !1 })
], cn.prototype, "data", 2);
mi([
  Re({ converter: Ws })
], cn.prototype, "search", 2);
mi([
  Re({ type: Number })
], cn.prototype, "pagination", 2);
mi([
  Re({ converter: Ws })
], cn.prototype, "sort", 2);
mi([
  Ve()
], cn.prototype, "sorting", 2);
mi([
  Ve()
], cn.prototype, "globalFilter", 2);
mi([
  Ve()
], cn.prototype, "paginationState", 2);
cn = mi([
  Ts("lence-data-table")
], cn);
var QQ = Object.defineProperty, eee = Object.getOwnPropertyDescriptor, Zr = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? eee(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = (n ? o(t, e, i) : o(i)) || i);
  return n && i && QQ(t, e, i), i;
};
const uD = 32, cD = 30, fD = 80, hD = 30, Dl = [
  "#236aa4",
  // Deep blue
  "#45a1bf",
  // Teal
  "#a5cdee",
  // Light blue
  "#8dacbf",
  // Grayish blue
  "#85c7c6",
  // Cyan
  "#d2c6ac",
  // Tan
  "#f4b548",
  // Golden amber
  "#8f3d56",
  // Burgundy
  "#71b9f4",
  // Sky blue
  "#46a485"
  // Green
];
function _f(r) {
  const t = r.match(/^([+-]?\d+)([dmy])$/i);
  if (t) {
    const e = parseInt(t[1], 10), n = t[2].toLowerCase(), i = /* @__PURE__ */ new Date();
    switch (n) {
      case "d":
        i.setDate(i.getDate() + e);
        break;
      case "m":
        i.setMonth(i.getMonth() + e);
        break;
      case "y":
        i.setFullYear(i.getFullYear() + e);
        break;
    }
    return i.getTime();
  }
  return new Date(r).getTime();
}
const tee = /^\$\{inputs\.(\w+)\.value\}$/;
let mr = class extends wr {
  constructor() {
    super(...arguments), this.query = "", this.label = "", this.start = "", this.end = "", this.title = "", this.url = "", this.showToday = !1, this.error = null, this.chart = null, this.resizeObserver = null;
  }
  /**
   * Extract input name from ${inputs.foo.value} syntax, or null if not a reference.
   */
  extractInputName(r) {
    if (!r) return null;
    const t = r.match(tee);
    return t ? t[1] : null;
  }
  connectedCallback() {
    super.connectedCallback(), this.unsubscribeInputs = Sr.onChange((r) => {
      const t = this.extractInputName(this.viewStart), e = this.extractInputName(this.viewEnd);
      (t === r || e === r) && this.data && this.renderChart();
    });
  }
  firstUpdated() {
    var t;
    this.resizeObserver = new ResizeObserver(() => {
      var e;
      (e = this.chart) == null || e.resize();
    });
    const r = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".chart-container");
    r && this.resizeObserver.observe(r);
  }
  updated(r) {
    if (r.has("data") && this.data)
      if (this.hasPendingInputDependency())
        requestAnimationFrame(() => {
          try {
            this.error = null, this.renderChart();
          } catch (e) {
            this.error = e instanceof Error ? e.message : "Chart render failed", this.requestUpdate();
          }
        });
      else
        try {
          this.error = null, this.renderChart();
        } catch (e) {
          this.error = e instanceof Error ? e.message : "Chart render failed", this.requestUpdate();
        }
  }
  /**
   * Check if we depend on an input that hasn't been set yet.
   */
  hasPendingInputDependency() {
    const r = this.extractInputName(this.viewStart), t = this.extractInputName(this.viewEnd);
    return !!(r && !Sr.get(r).value || t && !Sr.get(t).value);
  }
  disconnectedCallback() {
    var r;
    super.disconnectedCallback(), this.destroyChart(), (r = this.unsubscribeInputs) == null || r.call(this);
  }
  /**
   * Resolve a value that may be a literal or ${inputs.foo.value} reference.
   */
  resolveValue(r) {
    if (!r) return;
    const t = this.extractInputName(r);
    return t ? Sr.get(t).value ?? void 0 : r;
  }
  getColumnValues(r) {
    if (!this.data) return [];
    const t = this.data.columns.findIndex(
      (e) => e.name === r
    );
    if (t === -1)
      throw new Error(`Column not found: ${r}`);
    return this.data.data.map((e) => e[t]);
  }
  countValidItems() {
    if (!this.data) return 0;
    const r = this.getColumnValues(this.start), t = this.getColumnValues(this.end);
    let e = 0;
    for (let n = 0; n < r.length; n++)
      (r[n] != null || t[n] != null) && e++;
    return e;
  }
  calculateHeight() {
    const r = this.countValidItems(), t = this.title ? hD : 0, e = Math.max(
      100,
      // minimum height
      r * uD + cD + fD + t
    );
    return this.maxHeight && e > this.maxHeight ? { height: this.maxHeight, needsYScroll: !0 } : { height: e, needsYScroll: !1 };
  }
  renderChart() {
    var n;
    if (!this.data || !this.label || !this.start || !this.end)
      return;
    const r = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".chart-container");
    if (!r) return;
    const { height: t } = this.calculateHeight();
    r.style.height = `${t}px`, this.url && (r.style.cursor = "pointer"), this.chart ? this.chart.resize() : (this.chart = z0(r), this.chart.on("click", (i) => {
      var o;
      const a = i;
      (o = a.data) != null && o.url && window.open(a.data.url, "_blank");
    }));
    const e = this.buildGanttOption();
    this.chart.setOption(e, !0), queueMicrotask(() => this.applyViewRange());
  }
  applyViewRange() {
    if (!this.chart) return;
    const r = this.resolveValue(this.viewStart), t = this.resolveValue(this.viewEnd);
    !r && !t || (r && t ? this.chart.dispatchAction({
      type: "dataZoom",
      startValue: _f(r),
      endValue: _f(t)
    }) : r ? this.chart.dispatchAction({
      type: "dataZoom",
      startValue: _f(r),
      end: 100
    }) : t && this.chart.dispatchAction({
      type: "dataZoom",
      start: 0,
      endValue: _f(t)
    }));
  }
  buildGanttOption() {
    const { needsYScroll: r } = this.calculateHeight(), t = this.getColumnValues(this.label), e = this.getColumnValues(this.start), n = this.getColumnValues(this.end), i = this.url ? this.getColumnValues(this.url) : [], a = [];
    for (let p = 0; p < t.length; p++) {
      const g = e[p], m = n[p];
      g != null && a.push(new Date(g).getTime()), m != null && a.push(new Date(m).getTime());
    }
    if (a.length === 0)
      throw new Error("No valid dates found in data");
    const o = Math.min(...a), s = Math.max(...a), u = (s - o) * 0.05, c = o - u, f = s + u, h = [], v = [];
    let d = 0;
    for (let p = 0; p < t.length; p++) {
      const g = String(t[p] ?? ""), m = e[p], y = n[p];
      if (m == null && y == null)
        continue;
      h.push(g);
      const _ = m != null ? new Date(m).getTime() : c, b = y != null ? new Date(y).getTime() : f, S = m == null || y == null, x = {
        value: [d, _, b],
        name: g,
        itemStyle: {
          color: Dl[d % Dl.length],
          opacity: S ? 0.5 : 0.85
        }
      };
      i.length > 0 && i[p] != null && (x.url = String(i[p])), v.push(x), d++;
    }
    return {
      animation: !1,
      color: Dl,
      title: this.title ? {
        text: this.title,
        left: "center",
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif",
          fontWeight: 600,
          fontSize: 16,
          color: "#060606"
        }
      } : void 0,
      tooltip: {
        trigger: "item",
        formatter: (p) => {
          const g = p, m = new Date(g.value[1]), y = new Date(g.value[2]), _ = g.data.itemStyle.opacity < 0.8, b = (D) => D.toLocaleDateString("en-US", {
            year: "numeric",
            month: "short",
            day: "numeric"
          }), S = _ && g.value[1] === c ? "(open)" : b(m), x = _ && g.value[2] === f ? "(open)" : b(y), w = g.value[2] - g.value[1], C = Math.round(w / (1e3 * 60 * 60 * 24));
          return `
            <strong>${g.name}</strong><br/>
            Start: ${S}<br/>
            End: ${x}<br/>
            Duration: ${C} days
          `;
        },
        textStyle: {
          fontFamily: "Inter, system-ui, sans-serif"
        }
      },
      grid: {
        left: 10,
        right: r ? 50 : "5%",
        top: this.title ? 60 : 30,
        bottom: 70,
        containLabel: !1
      },
      dataZoom: [
        // X-axis slider (always present)
        {
          type: "slider",
          xAxisIndex: 0,
          filterMode: "none",
          height: 20,
          bottom: 10,
          borderColor: "transparent",
          backgroundColor: "#f3f4f6",
          fillerColor: "rgba(35, 106, 164, 0.15)",
          handleStyle: {
            color: "#236aa4",
            borderColor: "#236aa4"
          },
          moveHandleSize: 0,
          textStyle: {
            color: "#6b7280",
            fontSize: 10
          }
        },
        // Y-axis slider (only when content overflows maxHeight)
        ...r ? [{
          type: "slider",
          yAxisIndex: 0,
          filterMode: "none",
          width: 20,
          right: 10,
          borderColor: "transparent",
          backgroundColor: "#f3f4f6",
          fillerColor: "rgba(35, 106, 164, 0.15)",
          handleStyle: {
            color: "#236aa4",
            borderColor: "#236aa4"
          },
          moveHandleSize: 0,
          startValue: 0,
          endValue: Math.floor((this.maxHeight - cD - fD - (this.title ? hD : 0)) / uD) - 1
        }] : []
      ],
      xAxis: {
        type: "time",
        min: c,
        max: f,
        axisLabel: {
          fontFamily: "Inter, system-ui, sans-serif",
          color: "#6b7280"
        },
        splitLine: {
          show: !0,
          lineStyle: {
            color: "#e5e7eb"
          }
        }
      },
      yAxis: {
        type: "category",
        data: h,
        inverse: !0,
        axisLabel: {
          show: !1
        },
        axisTick: {
          show: !1
        },
        axisLine: {
          show: !1
        },
        splitLine: {
          show: !1
        }
      },
      series: [
        {
          type: "custom",
          renderItem: (p, g) => {
            var A, T;
            const m = g.value(0), y = g.coord([g.value(1), m]), _ = g.coord([g.value(2), m]), b = ((T = (A = g.size) == null ? void 0 : A.call(g, [0, 1])) == null ? void 0 : T[1]) * 0.6 || 20, S = _[0] - y[0], x = p.coordSys, w = bM(
              {
                x: y[0],
                y: y[1] - b / 2,
                width: S,
                height: b
              },
              {
                x: x.x,
                y: x.y,
                width: x.width,
                height: x.height
              }
            );
            if (!w) return null;
            const C = h[m] || "", D = g.style().fill || Dl[m % Dl.length];
            return {
              type: "group",
              children: [
                {
                  type: "rect",
                  shape: w,
                  style: {
                    ...g.style(),
                    fill: D
                  }
                },
                {
                  type: "text",
                  style: {
                    x: w.x + 6,
                    y: w.y + w.height / 2,
                    text: C,
                    fill: "#fff",
                    fontFamily: "Inter, system-ui, sans-serif",
                    fontSize: 12,
                    fontWeight: 500,
                    verticalAlign: "middle",
                    truncate: {
                      outerWidth: Math.max(0, w.width - 12),
                      ellipsis: "…"
                    }
                  }
                }
              ]
            };
          },
          encode: {
            x: [1, 2],
            y: 0
          },
          data: v,
          markLine: this.showToday ? {
            silent: !0,
            symbol: "none",
            lineStyle: {
              color: "#ef4444",
              width: 2,
              type: "solid"
            },
            label: {
              show: !0,
              position: "start",
              formatter: "Today",
              fontFamily: "Inter, system-ui, sans-serif",
              fontSize: 11,
              color: "#ef4444"
            },
            data: [
              {
                xAxis: (/* @__PURE__ */ new Date()).getTime()
              }
            ]
          } : void 0
        }
      ],
      textStyle: {
        fontFamily: "Inter, system-ui, sans-serif",
        color: "#6b7280"
      }
    };
  }
  destroyChart() {
    this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.chart && (this.chart.dispose(), this.chart = null);
  }
  render() {
    return this.error ? ge`<div class="error">${this.error}</div>` : this.data ? this.data.row_count === 0 ? ge`<div class="no-data">No data available</div>` : ge`<div class="chart-container"></div>` : ge`<div class="loading">Loading chart...</div>`;
  }
};
mr.styles = [
  oa,
  Nn`
      :host {
        display: block;
        width: 100%;
        font-family: var(--lence-font-family);
      }

      .chart-container {
        width: 100%;
      }

      .loading {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }

      .error {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-negative);
        background: var(--lence-negative-bg);
        border: 1px solid var(--lence-negative);
        border-radius: var(--lence-radius);
        padding: 1rem;
      }

      .no-data {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--lence-text-muted);
      }
    `
];
Zr([
  Re({ type: String })
], mr.prototype, "query", 2);
Zr([
  Re({ type: String })
], mr.prototype, "label", 2);
Zr([
  Re({ type: String })
], mr.prototype, "start", 2);
Zr([
  Re({ type: String })
], mr.prototype, "end", 2);
Zr([
  Re({ type: String })
], mr.prototype, "title", 2);
Zr([
  Re({ type: String })
], mr.prototype, "url", 2);
Zr([
  Re({ converter: Ws })
], mr.prototype, "showToday", 2);
Zr([
  Re({ type: String })
], mr.prototype, "viewStart", 2);
Zr([
  Re({ type: String })
], mr.prototype, "viewEnd", 2);
Zr([
  Re({ type: Number })
], mr.prototype, "maxHeight", 2);
Zr([
  Re({ attribute: !1 })
], mr.prototype, "data", 2);
mr = Zr([
  Ts("lence-gantt")
], mr);
var ree = Object.defineProperty, nee = Object.getOwnPropertyDescriptor, Mr = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? nee(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = (n ? o(t, e, i) : o(i)) || i);
  return n && i && ree(t, e, i), i;
};
let or = class extends wr {
  constructor() {
    super(...arguments), this.name = "", this.placeholder = "All", this.disableSelectAll = !1, this.options = [], this.selectedValue = null, this.initialized = !1;
  }
  willUpdate(r) {
    if (r.has("queryData") && this.queryData && (this.options = this.extractOptions(this.queryData)), !this.initialized && this.options.length > 0)
      if (this.initialized = !0, this.defaultValue !== void 0) {
        this.selectedValue = this.defaultValue;
        const t = this.options.find((e) => e.value === this.defaultValue);
        Sr.set(this.name, this.defaultValue, (t == null ? void 0 : t.label) ?? this.defaultValue);
      } else if (!this.disableSelectAll)
        this.selectedValue = "%", Sr.set(this.name, "%", this.placeholder);
      else {
        const t = this.options[0];
        this.selectedValue = t.value, Sr.set(this.name, t.value, t.label);
      }
  }
  extractOptions(r) {
    const t = this.value, e = this.label ?? this.value;
    if (!t) {
      if (r.columns.length === 0) return [];
      const n = r.columns[0].name;
      return this.extractColumnValues(r, n, n);
    }
    return this.extractColumnValues(r, t, e ?? t);
  }
  extractColumnValues(r, t, e) {
    const n = r.columns.findIndex((s) => s.name === t), i = r.columns.findIndex((s) => s.name === e);
    if (n === -1) return [];
    const a = /* @__PURE__ */ new Set(), o = [];
    for (const s of r.data) {
      const l = s[n];
      if (l == null) continue;
      const u = String(l);
      if (a.has(u)) continue;
      a.add(u);
      const c = i !== -1 ? String(s[i] ?? u) : u;
      o.push({ value: u, label: c });
    }
    return o;
  }
  handleChange(r) {
    const e = r.target.value || null;
    this.selectedValue = e;
    const n = e ? this.options.find((i) => i.value === e) : null;
    Sr.set(this.name, e, (n == null ? void 0 : n.label) ?? null);
  }
  render() {
    const r = this.data && !this.queryData, t = this.selectedValue ?? "%";
    return ge`
      <div class="dropdown-container">
        ${this.title ? ge`<label>${this.title}</label>` : null}
        ${r ? ge`<span class="loading">Loading...</span>` : ge`
              <select @change=${this.handleChange}>
                ${this.disableSelectAll ? null : ge`<option value="%" ?selected=${t === "%"}>${this.placeholder}</option>`}
                ${this.options.map(
      (e) => ge`
                    <option value=${e.value} ?selected=${e.value === t}>${e.label}</option>
                  `
    )}
              </select>
            `}
      </div>
    `;
  }
};
or.styles = [
  oa,
  Nn`
      :host {
        display: block;
        font-family: var(--lence-font-family);
        font-size: var(--lence-font-size-sm);
        margin: 0.75rem 0;
      }

      .dropdown-container {
        display: inline-flex;
        flex-direction: column;
        gap: 0.375rem;
      }

      label {
        font-size: var(--lence-font-size-xs);
        font-weight: 500;
        color: var(--lence-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
      }

      select {
        height: 2.125rem;
        padding: 0 2rem 0 0.75rem;
        font-size: var(--lence-font-size-sm);
        font-family: inherit;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        background: var(--lence-bg);
        color: var(--lence-text);
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.5rem center;
        min-width: 150px;
      }

      select:hover {
        border-color: var(--lence-border-hover);
      }

      select:focus {
        outline: none;
        border-color: var(--lence-primary);
        box-shadow: 0 0 0 2px var(--lence-primary-bg);
      }

      select:disabled {
        background: var(--lence-bg-subtle);
        color: var(--lence-text-muted);
        cursor: not-allowed;
      }

      .loading {
        color: var(--lence-text-muted);
        font-style: italic;
      }
    `
];
Mr([
  Re({ type: String })
], or.prototype, "name", 2);
Mr([
  Re({ type: String })
], or.prototype, "data", 2);
Mr([
  Re({ type: String })
], or.prototype, "value", 2);
Mr([
  Re({ type: String })
], or.prototype, "label", 2);
Mr([
  Re({ type: String })
], or.prototype, "title", 2);
Mr([
  Re({ type: String })
], or.prototype, "defaultValue", 2);
Mr([
  Re({ type: String })
], or.prototype, "placeholder", 2);
Mr([
  Re({ converter: Ws })
], or.prototype, "disableSelectAll", 2);
Mr([
  Re({ attribute: !1 })
], or.prototype, "queryData", 2);
Mr([
  Ve()
], or.prototype, "options", 2);
Mr([
  Ve()
], or.prototype, "selectedValue", 2);
Mr([
  Ve()
], or.prototype, "initialized", 2);
or = Mr([
  Ts("lence-dropdown")
], or);
var iee = Object.defineProperty, aee = Object.getOwnPropertyDescriptor, Io = (r, t, e, n) => {
  for (var i = n > 1 ? void 0 : n ? aee(t, e) : t, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = (n ? o(t, e, i) : o(i)) || i);
  return n && i && iee(t, e, i), i;
};
let vi = class extends wr {
  constructor() {
    super(...arguments), this.name = "", this.title = "", this.label = "", this.defaultValue = !1, this.checked = !1, this.initialized = !1;
  }
  connectedCallback() {
    super.connectedCallback(), this.initialized || (this.initialized = !0, this.checked = this.defaultValue, Sr.set(this.name, this.checked ? "true" : "false", this.checked ? "Yes" : "No"));
  }
  handleChange(r) {
    const t = r.target;
    this.checked = t.checked, Sr.set(this.name, this.checked ? "true" : "false", this.checked ? "Yes" : "No");
  }
  render() {
    const r = `checkbox-${this.name}`;
    return ge`
      <div class="checkbox-wrapper">
        ${this.title ? ge`<span class="title">${this.title}</span>` : null}
        <label class="checkbox-container" for=${r}>
          <span class="label">${this.label}</span>
          <input
            type="checkbox"
            id=${r}
            .checked=${this.checked}
            @change=${this.handleChange}
          />
        </label>
      </div>
    `;
  }
};
vi.styles = [
  oa,
  Nn`
      :host {
        display: block;
        font-family: var(--lence-font-family);
        font-size: var(--lence-font-size-sm);
        margin: 0.75rem 0;
      }

      .checkbox-wrapper {
        display: inline-flex;
        flex-direction: column;
        gap: 0.375rem;
      }

      .title {
        font-size: var(--lence-font-size-xs);
        font-weight: 500;
        color: var(--lence-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
      }

      .checkbox-container {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        height: 2.125rem;
        padding: 0 0.75rem;
        border: 1px solid var(--lence-border);
        border-radius: var(--lence-radius);
        background: var(--lence-bg);
        cursor: pointer;
        user-select: none;
        box-sizing: border-box;
      }

      .checkbox-container:hover {
        border-color: var(--lence-border-hover);
      }

      input[type="checkbox"] {
        width: 0.875rem;
        height: 0.875rem;
        margin: 0;
        cursor: pointer;
        accent-color: var(--lence-primary);
      }

      .label {
        font-size: var(--lence-font-size-sm);
        color: var(--lence-text);
        cursor: pointer;
      }
    `
];
Io([
  Re({ type: String })
], vi.prototype, "name", 2);
Io([
  Re({ type: String })
], vi.prototype, "title", 2);
Io([
  Re({ type: String })
], vi.prototype, "label", 2);
Io([
  Re({ converter: Ws })
], vi.prototype, "defaultValue", 2);
Io([
  Ve()
], vi.prototype, "checked", 2);
Io([
  Ve()
], vi.prototype, "initialized", 2);
vi = Io([
  Ts("lence-checkbox")
], vi);
var oee = Object.defineProperty, see = (r, t, e, n) => {
  for (var i = void 0, a = r.length - 1, o; a >= 0; a--)
    (o = r[a]) && (i = o(t, e, i) || i);
  return i && oee(t, e, i), i;
};
const o1 = class o1 extends wr {
  constructor() {
    super(...arguments), this.currentPath = "/";
  }
  connectedCallback() {
    super.connectedCallback();
    const t = r5();
    this.currentPath = t.getPath(), this.unsubscribeRouter = t.onRouteChange((e) => {
      this.currentPath = e;
    });
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.unsubscribeRouter && this.unsubscribeRouter();
  }
  render() {
    return ge`
      <lence-layout>
        <lence-page .path=${this.currentPath}></lence-page>
      </lence-layout>
    `;
  }
};
o1.styles = Nn`
    :host {
      display: block;
    }
  `;
let Wh = o1;
see([
  Ve()
], Wh.prototype, "currentPath");
customElements.define("lence-app", Wh);
console.log("Lence initialized");
export {
  Wh as LenceApp
};
